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.
This commit is contained in:
Andrzej Kapolka 2013-05-12 20:08:01 -07:00
parent 4289921b7e
commit be88fec7d3
2 changed files with 3 additions and 2 deletions

View file

@ -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);

View file

@ -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;