reckfellENGINE

IterateIK3D

A SkeletonModifier3D to approach the goal by repeating small rotations.

On this page
class IterateIK3DReckfellSharpInherits ChainIK3D

A SkeletonModifier3D to approach the goal by repeating small rotations.

Base class of SkeletonModifier3D to approach the goal by repeating small rotations. Each bone chain (setting) has one effector, which is processed in order of the setting list. You can set some limitations for each joint. Note: All the methods in this class take an index parameter. This parameter specifies which setting list entry to return if the IK has multiple entries (e.g. settings/<index>/target_node). Note: When IterateIK3D.SetJointRotationAxis or IterateIK3D.SetJointLimitation is set, the IK tip may not reach the target. This occurs because IK calculates the path through iterations, and in some cases, it may hit a limit during the process and fail to resolve. In some cases, this can be resolved by splitting the IK into several SkeletonModifier3Ds and setting the iteration order manually.

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

Properties5

AngularDeltaLimitProperty
# AngularDeltaLimit
C#
public double AngularDeltaLimit { get; set; }

The maximum amount each bone can rotate in a single iteration. Note: This limitation is applied during each iteration. For example, if IterateIK3D.MaxIterations is 4 and IterateIK3D.AngularDeltaLimit is 5 degrees, the maximum rotation possible in a single frame is 20 degrees.

DeterministicProperty
# Deterministic
C#
public bool Deterministic { get; set; }

If false, the result is calculated from the previous frame's IterateIK3D result as the initial state. If true, the previous frame's IterateIK3D result is discarded. At this point, the new result is calculated from the bone pose excluding the IterateIK3D as the initial state. This means the result will be always equal as long as the target position and the previous bone pose are the same. However, if IterateIK3D.AngularDeltaLimit and IterateIK3D.MaxIterations are set too small, the end bone of the chain will never reach the target.

MaxIterationsProperty
# MaxIterations
C#
public int MaxIterations { get; set; }

The number of iteration loops used by the IK solver to produce more accurate results.

MinDistanceProperty
# MinDistance
C#
public double MinDistance { get; set; }

The minimum distance between the end bone and the target. If the distance is below this value, the IK solver stops any further iterations.

SettingCountProperty
# SettingCount
C#
public int SettingCount { get; set; }

The number of settings.

Methods24

GetAngularDeltaLimitdouble
# GetAngularDeltaLimit
C#
public double GetAngularDeltaLimit();
Returns double
GetJointLimitationJointLimitation3D
# GetJointLimitation
C#
public JointLimitation3D GetJointLimitation(int index, int joint);

Returns the joint limitation at joint in the bone chain's joint list.

Parameters
NameTypeDefault
indexint—
jointint—
Returns JointLimitation3D
GetJointLimitationRightAxisSkeletonModifier3D.SecondaryDirection
# GetJointLimitationRightAxis
C#
public SkeletonModifier3D.SecondaryDirection GetJointLimitationRightAxis(int index, int joint);

Returns the joint limitation right axis at joint in the bone chain's joint list.

Parameters
NameTypeDefault
indexint—
jointint—
Returns SkeletonModifier3D.SecondaryDirection
GetJointLimitationRightAxisVectorVector3
# GetJointLimitationRightAxisVector
C#
public Vector3 GetJointLimitationRightAxisVector(int index, int joint);

Returns the joint limitation right axis vector at joint in the bone chain's joint list. If IterateIK3D.GetJointLimitationRightAxis is SkeletonModifier3D.SecondaryDirection.None, this method returns Vector3(0, 0, 0).

Parameters
NameTypeDefault
indexint—
jointint—
Returns Vector3
GetJointLimitationRotationOffsetQuaternion
# GetJointLimitationRotationOffset
C#
public Quaternion GetJointLimitationRotationOffset(int index, int joint);

Returns the joint limitation rotation offset at joint in the bone chain's joint list. Rotation is done in the local space which is constructed by the bone direction (in general parent to child) as the +Y axis and IterateIK3D.GetJointLimitationRightAxisVector as the +X axis. If the +X and +Y axes are not orthogonal, the +X axis is implicitly modified to make it orthogonal. Also, if the length of IterateIK3D.GetJointLimitationRightAxisVector is zero, the space is created by rotating the reference pose using the shortest arc that rotates the +Y axis of the reference pose to match the bone direction. In here, the reference pose is the bone rest or bone pose immediately before processing IK depending on the IterateIK3D.IsJointUsingRestForLimitation.

Parameters
NameTypeDefault
indexint—
jointint—
Returns Quaternion
GetJointRotationAxisSkeletonModifier3D.RotationAxis
# GetJointRotationAxis
C#
public SkeletonModifier3D.RotationAxis GetJointRotationAxis(int index, int joint);

Returns the rotation axis at joint in the bone chain's joint list.

Parameters
NameTypeDefault
indexint—
jointint—
Returns SkeletonModifier3D.RotationAxis
GetJointRotationAxisVectorVector3
# GetJointRotationAxisVector
C#
public Vector3 GetJointRotationAxisVector(int index, int joint);

Returns the rotation axis vector for the specified joint in the bone chain. This vector represents the axis around which the joint can rotate. It is determined based on the rotation axis set for the joint. If IterateIK3D.GetJointRotationAxis is SkeletonModifier3D.RotationAxis.All, this method returns Vector3(0, 0, 0).

Parameters
NameTypeDefault
indexint—
jointint—
Returns Vector3
GetMaxIterationsint
# GetMaxIterations
C#
public int GetMaxIterations();
Returns int
GetMinDistancedouble
# GetMinDistance
C#
public double GetMinDistance();
Returns double
GetTargetEntityEntityPath
# GetTargetEntity
C#
public EntityPath GetTargetEntity(int index);

Returns the target node that the end bone is trying to reach.

Parameters
NameTypeDefault
indexint—
Returns EntityPath
IsDeterministicbool
# IsDeterministic
C#
public bool IsDeterministic();
Returns bool
IsJointUsingRestForLimitationbool
# IsJointUsingRestForLimitation
C#
public bool IsJointUsingRestForLimitation(int index, int joint);

Returns whether the limitation at joint in the bone chain's joint list is applied based on the Skeleton3D.GetBoneRest.

Parameters
NameTypeDefault
indexint—
jointint—
Returns bool
SetAngularDeltaLimitvoid
# SetAngularDeltaLimit
C#
public void SetAngularDeltaLimit(double angularDeltaLimit);
Parameters
NameTypeDefault
angularDeltaLimitdouble—
SetDeterministicvoid
# SetDeterministic
C#
public void SetDeterministic(bool deterministic);
Parameters
NameTypeDefault
deterministicbool—
SetJointLimitationvoid
# SetJointLimitation
C#
public void SetJointLimitation(int index, int joint, JointLimitation3D limitation);

Sets the joint limitation at joint in the bone chain's joint list.

Parameters
NameTypeDefault
indexint—
jointint—
limitationJointLimitation3D—
SetJointLimitationRightAxisvoid
# SetJointLimitationRightAxis
C#
public void SetJointLimitationRightAxis(int index, int joint, SkeletonModifier3D.SecondaryDirection direction);

Sets the joint limitation right axis at joint in the bone chain's joint list.

Parameters
NameTypeDefault
indexint—
jointint—
directionSkeletonModifier3D.SecondaryDirection—
SetJointLimitationRightAxisVectorvoid
# SetJointLimitationRightAxisVector
C#
public void SetJointLimitationRightAxisVector(int index, int joint, Vector3 vector);

Sets the optional joint limitation right axis vector at joint in the bone chain's joint list.

Parameters
NameTypeDefault
indexint—
jointint—
vectorVector3—
SetJointLimitationRotationOffsetvoid
# SetJointLimitationRotationOffset
C#
public void SetJointLimitationRotationOffset(int index, int joint, Quaternion offset);

Sets the joint limitation rotation offset at joint in the bone chain's joint list. Rotation is done in the local space which is constructed by the bone direction (in general parent to child) as the +Y axis and IterateIK3D.GetJointLimitationRightAxisVector as the +X axis. If the +X and +Y axes are not orthogonal, the +X axis is implicitly modified to make it orthogonal. Also, if the length of IterateIK3D.GetJointLimitationRightAxisVector is zero, the space is created by rotating the reference pose using the shortest arc that rotates the +Y axis of the reference pose to match the bone direction. In here, the reference pose is the bone pose immediately before processing IK.

Parameters
NameTypeDefault
indexint—
jointint—
offsetQuaternion—
SetJointRotationAxisvoid
# SetJointRotationAxis
C#
public void SetJointRotationAxis(int index, int joint, SkeletonModifier3D.RotationAxis axis);

Sets the rotation axis at joint in the bone chain's joint list. The axes are based on the reference pose's space, if axis is SkeletonModifier3D.RotationAxis.Custom, you can specify any axis. In here, the reference pose is the bone pose immediately before processing IK. Note: The rotation axis and the forward vector shouldn't be colinear to avoid unintended rotation since ChainIK3D does not factor in twisting forces. Note: Since IterateIK3D never modifies the twist, the twist is not fixed by IterateIK3D.SetJointRotationAxis even if IterateIK3D.IsJointUsingRestForLimitation is true.

Parameters
NameTypeDefault
indexint—
jointint—
axisSkeletonModifier3D.RotationAxis—
SetJointRotationAxisVectorvoid
# SetJointRotationAxisVector
C#
public void SetJointRotationAxisVector(int index, int joint, Vector3 axisVector);

Sets the rotation axis vector for the specified joint in the bone chain. This vector is normalized by an internal process and represents the axis around which the bone chain can rotate. If the vector length is 0, it is considered synonymous with SkeletonModifier3D.RotationAxis.All.

Parameters
NameTypeDefault
indexint—
jointint—
axisVectorVector3—
SetJointUseRestForLimitationvoid
# SetJointUseRestForLimitation
C#
public void SetJointUseRestForLimitation(int index, int joint, bool enabled);

Sets whether the limitation and the rotation axis at joint in the bone chain's joint list are applied based on the Skeleton3D.GetBoneRest. See also IterateIK3D.SetJointRotationAxis. Note: The limitation is applied to the rotation computed by this modifier. If the reference pose is rotated around the same axis, the limitation behaves as if it also limits the rotation of the reference pose. A rotation that this modifier does not change, such as the twist, is not limited. Note: The rendered gizmo's limitation shape will only respect the reference pose when this option is false and the modifier is active.

Parameters
NameTypeDefault
indexint—
jointint—
enabledbool—
SetMaxIterationsvoid
# SetMaxIterations
C#
public void SetMaxIterations(int maxIterations);
Parameters
NameTypeDefault
maxIterationsint—
SetMinDistancevoid
# SetMinDistance
C#
public void SetMinDistance(double minDistance);
Parameters
NameTypeDefault
minDistancedouble—
SetTargetEntityvoid
# SetTargetEntity
C#
public void SetTargetEntity(int index, EntityPath targetEntity);

Sets the target node that the end bone is trying to reach.

Parameters
NameTypeDefault
indexint—
targetEntityEntityPath—
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.