cocos2d-x  3.5
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AABB Class Reference

Axis Aligned Bounding Box (AABB), usually caculate some rough but fast collision detection. More...

#include <CCAABB.h>

Public Member Functions

 AABB ()
 Constructor. More...
 
 AABB (const Vec3 &min, const Vec3 &max)
 Constructor. More...
 
 AABB (const AABB &box)
 Constructor. More...
 
Vec3 getCenter ()
 Gets the center point of the bounding box. More...
 
void getCorners (Vec3 *dst) const
bool intersects (const AABB &aabb) const
 Tests whether this bounding box intersects the specified bounding object. More...
 
bool containPoint (const Vec3 &point) const
 check whether the point is in. More...
 
void merge (const AABB &box)
 Sets this bounding box to the smallest bounding box that contains both this bounding object and the specified bounding box. More...
 
void set (const Vec3 &min, const Vec3 &max)
 Sets this bounding box to the specified values. More...
 
void reset ()
 Reset min and max value.If you invoke this method, isEmpty() shall return true. More...
 
bool isEmpty () const
 check the AABB object is empty(reset). More...
 
void updateMinMax (const Vec3 *point, ssize_t num)
 update the _min and _max from the given point. More...
 
void transform (const Mat4 &mat)
 Transforms the bounding box by the given transformation matrix. More...
 

Public Attributes

Vec3 _min
Vec3 _max

Detailed Description

Axis Aligned Bounding Box (AABB), usually caculate some rough but fast collision detection.

Constructor & Destructor Documentation

AABB ( )

Constructor.

AABB ( const Vec3 min,
const Vec3 max 
)

Constructor.

AABB ( const AABB box)

Constructor.

Member Function Documentation

bool containPoint ( const Vec3 point) const

check whether the point is in.

Vec3 getCenter ( )

Gets the center point of the bounding box.

void getCorners ( Vec3 dst) const
bool intersects ( const AABB aabb) const

Tests whether this bounding box intersects the specified bounding object.

bool isEmpty ( ) const

check the AABB object is empty(reset).

void merge ( const AABB box)

Sets this bounding box to the smallest bounding box that contains both this bounding object and the specified bounding box.

void reset ( )

Reset min and max value.If you invoke this method, isEmpty() shall return true.

void set ( const Vec3 min,
const Vec3 max 
)

Sets this bounding box to the specified values.

void transform ( const Mat4 mat)

Transforms the bounding box by the given transformation matrix.

void updateMinMax ( const Vec3 point,
ssize_t  num 
)

update the _min and _max from the given point.

Member Data Documentation

Vec3 _max
Vec3 _min

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