summaryrefslogtreecommitdiff
path: root/doc/classes/RigidBody3D.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/RigidBody3D.xml')
-rw-r--r--doc/classes/RigidBody3D.xml67
1 files changed, 14 insertions, 53 deletions
diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml
index 1c6c8852a9..fb2b9690a3 100644
--- a/doc/classes/RigidBody3D.xml
+++ b/doc/classes/RigidBody3D.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
This is the node that implements full 3D physics. This means that you do not control a RigidBody3D 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 RigidBody3D has 4 behavior [member mode]s: Rigid, Static, Character, and Kinematic.
+ A RigidBody3D has 4 behavior [member mode]s: Dynamic, Static, DynamicLocked, and Kinematic.
[b]Note:[/b] Don't change a RigidBody3D'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 RigidBody3D center. With GodotPhysics, the center of mass is the average of the [CollisionShape3D] centers.
@@ -40,7 +40,7 @@
</return>
<argument index="0" name="force" type="Vector3">
</argument>
- <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
+ <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)">
</argument>
<description>
Adds a constant directional force (i.e. acceleration).
@@ -71,7 +71,7 @@
</return>
<argument index="0" name="impulse" type="Vector3">
</argument>
- <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
+ <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)">
</argument>
<description>
Applies a positioned impulse to the body. An impulse is time independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin.
@@ -86,15 +86,6 @@
Applies a torque impulse which will be affected by the body mass and shape. This will rotate the body around the [code]impulse[/code] vector passed.
</description>
</method>
- <method name="get_axis_lock" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="axis" type="int" enum="PhysicsServer3D.BodyAxis">
- </argument>
- <description>
- Returns [code]true[/code] if the specified linear or rotational axis is locked.
- </description>
- </method>
<method name="get_colliding_bodies" qualifiers="const">
<return type="Array">
</return>
@@ -103,24 +94,13 @@
[b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead.
</description>
</method>
- <method name="get_inverse_inertia_tensor">
+ <method name="get_inverse_inertia_tensor" qualifiers="const">
<return type="Basis">
</return>
<description>
Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the [RigidBody3D].
</description>
</method>
- <method name="set_axis_lock">
- <return type="void">
- </return>
- <argument index="0" name="axis" type="int" enum="PhysicsServer3D.BodyAxis">
- </argument>
- <argument index="1" name="lock" type="bool">
- </argument>
- <description>
- Locks the specified linear or rotational axis.
- </description>
- </method>
<method name="set_axis_velocity">
<return type="void">
</return>
@@ -136,30 +116,11 @@
Damps RigidBody3D's rotational forces.
See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping.
</member>
- <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3( 0, 0, 0 )">
+ <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3(0, 0, 0)">
RigidBody3D's rotational velocity.
</member>
- <member name="axis_lock_angular_x" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
- Lock the body's rotation in the X axis.
- </member>
- <member name="axis_lock_angular_y" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
- Lock the body's rotation in the Y axis.
- </member>
- <member name="axis_lock_angular_z" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
- Lock the body's rotation in the Z axis.
- </member>
- <member name="axis_lock_linear_x" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
- Lock the body's movement in the X axis.
- </member>
- <member name="axis_lock_linear_y" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
- Lock the body's movement in the Y axis.
- </member>
- <member name="axis_lock_linear_z" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
- Lock the body's movement in the Z axis.
- </member>
<member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true">
If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping].
- [b]Note:[/b] A RigidBody3D will never enter sleep mode automatically if its [member mode] is [constant MODE_CHARACTER]. It can still be put to sleep manually by setting its [member sleeping] property to [code]true[/code].
</member>
<member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false">
If [code]true[/code], the RigidBody3D will emit signals when it collides with another RigidBody3D. See also [member contacts_reported].
@@ -182,7 +143,7 @@
The body's linear damp. Cannot be less than -1.0. If this value is different from -1.0, any linear damp derived from the world or areas will be overridden.
See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping.
</member>
- <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3( 0, 0, 0 )">
+ <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="mass" type="float" setter="set_mass" getter="get_mass" default="1.0">
@@ -217,7 +178,7 @@
</description>
</signal>
<signal name="body_shape_entered">
- <argument index="0" name="body_id" type="int">
+ <argument index="0" name="body_rid" type="RID">
</argument>
<argument index="1" name="body" type="Node">
</argument>
@@ -235,7 +196,7 @@
</description>
</signal>
<signal name="body_shape_exited">
- <argument index="0" name="body_id" type="int">
+ <argument index="0" name="body_rid" type="RID">
</argument>
<argument index="1" name="body" type="Node">
</argument>
@@ -260,17 +221,17 @@
</signal>
</signals>
<constants>
- <constant name="MODE_RIGID" value="0" enum="Mode">
- Rigid body mode. This is the "natural" state of a rigid body. It is affected by forces, and can move, rotate, and be affected by user code.
+ <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 mode. The body behaves like a [StaticBody3D], and can only move by user code.
+ Static body mode. The body behaves like a [StaticBody3D], and can only move by user code.
</constant>
- <constant name="MODE_CHARACTER" value="2" enum="Mode">
- Character body mode. This behaves like a rigid body, but can not rotate.
+ <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>
<constant name="MODE_KINEMATIC" value="3" enum="Mode">
- Kinematic body mode. The body behaves like a [KinematicBody3D], and can only move by user code.
+ Kinematic body mode. The body behaves like a [StaticBody3D] with [member StaticBody3D.kinematic_motion] enabled, and can only move by user code.
</constant>
</constants>
</class>