Refactoring and optimising Marching Cubes algorithm.

This commit is contained in:
David Williams
2009-05-04 10:28:20 +00:00
parent 6da15633e6
commit 03163404df
7 changed files with 480 additions and 367 deletions

View File

@ -382,6 +382,23 @@ namespace PolyVox
return true;
}
template <typename VoxelType>
void VolumeIterator<VoxelType>::movePositiveX(void)
{
++mXPosInVolume;
if(mXPosInVolume % mVolume.m_uBlockSideLength == 0)
{
//We've hit the block boundary. Just calling setPosition() is the easiest weay to resolve this.
setPosition(mXPosInVolume, mYPosInVolume, mZPosInVolume);
}
else
{
//No need to compute new block.
++mVoxelIndexInBlock;
++mCurrentVoxel;
}
}
#pragma endregion
#pragma region Peekers