:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TwoBoneIK3D.xml. .. _class_TwoBoneIK3D: TwoBoneIK3D =========== **Inherits:** :ref:`IKModifier3D` **<** :ref:`SkeletonModifier3D` **<** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` Rotation based intersection of two circles inverse kinematics solver. .. rst-class:: classref-introduction-group Description ----------- This :ref:`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. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-----------------------+----------------------------------------------------------------+-------+ | :ref:`int` | :ref:`setting_count` | ``0`` | +-----------------------+----------------------------------------------------------------+-------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_end_bone`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`BoneDirection` | :ref:`get_end_bone_direction`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_end_bone_length`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_end_bone_name`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_middle_bone`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_middle_bone_name`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`SecondaryDirection` | :ref:`get_pole_direction`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_pole_direction_vector`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`NodePath` | :ref:`get_pole_node`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_root_bone`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_root_bone_name`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`NodePath` | :ref:`get_target_node`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_end_bone_extended`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_using_virtual_end`\ (\ index\: :ref:`int`\ ) |const| | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_end_bone`\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_end_bone_direction`\ (\ index\: :ref:`int`, bone_direction\: :ref:`BoneDirection`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_end_bone_length`\ (\ index\: :ref:`int`, length\: :ref:`float`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_end_bone_name`\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_extend_end_bone`\ (\ index\: :ref:`int`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_middle_bone`\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_middle_bone_name`\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_pole_direction`\ (\ index\: :ref:`int`, direction\: :ref:`SecondaryDirection`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_pole_direction_vector`\ (\ index\: :ref:`int`, vector\: :ref:`Vector3`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_pole_node`\ (\ index\: :ref:`int`, pole_node\: :ref:`NodePath`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_root_bone`\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_root_bone_name`\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_target_node`\ (\ index\: :ref:`int`, target_node\: :ref:`NodePath`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_use_virtual_end`\ (\ index\: :ref:`int`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_TwoBoneIK3D_property_setting_count: .. rst-class:: classref-property :ref:`int` **setting_count** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_setting_count**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_setting_count**\ (\ ) The number of settings. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_TwoBoneIK3D_method_get_end_bone: .. rst-class:: classref-method :ref:`int` **get_end_bone**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the end bone index. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_get_end_bone_direction: .. rst-class:: classref-method :ref:`BoneDirection` **get_end_bone_direction**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the end bone's tail direction when :ref:`is_end_bone_extended()` is ``true``. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_get_end_bone_length: .. rst-class:: classref-method :ref:`float` **get_end_bone_length**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the end bone tail length of the bone chain when :ref:`is_end_bone_extended()` is ``true``. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_get_end_bone_name: .. rst-class:: classref-method :ref:`String` **get_end_bone_name**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the end bone name. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_get_middle_bone: .. rst-class:: classref-method :ref:`int` **get_middle_bone**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the middle bone index. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_get_middle_bone_name: .. rst-class:: classref-method :ref:`String` **get_middle_bone_name**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the middle bone name. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_get_pole_direction: .. rst-class:: classref-method :ref:`SecondaryDirection` **get_pole_direction**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the pole direction. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_get_pole_direction_vector: .. rst-class:: classref-method :ref:`Vector3` **get_pole_direction_vector**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the pole direction vector. If :ref:`get_pole_direction()` is :ref:`SkeletonModifier3D.SECONDARY_DIRECTION_NONE`, this method returns ``Vector3(0, 0, 0)``. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_get_pole_node: .. rst-class:: classref-method :ref:`NodePath` **get_pole_node**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the pole target node that constructs a plane which the joints are all on and the pole is trying to direct. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_get_root_bone: .. rst-class:: classref-method :ref:`int` **get_root_bone**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the root bone index. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_get_root_bone_name: .. rst-class:: classref-method :ref:`String` **get_root_bone_name**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the root bone name. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_get_target_node: .. rst-class:: classref-method :ref:`NodePath` **get_target_node**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns the target node that the end bone is trying to reach. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_is_end_bone_extended: .. rst-class:: classref-method :ref:`bool` **is_end_bone_extended**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns ``true`` if the end bone is extended to have a tail. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_is_using_virtual_end: .. rst-class:: classref-method :ref:`bool` **is_using_virtual_end**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` Returns ``true`` if the end bone is extended from the middle bone as a virtual bone. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_end_bone: .. rst-class:: classref-method |void| **set_end_bone**\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) :ref:`🔗` Sets the end bone index. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_end_bone_direction: .. rst-class:: classref-method |void| **set_end_bone_direction**\ (\ index\: :ref:`int`, bone_direction\: :ref:`BoneDirection`\ ) :ref:`🔗` Sets the end bone tail direction when :ref:`is_end_bone_extended()` is ``true``. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_end_bone_length: .. rst-class:: classref-method |void| **set_end_bone_length**\ (\ index\: :ref:`int`, length\: :ref:`float`\ ) :ref:`🔗` Sets the end bone tail length when :ref:`is_end_bone_extended()` is ``true``. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_end_bone_name: .. rst-class:: classref-method |void| **set_end_bone_name**\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) :ref:`🔗` Sets the end bone name. \ **Note:** The end bone must be a child of the middle bone. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_extend_end_bone: .. rst-class:: classref-method |void| **set_extend_end_bone**\ (\ index\: :ref:`int`, enabled\: :ref:`bool`\ ) :ref:`🔗` If ``enabled`` is ``true``, the end bone is extended to have a tail. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_middle_bone: .. rst-class:: classref-method |void| **set_middle_bone**\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) :ref:`🔗` Sets the middle bone index. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_middle_bone_name: .. rst-class:: classref-method |void| **set_middle_bone_name**\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) :ref:`🔗` Sets the middle bone name. \ **Note:** The middle bone must be a child of the root bone. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_pole_direction: .. rst-class:: classref-method |void| **set_pole_direction**\ (\ index\: :ref:`int`, direction\: :ref:`SecondaryDirection`\ ) :ref:`🔗` 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. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_pole_direction_vector: .. rst-class:: classref-method |void| **set_pole_direction_vector**\ (\ index\: :ref:`int`, vector\: :ref:`Vector3`\ ) :ref:`🔗` Sets the pole direction vector. This vector is normalized by an internal process. If the vector length is ``0``, it is considered synonymous with :ref:`SkeletonModifier3D.SECONDARY_DIRECTION_NONE`. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_pole_node: .. rst-class:: classref-method |void| **set_pole_node**\ (\ index\: :ref:`int`, pole_node\: :ref:`NodePath`\ ) :ref:`🔗` Sets the pole target node that constructs a plane which the joints are all on and the pole is trying to direct. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_root_bone: .. rst-class:: classref-method |void| **set_root_bone**\ (\ index\: :ref:`int`, bone\: :ref:`int`\ ) :ref:`🔗` Sets the root bone index. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_root_bone_name: .. rst-class:: classref-method |void| **set_root_bone_name**\ (\ index\: :ref:`int`, bone_name\: :ref:`String`\ ) :ref:`🔗` Sets the root bone name. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_target_node: .. rst-class:: classref-method |void| **set_target_node**\ (\ index\: :ref:`int`, target_node\: :ref:`NodePath`\ ) :ref:`🔗` Sets the target node that the end bone is trying to reach. .. rst-class:: classref-item-separator ---- .. _class_TwoBoneIK3D_method_set_use_virtual_end: .. rst-class:: classref-method |void| **set_use_virtual_end**\ (\ index\: :ref:`int`, enabled\: :ref:`bool`\ ) :ref:`🔗` If ``enabled`` is ``true``, the end bone is extended from the middle bone as a virtual bone. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`