TwoBoneIK3D
Rotation based intersection of two circles inverse kinematics solver.
Rotation based intersection of two circles inverse kinematics solver.
This IKModifier3D requires a pole target. It provides deterministic results by constructing a plane from each joint and pole target and finding the intersection of two circles (disks in 3D).
This IK can handle twist by setting the pole direction. If there are more than one bone between each set bone, their rotations are ignored, and the straight line connecting the root-middle and middle-end joints are treated as virtual bones.
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>/root_bone_name).
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
TwoBoneIK3DConstructor
public TwoBoneIK3D();Properties1
SettingCountProperty
public int SettingCount { get; set; }The number of settings.
Methods28
GetEndBoneint
public int GetEndBone(int index);Returns the end bone index.
| Name | Type | Default |
|---|---|---|
index | int | — |
intGetEndBoneDirectionSkeletonModifier3D.BoneDirection
public SkeletonModifier3D.BoneDirection GetEndBoneDirection(int index);Returns the end bone's tail direction when TwoBoneIK3D.IsEndBoneExtended is true.
| Name | Type | Default |
|---|---|---|
index | int | — |
SkeletonModifier3D.BoneDirectionGetEndBoneLengthfloat
public float GetEndBoneLength(int index);Returns the end bone tail length of the bone chain when TwoBoneIK3D.IsEndBoneExtended is true.
| Name | Type | Default |
|---|---|---|
index | int | — |
floatGetEndBoneNamestring
public string GetEndBoneName(int index);Returns the end bone name.
| Name | Type | Default |
|---|---|---|
index | int | — |
stringGetMiddleBoneint
public int GetMiddleBone(int index);Returns the middle bone index.
| Name | Type | Default |
|---|---|---|
index | int | — |
intGetMiddleBoneNamestring
public string GetMiddleBoneName(int index);Returns the middle bone name.
| Name | Type | Default |
|---|---|---|
index | int | — |
stringGetPoleDirectionSkeletonModifier3D.SecondaryDirection
public SkeletonModifier3D.SecondaryDirection GetPoleDirection(int index);Returns the pole direction.
| Name | Type | Default |
|---|---|---|
index | int | — |
SkeletonModifier3D.SecondaryDirectionGetPoleDirectionVectorVector3
public Vector3 GetPoleDirectionVector(int index);Returns the pole direction vector.
If TwoBoneIK3D.GetPoleDirection is SkeletonModifier3D.SecondaryDirection.None, this method returns Vector3(0, 0, 0).
| Name | Type | Default |
|---|---|---|
index | int | — |
Vector3GetPoleEntityEntityPath
public EntityPath GetPoleEntity(int index);Returns the pole target node that constructs a plane which the joints are all on and the pole is trying to direct.
| Name | Type | Default |
|---|---|---|
index | int | — |
EntityPathGetRootBoneint
public int GetRootBone(int index);Returns the root bone index.
| Name | Type | Default |
|---|---|---|
index | int | — |
intGetRootBoneNamestring
public string GetRootBoneName(int index);Returns the root bone name.
| Name | Type | Default |
|---|---|---|
index | int | — |
stringGetTargetEntityEntityPath
public EntityPath GetTargetEntity(int index);Returns the target node that the end bone is trying to reach.
| Name | Type | Default |
|---|---|---|
index | int | — |
EntityPathIsEndBoneExtendedbool
public bool IsEndBoneExtended(int index);Returns true if the end bone is extended to have a tail.
| Name | Type | Default |
|---|---|---|
index | int | — |
boolIsUsingVirtualEndbool
public bool IsUsingVirtualEnd(int index);Returns true if the end bone is extended from the middle bone as a virtual bone.
| Name | Type | Default |
|---|---|---|
index | int | — |
boolSetEndBonevoid
public void SetEndBone(int index, int bone);Sets the end bone index.
| Name | Type | Default |
|---|---|---|
index | int | — |
bone | int | — |
SetEndBoneDirectionvoid
public void SetEndBoneDirection(int index, SkeletonModifier3D.BoneDirection boneDirection);Sets the end bone tail direction when TwoBoneIK3D.IsEndBoneExtended is true.
| Name | Type | Default |
|---|---|---|
index | int | — |
boneDirection | SkeletonModifier3D.BoneDirection | — |
SetEndBoneLengthvoid
public void SetEndBoneLength(int index, float length);Sets the end bone tail length when TwoBoneIK3D.IsEndBoneExtended is true.
| Name | Type | Default |
|---|---|---|
index | int | — |
length | float | — |
SetEndBoneNamevoid
public void SetEndBoneName(int index, string boneName);Sets the end bone name. Note: The end bone must be a child of the middle bone.
| Name | Type | Default |
|---|---|---|
index | int | — |
boneName | string | — |
SetExtendEndBonevoid
public void SetExtendEndBone(int index, bool enabled);If enabled is true, the end bone is extended to have a tail.
| Name | Type | Default |
|---|---|---|
index | int | — |
enabled | bool | — |
SetMiddleBonevoid
public void SetMiddleBone(int index, int bone);Sets the middle bone index.
| Name | Type | Default |
|---|---|---|
index | int | — |
bone | int | — |
SetMiddleBoneNamevoid
public void SetMiddleBoneName(int index, string boneName);Sets the middle bone name. Note: The middle bone must be a child of the root bone.
| Name | Type | Default |
|---|---|---|
index | int | — |
boneName | string | — |
SetPoleDirectionvoid
public void SetPoleDirection(int index, SkeletonModifier3D.SecondaryDirection direction);Sets the pole direction. The pole is on the middle bone and will direct to the pole target. The rotation axis is a vector that is orthogonal to this and the forward vector. Note: The pole direction and the forward vector shouldn't be colinear to avoid unintended rotation.
| Name | Type | Default |
|---|---|---|
index | int | — |
direction | SkeletonModifier3D.SecondaryDirection | — |
SetPoleDirectionVectorvoid
public void SetPoleDirectionVector(int index, Vector3 vector);Sets the pole direction vector.
This vector is normalized by an internal process.
If the vector length is 0, it is considered synonymous with SkeletonModifier3D.SecondaryDirection.None.
| Name | Type | Default |
|---|---|---|
index | int | — |
vector | Vector3 | — |
SetPoleEntityvoid
public void SetPoleEntity(int index, EntityPath poleNode);Sets the pole target node that constructs a plane which the joints are all on and the pole is trying to direct.
| Name | Type | Default |
|---|---|---|
index | int | — |
poleNode | EntityPath | — |
SetRootBonevoid
public void SetRootBone(int index, int bone);Sets the root bone index.
| Name | Type | Default |
|---|---|---|
index | int | — |
bone | int | — |
SetRootBoneNamevoid
public void SetRootBoneName(int index, string boneName);Sets the root bone name.
| Name | Type | Default |
|---|---|---|
index | int | — |
boneName | string | — |
SetTargetEntityvoid
public void SetTargetEntity(int index, EntityPath targetEntity);Sets the target node that the end bone is trying to reach.
| Name | Type | Default |
|---|---|---|
index | int | — |
targetEntity | EntityPath | — |
SetUseVirtualEndvoid
public void SetUseVirtualEnd(int index, bool enabled);If enabled is true, the end bone is extended from the middle bone as a virtual bone.
| Name | Type | Default |
|---|---|---|
index | int | — |
enabled | bool | — |