Unigine::Plugins::IG::Converter Class
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to- Sim
SDK edition to use it.
You should upgrade to
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.).
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.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.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.Unigine uses ENU orientation!
Axis order: Yaw -> Pitch -> Roll (ENU: Z -> X -> Y, NED: Z -> Y -> X)
- final_rotation = zero_rotation * entity_local_rotation
- entity_local_rotation = final_rotation * inverse(zero_rotation)
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.Unigine uses ENU orientation!
Axis order: Yaw -> Pitch -> Roll (ENU: Z -> X -> Y, NED: Z -> Y -> X)
- final_rotation = zero_rotation * entity_local_rotation
- entity_local_rotation = final_rotation * inverse(zero_rotation)
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.Unigine uses ENU orientation!
Axis order: Yaw -> Pitch -> Roll (ENU: Z -> X -> Y, NED: Z -> Y -> X)
- final_rotation = zero_rotation * entity_local_rotation
- entity_local_rotation = final_rotation * inverse(zero_rotation)
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.Unigine uses ENU orientation!
Axis order: Yaw -> Pitch -> Roll (ENU: Z -> X -> Y, NED: Z -> Y -> X)
- final_rotation = zero_rotation * entity_local_rotation
- entity_local_rotation = final_rotation * inverse(zero_rotation)
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
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)