Applied patch from ker such that int32_t's are now used instead of uint16_t's for addressing voxel positions.

This commit is contained in:
David Williams
2011-03-03 23:00:00 +00:00
parent 3c34d401fc
commit 4ef0cfb468
24 changed files with 278 additions and 251 deletions

View File

@ -49,9 +49,9 @@ namespace PolyVox
template <typename VoxelType>
Vector3DFloat computeDecimatedCentralDifferenceGradient(const VolumeSampler<VoxelType>& volIter)
{
const uint16_t x = volIter.getPosX();
const uint16_t y = volIter.getPosY();
const uint16_t z = volIter.getPosZ();
const int32_t x = volIter.getPosX();
const int32_t y = volIter.getPosY();
const int32_t z = volIter.getPosZ();
//FIXME - bitwise way of doing this?
VoxelType voxel1nx = volIter.getVoxelAt(x-2, y ,z ) > 0 ? 1: 0;
@ -74,9 +74,9 @@ namespace PolyVox
template <typename VoxelType>
Vector3DFloat computeSmoothCentralDifferenceGradient(VolumeSampler<VoxelType>& volIter)
{
uint16_t initialX = volIter.getPosX();
uint16_t initialY = volIter.getPosY();
uint16_t initialZ = volIter.getPosZ();
int32_t initialX = volIter.getPosX();
int32_t initialY = volIter.getPosY();
int32_t initialZ = volIter.getPosZ();
//FIXME - bitwise way of doing this?
volIter.setPosition(initialX-1, initialY, initialZ);
@ -191,9 +191,9 @@ namespace PolyVox
static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, {
{3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } };
uint16_t initialX = volIter.getPosX();
uint16_t initialY = volIter.getPosY();
uint16_t initialZ = volIter.getPosZ();
int32_t initialX = volIter.getPosX();
int32_t initialY = volIter.getPosY();
int32_t initialZ = volIter.getPosZ();
volIter.setPosition(initialX-1, initialY-1, initialZ-1); const float pVoxel1nx1ny1nz = computeSmoothedVoxel(volIter);
volIter.setPosition(initialX-1, initialY-1, initialZ ); const float pVoxel1nx1ny0pz = computeSmoothedVoxel(volIter);