summaryrefslogtreecommitdiffstats
path: root/servers/physics_server_3d.h
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2021-08-09 12:14:24 -0700
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-08-09 12:30:17 -0700
commit5650c83e4b7f669066685a9f5526d7ec56e9b43d (patch)
tree401c9269dab589614f85536eb083d53a86ac5cb5 /servers/physics_server_3d.h
parent0cee8831b25377567bff8f46f7eaad8cb203dbf8 (diff)
downloadredot-engine-5650c83e4b7f669066685a9f5526d7ec56e9b43d.tar.gz
Fix applied rotation from moving platforms in move_and_slide
When synchronizing CharacterBody 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.
Diffstat (limited to 'servers/physics_server_3d.h')
-rw-r--r--servers/physics_server_3d.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h
index 17bae9a057..3fb01b301b 100644
--- a/servers/physics_server_3d.h
+++ b/servers/physics_server_3d.h
@@ -62,6 +62,8 @@ public:
virtual void set_transform(const Transform3D &p_transform) = 0;
virtual Transform3D get_transform() const = 0;
+ virtual Vector3 get_velocity_at_local_position(const Vector3 &p_position) const = 0;
+
virtual void add_central_force(const Vector3 &p_force) = 0;
virtual void add_force(const Vector3 &p_force, const Vector3 &p_position = Vector3()) = 0;
virtual void add_torque(const Vector3 &p_torque) = 0;