diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-12 11:46:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-12 11:46:22 +0200 |
commit | 1846d33b5f0543eadd29859f2a764e9262af58f8 (patch) | |
tree | d1f7aa6dd966e156ff9fda40016ef236f6e2b994 /servers/physics_3d | |
parent | 28bd664de5a3b30bbd6cdd72f91b62d4df13edcb (diff) | |
parent | 4a0d15f91c52cc0bc98f6480e7d57711383ec593 (diff) |
Merge pull request #37822 from nekomatata/rigid-body-force-pos
Fix add_force in Godot Physics RigidBody
Diffstat (limited to 'servers/physics_3d')
-rw-r--r-- | servers/physics_3d/body_3d_sw.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/physics_3d/body_3d_sw.h b/servers/physics_3d/body_3d_sw.h index b553cf0670..a6b18ee33c 100644 --- a/servers/physics_3d/body_3d_sw.h +++ b/servers/physics_3d/body_3d_sw.h @@ -257,7 +257,7 @@ public: _FORCE_INLINE_ void add_force(const Vector3 &p_force, const Vector3 &p_pos) { applied_force += p_force; - applied_torque += p_pos.cross(p_force); + applied_torque += (p_pos - center_of_mass).cross(p_force); } _FORCE_INLINE_ void add_torque(const Vector3 &p_torque) { |