Removed unnecessary condition.
This commit is contained in:
@ -244,71 +244,67 @@ namespace PolyVox
|
|||||||
|
|
||||||
int32_t indlist[12];
|
int32_t indlist[12];
|
||||||
|
|
||||||
/* Cube is entirely in/out of the surface */
|
/* Find the vertices where the surface intersects the cube */
|
||||||
if (edgeTable[iCubeIndex] != 0)
|
if (edgeTable[iCubeIndex] & 1)
|
||||||
{
|
{
|
||||||
/* Find the vertices where the surface intersects the cube */
|
indlist[0] = pPreviousIndices(uXRegSpace, uYRegSpace - 1).getX();
|
||||||
if (edgeTable[iCubeIndex] & 1)
|
|
||||||
{
|
|
||||||
indlist[0] = pPreviousIndices(uXRegSpace, uYRegSpace - 1).getX();
|
|
||||||
}
|
|
||||||
if (edgeTable[iCubeIndex] & 2)
|
|
||||||
{
|
|
||||||
indlist[1] = pPreviousIndices(uXRegSpace, uYRegSpace).getY();
|
|
||||||
}
|
|
||||||
if (edgeTable[iCubeIndex] & 4)
|
|
||||||
{
|
|
||||||
indlist[2] = pPreviousIndices(uXRegSpace, uYRegSpace).getX();
|
|
||||||
}
|
|
||||||
if (edgeTable[iCubeIndex] & 8)
|
|
||||||
{
|
|
||||||
indlist[3] = pPreviousIndices(uXRegSpace - 1, uYRegSpace).getY();
|
|
||||||
}
|
|
||||||
if (edgeTable[iCubeIndex] & 16)
|
|
||||||
{
|
|
||||||
indlist[4] = pIndices(uXRegSpace, uYRegSpace - 1).getX();
|
|
||||||
}
|
|
||||||
if (edgeTable[iCubeIndex] & 32)
|
|
||||||
{
|
|
||||||
indlist[5] = pIndices(uXRegSpace, uYRegSpace).getY();
|
|
||||||
}
|
|
||||||
if (edgeTable[iCubeIndex] & 64)
|
|
||||||
{
|
|
||||||
indlist[6] = pIndices(uXRegSpace, uYRegSpace).getX();
|
|
||||||
}
|
|
||||||
if (edgeTable[iCubeIndex] & 128)
|
|
||||||
{
|
|
||||||
indlist[7] = pIndices(uXRegSpace - 1, uYRegSpace).getY();
|
|
||||||
}
|
|
||||||
if (edgeTable[iCubeIndex] & 256)
|
|
||||||
{
|
|
||||||
indlist[8] = pIndices(uXRegSpace - 1, uYRegSpace - 1).getZ();
|
|
||||||
}
|
|
||||||
if (edgeTable[iCubeIndex] & 512)
|
|
||||||
{
|
|
||||||
indlist[9] = pIndices(uXRegSpace, uYRegSpace - 1).getZ();
|
|
||||||
}
|
|
||||||
if (edgeTable[iCubeIndex] & 1024)
|
|
||||||
{
|
|
||||||
indlist[10] = pIndices(uXRegSpace, uYRegSpace).getZ();
|
|
||||||
}
|
|
||||||
if (edgeTable[iCubeIndex] & 2048)
|
|
||||||
{
|
|
||||||
indlist[11] = pIndices(uXRegSpace - 1, uYRegSpace).getZ();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; triTable[iCubeIndex][i] != -1; i += 3)
|
|
||||||
{
|
|
||||||
const int32_t ind0 = indlist[triTable[iCubeIndex][i]];
|
|
||||||
const int32_t ind1 = indlist[triTable[iCubeIndex][i + 1]];
|
|
||||||
const int32_t ind2 = indlist[triTable[iCubeIndex][i + 2]];
|
|
||||||
|
|
||||||
if ((ind0 != -1) && (ind1 != -1) && (ind2 != -1))
|
|
||||||
{
|
|
||||||
result->addTriangle(ind0, ind1, ind2);
|
|
||||||
}
|
|
||||||
} // For each triangle
|
|
||||||
}
|
}
|
||||||
|
if (edgeTable[iCubeIndex] & 2)
|
||||||
|
{
|
||||||
|
indlist[1] = pPreviousIndices(uXRegSpace, uYRegSpace).getY();
|
||||||
|
}
|
||||||
|
if (edgeTable[iCubeIndex] & 4)
|
||||||
|
{
|
||||||
|
indlist[2] = pPreviousIndices(uXRegSpace, uYRegSpace).getX();
|
||||||
|
}
|
||||||
|
if (edgeTable[iCubeIndex] & 8)
|
||||||
|
{
|
||||||
|
indlist[3] = pPreviousIndices(uXRegSpace - 1, uYRegSpace).getY();
|
||||||
|
}
|
||||||
|
if (edgeTable[iCubeIndex] & 16)
|
||||||
|
{
|
||||||
|
indlist[4] = pIndices(uXRegSpace, uYRegSpace - 1).getX();
|
||||||
|
}
|
||||||
|
if (edgeTable[iCubeIndex] & 32)
|
||||||
|
{
|
||||||
|
indlist[5] = pIndices(uXRegSpace, uYRegSpace).getY();
|
||||||
|
}
|
||||||
|
if (edgeTable[iCubeIndex] & 64)
|
||||||
|
{
|
||||||
|
indlist[6] = pIndices(uXRegSpace, uYRegSpace).getX();
|
||||||
|
}
|
||||||
|
if (edgeTable[iCubeIndex] & 128)
|
||||||
|
{
|
||||||
|
indlist[7] = pIndices(uXRegSpace - 1, uYRegSpace).getY();
|
||||||
|
}
|
||||||
|
if (edgeTable[iCubeIndex] & 256)
|
||||||
|
{
|
||||||
|
indlist[8] = pIndices(uXRegSpace - 1, uYRegSpace - 1).getZ();
|
||||||
|
}
|
||||||
|
if (edgeTable[iCubeIndex] & 512)
|
||||||
|
{
|
||||||
|
indlist[9] = pIndices(uXRegSpace, uYRegSpace - 1).getZ();
|
||||||
|
}
|
||||||
|
if (edgeTable[iCubeIndex] & 1024)
|
||||||
|
{
|
||||||
|
indlist[10] = pIndices(uXRegSpace, uYRegSpace).getZ();
|
||||||
|
}
|
||||||
|
if (edgeTable[iCubeIndex] & 2048)
|
||||||
|
{
|
||||||
|
indlist[11] = pIndices(uXRegSpace - 1, uYRegSpace).getZ();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; triTable[iCubeIndex][i] != -1; i += 3)
|
||||||
|
{
|
||||||
|
const int32_t ind0 = indlist[triTable[iCubeIndex][i]];
|
||||||
|
const int32_t ind1 = indlist[triTable[iCubeIndex][i + 1]];
|
||||||
|
const int32_t ind2 = indlist[triTable[iCubeIndex][i + 2]];
|
||||||
|
|
||||||
|
if ((ind0 != -1) && (ind1 != -1) && (ind2 != -1))
|
||||||
|
{
|
||||||
|
result->addTriangle(ind0, ind1, ind2);
|
||||||
|
}
|
||||||
|
} // For each triangle
|
||||||
}
|
}
|
||||||
} // For each cell
|
} // For each cell
|
||||||
sampler.movePositiveX();
|
sampler.movePositiveX();
|
||||||
|
Reference in New Issue
Block a user