This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

NavigationMesh Class

This class creates a navigation area above the surface of the arbitrary mesh. Navigation mesh is effectively the distance (of specified height) above the polygons of the mesh available for path finding.
Only 2D path finding is available for navigation meshes. Finding routes between two navigation meshes is also not supported.

Notice
A mesh used as NavigationMesh must allow for finding simple 2D routes: a polygon cannot share its edge with more than 2 other polygons; otherwise, an error will be generated.

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.

int getDepth ()

Returns the depth, which is an integer value in range [0;4].

Return value

Depth.

float getHeight ()

Returns the distance above the navigation mesh polygons that is available for path finding.

Return value

Height in units.

int getMesh (ObjectMesh mesh)

Allows to receive a mesh node as an argument.

Arguments

  • ObjectMesh mesh - Name of the mesh.

Return value

Mesh node.

int load (string name)

Loads a specified mesh to be used as navigation one.

Arguments

  • string name - Path to the mesh.

Return value

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

int save (string name)

Saves the navigation mesh into the mesh file.

Arguments

  • string name - Path to the mesh.

Return value

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

void setDepth (int d)

Sets the depth value. The larger the depth value, the better control over accuracy/speed of path calculation.

Arguments

  • int d - 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 path finding. The default is 1 unit.

Arguments

  • float height - Height in units.

int setMesh (ObjectMesh mesh)

Allows to reinitialize the NavigationMesh.

Arguments

  • ObjectMesh mesh - Name of the mesh node.

Return value

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