Видеоуроки
Interface
Essentials
Advanced
Полезные советы
Принципы работы
Properties
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Освещение
Landscape Tool
Sandworm (Experimental)
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
File Formats
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
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials

IG::Converter Class

Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Sim SDK edition to use it.
Header: #include <plugins/UnigineIG.h>

This utility class is used to perform conversions between different coordinate systems for the IG (e.g. ENU <-> NED, Euler rotation <-> quaternion, etc.).

Notice
IG plugin must be loaded.

Converter Class

Members


dvec3 worldToGeodetic ( const NodePtr & node ) #

Returns the position of the specified node in geodetic coordinates.

Arguments

  • const NodePtr & node - Node, for which a geodetic coordinates are to be obtained.

Return value

Node's position in geodetic coordinates (lat, lon, alt).

dvec3 worldToGeodetic ( const Vec3 & world_pos ) #

Returns geodetic coordinates of a point with the specified world coordinates.

Arguments

  • const Vec3 & world_pos - World coordinates of the point to be converted (X, Y, Z).

Return value

Geodetic coordinates of the point (lat, lon, alt).

Vec3 geodeticToWorld ( const dvec3 & geo_pos ) #

Returns world coordinates of a point with the specified geodetic coordinates.

Arguments

  • const dvec3 & geo_pos - Geodetic coordinates of the point to be converted (lat, lon, alt).

Return value

World coordinates of the point (X, Y, Z).

Vec3 ENUtoNED ( const Vec3 & enu_pos ) #

Converts the coordinates of a point specified in the ENU (East-North-Up) system to NED (North-East-Down).

Arguments

  • const Vec3 & enu_pos - Coordinates of a point in the ENU (East-North-Up) system.

Return value

Coordinates of the point in the NED (North-East-Down) system.

Vec3 NEDtoENU ( const Vec3 & ned_pos ) #

Converts the coordinates of a point specified in the NED (North-East-Down) system to ENU (East-North-Up).

Arguments

  • const Vec3 & ned_pos - Coordinates of a point in the NED (North-East-Down) system.

Return value

Coordinates of the point in the ENU (East-North-Up) system.

quat getZeroRotation ( const dvec3 & geo_pos ) #

Returns the zero-rotation for the specified target geodetic position.
Notice

Unigine uses ENU orientation!

  • final_rotation = zero_rotation * entity_local_rotation
  • entity_local_rotation = final_rotation * inverse(zero_rotation)

Arguments

  • const dvec3 & geo_pos - Target geodetic position coordinates (lat, lon, alt).

Return value

Zero-rotation quaternion for the specified target geodetic position.

void getZeroUpDirection ( const dvec3 & geo_pos, vec3 & up ) #

Returns the zero "up"-vector coordinates for the specified target geodetic position.

Arguments

  • const dvec3 & geo_pos - Target geodetic position coordinates (lat, lon, alt).
  • vec3 & up - Zero "up"-vector coordinates for the specified target geodetic position.

void getZeroDirections ( const dvec3 & geo_pos, vec3 & east, vec3 & north, vec3 & up ) #

Gets zero directions (east, north, up) for the specified target geodetic position and puts them to the specified vectors.
Notice
Unigine uses ENU orientation!

Arguments

  • const dvec3 & geo_pos - Target geodetic position coordinates (lat, lon, alt).
  • vec3 & east - Vector to which the east direction vector coordinates are to be put.
  • vec3 & north - Vector to which the north direction vector coordinates are to be put.
  • vec3 & up - Vector to which the up direction vector coordinates are to be put.

Mat4 getZeroBasis ( const dvec3 & geo_pos ) #

Returns the whole zero basis for the specified target geodetic position.

Arguments

  • const dvec3 & geo_pos - Target geodetic position coordinates (lat, lon, alt).

Return value

Zero basis for the specified target geodetic position.

quat eulerENUToRotation ( const vec3 & euler ) #

Converts the specified Euler rotation vector in ENU (East-North-Up) coordinates to a rotation quaternion.
Notice

Unigine uses ENU orientation!

Axis order: Yaw -> Pitch -> Roll (ENU: Z -> X -> Y, NED: Z -> Y -> X)

Arguments

  • const vec3 & euler - Vector representing rotation (roll, pitch, yaw) in ENU (East-North-Up) coordinates.

Return value

Rotation quaternion.

quat eulerNEDToRotation ( const vec3 & euler ) #

Converts the specified Euler rotation vector in NED (North-East-Down) coordinates to a rotation quaternion.
Notice

Unigine uses ENU orientation!

Axis order: Yaw -> Pitch -> Roll (ENU: Z -> X -> Y, NED: Z -> Y -> X)

Arguments

  • const vec3 & euler - Vector representing Euler rotation (roll, pitch, yaw) in NED (North-East-Down) coordinates.

Return value

Rotation quaternion.

vec3 rotationToEulerENU ( const quat & rotation ) #

Converts the specified rotation quaternion to Euler rotation vector in ENU (East-North-Up) coordinates.
Notice

Unigine uses ENU orientation!

Axis order: Yaw -> Pitch -> Roll (ENU: Z -> X -> Y, NED: Z -> Y -> X)

Arguments

  • const quat & rotation - Rotation quaternion.

Return value

Vector representing rotation (roll, pitch, yaw) in ENU (East-North-Up) coordinates.

vec3 rotationToEulerNED ( const quat & rotation ) #

Converts the specified rotation quaternion to Euler rotation vector in NED (North-East-Down) coordinates.
Notice

Unigine uses ENU orientation!

Axis order: Yaw -> Pitch -> Roll (ENU: Z -> X -> Y, NED: Z -> Y -> X)

Arguments

  • const quat & rotation - Rotation quaternion.

Return value

Vector representing Euler rotation (roll, pitch, yaw) in NED (North-East-Down) coordinates.
Last update: 28.11.2019