3DCoatScripting  4.8.31β
You can manage 3DСoat features with help of scripting
coat::scripto::AABB Class Reference

Class for working with an axis aligned bounding box. More...

Public Types

typedef comms::Bounds< float, 3 > bounds_t
 

Public Member Functions

 AABB ()
 Constructor for building an empty box. More...
 
const About & about () const
 
bool operator== (const AABB &) const
 Comparison. More...
 
Vec3 min () const
 Returns a corner with a minimal coord.
 
Vec3 max () const
 Returns a corner with a maximal coord.
 
Vec3 size () const
 Returns a size of box.
 
bool empty () const
 TRUE when box is empty.
 
bool contains (const Vec3 &) const
 Returns TRUE when point lies in this box. More...
 
bool add (const Vec3 &)
 Extends this box by point. Returns TRUE when box was extended. More...
 
AABBtransform (const Mat4 &)
 Transform box by matrix 4 x 4. More...
 
AABB transformCopy (const Mat4 &) const
 

Detailed Description

Class for working with an axis aligned bounding box.

aabb.jpg
Since
4.5.32

Constructor & Destructor Documentation

coat::scripto::AABB::AABB ( )
inline

Constructor for building an empty box.

See Also
empty()

Member Function Documentation

bool coat::scripto::AABB::operator== ( const AABB ) const

Comparison.

AABB a;
AABB b;
...
if (a == b) { ... }
bool coat::scripto::AABB::contains ( const Vec3 ) const

Returns TRUE when point lies in this box.

AABB a;
Vec3 p( 1, 3, 9 );
...
if ( a.contains( p ) ) { ... }
bool coat::scripto::AABB::add ( const Vec3 )

Extends this box by point. Returns TRUE when box was extended.

AABB a;
a.add( Vec3( -10, -30, -90 ) );
a.add( Vec3( 90, 30, 10 ) );
a.add( Vec3( 9, 3, 1 ) );
AABB& coat::scripto::AABB::transform ( const Mat4 )

Transform box by matrix 4 x 4.

AABB a;
Mat4 m;
...
a.transform( m );