cesium-native 0.43.0
Loading...
Searching...
No Matches
CesiumGeospatial::BoundingRegion Class Referencefinal

A bounding volume specified as a longitude/latitude bounding box and a minimum and maximum height. More...

#include <CesiumGeospatial/BoundingRegion.h>

Public Member Functions

 BoundingRegion (const GlobeRectangle &rectangle, double minimumHeight, double maximumHeight, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
 Constructs a new bounding region.
 
const GlobeRectanglegetRectangle () const noexcept
 Gets the bounding rectangle of the region.
 
double getMinimumHeight () const noexcept
 Gets the minimum height of the region.
 
double getMaximumHeight () const noexcept
 Gets the maximum height of the region.
 
const CesiumGeometry::OrientedBoundingBoxgetBoundingBox () const noexcept
 Gets an oriented bounding box containing this region.
 
CesiumGeometry::CullingResult intersectPlane (const CesiumGeometry::Plane &plane) const noexcept
 Determines on which side of a plane the bounding region is located.
 
double computeDistanceSquaredToPosition (const glm::dvec3 &position, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84) const noexcept
 Computes the distance-squared from a position in ellipsoid-centered Cartesian coordinates to the closest point in this bounding region.
 
double computeDistanceSquaredToPosition (const Cartographic &position, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84) const noexcept
 Computes the distance-squared from a longitude-latitude-height position to the closest point in this bounding region.
 
double computeDistanceSquaredToPosition (const Cartographic &cartographicPosition, const glm::dvec3 &cartesianPosition) const noexcept
 Computes the distance-squared from a position to the closest point in this bounding region, when the longitude-latitude-height and ellipsoid-centered Cartesian coordinates of the position are both already known.
 
BoundingRegion computeUnion (const BoundingRegion &other, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84) const noexcept
 Computes the union of this bounding region with another.
 

Detailed Description

A bounding volume specified as a longitude/latitude bounding box and a minimum and maximum height.

Definition at line 22 of file BoundingRegion.h.

Constructor & Destructor Documentation

◆ BoundingRegion()

CesiumGeospatial::BoundingRegion::BoundingRegion ( const GlobeRectangle & rectangle,
double minimumHeight,
double maximumHeight,
const Ellipsoid & ellipsoid = CesiumGeospatial::Ellipsoid::WGS84 )

Constructs a new bounding region.

Parameters
rectangleThe bounding rectangle of the region.
minimumHeightThe minimum height in meters.
maximumHeightThe maximum height in meters.
ellipsoidThe ellipsoid on which this region is defined.

Member Function Documentation

◆ computeDistanceSquaredToPosition() [1/3]

double CesiumGeospatial::BoundingRegion::computeDistanceSquaredToPosition ( const Cartographic & cartographicPosition,
const glm::dvec3 & cartesianPosition ) const
noexcept

Computes the distance-squared from a position to the closest point in this bounding region, when the longitude-latitude-height and ellipsoid-centered Cartesian coordinates of the position are both already known.

Parameters
cartographicPositionThe position as a longitude-latitude-height.
cartesianPositionThe position as ellipsoid-centered Cartesian coordinates.
Returns
The distance-squared from the position to the closest point in the bounding region.

◆ computeDistanceSquaredToPosition() [2/3]

double CesiumGeospatial::BoundingRegion::computeDistanceSquaredToPosition ( const Cartographic & position,
const Ellipsoid & ellipsoid = CesiumGeospatial::Ellipsoid::WGS84 ) const
noexcept

Computes the distance-squared from a longitude-latitude-height position to the closest point in this bounding region.

Parameters
positionThe position.
ellipsoidThe ellipsoid on which this region is defined.
Returns
The distance-squared from the position to the closest point in the bounding region.

◆ computeDistanceSquaredToPosition() [3/3]

double CesiumGeospatial::BoundingRegion::computeDistanceSquaredToPosition ( const glm::dvec3 & position,
const Ellipsoid & ellipsoid = CesiumGeospatial::Ellipsoid::WGS84 ) const
noexcept

Computes the distance-squared from a position in ellipsoid-centered Cartesian coordinates to the closest point in this bounding region.

If the position cannot be converted into cartograpic coordinates for the given ellipsoid (because it is close to the center of the ellipsoid), then this function will return the squared distance between the given position and the closest point of the bounding box that is enclosed in this region.

Parameters
positionThe position.
ellipsoidThe ellipsoid on which this region is defined.
Returns
The distance-squared from the position to the closest point in the bounding region.

◆ computeUnion()

BoundingRegion CesiumGeospatial::BoundingRegion::computeUnion ( const BoundingRegion & other,
const CesiumGeospatial::Ellipsoid & ellipsoid = CesiumGeospatial::Ellipsoid::WGS84 ) const
noexcept

Computes the union of this bounding region with another.

Parameters
otherThe other bounding region.
ellipsoidThe CesiumGeospatial::Ellipsoid.
Returns
The union.

◆ getBoundingBox()

const CesiumGeometry::OrientedBoundingBox & CesiumGeospatial::BoundingRegion::getBoundingBox ( ) const
inlinenoexcept

Gets an oriented bounding box containing this region.

Definition at line 58 of file BoundingRegion.h.

◆ getMaximumHeight()

double CesiumGeospatial::BoundingRegion::getMaximumHeight ( ) const
inlinenoexcept

Gets the maximum height of the region.

Definition at line 53 of file BoundingRegion.h.

◆ getMinimumHeight()

double CesiumGeospatial::BoundingRegion::getMinimumHeight ( ) const
inlinenoexcept

Gets the minimum height of the region.

Definition at line 48 of file BoundingRegion.h.

◆ getRectangle()

const GlobeRectangle & CesiumGeospatial::BoundingRegion::getRectangle ( ) const
inlinenoexcept

Gets the bounding rectangle of the region.

Definition at line 41 of file BoundingRegion.h.

◆ intersectPlane()

CesiumGeometry::CullingResult CesiumGeospatial::BoundingRegion::intersectPlane ( const CesiumGeometry::Plane & plane) const
noexcept

Determines on which side of a plane the bounding region is located.

Parameters
planeThe plane to test against.
Returns
The CesiumGeometry::CullingResult
  • Inside if the entire region is on the side of the plane the normal is pointing.
  • Outside if the entire region is on the opposite side.
  • Intersecting if the region intersects the plane.

The documentation for this class was generated from the following file: