Documentation ¶
Overview ¶
Package Skeleton3D provides methods for working with Skeleton3D object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AddBone(name string) int
- func (self Instance) AnimatePhysicalBones() bool
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsSkeleton3D() Instance
- func (self Instance) ClearBones()
- func (self Instance) ClearBonesGlobalPoseOverride()
- func (self Instance) CreateSkinFromRestTransforms() [1]gdclass.Skin
- func (self Instance) FindBone(name string) int
- func (self Instance) ForceUpdateAllBoneTransforms()
- func (self Instance) ForceUpdateBoneChildTransform(bone_idx int)
- func (self Instance) GetBoneChildren(bone_idx int) []int32
- func (self Instance) GetBoneCount() int
- func (self Instance) GetBoneGlobalPose(bone_idx int) Transform3D.BasisOrigin
- func (self Instance) GetBoneGlobalPoseNoOverride(bone_idx int) Transform3D.BasisOrigin
- func (self Instance) GetBoneGlobalPoseOverride(bone_idx int) Transform3D.BasisOrigin
- func (self Instance) GetBoneGlobalRest(bone_idx int) Transform3D.BasisOrigin
- func (self Instance) GetBoneName(bone_idx int) string
- func (self Instance) GetBoneParent(bone_idx int) int
- func (self Instance) GetBonePose(bone_idx int) Transform3D.BasisOrigin
- func (self Instance) GetBonePosePosition(bone_idx int) Vector3.XYZ
- func (self Instance) GetBonePoseRotation(bone_idx int) Quaternion.IJKX
- func (self Instance) GetBonePoseScale(bone_idx int) Vector3.XYZ
- func (self Instance) GetBoneRest(bone_idx int) Transform3D.BasisOrigin
- func (self Instance) GetConcatenatedBoneNames() string
- func (self Instance) GetParentlessBones() []int32
- func (self Instance) GetVersion() int
- func (self Instance) IsBoneEnabled(bone_idx int) bool
- func (self Instance) LocalizeRests()
- func (self Instance) ModifierCallbackModeProcess() gdclass.Skeleton3DModifierCallbackModeProcess
- func (self Instance) MotionScale() Float.X
- func (self Instance) OnBoneEnabledChanged(cb func(bone_idx int))
- func (self Instance) OnBoneListChanged(cb func())
- func (self Instance) OnPoseUpdated(cb func())
- func (self Instance) OnShowRestOnlyChanged(cb func())
- func (self Instance) OnSkeletonUpdated(cb func())
- func (self Instance) PhysicalBonesAddCollisionException(exception RID.Body3D)
- func (self Instance) PhysicalBonesRemoveCollisionException(exception RID.Body3D)
- func (self Instance) PhysicalBonesStartSimulation()
- func (self Instance) PhysicalBonesStopSimulation()
- func (self Instance) RegisterSkin(skin [1]gdclass.Skin) [1]gdclass.SkinReference
- func (self Instance) ResetBonePose(bone_idx int)
- func (self Instance) ResetBonePoses()
- func (self Instance) SetAnimatePhysicalBones(value bool)
- func (self Instance) SetBoneEnabled(bone_idx int)
- func (self Instance) SetBoneGlobalPose(bone_idx int, pose Transform3D.BasisOrigin)
- func (self Instance) SetBoneGlobalPoseOverride(bone_idx int, pose Transform3D.BasisOrigin, amount Float.X)
- func (self Instance) SetBoneName(bone_idx int, name string)
- func (self Instance) SetBoneParent(bone_idx int, parent_idx int)
- func (self Instance) SetBonePose(bone_idx int, pose Transform3D.BasisOrigin)
- func (self Instance) SetBonePosePosition(bone_idx int, position Vector3.XYZ)
- func (self Instance) SetBonePoseRotation(bone_idx int, rotation Quaternion.IJKX)
- func (self Instance) SetBonePoseScale(bone_idx int, scale Vector3.XYZ)
- func (self Instance) SetBoneRest(bone_idx int, rest Transform3D.BasisOrigin)
- func (self Instance) SetModifierCallbackModeProcess(value gdclass.Skeleton3DModifierCallbackModeProcess)
- func (self Instance) SetMotionScale(value Float.X)
- func (self Instance) SetShowRestOnly(value bool)
- func (self Instance) ShowRestOnly() bool
- func (self Instance) UnparentBoneAndRest(bone_idx int)
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
- type ModifierCallbackModeProcess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Instance ¶
type Instance [1]gdclass.Skeleton3D
[Skeleton3D] provides an interface for managing a hierarchy of bones, including pose, rest and animation (see [Animation]). It can also use ragdoll physics. The overall transform of a bone with respect to the skeleton is determined by bone pose. Bone rest defines the initial transform of the bone pose. Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it is not the actual global/world transform of the bone.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddBone ¶
Adds a new bone with the given name. Returns the new bone's index, or [code]-1[/code] if this method fails. [b]Note:[/b] Bone names should be unique, non empty, and cannot include the [code]:[/code] and [code]/[/code] characters.
func (Instance) AnimatePhysicalBones ¶
func (Instance) AsSkeleton3D ¶
func (Instance) ClearBones ¶
func (self Instance) ClearBones()
Clear all the bones in this skeleton.
func (Instance) ClearBonesGlobalPoseOverride ¶
func (self Instance) ClearBonesGlobalPoseOverride()
Removes the global pose override on all bones in the skeleton.
func (Instance) CreateSkinFromRestTransforms ¶
func (Instance) FindBone ¶
Returns the bone index that matches [param name] as its name. Returns [code]-1[/code] if no bone with this name exists.
func (Instance) ForceUpdateAllBoneTransforms ¶
func (self Instance) ForceUpdateAllBoneTransforms()
Force updates the bone transforms/poses for all bones in the skeleton.
func (Instance) ForceUpdateBoneChildTransform ¶
Force updates the bone transform for the bone at [param bone_idx] and all of its children.
func (Instance) GetBoneChildren ¶
Returns an array containing the bone indexes of all the child node of the passed in bone, [param bone_idx].
func (Instance) GetBoneCount ¶
Returns the number of bones in the skeleton.
func (Instance) GetBoneGlobalPose ¶
func (self Instance) GetBoneGlobalPose(bone_idx int) Transform3D.BasisOrigin
Returns the overall transform of the specified bone, with respect to the skeleton. Being relative to the skeleton frame, this is not the actual "global" transform of the bone. [b]Note:[/b] This is the global pose you set to the skeleton in the process, the final global pose can get overridden by modifiers in the deferred process, if you want to access the final global pose, use [signal SkeletonModifier3D.modification_processed].
func (Instance) GetBoneGlobalPoseNoOverride ¶
func (self Instance) GetBoneGlobalPoseNoOverride(bone_idx int) Transform3D.BasisOrigin
Returns the overall transform of the specified bone, with respect to the skeleton, but without any global pose overrides. Being relative to the skeleton frame, this is not the actual "global" transform of the bone.
func (Instance) GetBoneGlobalPoseOverride ¶
func (self Instance) GetBoneGlobalPoseOverride(bone_idx int) Transform3D.BasisOrigin
Returns the global pose override transform for [param bone_idx].
func (Instance) GetBoneGlobalRest ¶
func (self Instance) GetBoneGlobalRest(bone_idx int) Transform3D.BasisOrigin
Returns the global rest transform for [param bone_idx].
func (Instance) GetBoneName ¶
Returns the name of the bone at index [param bone_idx].
func (Instance) GetBoneParent ¶
Returns the bone index which is the parent of the bone at [param bone_idx]. If -1, then bone has no parent. [b]Note:[/b] The parent bone returned will always be less than [param bone_idx].
func (Instance) GetBonePose ¶
func (self Instance) GetBonePose(bone_idx int) Transform3D.BasisOrigin
Returns the pose transform of the specified bone. [b]Note:[/b] This is the pose you set to the skeleton in the process, the final pose can get overridden by modifiers in the deferred process, if you want to access the final pose, use [signal SkeletonModifier3D.modification_processed].
func (Instance) GetBonePosePosition ¶
Returns the pose position of the bone at [param bone_idx]. The returned [Vector3] is in the local coordinate space of the [Skeleton3D] node.
func (Instance) GetBonePoseRotation ¶
func (self Instance) GetBonePoseRotation(bone_idx int) Quaternion.IJKX
Returns the pose rotation of the bone at [param bone_idx]. The returned [Quaternion] is local to the bone with respect to the rotation of any parent bones.
func (Instance) GetBonePoseScale ¶
Returns the pose scale of the bone at [param bone_idx].
func (Instance) GetBoneRest ¶
func (self Instance) GetBoneRest(bone_idx int) Transform3D.BasisOrigin
Returns the rest transform for a bone [param bone_idx].
func (Instance) GetConcatenatedBoneNames ¶
Returns all bone names concatenated with commas ([code],[/code]) as a single [StringName]. It is useful to set it as a hint for the enum property.
func (Instance) GetParentlessBones ¶
Returns an array with all of the bones that are parentless. Another way to look at this is that it returns the indexes of all the bones that are not dependent or modified by other bones in the Skeleton.
func (Instance) GetVersion ¶
Returns the number of times the bone hierarchy has changed within this skeleton, including renames. The Skeleton version is not serialized: only use within a single instance of Skeleton3D. Use for invalidating caches in IK solvers and other nodes which process bones.
func (Instance) IsBoneEnabled ¶
Returns whether the bone pose for the bone at [param bone_idx] is enabled.
func (Instance) LocalizeRests ¶
func (self Instance) LocalizeRests()
Returns all bones in the skeleton to their rest poses.
func (Instance) ModifierCallbackModeProcess ¶
func (self Instance) ModifierCallbackModeProcess() gdclass.Skeleton3DModifierCallbackModeProcess
func (Instance) MotionScale ¶
func (Instance) OnBoneEnabledChanged ¶
func (Instance) OnBoneListChanged ¶
func (self Instance) OnBoneListChanged(cb func())
func (Instance) OnPoseUpdated ¶
func (self Instance) OnPoseUpdated(cb func())
func (Instance) OnShowRestOnlyChanged ¶
func (self Instance) OnShowRestOnlyChanged(cb func())
func (Instance) OnSkeletonUpdated ¶
func (self Instance) OnSkeletonUpdated(cb func())
func (Instance) PhysicalBonesAddCollisionException ¶
Adds a collision exception to the physical bone. Works just like the [RigidBody3D] node.
func (Instance) PhysicalBonesRemoveCollisionException ¶
Removes a collision exception to the physical bone. Works just like the [RigidBody3D] node.
func (Instance) PhysicalBonesStartSimulation ¶
func (self Instance) PhysicalBonesStartSimulation()
Tells the [PhysicalBone3D] nodes in the Skeleton to start simulating and reacting to the physics world. Optionally, a list of bone names can be passed-in, allowing only the passed-in bones to be simulated.
func (Instance) PhysicalBonesStopSimulation ¶
func (self Instance) PhysicalBonesStopSimulation()
Tells the [PhysicalBone3D] nodes in the Skeleton to stop simulating.
func (Instance) RegisterSkin ¶
func (self Instance) RegisterSkin(skin [1]gdclass.Skin) [1]gdclass.SkinReference
Binds the given Skin to the Skeleton.
func (Instance) ResetBonePose ¶
Sets the bone pose to rest for [param bone_idx].
func (Instance) ResetBonePoses ¶
func (self Instance) ResetBonePoses()
Sets all bone poses to rests.
func (Instance) SetAnimatePhysicalBones ¶
func (Instance) SetBoneEnabled ¶
Disables the pose for the bone at [param bone_idx] if [code]false[/code], enables the bone pose if [code]true[/code].
func (Instance) SetBoneGlobalPose ¶
func (self Instance) SetBoneGlobalPose(bone_idx int, pose Transform3D.BasisOrigin)
Sets the global pose transform, [param pose], for the bone at [param bone_idx]. [b]Note:[/b] If other bone poses have been changed, this method executes a dirty poses recalculation and will cause performance to deteriorate. If you know that multiple global poses will be applied, consider using [method set_bone_pose] with precalculation.
func (Instance) SetBoneGlobalPoseOverride ¶
func (self Instance) SetBoneGlobalPoseOverride(bone_idx int, pose Transform3D.BasisOrigin, amount Float.X)
Sets the global pose transform, [param pose], for the bone at [param bone_idx]. [param amount] is the interpolation strength that will be used when applying the pose, and [param persistent] determines if the applied pose will remain. [b]Note:[/b] The pose transform needs to be a global pose! To convert a world transform from a [Node3D] to a global bone pose, multiply the [method Transform3D.affine_inverse] of the node's [member Node3D.global_transform] by the desired world transform.
func (Instance) SetBoneName ¶
Sets the bone name, [param name], for the bone at [param bone_idx].
func (Instance) SetBoneParent ¶
Sets the bone index [param parent_idx] as the parent of the bone at [param bone_idx]. If -1, then bone has no parent. [b]Note:[/b] [param parent_idx] must be less than [param bone_idx].
func (Instance) SetBonePose ¶
func (self Instance) SetBonePose(bone_idx int, pose Transform3D.BasisOrigin)
Sets the pose transform, [param pose], for the bone at [param bone_idx].
func (Instance) SetBonePosePosition ¶
Sets the pose position of the bone at [param bone_idx] to [param position]. [param position] is a [Vector3] describing a position local to the [Skeleton3D] node.
func (Instance) SetBonePoseRotation ¶
func (self Instance) SetBonePoseRotation(bone_idx int, rotation Quaternion.IJKX)
Sets the pose rotation of the bone at [param bone_idx] to [param rotation]. [param rotation] is a [Quaternion] describing a rotation in the bone's local coordinate space with respect to the rotation of any parent bones.
func (Instance) SetBonePoseScale ¶
Sets the pose scale of the bone at [param bone_idx] to [param scale].
func (Instance) SetBoneRest ¶
func (self Instance) SetBoneRest(bone_idx int, rest Transform3D.BasisOrigin)
Sets the rest transform for bone [param bone_idx].
func (Instance) SetModifierCallbackModeProcess ¶
func (self Instance) SetModifierCallbackModeProcess(value gdclass.Skeleton3DModifierCallbackModeProcess)
func (Instance) SetMotionScale ¶
func (Instance) SetShowRestOnly ¶
func (Instance) ShowRestOnly ¶
func (Instance) UnparentBoneAndRest ¶
Unparents the bone at [param bone_idx] and sets its rest position to that of its parent prior to being reset.
func (*Instance) UnsafePointer ¶
type ModifierCallbackModeProcess ¶
type ModifierCallbackModeProcess = gdclass.Skeleton3DModifierCallbackModeProcess //gd:Skeleton3D.ModifierCallbackModeProcess
const ( /*Set a flag to process modification during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]).*/ ModifierCallbackModeProcessPhysics ModifierCallbackModeProcess = 0 /*Set a flag to process modification during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]).*/ ModifierCallbackModeProcessIdle ModifierCallbackModeProcess = 1 )