Further fixes for move...() functions.
This commit is contained in:
parent
056cae39b5
commit
135aa96bdf
@ -146,13 +146,12 @@ namespace PolyVox
|
|||||||
// Base version updates position and validity flags.
|
// Base version updates position and validity flags.
|
||||||
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::movePositiveX();
|
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::movePositiveX();
|
||||||
|
|
||||||
this->m_uXPosInChunk++;
|
|
||||||
|
|
||||||
// Then we update the voxel pointer
|
// Then we update the voxel pointer
|
||||||
if(((this->mXPosInVolume) % this->mVolume->m_uChunkSideLength != 0))
|
if(((this->mXPosInVolume) % this->mVolume->m_uChunkSideLength != 0))
|
||||||
{
|
{
|
||||||
//No need to compute new chunk.
|
//No need to compute new chunk.
|
||||||
mCurrentVoxel += POS_X_DELTA;
|
mCurrentVoxel += POS_X_DELTA;
|
||||||
|
this->m_uXPosInChunk++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -167,13 +166,12 @@ namespace PolyVox
|
|||||||
// Base version updates position and validity flags.
|
// Base version updates position and validity flags.
|
||||||
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::movePositiveY();
|
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::movePositiveY();
|
||||||
|
|
||||||
this->m_uYPosInChunk++;
|
|
||||||
|
|
||||||
// Then we update the voxel pointer
|
// Then we update the voxel pointer
|
||||||
if(((this->mYPosInVolume) % this->mVolume->m_uChunkSideLength != 0))
|
if(((this->mYPosInVolume) % this->mVolume->m_uChunkSideLength != 0))
|
||||||
{
|
{
|
||||||
//No need to compute new chunk.
|
//No need to compute new chunk.
|
||||||
mCurrentVoxel += POS_Y_DELTA;
|
mCurrentVoxel += POS_Y_DELTA;
|
||||||
|
this->m_uYPosInChunk++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -188,13 +186,12 @@ namespace PolyVox
|
|||||||
// Base version updates position and validity flags.
|
// Base version updates position and validity flags.
|
||||||
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::movePositiveZ();
|
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::movePositiveZ();
|
||||||
|
|
||||||
this->m_uZPosInChunk++;
|
|
||||||
|
|
||||||
// Then we update the voxel pointer
|
// Then we update the voxel pointer
|
||||||
if(((this->mZPosInVolume) % this->mVolume->m_uChunkSideLength != 0))
|
if(((this->mZPosInVolume) % this->mVolume->m_uChunkSideLength != 0))
|
||||||
{
|
{
|
||||||
//No need to compute new chunk.
|
//No need to compute new chunk.
|
||||||
mCurrentVoxel += POS_Z_DELTA;
|
mCurrentVoxel += POS_Z_DELTA;
|
||||||
|
this->m_uZPosInChunk++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -209,13 +206,12 @@ namespace PolyVox
|
|||||||
// Base version updates position and validity flags.
|
// Base version updates position and validity flags.
|
||||||
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::moveNegativeX();
|
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::moveNegativeX();
|
||||||
|
|
||||||
this->m_uXPosInChunk--;
|
|
||||||
|
|
||||||
// Then we update the voxel pointer
|
// Then we update the voxel pointer
|
||||||
if(((this->mXPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0))
|
if(((this->mXPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0))
|
||||||
{
|
{
|
||||||
//No need to compute new chunk.
|
//No need to compute new chunk.
|
||||||
mCurrentVoxel += NEG_X_DELTA;
|
mCurrentVoxel += NEG_X_DELTA;
|
||||||
|
this->m_uXPosInChunk--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -230,13 +226,12 @@ namespace PolyVox
|
|||||||
// Base version updates position and validity flags.
|
// Base version updates position and validity flags.
|
||||||
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::moveNegativeY();
|
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::moveNegativeY();
|
||||||
|
|
||||||
this->m_uYPosInChunk--;
|
|
||||||
|
|
||||||
// Then we update the voxel pointer
|
// Then we update the voxel pointer
|
||||||
if(((this->mYPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0))
|
if(((this->mYPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0))
|
||||||
{
|
{
|
||||||
//No need to compute new chunk.
|
//No need to compute new chunk.
|
||||||
mCurrentVoxel += NEG_Y_DELTA;
|
mCurrentVoxel += NEG_Y_DELTA;
|
||||||
|
this->m_uYPosInChunk--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -251,13 +246,12 @@ namespace PolyVox
|
|||||||
// Base version updates position and validity flags.
|
// Base version updates position and validity flags.
|
||||||
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::moveNegativeZ();
|
BaseVolume<VoxelType>::template Sampler< PagedVolume<VoxelType> >::moveNegativeZ();
|
||||||
|
|
||||||
this->m_uZPosInChunk--;
|
|
||||||
|
|
||||||
// Then we update the voxel pointer
|
// Then we update the voxel pointer
|
||||||
if(((this->mZPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0))
|
if(((this->mZPosInVolume + 1) % this->mVolume->m_uChunkSideLength != 0))
|
||||||
{
|
{
|
||||||
//No need to compute new chunk.
|
//No need to compute new chunk.
|
||||||
mCurrentVoxel += NEG_Z_DELTA;
|
mCurrentVoxel += NEG_Z_DELTA;
|
||||||
|
this->m_uZPosInChunk--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user