History

Added possibility to create a VoxelSystem from an already existing VoxelTree

Atlante45 committed 12 years ago

Commit ea0f4141 parent 4bcb43f2 files · +3 −3Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+2−2
@@ -55,7 +55,7 @@ GLubyte identityIndicesRight[] = { 1, 2, 6, 1, 6, 5 }; · 54 unmodified lines
5555 GLubyte identityIndicesFront[] = { 0, 2, 1, 0, 3, 2 };
5656 GLubyte identityIndicesBack[] = { 4, 5, 6, 4, 6, 7 };
5757
58−VoxelSystem::VoxelSystem(float treeScale, int maxVoxels)
58+VoxelSystem::VoxelSystem(float treeScale, int maxVoxels, VoxelTree* tree)
5959 : NodeData(),
6060 _treeScale(treeScale),
6161 _maxVoxels(maxVoxels),
@@ -71,7 +71,7 @@ VoxelSystem::VoxelSystem(float treeScale, int maxVoxels) · 9 unmodified lines
7171 _voxelsInReadArrays = _voxelsInWriteArrays = _voxelsUpdated = 0;
7272 _writeRenderFullVBO = true;
7373 _readRenderFullVBO = true;
74− _tree = new VoxelTree();
74+ _tree = (tree) ? tree : new VoxelTree();
7575
7676 _tree->getRoot()->setVoxelSystem(this);
7777