FCL
0.6.0
Flexible Collision Library
|
Oriented bounding box class. More...
#include <OBB.h>
Public Types | |
using | S = S_ |
Public Member Functions | |
OBB () | |
Constructor. | |
OBB (const Matrix3< S > &axis, const Vector3< S > ¢er, const Vector3< S > &extent) | |
Constructor. | |
bool | overlap (const OBB< S > &other) const |
Check collision between two OBB, return true if collision happens. More... | |
bool | overlap (const OBB< S > &other, OBB< S > &overlap_part) const |
Check collision between two OBB and return the overlap part. For OBB, the overlap_part return value is NOT used as the overlap part of two obbs usually is not an obb. | |
bool | contain (const Vector3< S > &p) const |
Check whether the OBB contains a point. | |
OBB< S > & | operator+= (const Vector3< S > &p) |
A simple way to merge the OBB and a point (the result is not compact). | |
OBB< S > & | operator+= (const OBB< S > &other) |
Merge the OBB and another OBB (the result is not compact). | |
OBB< S > | operator+ (const OBB< S > &other) const |
Return the merged OBB of current OBB and the other one (the result is not compact). | |
S | width () const |
Width of the OBB. | |
S | height () const |
Height of the OBB. | |
S | depth () const |
Depth of the OBB. | |
S | volume () const |
Volume of the OBB. | |
S | size () const |
Size of the OBB (used in BV_Splitter to order two OBBs) | |
const Vector3< S > | center () const |
Center of the OBB. | |
S | distance (const OBB &other, Vector3< S > *P=nullptr, Vector3< S > *Q=nullptr) const |
Distance between two OBBs, not implemented. | |
Public Attributes | |
Matrix3< S > | axis |
Orientation of OBB. The axes of the rotation matrix are the principle directions of the box. We assume that the first column corresponds to the axis with the longest box edge, second column corresponds to the shorter one and the third coulumn corresponds to the shortest one. | |
Vector3< S > | To |
Center of OBB. | |
Vector3< S > | extent |
Half dimensions of OBB. | |
Oriented bounding box class.
Check collision between two OBB, return true if collision happens.
compute the relative transform that takes us from this->frame to other.frame