: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/SkeletonModification2DPhysicalBones.xml. .. _class_SkeletonModification2DPhysicalBones: SkeletonModification2DPhysicalBones =================================== **Inherits:** :ref:`SkeletonModification2D` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` A modification that applies the transforms of :ref:`PhysicalBone2D` nodes to :ref:`Bone2D` nodes. Description ----------- This modification takes the transforms of :ref:`PhysicalBone2D` nodes and applies them to :ref:`Bone2D` nodes. This allows the :ref:`Bone2D` nodes to react to physics thanks to the linked :ref:`PhysicalBone2D` nodes. Properties ---------- +-----------------------+------------------------------------------------------------------------------------------------------------------+-------+ | :ref:`int` | :ref:`physical_bone_chain_length` | ``0`` | +-----------------------+------------------------------------------------------------------------------------------------------------------+-------+ Methods ------- +---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fetch_physical_bones` **(** **)** | +---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`NodePath` | :ref:`get_physical_bone_node` **(** :ref:`int` joint_idx **)** |const| | +---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_physical_bone_node` **(** :ref:`int` joint_idx, :ref:`NodePath` physicalbone2d_node **)** | +---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`start_simulation` **(** :ref:`StringName[]` bones=[] **)** | +---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`stop_simulation` **(** :ref:`StringName[]` bones=[] **)** | +---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- .. _class_SkeletonModification2DPhysicalBones_property_physical_bone_chain_length: - :ref:`int` **physical_bone_chain_length** +-----------+---------------------------------------+ | *Default* | ``0`` | +-----------+---------------------------------------+ | *Setter* | set_physical_bone_chain_length(value) | +-----------+---------------------------------------+ | *Getter* | get_physical_bone_chain_length() | +-----------+---------------------------------------+ The amount of :ref:`PhysicalBone2D` nodes linked in this modification. Method Descriptions ------------------- .. _class_SkeletonModification2DPhysicalBones_method_fetch_physical_bones: - void **fetch_physical_bones** **(** **)** Empties the list of :ref:`PhysicalBone2D` nodes and populates it will all :ref:`PhysicalBone2D` nodes that are children of the :ref:`Skeleton2D`. ---- .. _class_SkeletonModification2DPhysicalBones_method_get_physical_bone_node: - :ref:`NodePath` **get_physical_bone_node** **(** :ref:`int` joint_idx **)** |const| Returns the :ref:`PhysicalBone2D` node at ``joint_idx``. ---- .. _class_SkeletonModification2DPhysicalBones_method_set_physical_bone_node: - void **set_physical_bone_node** **(** :ref:`int` joint_idx, :ref:`NodePath` physicalbone2d_node **)** Sets the :ref:`PhysicalBone2D` node at ``joint_idx``. \ **Note:** This is just the index used for this modification, not the bone index used in the :ref:`Skeleton2D`. ---- .. _class_SkeletonModification2DPhysicalBones_method_start_simulation: - void **start_simulation** **(** :ref:`StringName[]` bones=[] **)** Tell the :ref:`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 :ref:`PhysicalBone2D` nodes with those names to start simulating. ---- .. _class_SkeletonModification2DPhysicalBones_method_stop_simulation: - void **stop_simulation** **(** :ref:`StringName[]` bones=[] **)** Tell the :ref:`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 :ref:`PhysicalBone2D` nodes with those names to stop simulating. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |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.)`