mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 12:41:54 +00:00
Add lMaxNorm for computing the max norm.
This commit is contained in:
parent
947527d3ac
commit
2400954df2
@ -3,6 +3,7 @@
|
|||||||
///
|
///
|
||||||
/// @see core (dependence)
|
/// @see core (dependence)
|
||||||
/// @see gtx_quaternion (dependence)
|
/// @see gtx_quaternion (dependence)
|
||||||
|
/// @see gtx_component_wise (dependence)
|
||||||
///
|
///
|
||||||
/// @defgroup gtx_norm GLM_GTX_norm
|
/// @defgroup gtx_norm GLM_GTX_norm
|
||||||
/// @ingroup gtx
|
/// @ingroup gtx
|
||||||
@ -16,6 +17,7 @@
|
|||||||
// Dependency:
|
// Dependency:
|
||||||
#include "../geometric.hpp"
|
#include "../geometric.hpp"
|
||||||
#include "../gtx/quaternion.hpp"
|
#include "../gtx/quaternion.hpp"
|
||||||
|
#include "../gtx/component_wise.hpp"
|
||||||
|
|
||||||
#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
|
#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
|
||||||
# ifndef GLM_ENABLE_EXPERIMENTAL
|
# ifndef GLM_ENABLE_EXPERIMENTAL
|
||||||
@ -70,6 +72,16 @@ namespace glm
|
|||||||
template<typename T, qualifier Q>
|
template<typename T, qualifier Q>
|
||||||
GLM_FUNC_DECL T lxNorm(vec<3, T, Q> const& x, unsigned int Depth);
|
GLM_FUNC_DECL T lxNorm(vec<3, T, Q> const& x, unsigned int Depth);
|
||||||
|
|
||||||
|
//! Returns the LMax norm between x and y.
|
||||||
|
//! From GLM_GTX_norm extension.
|
||||||
|
template<typename T, qualifier Q>
|
||||||
|
GLM_FUNC_DECL T lMaxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y);
|
||||||
|
|
||||||
|
//! Returns the LMax norm of v.
|
||||||
|
//! From GLM_GTX_norm extension.
|
||||||
|
template<typename T, qualifier Q>
|
||||||
|
GLM_FUNC_DECL T lMaxNorm(vec<3, T, Q> const& x);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
|
@ -80,4 +80,16 @@ namespace detail
|
|||||||
return pow(pow(v.x, T(Depth)) + pow(v.y, T(Depth)) + pow(v.z, T(Depth)), T(1) / T(Depth));
|
return pow(pow(v.x, T(Depth)) + pow(v.y, T(Depth)) + pow(v.z, T(Depth)), T(1) / T(Depth));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T, qualifier Q>
|
||||||
|
GLM_FUNC_QUALIFIER T lMaxNorm(vec<3, T, Q> const& a, vec<3, T, Q> const& b)
|
||||||
|
{
|
||||||
|
return compMax(abs(b - a));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T, qualifier Q>
|
||||||
|
GLM_FUNC_QUALIFIER T lMaxNorm(vec<3, T, Q> const& v)
|
||||||
|
{
|
||||||
|
return compMax(abs(v));
|
||||||
|
}
|
||||||
|
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
Loading…
Reference in New Issue
Block a user