SkeletonModification2D
Base class for resources that operate on Bone2Ds in a Skeleton2D.
Base class for resources that operate on Bone2Ds in a Skeleton2D.
This resource provides an interface that can be expanded so code that operates on Bone2D nodes in a Skeleton2D can be mixed and matched together to create complex interactions.
This is used to provide Reckfell with a flexible and powerful Inverse Kinematics solution that can be adapted for many different uses.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
SkeletonModification2DConstructor
public SkeletonModification2D();Properties2
EnabledProperty
public bool Enabled { get; set; }If true, the modification's SkeletonModification2D._Execute function will be called by the SkeletonModificationStack2D.
ExecutionModeProperty
public int ExecutionMode { get; set; }The execution mode for the modification. This tells the modification stack when to execute the modification. Some modifications have settings that are only available in certain execution modes.
Methods13
ClampAnglefloat
public float ClampAngle(float angle, float min, float max, bool invert);Takes an angle and clamps it so it is within the passed-in min and max range. invert will inversely clamp the angle, clamping it to the range outside of the given bounds.
| Name | Type | Default |
|---|---|---|
angle | float | — |
min | float | — |
max | float | — |
invert | bool | — |
floatGetEditorDrawGizmobool
public bool GetEditorDrawGizmo();Returns whether this modification will call SkeletonModification2D._DrawEditorGizmo in the Reckfell editor to draw modification-specific gizmos.
boolGetEnabledbool
public bool GetEnabled();boolGetExecutionModeint
public int GetExecutionMode();intGetIsSetupbool
public bool GetIsSetup();Returns whether this modification has been successfully setup or not.
boolGetModificationStackSkeletonModificationStack2D
public SkeletonModificationStack2D GetModificationStack();Returns the SkeletonModificationStack2D that this modification is bound to. Through the modification stack, you can access the Skeleton2D the modification is operating on.
SkeletonModificationStack2DSetEditorDrawGizmovoid
public void SetEditorDrawGizmo(bool drawGizmo);Sets whether this modification will call SkeletonModification2D._DrawEditorGizmo in the Reckfell editor to draw modification-specific gizmos.
| Name | Type | Default |
|---|---|---|
drawGizmo | bool | — |
SetEnabledvoid
public void SetEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetExecutionModevoid
public void SetExecutionMode(int executionMode);| Name | Type | Default |
|---|---|---|
executionMode | int | — |
SetIsSetupvoid
public void SetIsSetup(bool isSetup);Manually allows you to set the setup state of the modification. This function should only rarely be used, as the SkeletonModificationStack2D the modification is bound to should handle setting the modification up.
| Name | Type | Default |
|---|---|---|
isSetup | bool | — |
_DrawEditorGizmovoid
public virtual void _DrawEditorGizmo();Used for drawing editor-only modification gizmos. This function will only be called in the Reckfell editor and can be overridden to draw custom gizmos.
Note: You will need to use the Skeleton2D from SkeletonModificationStack2D.GetSkeleton and its draw functions, as the SkeletonModification2D resource cannot draw on its own.
_Executevoid
public virtual void _Execute(double delta);Executes the given modification. This is where the modification performs whatever function it is designed to do.
| Name | Type | Default |
|---|---|---|
delta | double | — |
_SetupModificationvoid
public virtual void _SetupModification(SkeletonModificationStack2D modificationStack);Called when the modification is setup. This is where the modification performs initialization.
| Name | Type | Default |
|---|---|---|
modificationStack | SkeletonModificationStack2D | — |