diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index d48abdfe..884d46dd 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -205,15 +205,6 @@ namespace PolyVox inline VoxelType peekVoxel1px1py1pz(void) const; private: - - //The current volume - //LargeVolume* mVolume; - - //The current position in the volume - int32_t mXPosInVolume; - int32_t mYPosInVolume; - int32_t mZPosInVolume; - //Other current position information VoxelType* mCurrentVoxel; }; diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h index 0fa08c2c..b2bee28c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h @@ -95,14 +95,6 @@ namespace PolyVox inline VoxelType peekVoxel1px1py1pz(void) const; private: - //The current volume - //RawVolume* mVolume; - - //The current position in the volume - int32_t mXPosInVolume; - int32_t mYPosInVolume; - int32_t mZPosInVolume; - //Other current position information VoxelType* mCurrentVoxel; diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl index 431a2085..fb8e4f61 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl @@ -32,9 +32,6 @@ namespace PolyVox template RawVolume::Sampler::Sampler(RawVolume* volume) :Volume::Sampler< RawVolume >(volume) - ,mXPosInVolume(0) - ,mYPosInVolume(0) - ,mZPosInVolume(0) ,mCurrentVoxel(0) ,m_bIsCurrentPositionValid(false) { diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h index eba5177a..b9284e11 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h @@ -119,16 +119,7 @@ namespace PolyVox inline VoxelType peekVoxel1px1py0pz(void) const; inline VoxelType peekVoxel1px1py1pz(void) const; - private: - - //The current volume - //SimpleVolume* mVolume; - - //The current position in the volume - int32_t mXPosInVolume; - int32_t mYPosInVolume; - int32_t mZPosInVolume; - + private: //Other current position information VoxelType* mCurrentVoxel; }; diff --git a/library/PolyVoxCore/include/PolyVoxCore/Volume.h b/library/PolyVoxCore/include/PolyVoxCore/Volume.h index b9d367aa..51b7634a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Volume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Volume.h @@ -93,9 +93,10 @@ namespace PolyVox protected: DerivedVolumeType* mVolume; - int32_t mXPos; - int32_t mYPos; - int32_t mZPos; + //The current position in the volume + int32_t mXPosInVolume; + int32_t mYPosInVolume; + int32_t mZPosInVolume; }; #endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/VolumeSampler.inl index 4b7394dd..68b2e314 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeSampler.inl @@ -33,9 +33,9 @@ namespace PolyVox template Volume::Sampler::Sampler(DerivedVolumeType* volume) :mVolume(volume) - ,mXPos(0) - ,mYPos(0) - ,mZPos(0) + ,mXPosInVolume(0) + ,mYPosInVolume(0) + ,mZPosInVolume(0) { } @@ -49,151 +49,151 @@ namespace PolyVox template int32_t Volume::Sampler::getPosX(void) const { - return mXPos; + return mXPosInVolume; } template template int32_t Volume::Sampler::getPosY(void) const { - return mYPos; + return mYPosInVolume; } template template int32_t Volume::Sampler::getPosZ(void) const { - return mZPos; + return mZPosInVolume; } template template VoxelType Volume::Sampler::getVoxel(void) const { - return mVolume->getVoxelAt(mXPos, mYPos, mZPos); + return mVolume->getVoxelAt(mXPosInVolume, mYPosInVolume, mZPosInVolume); } template template void Volume::Sampler::setPosition(const Vector3DInt32& v3dNewPos) { - mXPos = v3dNewPos.getX(); - mYPos = v3dNewPos.getY(); - mZPos = v3dNewPos.getZ(); + mXPosInVolume = v3dNewPos.getX(); + mYPosInVolume = v3dNewPos.getY(); + mZPosInVolume = v3dNewPos.getZ(); } template template void Volume::Sampler::setPosition(int32_t xPos, int32_t yPos, int32_t zPos) { - mXPos = xPos; - mYPos = yPos; - mZPos = zPos; + mXPosInVolume = xPos; + mYPosInVolume = yPos; + mZPosInVolume = zPos; } template template void Volume::Sampler::movePositiveX(void) { - mXPos++; + mXPosInVolume++; } template template void Volume::Sampler::movePositiveY(void) { - mYPos++; + mYPosInVolume++; } template template void Volume::Sampler::movePositiveZ(void) { - mZPos++; + mZPosInVolume++; } template template void Volume::Sampler::moveNegativeX(void) { - mXPos--; + mXPosInVolume--; } template template void Volume::Sampler::moveNegativeY(void) { - mYPos--; + mYPosInVolume--; } template template void Volume::Sampler::moveNegativeZ(void) { - mZPos--; + mZPosInVolume--; } template template VoxelType Volume::Sampler::peekVoxel1nx1ny1nz(void) const { - return mVolume->getVoxelAt(mXPos - 1, mYPos - 1, mZPos - 1); + return mVolume->getVoxelAt(mXPosInVolume - 1, mYPosInVolume - 1, mZPosInVolume - 1); } template template VoxelType Volume::Sampler::peekVoxel1nx1ny0pz(void) const { - return mVolume->getVoxelAt(mXPos - 1, mYPos - 1, mZPos ); + return mVolume->getVoxelAt(mXPosInVolume - 1, mYPosInVolume - 1, mZPosInVolume ); } template template VoxelType Volume::Sampler::peekVoxel1nx1ny1pz(void) const { - return mVolume->getVoxelAt(mXPos - 1, mYPos - 1, mZPos + 1); + return mVolume->getVoxelAt(mXPosInVolume - 1, mYPosInVolume - 1, mZPosInVolume + 1); } template template VoxelType Volume::Sampler::peekVoxel1nx0py1nz(void) const { - return mVolume->getVoxelAt(mXPos - 1, mYPos , mZPos - 1); + return mVolume->getVoxelAt(mXPosInVolume - 1, mYPosInVolume , mZPosInVolume - 1); } template template VoxelType Volume::Sampler::peekVoxel1nx0py0pz(void) const { - return mVolume->getVoxelAt(mXPos - 1, mYPos , mZPos ); + return mVolume->getVoxelAt(mXPosInVolume - 1, mYPosInVolume , mZPosInVolume ); } template template VoxelType Volume::Sampler::peekVoxel1nx0py1pz(void) const { - return mVolume->getVoxelAt(mXPos - 1, mYPos , mZPos + 1); + return mVolume->getVoxelAt(mXPosInVolume - 1, mYPosInVolume , mZPosInVolume + 1); } template template VoxelType Volume::Sampler::peekVoxel1nx1py1nz(void) const { - return mVolume->getVoxelAt(mXPos - 1, mYPos + 1, mZPos - 1); + return mVolume->getVoxelAt(mXPosInVolume - 1, mYPosInVolume + 1, mZPosInVolume - 1); } template template VoxelType Volume::Sampler::peekVoxel1nx1py0pz(void) const { - return mVolume->getVoxelAt(mXPos - 1, mYPos + 1, mZPos ); + return mVolume->getVoxelAt(mXPosInVolume - 1, mYPosInVolume + 1, mZPosInVolume ); } template template VoxelType Volume::Sampler::peekVoxel1nx1py1pz(void) const { - return mVolume->getVoxelAt(mXPos - 1, mYPos + 1, mZPos + 1); + return mVolume->getVoxelAt(mXPosInVolume - 1, mYPosInVolume + 1, mZPosInVolume + 1); } ////////////////////////////////////////////////////////////////////////// @@ -202,63 +202,63 @@ namespace PolyVox template VoxelType Volume::Sampler::peekVoxel0px1ny1nz(void) const { - return mVolume->getVoxelAt(mXPos , mYPos - 1, mZPos - 1); + return mVolume->getVoxelAt(mXPosInVolume , mYPosInVolume - 1, mZPosInVolume - 1); } template template VoxelType Volume::Sampler::peekVoxel0px1ny0pz(void) const { - return mVolume->getVoxelAt(mXPos , mYPos - 1, mZPos ); + return mVolume->getVoxelAt(mXPosInVolume , mYPosInVolume - 1, mZPosInVolume ); } template template VoxelType Volume::Sampler::peekVoxel0px1ny1pz(void) const { - return mVolume->getVoxelAt(mXPos , mYPos - 1, mZPos + 1); + return mVolume->getVoxelAt(mXPosInVolume , mYPosInVolume - 1, mZPosInVolume + 1); } template template VoxelType Volume::Sampler::peekVoxel0px0py1nz(void) const { - return mVolume->getVoxelAt(mXPos , mYPos , mZPos - 1); + return mVolume->getVoxelAt(mXPosInVolume , mYPosInVolume , mZPosInVolume - 1); } template template VoxelType Volume::Sampler::peekVoxel0px0py0pz(void) const { - return mVolume->getVoxelAt(mXPos , mYPos , mZPos ); + return mVolume->getVoxelAt(mXPosInVolume , mYPosInVolume , mZPosInVolume ); } template template VoxelType Volume::Sampler::peekVoxel0px0py1pz(void) const { - return mVolume->getVoxelAt(mXPos , mYPos , mZPos + 1); + return mVolume->getVoxelAt(mXPosInVolume , mYPosInVolume , mZPosInVolume + 1); } template template VoxelType Volume::Sampler::peekVoxel0px1py1nz(void) const { - return mVolume->getVoxelAt(mXPos , mYPos + 1, mZPos - 1); + return mVolume->getVoxelAt(mXPosInVolume , mYPosInVolume + 1, mZPosInVolume - 1); } template template VoxelType Volume::Sampler::peekVoxel0px1py0pz(void) const { - return mVolume->getVoxelAt(mXPos , mYPos + 1, mZPos ); + return mVolume->getVoxelAt(mXPosInVolume , mYPosInVolume + 1, mZPosInVolume ); } template template VoxelType Volume::Sampler::peekVoxel0px1py1pz(void) const { - return mVolume->getVoxelAt(mXPos , mYPos + 1, mZPos + 1); + return mVolume->getVoxelAt(mXPosInVolume , mYPosInVolume + 1, mZPosInVolume + 1); } ////////////////////////////////////////////////////////////////////////// @@ -267,62 +267,62 @@ namespace PolyVox template VoxelType Volume::Sampler::peekVoxel1px1ny1nz(void) const { - return mVolume->getVoxelAt(mXPos + 1, mYPos - 1, mZPos - 1); + return mVolume->getVoxelAt(mXPosInVolume + 1, mYPosInVolume - 1, mZPosInVolume - 1); } template template VoxelType Volume::Sampler::peekVoxel1px1ny0pz(void) const { - return mVolume->getVoxelAt(mXPos + 1, mYPos - 1, mZPos ); + return mVolume->getVoxelAt(mXPosInVolume + 1, mYPosInVolume - 1, mZPosInVolume ); } template template VoxelType Volume::Sampler::peekVoxel1px1ny1pz(void) const { - return mVolume->getVoxelAt(mXPos + 1, mYPos - 1, mZPos + 1); + return mVolume->getVoxelAt(mXPosInVolume + 1, mYPosInVolume - 1, mZPosInVolume + 1); } template template VoxelType Volume::Sampler::peekVoxel1px0py1nz(void) const { - return mVolume->getVoxelAt(mXPos + 1, mYPos , mZPos - 1); + return mVolume->getVoxelAt(mXPosInVolume + 1, mYPosInVolume , mZPosInVolume - 1); } template template VoxelType Volume::Sampler::peekVoxel1px0py0pz(void) const { - return mVolume->getVoxelAt(mXPos + 1, mYPos , mZPos ); + return mVolume->getVoxelAt(mXPosInVolume + 1, mYPosInVolume , mZPosInVolume ); } template template VoxelType Volume::Sampler::peekVoxel1px0py1pz(void) const { - return mVolume->getVoxelAt(mXPos + 1, mYPos , mZPos + 1); + return mVolume->getVoxelAt(mXPosInVolume + 1, mYPosInVolume , mZPosInVolume + 1); } template template VoxelType Volume::Sampler::peekVoxel1px1py1nz(void) const { - return mVolume->getVoxelAt(mXPos + 1, mYPos + 1, mZPos - 1); + return mVolume->getVoxelAt(mXPosInVolume + 1, mYPosInVolume + 1, mZPosInVolume - 1); } template template VoxelType Volume::Sampler::peekVoxel1px1py0pz(void) const { - return mVolume->getVoxelAt(mXPos + 1, mYPos + 1, mZPos ); + return mVolume->getVoxelAt(mXPosInVolume + 1, mYPosInVolume + 1, mZPosInVolume ); } template template VoxelType Volume::Sampler::peekVoxel1px1py1pz(void) const { - return mVolume->getVoxelAt(mXPos + 1, mYPos + 1, mZPos + 1); + return mVolume->getVoxelAt(mXPosInVolume + 1, mYPosInVolume + 1, mZPosInVolume + 1); } }