Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

PhysicsTestMotionResult3D

继承: RefCounted < Object

描述 PhysicsServer3D.body_test_motion 的运动和碰撞结果。

描述

描述 PhysicsServer3D.body_test_motion 的运动和碰撞结果。

方法

Object

get_collider ( int collision_index=0 ) const

int

get_collider_id ( int collision_index=0 ) const

RID

get_collider_rid ( int collision_index=0 ) const

int

get_collider_shape ( int collision_index=0 ) const

Vector3

get_collider_velocity ( int collision_index=0 ) const

int

get_collision_count ( ) const

float

get_collision_depth ( int collision_index=0 ) const

int

get_collision_local_shape ( int collision_index=0 ) const

Vector3

get_collision_normal ( int collision_index=0 ) const

Vector3

get_collision_point ( int collision_index=0 ) const

float

get_collision_safe_fraction ( ) const

float

get_collision_unsafe_fraction ( ) const

Vector3

get_remainder ( ) const

Vector3

get_travel ( ) const


方法说明

Object get_collider ( int collision_index=0 ) const

如果发生了碰撞,则返回相撞物体所附加的 Object,碰撞物体由碰撞索引指定(默认为最深的碰撞)。见 Object.get_instance_id


int get_collider_id ( int collision_index=0 ) const

如果发生了碰撞,则返回相撞物体所附加 Object 的唯一实例 ID,碰撞物体由碰撞索引指定(默认为最深的碰撞)。见 Object.get_instance_id


RID get_collider_rid ( int collision_index=0 ) const

如果发生了碰撞,则返回相撞物体在 PhysicsServer3D 中使用的 RID,碰撞物体由碰撞索引指定(默认为最深的碰撞)。见 Object.get_instance_id


int get_collider_shape ( int collision_index=0 ) const

如果发生了碰撞,则返回相撞物体形状的索引,碰撞物体由碰撞索引指定(默认为最深的碰撞)。见 Object.get_instance_id


Vector3 get_collider_velocity ( int collision_index=0 ) const

如果发生了碰撞,则返回相撞物体的速度。见 Object.get_instance_id


int get_collision_count ( ) const

返回检测到的碰撞次数。


float get_collision_depth ( int collision_index=0 ) const

如果发生了碰撞,则在给定碰撞索引(默认为最深碰撞)的情况下,返回沿碰撞法线的重叠长度。


int get_collision_local_shape ( int collision_index=0 ) const

如果发生了碰撞,则在给定碰撞索引(默认为最深碰撞)的情况下,返回移动对象的碰撞形状。


Vector3 get_collision_normal ( int collision_index=0 ) const

如果发生了碰撞,则在给定碰撞索引(默认为最深碰撞)的情况下,返回碰撞物体形状在碰撞点处的法线。


Vector3 get_collision_point ( int collision_index=0 ) const

如果发生了碰撞,则在给定碰撞索引(默认为最深碰撞)的情况下,返回使用全局坐标表示的碰撞点。


float get_collision_safe_fraction ( ) const

返回可以运动但不发生碰撞的最大比例,在 01 之间。


float get_collision_unsafe_fraction ( ) const

如果发生了碰撞,则返回碰撞运动所需的最小摩擦力,在 01 之间。


Vector3 get_remainder ( ) const

返回移动对象的剩余移动向量。


Vector3 get_travel ( ) const

返回移动对象的在碰撞前的运动。