class_kinematiccollision.rst 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 KinematicBody collisions.
  12. Member Variables
  13. ----------------
  14. .. _class_KinematicCollision_collider:
  15. - :ref:`Object<class_object>` **collider** - The colliding body.
  16. .. _class_KinematicCollision_collider_id:
  17. - :ref:`int<class_int>` **collider_id** - The colliding body's unique :ref:`RID<class_rid>`.
  18. .. _class_KinematicCollision_collider_metadata:
  19. - :ref:`Variant<class_variant>` **collider_metadata** - The colliding body's metadata. See :ref:`Object<class_object>`.
  20. .. _class_KinematicCollision_collider_shape:
  21. - :ref:`Object<class_object>` **collider_shape** - The colliding body's shape.
  22. .. _class_KinematicCollision_collider_shape_index:
  23. - :ref:`int<class_int>` **collider_shape_index** - The colliding shape's index. See :ref:`CollisionObject<class_collisionobject>`.
  24. .. _class_KinematicCollision_collider_velocity:
  25. - :ref:`Vector3<class_vector3>` **collider_velocity** - The colliding object's velocity.
  26. .. _class_KinematicCollision_local_shape:
  27. - :ref:`Object<class_object>` **local_shape** - The moving object's colliding shape.
  28. .. _class_KinematicCollision_normal:
  29. - :ref:`Vector3<class_vector3>` **normal** - The colliding body's shape's normal at the point of collision.
  30. .. _class_KinematicCollision_position:
  31. - :ref:`Vector3<class_vector3>` **position** - The point of collision.
  32. .. _class_KinematicCollision_remainder:
  33. - :ref:`Vector3<class_vector3>` **remainder** - The moving object's remaining movement vector.
  34. .. _class_KinematicCollision_travel:
  35. - :ref:`Vector3<class_vector3>` **travel** - The distance the moving object traveled before collision.
  36. Description
  37. -----------
  38. Contains collision data for KinematicBody collisions. When a :ref:`KinematicBody<class_kinematicbody>` is moved using :ref:`KinematicBody.move_and_collide<class_KinematicBody_move_and_collide>`, it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision object is returned.
  39. 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.