KinematicCollision3D

继承: RefCounted < Object

Holds collision data from the movement of a PhysicsBody3D.

描述

Holds collision data from the movement of a PhysicsBody3D, usually from PhysicsBody3D.move_and_collide. When a PhysicsBody3D is moved, it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision3D object is returned.

The collision data includes the colliding object, the remaining motion, and the collision position. This data can be used to determine a custom response to the collision.

方法

floatget_angle ( collision_index: int = 0, up_direction: Vector3 = Vector3(0, 1, 0) ) const1
Objectget_collider ( collision_index: int = 0 ) const1
intget_collider_id ( collision_index: int = 0 ) const1
RIDget_collider_rid ( collision_index: int = 0 ) const1
Objectget_collider_shape ( collision_index: int = 0 ) const1
intget_collider_shape_index ( collision_index: int = 0 ) const1
Vector3get_collider_velocity ( collision_index: int = 0 ) const1
intget_collision_count ( ) const1
floatget_depth ( ) const1
Objectget_local_shape ( collision_index: int = 0 ) const1
Vector3get_normal ( collision_index: int = 0 ) const1
Vector3get_position ( collision_index: int = 0 ) const1
Vector3get_remainder ( ) const1
Vector3get_travel ( ) const1

方法说明

float get_angle ( collision_index: int = 0, up_direction: Vector3 = Vector3(0, 1, 0) ) const1

Returns the collision angle according to up_direction, which is Vector3.UP by default. This value is always positive.


Object get_collider ( collision_index: int = 0 ) const1

Returns the colliding body's attached Object given a collision index (the deepest collision by default).


int get_collider_id ( collision_index: int = 0 ) const1

Returns the unique instance ID of the colliding body's attached Object given a collision index (the deepest collision by default). See Object.get_instance_id.


RID get_collider_rid ( collision_index: int = 0 ) const1

Returns the colliding body's RID used by the PhysicsServer3D given a collision index (the deepest collision by default).


Object get_collider_shape ( collision_index: int = 0 ) const1

Returns the colliding body's shape given a collision index (the deepest collision by default).


int get_collider_shape_index ( collision_index: int = 0 ) const1

Returns the colliding body's shape index given a collision index (the deepest collision by default). See CollisionObject3D.


Vector3 get_collider_velocity ( collision_index: int = 0 ) const1

Returns the colliding body's velocity given a collision index (the deepest collision by default).


int get_collision_count ( ) const1

Returns the number of detected collisions.


float get_depth ( ) const1

Returns the colliding body's length of overlap along the collision normal.


Object get_local_shape ( collision_index: int = 0 ) const1

Returns the moving object's colliding shape given a collision index (the deepest collision by default).


Vector3 get_normal ( collision_index: int = 0 ) const1

Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default).


Vector3 get_position ( collision_index: int = 0 ) const1

Returns the point of collision in global coordinates given a collision index (the deepest collision by default).


Vector3 get_remainder ( ) const1

Returns the moving object's remaining movement vector.


Vector3 get_travel ( ) const1

Returns the moving object's travel before collision.

2

本方法通常需要用户覆盖才能生效。

1

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。