This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Программирование на C#
Рендеринг
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Setting Up Properties
Освещение
Landscape Tool
Sandworm
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
File Formats
Rebuilding the Engine Tools
GUI
Двойная точность координат
API
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
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии 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: 09.04.2021
Build: ()