summaryrefslogtreecommitdiff
path: root/doc/base/classes.xml
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-07-28 11:06:23 +0200
committerGitHub <noreply@github.com>2017-07-28 11:06:23 +0200
commit2d162a60da5ecf0faabe5f2a4c00def7d08e0d97 (patch)
tree759127e97fb72ff7c70f884eaf63d591d8befed6 /doc/base/classes.xml
parenta7b35edf7bb0071159ea7ed12341ea9ac20075d2 (diff)
parentbb4b98defedf6aeadb94a497568f962981dd3ec7 (diff)
Merge pull request #9863 from kubecz3k/move-docs
Documentation update for KinematicBody.move()
Diffstat (limited to 'doc/base/classes.xml')
-rw-r--r--doc/base/classes.xml24
1 files changed, 21 insertions, 3 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index cd366f01f8..058753132e 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -245,7 +245,7 @@
<description>
Returns the floating-point remainder of x/y (rounded towards zero):
[codeblock]
- fmod = x - tquot * y
+ fmod = x - tquot * y
[/codeblock]
Where tquot is the truncated (i.e., rounded towards zero) result of: x/y.
</description>
@@ -22387,7 +22387,16 @@
<argument index="0" name="rel_vec" type="Vector3">
</argument>
<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>
</method>
<method name="move_and_slide">
@@ -22569,7 +22578,16 @@
<argument index="0" name="rel_vec" type="Vector2">
</argument>
<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>
</method>
<method name="move_and_slide">