summaryrefslogtreecommitdiff
path: root/servers/physics_server_2d.h
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2020-04-14 19:59:53 +0200
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-10-25 18:22:12 -0700
commitdaf7dcac7a9e0b4c26ba62ba9a700813d5abec9a (patch)
tree3ab364852f8804d03e8f6334a792d18f523dfea3 /servers/physics_server_2d.h
parent24fdedfe948a918b5a67846f7962f83ba0e59258 (diff)
Improved RigidDynamicBody linear/angular damping override
Damping values are now non-negative. Add new properties linear_damp_mode and angular_damp_mode to set the way RigidDynamicBody and PhysicalBone (2D & 3D) use damping values. It can now be Combine (default) to add to the default/areas, or Replace to override the value completely (current behavior).
Diffstat (limited to 'servers/physics_server_2d.h')
-rw-r--r--servers/physics_server_2d.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/servers/physics_server_2d.h b/servers/physics_server_2d.h
index f83c57407d..584da56c66 100644
--- a/servers/physics_server_2d.h
+++ b/servers/physics_server_2d.h
@@ -400,11 +400,18 @@ public:
BODY_PARAM_INERTIA,
BODY_PARAM_CENTER_OF_MASS,
BODY_PARAM_GRAVITY_SCALE,
+ BODY_PARAM_LINEAR_DAMP_MODE,
+ BODY_PARAM_ANGULAR_DAMP_MODE,
BODY_PARAM_LINEAR_DAMP,
BODY_PARAM_ANGULAR_DAMP,
BODY_PARAM_MAX,
};
+ enum BodyDampMode {
+ BODY_DAMP_MODE_COMBINE,
+ BODY_DAMP_MODE_REPLACE,
+ };
+
virtual void body_set_param(RID p_body, BodyParameter p_param, const Variant &p_value) = 0;
virtual Variant body_get_param(RID p_body, BodyParameter p_param) const = 0;
@@ -692,12 +699,12 @@ VARIANT_ENUM_CAST(PhysicsServer2D::AreaParameter);
VARIANT_ENUM_CAST(PhysicsServer2D::AreaSpaceOverrideMode);
VARIANT_ENUM_CAST(PhysicsServer2D::BodyMode);
VARIANT_ENUM_CAST(PhysicsServer2D::BodyParameter);
+VARIANT_ENUM_CAST(PhysicsServer2D::BodyDampMode);
VARIANT_ENUM_CAST(PhysicsServer2D::BodyState);
VARIANT_ENUM_CAST(PhysicsServer2D::CCDMode);
VARIANT_ENUM_CAST(PhysicsServer2D::JointParam);
VARIANT_ENUM_CAST(PhysicsServer2D::JointType);
VARIANT_ENUM_CAST(PhysicsServer2D::DampedSpringParam);
-//VARIANT_ENUM_CAST( PhysicsServer2D::ObjectType );
VARIANT_ENUM_CAST(PhysicsServer2D::AreaBodyStatus);
VARIANT_ENUM_CAST(PhysicsServer2D::ProcessInfo);