Krig Game Engine
Loading...
Searching...
No Matches
QuadTree.h
Go to the documentation of this file.
1
10#ifndef QUAD_TREE_H_
11#define QUAD_TREE_H_
12
13#include "QuadTreeNode.h"
14#include "DisplayList.h"
15#include "Terrain.h"
16#include "Camera.h"
17
18class QuadTree {
19 public:
20 QuadTree();
21 ~QuadTree();
22
23 void buildTree(Terrain* t);
24 int buildDisplayList(DisplayList* l, Camera* c);
25 int buildLeafList(DisplayList* l);
26
27 // traverseTree is a debug-only utility (PRINT_DEBUG) and a no-op in
28 // production builds. It is not called in the normal game loop.
29 void traverseTree();
30
31 int buildTree(QuadTreeNode*& p, const float& xMin, const float& xMax, const float& zMin, const float& zMax, const float& scaleFactor);
32 void traverseTree(QuadTreeNode* n);
33 int buildDisplayList(QuadTreeNode* n, DisplayList* l, Camera* c);
34 int buildLeafList(QuadTreeNode* n, DisplayList* l);
35
36 // Public so tests and GameLevel can access the tree directly.
37 // The destructor does not delete the tree — callers are responsible
38 // for cleanup (see freeQuadTreeNode in test/quadtree.cpp).
39 QuadTreeNode* root;
40};
41
42#endif
Camera management.
Maintains a list of viewable QuadTreeNodes.
definition of a quatree node containing min and max coordinates.
generate and manage terrain game objects.
Definition Camera.h:13
Definition DisplayList.h:12
Definition QuadTreeNode.h:15
Definition Terrain.h:14