Enable iteration over ChunkNodes, not just Chunks

This commit is contained in:
Erik Broberg
2016-06-14 22:05:03 -04:00
parent 454e19dd83
commit ad73cb0627
2 changed files with 8 additions and 5 deletions
+6 -2
View File
@@ -98,8 +98,8 @@ bool ChunkNode::updateChunkTree(const RenderData& data) {
}
}
void ChunkNode::depthFirst(const std::function<void(const Chunk&)>& f) const {
f(_chunk);
void ChunkNode::depthFirst(const std::function<void(const ChunkNode&)>& f) const {
f(*this);
if (!isLeaf()) {
for (int i = 0; i < 4; ++i) {
_children[i]->depthFirst(f);
@@ -182,6 +182,10 @@ const ChunkNode& ChunkNode::getChild(Quad quad) const {
return *_children[quad];
}
const Chunk& ChunkNode::getChunk() const {
return _chunk;
}
} // namespace openspace