class_kinematiccollision2d.rst 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the KinematicCollision2D.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_KinematicCollision2D:
  5. KinematicCollision2D
  6. ====================
  7. **Inherits:** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Collision data for KinematicBody2D collisions.
  12. Member Variables
  13. ----------------
  14. .. _class_KinematicCollision2D_collider:
  15. - :ref:`Object<class_object>` **collider** - The colliding body.
  16. .. _class_KinematicCollision2D_collider_id:
  17. - :ref:`int<class_int>` **collider_id** - The colliding body's unique :ref:`RID<class_rid>`.
  18. .. _class_KinematicCollision2D_collider_metadata:
  19. - :ref:`Variant<class_variant>` **collider_metadata** - The colliding body's metadata. See :ref:`Object<class_object>`.
  20. .. _class_KinematicCollision2D_collider_shape:
  21. - :ref:`Object<class_object>` **collider_shape** - The colliding body's shape.
  22. .. _class_KinematicCollision2D_collider_shape_index:
  23. - :ref:`int<class_int>` **collider_shape_index** - The colliding shape's index. See :ref:`CollisionObject2D<class_collisionobject2d>`.
  24. .. _class_KinematicCollision2D_collider_velocity:
  25. - :ref:`Vector2<class_vector2>` **collider_velocity** - The colliding object's velocity.
  26. .. _class_KinematicCollision2D_local_shape:
  27. - :ref:`Object<class_object>` **local_shape** - The moving object's colliding shape.
  28. .. _class_KinematicCollision2D_normal:
  29. - :ref:`Vector2<class_vector2>` **normal** - The colliding body's shape's normal at the point of collision.
  30. .. _class_KinematicCollision2D_position:
  31. - :ref:`Vector2<class_vector2>` **position** - The point of collision.
  32. .. _class_KinematicCollision2D_remainder:
  33. - :ref:`Vector2<class_vector2>` **remainder** - The moving object's remaining movement vector.
  34. .. _class_KinematicCollision2D_travel:
  35. - :ref:`Vector2<class_vector2>` **travel** - The distance the moving object traveled before collision.
  36. Description
  37. -----------
  38. Contains collision data for KinematicBody2D collisions. When a :ref:`KinematicBody2D<class_kinematicbody2d>` is moved using :ref:`KinematicBody2D.move_and_collide<class_KinematicBody2D_move_and_collide>`, it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision2D 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.