This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
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
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

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: 2021-12-13
Build: ()