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

    Class XRHumanBodySubsystem

    Defines an interface for interacting with human body functionality.

    Inheritance
    Object
    TrackingSubsystem<XRHumanBody, XRHumanBodySubsystemDescriptor>
    XRHumanBodySubsystem
    Inherited Members
    TrackingSubsystem<XRHumanBody, XRHumanBodySubsystemDescriptor>.running
    TrackingSubsystem<XRHumanBody, XRHumanBodySubsystemDescriptor>.m_Running
    TrackingSubsystem<XRHumanBody, XRHumanBodySubsystemDescriptor>.GetChanges(Allocator)
    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    public abstract class XRHumanBodySubsystem : TrackingSubsystem<XRHumanBody, XRHumanBodySubsystemDescriptor>

    Constructors

    XRHumanBodySubsystem()

    Construct the subsystem by creating the functionality provider.

    Declaration
    public XRHumanBodySubsystem()

    Properties

    humanBodyPose2DEstimationEnabled

    Whether 2D human body pose estimation is enabled.

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

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

    humanBodyPose3DEstimationEnabled

    Whether 3D human body pose estimation is enabled.

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

    true if 3D human body 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.

    humanSegmentationDepthMode

    Specifies the human segmentation depth mode.

    Declaration
    public HumanSegmentationMode humanSegmentationDepthMode { get; set; }
    Property Value
    Type Description
    HumanSegmentationMode

    The human segmentation depth mode.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown when setting the human segmentation depth mode to enabled if the implementation does not support human segmentation.

    humanSegmentationStencilMode

    Specifies the human segmentation stencil mode.

    Declaration
    public HumanSegmentationMode humanSegmentationStencilMode { get; set; }
    Property Value
    Type Description
    HumanSegmentationMode

    The human segmentation stencil mode.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown when setting the human segmentation stencil mode to enabled if the implementation does not support human segmentation.

    Methods

    CreateProvider()

    Create the implementation specific functionality provider.

    Declaration
    protected abstract XRHumanBodySubsystem.IProvider CreateProvider()
    Returns
    Type Description
    XRHumanBodySubsystem.IProvider

    The implementation specific functionality provider.

    Destroy()

    Destroy the subsystem by desstroying the provider.

    Declaration
    public override sealed void Destroy()

    GetChanges(Allocator)

    Query the provider for the trackable changes.

    Declaration
    public override TrackableChanges<XRHumanBody> GetChanges(Allocator allocator)
    Parameters
    Type Name Description
    Allocator allocator

    The memory allocator to use for allocating the arrays.

    Returns
    Type Description
    TrackableChanges<XRHumanBody>

    The trackable human body changes.

    Overrides
    UnityEngine.XR.ARSubsystems.TrackingSubsystem<UnityEngine.XR.ARSubsystems.XRHumanBody, UnityEngine.XR.ARSubsystems.XRHumanBodySubsystemDescriptor>.GetChanges(Allocator)

    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.

    GetSkeleton(TrackableId, Allocator, ref NativeArray<XRHumanBodyJoint>)

    Query the provider for the skeleton joints for the requested trackable identifier.

    Declaration
    public void GetSkeleton(TrackableId trackableId, Allocator allocator, ref NativeArray<XRHumanBodyJoint> skeleton)
    Parameters
    Type Name Description
    TrackableId trackableId

    The human body trackable identifier for which to query.

    Allocator allocator

    The memory allocator to use for the returned arrays.

    NativeArray<XRHumanBodyJoint> skeleton

    The array of skeleton joints to update and returns.

    Register(XRHumanBodySubsystemCinfo)

    Register the descriptor for the human body subsystem implementation.

    Declaration
    public static bool Register(XRHumanBodySubsystemCinfo humanBodySubsystemCinfo)
    Parameters
    Type Name Description
    XRHumanBodySubsystemCinfo humanBodySubsystemCinfo

    The human body subsystem implementation construction information.

    Returns
    Type Description
    Boolean

    true if the descriptor was registered. Otherwise, false.

    Start()

    Start the subsystem by starting the provider.

    Declaration
    public override void Start()

    Stop()

    Stop the subsystem by stopping the provider.

    Declaration
    public override void Stop()

    TryGetHumanDepth(out XRTextureDescriptor)

    Gets the human depth texture descriptor.

    Declaration
    public bool TryGetHumanDepth(out XRTextureDescriptor humanDepthDescriptor)
    Parameters
    Type Name Description
    XRTextureDescriptor humanDepthDescriptor

    The human depth texture descriptor to be populated, if available from the provider.

    Returns
    Type Description
    Boolean

    true if the human depth texture descriptor is available and is returned. Otherwise, false.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown if the implementation does not support human depth texture.

    TryGetHumanStencil(out XRTextureDescriptor)

    Gets the human stencil texture descriptor.

    Declaration
    public bool TryGetHumanStencil(out XRTextureDescriptor humanStencilDescriptor)
    Parameters
    Type Name Description
    XRTextureDescriptor humanStencilDescriptor

    The human stencil texture descriptor to be populated, if available from the provider.

    Returns
    Type Description
    Boolean

    true if the human stencil texture descriptor is available and is returned. Otherwise, false.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown if the implementation does not support human stencil texture.

    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