Work on custom thresholds in SurfaceExtractionController.

This commit is contained in:
unknown
2012-07-09 17:24:55 +02:00
parent 949528b07a
commit 1217ea1fd8
6 changed files with 52 additions and 14 deletions

View File

@ -109,6 +109,17 @@ namespace PolyVox
typedef Type DensityType;
typedef float MaterialType;
SurfaceExtractionController(void)
{
// Default to a threshold value halfway between the min and max possible values.
m_tThreshold = (Density<Type>::getMinDensity() + Density<Type>::getMaxDensity()) / 2;
}
SurfaceExtractionController(DensityType tThreshold)
{
m_tThreshold = tThreshold;
}
DensityType convertToDensity(Density<Type> voxel)
{
return voxel.getDensity();
@ -120,10 +131,12 @@ namespace PolyVox
}
DensityType getThreshold(void)
{
// Returns a threshold value halfway between the min and max possible values.
return (Density<Type>::getMinDensity() + Density<Type>::getMaxDensity()) / 2;
{
return m_tThreshold;
}
private:
DensityType m_tThreshold;
};
}