Version: 2019.1
Experimental: this API is experimental and might be changed or removed in the future.

XRMeshSubsystem.GenerateMeshAsync

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

Parameters

meshIdThe TrackableId of the mesh you wish to generate.
meshThe Mesh to write the results into.
meshCollider(Optional) The MeshCollider to populate with physics data. This may be null.
attributesThe vertex attributes you'd like to use.
onMeshGenerationCompleteThe 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

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961