KinematicCollision

Inherits: Reference < Object

Collision data for KinematicBody collisions.

Descripción

Contains collision data for KinematicBody collisions. When a KinematicBody is moved using 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.

Propiedades

Object

collider

int

collider_id

0

Variant

collider_metadata

RID

collider_rid

Object

collider_shape

int

collider_shape_index

0

Vector3

collider_velocity

Vector3( 0, 0, 0 )

Object

local_shape

Vector3

normal

Vector3( 0, 0, 0 )

Vector3

position

Vector3( 0, 0, 0 )

Vector3

remainder

Vector3( 0, 0, 0 )

Vector3

travel

Vector3( 0, 0, 0 )

Métodos

float

get_angle ( Vector3 up_direction=Vector3( 0, 1, 0 ) ) const

Descripciones de Propiedades

Getter

get_collider()

El cuerpo en colisión.


  • int collider_id

Default

0

Getter

get_collider_id()

La identificación de la instancia única del cuerpo que colisiona. Ver Object.get_instance_id.


Getter

get_collider_metadata()

Los metadatos del cuerpo en colisión. Ver Object.


  • RID collider_rid

Getter

get_collider_rid()

The colliding body's RID used by the PhysicsServer.


Getter

get_collider_shape()

La forma del cuerpo en colisión.


  • int collider_shape_index

Default

0

Getter

get_collider_shape_index()

The colliding shape's index. See CollisionObject.


Default

Vector3( 0, 0, 0 )

Getter

get_collider_velocity()

La velocidad del objeto que colisiona.


Getter

get_local_shape()

La forma de colisión del objeto en movimiento.


Default

Vector3( 0, 0, 0 )

Getter

get_normal()

La normal de la forma del cuerpo que choca en el punto de colisión.


Default

Vector3( 0, 0, 0 )

Getter

get_position()

El punto de colisión, en coordenadas globales.


Default

Vector3( 0, 0, 0 )

Getter

get_remainder()

El vector de movimiento restante del objeto en movimiento.


Default

Vector3( 0, 0, 0 )

Getter

get_travel()

La distancia que el objeto en movimiento viajó antes de la colisión.

Descripciones de Métodos

  • float get_angle ( 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.