class_kinematiccollision.rst 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the KinematicCollision.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_KinematicCollision:
  6. KinematicCollision
  7. ==================
  8. **Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Collision data for KinematicBody collisions.
  13. Properties
  14. ----------
  15. +-------------------------------+-------------------------------------------------------------------------------------+
  16. | :ref:`Object<class_Object>` | :ref:`collider<class_KinematicCollision_property_collider>` |
  17. +-------------------------------+-------------------------------------------------------------------------------------+
  18. | :ref:`int<class_int>` | :ref:`collider_id<class_KinematicCollision_property_collider_id>` |
  19. +-------------------------------+-------------------------------------------------------------------------------------+
  20. | :ref:`Variant<class_Variant>` | :ref:`collider_metadata<class_KinematicCollision_property_collider_metadata>` |
  21. +-------------------------------+-------------------------------------------------------------------------------------+
  22. | :ref:`Object<class_Object>` | :ref:`collider_shape<class_KinematicCollision_property_collider_shape>` |
  23. +-------------------------------+-------------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`collider_shape_index<class_KinematicCollision_property_collider_shape_index>` |
  25. +-------------------------------+-------------------------------------------------------------------------------------+
  26. | :ref:`Vector3<class_Vector3>` | :ref:`collider_velocity<class_KinematicCollision_property_collider_velocity>` |
  27. +-------------------------------+-------------------------------------------------------------------------------------+
  28. | :ref:`Object<class_Object>` | :ref:`local_shape<class_KinematicCollision_property_local_shape>` |
  29. +-------------------------------+-------------------------------------------------------------------------------------+
  30. | :ref:`Vector3<class_Vector3>` | :ref:`normal<class_KinematicCollision_property_normal>` |
  31. +-------------------------------+-------------------------------------------------------------------------------------+
  32. | :ref:`Vector3<class_Vector3>` | :ref:`position<class_KinematicCollision_property_position>` |
  33. +-------------------------------+-------------------------------------------------------------------------------------+
  34. | :ref:`Vector3<class_Vector3>` | :ref:`remainder<class_KinematicCollision_property_remainder>` |
  35. +-------------------------------+-------------------------------------------------------------------------------------+
  36. | :ref:`Vector3<class_Vector3>` | :ref:`travel<class_KinematicCollision_property_travel>` |
  37. +-------------------------------+-------------------------------------------------------------------------------------+
  38. Description
  39. -----------
  40. Contains collision data for KinematicBody collisions. When a :ref:`KinematicBody<class_KinematicBody>` is moved using :ref:`KinematicBody.move_and_collide<class_KinematicBody_method_move_and_collide>`, it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision object is returned.
  41. This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response.
  42. Property Descriptions
  43. ---------------------
  44. .. _class_KinematicCollision_property_collider:
  45. - :ref:`Object<class_Object>` **collider**
  46. +----------+----------------+
  47. | *Getter* | get_collider() |
  48. +----------+----------------+
  49. The colliding body.
  50. ----
  51. .. _class_KinematicCollision_property_collider_id:
  52. - :ref:`int<class_int>` **collider_id**
  53. +----------+-------------------+
  54. | *Getter* | get_collider_id() |
  55. +----------+-------------------+
  56. The colliding body's unique :ref:`RID<class_RID>`.
  57. ----
  58. .. _class_KinematicCollision_property_collider_metadata:
  59. - :ref:`Variant<class_Variant>` **collider_metadata**
  60. +----------+-------------------------+
  61. | *Getter* | get_collider_metadata() |
  62. +----------+-------------------------+
  63. The colliding body's metadata. See :ref:`Object<class_Object>`.
  64. ----
  65. .. _class_KinematicCollision_property_collider_shape:
  66. - :ref:`Object<class_Object>` **collider_shape**
  67. +----------+----------------------+
  68. | *Getter* | get_collider_shape() |
  69. +----------+----------------------+
  70. The colliding body's shape.
  71. ----
  72. .. _class_KinematicCollision_property_collider_shape_index:
  73. - :ref:`int<class_int>` **collider_shape_index**
  74. +----------+----------------------------+
  75. | *Getter* | get_collider_shape_index() |
  76. +----------+----------------------------+
  77. The colliding shape's index. See :ref:`CollisionObject<class_CollisionObject>`.
  78. ----
  79. .. _class_KinematicCollision_property_collider_velocity:
  80. - :ref:`Vector3<class_Vector3>` **collider_velocity**
  81. +----------+-------------------------+
  82. | *Getter* | get_collider_velocity() |
  83. +----------+-------------------------+
  84. The colliding object's velocity.
  85. ----
  86. .. _class_KinematicCollision_property_local_shape:
  87. - :ref:`Object<class_Object>` **local_shape**
  88. +----------+-------------------+
  89. | *Getter* | get_local_shape() |
  90. +----------+-------------------+
  91. The moving object's colliding shape.
  92. ----
  93. .. _class_KinematicCollision_property_normal:
  94. - :ref:`Vector3<class_Vector3>` **normal**
  95. +----------+--------------+
  96. | *Getter* | get_normal() |
  97. +----------+--------------+
  98. The colliding body's shape's normal at the point of collision.
  99. ----
  100. .. _class_KinematicCollision_property_position:
  101. - :ref:`Vector3<class_Vector3>` **position**
  102. +----------+----------------+
  103. | *Getter* | get_position() |
  104. +----------+----------------+
  105. The point of collision.
  106. ----
  107. .. _class_KinematicCollision_property_remainder:
  108. - :ref:`Vector3<class_Vector3>` **remainder**
  109. +----------+-----------------+
  110. | *Getter* | get_remainder() |
  111. +----------+-----------------+
  112. The moving object's remaining movement vector.
  113. ----
  114. .. _class_KinematicCollision_property_travel:
  115. - :ref:`Vector3<class_Vector3>` **travel**
  116. +----------+--------------+
  117. | *Getter* | get_travel() |
  118. +----------+--------------+
  119. The distance the moving object traveled before collision.