mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-03 17:30:04 -05:00
Enable iteration over ChunkNodes, not just Chunks
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user