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
Pathfinding 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
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.

NavigationMesh Class

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
Inherits from: Navigation

This class enables to create a navigation area above the surface of an arbitrary mesh. In fact, the navigation mesh is the area of the specified height above the mesh polygons, which is available for pathfinding.

Notice
A mesh used as a base for the navigation mesh should meet the requirements described here.

See Also#

  • The article on Navigation Mesh
  • A set of samples located in the data/samples/paths folder:
    1. mesh_00
    2. route_03
    3. route_04

NavigationMesh Class

Members


static NavigationMesh ( ) #

Constructor. Creates an empty navigation mesh.

static NavigationMesh ( string arg1 ) #

Creates a navigation mesh from the given *.mesh file.

Arguments

  • string arg1 - Path to the *.mesh file.

void setDepth ( int depth ) #

Sets a depth value. The larger the depth value, the better control over accuracy and speed of route calculation is provided.

Arguments

  • int depth - A depth, which is an integer value in range [0;4].

int getDepth ( ) #

Returns the depth value, which is an integer value in range [0;4]. The larger the depth value, the better control over accuracy and speed of route calculation is provided.

Return value

The depth value.

void setHeight ( float height ) #

Sets the distance above the navigation mesh polygons that is available for pathfinding. By default, the height is set to 1.

Arguments

  • float height - Height in units.

float getHeight ( ) #

Returns the distance above the navigation mesh polygons that is available for pathfinding. By default, the height is set to 1.

Return value

Height in units.

int setMesh ( Mesh mesh ) #

Copies a given mesh into the mesh, on which the current navigation mesh is based.

Arguments

  • Mesh mesh - Mesh to be copied.

Return value

1 if the mesh is copied successfully; otherwise, 0.

int getMesh ( Mesh mesh ) #

Copies the mesh that is used as a base for the current navigation mesh into the received mesh.
Notice
A mesh used as a base for the navigation mesh should meet the requirements described here.

Arguments

  • Mesh mesh - A mesh into which the current mesh is copied.

Return value

1 if the mesh is copied successfully; otherwise, 0.

int setMeshName ( string path, int force_load = 0 ) #

Sets a new name for the mesh used as a base for the navigation mesh and forces loading of the mesh with the new name for the current navigation mesh.

Arguments

  • string path - A mesh name to be set.
  • int force_load - Force flag.
    • If 1 is specified, the mesh with the new name will be loaded immediately.
    • If 0 is specified, only the mesh name will be updated.

Return value

1 if:
  • The current mesh name coincides the new name.
  • The mesh with the new name has been loaded successfully.
  • The force flag is set to 0.
In other cases, 0.

string getMeshName ( ) #

Returns the name of the mesh used as a base for the navigation mesh.

Return value

The mesh name.

int loadMesh ( string path ) #

Loads a mesh, on which the navigation mesh is based, from the file. This function doesn't change the mesh name.

Arguments

  • string path - A relative path to the *.mesh file.

Return value

1 if the mesh is loaded successfully; otherwise, 0.

int saveMesh ( string path ) #

Saves the mesh, on which the navigation mesh is based, to the file.

Arguments

  • string path - A relative path to the *.mesh file.

Return value

1 if the mesh is saved successfully; otherwise, 0.

static int type ( ) #

Returns the type of the node.

Return value

Navigation type identifier.

void setMeshName ( string name ) #

Saves the name of the mesh used as a base for the navigation mesh.
Notice
A mesh used as a base for the navigation mesh should meet the requirements described here.
Source code (C++)
mesh->setMeshName("NewMeshName");
Source code (C#)
mesh.SetMeshName("NewMeshName");

Arguments

  • string name - A mesh name to be set.
Last update: 2021-12-13
Build: ()