diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h index 6a7aaa22..2d1b6144 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h @@ -75,8 +75,15 @@ namespace PolyVox * if the voxel type is 'float' then the representable range is -FLT_MAX to FLT_MAX and the threshold will be set to zero. */ DefaultMarchingCubesController(void) - :m_tThreshold(((std::numeric_limits::min)() + (std::numeric_limits::max)()) / 2) - { + { + if (std::is_signed()) + { + m_tThreshold = DensityType(0); + } + else + { + m_tThreshold = (((std::numeric_limits::min)() + (std::numeric_limits::max)()) / 2); + } } /**