diff --git a/include/math/box2.h b/include/math/box2.h index 8ed1621935..467558e676 100644 --- a/include/math/box2.h +++ b/include/math/box2.h @@ -28,24 +28,9 @@ #define __BOX2_H #include +#include -template -class BOX2_TRAITS -{ -}; - -template <> -class BOX2_TRAITS -{ -public: - enum - { - c_max_size = INT_MAX - 1, - c_min_coord_value = INT_MIN / 2 + 1 - }; -}; - /** * Class BOX2 * handles a 2-D bounding box, built on top of an origin point @@ -59,8 +44,9 @@ private: Vec m_Size; // Rectangle Size public: - typedef typename Vec::coord_type coord_type; - typedef typename Vec::extended_type ecoord_type; + typedef typename Vec::coord_type coord_type; + typedef typename Vec::extended_type ecoord_type; + typedef typename std::numeric_limits coord_limits; BOX2() {}; @@ -73,8 +59,8 @@ public: void SetMaximum() { - m_Pos.x = m_Pos.y = BOX2_TRAITS().c_min_coord_value; - m_Size.x = m_Size.y = BOX2_TRAITS().c_max_size; + m_Pos.x = m_Pos.y = coord_limits::min() / 2 + coord_limits::epsilon(); + m_Size.x = m_Size.y = coord_limits::max() - coord_limits::epsilon(); } Vec Centre() const