class_physicstestmotionresult3d.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the PhysicsTestMotionResult3D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_PhysicsTestMotionResult3D:
  6. PhysicsTestMotionResult3D
  7. =========================
  8. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Result from a 3D body motion test.
  10. Description
  11. -----------
  12. This class contains the motion and collision result from :ref:`PhysicsServer3D.body_test_motion<class_PhysicsServer3D_method_body_test_motion>`.
  13. Methods
  14. -------
  15. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`Object<class_Object>` | :ref:`get_collider<class_PhysicsTestMotionResult3D_method_get_collider>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
  17. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`int<class_int>` | :ref:`get_collider_id<class_PhysicsTestMotionResult3D_method_get_collider_id>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
  19. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`RID<class_RID>` | :ref:`get_collider_rid<class_PhysicsTestMotionResult3D_method_get_collider_rid>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
  21. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`int<class_int>` | :ref:`get_collider_shape<class_PhysicsTestMotionResult3D_method_get_collider_shape>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
  23. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Vector3<class_Vector3>` | :ref:`get_collider_velocity<class_PhysicsTestMotionResult3D_method_get_collider_velocity>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
  25. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`get_collision_count<class_PhysicsTestMotionResult3D_method_get_collision_count>` **(** **)** |const| |
  27. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`get_collision_depth<class_PhysicsTestMotionResult3D_method_get_collision_depth>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
  29. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`int<class_int>` | :ref:`get_collision_local_shape<class_PhysicsTestMotionResult3D_method_get_collision_local_shape>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
  31. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`Vector3<class_Vector3>` | :ref:`get_collision_normal<class_PhysicsTestMotionResult3D_method_get_collision_normal>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
  33. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`Vector3<class_Vector3>` | :ref:`get_collision_point<class_PhysicsTestMotionResult3D_method_get_collision_point>` **(** :ref:`int<class_int>` collision_index=0 **)** |const| |
  35. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`float<class_float>` | :ref:`get_collision_safe_fraction<class_PhysicsTestMotionResult3D_method_get_collision_safe_fraction>` **(** **)** |const| |
  37. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`get_collision_unsafe_fraction<class_PhysicsTestMotionResult3D_method_get_collision_unsafe_fraction>` **(** **)** |const| |
  39. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`Vector3<class_Vector3>` | :ref:`get_remainder<class_PhysicsTestMotionResult3D_method_get_remainder>` **(** **)** |const| |
  41. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`Vector3<class_Vector3>` | :ref:`get_travel<class_PhysicsTestMotionResult3D_method_get_travel>` **(** **)** |const| |
  43. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. Method Descriptions
  45. -------------------
  46. .. _class_PhysicsTestMotionResult3D_method_get_collider:
  47. - :ref:`Object<class_Object>` **get_collider** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
  48. Returns the colliding body's attached :ref:`Object<class_Object>` given a collision index (the deepest collision by default), if a collision occurred.
  49. ----
  50. .. _class_PhysicsTestMotionResult3D_method_get_collider_id:
  51. - :ref:`int<class_int>` **get_collider_id** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
  52. 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 occurred. See :ref:`Object.get_instance_id<class_Object_method_get_instance_id>`.
  53. ----
  54. .. _class_PhysicsTestMotionResult3D_method_get_collider_rid:
  55. - :ref:`RID<class_RID>` **get_collider_rid** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
  56. 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 occurred.
  57. ----
  58. .. _class_PhysicsTestMotionResult3D_method_get_collider_shape:
  59. - :ref:`int<class_int>` **get_collider_shape** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
  60. Returns the colliding body's shape index given a collision index (the deepest collision by default), if a collision occurred. See :ref:`CollisionObject3D<class_CollisionObject3D>`.
  61. ----
  62. .. _class_PhysicsTestMotionResult3D_method_get_collider_velocity:
  63. - :ref:`Vector3<class_Vector3>` **get_collider_velocity** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
  64. Returns the colliding body's velocity given a collision index (the deepest collision by default), if a collision occurred.
  65. ----
  66. .. _class_PhysicsTestMotionResult3D_method_get_collision_count:
  67. - :ref:`int<class_int>` **get_collision_count** **(** **)** |const|
  68. Returns the number of detected collisions.
  69. ----
  70. .. _class_PhysicsTestMotionResult3D_method_get_collision_depth:
  71. - :ref:`float<class_float>` **get_collision_depth** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
  72. Returns the length of overlap along the collision normal given a collision index (the deepest collision by default), if a collision occurred.
  73. ----
  74. .. _class_PhysicsTestMotionResult3D_method_get_collision_local_shape:
  75. - :ref:`int<class_int>` **get_collision_local_shape** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
  76. Returns the moving object's colliding shape given a collision index (the deepest collision by default), if a collision occurred.
  77. ----
  78. .. _class_PhysicsTestMotionResult3D_method_get_collision_normal:
  79. - :ref:`Vector3<class_Vector3>` **get_collision_normal** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
  80. 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 occurred.
  81. ----
  82. .. _class_PhysicsTestMotionResult3D_method_get_collision_point:
  83. - :ref:`Vector3<class_Vector3>` **get_collision_point** **(** :ref:`int<class_int>` collision_index=0 **)** |const|
  84. Returns the point of collision in global coordinates given a collision index (the deepest collision by default), if a collision occurred.
  85. ----
  86. .. _class_PhysicsTestMotionResult3D_method_get_collision_safe_fraction:
  87. - :ref:`float<class_float>` **get_collision_safe_fraction** **(** **)** |const|
  88. Returns the maximum fraction of the motion that can occur without a collision, between ``0`` and ``1``.
  89. ----
  90. .. _class_PhysicsTestMotionResult3D_method_get_collision_unsafe_fraction:
  91. - :ref:`float<class_float>` **get_collision_unsafe_fraction** **(** **)** |const|
  92. Returns the minimum fraction of the motion needed to collide, if a collision occurred, between ``0`` and ``1``.
  93. ----
  94. .. _class_PhysicsTestMotionResult3D_method_get_remainder:
  95. - :ref:`Vector3<class_Vector3>` **get_remainder** **(** **)** |const|
  96. Returns the moving object's remaining movement vector.
  97. ----
  98. .. _class_PhysicsTestMotionResult3D_method_get_travel:
  99. - :ref:`Vector3<class_Vector3>` **get_travel** **(** **)** |const|
  100. Returns the moving object's travel before collision.
  101. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  102. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  103. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  104. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  105. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  106. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`