A bounding volume defined as a region following the surface of a cylinder between two radius values. Used for creating bounding volumes from 3DTILES_bounding_volume_cylinder
.
More...
#include <CesiumGeometry/BoundingCylinderRegion.h>
|
| BoundingCylinderRegion (const glm::dvec3 &translation, const glm::dquat &rotation, double height, const glm::dvec2 &radialBounds, const glm::dvec2 &angularBounds={ -CesiumUtility::Math::OnePi, CesiumUtility::Math::OnePi}) noexcept |
| Construct a new bounding cylinder region.
|
|
constexpr const glm::dvec3 & | getCenter () const noexcept |
| Gets the center of the cylinder region.
|
|
constexpr const glm::dvec3 & | getTranslation () const noexcept |
| Gets the translation that is applied to the bounding cylinder region.
|
|
constexpr const glm::dquat & | getRotation () const noexcept |
| Gets the rotation that is applied to the bounding cylinder region.
|
|
constexpr double | getHeight () const noexcept |
| Gets the height of the cylinder region.
|
|
constexpr const glm::dvec2 & | getRadialBounds () const noexcept |
| Gets the radial bounds of the cylinder region.
|
|
constexpr const glm::dvec2 & | getAngularBounds () const noexcept |
| Gets the angular bounds of the cylinder region.
|
|
CullingResult | intersectPlane (const Plane &plane) const noexcept |
| Determines on which side of a plane the bounding cylinder is located.
|
|
double | computeDistanceSquaredToPosition (const glm::dvec3 &position) const noexcept |
| Computes the distance squared from a given position to the closest point on the bounding volume. The bounding volume and the position must be expressed in the same coordinate system.
|
|
bool | contains (const glm::dvec3 &position) const noexcept |
| Computes whether the given position is contained within the bounding cylinder.
|
|
BoundingCylinderRegion | transform (const glm::dmat4 &transformation) const noexcept |
| Transforms this bounding cylinder region to another coordinate system using a 4x4 matrix.
|
|
OrientedBoundingBox | toOrientedBoundingBox () const noexcept |
| Converts this bounding cylinder region to an oriented bounding box.
|
|
A bounding volume defined as a region following the surface of a cylinder between two radius values. Used for creating bounding volumes from 3DTILES_bounding_volume_cylinder
.
Note: This uses a OrientedBoundingBox underneath the hood to approximate the result, similar to how CesiumJS approximates cylinders. The output may not be accurate to the actual cylinder itself.
- See also
- OrientedBoundingBox
Definition at line 27 of file BoundingCylinderRegion.h.
◆ BoundingCylinderRegion()
CesiumGeometry::BoundingCylinderRegion::BoundingCylinderRegion |
( |
const glm::dvec3 & | translation, |
|
|
const glm::dquat & | rotation, |
|
|
double | height, |
|
|
const glm::dvec2 & | radialBounds, |
|
|
const glm::dvec2 & | angularBounds = { -CesiumUtility::Math::OnePi, CesiumUtility::Math::OnePi} ) |
|
noexcept |
Construct a new bounding cylinder region.
It is possible for the region to only occupy part of the cylinder, and if that is the case, the region's center may not necessarily equal the translation. Additionally, the rotation is applied at to the reference cylinder at the local origin. In other words, the region is rotated around the whole cylinder's center, and not necessarily its own.
- Parameters
-
translation | The translation applied to the reference cylinder. |
rotation | The rotation applied to the reference cylinder. |
height | The height of the cylinder region along the z-axis. |
radialBounds | The radial bounds of the region, where x is the minimum radius and y is the maximum. |
angularBounds | The angular bounds of the region, where x is the minimum angle and y is the maximum. |
glm::dvec3 translation(1.0, 2.0, 3.0);
glm::dquat rotation(1.0, 0.0, 0.0, 0.0);
double height = 2.0;
glm::dvec2 radialBounds(0.5, 1.0);
glm::dvec2 angularBounds(-Math::PiOverTwo, 0.0);
translation,
rotation,
height,
radialBounds,
angularBounds);
◆ computeDistanceSquaredToPosition()
double CesiumGeometry::BoundingCylinderRegion::computeDistanceSquaredToPosition |
( |
const glm::dvec3 & | position | ) |
const |
|
noexcept |
Computes the distance squared from a given position to the closest point on the bounding volume. The bounding volume and the position must be expressed in the same coordinate system.
- Parameters
-
- Returns
- The estimated distance squared from the bounding cylinder to the point.
◆ contains()
bool CesiumGeometry::BoundingCylinderRegion::contains |
( |
const glm::dvec3 & | position | ) |
const |
|
noexcept |
Computes whether the given position is contained within the bounding cylinder.
- Parameters
-
- Returns
- Whether the position is contained within the bounding cylinder.
◆ getAngularBounds()
const glm::dvec2 & CesiumGeometry::BoundingCylinderRegion::getAngularBounds |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ getCenter()
const glm::dvec3 & CesiumGeometry::BoundingCylinderRegion::getCenter |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ getHeight()
double CesiumGeometry::BoundingCylinderRegion::getHeight |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ getRadialBounds()
const glm::dvec2 & CesiumGeometry::BoundingCylinderRegion::getRadialBounds |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ getRotation()
const glm::dquat & CesiumGeometry::BoundingCylinderRegion::getRotation |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ getTranslation()
const glm::dvec3 & CesiumGeometry::BoundingCylinderRegion::getTranslation |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ intersectPlane()
CullingResult CesiumGeometry::BoundingCylinderRegion::intersectPlane |
( |
const Plane & | plane | ) |
const |
|
noexcept |
Determines on which side of a plane the bounding cylinder is located.
- Parameters
-
plane | The plane to test against. |
- Returns
- The
CullingResult
:
Inside
if the entire cylinder is on the side of the plane the normal is pointing.
Outside
if the entire cylinder is on the opposite side.
Intersecting
if the cylinder intersects the plane.
◆ transform()
BoundingCylinderRegion CesiumGeometry::BoundingCylinderRegion::transform |
( |
const glm::dmat4 & | transformation | ) |
const |
|
noexcept |
Transforms this bounding cylinder region to another coordinate system using a 4x4 matrix.
- Parameters
-
transformation | The transformation. |
- Returns
- The bounding cylinder region in the new coordinate system.
The documentation for this class was generated from the following file: