///////////////////////////////////////////////////////////////////////////////////////////////////
// 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/vector_query.h
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef glm_gtx_vector_query
#define glm_gtx_vector_query

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

namespace glm
{
	namespace test{
		void main_ext_gtx_vector_query();
	}//namespace test

	template <typename T> bool areCollinearGTX(const detail::tvec2<T>& v0, const detail::tvec2<T>& v1, const T epsilon = std::numeric_limits<T>::epsilon());
	template <typename T> bool areCollinearGTX(const detail::tvec3<T>& v0, const detail::tvec3<T>& v1, const T epsilon = std::numeric_limits<T>::epsilon());
	template <typename T> bool areCollinearGTX(const detail::tvec4<T>& v0, const detail::tvec4<T>& v1, const T epsilon = std::numeric_limits<T>::epsilon());

	template <typename T> bool areOppositeGTX(const detail::tvec2<T>& v0, const detail::tvec2<T>& v1, const T epsilon = std::numeric_limits<T>::epsilon());
	template <typename T> bool areOppositeGTX(const detail::tvec3<T>& v0, const detail::tvec3<T>& v1, const T epsilon = std::numeric_limits<T>::epsilon());
	template <typename T> bool areOppositeGTX(const detail::tvec4<T>& v0, const detail::tvec4<T>& v1, const T epsilon = std::numeric_limits<T>::epsilon());

    template <typename genType> bool areOrthogonalGTX(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());

	template <typename genType> bool isNormalizedGTX(const genType& v, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());

	template <typename genType> bool isNullGTX(const genType& v, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());

    template <typename T> bool isCompNullGTX(const float s, const T epsilon = std::numeric_limits<T>::epsilon());
    template <typename T> detail::tvec2<bool> isCompNullGTX(const detail::tvec2<T>& v, const T epsilon = std::numeric_limits<T>::epsilon());
    template <typename T> detail::tvec3<bool> isCompNullGTX(const detail::tvec3<T>& v, const T epsilon = std::numeric_limits<T>::epsilon());
    template <typename T> detail::tvec4<bool> isCompNullGTX(const detail::tvec4<T>& v, const T epsilon = std::numeric_limits<T>::epsilon());

	template <typename genType> bool areOrthonormalGTX(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());

	template <typename genType> bool areSimilarGTX(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());

    namespace gtx
    {
		//! GLM_GTX_vector_query extension: Query informations of vector types
        namespace vector_query
        {
	        template <typename genType> inline bool areCollinear(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon()){return areCollinearGTX(v0, v1, epsilon);}		//!< \brief Check if two vectors are collinears (From GLM_GTX_vector_query extensions)
	        template <typename genType> inline bool areOpposite(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon()){return areOppositeGTX(v0, v1, epsilon);}		//!< \brief Check if two vectors are opposites (From GLM_GTX_vector_query extensions)
	        template <typename genType> inline bool areOrthogonal(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon()){return areOrthogonalGTX(v0, v1, epsilon);}	//!< \brief Check if two vectors are orthogonals (From GLM_GTX_vector_query extensions)
	        template <typename genType> inline bool isNormalized(const genType& v, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon()){return isNormalizedGTX(v, epsilon);}								//!< \brief Check if a vector is normalized (From GLM_GTX_vector_query extensions)
	        template <typename genType> inline bool isNull(const genType& v, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon()){return isNullGTX(v, epsilon);}											//!< \brief Check if a vector is null (From GLM_GTX_vector_query extensions)
	        template <typename genType> inline bool areOrthonormal(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon()){return areOrthonormalGTX(v0, v1, epsilon);}	//!< \brief Check if two vectors are orthonormal (From GLM_GTX_vector_query extensions)
	        template <typename genType> inline bool areSimilar(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon()){return areSimilarGTX(v0, v1, epsilon);}			//!< \brief Check if two vectors are similar (From GLM_GTX_vector_query extensions)
        }
    }
}

#define GLM_GTX_vector_query namespace gtx::vector_query

#include "vector_query.inl"

#endif//glm_gtx_vector_query
