diff options
Diffstat (limited to 'doc/classes/PhysicsServer3D.xml')
-rw-r--r-- | doc/classes/PhysicsServer3D.xml | 92 |
1 files changed, 82 insertions, 10 deletions
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index b264590055..16c195c6dc 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -202,27 +202,39 @@ Sets the transform matrix for an area. </description> </method> - <method name="body_add_central_force"> + <method name="body_add_collision_exception"> <return type="void" /> <argument index="0" name="body" type="RID" /> - <argument index="1" name="force" type="Vector3" /> + <argument index="1" name="excepted_body" type="RID" /> <description> + Adds a body to the list of bodies exempt from collisions. </description> </method> - <method name="body_add_collision_exception"> + <method name="body_add_constant_central_force"> <return type="void" /> <argument index="0" name="body" type="RID" /> - <argument index="1" name="excepted_body" type="RID" /> + <argument index="1" name="force" type="Vector3" /> <description> - Adds a body to the list of bodies exempt from collisions. + Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with [code]body_set_constant_force(body, Vector3(0, 0, 0))[/code]. + This is equivalent to using [method body_add_constant_force] at the body's center of mass. </description> </method> - <method name="body_add_force"> + <method name="body_add_constant_force"> <return type="void" /> <argument index="0" name="body" type="RID" /> <argument index="1" name="force" type="Vector3" /> <argument index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> <description> + Adds a constant positioned force to the body that keeps being applied over time until cleared with [code]body_set_constant_force(body, Vector3(0, 0, 0))[/code]. + [code]position[/code] is the offset from the body origin in global coordinates. + </description> + </method> + <method name="body_add_constant_torque"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="Vector3" /> + <description> + Adds a constant rotational force without affecting position that keeps being applied over time until cleared with [code]body_set_constant_torque(body, Vector3(0, 0, 0))[/code]. </description> </method> <method name="body_add_shape"> @@ -235,11 +247,13 @@ Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. </description> </method> - <method name="body_add_torque"> + <method name="body_apply_central_force"> <return type="void" /> <argument index="0" name="body" type="RID" /> - <argument index="1" name="torque" type="Vector3" /> + <argument index="1" name="force" type="Vector3" /> <description> + Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. + This is equivalent to using [method body_apply_force] at the body's center of mass. </description> </method> <method name="body_apply_central_impulse"> @@ -247,6 +261,19 @@ <argument index="0" name="body" type="RID" /> <argument index="1" name="impulse" type="Vector3" /> <description> + Applies a directional impulse without affecting rotation. + 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 (use the "_force" functions otherwise). + This is equivalent to using [method body_apply_impulse] at the body's center of mass. + </description> + </method> + <method name="body_apply_force"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="force" type="Vector3" /> + <argument index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> + <description> + Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. + [code]position[/code] is the offset from the body origin in global coordinates. </description> </method> <method name="body_apply_impulse"> @@ -255,7 +282,17 @@ <argument index="1" name="impulse" type="Vector3" /> <argument index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> <description> - Gives the body a push at a [code]position[/code] in the direction of the [code]impulse[/code]. + 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 (use the "_force" functions otherwise). + [code]position[/code] is the offset from the body origin in global coordinates. + </description> + </method> + <method name="body_apply_torque"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="Vector3" /> + <description> + Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. </description> </method> <method name="body_apply_torque_impulse"> @@ -263,7 +300,8 @@ <argument index="0" name="body" type="RID" /> <argument index="1" name="impulse" type="Vector3" /> <description> - Gives the body a push to rotate it. + Applies a rotational impulse to the body without affecting the position. + 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 (use the "_force" functions otherwise). </description> </method> <method name="body_attach_object_instance_id"> @@ -301,6 +339,22 @@ - </description> </method> + <method name="body_get_constant_force" qualifiers="const"> + <return type="Vector3" /> + <argument index="0" name="body" type="RID" /> + <description> + Returns the body's total constant positional forces applied during each physics update. + See [method body_add_constant_force] and [method body_add_constant_central_force]. + </description> + </method> + <method name="body_get_constant_torque" qualifiers="const"> + <return type="Vector3" /> + <argument index="0" name="body" type="RID" /> + <description> + Returns the body's total constant rotational forces applied during each physics update. + See [method body_add_constant_torque]. + </description> + </method> <method name="body_get_direct_state"> <return type="PhysicsDirectBodyState3D" /> <argument index="0" name="body" type="RID" /> @@ -452,6 +506,24 @@ Sets the physics layer or layers a body can collide with. </description> </method> + <method name="body_set_constant_force"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="force" type="Vector3" /> + <description> + Sets the body's total constant positional forces applied during each physics update. + See [method body_add_constant_force] and [method body_add_constant_central_force]. + </description> + </method> + <method name="body_set_constant_torque"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="Vector3" /> + <description> + Sets the body's total constant rotational forces applied during each physics update. + See [method body_add_constant_torque]. + </description> + </method> <method name="body_set_enable_continuous_collision_detection"> <return type="void" /> <argument index="0" name="body" type="RID" /> |