summaryrefslogtreecommitdiffstats
path: root/BSPTree.h
diff options
context:
space:
mode:
Diffstat (limited to 'BSPTree.h')
-rw-r--r--BSPTree.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/BSPTree.h b/BSPTree.h
index a03327b..0b13b6b 100644
--- a/BSPTree.h
+++ b/BSPTree.h
@@ -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);
}
}