cesium-native  0.41.0
GlobeAnchor.h
1 #pragma once
2 
3 #include "Library.h"
4 
5 #include <CesiumGeospatial/Ellipsoid.h>
6 
7 #include <glm/mat4x4.hpp>
8 
9 #include <optional>
10 
11 namespace CesiumGeospatial {
12 
13 class LocalHorizontalCoordinateSystem;
14 
26 class CESIUMGEOSPATIAL_API GlobeAnchor final {
27 public:
42  const LocalHorizontalCoordinateSystem& localCoordinateSystem,
43  const glm::dmat4& anchorToLocal);
44 
52  static GlobeAnchor
53  fromAnchorToFixedTransform(const glm::dmat4& anchorToFixed);
54 
62  explicit GlobeAnchor(const glm::dmat4& anchorToFixed);
63 
68  const glm::dmat4& getAnchorToFixedTransform() const;
69 
89  const glm::dmat4& newAnchorToFixed,
90  bool adjustOrientation,
91  const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
92 
98  const LocalHorizontalCoordinateSystem& localCoordinateSystem) const;
99 
126  const LocalHorizontalCoordinateSystem& localCoordinateSystem,
127  const glm::dmat4& newAnchorToLocal,
128  bool adjustOrientation,
129  const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
130 
131 private:
132  glm::dmat4 _anchorToFixed;
133 };
134 
135 } // namespace CesiumGeospatial
A quadratic surface defined in Cartesian coordinates.
Definition: Ellipsoid.h:38
Anchors an object to the globe by defining a transformation from the object's coordinate to the globe...
Definition: GlobeAnchor.h:26
static GlobeAnchor fromAnchorToLocalTransform(const LocalHorizontalCoordinateSystem &localCoordinateSystem, const glm::dmat4 &anchorToLocal)
Creates a new instance from a transformation to a local coordinate system.
GlobeAnchor(const glm::dmat4 &anchorToFixed)
Constructs a new instance with a given transformation to the globe-fixed coordinate system.
static GlobeAnchor fromAnchorToFixedTransform(const glm::dmat4 &anchorToFixed)
Creates a new instance from a transformation to the globe-fixed coordinate system.
void setAnchorToFixedTransform(const glm::dmat4 &newAnchorToFixed, bool adjustOrientation, const Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID)
Sets the new transformation from the anchor's coordinate system to globe-fixed coordinates.
void setAnchorToLocalTransform(const LocalHorizontalCoordinateSystem &localCoordinateSystem, const glm::dmat4 &newAnchorToLocal, bool adjustOrientation, const Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID)
Sets the globe-fixed transformation based on a new transformation from anchor coordinates to a local-...
const glm::dmat4 & getAnchorToFixedTransform() const
Gets the transformation from the anchor's coordinate system to the globe-fixed coordinate system.
glm::dmat4 getAnchorToLocalTransform(const LocalHorizontalCoordinateSystem &localCoordinateSystem) const
Gets the transformation from the anchor's coordinate system to the given local-horizontal coordinate ...
A coordinate system created from a local horizontal plane at a particular origin point on the globe.
Classes for geospatial computations in Cesium.