Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TryGetSubmeshClassifications(MeshId, Allocator, out uint, out NativeArray<uint>, out NativeArray<uint>)

Gets classification information for vertices or vertex sets for meshes obtained through XRMeshSubsystem.TryGetMeshInfos. This must be enabled through _submeshClassificationEnabled.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine.XR
  • Assembly: UnityEngine.XRModule

TryGetSubmeshClassifications(MeshId, Allocator, uint, NativeArray<uint>, NativeArray<uint>)

public bool TryGetSubmeshClassifications(MeshId id, Allocator allocator, out uint elementsPerVector, out NativeArray<uint> vertexIndexVectors, out NativeArray<uint> classifications)

Parameters

A MeshId obtained earlier through TryGetMeshInfos for which to retrieve classification information

allocator

The Allocator type to use for the returned
NativeArray
s

elementsPerVector

The number of packed elements in
vertexIndexVectors
to treat as one classification unit. Platform-specific; for example, some platforms may use
1
for a single vertex per classification; others may use
3
to represent a triangle face per classification.

vertexIndexVectors

The indices referring to Mesh vertices that the classifications apply to, coallated with
classifications
.

classifications

The opaque classification enumerations returned by the provider for the defined vertex components above.

Returns

Type

Description

boolTrue if the retrieval is successful, otherwise False

Remarks

Use this to retrieve semantic classifications for vertex or vertex group components of the meshes tracked by the subsystem.
This method always returns new NativeArray<T>s, even when there are no results. The caller is responsible for disposing the returned NativeArray<T>, though specifying the appropriate Allocator will manage this for you.
Additional Resources: XRMeshSubsystem.TryGetMeshInfos