cesium-native 0.44.2
Loading...
Searching...
No Matches
S2CellBoundingVolume.h
1#pragma once
2
3#include <CesiumGeometry/CullingResult.h>
4#include <CesiumGeometry/Plane.h>
5#include <CesiumGeospatial/BoundingRegion.h>
6#include <CesiumGeospatial/Ellipsoid.h>
7#include <CesiumGeospatial/S2CellID.h>
8
9#include <glm/vec3.hpp>
10
11#include <array>
12#include <span>
13#include <string_view>
14
15namespace CesiumGeospatial {
16
22class CESIUMGEOSPATIAL_API S2CellBoundingVolume final {
23public:
32 const S2CellID& cellID,
33 double minimumHeight,
34 double maximumHeight,
35 const CesiumGeospatial::Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
36
40 const S2CellID& getCellID() const { return this->_cellID; }
41
45 double getMinimumHeight() const noexcept { return this->_minimumHeight; }
46
50 double getMaximumHeight() const noexcept { return this->_maximumHeight; }
51
56 glm::dvec3 getCenter() const noexcept;
57
64 std::span<const glm::dvec3> getVertices() const noexcept;
65
76 CesiumGeometry::CullingResult
77 intersectPlane(const CesiumGeometry::Plane& plane) const noexcept;
78
89 double
90 computeDistanceSquaredToPosition(const glm::dvec3& position) const noexcept;
91
97 std::span<const CesiumGeometry::Plane> getBoundingPlanes() const noexcept;
98
105 computeBoundingRegion(const CesiumGeospatial::Ellipsoid& ellipsoid
106 CESIUM_DEFAULT_ELLIPSOID) const noexcept;
107
108private:
109 S2CellID _cellID;
110 double _minimumHeight;
111 double _maximumHeight;
112 glm::dvec3 _center;
113 std::array<CesiumGeometry::Plane, 6> _boundingPlanes;
114 std::array<glm::dvec3, 8> _vertices;
115};
116
117} // namespace CesiumGeospatial
A bounding volume specified as a longitude/latitude bounding box and a minimum and maximum height.
A quadratic surface defined in Cartesian coordinates.
Definition Ellipsoid.h:39
glm::dvec3 getCenter() const noexcept
Gets the center of this bounding volume in ellipsoid-fixed (ECEF) coordinates.
const S2CellID & getCellID() const
Gets this bounding volume's cell ID.
double getMaximumHeight() const noexcept
Gets the maximum height of the cell.
S2CellBoundingVolume(const S2CellID &cellID, double minimumHeight, double maximumHeight, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Creates a new S2CellBoundingVolume.
double getMinimumHeight() const noexcept
Gets the minimum height of the cell.
A 64-bit unsigned integer that uniquely identifies a cell in the S2 cell decomposition.
Definition S2CellID.h:47
Basic geometry classes for Cesium.
Classes for geospatial computations in Cesium.
STL namespace.