Skip to content

Commit

Permalink
fix: fix testbed findBody function
Browse files Browse the repository at this point in the history
  • Loading branch information
zOadT committed Aug 6, 2023
1 parent 0d4e725 commit 886dadc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions testbed/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,11 @@ function findBody(world: World, point: Point) {
let body: Body | null = null;
const aabb = new AABB(point, point);
world.queryAABB(aabb, (fixture: Fixture) => {
if (body) {
return false;
}
if (!fixture.getBody().isDynamic() || !fixture.testPoint(point)) {
return false;
return true;
}
body = fixture.getBody();
return true;
return false;
});
return body;
}
Expand Down

0 comments on commit 886dadc

Please sign in to comment.