diff options
author | Camille Mohr-Daurat <pouleyKetchoup@gmail.com> | 2021-12-10 17:16:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 17:16:28 -0700 |
commit | f1ca14cc8daf7529569a11c9209c18f8f73e837a (patch) | |
tree | 937b7a7c559d6c2394cceb1874131df7b80bde0e /servers/physics_3d/godot_body_3d.cpp | |
parent | c6fe431a02a490aa42d8cbf5d573feb6edc7f0a8 (diff) | |
parent | 940f3fde5c5f902b6efd0f35fb6c7d23edd1da14 (diff) |
Merge pull request #55736 from nekomatata/physics-apply-forces
Improve RigidDynamicBody force and torque API
Diffstat (limited to 'servers/physics_3d/godot_body_3d.cpp')
-rw-r--r-- | servers/physics_3d/godot_body_3d.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/servers/physics_3d/godot_body_3d.cpp b/servers/physics_3d/godot_body_3d.cpp index d5098a2a5f..fca8a3f3a9 100644 --- a/servers/physics_3d/godot_body_3d.cpp +++ b/servers/physics_3d/godot_body_3d.cpp @@ -628,9 +628,8 @@ void GodotBody3D::integrate_forces(real_t p_step) { if (!omit_force_integration) { //overridden by direct state query - Vector3 force = gravity * mass; - force += applied_force; - Vector3 torque = applied_torque; + Vector3 force = gravity * mass + applied_force + constant_force; + Vector3 torque = applied_torque + constant_torque; real_t damp = 1.0 - p_step * total_linear_damp; |