Class SkeletonModificationStack2D
- Namespace
- Godot
- Assembly
- GodotSharp.dll
This resource is used by the Skeleton and holds a stack of SkeletonModification2Ds.
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.
public class SkeletonModificationStack2D : Resource, IDisposable
- Inheritance
-
SkeletonModificationStack2D
- Implements
- Inherited Members
Constructors
SkeletonModificationStack2D()
public SkeletonModificationStack2D()
Properties
Enabled
If true
, the modification's in the stack will be called. This is handled automatically through the Skeleton2D node.
public bool Enabled { get; set; }
Property Value
ModificationCount
The number of modifications in the stack.
public int ModificationCount { get; set; }
Property Value
Strength
The interpolation strength of the modifications in stack. A value of 0
will make it where the modifications are not applied, a strength of 0.5
will be half applied, and a strength of 1
will allow the modifications to be fully applied and override the Skeleton2DBone2D poses.
public float Strength { get; set; }
Property Value
Methods
AddModification(SkeletonModification2D)
Adds the passed-in SkeletonModification2D to the stack.
public void AddModification(SkeletonModification2D modification)
Parameters
modification
SkeletonModification2D
DeleteModification(int)
Deletes the SkeletonModification2D at the index position modIdx
, if it exists.
public void DeleteModification(int modIdx)
Parameters
modIdx
int
EnableAllModifications(bool)
Enables all SkeletonModification2Ds in the stack.
public void EnableAllModifications(bool enabled)
Parameters
enabled
bool
Execute(float, int)
Executes all of the SkeletonModification2Ds in the stack that use the same execution mode as the passed-in executionMode
, starting from index 0
to ModificationCount.
Note: The order of the modifications can matter depending on the modifications. For example, modifications on a spine should operate before modifications on the arms in order to get proper results.
public void Execute(float delta, int executionMode)
Parameters
GetIsSetup()
Returns a boolean that indicates whether the modification stack is setup and can execute.
public bool GetIsSetup()
Returns
GetModification(int)
Returns the SkeletonModification2D at the passed-in index, modIdx
.
public SkeletonModification2D GetModification(int modIdx)
Parameters
modIdx
int
Returns
GetSkeleton()
Returns the Skeleton2D node that the SkeletonModificationStack2D is bound to.
public Skeleton2D GetSkeleton()
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
SetModification(int, SkeletonModification2D)
Sets the modification at modIdx
to the passed-in modification, modification
.
public void SetModification(int modIdx, SkeletonModification2D modification)
Parameters
modIdx
intmodification
SkeletonModification2D
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.
public void Setup()