Cocos2d-x  v3.11
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
OBB Class Reference

Oritened Bounding Box(OBB) More...

Public Member Functions

bool containPoint (const Vec3 &point) const
 Check if the point is contained in the bounding box. More...
 
local containPoint ( local point)
 Check if the point is contained in the bounding box. More...
 
void getCorners (Vec3 *verts) const
 Get Obb's corners. More...
 
bool intersects (const OBB &box) const
 Tests whether this bounding box intersects the specified bounding object. More...
 
local intersects ( local box)
 Tests whether this bounding box intersects the specified bounding object. More...
 
void transform (const Mat4 &mat)
 Transforms the obb by the given transformation matrix. More...
 

Detailed Description

Oritened Bounding Box(OBB)

The OBB is similar to the AABB but the bounding box has the same direction as Sprite3D. so it's collistion detection more precise than AABB

Member Function Documentation

bool containPoint ( const Vec3 point) const

Check if the point is contained in the bounding box.

The specified point. Return true when the point is contained in the bounding box, otherwise return false.

local containPoint ( local  point)

Check if the point is contained in the bounding box.

The specified point. Return true when the point is contained in the bounding box, otherwise return false.

void getCorners ( Vec3 verts) const

Get Obb's corners.

The Corners vertices array. Face to the obb's -z direction verts[0] : left top front verts[1] : left bottom front verts[2] : right bottom front verts[3] : right top front

face to the obb's z direction verts[4] : right top back verts[5] : right bottom back verts[6] : left bottom back verts[7] : left top back

local getCorners ( local  verts)

Get Obb's corners.

The Corners vertices array. Face to the obb's -z direction verts[0] : left top front verts[1] : left bottom front verts[2] : right bottom front verts[3] : right top front

face to the obb's z direction verts[4] : right top back verts[5] : right bottom back verts[6] : left bottom back verts[7] : left top back

bool intersects ( const OBB box) const

Tests whether this bounding box intersects the specified bounding object.

The specified bounding box. Return true when two OOBBS intersect, otherwise return false.

local intersects ( local  box)

Tests whether this bounding box intersects the specified bounding object.

The specified bounding box. Return true when two OOBBS intersect, otherwise return false.

void transform ( const Mat4 mat)

Transforms the obb by the given transformation matrix.

The transform matrix.

local transform ( local  mat)

Transforms the obb by the given transformation matrix.

The transform matrix.


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