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

#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. More...
 
bool isEmpty () const
 
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
 

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
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.

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: