summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClay John <claynjohn@gmail.com>2022-10-23 16:53:25 -0700
committerGitHub <noreply@github.com>2022-10-23 16:53:25 -0700
commita6fc95cd92dfa5eba0104bbbc6a1f43d30efd2d4 (patch)
tree08f21274a787af4cdf0d8e3e6628f1dac4fb2620
parent8b37511364f1345a0636c576a9d31d572b8607ef (diff)
parent44b93006c406bdb3fd3c33841aeb47d9925c4adf (diff)
Merge pull request #67647 from Cykyrios/fix-rigidbody3d-inertia
Fix RigidBody3D inertia calculation
-rw-r--r--servers/physics_3d/godot_body_3d.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/physics_3d/godot_body_3d.cpp b/servers/physics_3d/godot_body_3d.cpp
index cec233d95b..53f4ab86f9 100644
--- a/servers/physics_3d/godot_body_3d.cpp
+++ b/servers/physics_3d/godot_body_3d.cpp
@@ -118,7 +118,7 @@ void GodotBody3D::update_mass_properties() {
shape_inertia_tensor = shape_basis * shape_inertia_tensor * shape_basis.transposed();
Vector3 shape_origin = shape_transform.origin - center_of_mass_local;
- inertia_tensor += shape_inertia_tensor + (Basis() * shape_origin.dot(shape_origin) - shape_origin.outer(shape_origin)) * mass;
+ inertia_tensor += shape_inertia_tensor + (Basis() * shape_origin.dot(shape_origin) - shape_origin.outer(shape_origin)) * mass_new;
}
// Set the inertia to a valid value when there are no valid shapes.