diff options
author | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2020-01-15 08:04:02 +0100 |
---|---|---|
committer | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2020-01-15 10:13:35 +0100 |
commit | 907adb37cee5f1b907d25069d0e0a037297f656e (patch) | |
tree | 9572c61bc022f636fbfbbca9f250ca3f866e1985 /doc | |
parent | 40f0649e5b02037cb4745c336170e1e5422467ed (diff) |
Fixes get_floor_normal() returning the user defined floor_normal.
When there is no collision with a floor the get_floor_normal() function
should return the zero vector to be consistent with get_floor_velocity().
Renames floor_normal to up_direction in all bindings.
Updates the documentation of get_floor_normal() and get_floor_velocity()
to make it clear when the values are valid. Updates the documentation for
move_and_slide() and move_and_slide_with_snap() to use the new up_direction
parameter name.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/KinematicBody.xml | 8 | ||||
-rw-r--r-- | doc/classes/KinematicBody2D.xml | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/doc/classes/KinematicBody.xml b/doc/classes/KinematicBody.xml index f796b15307..c32264221d 100644 --- a/doc/classes/KinematicBody.xml +++ b/doc/classes/KinematicBody.xml @@ -25,14 +25,14 @@ <return type="Vector3"> </return> <description> - Returns the normal vector of the floor. + Returns the surface normal of the floor at the last collision point. Only valid after calling [method move_and_slide] or [method move_and_slide_with_snap] and when [method is_on_floor] returns [code]true[/code]. </description> </method> <method name="get_floor_velocity" qualifiers="const"> <return type="Vector3"> </return> <description> - Returns the velocity of the floor. Only updates when calling [method move_and_slide]. + Returns the linear velocity of the floor at the last collision point. Only valid after calling [method move_and_slide] or [method move_and_slide_with_snap] and when [method is_on_floor] returns [code]true[/code]. </description> </method> <method name="get_slide_collision"> @@ -106,7 +106,7 @@ <description> Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody] or [RigidBody], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes. [code]linear_velocity[/code] is the velocity vector (typically meters per second). Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity. - [code]floor_normal[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector3(0, 0, 0)[/code], everything is considered a wall. This is useful for topdown games. + [code]up_direction[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector3(0, 0, 0)[/code], everything is considered a wall. If [code]stop_on_slope[/code] is [code]true[/code], body will not slide on slopes if you include gravity in [code]linear_velocity[/code]. If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops. [code]floor_max_angle[/code] is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. @@ -121,7 +121,7 @@ </argument> <argument index="1" name="snap" type="Vector3"> </argument> - <argument index="2" name="floor_normal" type="Vector3" default="Vector3( 0, 0, 0 )"> + <argument index="2" name="up_direction" type="Vector3" default="Vector3( 0, 0, 0 )"> </argument> <argument index="3" name="stop_on_slope" type="bool" default="false"> </argument> diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml index 470d8db47a..6a3b3dabb1 100644 --- a/doc/classes/KinematicBody2D.xml +++ b/doc/classes/KinematicBody2D.xml @@ -17,14 +17,14 @@ <return type="Vector2"> </return> <description> - Returns the normal vector of the floor. + Returns the surface normal of the floor at the last collision point. Only valid after calling [method move_and_slide] or [method move_and_slide_with_snap] and when [method is_on_floor] returns [code]true[/code]. </description> </method> <method name="get_floor_velocity" qualifiers="const"> <return type="Vector2"> </return> <description> - Returns the velocity of the floor. Only updates when calling [method move_and_slide]. + Returns the linear velocity of the floor at the last collision point. Only valid after calling [method move_and_slide] or [method move_and_slide_with_snap] and when [method is_on_floor] returns [code]true[/code]. </description> </method> <method name="get_slide_collision"> @@ -91,7 +91,7 @@ </return> <argument index="0" name="linear_velocity" type="Vector2"> </argument> - <argument index="1" name="floor_normal" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="1" name="up_direction" type="Vector2" default="Vector2( 0, 0 )"> </argument> <argument index="2" name="stop_on_slope" type="bool" default="false"> </argument> @@ -104,7 +104,7 @@ <description> Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes. [code]linear_velocity[/code] is the velocity vector in pixels per second. Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity. - [code]floor_normal[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games. + [code]up_direction[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games. If [code]stop_on_slope[/code] is [code]true[/code], body will not slide on slopes when you include gravity in [code]linear_velocity[/code] and the body is standing still. If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops. [code]floor_max_angle[/code] is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. @@ -119,7 +119,7 @@ </argument> <argument index="1" name="snap" type="Vector2"> </argument> - <argument index="2" name="floor_normal" type="Vector2" default="Vector2( 0, 0 )"> + <argument index="2" name="up_direction" type="Vector2" default="Vector2( 0, 0 )"> </argument> <argument index="3" name="stop_on_slope" type="bool" default="false"> </argument> |