3#include <Cesium3DTilesSelection/BoundingVolume.h>
4#include <Cesium3DTilesSelection/Library.h>
5#include <CesiumGeometry/CullingVolume.h>
6#include <CesiumGeometry/Plane.h>
7#include <CesiumGeospatial/Cartographic.h>
8#include <CesiumGeospatial/Ellipsoid.h>
10#include <glm/mat3x3.hpp>
11#include <glm/vec2.hpp>
12#include <glm/vec3.hpp>
44 const glm::dvec3& position,
45 const glm::dvec3& direction,
47 const glm::dvec2& viewportSize,
48 double horizontalFieldOfView,
49 double verticalFieldOfView,
56 const glm::dvec3&
getPosition() const noexcept {
return this->_position; }
62 const glm::dvec3&
getDirection() const noexcept {
return this->_direction; }
68 const glm::dvec3&
getUp() const noexcept {
return this->_up; }
76 const std::optional<CesiumGeospatial::Cartographic>&
78 return this->_positionCartographic;
85 return this->_viewportSize;
92 return this->_horizontalFieldOfView;
99 return this->_verticalFieldOfView;
158 const glm::dvec3& position,
159 const glm::dvec3& direction,
160 const glm::dvec3& up,
161 const glm::dvec2& viewportSize,
162 double horizontalFieldOfView,
163 double verticalFieldOfView,
164 const std::optional<CesiumGeospatial::Cartographic>& positionCartographic,
167 const glm::dvec3 _position;
168 const glm::dvec3 _direction;
169 const glm::dvec3 _up;
170 const glm::dvec2 _viewportSize;
171 const double _horizontalFieldOfView;
172 const double _verticalFieldOfView;
175 const double _sseDenominator;
176 const std::optional<CesiumGeospatial::Cartographic> _positionCartographic;
The state of the view that is used during the traversal of a tileset.
const glm::dvec3 & getDirection() const noexcept
Gets the look direction of the camera in Earth-centered, Earth-fixed coordinates.
const glm::dvec3 & getUp() const noexcept
Gets the up 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.
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=CesiumGeospatial::Ellipsoid::WGS84)
Creates a new instance of a view state.
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::dvec2 & getViewportSize() const noexcept
Gets the size of the viewport in pixels.
bool isBoundingVolumeVisible(const BoundingVolume &boundingVolume) const noexcept
Returns whether the given BoundingVolume is visible for this camera.
double getVerticalFieldOfView() const noexcept
Gets the vertical field-of-view angle in radians.
const glm::dvec3 & getPosition() const noexcept
Gets the position of the camera in Earth-centered, Earth-fixed coordinates.
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.