Avoid setting the sampler position every iteration.
This commit is contained in:
parent
5b84c5a9a5
commit
cee15a145f
@ -81,12 +81,12 @@ namespace PolyVox
|
||||
{
|
||||
const uint32_t uYRegSpace = iYVolSpace - m_regSizeInVoxels.getLowerY();
|
||||
|
||||
m_sampVolume.setPosition(m_regSizeInVoxels.getLowerX(), iYVolSpace, iZVolSpace);
|
||||
|
||||
for (int32_t iXVolSpace = m_regSizeInVoxels.getLowerX(); iXVolSpace <= m_regSizeInVoxels.getUpperX(); iXVolSpace++)
|
||||
{
|
||||
const uint32_t uXRegSpace = iXVolSpace - m_regSizeInVoxels.getLowerX();
|
||||
|
||||
m_sampVolume.setPosition(iXVolSpace, iYVolSpace, iZVolSpace);
|
||||
|
||||
typename VolumeType::VoxelType v000;
|
||||
typename VolumeType::VoxelType v100;
|
||||
typename VolumeType::VoxelType v010;
|
||||
@ -286,10 +286,8 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/* Cube is entirely in/out of the surface */
|
||||
if (edgeTable[iCubeIndex] == 0)
|
||||
if (edgeTable[iCubeIndex] != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// These three might not have been sampled, as v111 is the only one we sample every iteration.
|
||||
v110 = m_sampVolume.peekVoxel0px0py1nz();
|
||||
@ -400,20 +398,16 @@ namespace PolyVox
|
||||
|
||||
// Now output the indices. For the first row, column or slice there aren't
|
||||
// any (the region size in cells is one less than the region size in voxels)
|
||||
if ((!isPrevXAvail) || (!isPrevYAvail) || (!isPrevZAvail))
|
||||
if ((isPrevXAvail) && (isPrevYAvail) && (isPrevZAvail))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int32_t indlist[12];
|
||||
|
||||
m_sampVolume.setPosition(iXVolSpace, iYVolSpace, iZVolSpace);
|
||||
|
||||
/* Cube is entirely in/out of the surface */
|
||||
if (edgeTable[iCubeIndex] == 0)
|
||||
if (edgeTable[iCubeIndex] != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Find the vertices where the surface intersects the cube */
|
||||
if (edgeTable[iCubeIndex] & 1)
|
||||
@ -476,7 +470,11 @@ namespace PolyVox
|
||||
m_meshCurrent->addTriangle(ind0, ind1, ind2);
|
||||
}
|
||||
}//For each triangle
|
||||
}
|
||||
}
|
||||
}//For each cell
|
||||
m_sampVolume.movePositiveX();
|
||||
}
|
||||
}
|
||||
|
||||
pPreviousBitmask.swap(pCurrentBitmask);
|
||||
|
Loading…
x
Reference in New Issue
Block a user