History

fix voxel randomly disappearing bug

Brad Hefta-Gaub committed 12 years ago

Commit a9603301 parent a8a63471 file · +8 −10Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+8−10
@@ -925,16 +925,14 @@ int VoxelSystem::newTreeToArrays(VoxelTreeElement* voxel) { · 924 unmodified lines
925 // for either voxels that should not render, or those that should render and are in view925 // for either voxels that should not render, or those that should render and are in view
926 // update their geometry in the array.if the voxel "should render" but is not in view, then926 // update their geometry in the array.if the voxel "should render" but is not in view, then
927 // it actually doesn't need to be rendered927 // it actually doesn't need to be rendered
928 if (!shouldRender || voxel->isInView(*_viewFrustum)) {928 if (_writeRenderFullVBO) {
929 if (_writeRenderFullVBO) {929 const bool DONT_REUSE_INDEX = false;
930 const bool DONT_REUSE_INDEX = false;930 const bool FORCE_REDRAW = true;
931 const bool FORCE_REDRAW = true;931 voxelsUpdated += updateNodeInArrays(voxel, DONT_REUSE_INDEX, FORCE_REDRAW);
932 voxelsUpdated += updateNodeInArrays(voxel, DONT_REUSE_INDEX, FORCE_REDRAW);932 } else {
933 } else {933 const bool REUSE_INDEX = true;
934 const bool REUSE_INDEX = true;934 const bool DONT_FORCE_REDRAW = false;
935 const bool DONT_FORCE_REDRAW = false;935 voxelsUpdated += updateNodeInArrays(voxel, REUSE_INDEX, DONT_FORCE_REDRAW);
936 voxelsUpdated += updateNodeInArrays(voxel, REUSE_INDEX, DONT_FORCE_REDRAW);
937 }
938 }936 }
939 voxel->clearDirtyBit(); // clear the dirty bit, do this before we potentially delete things.937 voxel->clearDirtyBit(); // clear the dirty bit, do this before we potentially delete things.
940 938