Skip to main content

Person

sealed class runtime wrapper
public sealed class Person

Namespace: AR51.Unity.SDK

A plain runtime wrapper (not a MonoBehaviour) representing one tracked skeleton and its instantiated character model. Each Person is created and owned by SkeletonConsumer — you obtain instances from its Persons collection or TryGetPerson / GetPerson, never by constructing one yourself. The Person holds the solved and raw joint positions, per-joint confidence, the character Model, and bone/transform caches; its scaling and IK are driven each frame.

How-to

This page is reference (facts only). For the step-by-step connect → skeleton → character walkthrough, see the How-to guide.

Units

All positions and lengths are Unity world-space meters (Vector3); rotations are Quaternion. Timestamps are seconds since the Unix epoch (UTC); durations are seconds.

Properties

PropertyTypeDescription
Identity & state
Idstringthe person's id — matches Skeleton.Id (the per-track / "PersonId")
IsActivePersonbooltrue when this is the local/active person (nearest to the camera/headset)
LastUpdateDateTimelocal time of the last skeleton update
IsAPosebooltrue while the person is currently in an A-pose
IsAutoScaledbooltrue once auto-scaling has been applied to the model
Character & model
CharacterAR51Characterthe live character component driven by this person
ModelGameObjectthe instantiated character GameObject
CharacterPrefabAR51Characterthe prefab Model was instantiated from
AnimatorAnimatorthe model's Animator
TintColorColortint applied to the model
JointColorColorcolor used when drawing this person's joints/gizmo
Visibility
IsModelVisibleboolwhether the character mesh is shown (see SetModelVisiblity)
IsModelGameObjectActiveboolwhether Model is active in the hierarchy
IsSkeletonVisibleboolwhether the skeleton gizmo is shown (see SetSkeletonVisible)
Joint data
PositionsVector3[]solved joint positions (meters, world) — indexed by Joints
RawPositionsVector3[]raw incoming joint positions (meters, world) before solve
Confidencefloat[]per-joint confidence, parallel to Positions
HeadPositionVector3midpoint of the eyes (meters)
LastSkeletonSkeletonthe most recent skeleton payload (get/set)
Timing
CreationTimedoublecapture time when first seen (Unix seconds)
TimeSinceCreationdoubleseconds since first seen
Bones & rig caches
RootBoneDFSTransform[]bones in depth-first order from the root
BonesTransform[]mapped rig bones
AnimatedBonesTransform[]bones driven by the animator
HeadJoint / NeckJointTransformhead / neck bone transforms
HeadInitRotationQuaternionhead bone rotation at bind time
NeckInitLocalRotationQuaternionneck bone local rotation at bind time
LeftWristJoint / RightWristJointTransformwrist bone transforms
LeftWristJointDFS / RightWristJointDFSTransform[]wrist sub-trees in depth-first order
Visualization & physics
JointGizmosJointGizmo[]per-joint gizmo components
C3DPointsC3DPoint[]C3D marker points
ParentConstraintsParentConstraint[]parent constraints on the rig
CollidersCollider[]the model's colliders
IdLabelGameObjectoptional world-space id label (get/set)
AutoScaleModeOverrideAutoScaleModeper-person auto-scale override

Method summary

MethodReturns
GetPositionVector3instance
GetRawPositionVector3instance
GetAverageConfidencefloatinstance
SetModelVisiblityvoidinstance
SetSkeletonVisiblevoidinstance
SetActivevoidinstance
GetHeadRotation / SetHeadRotationQuaternion / voidinstance
ApplyAutoScale / ResetScalevoidinstance · overloads
Updatevoidconsumer-driven
SolveIKvoidconsumer-driven
DrawGizmovoidinstance
DestroyModelsvoidinstance

→ Full descriptions in Method details below.

Driven by SkeletonConsumer

Update and SolveIK are public for advanced/manual driving, but in normal use you do not call them — SkeletonConsumer feeds new positions and runs the solve for every person each LateUpdate. Read Positions / Confidence / Model and toggle visibility instead.

Method details

GetPosition

methodinstance
public Vector3 GetPosition(int jointIndex);

The solved world position (meters) of a single joint — equivalent to Positions[jointIndex] with bounds safety.

Parameters
jointIndexinta joint index from Joints (e.g. Joints.RWrist)
ReturnsVector3the joint's solved position in Unity world space, meters
Exampleinferred
var person = SkeletonConsumer.Instance.ActivePerson;
Vector3 rightWrist = person.GetPosition(Joints.RWrist); // meters, world

GetRawPosition

methodinstance
public Vector3 GetRawPosition(int jointIndex);

The raw incoming world position (meters) of a joint, before scaling/IK — equivalent to RawPositions[jointIndex].

Parameters
jointIndexinta joint index from Joints
ReturnsVector3the joint's raw position in Unity world space, meters

GetAverageConfidence

methodinstance
public float GetAverageConfidence();

The mean confidence across the joints that have a confident reading — a quick overall tracking-quality signal.

Returnsfloataverage confidence over confident joints, or -1 when none are confident
Exampleinferred
foreach (var person in SkeletonConsumer.Instance.Persons)
{
float quality = person.GetAverageConfidence();
if (quality >= 0f && quality < 0.3f)
Debug.Log($"Low tracking quality for {person.Id}: {quality:F2}");
}

SetModelVisiblity

methodinstance
public void SetModelVisiblity(bool visible);

Show or hide the character mesh. Reflected by IsModelVisible. (Note the method's Visiblity spelling.)

Parameters
visiblebooltrue to render the model, false to hide it

SetSkeletonVisible

methodinstance
public void SetSkeletonVisible(bool visible);

Show or hide the skeleton gizmo for this person. Reflected by IsSkeletonVisible.

Parameters
visiblebooltrue to draw the skeleton gizmo, false to hide it

SetActive

methodinstance
public void SetActive(bool isActive);

Activate or deactivate the person's Model GameObject as a whole.

Parameters
isActivebooltrue to activate the model, false to deactivate it

Head rotation

methodinstance
public Quaternion GetHeadRotation();
public void SetHeadRotation(Quaternion rotation);

Read or override the head bone rotation — set it to fuse a headset's orientation onto the tracked person.

ReturnsQuaternionthe current head rotation

ApplyAutoScale

methodinstanceoverloads
public void ApplyAutoScale();
public void ApplyAutoScale(AutoScaleMode mode);
public void ApplyAutoNonUniformScale(Func<int, int, float> getLengthFunc);
public void ResetScale();

Rescale the character's bone lengths to match the tracked person. ApplyAutoScale() uses the configured mode; pass an AutoScaleMode to override it. ApplyAutoNonUniformScale scales per bone pair using the supplied length function. ResetScale() restores the unscaled rig. Sets IsAutoScaled.

Parameters
modeAutoScaleModescaling mode to apply (overload)
getLengthFuncFunc<int,int,float>returns target length for a (fromJoint, toJoint) pair (meters)

Update

methodconsumer-driven
public void Update(Vector3[] positions);

Feed a new set of joint positions (meters, world) into the person, refreshing RawPositions and LastUpdate. Called by SkeletonConsumer each frame — public only for advanced manual driving.

Parameters
positionsVector3[]joint positions indexed by Joints, in meters

SolveIK

methodconsumer-driven
public void SolveIK();

Run the IK / character solve for this person, driving Character toward the current positions and producing Positions. Driven by SkeletonConsumer in LateUpdate; do not call it yourself in normal use.

DrawGizmo

methodinstance
public void DrawGizmo(Color color);

Draw this person's skeleton gizmo in the given color (debug visualization).

Parameters
colorColorgizmo color

DestroyModels

methodinstance
public void DestroyModels();

Destroy the instantiated character model and associated GameObjects for this person. Normally invoked by the consumer when the person is removed.

PersonEventArgs

class
public class PersonEventArgs

Namespace: AR51.Unity.SDK

The payload for the person-lifecycle events raised by SkeletonConsumerOnPersonCreated, OnPersonDeleting, and OnPersonDeleted. It carries the affected Person.

MemberTypeDescription
PersonPersonthe person this event concerns
public PersonEventArgs(Person person);
Exampleinferred
SkeletonConsumer.Instance.OnPersonCreated += (sender, e) =>
{
Person p = e.Person;
Debug.Log($"Character spawned for {p.Id}; head at {p.HeadPosition} (meters)");
};

See also

  • SkeletonConsumer — owns and drives every Person; source of PersonEventArgs
  • Skeleton — the per-frame payload behind LastSkeleton; shares the Id
  • Joints — joint-index map for Positions / Confidence / GetPosition
  • AR51Character — the mocap-driven character this person owns
  • Class index — all Unity SDK types
Was this page helpful?