This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Режимы вывода изображения
Физика
Браузер SDK 2
Лицензирование и типы лицензий
Дополнения (Add-Ons)
Демонстрационные проекты
API Samples
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
Унифицированный язык шейдеров UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
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
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine::NavigationMesh Class

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

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
  • Navigation sample in C# Component Samples suite

NavigationMesh Class

Members


static NavigationMeshPtr create ( ) #

Constructor. Creates an empty navigation mesh.

static NavigationMeshPtr create ( const char * arg1 ) #

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

Arguments

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

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

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.

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.

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.

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.

int getMesh ( const Ptr<Mesh> & mesh ) #

Copies the mesh that is used as a base for the current navigation mesh into the received mesh.
Notice
A mesh used as a base for the navigation mesh should meet the requirements described here.

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.

int setMeshPath ( const char * path, int force_load = 0 ) #

Sets a new path for the mesh used as a base for the navigation mesh and forces loading of the mesh with the new path for the current navigation mesh.

Arguments

  • const char * path - Path to the *.mesh-file to be set.
  • int force_load - Force flag.
    • If 1 is specified, the mesh with the new path will be loaded immediately.
    • If 0 is specified, only the mesh path will be updated.

Return value

true if:
  • The current mesh path coincides the new path.
  • The mesh with the new path has been loaded successfully.
  • The force flag is set to 0.
In other cases, false.

const char * getMeshPath ( ) #

Returns the path to the .mesh-file containing a base mesh for the navigation mesh.

Return value

Path to the *.mesh-file.

int loadMesh ( const char * path ) #

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

Arguments

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

Return value

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

int saveMesh ( const char * path ) #

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

Arguments

  • const char * 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.
Last update: 13.12.2024
Build: ()