3 #include "AxisAlignedBox.h"
4 #include "BoundingSphere.h"
5 #include "CullingResult.h"
8 #include <glm/mat3x3.hpp>
9 #include <glm/vec3.hpp>
35 const glm::dvec3& center,
36 const glm::dmat3& halfAxes) noexcept
40 _inverseHalfAxes(glm::inverse(halfAxes)),
42 2.0 * glm::length(_halfAxes[0]),
43 2.0 * glm::length(_halfAxes[1]),
44 2.0 * glm::length(_halfAxes[2])) {}
49 constexpr
const glm::dvec3&
getCenter() const noexcept {
59 return this->_halfAxes;
67 return this->_inverseHalfAxes;
73 constexpr
const glm::dvec3&
getLengths() const noexcept {
74 return this->_lengths;
109 bool contains(
const glm::dvec3& position)
const noexcept;
119 transform(
const glm::dmat4& transformation)
const noexcept;
145 glm::dmat3 _halfAxes;
146 glm::dmat3 _inverseHalfAxes;
A bounding sphere with a center and a radius.
A bounding volume defined as a closed and convex cuboid with any orientation.
double computeDistanceSquaredToPosition(const glm::dvec3 &position) const noexcept
Computes the distance squared from a given position to the closest point on this bounding volume....
OrientedBoundingBox transform(const glm::dmat4 &transformation) const noexcept
Transforms this bounding box to another coordinate system using a 4x4 matrix.
constexpr const glm::dvec3 & getLengths() const noexcept
Gets the lengths of the box on each local axis respectively.
constexpr const glm::dmat3 & getInverseHalfAxes() const noexcept
Gets the inverse transformation matrix, to rotate from world space to local space relative to the box...
CullingResult intersectPlane(const Plane &plane) const noexcept
Determines on which side of a plane the bounding box is located.
AxisAlignedBox toAxisAligned() const noexcept
Converts this oriented bounding box to an axis-aligned bounding box.
OrientedBoundingBox(const glm::dvec3 ¢er, const glm::dmat3 &halfAxes) noexcept
Constructs a new instance.
constexpr const glm::dvec3 & getCenter() const noexcept
Gets the center of the box.
constexpr const glm::dmat3 & getHalfAxes() const noexcept
Gets the three orthogonal half-axes of the bounding box. Equivalently, the transformation matrix to r...
bool contains(const glm::dvec3 &position) const noexcept
Computes whether the given position is contained within the bounding box.
A plane in Hessian Normal Format.
Basic geometry classes for Cesium.
CullingResult
The result of culling an object.