3 #include "BoundingVolume.h"
6 #include <CesiumGeometry/CullingVolume.h>
7 #include <CesiumGeometry/Plane.h>
8 #include <CesiumGeospatial/Cartographic.h>
9 #include <CesiumGeospatial/Ellipsoid.h>
11 #include <glm/mat3x3.hpp>
12 #include <glm/vec2.hpp>
13 #include <glm/vec3.hpp>
45 const glm::dvec3& position,
46 const glm::dvec3& direction,
48 const glm::dvec2& viewportSize,
49 double horizontalFieldOfView,
50 double verticalFieldOfView,
57 const glm::dvec3&
getPosition() const noexcept {
return this->_position; }
63 const glm::dvec3&
getDirection() const noexcept {
return this->_direction; }
69 const glm::dvec3&
getUp() const noexcept {
return this->_up; }
77 const std::optional<CesiumGeospatial::Cartographic>&
79 return this->_positionCartographic;
86 return this->_viewportSize;
93 return this->_horizontalFieldOfView;
100 return this->_verticalFieldOfView;
159 const glm::dvec3& position,
160 const glm::dvec3& direction,
161 const glm::dvec3& up,
162 const glm::dvec2& viewportSize,
163 double horizontalFieldOfView,
164 double verticalFieldOfView,
165 const std::optional<CesiumGeospatial::Cartographic>& positionCartographic,
168 const glm::dvec3 _position;
169 const glm::dvec3 _direction;
170 const glm::dvec3 _up;
171 const glm::dvec2 _viewportSize;
172 const double _horizontalFieldOfView;
173 const double _verticalFieldOfView;
176 const double _sseDenominator;
177 const std::optional<CesiumGeospatial::Cartographic> _positionCartographic;
The state of the view that is used during the traversal of a tileset.
const glm::dvec3 & getUp() const noexcept
Gets the up direction of the camera in Earth-centered, Earth-fixed coordinates.
const glm::dvec2 & getViewportSize() const noexcept
Gets the size of the viewport in pixels.
const glm::dvec3 & getDirection() const noexcept
Gets the look direction of the camera in Earth-centered, Earth-fixed coordinates.
double getHorizontalFieldOfView() const noexcept
Gets the horizontal field-of-view angle in radians.
double computeDistanceSquaredToBoundingVolume(const BoundingVolume &boundingVolume) const noexcept
Computes the squared distance to the given BoundingVolume.
double computeScreenSpaceError(double geometricError, double distance) const noexcept
Computes the screen space error from a given geometric error.
const std::optional< CesiumGeospatial::Cartographic > & getPositionCartographic() const noexcept
Gets the position of the camera as a longitude / latitude / height.
const glm::dvec3 & getPosition() const noexcept
Gets the position of the camera in Earth-centered, Earth-fixed coordinates.
bool isBoundingVolumeVisible(const BoundingVolume &boundingVolume) const noexcept
Returns whether the given BoundingVolume is visible for this camera.
static ViewState create(const glm::dvec3 &position, const glm::dvec3 &direction, const glm::dvec3 &up, const glm::dvec2 &viewportSize, double horizontalFieldOfView, double verticalFieldOfView, const CesiumGeospatial::Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID)
Creates a new instance of a view state.
double getVerticalFieldOfView() const noexcept
Gets the vertical field-of-view angle in radians.
A quadratic surface defined in Cartesian coordinates.
Classes that implement the 3D Tiles standard.
std::variant< CesiumGeometry::BoundingSphere, CesiumGeometry::OrientedBoundingBox, CesiumGeospatial::BoundingRegion, CesiumGeospatial::BoundingRegionWithLooseFittingHeights, CesiumGeospatial::S2CellBoundingVolume > BoundingVolume
A bounding volume.
A culling volume, defined by four planes.