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
Inherited Members
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 |
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 |
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 |
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 |
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.