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

Commit

Permalink
fix scaling issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ughuuu committed Dec 11, 2023
1 parent edbc5c9 commit ac5d430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/bodies/box2d_collision_object_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@ void Box2DCollisionObject2D::set_transform(const Transform2D &p_transform, bool
b2Vec2 position = { origin.x, origin.y };
real_t rotation = transform.get_rotation();
box2d::body_set_transform(space_handle, body_handle, position, rotation, wake_up, space->get_last_step());

for (uint32_t i = 0; i < shapes.size(); i++) {
Shape &shape = shapes[i];
if (shape.disabled) {
continue;
}

_update_shape_transform(shape);
}
}
}

Expand Down
1 change: 0 additions & 1 deletion src/box2d-wrapper/box2d_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ void box2d::body_set_transform(b2World *world_handle,
body_handle->SetAwake(true);
}
}
// also update collider transform with new values
}

void box2d::body_update_material(b2World *world_handle, b2Body *body_handle, const Material *mat) {
Expand Down

0 comments on commit ac5d430

Please sign in to comment.