--- a/include/kdtree.h Mon May 05 15:31:14 2008 +0200
+++ b/include/kdtree.h Tue May 06 09:39:58 2008 +0200
@@ -44,10 +44,7 @@
*/
class KdNode
{
- union {
- Float split;
- void *pad64; /* pad to 64 bits on 64bit platforms */
- };
+ Float split;
union {
KdNode *children;
ShapeList *shapes;
@@ -79,16 +76,16 @@
*/
class KdTree: public Container
{
+ MemoryPool<KdNode> mempool;
KdNode *root;
+ const int max_depth;
bool built;
- const int max_depth;
- MemoryPool<KdNode> mempool;
void recursive_build(KdNode *node, const BBox &bbox, int maxdepth);
void recursive_load(istream &st, KdNode *node);
public:
- KdTree(): Container(), root(NULL), built(false), max_depth(32), mempool(64) {};
- KdTree(int maxdepth): Container(), root(NULL), built(false), max_depth(maxdepth), mempool(64) {};
+ KdTree(): Container(), mempool(64), root(NULL), max_depth(32), built(false) {};
+ KdTree(int maxdepth): Container(), mempool(64), root(NULL), max_depth(maxdepth), built(false) {};
~KdTree() { if (root) delete root; };
void addShape(Shape* aShape) { Container::addShape(aShape); built = false; };
Shape *nearest_intersection(const Shape *origin_shape, const Ray &ray,