summaryrefslogtreecommitdiff
path: root/doc/classes/PhysicsServer3D.xml
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 /doc/classes/PhysicsServer3D.xml
parente1ae2708ee52f8a0b361ecffd8567f304fad7f76 (diff)
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 'doc/classes/PhysicsServer3D.xml')
-rw-r--r--doc/classes/PhysicsServer3D.xml25
1 files changed, 19 insertions, 6 deletions
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml
index 46cde02f2c..2fbe84b8b1 100644
--- a/doc/classes/PhysicsServer3D.xml
+++ b/doc/classes/PhysicsServer3D.xml
@@ -347,7 +347,7 @@
</description>
</method>
<method name="body_get_param" qualifiers="const">
- <return type="float" />
+ <return type="Variant" />
<argument index="0" name="body" type="RID" />
<argument index="1" name="param" type="int" enum="PhysicsServer3D.BodyParameter" />
<description>
@@ -430,6 +430,13 @@
Removes a shape from a body. The shape is not deleted, so it can be reused afterwards.
</description>
</method>
+ <method name="body_reset_mass_properties">
+ <return type="void" />
+ <argument index="0" name="body" type="RID" />
+ <description>
+ Restores the default inertia and center of mass based on shapes to cancel any custom values previously set using [method body_set_param].
+ </description>
+ </method>
<method name="body_set_axis_lock">
<return type="void" />
<argument index="0" name="body" type="RID" />
@@ -511,7 +518,7 @@
<return type="void" />
<argument index="0" name="body" type="RID" />
<argument index="1" name="param" type="int" enum="PhysicsServer3D.BodyParameter" />
- <argument index="2" name="value" type="float" />
+ <argument index="2" name="value" type="Variant" />
<description>
Sets a body parameter. A list of available parameters is on the [enum BodyParameter] constants.
</description>
@@ -1282,16 +1289,22 @@
<constant name="BODY_PARAM_MASS" value="2" enum="BodyParameter">
Constant to set/get a body's mass.
</constant>
- <constant name="BODY_PARAM_GRAVITY_SCALE" value="3" enum="BodyParameter">
+ <constant name="BODY_PARAM_INERTIA" value="3" enum="BodyParameter">
+ Constant to set/get a body's inertia.
+ </constant>
+ <constant name="BODY_PARAM_CENTER_OF_MASS" value="4" enum="BodyParameter">
+ Constant to set/get a body's center of mass.
+ </constant>
+ <constant name="BODY_PARAM_GRAVITY_SCALE" value="5" enum="BodyParameter">
Constant to set/get a body's gravity multiplier.
</constant>
- <constant name="BODY_PARAM_LINEAR_DAMP" value="4" enum="BodyParameter">
+ <constant name="BODY_PARAM_LINEAR_DAMP" value="6" enum="BodyParameter">
Constant to set/get a body's linear dampening factor.
</constant>
- <constant name="BODY_PARAM_ANGULAR_DAMP" value="5" enum="BodyParameter">
+ <constant name="BODY_PARAM_ANGULAR_DAMP" value="7" enum="BodyParameter">
Constant to set/get a body's angular dampening factor.
</constant>
- <constant name="BODY_PARAM_MAX" value="6" enum="BodyParameter">
+ <constant name="BODY_PARAM_MAX" value="8" enum="BodyParameter">
Represents the size of the [enum BodyParameter] enum.
</constant>
<constant name="BODY_STATE_TRANSFORM" value="0" enum="BodyState">