Documentation update for KinematicBody.move()

This commit is contained in:
Jakub Grzesik 2017-07-26 11:12:10 +02:00
parent f55211ae0d
commit bb4b98defe

View file

@ -245,7 +245,7 @@
<description> <description>
Returns the floating-point remainder of x/y (rounded towards zero): Returns the floating-point remainder of x/y (rounded towards zero):
[codeblock] [codeblock]
fmod = x - tquot * y fmod = x - tquot * y
[/codeblock] [/codeblock]
Where tquot is the truncated (i.e., rounded towards zero) result of: x/y. Where tquot is the truncated (i.e., rounded towards zero) result of: x/y.
</description> </description>
@ -22390,7 +22390,16 @@
<argument index="0" name="rel_vec" type="Vector3"> <argument index="0" name="rel_vec" type="Vector3">
</argument> </argument>
<description> <description>
Move the body in the given direction, stopping if there is an obstacle. The returned vector is how much movement was remaining before being stopped. Move the body in the given direction, stopping if there is an obstacle. If as a result of a movement there will be any collision then informations about this collision will be in returned dictionary. Dictionary will contains those keys:
- "position" - collision position
- "normal" - collision normal
- "local_shape" - id of this kinematic body shape that took part in a collision
- "travel" - traveled movement before being stopped
- "remainder" - remaining movement before being stopped
- "collider_id" - id of the collider, it can be used when dealing with [PhysicsServer]
- "collider" - colliding body
- "collider_shape_index" - index of the colliding shape, inside collider body "collider_metadata"
If the body did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead. Please note that this method is less user friendly than [method move_and_slide]. If you don't want to program each edge case manually, then it's recommended to use [method move_and_slide] instead.
</description> </description>
</method> </method>
<method name="move_and_slide"> <method name="move_and_slide">
@ -22572,7 +22581,16 @@
<argument index="0" name="rel_vec" type="Vector2"> <argument index="0" name="rel_vec" type="Vector2">
</argument> </argument>
<description> <description>
Move the body in the given direction, stopping if there is an obstacle. The returned vector is how much movement was remaining before being stopped. Move the body in the given direction, stopping if there is an obstacle. If as a result of a movement there will be any collision then informations about this collision will be in returned dictionary. Dictionary will contains those keys:
- "position" - collision position
- "normal" - collision normal
- "local_shape" - id of this kinematic body shape that took part in a collision
- "travel" - traveled movement before being stopped
- "remainder" - remaining movement before being stopped
- "collider_id" - id of the collider, it can be used when dealing with [Physics2DServer]
- "collider" - colliding body
- "collider_shape_index" - index of the colliding shape, inside collider body "collider_metadata"
If the body did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead. Please note that this method is less user friendly than [method move_and_slide]. If you don't want to program each edge case manually, then it's recommended to use [method move_and_slide] instead.
</description> </description>
</method> </method>
<method name="move_and_slide"> <method name="move_and_slide">