diff --git a/library/PolyVoxCore/include/PolyVoxCore/Density.h b/library/PolyVoxCore/include/PolyVoxCore/Density.h index a5e74616..e4fbc6e5 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Density.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Density.h @@ -65,9 +65,9 @@ namespace PolyVox void setDensity(DensityType uDensity) { m_uDensity = uDensity; } void setMaterial(uint32_t uMaterial) { assert(false); } //Cannot set material on voxel of type Density - static DensityType getMaxDensity() throw() { return (0x01 << (sizeof(DensityType) * 8)) - 1; } - static DensityType getMinDensity() throw() { return 0; } - static DensityType getThreshold() throw() {return 0x01 << ((sizeof(DensityType) * 8) - 1);} + static DensityType getMaxDensity() throw() { return (std::numeric_limits::max)(); } + static DensityType getMinDensity() throw() { return (std::numeric_limits::min)(); } + static DensityType getThreshold() throw() { return (std::numeric_limits::max)() / 2; } private: DensityType m_uDensity;