From f7d31cec38c795909c4d1e0917f54aa118d380d7 Mon Sep 17 00:00:00 2001 From: Josh Grams Date: Wed, 20 Apr 2016 20:49:37 -0400 Subject: RigidBody2D: add and bind get_inertia() method. You can't set this value very well, since it's automatically computed from the mass and the collision shapes. But since the values are higher than many people might suspect, so being able to read it helps estimate the amount of torque you might need to apply. --- scene/2d/physics_body_2d.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scene/2d/physics_body_2d.h') diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index 40cb25d8c1..7523413df3 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -217,6 +217,8 @@ public: void set_mass(real_t p_mass); real_t get_mass() const; + real_t get_inertia() const; // read-only: auto-computed from mass & shapes. + void set_weight(real_t p_weight); real_t get_weight() const; -- cgit v1.2.3