00001 /* Crown and Cutlass 00002 * Quad-Tree Node Object Header 00003 * Note: For use with the terrain quadtree 00004 */ 00005 00006 #if !defined( _QUADNODE_H_ ) 00007 00008 #define _QUADNODE_H_ 00009 00010 // So I don't have to include the headers 00011 class Terrain; 00012 class BoundBox; 00013 class Frustum; 00014 class WaveEmitter; 00015 00016 class QuadNode { 00017 public: 00018 QuadNode(Terrain *terrain, BoundBox *box); 00019 ~QuadNode(); 00020 00021 // Check visibility and either draw children, or call list 00022 void Draw(Frustum *frustum); 00023 00024 // Dump info 00025 void Dump(); 00026 00027 static int s_quadSize; 00028 00029 private: 00030 // Child nodes 00031 QuadNode *m_child1; 00032 QuadNode *m_child2; 00033 QuadNode *m_child3; 00034 QuadNode *m_child4; 00035 00036 // Coords of this node 00037 BoundBox *m_nodeBox; 00038 00039 // Count of vertices in index buffer 00040 int m_vertexCount; 00041 00042 // Range of indices in the index buffer 00043 unsigned int m_indexStartRange; 00044 unsigned int m_indexEndRange; 00045 00046 // Actual index buffer used to draw vertex arrays 00047 unsigned int *m_indexArray; 00048 00049 // Emitter for all waves in this box 00050 // Note: This should only be set if leaf node 00051 WaveEmitter *m_emitter; 00052 }; 00053 00054 #endif
1.4.7