Data Structures | Functions | Variables
AtBBox API

Bounding box creation and manipulation. More...

Data Structures

struct  AtBBox
 3D axis-aligned bounding box (uses single-precision) More...
 
struct  AtBBox2
 2D axis-aligned bounding box (uses integers) More...
 

Functions

AI_DEVICE AtBBox::AtBBox (const AtVector &mn, const AtVector &mx)
 
AI_DEVICE AtBBox::AtBBox (const AtVector &p0, const AtVector &p1, const AtVector &p2)
 Compute the bbox of a triangle.
 
AI_DEVICE void AtBBox::addSlack (float slack)
 Expand a bounding box with some safety slack volume.
 
void AtBBox::init ()
 Initialize a bounding box to be empty.
 
void AtBBox::expand (const AtVector &v)
 Expand a bounding box with a point.
 
AI_DEVICE bool AtBBox::inside (const AtVector &p) const
 Check to see if the specified point is inside the bbox.
 
float AtBBox::volume () const
 Compute the volume of a bbox.
 
bool AtBBox::isEmpty () const
 Returns whether or not the specified box is empty.
 
float AtBBox::halfArea () const
 Compute half the surface area of a bbox.
 
float AtBBox::area () const
 Compute the surface area of a bbox.
 
AI_DEVICE AtVector AtBBox::center () const
 Compute the center of a bbox.
 
AtBBox AiBBoxUnion (const AtBBox &b1, const AtBBox &b2)
 Compute the "union" of two bboxes. More...
 
AtBBox AiBBoxIntersection (const AtBBox &b1, const AtBBox &b2)
 Compute the intersection of two bboxes.
 
AtBBox AiBBoxLerp (float k, const AtBBox &lo, const AtBBox &hi)
 Linear interpolation between two bboxes (k=0 -> bbox=lo, k=1 -> bbox=hi)
 
constexpr AtBBox2::AtBBox2 (int min_x, int min_y, int max_x, int max_y)
 
constexpr int AtBBox2::AiBBox2Area () const
 Compute the area (# of pixels) of an integer bbox.
 

Variables

AtVector AtBBox::min
 
AtVector AtBBox::max
 
int AtBBox2::minx
 
int AtBBox2::miny
 
int AtBBox2::maxx
 
int AtBBox2::maxy
 

Detailed Description

Bounding box creation and manipulation.

The AtBBox class is implemented as a 3D axis-aligned bounding box, using single precision for its internal storage and operation.

Function Documentation

◆ AiBBoxUnion()

AtBBox AiBBoxUnion ( const AtBBox b1,
const AtBBox b2 
)
inline

Compute the "union" of two bboxes.

Note
this name is misleading since it's the bbox of bboxes, not the union (which can be disjoint)

© 2023 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com