From be88fec7d31712ec682ee4f1de344735d07ca1a9 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Sun, 12 May 2013 20:08:01 -0700 Subject: [PATCH] Fixed the major bug, which is that non-leaves were being collapsed. Update full VBO on deletion, since otherwise we don't see the update. --- interface/src/VoxelSystem.cpp | 1 + libraries/voxels/src/VoxelNode.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/interface/src/VoxelSystem.cpp b/interface/src/VoxelSystem.cpp index 2ea6a33773..87613e2715 100644 --- a/interface/src/VoxelSystem.cpp +++ b/interface/src/VoxelSystem.cpp @@ -1005,6 +1005,7 @@ void VoxelSystem::deleteVoxelAt(float x, float y, float z, float s) { _tree->deleteVoxelAt(x, y, z, s, true); // redraw! + _renderFullVBO = true; setupNewVoxelsForDrawing(); // do we even need to do this? Or will the next network receive kick in? pthread_mutex_unlock(&_treeLock); diff --git a/libraries/voxels/src/VoxelNode.cpp b/libraries/voxels/src/VoxelNode.cpp index d151603069..3b8a0d68e5 100644 --- a/libraries/voxels/src/VoxelNode.cpp +++ b/libraries/voxels/src/VoxelNode.cpp @@ -195,8 +195,8 @@ bool VoxelNode::collapseIdenticalLeaves() { bool allChildrenMatch = true; // assume the best (ottimista) int red,green,blue; for (int i = 0; i < NUMBER_OF_CHILDREN; i++) { - // if no child, or child doesn't have a color - if (!_children[i] || !_children[i]->isColored()) { + // if no child, child isn't a leaf, or child doesn't have a color + if (!_children[i] || !_children[i]->isLeaf() || !_children[i]->isColored()) { allChildrenMatch=false; //printLog("SADNESS child missing or not colored! i=%d\n",i); break;