Files
godot-docs/classes/class_boneconstraint3d.rst
2025-11-15 03:29:31 +00:00

333 lines
18 KiB
ReStructuredText

: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/BoneConstraint3D.xml.
.. _class_BoneConstraint3D:
BoneConstraint3D
================
**Inherits:** :ref:`SkeletonModifier3D<class_SkeletonModifier3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AimModifier3D<class_AimModifier3D>`, :ref:`ConvertTransformModifier3D<class_ConvertTransformModifier3D>`, :ref:`CopyTransformModifier3D<class_CopyTransformModifier3D>`
A node that may modify Skeleton3D's bone with associating the two bones.
.. rst-class:: classref-introduction-group
Description
-----------
Base class of :ref:`SkeletonModifier3D<class_SkeletonModifier3D>` that modifies the bone set in :ref:`set_apply_bone()<class_BoneConstraint3D_method_set_apply_bone>` based on the transform of the bone retrieved by :ref:`get_reference_bone()<class_BoneConstraint3D_method_get_reference_bone>`.
.. rst-class:: classref-reftable-group
Methods
-------
.. table::
:widths: auto
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`clear_setting<class_BoneConstraint3D_method_clear_setting>`\ (\ ) |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_amount<class_BoneConstraint3D_method_get_amount>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_apply_bone<class_BoneConstraint3D_method_get_apply_bone>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_apply_bone_name<class_BoneConstraint3D_method_get_apply_bone_name>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_reference_bone<class_BoneConstraint3D_method_get_reference_bone>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_reference_bone_name<class_BoneConstraint3D_method_get_reference_bone_name>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`get_reference_node<class_BoneConstraint3D_method_get_reference_node>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ReferenceType<enum_BoneConstraint3D_ReferenceType>` | :ref:`get_reference_type<class_BoneConstraint3D_method_get_reference_type>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_setting_count<class_BoneConstraint3D_method_get_setting_count>`\ (\ ) |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_amount<class_BoneConstraint3D_method_set_amount>`\ (\ index\: :ref:`int<class_int>`, amount\: :ref:`float<class_float>`\ ) |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_apply_bone<class_BoneConstraint3D_method_set_apply_bone>`\ (\ index\: :ref:`int<class_int>`, bone\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_apply_bone_name<class_BoneConstraint3D_method_set_apply_bone_name>`\ (\ index\: :ref:`int<class_int>`, bone_name\: :ref:`String<class_String>`\ ) |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_reference_bone<class_BoneConstraint3D_method_set_reference_bone>`\ (\ index\: :ref:`int<class_int>`, bone\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_reference_bone_name<class_BoneConstraint3D_method_set_reference_bone_name>`\ (\ index\: :ref:`int<class_int>`, bone_name\: :ref:`String<class_String>`\ ) |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_reference_node<class_BoneConstraint3D_method_set_reference_node>`\ (\ index\: :ref:`int<class_int>`, node\: :ref:`NodePath<class_NodePath>`\ ) |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_reference_type<class_BoneConstraint3D_method_set_reference_type>`\ (\ index\: :ref:`int<class_int>`, type\: :ref:`ReferenceType<enum_BoneConstraint3D_ReferenceType>`\ ) |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_setting_count<class_BoneConstraint3D_method_set_setting_count>`\ (\ count\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_BoneConstraint3D_ReferenceType:
.. rst-class:: classref-enumeration
enum **ReferenceType**: :ref:`🔗<enum_BoneConstraint3D_ReferenceType>`
.. _class_BoneConstraint3D_constant_REFERENCE_TYPE_BONE:
.. rst-class:: classref-enumeration-constant
:ref:`ReferenceType<enum_BoneConstraint3D_ReferenceType>` **REFERENCE_TYPE_BONE** = ``0``
The reference target is a bone. In this case, the reference target spaces is local space.
.. _class_BoneConstraint3D_constant_REFERENCE_TYPE_NODE:
.. rst-class:: classref-enumeration-constant
:ref:`ReferenceType<enum_BoneConstraint3D_ReferenceType>` **REFERENCE_TYPE_NODE** = ``1``
The reference target is a :ref:`Node3D<class_Node3D>`. In this case, the reference target spaces is model space.
In other words, the reference target's coordinates are treated as if it were placed directly under :ref:`Skeleton3D<class_Skeleton3D>` which parent of the **BoneConstraint3D**.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_BoneConstraint3D_method_clear_setting:
.. rst-class:: classref-method
|void| **clear_setting**\ (\ ) :ref:`🔗<class_BoneConstraint3D_method_clear_setting>`
Clear all settings.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_get_amount:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_amount**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_BoneConstraint3D_method_get_amount>`
Returns the apply amount of the setting at ``index``.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_get_apply_bone:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_apply_bone**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_BoneConstraint3D_method_get_apply_bone>`
Returns the apply bone of the setting at ``index``. This bone will be modified.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_get_apply_bone_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_apply_bone_name**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_BoneConstraint3D_method_get_apply_bone_name>`
Returns the apply bone name of the setting at ``index``. This bone will be modified.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_get_reference_bone:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_reference_bone**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_BoneConstraint3D_method_get_reference_bone>`
Returns the reference bone of the setting at ``index``.
This bone will be only referenced and not modified by this modifier.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_get_reference_bone_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_reference_bone_name**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_BoneConstraint3D_method_get_reference_bone_name>`
Returns the reference bone name of the setting at ``index``.
This bone will be only referenced and not modified by this modifier.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_get_reference_node:
.. rst-class:: classref-method
:ref:`NodePath<class_NodePath>` **get_reference_node**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_BoneConstraint3D_method_get_reference_node>`
Returns the reference node path of the setting at ``index``.
This node will be only referenced and not modified by this modifier.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_get_reference_type:
.. rst-class:: classref-method
:ref:`ReferenceType<enum_BoneConstraint3D_ReferenceType>` **get_reference_type**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_BoneConstraint3D_method_get_reference_type>`
Returns the reference target type of the setting at ``index``. See also :ref:`ReferenceType<enum_BoneConstraint3D_ReferenceType>`.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_get_setting_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_setting_count**\ (\ ) |const| :ref:`🔗<class_BoneConstraint3D_method_get_setting_count>`
Returns the number of settings in the modifier.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_set_amount:
.. rst-class:: classref-method
|void| **set_amount**\ (\ index\: :ref:`int<class_int>`, amount\: :ref:`float<class_float>`\ ) :ref:`🔗<class_BoneConstraint3D_method_set_amount>`
Sets the apply amount of the setting at ``index`` to ``amount``.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_set_apply_bone:
.. rst-class:: classref-method
|void| **set_apply_bone**\ (\ index\: :ref:`int<class_int>`, bone\: :ref:`int<class_int>`\ ) :ref:`🔗<class_BoneConstraint3D_method_set_apply_bone>`
Sets the apply bone of the setting at ``index`` to ``bone``. This bone will be modified.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_set_apply_bone_name:
.. rst-class:: classref-method
|void| **set_apply_bone_name**\ (\ index\: :ref:`int<class_int>`, bone_name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_BoneConstraint3D_method_set_apply_bone_name>`
Sets the apply bone of the setting at ``index`` to ``bone_name``. This bone will be modified.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_set_reference_bone:
.. rst-class:: classref-method
|void| **set_reference_bone**\ (\ index\: :ref:`int<class_int>`, bone\: :ref:`int<class_int>`\ ) :ref:`🔗<class_BoneConstraint3D_method_set_reference_bone>`
Sets the reference bone of the setting at ``index`` to ``bone``.
This bone will be only referenced and not modified by this modifier.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_set_reference_bone_name:
.. rst-class:: classref-method
|void| **set_reference_bone_name**\ (\ index\: :ref:`int<class_int>`, bone_name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_BoneConstraint3D_method_set_reference_bone_name>`
Sets the reference bone of the setting at ``index`` to ``bone_name``.
This bone will be only referenced and not modified by this modifier.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_set_reference_node:
.. rst-class:: classref-method
|void| **set_reference_node**\ (\ index\: :ref:`int<class_int>`, node\: :ref:`NodePath<class_NodePath>`\ ) :ref:`🔗<class_BoneConstraint3D_method_set_reference_node>`
Sets the reference node path of the setting at ``index`` to ``node``.
This node will be only referenced and not modified by this modifier.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_set_reference_type:
.. rst-class:: classref-method
|void| **set_reference_type**\ (\ index\: :ref:`int<class_int>`, type\: :ref:`ReferenceType<enum_BoneConstraint3D_ReferenceType>`\ ) :ref:`🔗<class_BoneConstraint3D_method_set_reference_type>`
Sets the reference target type of the setting at ``index`` to ``type``. See also :ref:`ReferenceType<enum_BoneConstraint3D_ReferenceType>`.
.. rst-class:: classref-item-separator
----
.. _class_BoneConstraint3D_method_set_setting_count:
.. rst-class:: classref-method
|void| **set_setting_count**\ (\ count\: :ref:`int<class_int>`\ ) :ref:`🔗<class_BoneConstraint3D_method_set_setting_count>`
Sets the number of settings in the modifier.
.. |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.)`