Unigine.Navigation Class
Inherits from: | Node |
3D navigation feature is experimental and not recommended for production use.
This class contains functions that enable to get or change parameters of a navigation area within which pathfinding is performed. The navigation area can be either a navigation sector or a navigation mesh.
For example, by using the functions of this class, you can scale velocity of the point moving inside the navigation area. Or you can change the danger factor of the area.
See Also#
- Articles of the Navigation Area section
- A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/paths/ folder
- Navigation sample in C# Component Samples suite
Navigation Class
Properties
float Velocity#
The current scaling factor for velocity of the point that moves inside the navigation area along the calculated route.
int Quality#
The quality of optimization of the route that has already been calculated. the quality value specifies the number of iterations that are used for taking the short cut.
int NumNavigations#
The number of navigation areas that intersect the current one.
int NavigationMask#
The current navigation mask of the navigation area. the navigation mask of the navigation area must match the navigation mask of the route that is calculated within it. Otherwise, the area will not participate in pathfinding.
float Dangerous#
The current danger factor that indicates if the point that moves inside the navigation area should try to avoid this area.
If the danger factor exceeds the maximum danger factor set for the route, the navigation area will be excluded from pathfinding calculations.
Members
Navigation GetNavigation ( int num ) #
Returns the specified connected navigation area.Arguments
- int num - The navigation area number.
Return value
The navigation area.int Inside ( Navigation navigation ) #
Returns a value indicating if the specified Navigation area is a part of the Navigation area.Arguments
- Navigation navigation - Navigation area
int Inside2D ( vec3 point, float radius ) #
Depending on the type of the navigation area, the function performs the following:- For navigation sectors, it checks whether the given point is inside the navigation sector. The height of the navigation sector (Z coordinate) is ignored.
- For navigation meshes, it checks whether the given point is inside the navigation mesh and the distance from the point to the mesh is in range [-height;height]. Here height is a height of the navigation mesh.
Arguments
- vec3 point - Point coordinates.
- float radius - The radius of the point. The radius is used to exclude exceeding the navigation mesh by the point.
If the radius is set, it is more likely that the point will be inside the navigation mesh.
When calling the function for NavigationSector, this option is irrelevant.
Return value
1 if the point is inside the navigation area; otherwise, 0.int Inside3D ( vec3 point, float radius ) #
Depending on the type of the navigation area, the function performs the following:- For navigation sectors, it checks whether the given point is inside the navigation area. Notice that the height of the navigation sector (Z coordinate) is also taken into account.
- For navigation meshes, it checks whether the given point is inside the navigation mesh and the distance from the point to the mesh is in range [0;height]. Here height is a height of the navigation mesh.
Arguments
- vec3 point - Point coordinates.
- float radius - The radius of the point. The radius is used to exclude exceeding the navigation mesh by the point.
If the radius is set, it is more likely that the point will be inside the navigation mesh.
When calling the function for NavigationSector, this option is irrelevant.
Return value
1 it the point is inside the navigation area; otherwise, 0.Last update:
2023-01-11
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)