Public Member Functions
-
AxisAlignedBox ()
-
AxisAlignedBox (const vec3 &min, const vec3 &max)
-
const vec3 &getCenter () const
Returns the center of the axis-aligned box.
-
const vec3 &getExtents () const
Returns the extents of the axis-aligned box.
-
vec3getSize () const
Returns the size of the axis-aligned box.
-
vec3getMin () const
Returns the corner of the axis-aligned box with the smallest x, y and z coordinates.
-
vec3getMax () const
Returns the corner of the axis-aligned box with the largest x, y and z coordinates.
-
voidset (const vec3 &min, const vec3 &max)
Construct an axis-aligned box by specifying two opposite corners.
-
voidinclude (const vec3 &point)
Expands the box so that it contains point .
-
voidinclude (const AxisAlignedBox &box)
Expands the box so that it contains box .
-
boolcontains (const vec3 &point) const
Returns
true
if the axis-aligned box contains point . -
boolintersects (const AxisAlignedBox &box) const
Returns
true
if the axis-aligned boxes intersect. -
boolintersects (const ci::Sphere &sphere) const
Returns
true
if the axis-aligned box intersects sphere . -
boolintersects (const Ray &ray) const
Returns
true
if the ray intersects the axis-aligned box. -
intintersect (const Ray &ray, float *min, float *max) const
Performs ray intersections and returns the number of intersections (0, 1 or 2). Returns min and max distance from the ray origin.
-
voidproject (const vec3 &normal, float *min, float *max) const
Given a plane through the origin with normal , returns the minimum and maximum distance to the axis-aligned box.
-
vec3getNegative (const vec3 &normal) const
Given a plane through the origin with normal , returns the corner closest to the plane.
-
vec3getPositive (const vec3 &normal) const
Given a plane through the origin with normal , returns the corner farthest from the plane.
-
voidtransform (const mat4 &transform)
Converts axis-aligned box to another coordinate space.
-
transformed (const mat4 &transform) const
Converts axis-aligned box to another coordinate space.