History

Added LOD to preview + Shared voxelSystem for reduced memory consumption

atlante45 committed 13 years ago

Commit 1dc8d8d1 parent 7d9d36a10 files · +227 −104Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 10 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+13−1
@@ -420,7 +420,7 @@ int VoxelSystem::newTreeToArrays(VoxelNode* node) { · 419 unmodified lines
420420 bool shouldRender = false; // assume we don't need to render it
421421 // if it's colored, we might need to render it!
422422 shouldRender = node->calculateShouldRender(_viewFrustum);
423−
423+
424424 node->setShouldRender(shouldRender);
425425 // let children figure out their renderness
426426 if (!node->isLeaf()) {
@@ -631,6 +631,18 @@ void VoxelSystem::init() { · 204 unmodified lines
631631 _perlinModulateProgram->release();
632632 }
633633
634+void VoxelSystem::changeTree(VoxelTree* newTree) {
635+ disconnect(_tree, 0, this, 0);
636+
637+ _tree = newTree;
638+ _tree->setDirtyBit();
639+
640+ connect(_tree, SIGNAL(importSize(float,float,float)), SIGNAL(importSize(float,float,float)));
641+ connect(_tree, SIGNAL(importProgress(int)), SIGNAL(importProgress(int)));
642+
643+ setupNewVoxelsForDrawing();
644+}
645+
634646 void VoxelSystem::updateFullVBOs() {
635647 updateVBOSegment(0, _voxelsInReadArrays);
636648