.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the KinematicCollision.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_KinematicCollision: KinematicCollision ================== **Inherits:** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Collision data for KinematicBody2D collisions. Member Functions ---------------- +--------------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_collider` **(** **)** const | +--------------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collider_id` **(** **)** const | +--------------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_collider_metadata` **(** **)** const | +--------------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_collider_shape` **(** **)** const | +--------------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collider_shape_index` **(** **)** const | +--------------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_collider_velocity` **(** **)** const | +--------------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_local_shape` **(** **)** const | +--------------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_normal` **(** **)** const | +--------------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_position` **(** **)** const | +--------------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_remainder` **(** **)** const | +--------------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_travel` **(** **)** const | +--------------------------------+-------------------------------------------------------------------------------------------------------+ Member Variables ---------------- - :ref:`Object` **collider** - The colliding body. - :ref:`int` **collider_id** - The colliding body's unique [RID]. - :ref:`Variant` **collider_metadata** - The colliding body's metadata. See [Object]. - :ref:`Object` **collider_shape** - The colliding body's shape. - :ref:`int` **collider_shape_index** - The colliding shape's index. See [CollisionObject]. - :ref:`Vector3` **collider_velocity** - The colliding object's velocity. - :ref:`Object` **local_shape** - The moving object's colliding shape. - :ref:`Vector3` **normal** - The colliding body's shape's normal at the point of collision. - :ref:`Vector3` **position** - The point of collision. - :ref:`Vector3` **remainder** - The moving object's remaining movement vector. - :ref:`Vector3` **travel** - The distance the moving object traveled before collision. Description ----------- Contains collision data for KinematicBody collisions. When a :ref:`KinematicBody` is moved using :ref:`KinematicBody.move_and_collide`, it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision object is returned. 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. Member Function Description --------------------------- .. _class_KinematicCollision_get_collider: - :ref:`Object` **get_collider** **(** **)** const .. _class_KinematicCollision_get_collider_id: - :ref:`int` **get_collider_id** **(** **)** const .. _class_KinematicCollision_get_collider_metadata: - :ref:`Variant` **get_collider_metadata** **(** **)** const .. _class_KinematicCollision_get_collider_shape: - :ref:`Object` **get_collider_shape** **(** **)** const .. _class_KinematicCollision_get_collider_shape_index: - :ref:`int` **get_collider_shape_index** **(** **)** const .. _class_KinematicCollision_get_collider_velocity: - :ref:`Vector3` **get_collider_velocity** **(** **)** const .. _class_KinematicCollision_get_local_shape: - :ref:`Object` **get_local_shape** **(** **)** const .. _class_KinematicCollision_get_normal: - :ref:`Vector3` **get_normal** **(** **)** const .. _class_KinematicCollision_get_position: - :ref:`Vector3` **get_position** **(** **)** const .. _class_KinematicCollision_get_remainder: - :ref:`Vector3` **get_remainder** **(** **)** const .. _class_KinematicCollision_get_travel: - :ref:`Vector3` **get_travel** **(** **)** const