diff -r 4c8abb8977dc -r ca7d4c665531 include/octree.h --- a/include/octree.h Thu May 08 09:21:25 2008 +0200 +++ b/include/octree.h Sat May 10 14:29:37 2008 +0200 @@ -61,7 +61,7 @@ void makeChildren() { children = new OctreeNode[8]; assert(!isLeaf()); }; // this also cleans leaf bit OctreeNode *getChild(const int num) { assert(!isLeaf()); return children + num; }; - void addShape(Shape* aShape) { getShapes()->push_back(aShape); }; + void addShape(const Shape* aShape) { getShapes()->push_back(aShape); }; ShapeList *getShapes() { return (ShapeList*)((size_t)shapes & ~(size_t)1); }; void setShapes(ShapeList *const ashapes) { shapes = ashapes; assert(!isLeaf()); setLeaf(); }; @@ -80,8 +80,8 @@ Octree() : Container(), root(NULL), max_depth(10), built(false) {}; Octree(int maxdepth) : Container(), root(NULL), max_depth(maxdepth), built(false) {}; ~Octree() { if (root) delete root; }; - void addShape(Shape* aShape) { Container::addShape(aShape); built = false; }; - Shape *nearest_intersection(const Shape *origin_shape, const Ray &ray, + void addShape(const Shape* aShape) { Container::addShape(aShape); built = false; }; + const Shape *nearest_intersection(const Shape *origin_shape, const Ray &ray, Float &nearest_distance); void optimize() { build(); }; void build();