This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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 Optimization
Materials
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

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: ()