Files
godot-docs/classes/class_physicstestmotionresult3d.rst
2021-10-06 11:19:07 +02:00

173 lines
11 KiB
ReStructuredText

:github_url: hide
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the PhysicsTestMotionResult3D.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_PhysicsTestMotionResult3D:
PhysicsTestMotionResult3D
=========================
**Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
Result from a 3D body motion test.
Description
-----------
This class contains the motion and collision result from :ref:`PhysicsServer3D.body_test_motion<class_PhysicsServer3D_method_body_test_motion>`.
Methods
-------
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Object<class_Object>` | :ref:`get_collider<class_PhysicsTestMotionResult3D_method_get_collider>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_collider_id<class_PhysicsTestMotionResult3D_method_get_collider_id>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`RID<class_RID>` | :ref:`get_collider_rid<class_PhysicsTestMotionResult3D_method_get_collider_rid>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_collider_shape<class_PhysicsTestMotionResult3D_method_get_collider_shape>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_collider_velocity<class_PhysicsTestMotionResult3D_method_get_collider_velocity>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_collision_count<class_PhysicsTestMotionResult3D_method_get_collision_count>` **(** **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_collision_depth<class_PhysicsTestMotionResult3D_method_get_collision_depth>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_collision_local_shape<class_PhysicsTestMotionResult3D_method_get_collision_local_shape>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_collision_normal<class_PhysicsTestMotionResult3D_method_get_collision_normal>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_collision_point<class_PhysicsTestMotionResult3D_method_get_collision_point>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_collision_safe_fraction<class_PhysicsTestMotionResult3D_method_get_collision_safe_fraction>` **(** **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_collision_unsafe_fraction<class_PhysicsTestMotionResult3D_method_get_collision_unsafe_fraction>` **(** **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_remainder<class_PhysicsTestMotionResult3D_method_get_remainder>` **(** **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_travel<class_PhysicsTestMotionResult3D_method_get_travel>` **(** **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_PhysicsTestMotionResult3D_method_get_collider:
- :ref:`Object<class_Object>` **get_collider** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
Returns the colliding body's attached :ref:`Object<class_Object>` given a collision index (the deepest collision by default), if a collision occured.
----
.. _class_PhysicsTestMotionResult3D_method_get_collider_id:
- :ref:`int<class_int>` **get_collider_id** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
Returns the unique instance ID of the colliding body's attached :ref:`Object<class_Object>` given a collision index (the deepest collision by default), if a collision occured. See :ref:`Object.get_instance_id<class_Object_method_get_instance_id>`.
----
.. _class_PhysicsTestMotionResult3D_method_get_collider_rid:
- :ref:`RID<class_RID>` **get_collider_rid** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
Returns the colliding body's :ref:`RID<class_RID>` used by the :ref:`PhysicsServer3D<class_PhysicsServer3D>` given a collision index (the deepest collision by default), if a collision occured.
----
.. _class_PhysicsTestMotionResult3D_method_get_collider_shape:
- :ref:`int<class_int>` **get_collider_shape** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
Returns the colliding body's shape index given a collision index (the deepest collision by default), if a collision occured. See :ref:`CollisionObject3D<class_CollisionObject3D>`.
----
.. _class_PhysicsTestMotionResult3D_method_get_collider_velocity:
- :ref:`Vector3<class_Vector3>` **get_collider_velocity** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
Returns the colliding body's velocity given a collision index (the deepest collision by default), if a collision occured.
----
.. _class_PhysicsTestMotionResult3D_method_get_collision_count:
- :ref:`int<class_int>` **get_collision_count** **(** **)** |const|
Returns the number of detected collisions.
----
.. _class_PhysicsTestMotionResult3D_method_get_collision_depth:
- :ref:`float<class_float>` **get_collision_depth** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
Returns the length of overlap along the collision normal given a collision index (the deepest collision by default), if a collision occured.
----
.. _class_PhysicsTestMotionResult3D_method_get_collision_local_shape:
- :ref:`int<class_int>` **get_collision_local_shape** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
Returns the moving object's colliding shape given a collision index (the deepest collision by default), if a collision occured.
----
.. _class_PhysicsTestMotionResult3D_method_get_collision_normal:
- :ref:`Vector3<class_Vector3>` **get_collision_normal** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
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.
----
.. _class_PhysicsTestMotionResult3D_method_get_collision_point:
- :ref:`Vector3<class_Vector3>` **get_collision_point** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
Returns the point of collision in global coordinates given a collision index (the deepest collision by default), if a collision occured.
----
.. _class_PhysicsTestMotionResult3D_method_get_collision_safe_fraction:
- :ref:`float<class_float>` **get_collision_safe_fraction** **(** **)** |const|
Returns the maximum fraction of the motion that can occur without a collision, between ``0`` and ``1``.
----
.. _class_PhysicsTestMotionResult3D_method_get_collision_unsafe_fraction:
- :ref:`float<class_float>` **get_collision_unsafe_fraction** **(** **)** |const|
Returns the minimum fraction of the motion needed to collide, if a collision occured, between ``0`` and ``1``.
----
.. _class_PhysicsTestMotionResult3D_method_get_remainder:
- :ref:`Vector3<class_Vector3>` **get_remainder** **(** **)** |const|
Returns the moving object's remaining movement vector.
----
.. _class_PhysicsTestMotionResult3D_method_get_travel:
- :ref:`Vector3<class_Vector3>` **get_travel** **(** **)** |const|
Returns the moving object's travel before collision.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`