cesium-native  0.41.0
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 CESIUM_DEFAULT_ELLIPSOID)
 Constructs a new bounding region. More...
 
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. More...
 
double computeDistanceSquaredToPosition (const glm::dvec3 &position, const Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID) const noexcept
 Computes the distance-squared from a position in ellipsoid-centered Cartesian coordinates to the closest point in this bounding region. More...
 
double computeDistanceSquaredToPosition (const Cartographic &position, const Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID) const noexcept
 Computes the distance-squared from a longitude-latitude-height position to the closest point in this bounding region. More...
 
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. More...
 
BoundingRegion computeUnion (const BoundingRegion &other, const CesiumGeospatial::Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID) const noexcept
 Computes the union of this bounding region with another. More...
 

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  CESIUM_DEFAULT_ELLIPSOID 
)

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  CESIUM_DEFAULT_ELLIPSOID 
) 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  CESIUM_DEFAULT_ELLIPSOID 
) 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  CESIUM_DEFAULT_ELLIPSOID 
) const
noexcept

Computes the union of this bounding region with another.

Parameters
otherThe other bounding region.
Returns
The union.

◆ 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: