Class SkeletonModification2DPhysicalBones
A modification that applies the transforms of PhysicalBone2D nodes to Bone2D nodes.
- Inheritance
-
SkeletonModification2DPhysicalBones
Remarks
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.
Properties
physical_bone_chain_length
The number of PhysicalBone2D nodes linked in this modification.
var physical_bone_chain_length : int = 0
Property Value
Remarks
Methods
fetch_physical_bones
Empties the list of PhysicalBone2D nodes and populates it with all PhysicalBone2D nodes that are children of the Skeleton2D.
void fetch_physical_bones
get_physical_bone_node(int)
Qualifiers: const
Returns the PhysicalBone2D node at joint_idx
.
NodePath get_physical_bone_node(int joint_idx)
Parameters
joint_idx
int
set_physical_bone_node(int, NodePath)
Sets the PhysicalBone2D node at joint_idx
.
Note: This is just the index used for this modification, not the bone index used in the Skeleton2D.
void set_physical_bone_node(int joint_idx, NodePath physicalbone2d_node)
Parameters
start_simulation(StringName[])
Tell the PhysicalBone2D nodes to start simulating and interacting with the physics world.
Optionally, an array of bone names can be passed to this function, and that will cause only PhysicalBone2D nodes with those names to start simulating.
void start_simulation(StringName[] bones)
Parameters
bones
StringName[]
stop_simulation(StringName[])
Tell the PhysicalBone2D nodes to stop simulating and interacting with the physics world.
Optionally, an array of bone names can be passed to this function, and that will cause only PhysicalBone2D nodes with those names to stop simulating.
void stop_simulation(StringName[] bones)
Parameters
bones
StringName[]