This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Сэмплы материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::Navigation Class

Header: #include <UniginePathFinding.h>
Inherits from: Node
Warning
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

Members


void setDangerous ( float dangerous ) #

Sets the danger factor that indicates if the point that moves inside the navigation area should try to avoid this area.
Notice
If the danger factor exceeds the maximum danger factor set for the route, the navigation area will be excluded from pathfinding calculations.

Arguments

  • float dangerous - Danger factor.

float getDangerous ( ) #

Returns the current danger factor that indicates if the point that moves inside the navigation area should try to avoid this area.
Notice
If the danger factor exceeds the maximum danger factor set for the route, the navigation area will be excluded from pathfinding calculations.

Return value

The danger factor.

Ptr<Navigation> getNavigation ( int num ) #

Returns the specified connected navigation area.

Arguments

  • int num - The navigation area number.

Return value

The navigation area.

void setNavigationMask ( int mask ) #

Sets a navigation mask for 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. By using the navigation mask, you can specify navigation ares that must be ignored during pathfinding.

Arguments

  • int mask - An integer value, each bit of which is used to set a mask.

int getNavigationMask ( ) #

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

Return value

An integer value, each bit of which is used to set a mask.

int getNumNavigations ( ) #

Returns the number of navigation areas that intersect the current one.

Return value

The number of connected navigation areas.

void setQuality ( int quality ) #

Sets a quality of optimization of the route that has already been calculated. This value specifies the number of iterations that are used for taking the short cut. However, the higher the value, the longer the route calculation will take.

Arguments

  • int quality - A quality value. If a negative value is provided, 0 will be used instead.

int getQuality ( ) #

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

Return value

The quality value.

void setVelocity ( float velocity ) #

Sets a scaling factor for velocity of the point that moves inside the navigation area along the calculated route.

Arguments

  • float velocity - A velocity scaling factor.

float getVelocity ( ) #

Returns the current scaling factor for velocity of the point that moves inside the navigation area along the calculated route.

Return value

The velocity scaling factor.

int inside ( const Ptr<Navigation> & navigation ) #

Returns a value indicating if the specified Navigation area is a part of the Navigation area.

Arguments

  • const Ptr<Navigation> & navigation - Navigation area

int inside2D ( const Math::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

  • const Math::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.
    Notice
    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 ( const Math::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

  • const Math::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.
    Notice
    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: 23.06.2023
Build: ()