2025-10-01 15:23:05 +02:00

150 lines
6.3 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<class name="SpineBone" inherits="SpineObjectWrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
The current pose for a bone, before constraints are applied.
</brief_description>
<description>
The current pose for a bone, before constraints are applied.
A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a constraint or application code modifies the world transform after it was computed from the local transform.
The bone's world transform is relative to the skeleton's coordinate system origin. Use [method set_global_transform] and [method get_global_transform] to convert from and to Godot's Canvas coordinate system.
</description>
<methods>
<method name="world_to_local">
<return type="Vector2" />
<param index="0" name="world_position" type="Vector2" />
<description>
Transforms a point from world coordinates to the bone's local coordinates. The world coordinate space is equal to the SpineSprite coordinate space.
</description>
</method>
<method name="world_to_parent">
<return type="Vector2" />
<param index="0" name="world_position" type="Vector2" />
<description>
Transforms a point from world coordinates to the parent bone's local coordinates.
</description>
</method>
<method name="local_to_world">
<return type="Vector2" />
<param index="0" name="local_position" type="Vector2" />
<description>
Transforms a point from the bone's local coordinates to world coordinates. The world coordinate space equals the coordinate space of the SpineSprite.
</description>
</method>
<method name="parent_to_world">
<return type="Vector2" />
<param index="0" name="local_position" type="Vector2" />
<description>
Transforms a point from the parent bone's coordinates to world coordinates.
</description>
</method>
<method name="world_to_local_rotation">
<return type="float" />
<param index="0" name="world_rotation" type="float" />
<description>
Transforms a world rotation to a local rotation. The world coordinate space is equal to the SpineSprite coordinate space.
</description>
</method>
<method name="local_to_world_rotation">
<return type="float" />
<param index="0" name="local_rotation" type="float" />
<description>
Transforms a local rotation to a world rotation. The world coordinate space equals the coordinate space of the SpineSprite.
</description>
</method>
<method name="rotate_world">
<return type="void" />
<param index="0" name="degrees" type="float" />
<description>
Rotates the world transform the specified amount in degrees.
After changes are made to the world transform, update_local_transform should be called on the applied pose and update_world_transform will need to be called on any child bones, recursively.
</description>
</method>
<method name="get_data">
<return type="SpineBoneData" />
<description>
Returns the bone's setup pose data.
</description>
</method>
<method name="get_parent">
<return type="SpineBone" />
<description>
Returns the parent bone, or null if this is the root bone.
</description>
</method>
<method name="get_children">
<return type="Array" />
<description>
Returns the immediate children of this bone. Modifications of the array have no effect.
</description>
</method>
<method name="get_pose">
<return type="SpineBoneLocal" />
<description>
Returns the local pose for this bone. The pose contains the local transform (position, rotation, scale, shear).
</description>
</method>
<method name="get_applied_pose">
<return type="SpineBonePose" />
<description>
Returns the applied pose for this bone. The applied pose contains both the local transform and the world transform. The applied transform may differ from the pose if a constraint or application code modifies the world transform after it was computed from the local transform.
</description>
</method>
<method name="is_active">
<return type="bool" />
<description>
Returns false when the bone has not been computed because BoneData.skin_required is true and the active skin does not contain this bone.
</description>
</method>
<method name="set_active">
<return type="void" />
<param index="0" name="v" type="bool" />
<description>
Sets whether this bone is active. Inactive bones are not computed until they are active again.
</description>
</method>
<method name="update">
<return type="void" />
<param index="0" name="skeleton" type="SpineSkeleton" />
<param index="1" name="physics" type="int" enum="SpineConstant.Physics" />
<description>
Updates this bone. This is called internally when the skeleton's world transform is computed and should typically not be called directly. The physics parameter determines how physics are applied. See [enum SpineConstant.Physics].
</description>
</method>
<method name="apply_world_transform_2d">
<return type="void" />
<param index="0" name="o" type="Variant" />
<description>
Applies a world transform to this bone from a Node2D or Bone2D object.
</description>
</method>
<method name="get_transform">
<return type="Transform2D" />
<description>
Returns the bone transform as a Transform2D relative to the SpineSprite node representing the skeleton. Shear is not encoded in the transform.
</description>
</method>
<method name="set_transform">
<return type="void" />
<param index="0" name="transform" type="Transform2D" />
<description>
Sets the bone transform to the Godot Transform2D relative to the SpineSprite.
</description>
</method>
<method name="get_global_transform">
<return type="Transform2D" />
<description>
Returns the bone transform as a Transform2D relative to Godot's global canvas coordinate space. Shear is not encoded in the transform.
</description>
</method>
<method name="set_global_transform">
<return type="void" />
<param index="0" name="trans" type="Transform2D" />
<description>
Sets the bone's transform to the global Godot Transform2D.
</description>
</method>
</methods>
</class>