summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-09-26 13:44:36 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-09-26 13:44:36 +0200
commit1e4165ac603946afaf77c92c1a3d515432d3c747 (patch)
tree259822cde059f036362a075f487dd6c9b0abd2bc
parent21cdedb79c718258d66242aa7645511830f296f0 (diff)
parent3bab21fdd7950d27e672957b12100492c0c3df95 (diff)
downloadredot-engine-1e4165ac603946afaf77c92c1a3d515432d3c747.tar.gz
Merge pull request #78757 from Crimzoth/RigidBody3D-mass-issue-fix
Correctly set mass for a rigid body with custom inertia and center of mass
-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);
}
}