Skip to main content

Joints

static class
public static class Joints

Namespace: AR51.Unity.SDK

The canonical joint-index map for the position arrays returned by Skeleton.GetPositions<Vector3>() and Person.Positions. Every joint is a public const int index into those arrays; the class also exposes name↔index lookup tables and the line/connection data used to draw skeleton gizmos. The body layout is OpenPose-25 (indices 0–24); the hand joints follow, starting at RightWrist = 25.

Units

Joints itself holds only integer indices — no spatial data. The arrays it indexes (Person.Positions, Skeleton.GetPositions<Vector3>()) are Unity world-space Vector3 in meters.

Body joint indices (OpenPose-25)

The first 25 indices are the body, in OpenPose-25 order. CountWithoutHands is 25; CountWithHands is the full body + both hands (= LeftPinkyTip + 1).

public const int CountWithoutHands = 25;
public const int CountWithHands; // = LeftPinkyTip + 1 (full body + both hands)

// Body (OpenPose-25 layout)
public const int Nose = 0;
public const int Neck = 1;
public const int RShoulder = 2;
public const int RElbow = 3;
public const int RWrist = 4;
public const int LShoulder = 5;
public const int LElbow = 6;
public const int LWrist = 7;
public const int MidHip = 8;
public const int RHip = 9;
public const int RKnee = 10;
public const int RAnkle = 11;
public const int LHip = 12;
public const int LKnee = 13;
public const int LAnkle = 14;
public const int REye = 15;
public const int LEye = 16;
public const int REar = 17;
public const int LEar = 18;
public const int LBigToe = 19;
public const int LSmallToe = 20;
public const int LHeel = 21;
public const int RBigToe = 22;
public const int RSmallToe = 23;
public const int RHeel = 24;

// Hip aliases (both resolve to MidHip = 8)
public const int Hip = MidHip;
public const int Hips = MidHip;

Hand joint indices

The hand joints begin immediately after the body at RightWrist = 25, then run per finger in Proximal → Middle → Distal → Tip order; the left hand follows the right. Each finger group is exposed twice — once with descriptive names and once with anatomical aliases:

DescriptiveAnatomical alias
RightIndexProximalRIndex1Knuckles
RightIndexMiddleRIndex2PIP
RightIndexDistalRIndex3DIP
RightIndexTipRIndex4FingerTip
… (same pattern for thumb / middle / ring / pinky, both hands)

Per-finger offset constants (added to a hand's wrist index to reach that finger's first joint):

public const int ThumbOffset = 1;
public const int IndexOffset = 5;
public const int MiddleOffset = 9;
public const int RingOffset = 13;
public const int PinkyOffset = 17;

Spine / clavicle indices are also defined: LClavicle, RClavicle, and Spine0Spine6.

⚠️ Two distinct hand-joint schemes

These body-array hand indices (Joints, starting RightWrist = 25) are not the same enumeration as the device hand-tracking HandJointType, which indexes HandJointInfo[] from Wrist = 0. Use Joints for the full-body skeleton arrays; use HandJointType for the hands-adapter arrays.

Helper data

Static tables used for drawing and grouping joints.

MemberTypeDescription
Drawing
JointLinesJointLine[]colored from→to pairs for drawing the skeleton
GizmoLineConnectionsint[][]bone connections used to draw the skeleton gizmo
Grouped indices
FootJointIndicesint[]{ LHeel, LBigToe, LSmallToe, RHeel, RBigToe, RSmallToe }
HeadJointsList<int>{ Nose, REye, LEye, REar, LEar }
HandWristPairsint[]wrist-pair indices for the hands
HandStripsint[]per-finger strip indices for the hands
RightLeftOffsetint[]{ RightWrist, LeftWrist } — base index of each hand
Lookup
JointByStringDictionary<string,int>name → index
NameByJointIndexDictionary<int,string>index → name

Method summary

MethodReturns
GetJointNamestringstatic
Parseintstatic

→ Full descriptions in Method details below.

Method details

GetJointName

methodstatic
public static string GetJointName(int jointIndex);

The display name for a joint index (the reverse of Parse). Backed by NameByJointIndex.

Parameters
jointIndexinta joint index (a Joints constant, e.g. Joints.RWrist)
Returnsstringthe joint's name (e.g. "RWrist")
Exampleinferred
foreach (var person in SkeletonConsumer.Instance.Persons)
{
Vector3 head = person.GetPosition(Joints.Nose); // meters
Debug.Log($"{Joints.GetJointName(Joints.Nose)} at {head}");
}

Parse

methodstatic
public static int Parse(string s);

Resolve a joint name to its index (the reverse of GetJointName). Backed by JointByString.

Parameters
sstringa joint name (e.g. "RWrist")
Returnsintthe matching joint index, or -1 if the name is unknown

Nested types

JointLine

property
public struct JointLine
{
public int From;
public int To;
public Color Color;
public JointLine(int from, int to, Color color);
}

A single colored bone segment: two joint indices and the Color to draw it in. The JointLines table is an array of these, consumed by the skeleton-drawing helpers.

HandJoints

sealed class Unity component
public sealed class HandJoints : MonoBehaviour

Namespace: AR51.Unity.SDK

A MonoBehaviour marker component placed on a hand-joint hierarchy. It is a separate type from the static Joints index map above.

⚠️ needs confirmation

HandJoints has an empty body — no public members in this version; it appears to exist only as a tag/marker on a hand-joint hierarchy. Confirm its intended role before relying on it.

See also

  • Skeleton — the per-frame payload whose GetPositions<Vector3>() buffer these indices address
  • Person — exposes Positions / GetPosition(int) indexed by these constants
  • HandJointType — the separate device hand-tracking joint enumeration (Wrist = 0)
  • Skeletons & characters — area overview
  • Class index — all Unity SDK types
Was this page helpful?