summaryrefslogtreecommitdiff
path: root/servers/physics_2d
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2021-09-16 12:37:24 -0700
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-09-16 16:03:48 -0700
commited1ba5093f6a9d10adb5da74580bcb4469159214 (patch)
treec014e84d3930610b0c6ac658d86f41230fc05472 /servers/physics_2d
parent3581b893ed2dc1e444618ac40dc26dd58fe1219a (diff)
Clarify RigidDynamicBody modes
RigidDynamicBody modes are replaced with several properties to make their usage clearer: -lock_rotation: disable body's rotation (instead of MODE_LOCKED) -freeze: no gravity or forces (instead of MODE_STATIC and MODE_KINEMATIC) -freeze_mode: Static (can be only teleported) or Kinematic (can be animated) Also renamed MODE_DYNAMIC_LOCKED to MODE_DYNAMIC_LINEAR in the physics servers.
Diffstat (limited to 'servers/physics_2d')
-rw-r--r--servers/physics_2d/body_2d_sw.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp
index edd769aa9a..38b98b7bca 100644
--- a/servers/physics_2d/body_2d_sw.cpp
+++ b/servers/physics_2d/body_2d_sw.cpp
@@ -113,7 +113,7 @@ void Body2DSW::update_mass_properties() {
_inv_inertia = 0;
_inv_mass = 0;
} break;
- case PhysicsServer2D::BODY_MODE_DYNAMIC_LOCKED: {
+ case PhysicsServer2D::BODY_MODE_DYNAMIC_LINEAR: {
_inv_inertia = 0;
_inv_mass = 1.0 / mass;
@@ -257,7 +257,7 @@ void Body2DSW::set_mode(PhysicsServer2D::BodyMode p_mode) {
set_active(true);
} break;
- case PhysicsServer2D::BODY_MODE_DYNAMIC_LOCKED: {
+ case PhysicsServer2D::BODY_MODE_DYNAMIC_LINEAR: {
_inv_mass = mass > 0 ? (1.0 / mass) : 0;
_inv_inertia = 0;
angular_velocity = 0;