Added a bunch of 'this->' statements to fix compilation on g++.
This commit is contained in:
parent
84c78f6839
commit
8b0eea1152
@ -26,8 +26,8 @@ freely, subject to the following restrictions:
|
||||
#include "PolyVoxCore/Vector.h"
|
||||
#include "PolyVoxCore/Region.h"
|
||||
|
||||
#define BORDER_LOW(x) ((( x >> mVolume->m_uBlockSideLengthPower) << mVolume->m_uBlockSideLengthPower) != x)
|
||||
#define BORDER_HIGH(x) ((( (x+1) >> mVolume->m_uBlockSideLengthPower) << mVolume->m_uBlockSideLengthPower) != (x+1))
|
||||
#define BORDER_LOW(x) ((( x >> this->mVolume->m_uBlockSideLengthPower) << this->mVolume->m_uBlockSideLengthPower) != x)
|
||||
#define BORDER_HIGH(x) ((( (x+1) >> this->mVolume->m_uBlockSideLengthPower) << this->mVolume->m_uBlockSideLengthPower) != (x+1))
|
||||
//#define BORDER_LOW(x) (( x % mVolume->m_uBlockSideLength) != 0)
|
||||
//#define BORDER_HIGH(x) (( x % mVolume->m_uBlockSideLength) != mVolume->m_uBlockSideLength - 1)
|
||||
|
||||
@ -54,7 +54,7 @@ namespace PolyVox
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
mVolume = rhs.mVolume;
|
||||
this->mVolume = rhs.mVolume;
|
||||
mXPosInVolume = rhs.mXPosInVolume;
|
||||
mYPosInVolume = rhs.mYPosInVolume;
|
||||
mZPosInVolume = rhs.mZPosInVolume;
|
||||
@ -110,7 +110,7 @@ namespace PolyVox
|
||||
{
|
||||
for(uint8_t x = 0; x < uSize; ++x)
|
||||
{
|
||||
tValue = (std::min)(tValue, mVolume->getVoxelAt(mXPosInVolume + x, mYPosInVolume + y, mZPosInVolume + z));
|
||||
tValue = (std::min)(tValue, this->mVolume->getVoxelAt(mXPosInVolume + x, mYPosInVolume + y, mZPosInVolume + z));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -137,27 +137,27 @@ namespace PolyVox
|
||||
mYPosInVolume = yPos;
|
||||
mZPosInVolume = zPos;
|
||||
|
||||
const int32_t uXBlock = mXPosInVolume >> mVolume->m_uBlockSideLengthPower;
|
||||
const int32_t uYBlock = mYPosInVolume >> mVolume->m_uBlockSideLengthPower;
|
||||
const int32_t uZBlock = mZPosInVolume >> mVolume->m_uBlockSideLengthPower;
|
||||
const int32_t uXBlock = mXPosInVolume >> this->mVolume->m_uBlockSideLengthPower;
|
||||
const int32_t uYBlock = mYPosInVolume >> this->mVolume->m_uBlockSideLengthPower;
|
||||
const int32_t uZBlock = mZPosInVolume >> this->mVolume->m_uBlockSideLengthPower;
|
||||
|
||||
const uint16_t uXPosInBlock = mXPosInVolume - (uXBlock << mVolume->m_uBlockSideLengthPower);
|
||||
const uint16_t uYPosInBlock = mYPosInVolume - (uYBlock << mVolume->m_uBlockSideLengthPower);
|
||||
const uint16_t uZPosInBlock = mZPosInVolume - (uZBlock << mVolume->m_uBlockSideLengthPower);
|
||||
const uint16_t uXPosInBlock = mXPosInVolume - (uXBlock << this->mVolume->m_uBlockSideLengthPower);
|
||||
const uint16_t uYPosInBlock = mYPosInVolume - (uYBlock << this->mVolume->m_uBlockSideLengthPower);
|
||||
const uint16_t uZPosInBlock = mZPosInVolume - (uZBlock << this->mVolume->m_uBlockSideLengthPower);
|
||||
|
||||
const uint32_t uVoxelIndexInBlock = uXPosInBlock +
|
||||
uYPosInBlock * mVolume->m_uBlockSideLength +
|
||||
uZPosInBlock * mVolume->m_uBlockSideLength * mVolume->m_uBlockSideLength;
|
||||
uYPosInBlock * this->mVolume->m_uBlockSideLength +
|
||||
uZPosInBlock * this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength;
|
||||
|
||||
if(mVolume->m_regValidRegionInBlocks.containsPoint(Vector3DInt32(uXBlock, uYBlock, uZBlock)))
|
||||
if(this->mVolume->m_regValidRegionInBlocks.containsPoint(Vector3DInt32(uXBlock, uYBlock, uZBlock)))
|
||||
{
|
||||
Block<VoxelType>* pUncompressedCurrentBlock = mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock);
|
||||
Block<VoxelType>* pUncompressedCurrentBlock = this->mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock);
|
||||
|
||||
mCurrentVoxel = pUncompressedCurrentBlock->m_tUncompressedData + uVoxelIndexInBlock;
|
||||
}
|
||||
else
|
||||
{
|
||||
mCurrentVoxel = mVolume->m_pUncompressedBorderData + uVoxelIndexInBlock;
|
||||
mCurrentVoxel = this->mVolume->m_pUncompressedBorderData + uVoxelIndexInBlock;
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ namespace PolyVox
|
||||
void LargeVolume<VoxelType>::Sampler::movePositiveX(void)
|
||||
{
|
||||
//Note the *pre* increament here
|
||||
if((++mXPosInVolume) % mVolume->m_uBlockSideLength != 0)
|
||||
if((++mXPosInVolume) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
++mCurrentVoxel;
|
||||
@ -181,10 +181,10 @@ namespace PolyVox
|
||||
void LargeVolume<VoxelType>::Sampler::movePositiveY(void)
|
||||
{
|
||||
//Note the *pre* increament here
|
||||
if((++mYPosInVolume) % mVolume->m_uBlockSideLength != 0)
|
||||
if((++mYPosInVolume) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
mCurrentVoxel += mVolume->m_uBlockSideLength;
|
||||
mCurrentVoxel += this->mVolume->m_uBlockSideLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -197,10 +197,10 @@ namespace PolyVox
|
||||
void LargeVolume<VoxelType>::Sampler::movePositiveZ(void)
|
||||
{
|
||||
//Note the *pre* increament here
|
||||
if((++mZPosInVolume) % mVolume->m_uBlockSideLength != 0)
|
||||
if((++mZPosInVolume) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
mCurrentVoxel += mVolume->m_uBlockSideLength * mVolume->m_uBlockSideLength;
|
||||
mCurrentVoxel += this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -213,7 +213,7 @@ namespace PolyVox
|
||||
void LargeVolume<VoxelType>::Sampler::moveNegativeX(void)
|
||||
{
|
||||
//Note the *post* decreament here
|
||||
if((mXPosInVolume--) % mVolume->m_uBlockSideLength != 0)
|
||||
if((mXPosInVolume--) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
--mCurrentVoxel;
|
||||
@ -229,10 +229,10 @@ namespace PolyVox
|
||||
void LargeVolume<VoxelType>::Sampler::moveNegativeY(void)
|
||||
{
|
||||
//Note the *post* decreament here
|
||||
if((mYPosInVolume--) % mVolume->m_uBlockSideLength != 0)
|
||||
if((mYPosInVolume--) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
mCurrentVoxel -= mVolume->m_uBlockSideLength;
|
||||
mCurrentVoxel -= this->mVolume->m_uBlockSideLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -245,10 +245,10 @@ namespace PolyVox
|
||||
void LargeVolume<VoxelType>::Sampler::moveNegativeZ(void)
|
||||
{
|
||||
//Note the *post* decreament here
|
||||
if((mZPosInVolume--) % mVolume->m_uBlockSideLength != 0)
|
||||
if((mZPosInVolume--) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
mCurrentVoxel -= mVolume->m_uBlockSideLength * mVolume->m_uBlockSideLength;
|
||||
mCurrentVoxel -= this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -262,9 +262,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 - mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -272,9 +272,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 - mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -282,9 +282,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 - mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -292,9 +292,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -304,7 +304,7 @@ namespace PolyVox
|
||||
{
|
||||
return *(mCurrentVoxel - 1);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -312,9 +312,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -322,9 +322,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 + mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -332,9 +332,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 + mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -342,9 +342,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 + mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@ -354,9 +354,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -364,9 +364,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -374,9 +374,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -384,9 +384,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -400,9 +400,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -410,9 +410,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -420,9 +420,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -430,9 +430,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@ -442,9 +442,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 - mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -452,9 +452,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 - mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -462,9 +462,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 - mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -472,9 +472,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -484,7 +484,7 @@ namespace PolyVox
|
||||
{
|
||||
return *(mCurrentVoxel + 1);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -492,9 +492,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -502,9 +502,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 + mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -512,9 +512,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 + mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -522,8 +522,8 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 + mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ namespace PolyVox
|
||||
{
|
||||
template <typename VoxelType>
|
||||
RawVolume<VoxelType>::Sampler::Sampler(RawVolume<VoxelType>* volume)
|
||||
//:mVolume(volume)
|
||||
//:this->mVolume(volume)
|
||||
:mXPosInVolume(0)
|
||||
,mYPosInVolume(0)
|
||||
,mZPosInVolume(0)
|
||||
@ -68,7 +68,7 @@ namespace PolyVox
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::getVoxel(void) const
|
||||
{
|
||||
return m_bIsCurrentPositionValid ? *mCurrentVoxel : mVolume->getBorderValue();
|
||||
return m_bIsCurrentPositionValid ? *mCurrentVoxel : this->mVolume->getBorderValue();
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -85,12 +85,12 @@ namespace PolyVox
|
||||
mZPosInVolume = zPos;
|
||||
|
||||
const uint32_t uVoxelIndex = xPos +
|
||||
yPos * mVolume->getWidth() +
|
||||
zPos * mVolume->getWidth() * mVolume->getHeight();
|
||||
yPos * this->mVolume->getWidth() +
|
||||
zPos * this->mVolume->getWidth() * this->mVolume->getHeight();
|
||||
|
||||
mCurrentVoxel = mVolume->m_pData + uVoxelIndex;
|
||||
mCurrentVoxel = this->mVolume->m_pData + uVoxelIndex;
|
||||
|
||||
m_bIsCurrentPositionValid = mVolume->getEnclosingRegion().containsPoint(Vector3DInt32(xPos, yPos, zPos));
|
||||
m_bIsCurrentPositionValid = this->mVolume->getEnclosingRegion().containsPoint(Vector3DInt32(xPos, yPos, zPos));
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -98,23 +98,23 @@ namespace PolyVox
|
||||
{
|
||||
mXPosInVolume++;
|
||||
++mCurrentVoxel;
|
||||
m_bIsCurrentPositionValid = mXPosInVolume <= mVolume->getEnclosingRegion().getUpperCorner().getX();
|
||||
m_bIsCurrentPositionValid = mXPosInVolume <= this->mVolume->getEnclosingRegion().getUpperCorner().getX();
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void RawVolume<VoxelType>::Sampler::movePositiveY(void)
|
||||
{
|
||||
mYPosInVolume++;
|
||||
mCurrentVoxel += mVolume->getWidth();
|
||||
m_bIsCurrentPositionValid = mYPosInVolume <= mVolume->getEnclosingRegion().getUpperCorner().getY();
|
||||
mCurrentVoxel += this->mVolume->getWidth();
|
||||
m_bIsCurrentPositionValid = mYPosInVolume <= this->mVolume->getEnclosingRegion().getUpperCorner().getY();
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void RawVolume<VoxelType>::Sampler::movePositiveZ(void)
|
||||
{
|
||||
mZPosInVolume++;
|
||||
mCurrentVoxel += mVolume->getWidth() * mVolume->getHeight();
|
||||
m_bIsCurrentPositionValid = mZPosInVolume <= mVolume->getEnclosingRegion().getUpperCorner().getZ();
|
||||
mCurrentVoxel += this->mVolume->getWidth() * this->mVolume->getHeight();
|
||||
m_bIsCurrentPositionValid = mZPosInVolume <= this->mVolume->getEnclosingRegion().getUpperCorner().getZ();
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -122,77 +122,77 @@ namespace PolyVox
|
||||
{
|
||||
mXPosInVolume--;
|
||||
--mCurrentVoxel;
|
||||
m_bIsCurrentPositionValid = mXPosInVolume >= mVolume->getEnclosingRegion().getLowerCorner().getX();
|
||||
m_bIsCurrentPositionValid = mXPosInVolume >= this->mVolume->getEnclosingRegion().getLowerCorner().getX();
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void RawVolume<VoxelType>::Sampler::moveNegativeY(void)
|
||||
{
|
||||
mYPosInVolume--;
|
||||
mCurrentVoxel -= mVolume->getWidth();
|
||||
m_bIsCurrentPositionValid = mYPosInVolume >= mVolume->getEnclosingRegion().getLowerCorner().getY();
|
||||
mCurrentVoxel -= this->mVolume->getWidth();
|
||||
m_bIsCurrentPositionValid = mYPosInVolume >= this->mVolume->getEnclosingRegion().getLowerCorner().getY();
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void RawVolume<VoxelType>::Sampler::moveNegativeZ(void)
|
||||
{
|
||||
mZPosInVolume--;
|
||||
mCurrentVoxel -= mVolume->getWidth() * mVolume->getHeight();
|
||||
m_bIsCurrentPositionValid =mZPosInVolume >= mVolume->getEnclosingRegion().getLowerCorner().getZ();
|
||||
mCurrentVoxel -= this->mVolume->getWidth() * this->mVolume->getHeight();
|
||||
m_bIsCurrentPositionValid =mZPosInVolume >= this->mVolume->getEnclosingRegion().getLowerCorner().getZ();
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1nx1ny1nz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1nx1ny0pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1nx1ny1pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1nx0py1nz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1nx0py0pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1nx0py1pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1nx1py1nz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1nx1py0pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1nx1py1pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@ -200,25 +200,25 @@ namespace PolyVox
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel0px1ny1nz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel0px1ny0pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel0px1ny1pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel0px0py1nz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -230,25 +230,25 @@ namespace PolyVox
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel0px0py1pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel0px1py1nz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel0px1py0pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel0px1py1pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@ -256,54 +256,54 @@ namespace PolyVox
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1px1ny1nz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1px1ny0pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1px1ny1pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1px0py1nz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1px0py0pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1px0py1pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1px1py1nz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1px1py0pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel1px1py1pz(void) const
|
||||
{
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
}
|
||||
}
|
||||
|
@ -26,17 +26,17 @@ freely, subject to the following restrictions:
|
||||
#include "PolyVoxCore/Vector.h"
|
||||
#include "PolyVoxCore/Region.h"
|
||||
|
||||
#define BORDER_LOW(x) ((( x >> mVolume->m_uBlockSideLengthPower) << mVolume->m_uBlockSideLengthPower) != x)
|
||||
#define BORDER_HIGH(x) ((( (x+1) >> mVolume->m_uBlockSideLengthPower) << mVolume->m_uBlockSideLengthPower) != (x+1))
|
||||
//#define BORDER_LOW(x) (( x % mVolume->m_uBlockSideLength) != 0)
|
||||
//#define BORDER_HIGH(x) (( x % mVolume->m_uBlockSideLength) != mVolume->m_uBlockSideLength - 1)
|
||||
#define BORDER_LOW(x) ((( x >> this->mVolume->m_uBlockSideLengthPower) << this->mVolume->m_uBlockSideLengthPower) != x)
|
||||
#define BORDER_HIGH(x) ((( (x+1) >> this->mVolume->m_uBlockSideLengthPower) << this->mVolume->m_uBlockSideLengthPower) != (x+1))
|
||||
//#define BORDER_LOW(x) (( x % this->mVolume->m_uBlockSideLength) != 0)
|
||||
//#define BORDER_HIGH(x) (( x % this->mVolume->m_uBlockSideLength) != this->mVolume->m_uBlockSideLength - 1)
|
||||
|
||||
#include <limits>
|
||||
namespace PolyVox
|
||||
{
|
||||
template <typename VoxelType>
|
||||
SimpleVolume<VoxelType>::Sampler::Sampler(SimpleVolume<VoxelType>* volume)
|
||||
//:mVolume(volume)
|
||||
//:this->mVolume(volume)
|
||||
{
|
||||
//Dodgy doing this - need to find how to call base constructor
|
||||
this->mVolume = volume;
|
||||
@ -54,7 +54,7 @@ namespace PolyVox
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
mVolume = rhs.mVolume;
|
||||
this->mVolume = rhs.mVolume;
|
||||
mXPosInVolume = rhs.mXPosInVolume;
|
||||
mYPosInVolume = rhs.mYPosInVolume;
|
||||
mZPosInVolume = rhs.mZPosInVolume;
|
||||
@ -110,7 +110,7 @@ namespace PolyVox
|
||||
{
|
||||
for(uint8_t x = 0; x < uSize; ++x)
|
||||
{
|
||||
tValue = (std::min)(tValue, mVolume->getVoxelAt(mXPosInVolume + x, mYPosInVolume + y, mZPosInVolume + z));
|
||||
tValue = (std::min)(tValue, this->mVolume->getVoxelAt(mXPosInVolume + x, mYPosInVolume + y, mZPosInVolume + z));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -137,27 +137,27 @@ namespace PolyVox
|
||||
mYPosInVolume = yPos;
|
||||
mZPosInVolume = zPos;
|
||||
|
||||
const int32_t uXBlock = mXPosInVolume >> mVolume->m_uBlockSideLengthPower;
|
||||
const int32_t uYBlock = mYPosInVolume >> mVolume->m_uBlockSideLengthPower;
|
||||
const int32_t uZBlock = mZPosInVolume >> mVolume->m_uBlockSideLengthPower;
|
||||
const int32_t uXBlock = mXPosInVolume >> this->mVolume->m_uBlockSideLengthPower;
|
||||
const int32_t uYBlock = mYPosInVolume >> this->mVolume->m_uBlockSideLengthPower;
|
||||
const int32_t uZBlock = mZPosInVolume >> this->mVolume->m_uBlockSideLengthPower;
|
||||
|
||||
const uint16_t uXPosInBlock = mXPosInVolume - (uXBlock << mVolume->m_uBlockSideLengthPower);
|
||||
const uint16_t uYPosInBlock = mYPosInVolume - (uYBlock << mVolume->m_uBlockSideLengthPower);
|
||||
const uint16_t uZPosInBlock = mZPosInVolume - (uZBlock << mVolume->m_uBlockSideLengthPower);
|
||||
const uint16_t uXPosInBlock = mXPosInVolume - (uXBlock << this->mVolume->m_uBlockSideLengthPower);
|
||||
const uint16_t uYPosInBlock = mYPosInVolume - (uYBlock << this->mVolume->m_uBlockSideLengthPower);
|
||||
const uint16_t uZPosInBlock = mZPosInVolume - (uZBlock << this->mVolume->m_uBlockSideLengthPower);
|
||||
|
||||
const uint32_t uVoxelIndexInBlock = uXPosInBlock +
|
||||
uYPosInBlock * mVolume->m_uBlockSideLength +
|
||||
uZPosInBlock * mVolume->m_uBlockSideLength * mVolume->m_uBlockSideLength;
|
||||
uYPosInBlock * this->mVolume->m_uBlockSideLength +
|
||||
uZPosInBlock * this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength;
|
||||
|
||||
if(mVolume->m_regValidRegionInBlocks.containsPoint(Vector3DInt32(uXBlock, uYBlock, uZBlock)))
|
||||
if(this->mVolume->m_regValidRegionInBlocks.containsPoint(Vector3DInt32(uXBlock, uYBlock, uZBlock)))
|
||||
{
|
||||
Block* pUncompressedCurrentBlock = mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock);
|
||||
Block* pUncompressedCurrentBlock = this->mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock);
|
||||
|
||||
mCurrentVoxel = pUncompressedCurrentBlock->m_tUncompressedData + uVoxelIndexInBlock;
|
||||
}
|
||||
else
|
||||
{
|
||||
mCurrentVoxel = mVolume->m_pUncompressedBorderData + uVoxelIndexInBlock;
|
||||
mCurrentVoxel = this->mVolume->m_pUncompressedBorderData + uVoxelIndexInBlock;
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ namespace PolyVox
|
||||
void SimpleVolume<VoxelType>::Sampler::movePositiveX(void)
|
||||
{
|
||||
//Note the *pre* increament here
|
||||
if((++mXPosInVolume) % mVolume->m_uBlockSideLength != 0)
|
||||
if((++mXPosInVolume) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
++mCurrentVoxel;
|
||||
@ -181,10 +181,10 @@ namespace PolyVox
|
||||
void SimpleVolume<VoxelType>::Sampler::movePositiveY(void)
|
||||
{
|
||||
//Note the *pre* increament here
|
||||
if((++mYPosInVolume) % mVolume->m_uBlockSideLength != 0)
|
||||
if((++mYPosInVolume) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
mCurrentVoxel += mVolume->m_uBlockSideLength;
|
||||
mCurrentVoxel += this->mVolume->m_uBlockSideLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -197,10 +197,10 @@ namespace PolyVox
|
||||
void SimpleVolume<VoxelType>::Sampler::movePositiveZ(void)
|
||||
{
|
||||
//Note the *pre* increament here
|
||||
if((++mZPosInVolume) % mVolume->m_uBlockSideLength != 0)
|
||||
if((++mZPosInVolume) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
mCurrentVoxel += mVolume->m_uBlockSideLength * mVolume->m_uBlockSideLength;
|
||||
mCurrentVoxel += this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -213,7 +213,7 @@ namespace PolyVox
|
||||
void SimpleVolume<VoxelType>::Sampler::moveNegativeX(void)
|
||||
{
|
||||
//Note the *post* decreament here
|
||||
if((mXPosInVolume--) % mVolume->m_uBlockSideLength != 0)
|
||||
if((mXPosInVolume--) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
--mCurrentVoxel;
|
||||
@ -229,10 +229,10 @@ namespace PolyVox
|
||||
void SimpleVolume<VoxelType>::Sampler::moveNegativeY(void)
|
||||
{
|
||||
//Note the *post* decreament here
|
||||
if((mYPosInVolume--) % mVolume->m_uBlockSideLength != 0)
|
||||
if((mYPosInVolume--) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
mCurrentVoxel -= mVolume->m_uBlockSideLength;
|
||||
mCurrentVoxel -= this->mVolume->m_uBlockSideLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -245,10 +245,10 @@ namespace PolyVox
|
||||
void SimpleVolume<VoxelType>::Sampler::moveNegativeZ(void)
|
||||
{
|
||||
//Note the *post* decreament here
|
||||
if((mZPosInVolume--) % mVolume->m_uBlockSideLength != 0)
|
||||
if((mZPosInVolume--) % this->mVolume->m_uBlockSideLength != 0)
|
||||
{
|
||||
//No need to compute new block.
|
||||
mCurrentVoxel -= mVolume->m_uBlockSideLength * mVolume->m_uBlockSideLength;
|
||||
mCurrentVoxel -= this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -262,9 +262,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 - mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -272,9 +272,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 - mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -282,9 +282,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 - mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -292,9 +292,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -304,7 +304,7 @@ namespace PolyVox
|
||||
{
|
||||
return *(mCurrentVoxel - 1);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -312,9 +312,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -322,9 +322,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 + mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -332,9 +332,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 + mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -342,9 +342,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - 1 + mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume-1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@ -354,9 +354,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -364,9 +364,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -374,9 +374,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume-1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -384,9 +384,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -400,9 +400,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -410,9 +410,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -420,9 +420,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -430,9 +430,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume,mYPosInVolume+1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@ -442,9 +442,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 - mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -452,9 +452,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 - mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -462,9 +462,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 - mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume-1,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -472,9 +472,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -484,7 +484,7 @@ namespace PolyVox
|
||||
{
|
||||
return *(mCurrentVoxel + 1);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -492,9 +492,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume,mZPosInVolume+1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -502,9 +502,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 + mVolume->m_uBlockSideLength - mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength - this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume-1);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -512,9 +512,9 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 + mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -522,8 +522,8 @@ namespace PolyVox
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
return *(mCurrentVoxel + 1 + mVolume->m_uBlockSideLength + mVolume->m_uBlockSideLength*mVolume->m_uBlockSideLength);
|
||||
return *(mCurrentVoxel + 1 + this->mVolume->m_uBlockSideLength + this->mVolume->m_uBlockSideLength*this->mVolume->m_uBlockSideLength);
|
||||
}
|
||||
return mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
return this->mVolume->getVoxelAt(mXPosInVolume+1,mYPosInVolume+1,mZPosInVolume+1);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user