class_physicstestmotionresult2d.rst 8.7 KB

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