KinematicCollision2D.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="KinematicCollision2D" inherits="Reference" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Collision data for KinematicBody2D collisions.
  5. </brief_description>
  6. <description>
  7. Contains collision data for KinematicBody2D collisions. When a [KinematicBody2D] is moved using [method KinematicBody2D.move_and_collide], it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision2D object is returned.
  8. 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.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <demos>
  13. </demos>
  14. <methods>
  15. <method name="get_collider" qualifiers="const">
  16. <return type="Object">
  17. </return>
  18. <description>
  19. </description>
  20. </method>
  21. <method name="get_collider_id" qualifiers="const">
  22. <return type="int">
  23. </return>
  24. <description>
  25. </description>
  26. </method>
  27. <method name="get_collider_metadata" qualifiers="const">
  28. <return type="Variant">
  29. </return>
  30. <description>
  31. </description>
  32. </method>
  33. <method name="get_collider_shape" qualifiers="const">
  34. <return type="Object">
  35. </return>
  36. <description>
  37. </description>
  38. </method>
  39. <method name="get_collider_shape_index" qualifiers="const">
  40. <return type="int">
  41. </return>
  42. <description>
  43. </description>
  44. </method>
  45. <method name="get_collider_velocity" qualifiers="const">
  46. <return type="Vector2">
  47. </return>
  48. <description>
  49. </description>
  50. </method>
  51. <method name="get_local_shape" qualifiers="const">
  52. <return type="Object">
  53. </return>
  54. <description>
  55. </description>
  56. </method>
  57. <method name="get_normal" qualifiers="const">
  58. <return type="Vector2">
  59. </return>
  60. <description>
  61. </description>
  62. </method>
  63. <method name="get_position" qualifiers="const">
  64. <return type="Vector2">
  65. </return>
  66. <description>
  67. </description>
  68. </method>
  69. <method name="get_remainder" qualifiers="const">
  70. <return type="Vector2">
  71. </return>
  72. <description>
  73. </description>
  74. </method>
  75. <method name="get_travel" qualifiers="const">
  76. <return type="Vector2">
  77. </return>
  78. <description>
  79. </description>
  80. </method>
  81. </methods>
  82. <members>
  83. <member name="collider" type="Object" setter="" getter="get_collider">
  84. The colliding body.
  85. </member>
  86. <member name="collider_id" type="int" setter="" getter="get_collider_id">
  87. The colliding body's unique [RID].
  88. </member>
  89. <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata">
  90. The colliding body's metadata. See [Object].
  91. </member>
  92. <member name="collider_shape" type="Object" setter="" getter="get_collider_shape">
  93. The colliding body's shape.
  94. </member>
  95. <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index">
  96. The colliding shape's index. See [CollisionObject2D].
  97. </member>
  98. <member name="collider_velocity" type="Vector2" setter="" getter="get_collider_velocity">
  99. The colliding object's velocity.
  100. </member>
  101. <member name="local_shape" type="Object" setter="" getter="get_local_shape">
  102. The moving object's colliding shape.
  103. </member>
  104. <member name="normal" type="Vector2" setter="" getter="get_normal">
  105. The colliding body's shape's normal at the point of collision.
  106. </member>
  107. <member name="position" type="Vector2" setter="" getter="get_position">
  108. The point of collision.
  109. </member>
  110. <member name="remainder" type="Vector2" setter="" getter="get_remainder">
  111. The moving object's remaining movement vector.
  112. </member>
  113. <member name="travel" type="Vector2" setter="" getter="get_travel">
  114. The distance the moving object traveled before collision.
  115. </member>
  116. </members>
  117. <constants>
  118. </constants>
  119. </class>