Skeleton
namespace AR51.Net;
public sealed class Skeleton
One tracked person at one moment: the 3D position and confidence of each body joint, the hands when a hand-tracking headset reports them, plus identity and timing.
Positions are in meters, in the AR 51 world: left-handed, X right, Y up, Z forward (the same axes as Unity). A joint the cameras could not see is reported at (0, 0, 0) with confidence 0; use TryGetPosition to tell it apart. Instances are immutable and safe to share across threads.
Positions are in meters, in the AR 51 world: left-handed, X right, Y up, Z forward (the same axes as Unity). See Data conventions.
This page is reference (facts only). For a walkthrough with a complete sample, see the Skeletons guide.
// Hands are present only when the person wears a hand-tracking headset.
if (skeleton.LeftHand is { } hand)
Console.WriteLine($"left index fingertip at {hand.GetPosition(HandJoint.IndexTip)} m");
Properties
| Property | Type | Access | Description |
|---|---|---|---|
Id | string | get | Tracking id of this person, stable while the person stays tracked. |
EntityId | string | get | Identity assigned to this person at registration, stable across sessions. Empty when the person is not registered. |
EntityDisplayName | string | get | Name of the registered person, for display. Empty when the person is not registered. |
DeviceId | string | get | Id of the headset worn by this person, the same as DeviceInfo.Id. Empty when no headset is associated with this person. |
Positions | IReadOnlyList<Vector3> | get | Joint positions in meters (left-handed: X right, Y up, Z forward), indexed by Joint. |
Confidences | IReadOnlyList<float> | get | How sure the cameras are of each joint, from 0 (not seen) to 1, indexed by Joint. Empty when the server does not report confidence. |
LeftHand | HandPose? | get | The left hand's joints, or null unless this person wears a headset with hand tracking. Hands come from the headset, not from the cameras. |
RightHand | HandPose? | get | The right hand's joints, or null unless this person wears a headset with hand tracking. Hands come from the headset, not from the cameras. |
CaptureTime | DateTimeOffset | get | When the cameras captured this skeleton (server clock, UTC). The Unix epoch (1970-01-01) when the server did not send a valid time. |
ReceivedTime | DateTimeOffset | get | When this client received it (local clock). CaptureTime uses the server's clock and this uses yours, so their difference is the true delay only when both clocks are synchronized (for example with NTP). |
Method summary
| Method | Returns | |
|---|---|---|
GetPosition | Vector3 | |
GetConfidence | float | |
TryGetPosition | bool |
→ Full descriptions in Method details below.
Method details
GetPosition
GetConfidence
public float GetConfidence(Joint joint);
Gets how sure the cameras are of a joint.
TryGetPosition
public bool TryGetPosition(Joint joint, out Vector3 position);
Gets the position of a joint if it was detected.
true when the joint was detected: its confidence is above 0 (or, when the server does not report confidence, its position is not (0, 0, 0)).if (skeleton.TryGetPosition(Joint.RightWrist, out Vector3 wrist))
Console.WriteLine($"right wrist at {wrist} m (confidence {skeleton.GetConfidence(Joint.RightWrist):F2})");
else
Console.WriteLine("right wrist not seen");
Related types
Small types used by this class, documented here.
Joint
enumpublic enum Joint
Body joints reported in a Skeleton. The value is the index into Skeleton.Positions.
Left and right are the person's own left and right.
| Value | Meaning |
|---|---|
Nose = 0 | Tip of the nose. |
Neck = 1 | Base of the neck, between the shoulders. |
RightShoulder = 2 | Right shoulder. |
RightElbow = 3 | Right elbow. |
RightWrist = 4 | Right wrist. |
LeftShoulder = 5 | Left shoulder. |
LeftElbow = 6 | Left elbow. |
LeftWrist = 7 | Left wrist. |
MidHip = 8 | Center of the pelvis, between the hips. |
RightHip = 9 | Right hip. |
RightKnee = 10 | Right knee. |
RightAnkle = 11 | Right ankle. |
LeftHip = 12 | Left hip. |
LeftKnee = 13 | Left knee. |
LeftAnkle = 14 | Left ankle. |
RightEye = 15 | Right eye. |
LeftEye = 16 | Left eye. |
RightEar = 17 | Right ear. |
LeftEar = 18 | Left ear. |
LeftBigToe = 19 | Left big toe. |
LeftSmallToe = 20 | Left small toe. |
LeftHeel = 21 | Left heel. |
RightBigToe = 22 | Right big toe. |
RightSmallToe = 23 | Right small toe. |
RightHeel = 24 | Right heel. |
See also
- Skeletons guide — walkthrough with a complete, compiled sample
- Class index — every AR51.Net type
- Data conventions, threading and errors