Removed shadowed variables.
This commit is contained in:
parent
bc0e2d9b29
commit
da7471bee2
@ -48,7 +48,7 @@ namespace PolyVox
|
||||
|
||||
//Compute the cell bitmask for a given cell.
|
||||
template<bool isPrevXAvail, bool isPrevYAvail, bool isPrevZAvail>
|
||||
void computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask);
|
||||
void computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace);
|
||||
|
||||
//Use the cell bitmasks to generate all the vertices needed for that slice
|
||||
void generateVerticesForSlice(const Array2DUint8& pCurrentBitmask,
|
||||
@ -182,16 +182,6 @@ namespace PolyVox
|
||||
VolumeType* m_volData;
|
||||
typename VolumeType::Sampler m_sampVolume;
|
||||
|
||||
//Holds a position in volume space.
|
||||
int32_t iXVolSpace;
|
||||
int32_t iYVolSpace;
|
||||
int32_t iZVolSpace;
|
||||
|
||||
//Holds a position in region space.
|
||||
uint32_t uXRegSpace;
|
||||
uint32_t uYRegSpace;
|
||||
uint32_t uZRegSpace;
|
||||
|
||||
//Used to return the number of cells in a slice which contain triangles.
|
||||
uint32_t m_uNoOfOccupiedCells;
|
||||
|
||||
|
@ -136,18 +136,18 @@ namespace PolyVox
|
||||
const int32_t iMaxXVolSpace = m_regSliceCurrent.getUpperCorner().getX();
|
||||
const int32_t iMaxYVolSpace = m_regSliceCurrent.getUpperCorner().getY();
|
||||
|
||||
iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ();
|
||||
uZRegSpace = iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ();
|
||||
int32_t iZVolSpace = m_regSliceCurrent.getLowerCorner().getZ();
|
||||
uint32_t uZRegSpace = iZVolSpace - m_regSizeInVoxels.getLowerCorner().getZ();
|
||||
|
||||
//Process the lower left corner
|
||||
iYVolSpace = m_regSliceCurrent.getLowerCorner().getY();
|
||||
iXVolSpace = m_regSliceCurrent.getLowerCorner().getX();
|
||||
int32_t iYVolSpace = m_regSliceCurrent.getLowerCorner().getY();
|
||||
int32_t iXVolSpace = m_regSliceCurrent.getLowerCorner().getX();
|
||||
|
||||
uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX();
|
||||
uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY();
|
||||
uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerCorner().getX();
|
||||
uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerCorner().getY();
|
||||
|
||||
m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace);
|
||||
computeBitmaskForCell<false, false, isPrevZAvail>(pPreviousBitmask, pCurrentBitmask);
|
||||
computeBitmaskForCell<false, false, isPrevZAvail>(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace);
|
||||
|
||||
//Process the edge where x is minimal.
|
||||
iXVolSpace = m_regSliceCurrent.getLowerCorner().getX();
|
||||
@ -159,7 +159,7 @@ namespace PolyVox
|
||||
|
||||
m_sampVolume.movePositiveY();
|
||||
|
||||
computeBitmaskForCell<false, true, isPrevZAvail>(pPreviousBitmask, pCurrentBitmask);
|
||||
computeBitmaskForCell<false, true, isPrevZAvail>(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace);
|
||||
}
|
||||
|
||||
//Process the edge where y is minimal.
|
||||
@ -172,7 +172,7 @@ namespace PolyVox
|
||||
|
||||
m_sampVolume.movePositiveX();
|
||||
|
||||
computeBitmaskForCell<true, false, isPrevZAvail>(pPreviousBitmask, pCurrentBitmask);
|
||||
computeBitmaskForCell<true, false, isPrevZAvail>(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace);
|
||||
}
|
||||
|
||||
//Process all remaining elemnents of the slice. In this case, previous x and y values are always available
|
||||
@ -186,7 +186,7 @@ namespace PolyVox
|
||||
|
||||
m_sampVolume.movePositiveX();
|
||||
|
||||
computeBitmaskForCell<true, true, isPrevZAvail>(pPreviousBitmask, pCurrentBitmask);
|
||||
computeBitmaskForCell<true, true, isPrevZAvail>(pPreviousBitmask, pCurrentBitmask, uXRegSpace, uYRegSpace);
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ namespace PolyVox
|
||||
|
||||
template<typename VolumeType, typename Controller>
|
||||
template<bool isPrevXAvail, bool isPrevYAvail, bool isPrevZAvail>
|
||||
void MarchingCubesSurfaceExtractor<VolumeType, Controller>::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask)
|
||||
void MarchingCubesSurfaceExtractor<VolumeType, Controller>::computeBitmaskForCell(const Array2DUint8& pPreviousBitmask, Array2DUint8& pCurrentBitmask, uint32_t uXRegSpace, uint32_t uYRegSpace)
|
||||
{
|
||||
uint8_t iCubeIndex = 0;
|
||||
|
||||
@ -385,7 +385,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
//Save the bitmask
|
||||
pCurrentBitmask[uXRegSpace][iYVolSpace- m_regSizeInVoxels.getLowerCorner().getY()] = iCubeIndex;
|
||||
pCurrentBitmask[uXRegSpace][uYRegSpace] = iCubeIndex;
|
||||
|
||||
if(edgeTable[iCubeIndex] != 0)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user