include/octree.h
branchpyrit
changeset 36 b490093b0ac3
parent 35 fb170fccb19f
child 43 0b8b968b42d1
equal deleted inserted replaced
35:fb170fccb19f 36:b490093b0ac3
    36 {
    36 {
    37 	OctreeNode *root;
    37 	OctreeNode *root;
    38 	bool built;
    38 	bool built;
    39 	int max_depth;
    39 	int max_depth;
    40 public:
    40 public:
    41 	Octree() : Container(), root(NULL), built(false), max_depth(4) {};
    41 	Octree() : Container(), root(NULL), built(false), max_depth(10) {};
    42 	~Octree() { if (root) delete root; };
    42 	~Octree() { if (root) delete root; };
    43 	void addShape(Shape* aShape) { Container::addShape(aShape); built = false; };
    43 	void addShape(Shape* aShape) { Container::addShape(aShape); built = false; };
    44 	Shape *nearest_intersection(const Shape *origin_shape, const Ray &ray,
    44 	Shape *nearest_intersection(const Shape *origin_shape, const Ray &ray,
    45 		Float &nearest_distance);
    45 		Float &nearest_distance);
    46 	void optimize() { build(); };
    46 	void optimize() { build(); };