///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2007-03-05
// Updated : 2007-03-05
// Licence : This source is under MIT License
// File    : glm/gtx/matrix_query.h
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __glm_gtx_matrix_query__
#define __glm_gtx_matrix_query__

// Dependency:
#include "../../glm.h"
//#include <cfloat>
#include <limits>

namespace glm
{
	template<typename T> bool isNullGTX(const detail::tmat2x2<T>& m, const T epsilon = std::numeric_limits<T>::epsilon());
	template<typename T> bool isNullGTX(const detail::tmat3x3<T>& m, const T epsilon = std::numeric_limits<T>::epsilon());
	template<typename T> bool isNullGTX(const detail::tmat4x4<T>& m, const T epsilon = std::numeric_limits<T>::epsilon());

	template<typename genType> bool isIdentityGTX(const genType& m, const typename genType::value_type epsilon = std::numeric_limits<typename genType::value_type>::epsilon());

	template<typename T> bool isNormalizedGTX(const detail::tmat2x2<T>& m, const T epsilon = std::numeric_limits<T>::epsilon());
	template<typename T> bool isNormalizedGTX(const detail::tmat3x3<T>& m, const T epsilon = std::numeric_limits<T>::epsilon());
	template<typename T> bool isNormalizedGTX(const detail::tmat4x4<T>& m, const T epsilon = std::numeric_limits<T>::epsilon());

	template<typename genType> bool isOrthogonalGTX(const genType& m, const typename genType::value_type epsilon = std::numeric_limits<typename genType::value_type>::epsilon());

    namespace gtx
    {
		//! GLM_GTX_matrix_query: Query to evaluate matrices properties
        namespace matrix_query
        {
	        template<typename T> inline bool isNull(const detail::tmat2x2<T>& m, const T epsilon = std::numeric_limits<T>::epsilon()){return isNullGTX(m, epsilon);} //!< \brief Return if a matrix a null matrix (from GLM_GTX_matrix_query extension)
	        template<typename T> inline bool isNull(const detail::tmat3x3<T>& m, const T epsilon = std::numeric_limits<T>::epsilon()){return isNullGTX(m, epsilon);} //!< \brief Return if a matrix a null matrix (from GLM_GTX_matrix_query extension)
	        template<typename T> inline bool isNull(const detail::tmat4x4<T>& m, const T epsilon = std::numeric_limits<T>::epsilon()){return isNullGTX(m, epsilon);} //!< \brief Return if a matrix a null matrix (from GLM_GTX_matrix_query extension)

	        template<typename genType> inline bool isIdentity(const genType& m, const typename genType::value_type epsilon = std::numeric_limits<typename genType::value_type>::epsilon()){return isIdentityGTX(m, epsilon);} //!< \brief Return if a matrix an identity matrix (from GLM_GTX_matrix_query extension)

	        template<typename T> inline bool isNormalized(const detail::tmat2x2<T>& m, const T epsilon = std::numeric_limits<T>::epsilon()){return isNormalizedGTX(m, epsilon);} //!< \brief Return if a matrix a normalized matrix (from GLM_GTX_matrix_query extension)
	        template<typename T> inline bool isNormalized(const detail::tmat3x3<T>& m, const T epsilon = std::numeric_limits<T>::epsilon()){return isNormalizedGTX(m, epsilon);} //!< \brief Return if a matrix a normalized matrix (from GLM_GTX_matrix_query extension)
	        template<typename T> inline bool isNormalized(const detail::tmat4x4<T>& m, const T epsilon = std::numeric_limits<T>::epsilon()){return isNormalizedGTX(m, epsilon);} //!< \brief Return if a matrix a normalized matrix (from GLM_GTX_matrix_query extension)
        
	        template<typename genType> inline bool isOrthogonal(const genType& m, const typename genType::value_type epsilon = std::numeric_limits<typename genType::value_type>::epsilon()){return isOrthogonalGTX(m, epsilon);}   //!< \brief Return if a matrix an orthonormalized matrix (from GLM_GTX_matrix_query extension)
        }
    }
}

#define GLM_GTX_matrix_query namespace gtx::matrix_query

#include "matrix_query.inl"

#endif//__glm_gtx_matrix_query__
