Avara3D 0.2.0
C++ API reference
a3d::AABB Struct Reference

Axis-aligned bounding box defined by minimum and maximum corners. More...

#include <a3d/mesh/AABB.h>

Public Member Functions

bool valid () const
 Returns whether min is no greater than max on every axis. More...
 
AABBoperator|= (const AABB &b)
 Expands this box to include b. More...
 
AABBoperator|= (const math::vec3 &p)
 Expands this box to include p. More...
 

Static Public Member Functions

static AABB Zero ()
 Returns a zero-size box at the origin. More...
 
static AABB Invalid ()
 Returns an invalid box suitable as an empty accumulation seed. More...
 
static AABB Union (const AABB &a, const AABB &b)
 Returns the union of a and b, treating invalid bounds as empty. More...
 
static void Expand (AABB &a, const math::vec3 &p)
 Expands a to contain p, initializing invalid bounds to p. More...
 
static math::vec3 Center (const AABB &a)
 Returns the midpoint between a.min and a.max. More...
 

Public Attributes

math::vec3 min
 Minimum corner. More...
 
math::vec3 max
 Maximum corner. More...
 

Detailed Description

Axis-aligned bounding box defined by minimum and maximum corners.

Definition at line 17 of file AABB.h.

Member Function Documentation

◆ Center()

static math::vec3 a3d::AABB::Center ( const AABB a)
static

Returns the midpoint between a.min and a.max.

◆ Expand()

static void a3d::AABB::Expand ( AABB a,
const math::vec3 p 
)
static

Expands a to contain p, initializing invalid bounds to p.

◆ Invalid()

static AABB a3d::AABB::Invalid ( )
static

Returns an invalid box suitable as an empty accumulation seed.

◆ operator|=() [1/2]

AABB & a3d::AABB::operator|= ( const AABB b)

Expands this box to include b.

◆ operator|=() [2/2]

AABB & a3d::AABB::operator|= ( const math::vec3 p)

Expands this box to include p.

◆ Union()

static AABB a3d::AABB::Union ( const AABB a,
const AABB b 
)
static

Returns the union of a and b, treating invalid bounds as empty.

◆ valid()

bool a3d::AABB::valid ( ) const

Returns whether min is no greater than max on every axis.

◆ Zero()

static AABB a3d::AABB::Zero ( )
static

Returns a zero-size box at the origin.

Member Data Documentation

◆ max

math::vec3 a3d::AABB::max

Maximum corner.

Definition at line 50 of file AABB.h.

◆ min

math::vec3 a3d::AABB::min

Minimum corner.

Definition at line 49 of file AABB.h.


The documentation for this struct was generated from the following file: