KinematicCollision.xml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="KinematicCollision" inherits="Reference" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. Collision data for [KinematicBody] collisions.
  5. </brief_description>
  6. <description>
  7. Contains collision data for [KinematicBody] collisions. When a [KinematicBody] is moved using [method KinematicBody.move_and_collide], it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision 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. <methods>
  13. <method name="get_angle" qualifiers="const">
  14. <return type="float" />
  15. <argument index="0" name="up_direction" type="Vector3" default="Vector3( 0, 1, 0 )" />
  16. <description>
  17. The collision angle according to [code]up_direction[/code], which is [code]Vector3.UP[/code] by default. This value is always positive.
  18. </description>
  19. </method>
  20. </methods>
  21. <members>
  22. <member name="collider" type="Object" setter="" getter="get_collider">
  23. The colliding body.
  24. </member>
  25. <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0">
  26. The colliding body's unique instance ID. See [method Object.get_instance_id].
  27. </member>
  28. <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata">
  29. The colliding body's metadata. See [Object].
  30. </member>
  31. <member name="collider_rid" type="RID" setter="" getter="get_collider_rid">
  32. The colliding body's [RID] used by the [PhysicsServer].
  33. </member>
  34. <member name="collider_shape" type="Object" setter="" getter="get_collider_shape">
  35. The colliding body's shape.
  36. </member>
  37. <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index" default="0">
  38. The colliding shape's index. See [CollisionObject].
  39. </member>
  40. <member name="collider_velocity" type="Vector3" setter="" getter="get_collider_velocity" default="Vector3( 0, 0, 0 )">
  41. The colliding object's velocity.
  42. </member>
  43. <member name="local_shape" type="Object" setter="" getter="get_local_shape">
  44. The moving object's colliding shape.
  45. </member>
  46. <member name="normal" type="Vector3" setter="" getter="get_normal" default="Vector3( 0, 0, 0 )">
  47. The colliding body's shape's normal at the point of collision.
  48. </member>
  49. <member name="position" type="Vector3" setter="" getter="get_position" default="Vector3( 0, 0, 0 )">
  50. The point of collision, in global coordinates.
  51. </member>
  52. <member name="remainder" type="Vector3" setter="" getter="get_remainder" default="Vector3( 0, 0, 0 )">
  53. The moving object's remaining movement vector.
  54. </member>
  55. <member name="travel" type="Vector3" setter="" getter="get_travel" default="Vector3( 0, 0, 0 )">
  56. The distance the moving object traveled before collision.
  57. </member>
  58. </members>
  59. <constants>
  60. </constants>
  61. </class>