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
69
70
71
72
73
74
75
76
77
78
79
80
|
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SkeletonModification2DTwoBoneIK" inherits="SkeletonModification2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A modification that rotates two bones using the law of cosigns to reach the target.
</brief_description>
<description>
This [SkeletonModification2D] uses an algorithm typically called TwoBoneIK. This algorithm works by leveraging the law of cosigns and the lengths of the bones to figure out what rotation the bones currently have, and what rotation they need to make a complete triangle, where the first bone, the second bone, and the target form the three vertices of the triangle. Because the algorithm works by making a triangle, it can only operate on two bones.
TwoBoneIK is great for arms, legs, and really any joints that can be represented by just two bones that bend to reach a target. This solver is more lightweight than [SkeletonModification2DFABRIK], but gives similar, natural looking results.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_joint_one_bone2d_node" qualifiers="const">
<return type="NodePath" />
<description>
Returns the [Bone2D] node that is being used as the first bone in the TwoBoneIK modification.
</description>
</method>
<method name="get_joint_one_bone_idx" qualifiers="const">
<return type="int" />
<description>
Returns the index of the [Bone2D] node that is being used as the first bone in the TwoBoneIK modification.
</description>
</method>
<method name="get_joint_two_bone2d_node" qualifiers="const">
<return type="NodePath" />
<description>
Returns the [Bone2D] node that is being used as the second bone in the TwoBoneIK modification.
</description>
</method>
<method name="get_joint_two_bone_idx" qualifiers="const">
<return type="int" />
<description>
Returns the index of the [Bone2D] node that is being used as the second bone in the TwoBoneIK modification.
</description>
</method>
<method name="set_joint_one_bone2d_node">
<return type="void" />
<param index="0" name="bone2d_node" type="NodePath" />
<description>
Sets the [Bone2D] node that is being used as the first bone in the TwoBoneIK modification.
</description>
</method>
<method name="set_joint_one_bone_idx">
<return type="void" />
<param index="0" name="bone_idx" type="int" />
<description>
Sets the index of the [Bone2D] node that is being used as the first bone in the TwoBoneIK modification.
</description>
</method>
<method name="set_joint_two_bone2d_node">
<return type="void" />
<param index="0" name="bone2d_node" type="NodePath" />
<description>
Sets the [Bone2D] node that is being used as the second bone in the TwoBoneIK modification.
</description>
</method>
<method name="set_joint_two_bone_idx">
<return type="void" />
<param index="0" name="bone_idx" type="int" />
<description>
Sets the index of the [Bone2D] node that is being used as the second bone in the TwoBoneIK modification.
</description>
</method>
</methods>
<members>
<member name="flip_bend_direction" type="bool" setter="set_flip_bend_direction" getter="get_flip_bend_direction" default="false">
If [code]true[/code], the bones in the modification will blend outward as opposed to inwards when contracting. If [code]false[/code], the bones will bend inwards when contracting.
</member>
<member name="target_maximum_distance" type="float" setter="set_target_maximum_distance" getter="get_target_maximum_distance" default="0.0">
The maximum distance the target can be at. If the target is farther than this distance, the modification will solve as if it's at this maximum distance. When set to [code]0[/code], the modification will solve without distance constraints.
</member>
<member name="target_minimum_distance" type="float" setter="set_target_minimum_distance" getter="get_target_minimum_distance" default="0.0">
The minimum distance the target can be at. If the target is closer than this distance, the modification will solve as if it's at this minimum distance. When set to [code]0[/code], the modification will solve without distance constraints.
</member>
<member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath("")">
The NodePath to the node that is the target for the TwoBoneIK modification. This node is what the modification will use when bending the [Bone2D] nodes.
</member>
</members>
</class>
|