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
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
Pathfinding-Related Classes
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::Utils Class

Header: #include <UnigineUtils.h>

This class contains the helper functions.

Utils Class

Members


int convertHeightsToNormals ( ImagePtr & out, const ImagePtr & heights, float step_size ) #

Converts the elevation (height) map to the normal map.

Arguments

  • ImagePtr & out - Pointer to the target normal map.
  • const ImagePtr & heights - Source elevation (height) map.
  • float step_size - Grid cell step.

Return value

1 if the converting was successful; otherwise, 0.

void convertNodesToMesh ( MeshPtr & out, const Vector<NodePtr > & nodes ) #

Creates a mesh out of the node array.

Arguments

  • MeshPtr & out - Pointer to the target mesh.
  • const Vector<NodePtr > & nodes - Array of the node pointers.

String date ( const char * format, long long time ) #

Returns given time as a string. The content of format string with format specifiers expanded with the corresponding values that represent the time described in time.

Arguments

  • const char * format - Format string containing any combination of regular characters and special format specifiers. These format specifiers are replaced by the function to the corresponding values to represent the time specified in timeptr. They all begin with a percentage (%) sign, and are as follows:
    Specifier Replaced by Example
    %a Abbreviated weekday name Thu
    %b Abbreviated month name Aug
    %d Date and time representation equivalent to %a %b %D, %h:%m Thu Aug 23, 14:55
    %s Second (00-61) 15
    %m Minute (00-59) 55
    %h Hour (00-24) 14
    %D Month day (1-31) 25
    %M Month (1-12) 11
    %Y Year 2016
    %W Week day (1-7) 5
    % A % sign %
  • long long time - Time value.

String date ( const char * format ) #

Returns current time as a string. The content of format string with format specifiers expanded with the corresponding values that represent the current time.

Arguments

  • const char * format - Format string containing any combination of regular characters and special format specifiers. These format specifiers are replaced by the function to the corresponding values to represent the time specified in timeptr. They all begin with a percentage (%) sign, and are as follows:
    Specifier Replaced by Example
    %a Abbreviated weekday name Thu
    %b Abbreviated month name Aug
    %d Date and time representation equivalent to %a %b %D, %h:%m Thu Aug 23, 14:55
    %s Second (00-61) 15
    %m Minute (00-59) 55
    %h Hour (00-24) 14
    %D Month day (1-31) 25
    %M Month (1-12) 11
    %Y Year 2016
    %W Week day (1-7) 5
    % A % sign %

NodePtr loadObjectMesh ( const char * name ) #

Loads a mesh from a file. If the mesh is loaded successfully, its node does not belong to any node hierarchy, so be careful and make sure to handle it properly, when it is no longer needed.

Arguments

  • const char * name - Path to the mesh.

Return value

Pointer to the node corresponding to the loaded mesh; 0 if the mesh cannot be loaded.

int makeNodeCurved ( NodePtr node ) #

Curves a given node using its geodetic pivot.
Notice
The node must be a child of a geodetic pivot node.

Arguments

  • NodePtr node - Pointer to the node to be made curved.

Return value

1 if the node was curved successfully; othervise, 0.

int makeNodeFlat ( NodePtr node ) #

Flattens a given node using its geodetic pivot.
Notice
The node must be a child of a geodetic pivot node.

Arguments

  • NodePtr node - Pointer to the node to be made flat.

Return value

1 if the node was flattened successfully; othervise, 0.
Last update: 20.04.2022
Build: ()