class_physicstestmotionresult2d.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/PhysicsTestMotionResult2D.xml.
  6. .. _class_PhysicsTestMotionResult2D:
  7. PhysicsTestMotionResult2D
  8. =========================
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Describes the motion and collision result from :ref:`PhysicsServer2D.body_test_motion<class_PhysicsServer2D_method_body_test_motion>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Describes the motion and collision result from :ref:`PhysicsServer2D.body_test_motion<class_PhysicsServer2D_method_body_test_motion>`.
  15. .. rst-class:: classref-reftable-group
  16. Methods
  17. -------
  18. .. table::
  19. :widths: auto
  20. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Object<class_Object>` | :ref:`get_collider<class_PhysicsTestMotionResult2D_method_get_collider>` **(** **)** |const| |
  22. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`get_collider_id<class_PhysicsTestMotionResult2D_method_get_collider_id>` **(** **)** |const| |
  24. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`RID<class_RID>` | :ref:`get_collider_rid<class_PhysicsTestMotionResult2D_method_get_collider_rid>` **(** **)** |const| |
  26. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`get_collider_shape<class_PhysicsTestMotionResult2D_method_get_collider_shape>` **(** **)** |const| |
  28. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`Vector2<class_Vector2>` | :ref:`get_collider_velocity<class_PhysicsTestMotionResult2D_method_get_collider_velocity>` **(** **)** |const| |
  30. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`float<class_float>` | :ref:`get_collision_depth<class_PhysicsTestMotionResult2D_method_get_collision_depth>` **(** **)** |const| |
  32. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`int<class_int>` | :ref:`get_collision_local_shape<class_PhysicsTestMotionResult2D_method_get_collision_local_shape>` **(** **)** |const| |
  34. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`Vector2<class_Vector2>` | :ref:`get_collision_normal<class_PhysicsTestMotionResult2D_method_get_collision_normal>` **(** **)** |const| |
  36. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`Vector2<class_Vector2>` | :ref:`get_collision_point<class_PhysicsTestMotionResult2D_method_get_collision_point>` **(** **)** |const| |
  38. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`float<class_float>` | :ref:`get_collision_safe_fraction<class_PhysicsTestMotionResult2D_method_get_collision_safe_fraction>` **(** **)** |const| |
  40. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`float<class_float>` | :ref:`get_collision_unsafe_fraction<class_PhysicsTestMotionResult2D_method_get_collision_unsafe_fraction>` **(** **)** |const| |
  42. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`Vector2<class_Vector2>` | :ref:`get_remainder<class_PhysicsTestMotionResult2D_method_get_remainder>` **(** **)** |const| |
  44. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`Vector2<class_Vector2>` | :ref:`get_travel<class_PhysicsTestMotionResult2D_method_get_travel>` **(** **)** |const| |
  46. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  47. .. rst-class:: classref-section-separator
  48. ----
  49. .. rst-class:: classref-descriptions-group
  50. Method Descriptions
  51. -------------------
  52. .. _class_PhysicsTestMotionResult2D_method_get_collider:
  53. .. rst-class:: classref-method
  54. :ref:`Object<class_Object>` **get_collider** **(** **)** |const|
  55. Returns the colliding body's attached :ref:`Object<class_Object>`, if a collision occurred.
  56. .. rst-class:: classref-item-separator
  57. ----
  58. .. _class_PhysicsTestMotionResult2D_method_get_collider_id:
  59. .. rst-class:: classref-method
  60. :ref:`int<class_int>` **get_collider_id** **(** **)** |const|
  61. Returns the unique instance ID of the colliding body's attached :ref:`Object<class_Object>`, if a collision occurred. See :ref:`Object.get_instance_id<class_Object_method_get_instance_id>`.
  62. .. rst-class:: classref-item-separator
  63. ----
  64. .. _class_PhysicsTestMotionResult2D_method_get_collider_rid:
  65. .. rst-class:: classref-method
  66. :ref:`RID<class_RID>` **get_collider_rid** **(** **)** |const|
  67. Returns the colliding body's :ref:`RID<class_RID>` used by the :ref:`PhysicsServer2D<class_PhysicsServer2D>`, if a collision occurred.
  68. .. rst-class:: classref-item-separator
  69. ----
  70. .. _class_PhysicsTestMotionResult2D_method_get_collider_shape:
  71. .. rst-class:: classref-method
  72. :ref:`int<class_int>` **get_collider_shape** **(** **)** |const|
  73. Returns the colliding body's shape index, if a collision occurred. See :ref:`CollisionObject2D<class_CollisionObject2D>`.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_PhysicsTestMotionResult2D_method_get_collider_velocity:
  77. .. rst-class:: classref-method
  78. :ref:`Vector2<class_Vector2>` **get_collider_velocity** **(** **)** |const|
  79. Returns the colliding body's velocity, if a collision occurred.
  80. .. rst-class:: classref-item-separator
  81. ----
  82. .. _class_PhysicsTestMotionResult2D_method_get_collision_depth:
  83. .. rst-class:: classref-method
  84. :ref:`float<class_float>` **get_collision_depth** **(** **)** |const|
  85. Returns the length of overlap along the collision normal, if a collision occurred.
  86. .. rst-class:: classref-item-separator
  87. ----
  88. .. _class_PhysicsTestMotionResult2D_method_get_collision_local_shape:
  89. .. rst-class:: classref-method
  90. :ref:`int<class_int>` **get_collision_local_shape** **(** **)** |const|
  91. Returns the moving object's colliding shape, if a collision occurred.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _class_PhysicsTestMotionResult2D_method_get_collision_normal:
  95. .. rst-class:: classref-method
  96. :ref:`Vector2<class_Vector2>` **get_collision_normal** **(** **)** |const|
  97. Returns the colliding body's shape's normal at the point of collision, if a collision occurred.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_PhysicsTestMotionResult2D_method_get_collision_point:
  101. .. rst-class:: classref-method
  102. :ref:`Vector2<class_Vector2>` **get_collision_point** **(** **)** |const|
  103. Returns the point of collision in global coordinates, if a collision occurred.
  104. .. rst-class:: classref-item-separator
  105. ----
  106. .. _class_PhysicsTestMotionResult2D_method_get_collision_safe_fraction:
  107. .. rst-class:: classref-method
  108. :ref:`float<class_float>` **get_collision_safe_fraction** **(** **)** |const|
  109. Returns the maximum fraction of the motion that can occur without a collision, between ``0`` and ``1``.
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _class_PhysicsTestMotionResult2D_method_get_collision_unsafe_fraction:
  113. .. rst-class:: classref-method
  114. :ref:`float<class_float>` **get_collision_unsafe_fraction** **(** **)** |const|
  115. Returns the minimum fraction of the motion needed to collide, if a collision occurred, between ``0`` and ``1``.
  116. .. rst-class:: classref-item-separator
  117. ----
  118. .. _class_PhysicsTestMotionResult2D_method_get_remainder:
  119. .. rst-class:: classref-method
  120. :ref:`Vector2<class_Vector2>` **get_remainder** **(** **)** |const|
  121. Returns the moving object's remaining movement vector.
  122. .. rst-class:: classref-item-separator
  123. ----
  124. .. _class_PhysicsTestMotionResult2D_method_get_travel:
  125. .. rst-class:: classref-method
  126. :ref:`Vector2<class_Vector2>` **get_travel** **(** **)** |const|
  127. Returns the moving object's travel before collision.
  128. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  129. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  130. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  131. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  132. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  133. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  134. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`