Class ARHumanBodyManager | AR Foundation | 2.2.0-preview.6
docs.unity3d.com
    Show / Hide Table of Contents

    Class ARHumanBodyManager

    The manager for the human body subsystem.

    Inheritance
    Object
    SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>
    ARHumanBodyManager
    Inherited Members
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.trackables
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.SetTrackablesActive(Boolean)
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.sessionOrigin
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.gameObjectName
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.GetPrefab()
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.m_Trackables
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.m_PendingAdds
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.Awake()
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.Update()
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.OnTrackablesChanged(List<ARHumanBody>, List<ARHumanBody>, List<ARHumanBody>)
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.OnCreateTrackable(ARHumanBody)
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.OnAfterSetSessionRelativeData(ARHumanBody, XRHumanBody)
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.CreateTrackableImmediate(XRHumanBody)
    ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, ARHumanBody>.DestroyPendingTrackable(TrackableId)
    SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.subsystem
    SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.descriptor
    SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.CreateSubsystem()
    SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.CreateSubsystemIfNecessary()
    SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.GetActiveSubsystemInstance()
    SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.OnEnable()
    SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.OnDisable()
    SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.OnDestroy()
    SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.OnBeforeStart()
    SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.OnAfterStart()
    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
    UnityEngine.XR.ARFoundation.ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, UnityEngine.XR.ARFoundation.ARHumanBody>.gameObjectName

    humanBodyPose2DEstimationEnabled

    Whether 2D human pose estimation is enabled.

    Declaration
    public bool humanBodyPose2DEstimationEnabled { get; set; }
    Property Value
    Type Description
    Boolean

    true if 2D human pose estimation is enabled. Otherwise, false.

    humanBodyPose3DEstimationEnabled

    Whether 3D human pose estimation is enabled.

    Declaration
    public bool humanBodyPose3DEstimationEnabled { get; set; }
    Property Value
    Type Description
    Boolean

    true if 3D human pose estimation is enabled. Otherwise, false.

    humanBodyPose3DScaleEstimationEnabled

    Whether 3D human body scale estimation is enabled.

    Declaration
    public bool humanBodyPose3DScaleEstimationEnabled { get; set; }
    Property Value
    Type Description
    Boolean

    true if 3D human body scale estimation is enabled. Otherwise, false.

    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, null.

    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, null.

    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, null.

    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 null.

    Overrides
    UnityEngine.XR.ARFoundation.ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, UnityEngine.XR.ARFoundation.ARHumanBody>.GetPrefab()

    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
    UnityEngine.XR.ARFoundation.ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, UnityEngine.XR.ARFoundation.ARHumanBody>.OnAfterSetSessionRelativeData(UnityEngine.XR.ARFoundation.ARHumanBody, XRHumanBody)

    OnBeforeStart()

    Callback before the subsystem is started (but after it is created).

    Declaration
    protected override void OnBeforeStart()
    Overrides
    UnityEngine.XR.ARFoundation.SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.OnBeforeStart()

    OnDestroy()

    Callback as the manager is being destroyed.

    Declaration
    protected override void OnDestroy()
    Overrides
    UnityEngine.XR.ARFoundation.SubsystemLifecycleManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor>.OnDestroy()

    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
    UnityEngine.XR.ARFoundation.ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, UnityEngine.XR.ARFoundation.ARHumanBody>.OnTrackablesChanged(System.Collections.Generic.List<UnityEngine.XR.ARFoundation.ARHumanBody>, System.Collections.Generic.List<UnityEngine.XR.ARFoundation.ARHumanBody>, System.Collections.Generic.List<UnityEngine.XR.ARFoundation.ARHumanBody>)

    Update()

    Callback as the manager is being updated.

    Declaration
    protected override void Update()
    Overrides
    UnityEngine.XR.ARFoundation.ARTrackableManager<XRHumanBodySubsystem, XRHumanBodySubsystemDescriptor, XRHumanBody, UnityEngine.XR.ARFoundation.ARHumanBody>.Update()

    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>
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023