cesium-native  0.41.0
SimplePlanarEllipsoidCurve.h
1 #pragma once
2 
3 #include "Library.h"
4 
5 #include <CesiumGeospatial/Ellipsoid.h>
6 
7 #include <glm/vec3.hpp>
8 
9 #include <optional>
10 
11 namespace CesiumGeospatial {
12 
19 class CESIUMGEOSPATIAL_API SimplePlanarEllipsoidCurve final {
20 public:
38  static std::optional<SimplePlanarEllipsoidCurve>
40  const Ellipsoid& ellipsoid,
41  const glm::dvec3& sourceEcef,
42  const glm::dvec3& destinationEcef);
43 
61  static std::optional<SimplePlanarEllipsoidCurve> fromLongitudeLatitudeHeight(
62  const Ellipsoid& ellipsoid,
63  const Cartographic& source,
64  const Cartographic& destination);
65 
80  glm::dvec3
81  getPosition(double percentage, double additionalHeight = 0.0) const;
82 
83 private:
85  const Ellipsoid& ellipsoid,
86  const glm::dvec3& scaledSourceEcef,
87  const glm::dvec3& scaledDestinationEcef,
88  const glm::dvec3& originalSourceEcef,
89  const glm::dvec3& originalDestinationEcef);
90 
91  double _totalAngle;
92  double _sourceHeight;
93  double _destinationHeight;
94 
95  Ellipsoid _ellipsoid;
96  glm::dvec3 _sourceDirection;
97  glm::dvec3 _rotationAxis;
98  glm::dvec3 _sourceEcef;
99  glm::dvec3 _destinationEcef;
100 };
101 
102 } // namespace CesiumGeospatial
A position defined by longitude, latitude, and height.
Definition: Cartographic.h:12
A quadratic surface defined in Cartesian coordinates.
Definition: Ellipsoid.h:38
Produces points on an ellipse that lies on a plane that intersects the center of the earth and each o...
glm::dvec3 getPosition(double percentage, double additionalHeight=0.0) const
Samples the curve at the given percentage of its length.
static std::optional< SimplePlanarEllipsoidCurve > fromEarthCenteredEarthFixedCoordinates(const Ellipsoid &ellipsoid, const glm::dvec3 &sourceEcef, const glm::dvec3 &destinationEcef)
Creates a new instance of SimplePlanarEllipsoidCurve from a source and destination specified in Earth...
static std::optional< SimplePlanarEllipsoidCurve > fromLongitudeLatitudeHeight(const Ellipsoid &ellipsoid, const Cartographic &source, const Cartographic &destination)
Creates a new instance of SimplePlanarEllipsoidCurve from a source and destination specified in carto...
Classes for geospatial computations in Cesium.