Renamed getMidDensity() to getThreshold().
This commit is contained in:
parent
bffacbcb6a
commit
8d000e9235
@ -54,7 +54,7 @@ namespace PolyVox
|
||||
|
||||
static Type getMaxDensity() throw();
|
||||
static Type getMinDensity() throw();
|
||||
static Type getMidDensity() throw();
|
||||
static Type getThreshold() throw();
|
||||
|
||||
private:
|
||||
Type m_uMaterial : NoOfMaterialBits;
|
||||
|
@ -107,7 +107,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename Type, uint8_t NoOfMaterialBits, uint8_t NoOfDensityBits>
|
||||
Type MaterialDensityPair<Type, NoOfMaterialBits, NoOfDensityBits>::getMidDensity() throw()
|
||||
Type MaterialDensityPair<Type, NoOfMaterialBits, NoOfDensityBits>::getThreshold() throw()
|
||||
{
|
||||
return 0x01 << (NoOfDensityBits - 1);
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ namespace PolyVox
|
||||
|
||||
iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY | iPreviousCubeIndexZ;
|
||||
|
||||
if (v111.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 128;
|
||||
if (v111.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 128;
|
||||
}
|
||||
else //previous X not available
|
||||
{
|
||||
@ -277,8 +277,8 @@ namespace PolyVox
|
||||
|
||||
iCubeIndex = iPreviousCubeIndexY | iPreviousCubeIndexZ;
|
||||
|
||||
if (v011.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 64;
|
||||
if (v111.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 128;
|
||||
if (v011.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 64;
|
||||
if (v111.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 128;
|
||||
}
|
||||
}
|
||||
else //previous Y not available
|
||||
@ -299,8 +299,8 @@ namespace PolyVox
|
||||
|
||||
iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexZ;
|
||||
|
||||
if (v101.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 32;
|
||||
if (v111.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 128;
|
||||
if (v101.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 32;
|
||||
if (v111.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 128;
|
||||
}
|
||||
else //previous X not available
|
||||
{
|
||||
@ -313,10 +313,10 @@ namespace PolyVox
|
||||
uint8_t iPreviousCubeIndexZ = pPreviousBitmask[uXRegSpace][uYRegSpace];
|
||||
iCubeIndex = iPreviousCubeIndexZ >> 4;
|
||||
|
||||
if (v001.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 16;
|
||||
if (v101.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 32;
|
||||
if (v011.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 64;
|
||||
if (v111.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 128;
|
||||
if (v001.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 16;
|
||||
if (v101.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 32;
|
||||
if (v011.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 64;
|
||||
if (v111.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 128;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -341,8 +341,8 @@ namespace PolyVox
|
||||
|
||||
iCubeIndex = iPreviousCubeIndexX | iPreviousCubeIndexY;
|
||||
|
||||
if (v110.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 8;
|
||||
if (v111.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 128;
|
||||
if (v110.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 8;
|
||||
if (v111.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 128;
|
||||
}
|
||||
else //previous X not available
|
||||
{
|
||||
@ -359,10 +359,10 @@ namespace PolyVox
|
||||
|
||||
iCubeIndex = iPreviousCubeIndexY;
|
||||
|
||||
if (v010.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 4;
|
||||
if (v110.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 8;
|
||||
if (v011.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 64;
|
||||
if (v111.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 128;
|
||||
if (v010.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 4;
|
||||
if (v110.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 8;
|
||||
if (v011.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 64;
|
||||
if (v111.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 128;
|
||||
}
|
||||
}
|
||||
else //previous Y not available
|
||||
@ -382,10 +382,10 @@ namespace PolyVox
|
||||
|
||||
iCubeIndex = iPreviousCubeIndexX;
|
||||
|
||||
if (v100.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 2;
|
||||
if (v110.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 8;
|
||||
if (v101.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 32;
|
||||
if (v111.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 128;
|
||||
if (v100.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 2;
|
||||
if (v110.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 8;
|
||||
if (v101.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 32;
|
||||
if (v111.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 128;
|
||||
}
|
||||
else //previous X not available
|
||||
{
|
||||
@ -399,14 +399,14 @@ namespace PolyVox
|
||||
v011 = m_sampVolume.peekVoxel0px1py1pz();
|
||||
v111 = m_sampVolume.peekVoxel1px1py1pz();
|
||||
|
||||
if (v000.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 1;
|
||||
if (v100.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 2;
|
||||
if (v010.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 4;
|
||||
if (v110.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 8;
|
||||
if (v001.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 16;
|
||||
if (v101.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 32;
|
||||
if (v011.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 64;
|
||||
if (v111.getDensity() < VoxelType::getMidDensity()) iCubeIndex |= 128;
|
||||
if (v000.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 1;
|
||||
if (v100.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 2;
|
||||
if (v010.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 4;
|
||||
if (v110.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 8;
|
||||
if (v001.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 16;
|
||||
if (v101.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 32;
|
||||
if (v011.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 64;
|
||||
if (v111.getDensity() < VoxelType::getThreshold()) iCubeIndex |= 128;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -472,7 +472,7 @@ namespace PolyVox
|
||||
const Vector3DFloat n100 = computeCentralDifferenceGradient(m_sampVolume);
|
||||
|
||||
//float fInterp = static_cast<float>(v100.getDensity() - VoxelType::getMinDensity()) / static_cast<float>(VoxelType::getMaxDensity() - VoxelType::getMinDensity());
|
||||
float fInterp = static_cast<float>(VoxelType::getMidDensity() - v000.getDensity()) / static_cast<float>(v100.getDensity() - v000.getDensity());
|
||||
float fInterp = static_cast<float>(VoxelType::getThreshold() - v000.getDensity()) / static_cast<float>(v100.getDensity() - v000.getDensity());
|
||||
//fInterp = 0.5f;
|
||||
|
||||
const Vector3DFloat v3dPosition(static_cast<float>(uXVolSpace - m_regInputCropped.getLowerCorner().getX()) + fInterp, static_cast<float>(uYVolSpace - m_regInputCropped.getLowerCorner().getY()), static_cast<float>(uZVolSpace - m_regInputCropped.getLowerCorner().getZ()));
|
||||
@ -500,7 +500,7 @@ namespace PolyVox
|
||||
const VoxelType v010 = m_sampVolume.getVoxel();
|
||||
const Vector3DFloat n010 = computeCentralDifferenceGradient(m_sampVolume);
|
||||
|
||||
float fInterp = static_cast<float>(VoxelType::getMidDensity() - v000.getDensity()) / static_cast<float>(v010.getDensity() - v000.getDensity());
|
||||
float fInterp = static_cast<float>(VoxelType::getThreshold() - v000.getDensity()) / static_cast<float>(v010.getDensity() - v000.getDensity());
|
||||
//fInterp = 0.5f;
|
||||
|
||||
const Vector3DFloat v3dPosition(static_cast<float>(uXVolSpace - m_regInputCropped.getLowerCorner().getX()), static_cast<float>(uYVolSpace - m_regInputCropped.getLowerCorner().getY()) + fInterp, static_cast<float>(uZVolSpace - m_regInputCropped.getLowerCorner().getZ()));
|
||||
@ -528,7 +528,7 @@ namespace PolyVox
|
||||
const VoxelType v001 = m_sampVolume.getVoxel();
|
||||
const Vector3DFloat n001 = computeCentralDifferenceGradient(m_sampVolume);
|
||||
|
||||
float fInterp = static_cast<float>(VoxelType::getMidDensity() - v000.getDensity()) / static_cast<float>(v001.getDensity() - v000.getDensity());
|
||||
float fInterp = static_cast<float>(VoxelType::getThreshold() - v000.getDensity()) / static_cast<float>(v001.getDensity() - v000.getDensity());
|
||||
//fInterp = 0.5f;
|
||||
|
||||
const Vector3DFloat v3dPosition(static_cast<float>(uXVolSpace - m_regInputCropped.getLowerCorner().getX()), static_cast<float>(uYVolSpace - m_regInputCropped.getLowerCorner().getY()), static_cast<float>(uZVolSpace - m_regInputCropped.getLowerCorner().getZ()) + fInterp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user