Cocos2d-x  v4
AABB Class Reference

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

Public Member Functions

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

Detailed Description

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

Constructor & Destructor Documentation

◆ AABB() [1/2]

AABB ( )

Constructor.

@lua new

◆ AABB() [2/2]

AABB ( const Vec3 min,
const Vec3 max 
)

Constructor.

@lua new


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