cesium-native 0.44.2
Loading...
Searching...
No Matches
GlobeAnchor.h
1#pragma once
2
3#include <CesiumGeospatial/Ellipsoid.h>
4#include <CesiumGeospatial/Library.h>
5
6#include <glm/mat4x4.hpp>
7
8#include <optional>
9
10namespace CesiumGeospatial {
11
12class LocalHorizontalCoordinateSystem;
13
25class CESIUMGEOSPATIAL_API GlobeAnchor final {
26public:
41 const LocalHorizontalCoordinateSystem& localCoordinateSystem,
42 const glm::dmat4& anchorToLocal);
43
51 static GlobeAnchor
52 fromAnchorToFixedTransform(const glm::dmat4& anchorToFixed);
53
61 explicit GlobeAnchor(const glm::dmat4& anchorToFixed);
62
67 const glm::dmat4& getAnchorToFixedTransform() const;
68
89 const glm::dmat4& newAnchorToFixed,
90 bool adjustOrientation,
91 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
92
98 const LocalHorizontalCoordinateSystem& localCoordinateSystem) const;
99
127 const LocalHorizontalCoordinateSystem& localCoordinateSystem,
128 const glm::dmat4& newAnchorToLocal,
129 bool adjustOrientation,
130 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
131
132private:
133 glm::dmat4 _anchorToFixed;
134};
135
136} // namespace CesiumGeospatial
A quadratic surface defined in Cartesian coordinates.
Definition Ellipsoid.h:39
Anchors an object to the globe by defining a transformation from the object's coordinate to the globe...
Definition GlobeAnchor.h:25
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.
void setAnchorToLocalTransform(const LocalHorizontalCoordinateSystem &localCoordinateSystem, const glm::dmat4 &newAnchorToLocal, bool adjustOrientation, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
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.
void setAnchorToFixedTransform(const glm::dmat4 &newAnchorToFixed, bool adjustOrientation, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Sets the new transformation from the anchor's coordinate system to globe-fixed coordinates.
static GlobeAnchor fromAnchorToFixedTransform(const glm::dmat4 &anchorToFixed)
Creates a new instance from a transformation 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.