class_kinematiccollision.rst 7.5 KB

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