--- a/src/kdtree.h Thu Nov 22 18:10:10 2007 +0100
+++ b/src/kdtree.h Thu Nov 22 21:46:09 2007 +0100
@@ -68,15 +68,15 @@
{
float split;
bool leaf; /* is this node a leaf? */
- char axis; /* 1,2,3 => x,y,z */
- KdNode *leftchild;
+ short axis; /* 0,1,2 => x,y,z */
+ KdNode *children;
public:
ShapeList shapes;
KdNode() : leaf(true), axis(0), shapes() {};
- void setAxis(char aAxis) { axis = aAxis; };
- char getAxis() { return axis; };
+ void setAxis(short aAxis) { axis = aAxis; };
+ short getAxis() { return axis; };
void setSplit(float aSplit) { split = aSplit; };
float getSplit() { return split; };
@@ -84,13 +84,12 @@
void setLeaf(bool aLeaf) { leaf = aLeaf; };
bool isLeaf() { return leaf; };
- void setLeftChild(KdNode *aLeft) { leftchild = aLeft; };
- KdNode *getLeftChild() { return leftchild; };
- KdNode *getRightChild() { return leftchild+1; };
+ KdNode *getLeftChild() { return children; };
+ KdNode *getRightChild() { return children+1; };
void addShape(Shape* aShape) { shapes.push_back(aShape); };
- void subdivide(BBox bbox, int depth, int count);
+ void subdivide(BBox bbox, int depth);
};
class KdTree: public Container