summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCrimzoth <60625668+Crimzoth@users.noreply.github.com>2023-06-27 17:01:16 +0200
committerCrimzoth <60625668+Crimzoth@users.noreply.github.com>2023-06-27 18:56:38 +0200
commit3bab21fdd7950d27e672957b12100492c0c3df95 (patch)
tree578643f003e3835d12585e089eb5d9cc816a83c1
parent1b3bf485263c4e2ebc8bcdb1d71b58064f4dc5bc (diff)
downloadredot-engine-3bab21fdd7950d27e672957b12100492c0c3df95.tar.gz
Fix: Mass not set properly for RigidBody
Removed erroneous check, which caused _inv_mass not to be calculated when RigidBody2D or RigidBody3D used both custom center of mass and custom inertia.
-rw-r--r--servers/physics_2d/godot_body_2d.cpp2
-rw-r--r--servers/physics_3d/godot_body_3d.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/servers/physics_2d/godot_body_2d.cpp b/servers/physics_2d/godot_body_2d.cpp
index bc31721ae7..7809fa9475 100644
--- a/servers/physics_2d/godot_body_2d.cpp
+++ b/servers/physics_2d/godot_body_2d.cpp
@@ -35,7 +35,7 @@
#include "godot_space_2d.h"
void GodotBody2D::_mass_properties_changed() {
- if (get_space() && !mass_properties_update_list.in_list() && (calculate_inertia || calculate_center_of_mass)) {
+ if (get_space() && !mass_properties_update_list.in_list()) {
get_space()->body_add_to_mass_properties_update_list(&mass_properties_update_list);
}
}
diff --git a/servers/physics_3d/godot_body_3d.cpp b/servers/physics_3d/godot_body_3d.cpp
index 3c93fee4f8..d35f16f3ae 100644
--- a/servers/physics_3d/godot_body_3d.cpp
+++ b/servers/physics_3d/godot_body_3d.cpp
@@ -35,7 +35,7 @@
#include "godot_space_3d.h"
void GodotBody3D::_mass_properties_changed() {
- if (get_space() && !mass_properties_update_list.in_list() && (calculate_inertia || calculate_center_of_mass)) {
+ if (get_space() && !mass_properties_update_list.in_list()) {
get_space()->body_add_to_mass_properties_update_list(&mass_properties_update_list);
}
}