Version: 2018.4
LanguageEnglish
  • C#
Experimental: this API is experimental and might be changed or removed in the future.

XRMeshSubsystem.GenerateMeshAsync

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void GenerateMeshAsync(Experimental.XR.TrackableId meshId, Mesh mesh, MeshCollider meshCollider, Experimental.XR.MeshVertexAttributes attributes, Action<MeshGenerationResult> onMeshGenerationComplete);

Parameters

meshId The TrackableId of the mesh you wish to generate.
mesh The Mesh to write the results into.
meshCollider (Optional) The MeshCollider to populate with physics data. This may be null.
attributes The vertex attributes you'd like to use.
onMeshGenerationComplete The delegate to invoke when the generation completes.

Description

Request that the mesh with TrackableId meshId gets generated. onMeshGenerationComplete is called when generation is complete.

Use this method to request that a mesh is asynchronously generated. "Generation" includes extracting the mesh data from the subsystem's mesh provider (e.g., an AR device) and baking the MeshCollider (if meshCollider is not null).

This happens in a background thread. For large meshes, this can take several frames to complete. onMeshGenerationComplete is invoked when the generation completes.

See Also: TryGetMeshInfos