Skip to content

Commit

Permalink
RigidBody.h:
Browse files Browse the repository at this point in the history
* RigidBody now uses AABB<float>.
  • Loading branch information
razterizer committed Oct 24, 2024
1 parent 4195743 commit 6bf4591
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dynamics/RigidBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace dynamics

struct RigidBody
{
ttl::Rectangle aabb;
AABB<float> aabb;
Vec2 curr_pos;

Sprite* sprite = nullptr; // Position to be controlled by this rigid body object.
Expand All @@ -43,15 +43,15 @@ namespace dynamics
{
sprite = s;
curr_pos = s->pos;
aabb = s->calc_curr_AABB(0);
aabb = s->calc_curr_AABB(0).convert<float>();
}

void update(int sim_frame)
{
if (sprite != nullptr)
{
sprite->pos = { math::roundI(curr_pos.r), math::roundI(curr_pos.c) };
aabb = sprite->calc_curr_AABB(sim_frame);
aabb = sprite->calc_curr_AABB(sim_frame).convert<float>();
}
}
};
Expand Down

0 comments on commit 6bf4591

Please sign in to comment.