Various refactoring of volume stuff. Including moving region growing code to scrapyard.

This commit is contained in:
David Williams
2008-04-20 21:32:44 +00:00
parent efce9b8c95
commit 286ba35b42
6 changed files with 25 additions and 249 deletions

View File

@ -130,35 +130,6 @@ namespace PolyVox
return sum;
}
template <typename VoxelType>
void VolumeIterator<VoxelType>::setVoxelAt(const uint16_t xPosition, const uint16_t yPosition, const uint16_t zPosition, const VoxelType value)
{
const uint16_t blockX = xPosition >> POLYVOX_BLOCK_SIDE_LENGTH_POWER;
const uint16_t blockY = yPosition >> POLYVOX_BLOCK_SIDE_LENGTH_POWER;
const uint16_t blockZ = zPosition >> POLYVOX_BLOCK_SIDE_LENGTH_POWER;
const uint16_t xOffset = xPosition - (blockX << POLYVOX_BLOCK_SIDE_LENGTH_POWER);
const uint16_t yOffset = yPosition - (blockY << POLYVOX_BLOCK_SIDE_LENGTH_POWER);
const uint16_t zOffset = zPosition - (blockZ << POLYVOX_BLOCK_SIDE_LENGTH_POWER);
Block<VoxelType>* block = mVolume.mBlocks
[
blockX +
blockY * POLYVOX_VOLUME_SIDE_LENGTH_IN_BLOCKS +
blockZ * POLYVOX_VOLUME_SIDE_LENGTH_IN_BLOCKS * POLYVOX_VOLUME_SIDE_LENGTH_IN_BLOCKS
];
/*if(!block.unique())
{
Block* copy(new Block(*block));
block = copy;
mCurrentVoxel = block->mData + mVoxelIndexInBlock;
}*/
block->setVoxelAt(xOffset,yOffset,zOffset, value);
}
template <typename VoxelType>
Vector3DFloat VolumeIterator<VoxelType>::getCentralDifferenceGradient(void) const
{