diff options
Diffstat (limited to 'doc/classes/RigidBody2D.xml')
-rw-r--r-- | doc/classes/RigidBody2D.xml | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index 68e78ba5d4..9a1802b515 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RigidBody2D" inherits="PhysicsBody2D" category="Core" version="3.1"> +<class name="RigidBody2D" inherits="PhysicsBody2D" category="Core" version="3.2"> <brief_description> A body that is controlled by the 2D physics engine. </brief_description> @@ -7,12 +7,11 @@ This node implements simulated 2D physics. You do not control a RigidBody2D directly. Instead you apply forces to it (gravity, impulses, etc.) and the physics simulation calculates the resulting movement based on its mass, friction, and other physical properties. A RigidBody2D has 4 behavior [member mode]s: Rigid, Static, Character, and Kinematic. [b]Note:[/b] You should not change a RigidBody2D's [code]position[/code] or [code]linear_velocity[/code] every frame or even very often. 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. See [member custom_integrator]. + Please also keep in mind that physics bodies manage their own transform which overwrites the ones you set. So any direct or indirect transformation (including scaling of the node or its parent) will be visible in the editor only, and immediately reset at runtime. + If you need to override the default physics behavior or add a transformation at runtime, you can write a custom force integration. See [member custom_integrator]. </description> <tutorials> </tutorials> - <demos> - </demos> <methods> <method name="_integrate_forces" qualifiers="virtual"> <return type="void"> @@ -69,7 +68,7 @@ <argument index="1" name="impulse" type="Vector2"> </argument> <description> - Applies a positioned impulse to the body (which will be affected by the body mass and shape). This is the equivalent of hitting a billiard ball with a cue: a force that is applied instantaneously. Both the impulse and the offset from the body origin are in global coordinates. + 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). The position uses the rotation of the global coordinate system, but is centered at the object's origin. </description> </method> <method name="apply_torque_impulse"> |