Unigine.NavigationMesh Class
Inherits: | 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.
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:
- mesh_00
- route_03
- route_04
NavigationMesh Class
Properties
string MeshName#
The name of the mesh used as a base for the navigation mesh.
set
set value -
float Height#
The distance above the navigation mesh polygons that is available for pathfinding. by default, the height is set to 1.
set
Sets the distance above the navigation mesh polygons that is available for pathfinding. By default, the height is set to 1.
set value -
Height in units.
int Depth#
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.
set
Sets a depth value. The larger the depth value, the better control over accuracy and speed of route calculation is provided.
set value -
A depth, which is an integer value in range [0;4].
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.
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.Arguments
- Mesh mesh - A mesh into which the current mesh is copied.
Return value
1 if the mesh is copied successfully; otherwise, 0.bool SetMeshName ( string path, bool 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.
- bool 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.
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 ) #
Arguments
- string name
Last update:
2020-07-31
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)