:github_url: hide .. Generated automatically by doc/tools/make_rst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the KinematicCollision3D.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_KinematicCollision3D: KinematicCollision3D ==================== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Collision data for :ref:`PhysicsBody3D.move_and_collide` collisions. Description ----------- Contains collision data for :ref:`PhysicsBody3D.move_and_collide` collisions. When a :ref:`PhysicsBody3D` is moved using :ref:`PhysicsBody3D.move_and_collide`, it stops if it detects a collision with another body. If a collision is detected, a ``KinematicCollision3D`` 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. Methods ------- +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_angle` **(** :ref:`int` collision_index=0, :ref:`Vector3` up_direction=Vector3(0, 1, 0) **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_collider` **(** :ref:`int` collision_index=0 **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collider_id` **(** :ref:`int` collision_index=0 **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_collider_rid` **(** :ref:`int` collision_index=0 **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_collider_shape` **(** :ref:`int` collision_index=0 **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collider_shape_index` **(** :ref:`int` collision_index=0 **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_collider_velocity` **(** :ref:`int` collision_index=0 **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collision_count` **(** **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_local_shape` **(** :ref:`int` collision_index=0 **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_normal` **(** :ref:`int` collision_index=0 **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_position` **(** :ref:`int` collision_index=0 **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_remainder` **(** **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_travel` **(** **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- .. _class_KinematicCollision3D_method_get_angle: - :ref:`float` **get_angle** **(** :ref:`int` collision_index=0, :ref:`Vector3` up_direction=Vector3(0, 1, 0) **)** |const| Returns the collision angle according to ``up_direction``, which is ``Vector3.UP`` by default. This value is always positive. ---- .. _class_KinematicCollision3D_method_get_collider: - :ref:`Object` **get_collider** **(** :ref:`int` collision_index=0 **)** |const| Returns the colliding body's attached :ref:`Object` given a collision index (the deepest collision by default). ---- .. _class_KinematicCollision3D_method_get_collider_id: - :ref:`int` **get_collider_id** **(** :ref:`int` collision_index=0 **)** |const| Returns the unique instance ID of the colliding body's attached :ref:`Object` given a collision index (the deepest collision by default). See :ref:`Object.get_instance_id`. ---- .. _class_KinematicCollision3D_method_get_collider_rid: - :ref:`RID` **get_collider_rid** **(** :ref:`int` collision_index=0 **)** |const| Returns the colliding body's :ref:`RID` used by the :ref:`PhysicsServer3D` given a collision index (the deepest collision by default). ---- .. _class_KinematicCollision3D_method_get_collider_shape: - :ref:`Object` **get_collider_shape** **(** :ref:`int` collision_index=0 **)** |const| Returns the colliding body's shape given a collision index (the deepest collision by default). ---- .. _class_KinematicCollision3D_method_get_collider_shape_index: - :ref:`int` **get_collider_shape_index** **(** :ref:`int` collision_index=0 **)** |const| Returns the colliding body's shape index given a collision index (the deepest collision by default). See :ref:`CollisionObject3D`. ---- .. _class_KinematicCollision3D_method_get_collider_velocity: - :ref:`Vector3` **get_collider_velocity** **(** :ref:`int` collision_index=0 **)** |const| Returns the colliding body's velocity given a collision index (the deepest collision by default). ---- .. _class_KinematicCollision3D_method_get_collision_count: - :ref:`int` **get_collision_count** **(** **)** |const| Returns the number of detected collisions. ---- .. _class_KinematicCollision3D_method_get_local_shape: - :ref:`Object` **get_local_shape** **(** :ref:`int` collision_index=0 **)** |const| Returns the moving object's colliding shape given a collision index (the deepest collision by default). ---- .. _class_KinematicCollision3D_method_get_normal: - :ref:`Vector3` **get_normal** **(** :ref:`int` collision_index=0 **)** |const| Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default). ---- .. _class_KinematicCollision3D_method_get_position: - :ref:`Vector3` **get_position** **(** :ref:`int` collision_index=0 **)** |const| Returns the point of collision in global coordinates given a collision index (the deepest collision by default). ---- .. _class_KinematicCollision3D_method_get_remainder: - :ref:`Vector3` **get_remainder** **(** **)** |const| Returns the moving object's remaining movement vector. ---- .. _class_KinematicCollision3D_method_get_travel: - :ref:`Vector3` **get_travel** **(** **)** |const| Returns the moving object's travel before collision. .. |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.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`