#include <AABB.h>
Public Member Functions | |
AABB (void) | |
Standard constructor. | |
AABB (float minX, float minY, float minZ, float maxX, float maxY, float maxZ) | |
AABB (const AABB ©) | |
~AABB (void) | |
Destructor. | |
bool | isAABBCompletelyInside (AABB *boundingBox) |
bool | isAABBInsideOrOverlapping (AABB *boundingBox) |
bool | isPointInside (const Vector3f &point) |
bool | isPointInside (float x, float y, float z) |
Vector3f | getCenter (void) |
Vector3f | getBottomCenter (void) |
void | renderSolid (Vector3f color) |
void | renderWireframe (Vector3f color) |
Data Fields | |
float | m_minX |
float | m_minY |
float | m_minZ |
float | m_maxX |
float | m_maxY |
float | m_maxZ |
|
Standard constructor.
Definition at line 16 of file AABB.cpp. References m_maxX, m_maxY, m_maxZ, m_minX, m_minY, and m_minZ.
|
|
Definition at line 31 of file AABB.cpp. References m_maxX, m_maxY, m_maxZ, m_minX, m_minY, and m_minZ.
|
|
Definition at line 46 of file AABB.cpp. References m_maxX, m_maxY, m_maxZ, m_minX, m_minY, and m_minZ.
|
|
Destructor.
Definition at line 61 of file AABB.cpp.
00061 { 00062 } |
|
Definition at line 172 of file AABB.cpp. References m_maxX, m_maxZ, m_minX, m_minY, and m_minZ. Referenced by pge::MeshModel::setBottomCenter().
00172 {
00173 Vector3f center = Vector3f((m_maxX + m_minX) / 2.0f, m_minY, (m_maxZ + m_minZ) / 2.0f);
00174 return center;
00175 }
|
|
Definition at line 161 of file AABB.cpp. References m_maxX, m_maxY, m_maxZ, m_minX, m_minY, and m_minZ.
00161 {
00162 Vector3f center = Vector3f((m_maxX + m_minX) / 2.0f, (m_maxY + m_minY) / 2.0f, (m_maxZ + m_minZ) / 2.0f);
00163 return center;
00164 }
|
|
Definition at line 70 of file AABB.cpp. References isPointInside(), m_maxX, m_maxY, m_maxZ, m_minX, m_minY, and m_minZ. Referenced by pge::QuadtreeNode::subdivide(), and pge::OctreeNode::subdivide().
00070 { 00071 if(!isPointInside(boundingBox->m_minX, boundingBox->m_minY, boundingBox->m_minZ)) { 00072 return false; 00073 } 00074 if(!isPointInside(boundingBox->m_maxX, boundingBox->m_minY, boundingBox->m_minZ)) { 00075 return false; 00076 } 00077 if(!isPointInside(boundingBox->m_minX, boundingBox->m_maxY, boundingBox->m_minZ)) { 00078 return false; 00079 } 00080 if(!isPointInside(boundingBox->m_maxX, boundingBox->m_maxY, boundingBox->m_minZ)) { 00081 return false; 00082 } 00083 if(!isPointInside(boundingBox->m_minX, boundingBox->m_minY, boundingBox->m_maxZ)) { 00084 return false; 00085 } 00086 if(!isPointInside(boundingBox->m_maxX, boundingBox->m_minY, boundingBox->m_maxZ)) { 00087 return false; 00088 } 00089 if(!isPointInside(boundingBox->m_minX, boundingBox->m_maxY, boundingBox->m_maxZ)) { 00090 return false; 00091 } 00092 if(!isPointInside(boundingBox->m_maxX, boundingBox->m_maxY, boundingBox->m_maxZ)) { 00093 return false; 00094 } 00095 return true; 00096 } |
Here is the call graph for this function:
|
Definition at line 104 of file AABB.cpp. References isPointInside(), m_maxX, m_maxY, m_maxZ, m_minX, m_minY, and m_minZ.
00104 { 00105 if(isPointInside(boundingBox->m_minX, boundingBox->m_minY, boundingBox->m_minZ)) { 00106 return true; 00107 } 00108 if(isPointInside(boundingBox->m_maxX, boundingBox->m_minY, boundingBox->m_minZ)) { 00109 return true; 00110 } 00111 if(isPointInside(boundingBox->m_minX, boundingBox->m_maxY, boundingBox->m_minZ)) { 00112 return true; 00113 } 00114 if(isPointInside(boundingBox->m_maxX, boundingBox->m_maxY, boundingBox->m_minZ)) { 00115 return true; 00116 } 00117 if(isPointInside(boundingBox->m_minX, boundingBox->m_minY, boundingBox->m_maxZ)) { 00118 return true; 00119 } 00120 if(isPointInside(boundingBox->m_maxX, boundingBox->m_minY, boundingBox->m_maxZ)) { 00121 return true; 00122 } 00123 if(isPointInside(boundingBox->m_minX, boundingBox->m_maxY, boundingBox->m_maxZ)) { 00124 return true; 00125 } 00126 if(isPointInside(boundingBox->m_maxX, boundingBox->m_maxY, boundingBox->m_maxZ)) { 00127 return true; 00128 } 00129 return false; 00130 } |
Here is the call graph for this function:
|
Definition at line 148 of file AABB.cpp. References m_maxZ, m_minX, m_minY, and m_minZ.
|
|
Definition at line 138 of file AABB.cpp. References pge::Vector3f::m_v. Referenced by isAABBCompletelyInside(), isAABBInsideOrOverlapping(), and pge::EffectTest::timer().
00138 { 00139 return isPointInside(point.m_v[0], point.m_v[1], point.m_v[2]); 00140 } |
|
Definition at line 183 of file AABB.cpp. References m_maxX, m_maxY, m_maxZ, m_minX, m_minY, and m_minZ. Referenced by pge::occlusionquery::occlusionQuery().
00183 { 00184 renderer::color3f(color); 00185 glDisable(GL_TEXTURE_2D); 00186 00187 glBegin(GL_QUADS); 00188 // Front 00189 renderer::vertex3f(m_minX, m_minY, m_minZ); 00190 renderer::vertex3f(m_maxX, m_minY, m_minZ); 00191 renderer::vertex3f(m_maxX, m_maxY, m_minZ); 00192 renderer::vertex3f(m_minX, m_maxY, m_minZ); 00193 00194 // Back 00195 renderer::vertex3f(m_minX, m_minY, m_maxZ); 00196 renderer::vertex3f(m_maxX, m_minY, m_maxZ); 00197 renderer::vertex3f(m_maxX, m_maxY, m_maxZ); 00198 renderer::vertex3f(m_minX, m_maxY, m_maxZ); 00199 00200 // Top 00201 renderer::vertex3f(m_minX, m_maxY, m_minZ); 00202 renderer::vertex3f(m_maxX, m_maxY, m_minZ); 00203 renderer::vertex3f(m_maxX, m_maxY, m_maxZ); 00204 renderer::vertex3f(m_minX, m_maxY, m_maxZ); 00205 00206 // Bottom 00207 renderer::vertex3f(m_minX, m_minY, m_minZ); 00208 renderer::vertex3f(m_maxX, m_minY, m_minZ); 00209 renderer::vertex3f(m_maxX, m_minY, m_maxZ); 00210 renderer::vertex3f(m_minX, m_minY, m_maxZ); 00211 00212 // Left 00213 renderer::vertex3f(m_minX, m_minY, m_maxZ); 00214 renderer::vertex3f(m_minX, m_minY, m_minZ); 00215 renderer::vertex3f(m_minX, m_maxY, m_minZ); 00216 renderer::vertex3f(m_minX, m_maxY, m_maxZ); 00217 00218 // Right 00219 renderer::vertex3f(m_maxX, m_minY, m_minZ); 00220 renderer::vertex3f(m_maxX, m_minY, m_maxZ); 00221 renderer::vertex3f(m_maxX, m_maxY, m_maxZ); 00222 renderer::vertex3f(m_maxX, m_maxY, m_minZ); 00223 glEnd(); 00224 } |
|
Definition at line 232 of file AABB.cpp. References m_maxX, m_maxY, m_maxZ, m_minX, m_minY, and m_minZ. Referenced by pge::QuadtreeNode::renderWireframe(), and pge::OctreeNode::renderWireframe().
00232 { 00233 renderer::color3f(color); 00234 glDisable(GL_TEXTURE_2D); 00235 00236 glBegin(GL_LINES); 00237 // Front 00238 renderer::vertex3f(m_minX, m_minY, m_minZ); 00239 renderer::vertex3f(m_maxX, m_minY, m_minZ); 00240 renderer::vertex3f(m_maxX, m_maxY, m_minZ); 00241 renderer::vertex3f(m_minX, m_maxY, m_minZ); 00242 00243 // Back 00244 renderer::vertex3f(m_minX, m_minY, m_maxZ); 00245 renderer::vertex3f(m_maxX, m_minY, m_maxZ); 00246 renderer::vertex3f(m_maxX, m_maxY, m_maxZ); 00247 renderer::vertex3f(m_minX, m_maxY, m_maxZ); 00248 00249 // Left 00250 renderer::vertex3f(m_minX, m_minY, m_maxZ); 00251 renderer::vertex3f(m_minX, m_maxY, m_maxZ); 00252 renderer::vertex3f(m_minX, m_minY, m_minZ); 00253 renderer::vertex3f(m_minX, m_maxY, m_minZ); 00254 renderer::vertex3f(m_minX, m_minY, m_maxZ); 00255 renderer::vertex3f(m_minX, m_minY, m_minZ); 00256 renderer::vertex3f(m_minX, m_maxY, m_minZ); 00257 renderer::vertex3f(m_minX, m_maxY, m_maxZ); 00258 00259 // Right 00260 renderer::vertex3f(m_maxX, m_minY, m_maxZ); 00261 renderer::vertex3f(m_maxX, m_maxY, m_maxZ); 00262 renderer::vertex3f(m_maxX, m_minY, m_minZ); 00263 renderer::vertex3f(m_maxX, m_maxY, m_minZ); 00264 renderer::vertex3f(m_maxX, m_minY, m_maxZ); 00265 renderer::vertex3f(m_maxX, m_minY, m_minZ); 00266 renderer::vertex3f(m_maxX, m_maxY, m_minZ); 00267 renderer::vertex3f(m_maxX, m_maxY, m_maxZ); 00268 glEnd(); 00269 } |
|
|
|
|
|
|