This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Core Library
Containers
Engine Classes
Node-Related Classes
Rendering-Related Classes
Physics-Related Classes
Bounds-Related Classes
GUI-Related Classes
Controls-Related Classes
Utility Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

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

  • 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


NavigationMesh ()

Constructor. Creates an empty navigation mesh.

NavigationMesh (const char * arg1)

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

Arguments

  • const char * arg1 - Path to the *.mesh file.

int setMesh (const Ptr<Mesh> & mesh)

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

Arguments

  • const Ptr<Mesh> & mesh - Mesh to be copied.

Return value

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

const char * getMeshName ()

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

Return value

The mesh name.

int saveMesh (const char * name)

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

Arguments

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

Return value

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

int loadMesh (const char * name)

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

Arguments

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

Return value

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

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

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.

void setMeshName (const char * name)

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

Arguments

  • const char * name - A mesh name to be set.

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.

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.

int getMesh (const Ptr<Mesh> & mesh)

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

Arguments

  • const Ptr<Mesh> & mesh - A mesh into which the current mesh is copied.

Return value

1 if the mesh is copied successfully; otherwise, 0.
Last update: 2017-07-03
Build: ()