1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Fix applied rotation from moving platforms in move_and_slide

When synchronizing KinematicBody motion with moving the platform using
direct body state, only the linear velocity was taken into account.

This change exposes velocity at local point in direct body state and
uses it in move_and_slide to get the proper velocity that includes
rotations.
This commit is contained in:
PouleyKetchoupp
2021-08-09 11:57:17 -07:00
parent d5a0b2e8bf
commit f101349225
12 changed files with 48 additions and 2 deletions

View File

@@ -92,6 +92,8 @@ void PhysicsDirectBodyState::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_transform", "transform"), &PhysicsDirectBodyState::set_transform);
ClassDB::bind_method(D_METHOD("get_transform"), &PhysicsDirectBodyState::get_transform);
ClassDB::bind_method(D_METHOD("get_velocity_at_local_position", "local_position"), &PhysicsDirectBodyState::get_velocity_at_local_position);
ClassDB::bind_method(D_METHOD("add_central_force", "force"), &PhysicsDirectBodyState::add_central_force);
ClassDB::bind_method(D_METHOD("add_force", "force", "position"), &PhysicsDirectBodyState::add_force);
ClassDB::bind_method(D_METHOD("add_torque", "torque"), &PhysicsDirectBodyState::add_torque);