:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/KinematicCollision.xml. .. _class_KinematicCollision: KinematicCollision ================== **Inherits:** :ref:`Reference` **<** :ref:`Object` Collision data for :ref:`KinematicBody` collisions. Description ----------- Contains collision data for :ref:`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. Properties ---------- +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`Object` | :ref:`collider` | | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`int` | :ref:`collider_id` | ``0`` | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`Variant` | :ref:`collider_metadata` | | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`RID` | :ref:`collider_rid` | | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`Object` | :ref:`collider_shape` | | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`int` | :ref:`collider_shape_index` | ``0`` | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`Vector3` | :ref:`collider_velocity` | ``Vector3( 0, 0, 0 )`` | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`Object` | :ref:`local_shape` | | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`Vector3` | :ref:`normal` | ``Vector3( 0, 0, 0 )`` | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`Vector3` | :ref:`position` | ``Vector3( 0, 0, 0 )`` | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`Vector3` | :ref:`remainder` | ``Vector3( 0, 0, 0 )`` | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ | :ref:`Vector3` | :ref:`travel` | ``Vector3( 0, 0, 0 )`` | +-------------------------------+-------------------------------------------------------------------------------------+------------------------+ Methods ------- +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_angle` **(** :ref:`Vector3` up_direction=Vector3( 0, 1, 0 ) **)** |const| | +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- .. _class_KinematicCollision_property_collider: - :ref:`Object` **collider** +----------+----------------+ | *Getter* | get_collider() | +----------+----------------+ The colliding body. ---- .. _class_KinematicCollision_property_collider_id: - :ref:`int` **collider_id** +-----------+-------------------+ | *Default* | ``0`` | +-----------+-------------------+ | *Getter* | get_collider_id() | +-----------+-------------------+ The colliding body's unique instance ID. See :ref:`Object.get_instance_id`. ---- .. _class_KinematicCollision_property_collider_metadata: - :ref:`Variant` **collider_metadata** +----------+-------------------------+ | *Getter* | get_collider_metadata() | +----------+-------------------------+ The colliding body's metadata. See :ref:`Object`. ---- .. _class_KinematicCollision_property_collider_rid: - :ref:`RID` **collider_rid** +----------+--------------------+ | *Getter* | get_collider_rid() | +----------+--------------------+ The colliding body's :ref:`RID` used by the :ref:`PhysicsServer`. ---- .. _class_KinematicCollision_property_collider_shape: - :ref:`Object` **collider_shape** +----------+----------------------+ | *Getter* | get_collider_shape() | +----------+----------------------+ The colliding body's shape. ---- .. _class_KinematicCollision_property_collider_shape_index: - :ref:`int` **collider_shape_index** +-----------+----------------------------+ | *Default* | ``0`` | +-----------+----------------------------+ | *Getter* | get_collider_shape_index() | +-----------+----------------------------+ The colliding shape's index. See :ref:`CollisionObject`. ---- .. _class_KinematicCollision_property_collider_velocity: - :ref:`Vector3` **collider_velocity** +-----------+-------------------------+ | *Default* | ``Vector3( 0, 0, 0 )`` | +-----------+-------------------------+ | *Getter* | get_collider_velocity() | +-----------+-------------------------+ The colliding object's velocity. ---- .. _class_KinematicCollision_property_local_shape: - :ref:`Object` **local_shape** +----------+-------------------+ | *Getter* | get_local_shape() | +----------+-------------------+ The moving object's colliding shape. ---- .. _class_KinematicCollision_property_normal: - :ref:`Vector3` **normal** +-----------+------------------------+ | *Default* | ``Vector3( 0, 0, 0 )`` | +-----------+------------------------+ | *Getter* | get_normal() | +-----------+------------------------+ The colliding body's shape's normal at the point of collision. ---- .. _class_KinematicCollision_property_position: - :ref:`Vector3` **position** +-----------+------------------------+ | *Default* | ``Vector3( 0, 0, 0 )`` | +-----------+------------------------+ | *Getter* | get_position() | +-----------+------------------------+ The point of collision, in global coordinates. ---- .. _class_KinematicCollision_property_remainder: - :ref:`Vector3` **remainder** +-----------+------------------------+ | *Default* | ``Vector3( 0, 0, 0 )`` | +-----------+------------------------+ | *Getter* | get_remainder() | +-----------+------------------------+ The moving object's remaining movement vector. ---- .. _class_KinematicCollision_property_travel: - :ref:`Vector3` **travel** +-----------+------------------------+ | *Default* | ``Vector3( 0, 0, 0 )`` | +-----------+------------------------+ | *Getter* | get_travel() | +-----------+------------------------+ The distance the moving object traveled before collision. Method Descriptions ------------------- .. _class_KinematicCollision_method_get_angle: - :ref:`float` **get_angle** **(** :ref:`Vector3` up_direction=Vector3( 0, 1, 0 ) **)** |const| The collision angle according to ``up_direction``, which is ``Vector3.UP`` by default. This value is always positive. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`