cesium-native  0.41.0
CesiumGeospatial::LocalHorizontalCoordinateSystem Class Reference

A coordinate system created from a local horizontal plane at a particular origin point on the globe. More...

#include <CesiumGeospatial/LocalHorizontalCoordinateSystem.h>

Public Member Functions

 LocalHorizontalCoordinateSystem (const Cartographic &origin, LocalDirection xAxisDirection=LocalDirection::East, LocalDirection yAxisDirection=LocalDirection::North, LocalDirection zAxisDirection=LocalDirection::Up, double scaleToMeters=1.0, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
 Create a new coordinate system centered at a given longitude, latitude, and ellipsoidal height. More...
 
 LocalHorizontalCoordinateSystem (const glm::dvec3 &originEcef, LocalDirection xAxisDirection=LocalDirection::East, LocalDirection yAxisDirection=LocalDirection::North, LocalDirection zAxisDirection=LocalDirection::Up, double scaleToMeters=1.0, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
 Create a new coordinate system centered at a Earth-Centered, Earth-Fixed position. More...
 
 LocalHorizontalCoordinateSystem (const glm::dmat4 &localToEcef)
 Create a new coordinate system with a specified transformation to the Earth-Centered, Earth-Fixed frame. This is an advanced constructor and should be avoided in most cases. More...
 
 LocalHorizontalCoordinateSystem (const glm::dmat4 &localToEcef, const glm::dmat4 &ecefToLocal)
 Create a new coordinate system with the specified transformations between the local frame and the Earth-Centered, Earth-Fixed frame. This is an advanced constructor and should be avoided in most cases. More...
 
const glm::dmat4 & getLocalToEcefTransformation () const noexcept
 Gets the transformation matrix from the local horizontal coordinate system managed by this instance to the Earth-Centered, Earth-fixed coordinate system. More...
 
const glm::dmat4 & getEcefToLocalTransformation () const noexcept
 Gets the transformation matrix from the Earth-Centered, Earth-Fixed (ECEF) coordinate system to the local horizontal coordinate system managed by this instance. More...
 
glm::dvec3 localPositionToEcef (const glm::dvec3 &localPosition) const noexcept
 Converts a position in the local horizontal coordinate system managed by this instance to Earth-Centered, Earth-Fixed (ECEF). More...
 
glm::dvec3 ecefPositionToLocal (const glm::dvec3 &ecefPosition) const noexcept
 Converts a position in the Earth-Centered, Earth-Fixed (ECEF) coordinate system to the local horizontal coordinate system managed by this instance. More...
 
glm::dvec3 localDirectionToEcef (const glm::dvec3 &localDirection) const noexcept
 Converts a direction in the local horizontal coordinate system managed by this instance to Earth-Centered, Earth-Fixed (ECEF). More...
 
glm::dvec3 ecefDirectionToLocal (const glm::dvec3 &ecefDirection) const noexcept
 Converts a direction in the Earth-Centered, Earth-Fixed (ECEF) coordinate system to the local horizontal coordinate system managed by this instance. More...
 
glm::dmat4 computeTransformationToAnotherLocal (const LocalHorizontalCoordinateSystem &target) const noexcept
 Computes the transformation matrix from this local horizontal coordinate system to another one. For example, if the returned matrix is multiplied with a vector representing a position in this coordinate system, the result will be a new vector representing the position in the target coordinate system. More...
 

Detailed Description

A coordinate system created from a local horizontal plane at a particular origin point on the globe.

Each principal axis in the new coordinate system can be specified to point in a particular compass direction, or it can point up or down. In this way, a right-handed or left-handed coordinate system can be created.

Definition at line 25 of file LocalHorizontalCoordinateSystem.h.

Constructor & Destructor Documentation

◆ LocalHorizontalCoordinateSystem() [1/4]

CesiumGeospatial::LocalHorizontalCoordinateSystem::LocalHorizontalCoordinateSystem ( const Cartographic origin,
LocalDirection  xAxisDirection = LocalDirection::East,
LocalDirection  yAxisDirection = LocalDirection::North,
LocalDirection  zAxisDirection = LocalDirection::Up,
double  scaleToMeters = 1.0,
const Ellipsoid ellipsoid = CesiumGeospatial::Ellipsoid::WGS84 
)

Create a new coordinate system centered at a given longitude, latitude, and ellipsoidal height.

Parameters
originThe origin of the coordinate system.
xAxisDirectionThe local direction in which the X axis points at the origin.
yAxisDirectionThe local direction in which the Y axis points at the origin.
zAxisDirectionThe local direction in which the Z axis points at the origin.
scaleToMetersLocal units are converted to meters by multiplying them by this factor. For example, if the local units are centimeters, this parameter should be 1.0 / 100.0.
ellipsoidThe ellipsoid on which the coordinate system is based.

◆ LocalHorizontalCoordinateSystem() [2/4]

CesiumGeospatial::LocalHorizontalCoordinateSystem::LocalHorizontalCoordinateSystem ( const glm::dvec3 &  originEcef,
LocalDirection  xAxisDirection = LocalDirection::East,
LocalDirection  yAxisDirection = LocalDirection::North,
LocalDirection  zAxisDirection = LocalDirection::Up,
double  scaleToMeters = 1.0,
const Ellipsoid ellipsoid = CesiumGeospatial::Ellipsoid::WGS84 
)

Create a new coordinate system centered at a Earth-Centered, Earth-Fixed position.

Parameters
originEcefThe origin of the coordinate system.
xAxisDirectionThe local direction in which the X axis points at the origin.
yAxisDirectionThe local direction in which the Y axis points at the origin.
zAxisDirectionThe local direction in which the Z axis points at the origin.
scaleToMetersLocal units are converted to meters by multiplying them by this factor. For example, if the local units are centimeters, this parameter should be 1.0 / 100.0.
ellipsoidThe ellipsoid on which the coordinate system is based.

◆ LocalHorizontalCoordinateSystem() [3/4]

CesiumGeospatial::LocalHorizontalCoordinateSystem::LocalHorizontalCoordinateSystem ( const glm::dmat4 &  localToEcef)
explicit

Create a new coordinate system with a specified transformation to the Earth-Centered, Earth-Fixed frame. This is an advanced constructor and should be avoided in most cases.

This constructor can be used to save/restore the state of an instance. It can also be used to create unusual coordinate systems that can't be created by the other constructors, such as coordinate systems where the axes aren't aligned with compass directions.

Parameters
localToEcefThe transformation matrix from this coordinate system to the ECEF frame.

◆ LocalHorizontalCoordinateSystem() [4/4]

CesiumGeospatial::LocalHorizontalCoordinateSystem::LocalHorizontalCoordinateSystem ( const glm::dmat4 &  localToEcef,
const glm::dmat4 &  ecefToLocal 
)

Create a new coordinate system with the specified transformations between the local frame and the Earth-Centered, Earth-Fixed frame. This is an advanced constructor and should be avoided in most cases.

This constructor can be used to save/restore the state of an instance. It can also be used to create unusual coordinate systems that can't be created by the other constructors, such as coordinate systems where the axes aren't aligned with compass directions.

Parameters
localToEcefThe transformation matrix from this coordinate system to the ECEF frame. This must be the inverse of ecefToLocal or behavior is undefined, but this is not enforced.
ecefToLocalThe transformation matrix from the ECEF frame to this coordinate system. This must be the inverse of localToEcef or behavior is undefined, but this is not enforced.

Member Function Documentation

◆ computeTransformationToAnotherLocal()

glm::dmat4 CesiumGeospatial::LocalHorizontalCoordinateSystem::computeTransformationToAnotherLocal ( const LocalHorizontalCoordinateSystem target) const
noexcept

Computes the transformation matrix from this local horizontal coordinate system to another one. For example, if the returned matrix is multiplied with a vector representing a position in this coordinate system, the result will be a new vector representing the position in the target coordinate system.

Parameters
targetThe other local horizontal coordinate system.
Returns
The transformation.

◆ ecefDirectionToLocal()

glm::dvec3 CesiumGeospatial::LocalHorizontalCoordinateSystem::ecefDirectionToLocal ( const glm::dvec3 &  ecefDirection) const
noexcept

Converts a direction in the Earth-Centered, Earth-Fixed (ECEF) coordinate system to the local horizontal coordinate system managed by this instance.

Because the vector is treated as a direction only, the translation portion of the transformation is ignored.

Parameters
ecefDirectionThe direction in the ECEF coordinate system.
Returns
The equivalent direction in the local coordinate system.

◆ ecefPositionToLocal()

glm::dvec3 CesiumGeospatial::LocalHorizontalCoordinateSystem::ecefPositionToLocal ( const glm::dvec3 &  ecefPosition) const
noexcept

Converts a position in the Earth-Centered, Earth-Fixed (ECEF) coordinate system to the local horizontal coordinate system managed by this instance.

Parameters
ecefPositionThe position in the ECEF coordinate system.
Returns
The equivalent position in the local coordinate system.

◆ getEcefToLocalTransformation()

const glm::dmat4& CesiumGeospatial::LocalHorizontalCoordinateSystem::getEcefToLocalTransformation ( ) const
inlinenoexcept

Gets the transformation matrix from the Earth-Centered, Earth-Fixed (ECEF) coordinate system to the local horizontal coordinate system managed by this instance.

Returns
The transformation.

Definition at line 131 of file LocalHorizontalCoordinateSystem.h.

◆ getLocalToEcefTransformation()

const glm::dmat4& CesiumGeospatial::LocalHorizontalCoordinateSystem::getLocalToEcefTransformation ( ) const
inlinenoexcept

Gets the transformation matrix from the local horizontal coordinate system managed by this instance to the Earth-Centered, Earth-fixed coordinate system.

Returns
The transformation.

Definition at line 120 of file LocalHorizontalCoordinateSystem.h.

◆ localDirectionToEcef()

glm::dvec3 CesiumGeospatial::LocalHorizontalCoordinateSystem::localDirectionToEcef ( const glm::dvec3 &  localDirection) const
noexcept

Converts a direction in the local horizontal coordinate system managed by this instance to Earth-Centered, Earth-Fixed (ECEF).

Because the vector is treated as a direction only, the translation portion of the transformation is ignored.

Parameters
localDirectionThe direction in the local coordinate system.
Returns
The equivalent direction in the ECEF coordinate system.

◆ localPositionToEcef()

glm::dvec3 CesiumGeospatial::LocalHorizontalCoordinateSystem::localPositionToEcef ( const glm::dvec3 &  localPosition) const
noexcept

Converts a position in the local horizontal coordinate system managed by this instance to Earth-Centered, Earth-Fixed (ECEF).

Parameters
localPositionThe position in the local coordinate system.
Returns
The equivalent position in the ECEF coordinate system.

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