docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XRHandMeshData

    Low-level meshing data. If the call that retrieved this from TryGetMeshData(out XRHandMeshDataQueryResult, ref XRHandMeshDataQueryParams) was successful, positions, normals, and uvs will all have the same length.

    Implements
    IDisposable
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Hands.Meshing
    Assembly: Unity.XR.Hands.dll
    Syntax
    public struct XRHandMeshData : IDisposable

    Properties

    handedness

    Represents which hand this mesh data represents.

    Declaration
    public readonly Handedness handedness { get; }
    Property Value
    Type Description
    Handedness

    Right, left, or invalid.

    indices

    Indices into the other arrays in this type for triangle data.

    Declaration
    public readonly NativeArray<int> indices { get; }
    Property Value
    Type Description
    NativeArray<int>

    Can only be valid if the call to TryGetMeshData(out XRHandMeshDataQueryResult, ref XRHandMeshDataQueryParams) that retrieved this way successful, but may still not be valid, so check its IsCreated property before use.

    normals

    Normals of vertices.

    Declaration
    public readonly NativeArray<Vector3> normals { get; }
    Property Value
    Type Description
    NativeArray<Vector3>

    Can only be valid if the call to TryGetMeshData(out XRHandMeshDataQueryResult, ref XRHandMeshDataQueryParams) that retrieved this way successful, but may still not be valid, so check its IsCreated property before use.

    positions

    Positions of vertices, in session space.

    Declaration
    public readonly NativeArray<Vector3> positions { get; }
    Property Value
    Type Description
    NativeArray<Vector3>

    Can only be valid if the call to TryGetMeshData(out XRHandMeshDataQueryResult, ref XRHandMeshDataQueryParams) that retrieved this way successful, but may still not be valid, so check its IsCreated property before use.

    uvs

    Texture UV coordinates of vertices.

    Declaration
    public readonly NativeArray<Vector2> uvs { get; }
    Property Value
    Type Description
    NativeArray<Vector2>

    Can only be valid if the call to TryGetMeshData(out XRHandMeshDataQueryResult, ref XRHandMeshDataQueryParams) that retrieved this way successful, but may still not be valid, so check its IsCreated property before use.

    Methods

    Dispose()

    Dispose of array data in this object.

    Declaration
    public void Dispose()
    Remarks

    This method is idempotent, meaning it doesn't matter if it gets duplicate calls. Since XRHandMeshDataQueryResult's Dispose() calls this, that that means Dispose is safe to call on just leftHand and rightHand, just the containing XRHandMeshDataQueryResult, or both sets.

    TryGetRootPose(out Pose)

    Retrieves root pose, if this frame's data had one available.

    Declaration
    public bool TryGetRootPose(out Pose rootPose)
    Parameters
    Type Name Description
    Pose rootPose

    If this function succeeds, this will be filled out with the root Pose for how the mesh data in this object is intended to be drawn. This pose should not be used otherwise.

    Returns
    Type Description
    bool

    Returns true if successful and the root pose was filled out, returns false otherwise.

    Remarks

    If this function fails, you should continue to use the previous pose. If there has been no successful pose retrieval yet, the closest approximation would be the Pose of the wrist joint.

    Implements

    IDisposable

    Extension Methods

    XRHandMeshDataExtensions.InvalidateRootPose(ref XRHandMeshData)
    XRHandMeshDataExtensions.SetIndices(ref XRHandMeshData, NativeArray<int>)
    XRHandMeshDataExtensions.SetNormals(ref XRHandMeshData, NativeArray<Vector3>)
    XRHandMeshDataExtensions.SetPositions(ref XRHandMeshData, NativeArray<Vector3>)
    XRHandMeshDataExtensions.SetRootPose(ref XRHandMeshData, Pose)
    XRHandMeshDataExtensions.SetUVs(ref XRHandMeshData, NativeArray<Vector2>)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)