summaryrefslogtreecommitdiff
path: root/doc/classes/SkeletonModification2DPhysicalBones.xml
blob: d8aaf09a8e349a15d21b4027c68dbd8bb71ef163 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SkeletonModification2DPhysicalBones" inherits="SkeletonModification2D" version="4.0">
	<brief_description>
		A modification that applies the transforms of [PhysicalBone2D] nodes to [Bone2D] nodes.
	</brief_description>
	<description>
		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.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="fetch_physical_bones">
			<return type="void">
			</return>
			<description>
				Empties the list of [PhysicalBone2D] nodes and populates it will all [PhysicalBone2D] nodes that are children of the [Skeleton2D].
			</description>
		</method>
		<method name="get_physical_bone_node" qualifiers="const">
			<return type="NodePath">
			</return>
			<argument index="0" name="joint_idx" type="int">
			</argument>
			<description>
				Returns the [PhysicalBone2D] node at [code]joint_idx[/code].
			</description>
		</method>
		<method name="set_physical_bone_node">
			<return type="void">
			</return>
			<argument index="0" name="joint_idx" type="int">
			</argument>
			<argument index="1" name="physicalbone2d_node" type="NodePath">
			</argument>
			<description>
				Sets the [PhysicalBone2D] node at [code]joint_idx[/code].
				[b]Note:[/b] This is just the index used for this modification, not the bone index used in the [Skeleton2D].
			</description>
		</method>
		<method name="start_simulation">
			<return type="void">
			</return>
			<argument index="0" name="bones" type="StringName[]" default="[  ]">
			</argument>
			<description>
				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.
			</description>
		</method>
		<method name="stop_simulation">
			<return type="void">
			</return>
			<argument index="0" name="bones" type="StringName[]" default="[  ]">
			</argument>
			<description>
				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.
			</description>
		</method>
	</methods>
	<members>
		<member name="physical_bone_chain_length" type="int" setter="set_physical_bone_chain_length" getter="get_physical_bone_chain_length" default="0">
			The amount of [PhysicalBone2D] nodes linked in this modification.
		</member>
	</members>
	<constants>
	</constants>
</class>