summaryrefslogtreecommitdiffstats
path: root/servers/physics_server_3d.h
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2021-06-10 17:37:19 -0700
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-09-06 10:20:16 -0700
commit82ea2a7045e336bf4ce17358e2057558f89c3ac0 (patch)
tree3a1d5096b27926ffb19169f96558e75ee448ed85 /servers/physics_server_3d.h
parente1ae2708ee52f8a0b361ecffd8567f304fad7f76 (diff)
downloadredot-engine-82ea2a7045e336bf4ce17358e2057558f89c3ac0.tar.gz
Proper support for custom mass properties in 2D/3D physics bodies
Changes: -Added support for custom inertia and center of mass in 3D -Added support for custom center of mass in 2D -Calculated center of mass from shapes in 2D (same as in 3D) -Fixed mass properties calculation with disabled shapes in 2D/3D -Removed first_integration which is not used in 2D and doesn't seem to make a lot of sense (prevents omit_force_integration to work during the first frame) -Support for custom inertia on different axes for RigidBody3D
Diffstat (limited to 'servers/physics_server_3d.h')
-rw-r--r--servers/physics_server_3d.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h
index c02a8f42f8..5677604682 100644
--- a/servers/physics_server_3d.h
+++ b/servers/physics_server_3d.h
@@ -405,14 +405,18 @@ public:
BODY_PARAM_BOUNCE,
BODY_PARAM_FRICTION,
BODY_PARAM_MASS, ///< unused for static, always infinite
+ BODY_PARAM_INERTIA,
+ BODY_PARAM_CENTER_OF_MASS,
BODY_PARAM_GRAVITY_SCALE,
BODY_PARAM_LINEAR_DAMP,
BODY_PARAM_ANGULAR_DAMP,
BODY_PARAM_MAX,
};
- virtual void body_set_param(RID p_body, BodyParameter p_param, real_t p_value) = 0;
- virtual real_t body_get_param(RID p_body, BodyParameter p_param) const = 0;
+ 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;
+
+ virtual void body_reset_mass_properties(RID p_body) = 0;
//state
enum BodyState {