Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

NavMesh.CalculateTriangulation

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 static AI.NavMeshTriangulation CalculateTriangulation();

Returns

NavMeshTriangulation Object that contains a list of vertices and a list of indices that describe the triangles of the active NavMeshes.

Description

Calculates a triangulation of all the NavMeshes that are present in the scene at the time of the call.

Calculates and returns a simple triangulation of all the NavMeshes that are currently active. The resulting object contains vertices, triangle indices and NavMesh area types. The triangles from each NavMesh instance are grouped together in the array. These triangle groups are further sorted in the array based on the agent types that their originating NavMeshes were built for.
The triangulation captures the current shape of the NavMeshes, which can include temporary holes carved by NavMeshObstacles.


The returned mesh contains only the triangles used for pathfinding. It does not contain the detail that is used to place the agents on the walkable surface. This is noticeable on locations with curved surfaces.

Additional resources: Areas and Costs to learn how to use different Area types.

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