14 static float const oo;
52 bool inside(glm::vec3 point);
Represents a bounding box.
Definition: boundingBox.h:13
static BoundingBox mergeBox(const BoundingBox &a, const BoundingBox &b)
Compute a BoundingBox that is the union of the two input boxes.
Definition: boundingBox.cpp:83
static BoundingBox pointBox(const glm::vec3 &point)
Create a bounding box containing only one point.
Definition: boundingBox.cpp:111
static BoundingBox getExtremeBound()
Get a special invalid BoundingBox used as a starting point for mergeBox and confineBox....
Definition: boundingBox.cpp:117
static float const oo
infinity value. No bounding box's absolute value in any dimension can exceed this.
Definition: boundingBox.h:14
bool intersectWith(const BoundingBox &other)
Determines if a BoundingBox intersects with another.
Definition: boundingBox.cpp:76
float surfaceArea()
Compute the surface area of the BoundinBox.
Definition: boundingBox.cpp:53
bool inside(glm::vec3 point)
Determins if a point is inside of the bounding box.
Definition: boundingBox.cpp:22
glm::vec3 centroid()
Compute the centroid of the BoundingBox.
Definition: boundingBox.cpp:14
glm::vec3 bounds[2]
coordinates of the lower-left and upper-right corners of the bounding box, respectively.
Definition: boundingBox.h:16
float volume()
Compute the volume of the BoundingBox.
Definition: boundingBox.cpp:29
bool collidesWithRay(glm::vec4 point, glm::vec4 dir)
Determine if the BoundingBox collide with a ray.
Definition: boundingBox.cpp:64
glm::vec3 size()
Compute the size of the BoundingBox.
Definition: boundingBox.cpp:18
float lowerBoundSquareDistanceTo(const glm::vec3 point)
Compute the Lower-Bound squared distance from a point to the BoundingBox.
Definition: boundingBox.cpp:42
std::optional< float > findCollisionWithRay(glm::vec4 point, glm::vec4 dir)
Find the point of collision between a ray and the BoundingBox.
Definition: boundingBox.cpp:68
std::optional< float > findCollisionWithBox(glm::vec3 centroid, glm::vec3 dir, glm::vec3 size)
Find the collision between a moving bounding box and this one.
Definition: boundingBox.cpp:72
static BoundingBox confineBox(const BoundingBox &a, const BoundingBox &b)
Confine a BoundingBox within the other, effectively computing their intersection.
Definition: boundingBox.cpp:97