/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2005-12-21 // Updated : 2008-07-24 // Licence : This source is under MIT License // File : glm/gtx/norm.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// // Dependency: // - GLM core // - GLM_GTX_quaternion /////////////////////////////////////////////////////////////////////////////////////////////////// // ToDo: // - Study the validity of the notion of length2 to quaternion /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtx_norm #define glm_gtx_norm // Dependency: #include "../glm.hpp" #include "../gtx/quaternion.hpp" #if(defined(GLM_MESSAGES) && !defined(glm_ext)) # pragma message("GLM: GLM_GTX_norm extension included") #endif namespace glm{ namespace gtx{ namespace norm ///< GLM_GTX_norm extension: Various way to compute vector norms. { /// \addtogroup gtx_norm /// @{ //! Returns the squared length of x. //! From GLM_GTX_norm extension. template T length2( const T x); //! Returns the squared length of x. //! From GLM_GTX_norm extension. template T length2( const detail::tvec2 & x); //! Returns the squared length of x. //! From GLM_GTX_norm extension. template T length2( const detail::tvec3& x); //! Returns the squared length of x. //! From GLM_GTX_norm extension. template T length2( const detail::tvec4& x); //! Returns the squared length of x. //! From GLM_GTX_norm extension. template T length2( const detail::tquat& q); //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). //! From GLM_GTX_norm extension. template T distance2( const T p0, const T p1); //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). //! From GLM_GTX_norm extension. template T distance2( const detail::tvec2& p0, const detail::tvec2& p1); //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). //! From GLM_GTX_norm extension. template T distance2( const detail::tvec3& p0, const detail::tvec3& p1); //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). //! From GLM_GTX_norm extension. template T distance2( const detail::tvec4& p0, const detail::tvec4& p1); //! Returns the L1 norm between x and y. //! From GLM_GTX_norm extension. template T l1Norm( const detail::tvec3& x, const detail::tvec3& y); //! Returns the L1 norm of v. //! From GLM_GTX_norm extension. template T l1Norm( const detail::tvec3& v); //! Returns the L2 norm between x and y. //! From GLM_GTX_norm extension. template T l2Norm( const detail::tvec3& x, const detail::tvec3& y); //! Returns the L2 norm of v. //! From GLM_GTX_norm extension. template T l2Norm( const detail::tvec3& x); //! Returns the L norm between x and y. //! From GLM_GTX_norm extension. template T lxNorm( const detail::tvec3& x, const detail::tvec3& y, unsigned int Depth); //! Returns the L norm of v. //! From GLM_GTX_norm extension. template T lxNorm( const detail::tvec3& x, unsigned int Depth); /// @} }//namespace norm }//namespace gtx }//namespace glm #include "norm.inl" namespace glm{using namespace gtx::norm;} #endif//glm_gtx_norm