Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Commit

Permalink
Update box2d_wrapper.cpp (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ughuuu authored Nov 24, 2023
1 parent ce0903f commit f7cb1d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/box2d-wrapper/box2d_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ void box2d::body_set_transform(b2World *world_handle,
new_pos.y /= step;
if (body_handle->GetType() == b2BodyType::b2_kinematicBody) {
real_t new_rot1 = (rot - body_handle->GetAngle()) / step;
real_t new_rot2 = (b2_pi + rot + body_handle->GetAngle()) / step;
real_t new_rot2 = -(2.0 * b2_pi - rot + body_handle->GetAngle()) / step;
real_t new_rot = new_rot1;
if (ABS(new_rot2) < ABS(new_rot1)) {
new_rot = new_rot2;
Expand Down

0 comments on commit f7cb1d1

Please sign in to comment.