84 KdTree() : Container(), root(NULL), built(false), max_depth(32) {}; |
84 KdTree() : Container(), root(NULL), built(false), max_depth(32) {}; |
85 ~KdTree() { if (root) delete root; }; |
85 ~KdTree() { if (root) delete root; }; |
86 void addShape(Shape* aShape) { Container::addShape(aShape); built = false; }; |
86 void addShape(Shape* aShape) { Container::addShape(aShape); built = false; }; |
87 Shape *nearest_intersection(const Shape *origin_shape, const Ray &ray, |
87 Shape *nearest_intersection(const Shape *origin_shape, const Ray &ray, |
88 Float &nearest_distance); |
88 Float &nearest_distance); |
|
89 #ifndef NO_SSE |
89 void packet_intersection(const Shape **origin_shapes, const RayPacket &rays, |
90 void packet_intersection(const Shape **origin_shapes, const RayPacket &rays, |
90 Float *nearest_distances, Shape **nearest_shapes); |
91 Float *nearest_distances, Shape **nearest_shapes); |
|
92 #endif |
91 void optimize() { build(); }; |
93 void optimize() { build(); }; |
92 void build(); |
94 void build(); |
93 bool isBuilt() const { return built; }; |
95 bool isBuilt() const { return built; }; |
94 KdNode *getRootNode() const { return root; }; |
96 KdNode *getRootNode() const { return root; }; |
95 void setMaxDepth(int md) { max_depth = md; }; |
97 void setMaxDepth(int md) { max_depth = md; }; |