summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-10-04 21:05:38 +0200
committerGitHub <noreply@github.com>2021-10-04 21:05:38 +0200
commit5b270278c869461a3dce2c0d0db71e0beaa50685 (patch)
treea734131eb3b1b468fc3fcdd653466c66af3d4697 /doc/classes
parent8f227e9da3fd2dc10782c2ff42ed8c8e0632c82f (diff)
parent3ae5687d48c0a933a684c863beadf769312ba1ac (diff)
Merge pull request #53280 from nekomatata/test-body-motion-parameters
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/KinematicCollision2D.xml103
-rw-r--r--doc/classes/KinematicCollision3D.xml75
-rw-r--r--doc/classes/PhysicsServer2D.xml12
-rw-r--r--doc/classes/PhysicsServer3D.xml13
-rw-r--r--doc/classes/PhysicsTestMotionParameters2D.xml29
-rw-r--r--doc/classes/PhysicsTestMotionParameters3D.xml32
-rw-r--r--doc/classes/PhysicsTestMotionResult2D.xml108
-rw-r--r--doc/classes/PhysicsTestMotionResult3D.xml75
-rw-r--r--doc/classes/TileMap.xml2
9 files changed, 294 insertions, 155 deletions
diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml
index 29fc4700fd..23b01a0fc9 100644
--- a/doc/classes/KinematicCollision2D.xml
+++ b/doc/classes/KinematicCollision2D.xml
@@ -14,43 +14,74 @@
<return type="float" />
<argument index="0" name="up_direction" type="Vector2" default="Vector2(0, -1)" />
<description>
- The collision angle according to [code]up_direction[/code], which is [code]Vector2.UP[/code] by default. This value is always positive.
+ Returns the collision angle according to [code]up_direction[/code], which is [code]Vector2.UP[/code] by default. This value is always positive.
+ </description>
+ </method>
+ <method name="get_collider" qualifiers="const">
+ <return type="Object" />
+ <description>
+ Returns the colliding body's attached [Object].
+ </description>
+ </method>
+ <method name="get_collider_id" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the unique instance ID of the colliding body's attached [Object]. See [method Object.get_instance_id].
+ </description>
+ </method>
+ <method name="get_collider_rid" qualifiers="const">
+ <return type="RID" />
+ <description>
+ Returns the colliding body's [RID] used by the [PhysicsServer2D].
+ </description>
+ </method>
+ <method name="get_collider_shape" qualifiers="const">
+ <return type="Object" />
+ <description>
+ Returns the colliding body's shape.
+ </description>
+ </method>
+ <method name="get_collider_shape_index" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the colliding body's shape index. See [CollisionObject2D].
+ </description>
+ </method>
+ <method name="get_collider_velocity" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the colliding body's velocity.
+ </description>
+ </method>
+ <method name="get_local_shape" qualifiers="const">
+ <return type="Object" />
+ <description>
+ Returns the moving object's colliding shape.
+ </description>
+ </method>
+ <method name="get_normal" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the colliding body's shape's normal at the point of collision.
+ </description>
+ </method>
+ <method name="get_position" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the point of collision in global coordinates.
+ </description>
+ </method>
+ <method name="get_remainder" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the moving object's remaining movement vector.
+ </description>
+ </method>
+ <method name="get_travel" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the moving object's travel before collision.
</description>
</method>
</methods>
- <members>
- <member name="collider" type="Object" setter="" getter="get_collider">
- The colliding body.
- </member>
- <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0">
- The colliding body's unique instance ID. See [method Object.get_instance_id].
- </member>
- <member name="collider_rid" type="RID" setter="" getter="get_collider_rid">
- The colliding body's [RID] used by the [PhysicsServer2D].
- </member>
- <member name="collider_shape" type="Object" setter="" getter="get_collider_shape">
- The colliding body's shape.
- </member>
- <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index" default="0">
- The colliding shape's index. See [CollisionObject2D].
- </member>
- <member name="collider_velocity" type="Vector2" setter="" getter="get_collider_velocity" default="Vector2(0, 0)">
- The colliding object's velocity.
- </member>
- <member name="local_shape" type="Object" setter="" getter="get_local_shape">
- The moving object's colliding shape.
- </member>
- <member name="normal" type="Vector2" setter="" getter="get_normal" default="Vector2(0, 0)">
- The colliding body's shape's normal at the point of collision.
- </member>
- <member name="position" type="Vector2" setter="" getter="get_position" default="Vector2(0, 0)">
- The point of collision, in global coordinates.
- </member>
- <member name="remainder" type="Vector2" setter="" getter="get_remainder" default="Vector2(0, 0)">
- The moving object's remaining movement vector.
- </member>
- <member name="travel" type="Vector2" setter="" getter="get_travel" default="Vector2(0, 0)">
- The distance the moving object traveled before collision.
- </member>
- </members>
</class>
diff --git a/doc/classes/KinematicCollision3D.xml b/doc/classes/KinematicCollision3D.xml
index 3db6fe019b..372113b281 100644
--- a/doc/classes/KinematicCollision3D.xml
+++ b/doc/classes/KinematicCollision3D.xml
@@ -15,108 +15,89 @@
<argument index="0" name="collision_index" type="int" default="0" />
<argument index="1" name="up_direction" type="Vector3" default="Vector3(0, 1, 0)" />
<description>
- The collision angle according to [code]up_direction[/code], which is [code]Vector3.UP[/code] by default. This value is always positive.
+ Returns the collision angle according to [code]up_direction[/code], which is [code]Vector3.UP[/code] by default. This value is always positive.
</description>
</method>
<method name="get_collider" qualifiers="const">
<return type="Object" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
- Returns the collider by index (the latest by default).
+ Returns the colliding body's attached [Object] given a collision index (the deepest collision by default).
</description>
</method>
<method name="get_collider_id" qualifiers="const">
<return type="int" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
- Returns the collider ID by index (the latest by default).
+ Returns the unique instance ID of the colliding body's attached [Object] given a collision index (the deepest collision by default). See [method Object.get_instance_id].
</description>
</method>
<method name="get_collider_rid" qualifiers="const">
<return type="RID" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
- Returns the collider RID by index (the latest by default).
+ Returns the colliding body's [RID] used by the [PhysicsServer3D] given a collision index (the deepest collision by default).
</description>
</method>
<method name="get_collider_shape" qualifiers="const">
<return type="Object" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
- Returns the collider shape by index (the latest by default).
+ Returns the colliding body's shape given a collision index (the deepest collision by default).
</description>
</method>
<method name="get_collider_shape_index" qualifiers="const">
<return type="int" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
- Returns the collider shape index by index (the latest by default).
+ Returns the colliding body's shape index given a collision index (the deepest collision by default). See [CollisionObject3D].
</description>
</method>
<method name="get_collider_velocity" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
- Returns the collider velocity by index (the latest by default).
+ Returns the colliding body's velocity given a collision index (the deepest collision by default).
+ </description>
+ </method>
+ <method name="get_collision_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the number of detected collisions.
</description>
</method>
<method name="get_local_shape" qualifiers="const">
<return type="Object" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
- Returns the collider velocity by index (the latest by default).
+ Returns the moving object's colliding shape given a collision index (the deepest collision by default).
</description>
</method>
<method name="get_normal" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
- Returns the collider normal by index (the latest by default).
+ Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default).
</description>
</method>
<method name="get_position" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
- Returns the collider collision point by index (the latest by default).
+ Returns the point of collision in global coordinates given a collision index (the deepest collision by default).
+ </description>
+ </method>
+ <method name="get_remainder" qualifiers="const">
+ <return type="Vector3" />
+ <description>
+ Returns the moving object's remaining movement vector.
+ </description>
+ </method>
+ <method name="get_travel" qualifiers="const">
+ <return type="Vector3" />
+ <description>
+ Returns the moving object's travel before collision.
</description>
</method>
</methods>
- <members>
- <member name="collider" type="Object" setter="" getter="get_best_collider">
- The colliding body.
- </member>
- <member name="collider_id" type="int" setter="" getter="get_best_collider_id" default="0">
- The colliding body's unique instance ID. See [method Object.get_instance_id].
- </member>
- <member name="collider_rid" type="RID" setter="" getter="get_best_collider_rid">
- The colliding body's [RID] used by the [PhysicsServer3D].
- </member>
- <member name="collider_shape" type="Object" setter="" getter="get_best_collider_shape">
- The colliding body's shape.
- </member>
- <member name="collider_shape_index" type="int" setter="" getter="get_best_collider_shape_index" default="0">
- The colliding shape's index. See [CollisionObject3D].
- </member>
- <member name="collider_velocity" type="Vector3" setter="" getter="get_best_collider_velocity" default="Vector3(0, 0, 0)">
- The colliding object's velocity.
- </member>
- <member name="collision_count" type="int" setter="" getter="get_collision_count" default="0">
- </member>
- <member name="local_shape" type="Object" setter="" getter="get_best_local_shape">
- The moving object's colliding shape.
- </member>
- <member name="normal" type="Vector3" setter="" getter="get_best_normal" default="Vector3(0, 0, 0)">
- The colliding body's shape's normal at the point of collision.
- </member>
- <member name="position" type="Vector3" setter="" getter="get_best_position" default="Vector3(0, 0, 0)">
- The point of collision, in global coordinates.
- </member>
- <member name="remainder" type="Vector3" setter="" getter="get_remainder" default="Vector3(0, 0, 0)">
- The moving object's remaining movement vector.
- </member>
- <member name="travel" type="Vector3" setter="" getter="get_travel" default="Vector3(0, 0, 0)">
- The distance the moving object traveled before collision.
- </member>
- </members>
</class>
diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml
index b5b6a7ea58..d55feff829 100644
--- a/doc/classes/PhysicsServer2D.xml
+++ b/doc/classes/PhysicsServer2D.xml
@@ -584,14 +584,10 @@
<method name="body_test_motion">
<return type="bool" />
<argument index="0" name="body" type="RID" />
- <argument index="1" name="from" type="Transform2D" />
- <argument index="2" name="motion" type="Vector2" />
- <argument index="3" name="margin" type="float" default="0.08" />
- <argument index="4" name="result" type="PhysicsTestMotionResult2D" default="null" />
- <argument index="5" name="collide_separation_ray" type="bool" default="false" />
- <argument index="6" name="exclude" type="Array" default="[]" />
- <description>
- Returns [code]true[/code] if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. [PhysicsTestMotionResult2D] can be passed to return additional information in.
+ <argument index="1" name="parameters" type="PhysicsTestMotionParameters2D" />
+ <argument index="2" name="result" type="PhysicsTestMotionResult2D" default="null" />
+ <description>
+ Returns [code]true[/code] if a collision would result from moving along a motion vector from a given point in space. [PhysicsTestMotionParameters2D] is passed to set motion parameters. [PhysicsTestMotionResult2D] can be passed to return additional information.
</description>
</method>
<method name="capsule_shape_create">
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml
index 1d1ca54dbb..0e32d1defa 100644
--- a/doc/classes/PhysicsServer3D.xml
+++ b/doc/classes/PhysicsServer3D.xml
@@ -577,15 +577,10 @@
<method name="body_test_motion">
<return type="bool" />
<argument index="0" name="body" type="RID" />
- <argument index="1" name="from" type="Transform3D" />
- <argument index="2" name="motion" type="Vector3" />
- <argument index="3" name="margin" type="float" default="0.001" />
- <argument index="4" name="result" type="PhysicsTestMotionResult3D" default="null" />
- <argument index="5" name="collide_separation_ray" type="bool" default="false" />
- <argument index="6" name="exclude" type="Array" default="[]" />
- <argument index="7" name="max_collisions" type="int" default="1" />
- <description>
- Returns [code]true[/code] if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. [PhysicsTestMotionResult3D] can be passed to return additional information in.
+ <argument index="1" name="parameters" type="PhysicsTestMotionParameters3D" />
+ <argument index="2" name="result" type="PhysicsTestMotionResult3D" default="null" />
+ <description>
+ Returns [code]true[/code] if a collision would result from moving along a motion vector from a given point in space. [PhysicsTestMotionParameters3D] is passed to set motion parameters. [PhysicsTestMotionResult3D] can be passed to return additional information.
</description>
</method>
<method name="box_shape_create">
diff --git a/doc/classes/PhysicsTestMotionParameters2D.xml b/doc/classes/PhysicsTestMotionParameters2D.xml
new file mode 100644
index 0000000000..7cea848039
--- /dev/null
+++ b/doc/classes/PhysicsTestMotionParameters2D.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="PhysicsTestMotionParameters2D" inherits="RefCounted" version="4.0">
+ <brief_description>
+ Parameters to be sent to a 2D body motion test.
+ </brief_description>
+ <description>
+ This class contains parameters used in [method PhysicsServer2D.body_test_motion].
+ </description>
+ <tutorials>
+ </tutorials>
+ <members>
+ <member name="collide_separation_ray" type="bool" setter="set_collide_separation_ray_enabled" getter="is_collide_separation_ray_enabled" default="false">
+ If set to [code]true[/code], shapes of type [constant PhysicsServer2D.SHAPE_SEPARATION_RAY] are used to detect collisions and can stop the motion. Can be useful when snapping to the ground.
+ If set to [code]false[/code], shapes of type [constant PhysicsServer2D.SHAPE_SEPARATION_RAY] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes.
+ </member>
+ <member name="exclude_bodies" type="Array" setter="set_exclude_bodies" getter="get_exclude_bodies" default="[]">
+ Optional array of body [RID] to exclude from collision.
+ </member>
+ <member name="from" type="Transform2D" setter="set_from" getter="get_from" default="Transform2D(1, 0, 0, 1, 0, 0)">
+ Transform in global space where the motion should start. Usually set to [member Node2D.global_transform] for the current body's transform.
+ </member>
+ <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.08">
+ Increases the size of the shapes involved in the collision detection.
+ </member>
+ <member name="motion" type="Vector2" setter="set_motion" getter="get_motion" default="Vector2(0, 0)">
+ Motion vector to define the length and direction of the motion to test.
+ </member>
+ </members>
+</class>
diff --git a/doc/classes/PhysicsTestMotionParameters3D.xml b/doc/classes/PhysicsTestMotionParameters3D.xml
new file mode 100644
index 0000000000..07abbb1cb1
--- /dev/null
+++ b/doc/classes/PhysicsTestMotionParameters3D.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="PhysicsTestMotionParameters3D" inherits="RefCounted" version="4.0">
+ <brief_description>
+ Parameters to be sent to a 3D body motion test.
+ </brief_description>
+ <description>
+ This class contains parameters used in [method PhysicsServer3D.body_test_motion].
+ </description>
+ <tutorials>
+ </tutorials>
+ <members>
+ <member name="collide_separation_ray" type="bool" setter="set_collide_separation_ray_enabled" getter="is_collide_separation_ray_enabled" default="false">
+ If set to [code]true[/code], shapes of type [constant PhysicsServer3D.SHAPE_SEPARATION_RAY] are used to detect collisions and can stop the motion. Can be useful when snapping to the ground.
+ If set to [code]false[/code], shapes of type [constant PhysicsServer3D.SHAPE_SEPARATION_RAY] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes.
+ </member>
+ <member name="exclude_bodies" type="Array" setter="set_exclude_bodies" getter="get_exclude_bodies" default="[]">
+ Optional array of body [RID] to exclude from collision.
+ </member>
+ <member name="from" type="Transform3D" setter="set_from" getter="get_from" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)">
+ Transform in global space where the motion should start. Usually set to [member Node3D.global_transform] for the current body's transform.
+ </member>
+ <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.001">
+ Increases the size of the shapes involved in the collision detection.
+ </member>
+ <member name="max_collisions" type="int" setter="set_max_collisions" getter="get_max_collisions" default="1">
+ Maximum number of returned collisions, between [code]1[/code] and [code]32[/code]. Always returns the deepest detected collisions.
+ </member>
+ <member name="motion" type="Vector3" setter="set_motion" getter="get_motion" default="Vector3(0, 0, 0)">
+ Motion vector to define the length and direction of the motion to test.
+ </member>
+ </members>
+</class>
diff --git a/doc/classes/PhysicsTestMotionResult2D.xml b/doc/classes/PhysicsTestMotionResult2D.xml
index 8d594af673..355365cf25 100644
--- a/doc/classes/PhysicsTestMotionResult2D.xml
+++ b/doc/classes/PhysicsTestMotionResult2D.xml
@@ -1,35 +1,91 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PhysicsTestMotionResult2D" inherits="RefCounted" version="4.0">
<brief_description>
+ Result from a 2D body motion test.
</brief_description>
<description>
+ This class contains the motion and collision result from [method PhysicsServer2D.body_test_motion].
</description>
<tutorials>
</tutorials>
- <members>
- <member name="collider" type="Object" setter="" getter="get_collider">
- </member>
- <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0">
- </member>
- <member name="collider_rid" type="RID" setter="" getter="get_collider_rid">
- </member>
- <member name="collider_shape" type="int" setter="" getter="get_collider_shape" default="0">
- </member>
- <member name="collider_velocity" type="Vector2" setter="" getter="get_collider_velocity" default="Vector2(0, 0)">
- </member>
- <member name="collision_depth" type="float" setter="" getter="get_collision_depth" default="0.0">
- </member>
- <member name="collision_normal" type="Vector2" setter="" getter="get_collision_normal" default="Vector2(0, 0)">
- </member>
- <member name="collision_point" type="Vector2" setter="" getter="get_collision_point" default="Vector2(0, 0)">
- </member>
- <member name="collision_safe_fraction" type="float" setter="" getter="get_collision_safe_fraction" default="0.0">
- </member>
- <member name="collision_unsafe_fraction" type="float" setter="" getter="get_collision_unsafe_fraction" default="0.0">
- </member>
- <member name="remainder" type="Vector2" setter="" getter="get_remainder" default="Vector2(0, 0)">
- </member>
- <member name="travel" type="Vector2" setter="" getter="get_travel" default="Vector2(0, 0)">
- </member>
- </members>
+ <methods>
+ <method name="get_collider" qualifiers="const">
+ <return type="Object" />
+ <description>
+ Returns the colliding body's attached [Object], if a collision occured.
+ </description>
+ </method>
+ <method name="get_collider_id" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the unique instance ID of the colliding body's attached [Object], if a collision occured. See [method Object.get_instance_id].
+ </description>
+ </method>
+ <method name="get_collider_rid" qualifiers="const">
+ <return type="RID" />
+ <description>
+ Returns the colliding body's [RID] used by the [PhysicsServer2D], if a collision occured.
+ </description>
+ </method>
+ <method name="get_collider_shape" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the colliding body's shape index, if a collision occured. See [CollisionObject2D].
+ </description>
+ </method>
+ <method name="get_collider_velocity" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the colliding body's velocity, if a collision occured.
+ </description>
+ </method>
+ <method name="get_collision_depth" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the length of overlap along the collision normal, if a collision occured.
+ </description>
+ </method>
+ <method name="get_collision_local_shape" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the moving object's colliding shape, if a collision occured.
+ </description>
+ </method>
+ <method name="get_collision_normal" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the colliding body's shape's normal at the point of collision, if a collision occured.
+ </description>
+ </method>
+ <method name="get_collision_point" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the point of collision in global coordinates, if a collision occured.
+ </description>
+ </method>
+ <method name="get_collision_safe_fraction" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the maximum fraction of the motion that can occur without a collision, between [code]0[/code] and [code]1[/code].
+ </description>
+ </method>
+ <method name="get_collision_unsafe_fraction" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the minimum fraction of the motion needed to collide, if a collision occured, between [code]0[/code] and [code]1[/code].
+ </description>
+ </method>
+ <method name="get_remainder" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the moving object's remaining movement vector.
+ </description>
+ </method>
+ <method name="get_travel" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the moving object's travel before collision.
+ </description>
+ </method>
+ </methods>
</class>
diff --git a/doc/classes/PhysicsTestMotionResult3D.xml b/doc/classes/PhysicsTestMotionResult3D.xml
index 8aa087e99a..282c140568 100644
--- a/doc/classes/PhysicsTestMotionResult3D.xml
+++ b/doc/classes/PhysicsTestMotionResult3D.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PhysicsTestMotionResult3D" inherits="RefCounted" version="4.0">
<brief_description>
+ Result from a 3D body motion test.
</brief_description>
<description>
+ This class contains the motion and collision result from [method PhysicsServer3D.body_test_motion].
</description>
<tutorials>
</tutorials>
@@ -11,77 +13,94 @@
<return type="Object" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
+ Returns the colliding body's attached [Object] given a collision index (the deepest collision by default), if a collision occured.
</description>
</method>
<method name="get_collider_id" qualifiers="const">
<return type="int" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
+ Returns the unique instance ID of the colliding body's attached [Object] given a collision index (the deepest collision by default), if a collision occured. See [method Object.get_instance_id].
</description>
</method>
<method name="get_collider_rid" qualifiers="const">
<return type="RID" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
+ Returns the colliding body's [RID] used by the [PhysicsServer3D] given a collision index (the deepest collision by default), if a collision occured.
</description>
</method>
<method name="get_collider_shape" qualifiers="const">
<return type="int" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
+ Returns the colliding body's shape index given a collision index (the deepest collision by default), if a collision occured. See [CollisionObject3D].
</description>
</method>
<method name="get_collider_velocity" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
+ Returns the colliding body's velocity given a collision index (the deepest collision by default), if a collision occured.
+ </description>
+ </method>
+ <method name="get_collision_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the number of detected collisions.
</description>
</method>
<method name="get_collision_depth" qualifiers="const">
<return type="float" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
+ Returns the length of overlap along the collision normal given a collision index (the deepest collision by default), if a collision occured.
+ </description>
+ </method>
+ <method name="get_collision_local_shape" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="collision_index" type="int" default="0" />
+ <description>
+ Returns the moving object's colliding shape given a collision index (the deepest collision by default), if a collision occured.
</description>
</method>
<method name="get_collision_normal" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
+ Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default), if a collision occured.
</description>
</method>
<method name="get_collision_point" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="collision_index" type="int" default="0" />
<description>
+ Returns the point of collision in global coordinates given a collision index (the deepest collision by default), if a collision occured.
+ </description>
+ </method>
+ <method name="get_collision_safe_fraction" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the maximum fraction of the motion that can occur without a collision, between [code]0[/code] and [code]1[/code].
+ </description>
+ </method>
+ <method name="get_collision_unsafe_fraction" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the minimum fraction of the motion needed to collide, if a collision occured, between [code]0[/code] and [code]1[/code].
+ </description>
+ </method>
+ <method name="get_remainder" qualifiers="const">
+ <return type="Vector3" />
+ <description>
+ Returns the moving object's remaining movement vector.
+ </description>
+ </method>
+ <method name="get_travel" qualifiers="const">
+ <return type="Vector3" />
+ <description>
+ Returns the moving object's travel before collision.
</description>
</method>
</methods>
- <members>
- <member name="collider" type="Object" setter="" getter="get_best_collider">
- </member>
- <member name="collider_id" type="int" setter="" getter="get_best_collider_id" default="0">
- </member>
- <member name="collider_rid" type="RID" setter="" getter="get_best_collider_rid">
- </member>
- <member name="collider_shape" type="int" setter="" getter="get_best_collider_shape" default="0">
- </member>
- <member name="collider_velocity" type="Vector3" setter="" getter="get_best_collider_velocity" default="Vector3(0, 0, 0)">
- </member>
- <member name="collision_count" type="int" setter="" getter="get_collision_count" default="0">
- </member>
- <member name="collision_depth" type="float" setter="" getter="get_best_collision_depth" default="0.0">
- </member>
- <member name="collision_normal" type="Vector3" setter="" getter="get_best_collision_normal" default="Vector3(0, 0, 0)">
- </member>
- <member name="collision_point" type="Vector3" setter="" getter="get_best_collision_point" default="Vector3(0, 0, 0)">
- </member>
- <member name="remainder" type="Vector3" setter="" getter="get_remainder" default="Vector3(0, 0, 0)">
- </member>
- <member name="safe_fraction" type="float" setter="" getter="get_safe_fraction" default="0.0">
- </member>
- <member name="travel" type="Vector3" setter="" getter="get_travel" default="Vector3(0, 0, 0)">
- </member>
- <member name="unsafe_fraction" type="float" setter="" getter="get_unsafe_fraction" default="0.0">
- </member>
- </members>
</class>
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index e5fe823be6..532c9a7128 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -73,7 +73,7 @@
<return type="Vector2i" />
<argument index="0" name="body" type="RID" />
<description>
- Returns the coodinates of the tile for given physics body RID. Such RID can be retrieved from [member KinematicCollision2D.collider_rid], when colliding with a tile.
+ Returns the coodinates of the tile for given physics body RID. Such RID can be retrieved from [method KinematicCollision2D.get_collider_rid], when colliding with a tile.
</description>
</method>
<method name="get_layer_name" qualifiers="const">