Skip to content

Commit

Permalink
Update src/rigid_body.c
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeokkim committed Nov 10, 2024
1 parent 09f158d commit 3517485
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/geometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,11 @@ frAABB frGetShapeAABB(const frShape *s, frTransform tx) {
if (maxVertex.y < v.y) maxVertex.y = v.y;
}

float deltaX = maxVertex.x - minVertex.x;
float deltaY = maxVertex.y - minVertex.y;

result.x = minVertex.x;
result.y = minVertex.y;

result.width = deltaX;
result.height = deltaY;
result.width = maxVertex.x - minVertex.x;
result.height = maxVertex.y - minVertex.y;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/rigid_body.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void frSetBodyPosition(frBody *b, frVector2 position) {

b->tx.position = position;

b->aabb = frGetShapeAABB(b->shape, b->tx);
b->aabb.x += position.x, b->aabb.y += position.y;
}

/* Sets the `angle` of `b`, in radians. */
Expand Down

0 comments on commit 3517485

Please sign in to comment.