PhysicsTestMotionResult2D

继承: RefCounted < Object

Describes the motion and collision result from PhysicsServer2D.body_test_motion.

描述

Describes the motion and collision result from PhysicsServer2D.body_test_motion.

方法


方法说明

Object get_collider ( ) const1

Returns the colliding body's attached Object, if a collision occurred.


int get_collider_id ( ) const1

Returns the unique instance ID of the colliding body's attached Object, if a collision occurred. See Object.get_instance_id.


RID get_collider_rid ( ) const1

Returns the colliding body's RID used by the PhysicsServer2D, if a collision occurred.


int get_collider_shape ( ) const1

Returns the colliding body's shape index, if a collision occurred. See CollisionObject2D.


Vector2 get_collider_velocity ( ) const1

Returns the colliding body's velocity, if a collision occurred.


float get_collision_depth ( ) const1

Returns the length of overlap along the collision normal, if a collision occurred.


int get_collision_local_shape ( ) const1

Returns the moving object's colliding shape, if a collision occurred.


Vector2 get_collision_normal ( ) const1

Returns the colliding body's shape's normal at the point of collision, if a collision occurred.


Vector2 get_collision_point ( ) const1

Returns the point of collision in global coordinates, if a collision occurred.


float get_collision_safe_fraction ( ) const1

Returns the maximum fraction of the motion that can occur without a collision, between 0 and 1.


float get_collision_unsafe_fraction ( ) const1

Returns the minimum fraction of the motion needed to collide, if a collision occurred, between 0 and 1.


Vector2 get_remainder ( ) const1

Returns the moving object's remaining movement vector.


Vector2 get_travel ( ) const1

Returns the moving object's travel before collision.

2

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

1

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

3

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

4

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

5

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

6

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

7

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

8

无返回值。