Signal2
Signal support.
Skeleton3D.swift:1557class Signal2
Use the connect(flags:_:)
method to connect to the signal on the container object, and disconnect(_:)
to drop the connection.
You can also await the emitted
property for waiting for a single emission of the signal.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (50) members.
Types
class Signal1
Signal support.
Type members
Instance members
var animatePhysicalBones: Bool
var boneEnabledChanged: Signal2
To connect to this signal, reference this property and call the
var bonePoseChanged: Signal1
This signal is emitted when one of the bones in the Skeleton3D node have changed their pose. This is used to inform nodes that rely on bone positions that one of the bones in the Skeleton3D have changed their transform/pose.
var motionScale: Double
Multiplies the 3D position track animation.
var poseUpdated: SimpleSignal
To connect to this signal, reference this property and call the
var showRestOnly: Bool
var showRestOnlyChanged: SimpleSignal
To connect to this signal, reference this property and call the
func addBone(name: String
) Adds a bone, with name
name
.getBoneCount
will become the bone index.func clearBones(
) Clear all the bones in this skeleton.
func clearBonesGlobalPoseOverride(
) Removes the global pose override on all bones in the skeleton.
func createSkinFromRestTransforms(
) -> Skin? func findBone(name: String
) -> Int32 Returns the bone index that matches
name
as its name.func forceUpdateAllBoneTransforms(
) Force updates the bone transforms/poses for all bones in the skeleton.
func forceUpdateBoneChildTransform(boneIdx: Int32
) Force updates the bone transform for the bone at
boneIdx
and all of its children.func getBoneChildren(boneIdx: Int32
) -> PackedInt32Array Returns an array containing the bone indexes of all the children node of the passed in bone,
boneIdx
.func getBoneCount(
) -> Int32 Returns the number of bones in the skeleton.
func getBoneGlobalPose(boneIdx: Int32
) -> Transform3D 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.
func getBoneGlobalPoseNoOverride(boneIdx: Int32
) -> Transform3D 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 getBoneGlobalPoseOverride(boneIdx: Int32
) -> Transform3D Returns the global pose override transform for
boneIdx
.func getBoneGlobalRest(boneIdx: Int32
) -> Transform3D Returns the global rest transform for
boneIdx
.func getBoneName(boneIdx: Int32
) -> String Returns the name of the bone at index
boneIdx
.func getBoneParent(boneIdx: Int32
) -> Int32 Returns the bone index which is the parent of the bone at
boneIdx
. If -1, then bone has no parent.func getBonePose(boneIdx: Int32
) -> Transform3D Returns the pose transform of the specified bone.
func getBonePosePosition(boneIdx: Int32
) -> Vector3 Returns the pose position of the bone at
boneIdx
. The returnedVector3
is in the local coordinate space of theSkeleton3D
node.func getBonePoseRotation(boneIdx: Int32
) -> Quaternion Returns the pose rotation of the bone at
boneIdx
. The returnedQuaternion
is local to the bone with respect to the rotation of any parent bones.func getBonePoseScale(boneIdx: Int32
) -> Vector3 Returns the pose scale of the bone at
boneIdx
.func getBoneRest(boneIdx: Int32
) -> Transform3D Returns the rest transform for a bone
boneIdx
.func getParentlessBones(
) -> PackedInt32Array 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 getVersion(
) -> UInt Returns the number of times the bone hierarchy has changed within this skeleton, including renames.
func isBoneEnabled(boneIdx: Int32
) -> Bool Returns whether the bone pose for the bone at
boneIdx
is enabled.func localizeRests(
) Returns all bones in the skeleton to their rest poses.
func physicalBonesAddCollisionException(RID
) Adds a collision exception to the physical bone.
func physicalBonesRemoveCollisionException(RID
) Removes a collision exception to the physical bone.
func physicalBonesStartSimulation(bones: VariantCollection<StringName>
) Tells the
PhysicalBone3D
nodes in the Skeleton to start simulating and reacting to the physics world.func physicalBonesStopSimulation(
) Tells the
PhysicalBone3D
nodes in the Skeleton to stop simulating.func registerSkin(Skin?
) -> SkinReference? Binds the given Skin to the Skeleton.
func resetBonePose(boneIdx: Int32
) Sets the bone pose to rest for
boneIdx
.func resetBonePoses(
) Sets all bone poses to rests.
func setBoneEnabled(boneIdx: Int32, enabled: Bool
) Disables the pose for the bone at
boneIdx
iffalse
, enables the bone pose iftrue
.func setBoneGlobalPoseOverride(boneIdx: Int32, pose: Transform3D, amount: Double, persistent: Bool
) Sets the global pose transform,
pose
, for the bone atboneIdx
.func setBoneName(boneIdx: Int32, name: String
) func setBoneParent(boneIdx: Int32, parentIdx: Int32
) Sets the bone index
parentIdx
as the parent of the bone atboneIdx
. If -1, then bone has no parent.func setBonePosePosition(boneIdx: Int32, position: Vector3
) Sets the pose position of the bone at
boneIdx
toposition
.position
is aVector3
describing a position local to theSkeleton3D
node.func setBonePoseRotation(boneIdx: Int32, rotation: Quaternion
) Sets the pose rotation of the bone at
boneIdx
torotation
.rotation
is aQuaternion
describing a rotation in the bone’s local coordinate space with respect to the rotation of any parent bones.func setBonePoseScale(boneIdx: Int32, scale: Vector3
) Sets the pose scale of the bone at
boneIdx
toscale
.func setBoneRest(boneIdx: Int32, rest: Transform3D
) Sets the rest transform for bone
boneIdx
.func unparentBoneAndRest(boneIdx: Int32
) Unparents the bone at
boneIdx
and sets its rest position to that of its parent prior to being reset.
Citizens in SwiftGodot
Instance members
var emitted: Void
You can await this property to wait for the signal to be emitted once
func connect(flags: Object.ConnectFlags, @escaping (_ boneIdx: Int64) -> ()
) -> Object Connects the signal to the specified callback
func disconnect(Object
) Disconnects a signal that was previously connected, the return value from calling
connect(flags:_:)