class_physicstestmotionresult2d.rst 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. Result from a 2D body motion test.
  11. Description
  12. -----------
  13. This class contains the motion and collision result from :ref:`PhysicsServer2D.body_test_motion<class_PhysicsServer2D_method_body_test_motion>`.
  14. Methods
  15. -------
  16. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`Object<class_Object>` | :ref:`get_collider<class_PhysicsTestMotionResult2D_method_get_collider>` **(** **)** |const| |
  18. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`get_collider_id<class_PhysicsTestMotionResult2D_method_get_collider_id>` **(** **)** |const| |
  20. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`RID<class_RID>` | :ref:`get_collider_rid<class_PhysicsTestMotionResult2D_method_get_collider_rid>` **(** **)** |const| |
  22. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`get_collider_shape<class_PhysicsTestMotionResult2D_method_get_collider_shape>` **(** **)** |const| |
  24. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Vector2<class_Vector2>` | :ref:`get_collider_velocity<class_PhysicsTestMotionResult2D_method_get_collider_velocity>` **(** **)** |const| |
  26. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`get_collision_depth<class_PhysicsTestMotionResult2D_method_get_collision_depth>` **(** **)** |const| |
  28. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`int<class_int>` | :ref:`get_collision_local_shape<class_PhysicsTestMotionResult2D_method_get_collision_local_shape>` **(** **)** |const| |
  30. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`Vector2<class_Vector2>` | :ref:`get_collision_normal<class_PhysicsTestMotionResult2D_method_get_collision_normal>` **(** **)** |const| |
  32. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Vector2<class_Vector2>` | :ref:`get_collision_point<class_PhysicsTestMotionResult2D_method_get_collision_point>` **(** **)** |const| |
  34. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`float<class_float>` | :ref:`get_collision_safe_fraction<class_PhysicsTestMotionResult2D_method_get_collision_safe_fraction>` **(** **)** |const| |
  36. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`float<class_float>` | :ref:`get_collision_unsafe_fraction<class_PhysicsTestMotionResult2D_method_get_collision_unsafe_fraction>` **(** **)** |const| |
  38. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`Vector2<class_Vector2>` | :ref:`get_remainder<class_PhysicsTestMotionResult2D_method_get_remainder>` **(** **)** |const| |
  40. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Vector2<class_Vector2>` | :ref:`get_travel<class_PhysicsTestMotionResult2D_method_get_travel>` **(** **)** |const| |
  42. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  43. Method Descriptions
  44. -------------------
  45. .. _class_PhysicsTestMotionResult2D_method_get_collider:
  46. - :ref:`Object<class_Object>` **get_collider** **(** **)** |const|
  47. Returns the colliding body's attached :ref:`Object<class_Object>`, if a collision occurred.
  48. ----
  49. .. _class_PhysicsTestMotionResult2D_method_get_collider_id:
  50. - :ref:`int<class_int>` **get_collider_id** **(** **)** |const|
  51. 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>`.
  52. ----
  53. .. _class_PhysicsTestMotionResult2D_method_get_collider_rid:
  54. - :ref:`RID<class_RID>` **get_collider_rid** **(** **)** |const|
  55. Returns the colliding body's :ref:`RID<class_RID>` used by the :ref:`PhysicsServer2D<class_PhysicsServer2D>`, if a collision occurred.
  56. ----
  57. .. _class_PhysicsTestMotionResult2D_method_get_collider_shape:
  58. - :ref:`int<class_int>` **get_collider_shape** **(** **)** |const|
  59. Returns the colliding body's shape index, if a collision occurred. See :ref:`CollisionObject2D<class_CollisionObject2D>`.
  60. ----
  61. .. _class_PhysicsTestMotionResult2D_method_get_collider_velocity:
  62. - :ref:`Vector2<class_Vector2>` **get_collider_velocity** **(** **)** |const|
  63. Returns the colliding body's velocity, if a collision occurred.
  64. ----
  65. .. _class_PhysicsTestMotionResult2D_method_get_collision_depth:
  66. - :ref:`float<class_float>` **get_collision_depth** **(** **)** |const|
  67. Returns the length of overlap along the collision normal, if a collision occurred.
  68. ----
  69. .. _class_PhysicsTestMotionResult2D_method_get_collision_local_shape:
  70. - :ref:`int<class_int>` **get_collision_local_shape** **(** **)** |const|
  71. Returns the moving object's colliding shape, if a collision occurred.
  72. ----
  73. .. _class_PhysicsTestMotionResult2D_method_get_collision_normal:
  74. - :ref:`Vector2<class_Vector2>` **get_collision_normal** **(** **)** |const|
  75. Returns the colliding body's shape's normal at the point of collision, if a collision occurred.
  76. ----
  77. .. _class_PhysicsTestMotionResult2D_method_get_collision_point:
  78. - :ref:`Vector2<class_Vector2>` **get_collision_point** **(** **)** |const|
  79. Returns the point of collision in global coordinates, if a collision occurred.
  80. ----
  81. .. _class_PhysicsTestMotionResult2D_method_get_collision_safe_fraction:
  82. - :ref:`float<class_float>` **get_collision_safe_fraction** **(** **)** |const|
  83. Returns the maximum fraction of the motion that can occur without a collision, between ``0`` and ``1``.
  84. ----
  85. .. _class_PhysicsTestMotionResult2D_method_get_collision_unsafe_fraction:
  86. - :ref:`float<class_float>` **get_collision_unsafe_fraction** **(** **)** |const|
  87. Returns the minimum fraction of the motion needed to collide, if a collision occurred, between ``0`` and ``1``.
  88. ----
  89. .. _class_PhysicsTestMotionResult2D_method_get_remainder:
  90. - :ref:`Vector2<class_Vector2>` **get_remainder** **(** **)** |const|
  91. Returns the moving object's remaining movement vector.
  92. ----
  93. .. _class_PhysicsTestMotionResult2D_method_get_travel:
  94. - :ref:`Vector2<class_Vector2>` **get_travel** **(** **)** |const|
  95. Returns the moving object's travel before collision.
  96. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  97. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  98. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  99. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  100. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  101. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`