SkeletonModificationStack2D
A resource that holds a stack of SkeletonModification2D
s.
class SkeletonModificationStack2D
This resource is used by the Skeleton and holds a stack of SkeletonModification2D
s.
This controls the order of the modifications and how they are applied. Modification order is especially important for full-body IK setups, as you need to execute the modifications in the correct order to get the desired results. For example, you want to execute a modification on the spine before the arms on a humanoid skeleton.
This resource also controls how strongly all of the modifications are applied to the Skeleton2D
.
Superclasses
class Resource
Base class for serializable objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var enabled: Bool
If
true
, the modification’s in the stack will be called. This is handled automatically through theSkeleton2D
node.var modificationCount: Int32
The number of modifications in the stack.
var strength: Double
The interpolation strength of the modifications in stack. A value of
0
will make it where the modifications are not applied, a strength of0.5
will be half applied, and a strength of1
will allow the modifications to be fully applied and override theSkeleton2D
Bone2D
poses.func addModification(SkeletonModification2D?
) Adds the passed-in
SkeletonModification2D
to the stack.func deleteModification(modIdx: Int32
) Deletes the
SkeletonModification2D
at the index positionmodIdx
, if it exists.func enableAllModifications(enabled: Bool
) Enables all
SkeletonModification2D
s in the stack.func execute(delta: Double, executionMode: Int32
) Executes all of the
SkeletonModification2D
s in the stack that use the same execution mode as the passed-inexecutionMode
, starting from index0
tomodificationCount
.func getIsSetup(
) -> Bool Returns a boolean that indicates whether the modification stack is setup and can execute.
func getModification(modIdx: Int32
) -> SkeletonModification2D? Returns the
SkeletonModification2D
at the passed-in index,modIdx
.func getSkeleton(
) -> Skeleton2D? Returns the
Skeleton2D
node that the SkeletonModificationStack2D is bound to.func setModification(modIdx: Int32, modification: SkeletonModification2D?
) Sets the modification at
modIdx
to the passed-in modification,modification
.func setup(
) Sets up the modification stack so it can execute. This function should be called by
Skeleton2D
and shouldn’t be manually called unless you know what you are doing.