reckfellENGINE

SkeletonModification2DCcdik

A modification that uses CCDIK to manipulate a series of bones to reach a target in 2D.

On this page
class SkeletonModification2DCcdikReckfellSharpInherits SkeletonModification2D

A modification that uses CCDIK to manipulate a series of bones to reach a target in 2D.

This SkeletonModification2D uses an algorithm called Cyclic Coordinate Descent Inverse Kinematics, or CCDIK, to manipulate a chain of bones in a Skeleton2D so it reaches a defined target. CCDIK works by rotating a set of bones, typically called a "bone chain", on a single axis. Each bone is rotated to face the target from the tip (by default), which over a chain of bones allow it to rotate properly to reach the target. Because the bones only rotate on a single axis, CCDIK can look more robotic than other IK solvers. Note: The CCDIK modifier has ccdik_joints, which are the data objects that hold the data for each joint in the CCDIK chain. This is different from a bone! CCDIK joints hold the data needed for each bone in the bone chain used by CCDIK. CCDIK also fully supports angle constraints, allowing for more control over how a solution is met.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

SkeletonModification2DCcdikConstructor
# SkeletonModification2DCcdik
C#
public SkeletonModification2DCcdik();

Properties3

CcdikDataChainLengthProperty
# CcdikDataChainLength
C#
public int CcdikDataChainLength { get; set; }

The number of CCDIK joints in the CCDIK modification.

TargetEntitypathProperty
# TargetEntitypath
C#
public EntityPath TargetEntitypath { get; set; }

The EntityPath to the node that is the target for the CCDIK modification. This node is what the CCDIK chain will attempt to rotate the bone chain to.

TipEntitypathProperty
# TipEntitypath
C#
public EntityPath TipEntitypath { get; set; }

The end position of the CCDIK chain. Typically, this should be a child of a Bone2D node attached to the final Bone2D in the CCDIK chain.

Methods20

GetCcdikDataChainLengthint
# GetCcdikDataChainLength
C#
public int GetCcdikDataChainLength();
Returns int
GetCcdikJointBone2DEntityEntityPath
# GetCcdikJointBone2DEntity
C#
public EntityPath GetCcdikJointBone2DEntity(int jointIdx);

Returns the Bone2D node assigned to the CCDIK joint at joint_idx.

Parameters
NameTypeDefault
jointIdxint—
Returns EntityPath
GetCcdikJointBoneIndexint
# GetCcdikJointBoneIndex
C#
public int GetCcdikJointBoneIndex(int jointIdx);

Returns the index of the Bone2D node assigned to the CCDIK joint at joint_idx.

Parameters
NameTypeDefault
jointIdxint—
Returns int
GetCcdikJointConstraintAngleInvertbool
# GetCcdikJointConstraintAngleInvert
C#
public bool GetCcdikJointConstraintAngleInvert(int jointIdx);

Returns whether the CCDIK joint at joint_idx uses an inverted joint constraint. See SkeletonModification2DCcdik.SetCcdikJointConstraintAngleInvert for details.

Parameters
NameTypeDefault
jointIdxint—
Returns bool
GetCcdikJointConstraintAngleMaxfloat
# GetCcdikJointConstraintAngleMax
C#
public float GetCcdikJointConstraintAngleMax(int jointIdx);

Returns the maximum angle constraint for the joint at joint_idx.

Parameters
NameTypeDefault
jointIdxint—
Returns float
GetCcdikJointConstraintAngleMinfloat
# GetCcdikJointConstraintAngleMin
C#
public float GetCcdikJointConstraintAngleMin(int jointIdx);

Returns the minimum angle constraint for the joint at joint_idx.

Parameters
NameTypeDefault
jointIdxint—
Returns float
GetCcdikJointEnableConstraintbool
# GetCcdikJointEnableConstraint
C#
public bool GetCcdikJointEnableConstraint(int jointIdx);

Returns whether angle constraints on the CCDIK joint at joint_idx are enabled.

Parameters
NameTypeDefault
jointIdxint—
Returns bool
GetCcdikJointRotateFromJointbool
# GetCcdikJointRotateFromJoint
C#
public bool GetCcdikJointRotateFromJoint(int jointIdx);

Returns whether the joint at joint_idx is set to rotate from the joint, true, or to rotate from the tip, false. The default is to rotate from the tip.

Parameters
NameTypeDefault
jointIdxint—
Returns bool
GetTargetEntityEntityPath
# GetTargetEntity
C#
public EntityPath GetTargetEntity();
Returns EntityPath
GetTipEntityEntityPath
# GetTipEntity
C#
public EntityPath GetTipEntity();
Returns EntityPath
SetCcdikDataChainLengthvoid
# SetCcdikDataChainLength
C#
public void SetCcdikDataChainLength(int length);
Parameters
NameTypeDefault
lengthint—
SetCcdikJointBone2DEntityvoid
# SetCcdikJointBone2DEntity
C#
public void SetCcdikJointBone2DEntity(int jointIdx, EntityPath bone2DEntitypath);

Sets the Bone2D node assigned to the CCDIK joint at joint_idx.

Parameters
NameTypeDefault
jointIdxint—
bone2DEntitypathEntityPath—
SetCcdikJointBoneIndexvoid
# SetCcdikJointBoneIndex
C#
public void SetCcdikJointBoneIndex(int jointIdx, int boneIdx);

Sets the bone index, bone_idx, of the CCDIK joint at joint_idx. When possible, this will also update the bone2d_node of the CCDIK joint based on data provided by the linked skeleton.

Parameters
NameTypeDefault
jointIdxint—
boneIdxint—
SetCcdikJointConstraintAngleInvertvoid
# SetCcdikJointConstraintAngleInvert
C#
public void SetCcdikJointConstraintAngleInvert(int jointIdx, bool invert);

Sets whether the CCDIK joint at joint_idx uses an inverted joint constraint. An inverted joint constraint only constraints the CCDIK joint to the angles outside of the inputted minimum and maximum angles. For this reason, it is referred to as an inverted joint constraint, as it constraints the joint to the outside of the inputted values.

Parameters
NameTypeDefault
jointIdxint—
invertbool—
SetCcdikJointConstraintAngleMaxvoid
# SetCcdikJointConstraintAngleMax
C#
public void SetCcdikJointConstraintAngleMax(int jointIdx, float angleMax);

Sets the maximum angle constraint for the joint at joint_idx.

Parameters
NameTypeDefault
jointIdxint—
angleMaxfloat—
SetCcdikJointConstraintAngleMinvoid
# SetCcdikJointConstraintAngleMin
C#
public void SetCcdikJointConstraintAngleMin(int jointIdx, float angleMin);

Sets the minimum angle constraint for the joint at joint_idx.

Parameters
NameTypeDefault
jointIdxint—
angleMinfloat—
SetCcdikJointEnableConstraintvoid
# SetCcdikJointEnableConstraint
C#
public void SetCcdikJointEnableConstraint(int jointIdx, bool enableConstraint);

Determines whether angle constraints on the CCDIK joint at joint_idx are enabled. When true, constraints will be enabled and taken into account when solving.

Parameters
NameTypeDefault
jointIdxint—
enableConstraintbool—
SetCcdikJointRotateFromJointvoid
# SetCcdikJointRotateFromJoint
C#
public void SetCcdikJointRotateFromJoint(int jointIdx, bool rotateFromJoint);

Sets whether the joint at joint_idx is set to rotate from the joint, true, or to rotate from the tip, false.

Parameters
NameTypeDefault
jointIdxint—
rotateFromJointbool—
SetTargetEntityvoid
# SetTargetEntity
C#
public void SetTargetEntity(EntityPath targetEntitypath);
Parameters
NameTypeDefault
targetEntitypathEntityPath—
SetTipEntityvoid
# SetTipEntity
C#
public void SetTipEntity(EntityPath tipEntitypath);
Parameters
NameTypeDefault
tipEntitypathEntityPath—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.