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...
PhysicalBone3D¶
继承: PhysicsBody3D < CollisionObject3D < Node3D < Node < Object
用于让 Skeleton3D 中的骨骼对物理作出反应的物理体。
描述¶
The PhysicalBone3D node is a physics body that can be used to make bones in a Skeleton3D react to physics.
Note: In order to detect physical bones with raycasts, the SkeletonModifier3D.active property of the parent PhysicalBoneSimulator3D must be true and the Skeleton3D's bone must be assigned to PhysicalBone3D correctly; it means that get_bone_id should return a valid id (>= 0).
属性¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
方法¶
void |
_integrate_forces(state: PhysicsDirectBodyState3D) virtual |
void |
apply_central_impulse(impulse: Vector3) |
void |
apply_impulse(impulse: Vector3, position: Vector3 = Vector3(0, 0, 0)) |
get_bone_id() const |
|
枚举¶
enum DampMode: 🔗
DampMode DAMP_MODE_COMBINE = 0
在这种模式下,物体的阻尼值将被加到区域中设置的任何值或默认值。
DampMode DAMP_MODE_REPLACE = 1
在这种模式下,物体的阻尼值将替换掉区域中设置的任何值或默认值。
enum JointType: 🔗
JointType JOINT_TYPE_NONE = 0
该枚举目前没有描述,请帮我们贡献一个吧!
JointType JOINT_TYPE_PIN = 1
该枚举目前没有描述,请帮我们贡献一个吧!
JointType JOINT_TYPE_CONE = 2
该枚举目前没有描述,请帮我们贡献一个吧!
JointType JOINT_TYPE_HINGE = 3
该枚举目前没有描述,请帮我们贡献一个吧!
JointType JOINT_TYPE_SLIDER = 4
该枚举目前没有描述,请帮我们贡献一个吧!
JointType JOINT_TYPE_6DOF = 5
该枚举目前没有描述,请帮我们贡献一个吧!
属性说明¶
阻碍物体的旋转。默认情况下,物体将使用 项目 > 项目设置 > 物理 > 3d 中的默认角度阻尼,或物体所在的 Area3D 中设置的任何覆盖值。取决于 angular_damp_mode,可以设置 angular_damp 以增加或替换物体的阻尼值。
有关阻尼的更多详细信息,请参阅 ProjectSettings.physics/3d/default_angular_damp。
DampMode angular_damp_mode = 0 🔗
定义如何应用 angular_damp。可能的取值见 DampMode。
Vector3 angular_velocity = Vector3(0, 0, 0) 🔗
该 PhysicalBone3D 的旋转速度,以每秒弧度为单位。
Transform3D body_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) 🔗
void set_body_offset(value: Transform3D)
Transform3D get_body_offset()
设置该物体的变换。
身体的反弹力。值范围从 0 (无反弹)到 1(完全反弹)。
注意:即使将 bounce 设置为 1.0,由于线性和角度阻尼,一些能量也会随着时间的推移而损失。要让 PhysicalBone3D 随时间推移保留其所有能量,请将 bounce 设置为 1.0、linear_damp_mode 设置为 DAMP_MODE_REPLACE、linear_damp 设置为 0.0、angular_damp_mode 设置为 DAMP_MODE_REPLACE、并将 angular_damp 设置为 0.0。
如果为 true,则会在不移动时停用该物体,所以它在被外力唤醒前不会参与模拟。
bool custom_integrator = false 🔗
如果为 true,则该物体的标准力积分(如重力或阻尼)将被禁用。除了碰撞响应之外,如果覆盖了 _integrate_forces 方法,则物体将仅按照该方法确定的方式移动。
设置该属性将在内部调用方法 PhysicsServer3D.body_set_omit_force_integration。
该物体的摩擦,从 0(无摩擦)到 1(最大摩擦)。
与设置 > 项目设置 > 物理 > 3D 中的全局 3D 重力设置相乘,得到该物体的重力。例如,取值为 1 就是正常重力,2 就是双倍重力,0.5 会让应用到这个对象的重力减半。
Transform3D joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) 🔗
void set_joint_offset(value: Transform3D)
Transform3D get_joint_offset()
设置该关节的变换。
Vector3 joint_rotation = Vector3(0, 0, 0) 🔗
设置该关节的旋转,单位为弧度。
设置关节的类型。可能的值见 JointType。
阻碍物体的运动。默认情况下,物体将使用 项目 > 项目设置 > 物理 > 3d 中的默认线性阻尼,或物体所在的 Area3D 中设置的任何覆盖值。取决于 linear_damp_mode,可以设置 linear_damp 以增加或替换物体的阻尼值。
有关阻尼的更多详细信息,请参阅 ProjectSettings.physics/3d/default_linear_damp。
DampMode linear_damp_mode = 0 🔗
定义如何应用 linear_damp。有关可能的值,请参阅 DampMode。
Vector3 linear_velocity = Vector3(0, 0, 0) 🔗
物体的线速度,单位为单位每秒。可以偶尔使用,但是不要每一帧都设置它,因为物理可能在另一个线程中运行,并且以不同的间隔。使用 _integrate_forces 作为你的进程循环,以精确控制物体状态。
实体的质量。
方法说明¶
void _integrate_forces(state: PhysicsDirectBodyState3D) virtual 🔗
在物理处理过程中被调用,允许你读取并安全地修改对象的模拟状态。默认情况下,它在标准力积分之前调用,但 custom_integrator 属性允许你禁用标准力积分并对物体进行完全自定义的力积分。
void apply_central_impulse(impulse: Vector3) 🔗
该方法目前没有描述,请帮我们贡献一个吧!
void apply_impulse(impulse: Vector3, position: Vector3 = Vector3(0, 0, 0)) 🔗
该方法目前没有描述,请帮我们贡献一个吧!
该方法目前没有描述,请帮我们贡献一个吧!
该方法目前没有描述,请帮我们贡献一个吧!
bool is_simulating_physics() 🔗
该方法目前没有描述,请帮我们贡献一个吧!