cesium-native 0.43.0
Loading...
Searching...
No Matches
LocalHorizontalCoordinateSystem.h
1#pragma once
2
3#include "Ellipsoid.h"
4#include "Library.h"
5
6#include <glm/mat4x4.hpp>
7#include <glm/vec3.hpp>
8
9namespace CesiumGeospatial {
10class Cartographic;
11}
12
13namespace CesiumGeospatial {
14
19enum class LocalDirection { East, North, West, South, Up, Down };
20
29class CESIUMGEOSPATIAL_API LocalHorizontalCoordinateSystem {
30public:
48 const Cartographic& origin,
49 LocalDirection xAxisDirection = LocalDirection::East,
50 LocalDirection yAxisDirection = LocalDirection::North,
51 LocalDirection zAxisDirection = LocalDirection::Up,
52 double scaleToMeters = 1.0,
53 // Can't use CESIUM_DEFAULT_ELLIPSOID here because of the other default
54 // parameters
56
74 const glm::dvec3& originEcef,
75 LocalDirection xAxisDirection = LocalDirection::East,
76 LocalDirection yAxisDirection = LocalDirection::North,
77 LocalDirection zAxisDirection = LocalDirection::Up,
78 double scaleToMeters = 1.0,
80
94 explicit LocalHorizontalCoordinateSystem(const glm::dmat4& localToEcef);
95
115 const glm::dmat4& localToEcef,
116 const glm::dmat4& ecefToLocal);
117
124 const glm::dmat4& getLocalToEcefTransformation() const noexcept {
125 return this->_localToEcef;
126 }
127
134 const glm::dmat4& getEcefToLocalTransformation() const noexcept {
135 return this->_ecefToLocal;
136 };
137
146 glm::dvec3
147 localPositionToEcef(const glm::dvec3& localPosition) const noexcept;
148
157 glm::dvec3 ecefPositionToLocal(const glm::dvec3& ecefPosition) const noexcept;
158
170 glm::dvec3
171 localDirectionToEcef(const glm::dvec3& localDirection) const noexcept;
172
184 glm::dvec3
185 ecefDirectionToLocal(const glm::dvec3& ecefDirection) const noexcept;
186
198 const LocalHorizontalCoordinateSystem& target) const noexcept;
199
200private:
201 glm::dmat4 _ecefToLocal;
202 glm::dmat4 _localToEcef;
203};
204
205} // namespace CesiumGeospatial
A position defined by longitude, latitude, and height.
A quadratic surface defined in Cartesian coordinates.
Definition Ellipsoid.h:38
static const Ellipsoid WGS84
An Ellipsoid instance initialized to the WGS84 standard.
Definition Ellipsoid.h:47
A coordinate system created from a local horizontal plane at a particular origin point on the globe.
LocalHorizontalCoordinateSystem(const glm::dmat4 &localToEcef, const glm::dmat4 &ecefToLocal)
Create a new coordinate system with the specified transformations between the local frame and the Ear...
glm::dvec3 ecefDirectionToLocal(const glm::dvec3 &ecefDirection) const noexcept
Converts a direction in the Earth-Centered, Earth-Fixed (ECEF) coordinate system to the local horizon...
const glm::dmat4 & getEcefToLocalTransformation() const noexcept
Gets the transformation matrix from Earth-Centered, Earth-Fixed Coordinates (ECEF) to the local horiz...
glm::dvec3 localPositionToEcef(const glm::dvec3 &localPosition) const noexcept
Converts a position in the local horizontal coordinate system managed by this instance to Earth-Cente...
glm::dvec3 ecefPositionToLocal(const glm::dvec3 &ecefPosition) const noexcept
Converts a position in the Earth-Centered, Earth-Fixed (ECEF) coordinate system to the local horizont...
glm::dvec3 localDirectionToEcef(const glm::dvec3 &localDirection) const noexcept
Converts a direction in the local horizontal coordinate system managed by this instance to Earth-Cent...
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.
const glm::dmat4 & getLocalToEcefTransformation() const noexcept
Gets the transformation matrix from the local horizontal coordinate system managed by this instance t...
LocalHorizontalCoordinateSystem(const glm::dmat4 &localToEcef)
Create a new coordinate system with a specified transformation to the Earth-Centered,...
glm::dmat4 computeTransformationToAnotherLocal(const LocalHorizontalCoordinateSystem &target) const noexcept
Computes the transformation matrix from this local horizontal coordinate system to another one....
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.
Classes for geospatial computations in Cesium.
LocalDirection
A local direction, consisting of the four cardinal directions (North, South, East,...