diff options
Diffstat (limited to 'BSPTree.h')
-rw-r--r-- | BSPTree.h | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -78,54 +78,54 @@ class BSPTree { } template<typename T> - void visit(const T& visitor, const vmml::vec3f &v) { - if(plane.getNormal().dot(v) > 0) { + void visit(const T& visitor, const vmml::vec3f &p) { + if(plane.isBehind(p)) { if(frontTree) - frontTree->visit(visitor, v); + frontTree->visit(visitor, p); for(std::list<Triangle>::iterator t = triangles.begin(); t != triangles.end(); ++t) { visitor(*t); } if(backTree) - backTree->visit(visitor, v); + backTree->visit(visitor, p); } else { if(backTree) - backTree->visit(visitor, v); + backTree->visit(visitor, p); for(std::list<Triangle>::iterator t = triangles.begin(); t != triangles.end(); ++t) { visitor(*t); } if(frontTree) - frontTree->visit(visitor, v); + frontTree->visit(visitor, p); } } template<typename T> - void visit(T& visitor, const vmml::vec3f &v) { - if(plane.getNormal().dot(v) > 0) { + void visit(T& visitor, const vmml::vec3f &p) { + if(plane.isBehind(p)) { if(frontTree) - frontTree->visit(visitor, v); + frontTree->visit(visitor, p); for(std::list<Triangle>::iterator t = triangles.begin(); t != triangles.end(); ++t) { visitor(*t); } if(backTree) - backTree->visit(visitor, v); + backTree->visit(visitor, p); } else { if(backTree) - backTree->visit(visitor, v); + backTree->visit(visitor, p); for(std::list<Triangle>::iterator t = triangles.begin(); t != triangles.end(); ++t) { visitor(*t); } if(frontTree) - frontTree->visit(visitor, v); + frontTree->visit(visitor, p); } } |