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

Update box2d_wrapper.cpp #75

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading