00001 00002 00003 #ifndef AABB_H 00004 #define AABB_H 00005 00006 00007 #include "Vector3f.h" 00008 00009 00010 namespace pge { 00011 00012 00013 class AABB { 00014 public: 00015 //************************************************************************ 00016 // 00017 // Constructor 00018 // 00019 //************************************************************************ 00021 AABB(void); 00022 AABB(float minX, float minY, float minZ, float maxX, float maxY, float maxZ); 00023 AABB(const AABB ©); 00024 00025 00026 //************************************************************************ 00027 // 00028 // Destructor 00029 // 00030 //************************************************************************ 00032 ~AABB(void); 00033 00034 00035 //************************************************************************ 00036 // 00037 // Functions 00038 // 00039 //************************************************************************ 00040 00041 // 00042 // Returns true if the given boundingbox is completely inside this one. 00043 // 00044 // REMARK: This does not return true if the given box is greater than this one 00045 // and this box would be inside of the given one. 00046 // 00047 bool isAABBCompletelyInside(AABB *boundingBox); 00048 00049 // 00050 // Returns true if the given boundingbox is inside or overlaps this one. 00051 // 00052 // REMARK: This does not return true if the given box is greater than this one 00053 // and this box would be inside of the given one. 00054 // 00055 bool isAABBInsideOrOverlapping(AABB *boundingBox); 00056 00057 bool isPointInside(const Vector3f &point); 00058 bool isPointInside(float x, float y, float z); 00059 Vector3f getCenter(void); 00060 Vector3f getBottomCenter(void); 00061 void renderSolid(Vector3f color); 00062 void renderWireframe(Vector3f color); 00063 00064 00065 //************************************************************************ 00066 // 00067 // Variables 00068 // 00069 //************************************************************************ 00070 // Min and max values 00071 float m_minX; 00072 float m_minY; 00073 float m_minZ; 00074 float m_maxX; 00075 float m_maxY; 00076 float m_maxZ; 00077 }; 00078 }; 00079 00080 #endif