UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1

NavigationMesh Class

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

NavigationMesh Class

This class inherits from Navigation

Members


NavigationMesh ()

Constructor. Creates an empty navigation mesh.

NavigationMesh (string name)

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

Arguments

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

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.

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.

string getMeshName ()

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

Return value

The mesh name.

int getMesh (Mesh mesh)

Copies the mesh that is used as a base for the current navigation mesh into the received mesh.

Arguments

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

Return value

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

int loadMesh (string name)

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

Arguments

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

Return value

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

int saveMesh (string name)

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

Arguments

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

Return value

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

void setDepth (int d)

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

Arguments

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

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.

void setMeshName (string name)

Sets a new name for the mesh used as a base for the navigation mesh.

Arguments

  • string name - A mesh name to be set.

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.
Last update: 2017-07-03