This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm (Experimental)
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Navigation Mesh

The navigation mesh is a navigation area which is arranged above the surface of an arbitrary mesh. In fact, the navigation mesh is an area of the specified height above the mesh polygons, which is available for pathfinding.

In contrast to navigation sectors, the navigation mesh enables the following:

  • Only 2D routes can be calculated within the navigation mesh.
  • Pathfinding can be performed within 1 navigation mesh only. Pathfinding within the following areas is not supported:
    • Within several intersecting navigation meshes.
    • Within the intersecting navigation mesh and sector.

See also#

  • The NavigationMesh class to manage navigation meshes via API
  • The article on Creating Routes to learn how to create routes inside the navigation mesh
  • A set of samples located in the <UnigineSDK>/data/samples/paths folder:
    • mesh_00
    • route_03
    • route_04

Creating Navigation Mesh#

Before adding a navigation mesh, you should prepare a mesh, on which this navigation mesh will be based. Such mesh is created separately and should meet the following requirements:

  • Any polygon of the mesh must not share its edge with more than 2 other polygons; otherwise, an error will occur.
  • Mesh polygons should be as wide as possible (ideally, they should be equilateral). Too narrow and high polygons may reduce accuracy of path calculation.
  • The mesh should be optimized: it should not contain a large number of polygons.

When a mesh is prepared, you can add the navigation mesh to the scene via UnigineEditor:

  1. Run UnigineEditor.
  2. On the Menu bar, click Create -> Navigation -> Navigation Mesh.

  3. In the file dialog window that opens, choose the required mesh to be used as a base for the new navigation area and click Ok.

  4. Click somewhere in the world to place the navigation mesh. A new navigation mesh is added to UnigineEditor and you can edit it via the Parameters window.

Notice
The created navigation mesh only provides an area within which 2D routes are calculated. The routes themselves should be created using the script.

Example#

If you have a scene with different objects and need to calculate a 2D route among them, add the navigation mesh to this scene as follows:

  1. Create a flat mesh with holes in places where the objects are positioned.
    The scene
    The mesh created for the navigation mesh
  2. Specify this mesh as a base for a navigation mesh within which the route is calculated, and add the navigation mesh to the world. It will be highlighted in green:

    A navigation mesh based on the flat mesh
  3. Place the navigation mesh above the scene.

    The navigation mesh positioned above the scene

Notice
In this case, you can also use a navigation sector with obstacles positioned inside it instead of the navigation mesh. However, the navigation mesh is preferred for more complex cases.

Editing Navigation Mesh#

In the Node tab of the Parameters window, you can adjust the following parameters of the navigation mesh:

Navigation Mask The navigation mask of the navigation mesh must match the navigation mask of the route that is calculated within it. Otherwise, the navigation mesh does not participate in pathfinding.
Quality Quality of optimization for route calculation. This value specifies the number of iterations that are used to find the shortcut. The higher the value, the longer the route calculation takes.
Velocity Scaling factor for velocity of the point that moves inside the navigation mesh.
Dangerous Danger factor that indicates if a moving point should try to avoid the navigation mesh.
Notice
If the danger factor exceeds the maximum danger factor set for the route, the navigation mesh is excluded from pathfinding calculations.
Depth Depth value. This value affects the quality of the route that is currently calculated. The more the depth value, the better control over accuracy and speed of route calculation is provided. The depth can take integer value in range [0;4]. By default, the depth is set to 0 for a new navigation mesh. The 2, 3, 4 values are used for deeper heuristics.
Height Distance above the mesh polygons available for pathfinding. By default, the height is set to 1 for a new navigation mesh.

Loading a New Mesh#

To load a new mesh on which the navigation area is based:

  1. On the Navigation tab, press .
  2. In the file dialog window that opens, choose the required mesh and press Ok.

Saving the Current Mesh#

To save the current mesh on which the navigation area is based:

  1. On the Navigation tab, press .
  2. In the file dialog window that opens, specify a name for the mesh and press Ok.
Last update: 2020-11-24
Build: ()