Mesh decimation now works for levels 0,1,2 and 3.

This commit is contained in:
David Williams
2008-06-13 21:05:45 +00:00
parent 0751ff2fad
commit 5eb5d33aa1
3 changed files with 4 additions and 4 deletions

View File

@@ -39,10 +39,10 @@ namespace PolyVox
const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel;
//When generating the mesh for a region we actually look one voxel outside it in the
//When generating the mesh for a region we actually look outside it in the
// back, bottom, right direction. Protect against access violations by cropping region here
Region regVolume = volumeData->getEnclosingRegion();
regVolume.setUpperCorner(regVolume.getUpperCorner() - Vector3DInt32(uLevel+uStepSize,uLevel+uStepSize,uLevel+uStepSize));
regVolume.setUpperCorner(regVolume.getUpperCorner() - Vector3DInt32(2*uStepSize-1,2*uStepSize-1,2*uStepSize-1));
region.cropTo(regVolume);
//Offset from volume corner