diff --git a/components/terrain/quadtreeworld.cpp b/components/terrain/quadtreeworld.cpp index 1d968ddc49..56fa8b7f39 100644 --- a/components/terrain/quadtreeworld.cpp +++ b/components/terrain/quadtreeworld.cpp @@ -2,6 +2,7 @@ #include +#include #include #include @@ -311,11 +312,11 @@ void updateWaterCullingView(HeightCullCallback* callback, ViewData* vd, osgUtil: { if (!(cv->getTraversalMask() & callback->getCullMask())) return; - float lowZ = FLT_MAX; + float lowZ = std::numeric_limits::max(); float highZ = callback->getHighZ(); if (cv->getEyePoint().z() <= highZ || outofworld) { - callback->setLowZ(-FLT_MAX); + callback->setLowZ(-std::numeric_limits::max()); return; } cv->pushCurrentMask(); diff --git a/components/terrain/world.hpp b/components/terrain/world.hpp index 92eb69b80b..fb6c45967a 100644 --- a/components/terrain/world.hpp +++ b/components/terrain/world.hpp @@ -7,9 +7,9 @@ #include #include +#include #include #include -#include #include "defs.hpp" #include "cellborder.hpp" @@ -43,7 +43,7 @@ namespace Terrain class HeightCullCallback : public osg::NodeCallback { public: - HeightCullCallback() : mLowZ(-FLT_MAX), mHighZ(FLT_MAX), mMask(~0) {} + HeightCullCallback() : mLowZ(-std::numeric_limits::max()), mHighZ(std::numeric_limits::max()), mMask(~0) {} void setLowZ(float z) {