Class reference
TwoBoneIK3D
Inherits IKModifier3D
Rotation based intersection of two circles inverse kinematics solver.
Description
This IKModifier3D requires a pole target. It provides deterministic results by constructing a plane from each joint and pole target and finding the intersection of two circles (disks in 3D). This IK can handle twist by setting the pole direction. If there are more than one bone between each set bone, their rotations are ignored, and the straight line connecting the root-middle and middle-end joints are treated as virtual bones.
Properties
int setting_count = 0
int setting_count = 0The number of settings.
Methods
int get_end_bone(int index) const
int get_end_bone(int index) constReturns the end bone index.
int get_end_bone_direction(int index) const
int get_end_bone_direction(int index) constReturns the end bone's tail direction when is_end_bone_extended() is true.
float get_end_bone_length(int index) const
float get_end_bone_length(int index) constReturns the end bone tail length of the bone chain when is_end_bone_extended() is true.
String get_end_bone_name(int index) const
String get_end_bone_name(int index) constReturns the end bone name.
int get_middle_bone(int index) const
int get_middle_bone(int index) constReturns the middle bone index.
String get_middle_bone_name(int index) const
String get_middle_bone_name(int index) constReturns the middle bone name.
int get_pole_direction(int index) const
int get_pole_direction(int index) constReturns the pole direction.
Vector3 get_pole_direction_vector(int index) const
Vector3 get_pole_direction_vector(int index) constReturns the pole direction vector. If get_pole_direction() is SkeletonModifier3D.SECONDARY_DIRECTION_NONE, this method returns Vector3(0, 0, 0).
NodePath get_pole_node(int index) const
NodePath get_pole_node(int index) constReturns the pole target node that constructs a plane which the joints are all on and the pole is trying to direct.
int get_root_bone(int index) const
int get_root_bone(int index) constReturns the root bone index.
String get_root_bone_name(int index) const
String get_root_bone_name(int index) constReturns the root bone name.
NodePath get_target_node(int index) const
NodePath get_target_node(int index) constReturns the target node that the end bone is trying to reach.
bool is_end_bone_extended(int index) const
bool is_end_bone_extended(int index) constReturns true if the end bone is extended to have a tail.
bool is_using_virtual_end(int index) const
bool is_using_virtual_end(int index) constReturns true if the end bone is extended from the middle bone as a virtual bone.
void set_end_bone(int index, int bone)
int index, int bone)Sets the end bone index.
void set_end_bone_direction(int index, int bone_direction)
int index, int bone_direction)Sets the end bone tail direction when is_end_bone_extended() is true.
void set_end_bone_length(int index, float length)
int index, float length)Sets the end bone tail length when is_end_bone_extended() is true.
void set_end_bone_name(int index, String bone_name)
int index, String bone_name)Sets the end bone name. Note: The end bone must be a child of the middle bone.
void set_extend_end_bone(int index, bool enabled)
int index, bool enabled)If enabled is true, the end bone is extended to have a tail.
void set_middle_bone(int index, int bone)
int index, int bone)Sets the middle bone index.
void set_middle_bone_name(int index, String bone_name)
int index, String bone_name)Sets the middle bone name. Note: The middle bone must be a child of the root bone.
void set_pole_direction(int index, int direction)
int index, int direction)Sets the pole direction. The pole is on the middle bone and will direct to the pole target. The rotation axis is a vector that is orthogonal to this and the forward vector. Note: The pole direction and the forward vector shouldn't be colinear to avoid unintended rotation.
void set_pole_direction_vector(int index, Vector3 vector)
int index, Vector3 vector)Sets the pole direction vector. This vector is normalized by an internal process. If the vector length is 0, it is considered synonymous with SkeletonModifier3D.SECONDARY_DIRECTION_NONE.
void set_pole_node(int index, NodePath pole_node)
int index, NodePath pole_node)Sets the pole target node that constructs a plane which the joints are all on and the pole is trying to direct.
void set_root_bone(int index, int bone)
int index, int bone)Sets the root bone index.
void set_root_bone_name(int index, String bone_name)
int index, String bone_name)Sets the root bone name.
void set_target_node(int index, NodePath target_node)
int index, NodePath target_node)Sets the target node that the end bone is trying to reach.
void set_use_virtual_end(int index, bool enabled)
int index, bool enabled)If enabled is true, the end bone is extended from the middle bone as a virtual bone.