32 bbox(
const vec3& minimum,
const vec3& maximum);
43 bbox(
float xMin,
float yMin,
float zMin,
float xMax,
float yMax,
float zMax);
67 bbox&
from_points(
const char* point_buffer,
unsigned int point_count,
unsigned int point_stride,
bool reset =
true);
106 bool intersect(
const bbox& bounds,
const vec3& tolerance)
const;
116 bool intersect(
const vec3& origin,
const vec3& velocity,
float& t,
bool restrict_range =
true)
const;
126 bool intersect(
const vec3& v0,
const vec3& v1,
const vec3& v2,
const bbox& triangle_bounds)
const;
135 bool intersect(
const vec3& v0,
const vec3& v1,
const vec3& v2)
const;
233 void inflate(
const vec3& amount);
Storage for box vector values and wraps up common functionality.
bbox & add_point(const vec3 &point)
Grows the bounding box based on the point passed.
vec3 max
The maximum vector value of the bounding box.
bbox operator*(float scale) const
Scales the bounding box values by the scalar passed.
void reset()
Resets the bounding box values.
bbox & operator+=(const vec3 &shift)
Moves the bounding box by the vector passed.
bbox & from_points(const char *point_buffer, unsigned int point_count, unsigned int point_stride, bool reset=true)
Calculates the bounding box based on the points specified.
bbox & operator-=(const vec3 &shift)
Moves the bounding box by the vector passed.
bbox & mul(const transform &t)
Transforms an axis aligned bounding box by the specified matrix.
void get_plane_points(volume_plane::e side, vec3 points_out[]) const
Retrieves the four points that form the boundary of the specified side of the bounding box.
void inflate(float amount)
Grows the bounding box by the specified number of world space units on all three axes.
bool operator==(const bbox &bounds) const
Checks for equality between this bounding box and another.
bbox & from_sphere(const vec3 ¢er, float radius)
Calculates the bounding box based on the sphere specified.
bbox & operator*=(const transform &t)
Transforms the bounding box by the matrix passed.
vec3 min
The minimum vector value of the bounding box.
std::array< vec3, 8 > get_corners() const
bool is_degenerate() const
Checks if the bounding box is degenerate (empty)
bbox & mul_no_scale(const transform &t)
bool contains_point(const vec3 &point) const
Tests to see if a point falls within this bounding box or not.
static bbox empty
An empty bounding box.
plane get_plane(volume_plane::e side) const
Retrieves the plane for the specified side of the bounding box.
void validate()
Ensures that the values placed in the min/max values never make the bounding box itself inverted.
bool is_populated() const
Checks if the bounding box is populated.
bool operator!=(const bbox &bounds) const
Checks for inequality between this bounding box and another.
vec3 get_dimensions() const
Returns a vector containing the dimensions of the bounding box.
vec3 get_extents() const
Returns a vector containing the extents of the bounding box (the half-dimensions)
vec3 closest_point(const vec3 &source_point) const
Computes the closest point on the surface of the AABB to the input point.
vec3 get_center() const
Returns a vector containing the exact center point of the box.
bbox()
Default Constructor.
Storage for infinite plane.