This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
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
Content Creation
Content Optimization
Materials
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine::Plugins::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 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: 2021-04-29
Build: ()