Cesium for Unreal 2.12.0
Loading...
Searching...
No Matches
GeoTransforms Class Reference

A lightweight structure to encapsulate coordinate transforms. More...

#include <GeoTransforms.h>

Public Member Functions

 GeoTransforms ()
 Creates a new instance.
 
 GeoTransforms (const CesiumGeospatial::Ellipsoid &ellipsoid, const glm::dvec3 &center, double scale)
 Creates a new instance.
 
void setCenter (const glm::dvec3 &center) noexcept
 Set the center position of this instance.
 
void setEllipsoid (const CesiumGeospatial::Ellipsoid &ellipsoid) noexcept
 Set the ellipsoid of this instance.
 
glm::dvec3 TransformLongitudeLatitudeHeightToEcef (const glm::dvec3 &LongitudeLatitudeHeight) const noexcept
 Transforms the given longitude in degrees (x), latitude in degrees (y), and height in meters (z) into Earth-Centered, Earth-Fixed (ECEF) coordinates.
 
glm::dvec3 TransformEcefToLongitudeLatitudeHeight (const glm::dvec3 &Ecef) const noexcept
 Transforms the given Earth-Centered, Earth-Fixed (ECEF) coordinates into longitude in degrees (x), latitude in degrees (y), and height in meters (z).
 
glm::dvec3 TransformLongitudeLatitudeHeightToUnreal (const glm::dvec3 &origin, const glm::dvec3 &LongitudeLatitudeHeight) const noexcept
 Transforms the given longitude in degrees (x), latitude in degrees (y), and height in meters (z) into Unreal world coordinates (relative to the floating origin).
 
glm::dvec3 TransformUnrealToLongitudeLatitudeHeight (const glm::dvec3 &origin, const glm::dvec3 &Ue) const noexcept
 Transforms Unreal world coordinates (relative to the floating origin) into longitude in degrees (x), latitude in degrees (y), and height in meters (z).
 
glm::dvec3 TransformEcefToUnreal (const glm::dvec3 &origin, const glm::dvec3 &Ecef) const noexcept
 Transforms the given point from Earth-Centered, Earth-Fixed (ECEF) into Unreal world coordinates (relative to the floating origin).
 
glm::dvec3 TransformUnrealToEcef (const glm::dvec3 &origin, const glm::dvec3 &Ue) const noexcept
 Transforms the given point from Unreal world coordinates (relative to the floating origin) to Earth-Centered, Earth-Fixed (ECEF).
 
glm::dquat TransformRotatorUnrealToEastSouthUp (const glm::dvec3 &origin, const glm::dquat &UeRotator, const glm::dvec3 &UeLocation) const noexcept
 Transforms a rotator from Unreal world to East-South-Up at the given Unreal relative world location (relative to the floating origin).
 
glm::dquat TransformRotatorEastSouthUpToUnreal (const glm::dvec3 &origin, const glm::dquat &EnuRotator, const glm::dvec3 &UeLocation) const noexcept
 Transforms a rotator from East-South-Up to Unreal world at the given Unreal world location (relative to the floating origin).
 
glm::dmat4 ComputeEastSouthUpToUnreal (const glm::dvec3 &origin, const glm::dvec3 &Ue) const noexcept
 Computes the rotation matrix from the local East-South-Up to Unreal at the specified Unreal world location (relative to the floating origin).
 
glm::dmat3 ComputeEastNorthUpToEcef (const glm::dvec3 &Ecef) const noexcept
 Computes the rotation matrix from the local East-North-Up to Earth-Centered, Earth-Fixed (ECEF) at the specified ECEF location.
 
const glm::dmat4 & GetAbsoluteUnrealWorldToEllipsoidCenteredTransform () const noexcept
 Gets the transformation from the absolute "Unreal World" reference frame to the "Ellipsoid-centered" reference frame (i.e.
 
const glm::dmat4 & GetEllipsoidCenteredToAbsoluteUnrealWorldTransform () const noexcept
 Gets the transformation from the "Ellipsoid-centered" reference frame (i.e.
 
glm::dvec3 ComputeGeodeticSurfaceNormal (const glm::dvec3 &position) const
 Computes the normal of the plane tangent to the surface of the ellipsoid that is used by this instance, at the provided position.
 
glm::dquat ComputeSurfaceNormalRotation (const glm::dvec3 &oldPosition, const glm::dvec3 &newPosition) const
 Computes the rotation in ellipsoid surface normal between an old position and a new position.
 
glm::dquat ComputeSurfaceNormalRotationUnreal (const glm::dvec3 &oldPosition, const glm::dvec3 &newPosition) const
 Computes the rotation in ellipsoid surface normal between an old position and a new position.
 
const FMatrix & GetEllipsoidCenteredToAbsoluteUnrealWorldMatrix () const
 
const FMatrix & GetAbsoluteUnrealWorldToEllipsoidCenteredMatrix () const
 

Detailed Description

A lightweight structure to encapsulate coordinate transforms.

It encapsulates the conversions between...

  • Earth-Centered, Earth-Fixed (ECEF) coordinates
  • Georeferenced coordinates (Latitude/Longitude/Height)
  • Unreal coordinates (relative to the unreal world origin)

Definition at line 21 of file GeoTransforms.h.

Constructor & Destructor Documentation

◆ GeoTransforms() [1/2]

GeoTransforms::GeoTransforms ( )

Creates a new instance.

◆ GeoTransforms() [2/2]

GeoTransforms::GeoTransforms ( const CesiumGeospatial::Ellipsoid & ellipsoid,
const glm::dvec3 & center,
double scale )

Creates a new instance.

The center position is the position of the origin of the local coordinate system that is established by this instance.

Parameters
ellipsoidThe ellipsoid to use for the georeferenced coordinates
centerThe center position.
scaleThe scale factor of the globe in the Unreal world.

Member Function Documentation

◆ ComputeEastNorthUpToEcef()

glm::dmat3 GeoTransforms::ComputeEastNorthUpToEcef ( const glm::dvec3 & Ecef) const
noexcept

Computes the rotation matrix from the local East-North-Up to Earth-Centered, Earth-Fixed (ECEF) at the specified ECEF location.

◆ ComputeEastSouthUpToUnreal()

glm::dmat4 GeoTransforms::ComputeEastSouthUpToUnreal ( const glm::dvec3 & origin,
const glm::dvec3 & Ue ) const
noexcept

Computes the rotation matrix from the local East-South-Up to Unreal at the specified Unreal world location (relative to the floating origin).

The returned transformation works in Unreal's left-handed coordinate system.

◆ ComputeGeodeticSurfaceNormal()

glm::dvec3 GeoTransforms::ComputeGeodeticSurfaceNormal ( const glm::dvec3 & position) const
inline

Computes the normal of the plane tangent to the surface of the ellipsoid that is used by this instance, at the provided position.

Parameters
positionThe cartesian position for which to to determine the surface normal.
Returns
The normal.

Definition at line 185 of file GeoTransforms.h.

◆ ComputeSurfaceNormalRotation()

glm::dquat GeoTransforms::ComputeSurfaceNormalRotation ( const glm::dvec3 & oldPosition,
const glm::dvec3 & newPosition ) const

Computes the rotation in ellipsoid surface normal between an old position and a new position.

This rotation is expressed in terms of Unreal world coordinates, and can be used to maintain an object's orientation relative to the local horizontal as it moves over the globe.

Parameters
oldPositionThe old ECEF position that the object moved from.
newPositionThe new ECEF position that the object moved to.
Returns
The rotation from the ellipsoid surface normal at the old position to the ellipsoid surface normal at the new position.

◆ ComputeSurfaceNormalRotationUnreal()

glm::dquat GeoTransforms::ComputeSurfaceNormalRotationUnreal ( const glm::dvec3 & oldPosition,
const glm::dvec3 & newPosition ) const

Computes the rotation in ellipsoid surface normal between an old position and a new position.

This rotation is expressed in terms of Unreal world coordinates, and can be used to maintain an object's orientation relative to the local horizontal as it moves over the globe.

Parameters
oldPositionThe old ECEF position that the object moved from.
newPositionThe new ECEF position that the object moved to.
Returns
The rotation from the ellipsoid surface normal at the old position to the ellipsoid surface normal at the new position.

◆ GetAbsoluteUnrealWorldToEllipsoidCenteredMatrix()

const FMatrix & GeoTransforms::GetAbsoluteUnrealWorldToEllipsoidCenteredMatrix ( ) const
inline

Definition at line 222 of file GeoTransforms.h.

◆ GetAbsoluteUnrealWorldToEllipsoidCenteredTransform()

const glm::dmat4 & GeoTransforms::GetAbsoluteUnrealWorldToEllipsoidCenteredTransform ( ) const
inlinenoexcept

Gets the transformation from the absolute "Unreal World" reference frame to the "Ellipsoid-centered" reference frame (i.e.

ECEF).

Gets a matrix that transforms coordinates from the absolute "Unreal World" reference frame (with respect to the absolute world origin, not the floating origin) to the "Ellipsoid-centered" reference frame (which is usually Earth-centered, Earth-fixed). See reference-frames.md.

Definition at line 159 of file GeoTransforms.h.

◆ GetEllipsoidCenteredToAbsoluteUnrealWorldMatrix()

const FMatrix & GeoTransforms::GetEllipsoidCenteredToAbsoluteUnrealWorldMatrix ( ) const
inline

Definition at line 219 of file GeoTransforms.h.

◆ GetEllipsoidCenteredToAbsoluteUnrealWorldTransform()

const glm::dmat4 & GeoTransforms::GetEllipsoidCenteredToAbsoluteUnrealWorldTransform ( ) const
inlinenoexcept

Gets the transformation from the "Ellipsoid-centered" reference frame (i.e.

ECEF) to the absolute "Unreal World" reference frame.

Gets a matrix that transforms coordinates from the "Ellipsoid-centered" reference frame (which is usually Earth-centered, Earth-fixed) to the absolute "Unreal world" reference frame (with respect to the absolute world origin, not the floating origin). See reference-frames.md.

Definition at line 173 of file GeoTransforms.h.

◆ setCenter()

void GeoTransforms::setCenter ( const glm::dvec3 & center)
noexcept

Set the center position of this instance.

The center position is the position of the origin of the local coordinate system that is established by this instance.

Parameters
centerThe center position.

◆ setEllipsoid()

void GeoTransforms::setEllipsoid ( const CesiumGeospatial::Ellipsoid & ellipsoid)
noexcept

Set the ellipsoid of this instance.

Parameters
ellipsoidThe ellipsoid

◆ TransformEcefToLongitudeLatitudeHeight()

glm::dvec3 GeoTransforms::TransformEcefToLongitudeLatitudeHeight ( const glm::dvec3 & Ecef) const
noexcept

Transforms the given Earth-Centered, Earth-Fixed (ECEF) coordinates into longitude in degrees (x), latitude in degrees (y), and height in meters (z).

◆ TransformEcefToUnreal()

glm::dvec3 GeoTransforms::TransformEcefToUnreal ( const glm::dvec3 & origin,
const glm::dvec3 & Ecef ) const
noexcept

Transforms the given point from Earth-Centered, Earth-Fixed (ECEF) into Unreal world coordinates (relative to the floating origin).

◆ TransformLongitudeLatitudeHeightToEcef()

glm::dvec3 GeoTransforms::TransformLongitudeLatitudeHeightToEcef ( const glm::dvec3 & LongitudeLatitudeHeight) const
noexcept

Transforms the given longitude in degrees (x), latitude in degrees (y), and height in meters (z) into Earth-Centered, Earth-Fixed (ECEF) coordinates.

◆ TransformLongitudeLatitudeHeightToUnreal()

glm::dvec3 GeoTransforms::TransformLongitudeLatitudeHeightToUnreal ( const glm::dvec3 & origin,
const glm::dvec3 & LongitudeLatitudeHeight ) const
noexcept

Transforms the given longitude in degrees (x), latitude in degrees (y), and height in meters (z) into Unreal world coordinates (relative to the floating origin).

◆ TransformRotatorEastSouthUpToUnreal()

glm::dquat GeoTransforms::TransformRotatorEastSouthUpToUnreal ( const glm::dvec3 & origin,
const glm::dquat & EnuRotator,
const glm::dvec3 & UeLocation ) const
noexcept

Transforms a rotator from East-South-Up to Unreal world at the given Unreal world location (relative to the floating origin).

◆ TransformRotatorUnrealToEastSouthUp()

glm::dquat GeoTransforms::TransformRotatorUnrealToEastSouthUp ( const glm::dvec3 & origin,
const glm::dquat & UeRotator,
const glm::dvec3 & UeLocation ) const
noexcept

Transforms a rotator from Unreal world to East-South-Up at the given Unreal relative world location (relative to the floating origin).

◆ TransformUnrealToEcef()

glm::dvec3 GeoTransforms::TransformUnrealToEcef ( const glm::dvec3 & origin,
const glm::dvec3 & Ue ) const
noexcept

Transforms the given point from Unreal world coordinates (relative to the floating origin) to Earth-Centered, Earth-Fixed (ECEF).

◆ TransformUnrealToLongitudeLatitudeHeight()

glm::dvec3 GeoTransforms::TransformUnrealToLongitudeLatitudeHeight ( const glm::dvec3 & origin,
const glm::dvec3 & Ue ) const
noexcept

Transforms Unreal world coordinates (relative to the floating origin) into longitude in degrees (x), latitude in degrees (y), and height in meters (z).


The documentation for this class was generated from the following file: