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/mat4x4.hpp>
12#include <glm/vec2.hpp>
13#include <glm/vec3.hpp>
34 const glm::dvec3& position,
35 const glm::dvec3& direction,
37 const glm::dvec2& viewportSize,
38 double horizontalFieldOfView,
39 double verticalFieldOfView,
59 const glm::dvec3& position,
60 const glm::dvec3& direction,
62 const glm::dvec2& viewportSize,
63 double horizontalFieldOfView,
64 double verticalFieldOfView,
81 const glm::dmat4& viewMatrix,
82 const glm::dmat4& projectionMatrix,
83 const glm::dvec2& viewportSize,
104 const glm::dvec3& position,
105 const glm::dvec3& direction,
106 const glm::dvec3& up,
107 const glm::dvec2& viewportSize,
118 const glm::dvec3&
getPosition() const noexcept {
return this->_position; }
124 const glm::dvec3&
getDirection() const noexcept {
return this->_direction; }
132 this->_viewMatrix[0][1],
133 this->_viewMatrix[1][1],
134 this->_viewMatrix[2][1]};
143 const std::optional<CesiumGeospatial::Cartographic>&
145 return this->_positionCartographic;
152 return this->_viewportSize;
165 double getVerticalFieldOfView() const noexcept;
170 const glm::dmat4& getViewMatrix() const noexcept {
return this->_viewMatrix; }
176 return this->_projectionMatrix;
222 const glm::dvec3 _position;
223 const glm::dvec3 _direction;
224 const glm::dvec2 _viewportSize;
227 const std::optional<CesiumGeospatial::Cartographic> _positionCartographic;
230 const glm::dmat4 _viewMatrix;
231 const glm::dmat4 _projectionMatrix;
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.
ViewState(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.
double getHorizontalFieldOfView() const noexcept
Gets the horizontal field-of-view angle in radians. This is only valid for a symmetric perspective pr...
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 with a symmetric perspective projection.
ViewState(const glm::dmat4 &viewMatrix, const glm::dmat4 &projectionMatrix, const glm::dvec2 &viewportSize, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Creates a new instance of a view state with a general projection, including skewed perspective and or...
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.
const glm::dmat4 & getProjectionMatrix() const noexcept
Gets the projection matrix for the ViewState.
ViewState(const glm::dvec3 &position, const glm::dvec3 &direction, const glm::dvec3 &up, const glm::dvec2 &viewportSize, double left, double right, double bottom, double top, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Creates a new instance of a view state with an orthographic projection.
glm::dvec3 getUp() const noexcept
Gets the up direction 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.
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, CesiumGeometry::BoundingCylinderRegion > BoundingVolume
A bounding volume.
A culling volume, defined by four planes.