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

@ -60,6 +60,8 @@ public:
virtual void set_transform(const Transform2D &p_transform) = 0;
virtual Transform2D get_transform() const = 0;
virtual Vector2 get_velocity_at_local_position(const Vector2 &p_position) const = 0;
virtual void add_central_force(const Vector2 &p_force) = 0;
virtual void add_force(const Vector2 &p_offset, const Vector2 &p_force) = 0;
virtual void add_torque(real_t p_torque) = 0;