#ifndef BOUNDING_BOX_HPP
#define BOUNDING_BOX_HPP

//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include <Extern/GLMConfig.hpp>
#include <Math/Vector.hpp>
#include <limits>
//-----------------------------------------------------------------------------
#include <Tools/Allocator.hpp>

namespace Math
{
	using namespace glm;

	template<class genType>
	struct tbbox
	{
		tbbox():
		min(std::numeric_limits<typename genType::value_type>::max()),
		max(std::numeric_limits<typename genType::value_type>::min()) {}
		
		genType min, max;

		tbbox& operator +=(const tbbox& _copy)
		{
			max = max(*this,_copy);
			min = max(*this,_copy);
			return *this;
		}
	};

	template<class genType>
	tbbox<genType> operator+(const tbbox<genType>& _b1, 
				 			 const tbbox<genType>& _b2)
	{
		tbbox<genType> copy(_b1);
		return _b1 += _b2;
	}

	// Type definition for 'float'
	typedef tbbox<vec1> bbox1;
	typedef tbbox<vec2> bbox2;
	typedef tbbox<vec3> bbox3;

	// Type definition for 'int'
	typedef tbbox<ivec1> ibbox1;
	typedef tbbox<ivec2> ibbox2;
	typedef tbbox<ivec3> ibbox3;

	// Type definition for 'uint'
	typedef tbbox<uvec1> ubbox1;
	typedef tbbox<uvec2> ubbox2;
	typedef tbbox<uvec3> ubbox3;

	// Float bounding box output
	//inline std::string ToString(const bbox1& _value);
	//inline std::string ToString(const bbox2& _value);
	//inline std::string ToString(const bbox3& _value);
}

//-----------------------------------------------------------------------------
// Include inline definitions
//-----------------------------------------------------------------------------
//#include <Math/BoundingBox.inl>

#endif /*BOUNDING_BOX_HPP*/
