Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
PhysicsTestMotionResult2D
继承: RefCounted < Object
描述 PhysicsServer2D.body_test_motion() 的运动和碰撞结果。
描述
描述 PhysicsServer2D.body_test_motion() 的运动和碰撞结果。
方法
get_collider() const |
|
get_collider_id() const |
|
get_collider_rid() const |
|
get_collider_shape() const |
|
get_collider_velocity() const |
|
get_collision_depth() const |
|
get_collision_local_shape() const |
|
get_collision_normal() const |
|
get_collision_point() const |
|
get_collision_safe_fraction() const |
|
get_collision_unsafe_fraction() const |
|
get_remainder() const |
|
get_travel() const |
方法说明
如果发生了碰撞,则返回相撞物体所附加的 Object。
如果发生了碰撞,则返回相撞物体所附加 Object 的唯一实例 ID。见 Object.get_instance_id()。
RID get_collider_rid() const 🔗
如果发生了碰撞,则返回相撞物体在 PhysicsServer2D 中使用的 RID。
int get_collider_shape() const 🔗
如果发生了碰撞,则返回相撞物体形状的索引。见 CollisionObject2D。
Vector2 get_collider_velocity() const 🔗
如果发生了碰撞,则返回相撞物体的速度。
float get_collision_depth() const 🔗
如果发生了碰撞,则返回沿碰撞法线的重叠长度。
int get_collision_local_shape() const 🔗
如果发生了碰撞,则返回移动对象的碰撞形状。
Vector2 get_collision_normal() const 🔗
如果发生了碰撞,则返回碰撞物体形状在碰撞点处的法线。
Vector2 get_collision_point() const 🔗
如果发生了碰撞,则返回使用全局坐标表示的碰撞点。
float get_collision_safe_fraction() const 🔗
返回可以运动但不发生碰撞的最大比例,在 0
和 1
之间。
float get_collision_unsafe_fraction() const 🔗
如果发生了碰撞,则返回碰撞运动所需的最小摩擦力,在 0
和 1
之间。
Vector2 get_remainder() const 🔗
返回移动对象的剩余移动向量。
返回移动对象的在碰撞前的运动。