diff --git a/include/PolyVox/PagedVolumeSampler.inl b/include/PolyVox/PagedVolumeSampler.inl index db540f54..e7d87b50 100644 --- a/include/PolyVox/PagedVolumeSampler.inl +++ b/include/PolyVox/PagedVolumeSampler.inl @@ -145,14 +145,13 @@ namespace PolyVox { // Base version updates position and validity flags. BaseVolume::template Sampler< PagedVolume >::movePositiveX(); - - this->m_uXPosInChunk++; // Then we update the voxel pointer if(((this->mXPosInVolume) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new chunk. mCurrentVoxel += POS_X_DELTA; + this->m_uXPosInChunk++; } else { @@ -167,13 +166,12 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< PagedVolume >::movePositiveY(); - this->m_uYPosInChunk++; - // Then we update the voxel pointer if(((this->mYPosInVolume) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new chunk. mCurrentVoxel += POS_Y_DELTA; + this->m_uYPosInChunk++; } else { @@ -188,13 +186,12 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< PagedVolume >::movePositiveZ(); - this->m_uZPosInChunk++; - // Then we update the voxel pointer if(((this->mZPosInVolume) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new chunk. mCurrentVoxel += POS_Z_DELTA; + this->m_uZPosInChunk++; } else { @@ -209,13 +206,12 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< PagedVolume >::moveNegativeX(); - this->m_uXPosInChunk--; - // Then we update the voxel pointer if(((this->mXPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new chunk. mCurrentVoxel += NEG_X_DELTA; + this->m_uXPosInChunk--; } else { @@ -230,13 +226,12 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< PagedVolume >::moveNegativeY(); - this->m_uYPosInChunk--; - // Then we update the voxel pointer if(((this->mYPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new chunk. mCurrentVoxel += NEG_Y_DELTA; + this->m_uYPosInChunk--; } else { @@ -251,13 +246,12 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< PagedVolume >::moveNegativeZ(); - this->m_uZPosInChunk--; - // Then we update the voxel pointer if(((this->mZPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0)) { //No need to compute new chunk. mCurrentVoxel += NEG_Z_DELTA; + this->m_uZPosInChunk--; } else {