Class ARHumanBodyManager
The manager for the human body subsystem.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Syntax
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 human pose estimation is enabled.
Declaration
public bool humanBodyPose2DEstimationEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
|
humanBodyPose3DEstimationEnabled
Whether 3D human pose estimation is enabled.
Declaration
public bool humanBodyPose3DEstimationEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
|
humanBodyPose3DScaleEstimationEnabled
Whether 3D human body scale estimation is enabled.
Declaration
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. |
humanDepthTexture
The human segmentation depth texture.
Declaration
public Texture2D humanDepthTexture { get; }
Property Value
| Type | Description |
|---|---|
| Texture2D | The human segmentation depth texture, if any. Otherwise, |
humanSegmentationDepthMode
The mode for generating the human segmentation depth texture.
Declaration
public HumanSegmentationMode humanSegmentationDepthMode { get; set; }
Property Value
| Type | Description |
|---|---|
| HumanSegmentationMode | The mode for generating the human segmentation depth texture. |
Remarks
Setting the value for the depth mode to HumanSegmentationMode.HalfScreenResolution or
HumanSegmentationMode.FullScreenResolution do improve the quality of the depth texture content by
executing an image filter over the texture, but neither setting increases the resolution of the texture
currently. HumanSegmentationMode.HalfScreenResolution and
HumanSegmentationMode.FullScreenResolution result in the equivalent depth texture quality in the
current implementation.
humanSegmentationStencilMode
The mode for generating the human segmentation stencil texture.
Declaration
public HumanSegmentationMode humanSegmentationStencilMode { get; set; }
Property Value
| Type | Description |
|---|---|
| HumanSegmentationMode | The mode for generating the human segmentation stencil texture. |
humanStencilTexture
The human segmentation stencil texture.
Declaration
public Texture2D humanStencilTexture { get; }
Property Value
| Type | Description |
|---|---|
| Texture2D | The human segmentation stencil texture, if any. Otherwise, |
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
Update()
Callback as the manager is being updated.
Declaration
protected override void Update()
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> |