Class XRHandMeshDataExtensions
Contains extensions to XRHandMeshData relevant to supplying data when TryGetMeshData(out XRHandMeshDataQueryResult, ref XRHandMeshDataQueryParams) is called.
Inherited Members
Namespace: UnityEngine.XR.Hands.Meshing.ProviderImplementation
Assembly: Unity.XR.Hands.dll
Syntax
public static class XRHandMeshDataExtensions
Methods
InvalidateRootPose(ref XRHandMeshData)
Invalidates the root Pose on the XRHandMeshData.
Declaration
public static void InvalidateRootPose(this ref XRHandMeshData meshData)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to invalidate the root pose on. |
SetBoneWeights(ref XRHandMeshData, NativeArray<BoneWeight1>)
Set bone weights on the XRHandMeshData.
Declaration
public static void SetBoneWeights(this ref XRHandMeshData meshData, NativeArray<BoneWeight1> boneWeights)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to set bone weights on. |
| NativeArray<BoneWeight1> | boneWeights | Bone weights for each vertex, sorted by vertex index. |
SetBonesPerVertex(ref XRHandMeshData, NativeArray<byte>)
Set bones per vertex on the XRHandMeshData.
Declaration
public static void SetBonesPerVertex(this ref XRHandMeshData meshData, NativeArray<byte> bonesPerVertex)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to set bones per vertex on. |
| NativeArray<byte> | bonesPerVertex | Bone count for each vertex in the mesh. |
SetIndices(ref XRHandMeshData, NativeArray<int>)
Set the indices data on the XRHandMeshData.
Declaration
public static void SetIndices(this ref XRHandMeshData meshData, NativeArray<int> indices)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to set index data on. |
| NativeArray<int> | indices | Index data to set on the invoking mesh data. |
SetJointBindPoses(ref XRHandMeshData, NativeArray<Matrix4x4>)
Set the joint bind poses on the XRHandMeshData. Must have enough room for each joint up to and including the last valid one. Must have memory allocated for joints with lower-integer-value XRHandJointIDs, even if those joints are invalid.
Declaration
public static void SetJointBindPoses(this ref XRHandMeshData meshData, NativeArray<Matrix4x4> jointBindPoses)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to set joint data validity flags on. |
| NativeArray<Matrix4x4> | jointBindPoses | Pose for each joint known with known data this frame. |
Remarks
The bind Pose at each index can only be retrieved if the value at the matching index in what's supplied to SetMatchingJointBindPoseValidity(ref XRHandMeshData, NativeArray<bool>) is set to true.
SetJointRadii(ref XRHandMeshData, NativeArray<float>)
Set the joint radii on the XRHandMeshData. Must have enough room for each joint up to and including the last valid one. Must have memory allocated for joints with lower-integer-value XRHandJointIDs, even if those joints are invalid.
Declaration
public static void SetJointRadii(this ref XRHandMeshData meshData, NativeArray<float> jointRadii)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to set joint data validity flags on. |
| NativeArray<float> | jointRadii | Radius for each joint known with known data this frame. |
Remarks
The radius at each index can only be retrieved if the value at the matching index in what's supplied to SetMatchingJointRadiusValidity(ref XRHandMeshData, NativeArray<bool>) is set to true.
SetMatchingJointBindPoseValidity(ref XRHandMeshData, NativeArray<bool>)
Set the joint pose validity on the XRHandMeshData. Must have enough room for each joint up to and including the last valid one. Must have memory allocated for joints with lower-integer-value XRHandJointIDs, even if those joints are invalid.
Declaration
public static void SetMatchingJointBindPoseValidity(this ref XRHandMeshData meshData, NativeArray<bool> matchingJointBindPoseIsValid)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to set joint data validity flags on. |
| NativeArray<bool> | matchingJointBindPoseIsValid | The value at each index is set to true if the bind Pose for that joint is valid. That bind Pose can then be retrieved from XRHandMesh.TryGetJointPose. |
SetMatchingJointRadiusValidity(ref XRHandMeshData, NativeArray<bool>)
Set the joint radius validity on the XRHandMeshData. Must have enough room for each joint up to and including the last valid one. Must have memory allocated for joints with lower-integer-value XRHandJointIDs, even if those joints are invalid.
Declaration
public static void SetMatchingJointRadiusValidity(this ref XRHandMeshData meshData, NativeArray<bool> matchingJointRadiusIsValid)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to set joint data validity flags on. |
| NativeArray<bool> | matchingJointRadiusIsValid | The value at each index is set to true if the radius for that joint is valid. That radius can then be retrieved from XRHandMesh.TryGetJointRadius. |
SetNormals(ref XRHandMeshData, NativeArray<Vector3>)
Set the normals data on the XRHandMeshData.
Declaration
public static void SetNormals(this ref XRHandMeshData meshData, NativeArray<Vector3> normals)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to set normal data on. |
| NativeArray<Vector3> | normals | Index data to set on the invoking mesh data. |
SetPositions(ref XRHandMeshData, NativeArray<Vector3>)
Set the positions data on the XRHandMeshData.
Declaration
public static void SetPositions(this ref XRHandMeshData meshData, NativeArray<Vector3> positions)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to set position data on. |
| NativeArray<Vector3> | positions | Index data to set on the invoking mesh data. |
SetRootPose(ref XRHandMeshData, Pose)
Set the root Pose on the XRHandMeshData.
Declaration
public static void SetRootPose(this ref XRHandMeshData meshData, Pose rootPose)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to set index data on. |
| Pose | rootPose | Root pose to set on the invoking mesh data. |
SetUVs(ref XRHandMeshData, NativeArray<Vector2>)
Set the uvs data on the XRHandMeshData.
Declaration
public static void SetUVs(this ref XRHandMeshData meshData, NativeArray<Vector2> uvs)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandMeshData | meshData | Mesh data to set texture coordinate data on. |
| NativeArray<Vector2> | uvs | Texture coordinate data to set on the invoking mesh data. |