Added possibility to create a VoxelSystem from an already existing VoxelTree

This commit is contained in:
Atlante45 2014-02-28 15:11:38 -08:00
parent 4bcb43f7dd
commit ea0f414c23
2 changed files with 3 additions and 3 deletions

View file

@ -55,7 +55,7 @@ GLubyte identityIndicesRight[] = { 1, 2, 6, 1, 6, 5 };
GLubyte identityIndicesFront[] = { 0, 2, 1, 0, 3, 2 };
GLubyte identityIndicesBack[] = { 4, 5, 6, 4, 6, 7 };
VoxelSystem::VoxelSystem(float treeScale, int maxVoxels)
VoxelSystem::VoxelSystem(float treeScale, int maxVoxels, VoxelTree* tree)
: NodeData(),
_treeScale(treeScale),
_maxVoxels(maxVoxels),
@ -71,7 +71,7 @@ VoxelSystem::VoxelSystem(float treeScale, int maxVoxels)
_voxelsInReadArrays = _voxelsInWriteArrays = _voxelsUpdated = 0;
_writeRenderFullVBO = true;
_readRenderFullVBO = true;
_tree = new VoxelTree();
_tree = (tree) ? tree : new VoxelTree();
_tree->getRoot()->setVoxelSystem(this);

View file

@ -45,7 +45,7 @@ class VoxelSystem : public NodeData, public OctreeElementDeleteHook, public Octr
friend class VoxelHideShowThread;
public:
VoxelSystem(float treeScale = TREE_SCALE, int maxVoxels = DEFAULT_MAX_VOXELS_PER_SYSTEM);
VoxelSystem(float treeScale = TREE_SCALE, int maxVoxels = DEFAULT_MAX_VOXELS_PER_SYSTEM, VoxelTree* tree = NULL);
~VoxelSystem();
void setDataSourceUUID(const QUuid& dataSourceUUID) { _dataSourceUUID = dataSourceUUID; }