Class ARHumanBodyManager
The manager for the human body subsystem.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Syntax
[DisallowMultipleComponent]
[DefaultExecutionOrder(-2147483647)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.1/api/UnityEngine.XR.ARFoundation.ARHumanBodyManager.html")]
public sealed class ARHumanBodyManager : ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>
Properties
gameObjectName
The name for any generated game objects.
Declaration
protected override string gameObjectName { get; }
Property Value
Type | Description |
---|---|
String | The name for any generated game objects. |
Overrides
humanBodyPose2DEstimationEnabled
Whether 2D body pose tracking is enabled. This method is obsolete. Use pose2DRequested or pose2DEnabled instead.
Declaration
[Obsolete("Use pose2DEnabled or pose2DRequested instead. 2020-01-14")]
public bool humanBodyPose2DEstimationEnabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
humanBodyPose3DEstimationEnabled
Whether 3D body pose tracking is enabled. This method is obsolete. Use pose3DEnabled or pose3DRequested instead.
Declaration
[Obsolete("Use pose3DEnabled or pose3DRequested instead. 2020-01-14")]
public bool humanBodyPose3DEstimationEnabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
humanBodyPose3DScaleEstimationEnabled
Whether 3D body pose scale estimation is enabled. This method is obsolete. Use pose3DScaleEstimationEnabled or pose3DScaleEstimationRequested instead.
Declaration
[Obsolete("Use pose3DScaleEstimationRequested or pose3DScaleEstimationRequested instead. 2020-01-14")]
public bool humanBodyPose3DScaleEstimationEnabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
humanBodyPrefab
The prefab object to instantiate at the location of the human body origin.
Declaration
public GameObject humanBodyPrefab { get; set; }
Property Value
Type | Description |
---|---|
GameObject | The prefab object to instantiate at the location of the human body origin. |
pose2DEnabled
Whether 2D human pose estimation is enabled. While pose2DRequested tells you whether 2D pose estimation has been requested, this property tells you whether 2D pose estimation is currently active in the subsystem.
Declaration
public bool pose2DEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
pose2DRequested
Whether 2D human pose estimation is requested.
Declaration
public bool pose2DRequested { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
pose3DEnabled
Whether 3D human pose estimation is enabled.
Declaration
public bool pose3DEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
pose3DRequested
Whether 3D human pose estimation is requested.
Declaration
public bool pose3DRequested { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
pose3DScaleEstimationEnabled
Whether 3D human body scale estimation is enabled.
Declaration
public bool pose3DScaleEstimationEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
pose3DScaleEstimationRequested
Whether 3D human body scale estimation is requested.
Declaration
public bool pose3DScaleEstimationRequested { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
Methods
GetHumanBody(TrackableId)
Get the human body matching the trackable identifier.
Declaration
public ARHumanBody GetHumanBody(TrackableId trackableId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableId | The trackable identifier for querying a human body trackable. |
Returns
Type | Description |
---|---|
ARHumanBody | The human body trackable, if found. Otherwise, |
GetHumanBodyPose2DJoints(Allocator)
Gets the human body pose 2D joints for the current frame.
Declaration
public NativeArray<XRHumanBodyPose2DJoint> GetHumanBodyPose2DJoints(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | The allocator to use for the returned array memory. |
Returns
Type | Description |
---|---|
NativeArray<XRHumanBodyPose2DJoint> | The array of body pose 2D joints. |
Remarks
The returned array may be empty if the system is not enabled for human body pose 2D or if the system does not detect a human in the camera image.
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown if the implementation does not support human body pose 2D. |
GetPrefab()
Gets the prefab object to instantiate at the location of the trackable.
Declaration
protected override GameObject GetPrefab()
Returns
Type | Description |
---|---|
GameObject | A game object to instantiate at the location of the trackable, or |
Overrides
OnAfterSetSessionRelativeData(ARHumanBody, XRHumanBody)
Callback after the session relative data has been set to update the skeleton for the human body.
Declaration
protected override void OnAfterSetSessionRelativeData(ARHumanBody arBody, XRHumanBody xrBody)
Parameters
Type | Name | Description |
---|---|---|
ARHumanBody | arBody | The human body trackable being updated. |
XRHumanBody | xrBody | The raw human body data from the subsystem. |
Overrides
OnBeforeStart()
Callback before the subsystem is started (but after it is created).
Declaration
protected override void OnBeforeStart()
Overrides
OnDestroy()
Callback as the manager is being destroyed.
Declaration
protected override void OnDestroy()
Overrides
OnTrackablesChanged(List<ARHumanBody>, List<ARHumanBody>, List<ARHumanBody>)
Callback when the trackable deltas are being reported.
Declaration
protected override void OnTrackablesChanged(List<ARHumanBody> added, List<ARHumanBody> updated, List<ARHumanBody> removed)
Parameters
Type | Name | Description |
---|---|---|
List<ARHumanBody> | added | The list of human bodies added to the set of trackables. |
List<ARHumanBody> | updated | The list of human bodies updated in the set of trackables. |
List<ARHumanBody> | removed | The list of human bodies removed to the set of trackables. |
Overrides
Events
humanBodiesChanged
The event that is fired when a change to the detected human bodies is reported.
Declaration
public event Action<ARHumanBodiesChangedEventArgs> humanBodiesChanged
Event Type
Type | Description |
---|---|
Action<ARHumanBodiesChangedEventArgs> |