glm/glm/gtx/vector_query.hpp

97 lines
3.2 KiB
C++
Raw Normal View History

2010-04-29 10:54:07 +00:00
///////////////////////////////////////////////////////////////////////////////////////////////////
2011-01-20 11:40:14 +00:00
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
2010-04-29 10:54:07 +00:00
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2007-03-05
// Updated : 2007-03-05
// Licence : This source is under MIT License
2010-04-29 10:56:52 +00:00
// File : glm/gtx/vector_query.hpp
2010-04-29 10:54:07 +00:00
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef glm_gtx_vector_query
#define glm_gtx_vector_query
// Dependency:
#include "../glm.hpp"
#include <cfloat>
#include <limits>
2011-01-19 17:10:55 +00:00
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
# pragma message("GLM: GLM_GTX_vector_query extension included")
#endif
namespace glm{
namespace gtx{
namespace vector_query ///< GLM_GTX_vector_query extension: Query informations of vector types
2010-04-29 10:54:07 +00:00
{
/// \addtogroup gtx_vector_query
///@{
2010-04-29 10:54:07 +00:00
//! Check if two vectors are collinears.
//! From GLM_GTX_vector_query extensions.
template <typename genType>
bool areCollinear(
genType const & v0,
genType const & v1,
typename genType::value_type const & epsilon = std::numeric_limits<typename genType::value_type>::epsilon());
2010-04-29 10:54:07 +00:00
//! Check if two vectors are opposites.
//! From GLM_GTX_vector_query extensions.
template <typename genType>
bool areOpposite(
genType const & v0,
genType const & v1,
typename genType::value_type const & epsilon = std::numeric_limits<typename genType::value_type>::epsilon());
2010-04-29 10:54:07 +00:00
//! Check if two vectors are orthogonals.
//! From GLM_GTX_vector_query extensions.
template <typename genType>
bool areOrthogonal(
genType const & v0,
genType const & v1,
typename genType::value_type const & epsilon = std::numeric_limits<typename genType::value_type>::epsilon());
2010-04-29 10:54:07 +00:00
//! Check if a vector is normalized.
//! From GLM_GTX_vector_query extensions.
template <typename genType>
bool isNormalized(
genType const & v,
typename genType::value_type const & epsilon = std::numeric_limits<typename genType::value_type>::epsilon());
2010-04-29 10:54:07 +00:00
//! Check if a vector is null.
//! From GLM_GTX_vector_query extensions.
template <typename genType>
bool isNull(
genType const & v,
typename genType::value_type const & epsilon = std::numeric_limits<typename genType::value_type>::epsilon());
2010-04-29 10:54:07 +00:00
//! Check if two vectors are orthonormal.
//! From GLM_GTX_vector_query extensions.
template <typename genType>
bool areOrthonormal(
genType const & v0,
genType const & v1,
typename genType::value_type const & epsilon = std::numeric_limits<typename genType::value_type>::epsilon());
2010-04-29 10:54:07 +00:00
//! Check if two vectors are similar.
//! From GLM_GTX_vector_query extensions.
template <typename genType>
bool areSimilar(
genType const & v0,
genType const & v1,
typename genType::value_type const & epsilon = std::numeric_limits<typename genType::value_type>::epsilon());
2010-04-29 10:54:07 +00:00
///@}
}//namespace vector_query
}//namespace gtx
2010-04-29 10:54:07 +00:00
}//namespace glm
#include "vector_query.inl"
2010-04-29 10:56:52 +00:00
namespace glm{using namespace gtx::vector_query;}
2010-04-29 10:54:07 +00:00
#endif//glm_gtx_vector_query