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...
SkeletonModification2DPhysicalBones
實驗性: Physical bones may be changed in the future to perform the position update of Bone2D on their own, without needing this resource.
繼承: SkeletonModification2D < Resource < RefCounted < Object
將 PhysicalBone2D 節點的變換套用到 Bone2D 節點的修改器。
說明
This modification takes the transforms of PhysicalBone2D nodes and applies them to Bone2D nodes. This allows the Bone2D nodes to react to physics thanks to the linked PhysicalBone2D nodes.
屬性
|
方法
void |
|
get_physical_bone_node(joint_idx: int) const |
|
void |
set_physical_bone_node(joint_idx: int, physicalbone2d_node: NodePath) |
void |
start_simulation(bones: Array[StringName] = []) |
void |
stop_simulation(bones: Array[StringName] = []) |
屬性說明
int physical_bone_chain_length = 0 🔗
在這個修改器中連結的 PhysicalBone2D 節點的數量。
方法說明
void fetch_physical_bones() 🔗
清空 PhysicalBone2D 節點列表,並使用該 Skeleton2D 節點的所有 PhysicalBone2D 子節點填充該列表。
NodePath get_physical_bone_node(joint_idx: int) const 🔗
返回位於 joint_idx 的 PhysicalBone2D 節點。
void set_physical_bone_node(joint_idx: int, physicalbone2d_node: NodePath) 🔗
設定位於 joint_idx 的 PhysicalBone2D 節點。
注意:這個索引只適用於這個修改器,不是 Skeleton2D 使用的骨骼索引。
void start_simulation(bones: Array[StringName] = []) 🔗
讓 PhysicalBone2D 節點開始類比,開始與物理世界進行互動。
還可以把骨骼名稱陣列傳給這個函式,會導致只有這些名稱的 PhysicalBone2D 節點開始模擬。
void stop_simulation(bones: Array[StringName] = []) 🔗
讓 PhysicalBone2D 節點停止類比,不再與物理世界進行互動。
還可以把骨骼名稱陣列傳給這個函式,會導致只有這些名稱的 PhysicalBone2D 節點停止模擬。