0.2.0-dev Download ZIP
56 lines ·2.7 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="SkeletonModification2DPhysicalBones" inherits="SkeletonModification2D" api_type="core" experimental="Physical bones may be changed in the future to perform the position update of [Bone2D] on their own, without needing this resource." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A modification that applies the transforms of [PhysicalBone2D] nodes to [Bone2D] nodes. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | 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. |
| 8 | </description> |
| 9 | <tutorials> |
| 10 | </tutorials> |
| 11 | <methods> |
| 12 | <method name="fetch_physical_bones"> |
| 13 | <return type="void" /> |
| 14 | <description> |
| 15 | Empties the list of [PhysicalBone2D] nodes and populates it with all [PhysicalBone2D] nodes that are children of the [Skeleton2D]. |
| 16 | </description> |
| 17 | </method> |
| 18 | <method name="get_physical_bone_node" qualifiers="const"> |
| 19 | <return type="NodePath" /> |
| 20 | <param index="0" name="joint_idx" type="int" /> |
| 21 | <description> |
| 22 | Returns the [PhysicalBone2D] node at [param joint_idx]. |
| 23 | </description> |
| 24 | </method> |
| 25 | <method name="set_physical_bone_node"> |
| 26 | <return type="void" /> |
| 27 | <param index="0" name="joint_idx" type="int" /> |
| 28 | <param index="1" name="physicalbone2d_node" type="NodePath" /> |
| 29 | <description> |
| 30 | Sets the [PhysicalBone2D] node at [param joint_idx]. |
| 31 | [b]Note:[/b] This is just the index used for this modification, not the bone index used in the [Skeleton2D]. |
| 32 | </description> |
| 33 | </method> |
| 34 | <method name="start_simulation"> |
| 35 | <return type="void" /> |
| 36 | <param index="0" name="bones" type="StringName[]" default="[]" /> |
| 37 | <description> |
| 38 | Tell the [PhysicalBone2D] nodes to start simulating and interacting with the physics world. |
| 39 | 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. |
| 40 | </description> |
| 41 | </method> |
| 42 | <method name="stop_simulation"> |
| 43 | <return type="void" /> |
| 44 | <param index="0" name="bones" type="StringName[]" default="[]" /> |
| 45 | <description> |
| 46 | Tell the [PhysicalBone2D] nodes to stop simulating and interacting with the physics world. |
| 47 | 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. |
| 48 | </description> |
| 49 | </method> |
| 50 | </methods> |
| 51 | <members> |
| 52 | <member name="physical_bone_chain_length" type="int" setter="set_physical_bone_chain_length" getter="get_physical_bone_chain_length" default="0"> |
| 53 | The number of [PhysicalBone2D] nodes linked in this modification. |
| 54 | </member> |
| 55 | </members> |
| 56 | </class> |