summaryrefslogtreecommitdiff
path: root/doc/classes/RigidDynamicBody3D.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/RigidDynamicBody3D.xml')
-rw-r--r--doc/classes/RigidDynamicBody3D.xml33
1 files changed, 17 insertions, 16 deletions
diff --git a/doc/classes/RigidDynamicBody3D.xml b/doc/classes/RigidDynamicBody3D.xml
index 9b6bcd840b..7d1c7fecfa 100644
--- a/doc/classes/RigidDynamicBody3D.xml
+++ b/doc/classes/RigidDynamicBody3D.xml
@@ -5,10 +5,9 @@
</brief_description>
<description>
This is the node that implements full 3D physics. This means that you do not control a RigidDynamicBody3D directly. Instead, you can apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the resulting movement, collision, bouncing, rotating, etc.
- A RigidDynamicBody3D has 4 behavior [member mode]s: Dynamic, Static, DynamicLocked, and Kinematic.
+ You can switch the body's behavior using [member lock_rotation], [member freeze], and [member freeze_mode].
[b]Note:[/b] Don't change a RigidDynamicBody3D's position every frame or very often. Sporadic changes work fine, but physics runs at a different granularity (fixed Hz) than usual rendering (process callback) and maybe even in a separate thread, so changing this from a process loop may result in strange behavior. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state.
If you need to override the default physics behavior, you can write a custom force integration function. See [member custom_integrator].
- With Bullet physics (the default), the center of mass is the RigidDynamicBody3D center. With GodotPhysics, the center of mass is the average of the [CollisionShape3D] centers.
</description>
<tutorials>
<link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
@@ -123,6 +122,15 @@
<member name="custom_integrator" type="bool" setter="set_use_custom_integrator" getter="is_using_custom_integrator" default="false">
If [code]true[/code], internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] function, if defined.
</member>
+ <member name="freeze" type="bool" setter="set_freeze_enabled" getter="is_freeze_enabled" default="false">
+ If [code]true[/code], the body is frozen. Gravity and forces are not applied anymore.
+ See [member freeze_mode] to set the body's behavior when frozen.
+ For a body that is always frozen, use [StaticBody3D] or [AnimatableBody3D] instead.
+ </member>
+ <member name="freeze_mode" type="int" setter="set_freeze_mode" getter="get_freeze_mode" enum="RigidDynamicBody3D.FreezeMode" default="0">
+ The body's freeze mode. Can be used to set the body's behavior when [member freeze] is enabled. See [enum FreezeMode] for possible values.
+ For a body that is always frozen, use [StaticBody3D] or [AnimatableBody3D] instead.
+ </member>
<member name="gravity_scale" type="float" setter="set_gravity_scale" getter="get_gravity_scale" default="1.0">
This is multiplied by the global 3D gravity setting found in [b]Project &gt; Project Settings &gt; Physics &gt; 3d[/b] to produce RigidDynamicBody3D's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object.
</member>
@@ -137,13 +145,12 @@
<member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3(0, 0, 0)">
The body's linear velocity. Can be used sporadically, but [b]don't set this every frame[/b], because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state.
</member>
+ <member name="lock_rotation" type="bool" setter="set_lock_rotation_enabled" getter="is_lock_rotation_enabled" default="false">
+ If [code]true[/code], the body cannot rotate. Gravity and forces only apply linear movement.
+ </member>
<member name="mass" type="float" setter="set_mass" getter="get_mass" default="1.0">
The body's mass.
</member>
- <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="RigidDynamicBody3D.Mode" default="0">
- The body's mode. See [enum Mode] for possible values.
- For a body that uses only Static or Kinematic mode, use [StaticBody3D] or [AnimatableBody3D] instead.
- </member>
<member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override">
The physics material override for the body.
If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.
@@ -203,17 +210,11 @@
</signal>
</signals>
<constants>
- <constant name="MODE_DYNAMIC" value="0" enum="Mode">
- Dynamic body mode. This is the default mode of a rigid body. It is affected by forces, and can move, rotate, and be affected by user code.
- </constant>
- <constant name="MODE_STATIC" value="1" enum="Mode">
- Static body mode. The body behaves like a [StaticBody3D], and can only move by user code.
- </constant>
- <constant name="MODE_DYNAMIC_LOCKED" value="2" enum="Mode">
- Locked dynamic body mode. Similar to [constant MODE_DYNAMIC], but the body can not rotate.
+ <constant name="FREEZE_MODE_STATIC" value="0" enum="FreezeMode">
+ Static body freeze mode (default). The body is not affected by gravity and forces. It can be only moved by user code and doesn't collide with other bodies along its path.
</constant>
- <constant name="MODE_KINEMATIC" value="3" enum="Mode">
- Kinematic body mode. The body behaves like a [AnimatableBody3D], and can only move by user code.
+ <constant name="FREEZE_MODE_KINEMATIC" value="1" enum="FreezeMode">
+ Kinematic body freeze mode. Similar to [constant FREEZE_MODE_STATIC], but collides with other bodies along its path when moved. Useful for a frozen body that needs to be animated.
</constant>
<constant name="CENTER_OF_MASS_MODE_AUTO" value="0" enum="CenterOfMassMode">
In this mode, the body's center of mass is calculated automatically based on its shapes.