cesium-native 0.44.2
Loading...
Searching...
No Matches
EllipsoidTangentPlane.h
1#pragma once
2
3#include <CesiumGeometry/Plane.h>
4#include <CesiumGeospatial/Ellipsoid.h>
5#include <CesiumGeospatial/Library.h>
6
7#include <glm/fwd.hpp>
8#include <glm/vec2.hpp>
9#include <glm/vec3.hpp>
10
11namespace CesiumGeospatial {
12
19class CESIUMGEOSPATIAL_API EllipsoidTangentPlane final {
20public:
30 const glm::dvec3& origin,
31 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
32
41 const glm::dmat4& eastNorthUpToFixedFrame,
42 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
43
47 const Ellipsoid& getEllipsoid() const noexcept { return this->_ellipsoid; }
48
52 const glm::dvec3& getOrigin() const noexcept { return this->_origin; }
53
57 const glm::dvec3& getXAxis() const noexcept { return this->_xAxis; }
58
62 const glm::dvec3& getYAxis() const noexcept { return this->_yAxis; }
63
67 const glm::dvec3& getZAxis() const noexcept {
68 return this->_plane.getNormal();
69 }
70
75 const CesiumGeometry::Plane& getPlane() const noexcept {
76 return this->_plane;
77 }
78
91 glm::dvec2
92 projectPointToNearestOnPlane(const glm::dvec3& cartesian) const noexcept;
93
94private:
100 static glm::dmat4 computeEastNorthUpToFixedFrame(
101 const glm::dvec3& origin,
102 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
103
104 Ellipsoid _ellipsoid;
105 glm::dvec3 _origin;
106 glm::dvec3 _xAxis;
107 glm::dvec3 _yAxis;
109};
110
111} // namespace CesiumGeospatial
A plane in Hessian Normal Format.
Definition Plane.h:12
A plane tangent to an Ellipsoid at a certain origin position.
EllipsoidTangentPlane(const glm::dmat4 &eastNorthUpToFixedFrame, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Creates a new instance.
const glm::dvec3 & getOrigin() const noexcept
Returns the origin, in cartesian coordinates.
const Ellipsoid & getEllipsoid() const noexcept
Returns the Ellipsoid.
glm::dvec2 projectPointToNearestOnPlane(const glm::dvec3 &cartesian) const noexcept
Computes the position of the projection of the given point on this plane.
const glm::dvec3 & getYAxis() const noexcept
Returns the y-axis of this plane.
EllipsoidTangentPlane(const glm::dvec3 &origin, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Creates a new instance.
const CesiumGeometry::Plane & getPlane() const noexcept
Returns a CesiumGeometry::Plane representation of this plane.
const glm::dvec3 & getZAxis() const noexcept
Returns the z-axis (i.e. the normal) of this plane.
const glm::dvec3 & getXAxis() const noexcept
Returns the x-axis of this plane.
A quadratic surface defined in Cartesian coordinates.
Definition Ellipsoid.h:39
Classes for geospatial computations in Cesium.