Commit 338ae906 authored by Nianchen Deng's avatar Nianchen Deng
Browse files

tog'21 baseline

parent f1dd9e3a
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_matrix_query
/// @file glm/gtx/matrix_query.inl
/// @date 2007-03-05 / 2007-03-05
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNull(tmat2x2<T, P> const & m, T const & epsilon)
{
bool result = true;
for(detail::component_count_t i = 0; result && i < 2 ; ++i)
result = isNull(m[i], epsilon);
return result;
}
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNull(tmat3x3<T, P> const & m, T const & epsilon)
{
bool result = true;
for(detail::component_count_t i = 0; result && i < 3 ; ++i)
result = isNull(m[i], epsilon);
return result;
}
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNull(tmat4x4<T, P> const & m, T const & epsilon)
{
bool result = true;
for(detail::component_count_t i = 0; result && i < 4 ; ++i)
result = isNull(m[i], epsilon);
return result;
}
template<typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_QUALIFIER bool isIdentity(matType<T, P> const & m, T const & epsilon)
{
bool result = true;
for(detail::component_count_t i(0); result && i < detail::component_count(m[0]); ++i)
{
for(detail::component_count_t j(0); result && j < i ; ++j)
result = abs(m[i][j]) <= epsilon;
if(result)
result = abs(m[i][i] - 1) <= epsilon;
for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j)
result = abs(m[i][j]) <= epsilon;
}
return result;
}
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNormalized(tmat2x2<T, P> const & m, T const & epsilon)
{
bool result(true);
for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i)
result = isNormalized(m[i], epsilon);
for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i)
{
typename tmat2x2<T, P>::col_type v;
for(detail::component_count_t j(0); j < detail::component_count(m); ++j)
v[j] = m[j][i];
result = isNormalized(v, epsilon);
}
return result;
}
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNormalized(tmat3x3<T, P> const & m, T const & epsilon)
{
bool result(true);
for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i)
result = isNormalized(m[i], epsilon);
for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i)
{
typename tmat3x3<T, P>::col_type v;
for(detail::component_count_t j(0); j < detail::component_count(m); ++j)
v[j] = m[j][i];
result = isNormalized(v, epsilon);
}
return result;
}
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNormalized(tmat4x4<T, P> const & m, T const & epsilon)
{
bool result(true);
for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i)
result = isNormalized(m[i], epsilon);
for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i)
{
typename tmat4x4<T, P>::col_type v;
for(detail::component_count_t j(0); j < detail::component_count(m); ++j)
v[j] = m[j][i];
result = isNormalized(v, epsilon);
}
return result;
}
template<typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_QUALIFIER bool isOrthogonal(matType<T, P> const & m, T const & epsilon)
{
bool result(true);
for(detail::component_count_t i(0); result && i < detail::component_count(m) - 1; ++i)
for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j)
result = areOrthogonal(m[i], m[j], epsilon);
if(result)
{
matType<T, P> tmp = transpose(m);
for(detail::component_count_t i(0); result && i < detail::component_count(m) - 1 ; ++i)
for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j)
result = areOrthogonal(tmp[i], tmp[j], epsilon);
}
return result;
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_matrix_transform_2d
/// @file glm/gtx/matrix_transform_2d.hpp
/// @date 2014-02-20
/// @author Miguel Ángel Pérez Martínez
///
/// @see core (dependence)
///
/// @defgroup gtx_matrix_transform_2d GLM_GTX_matrix_transform_2d
/// @ingroup gtx
///
/// @brief Defines functions that generate common 2d transformation matrices.
///
/// <glm/gtx/matrix_transform_2d.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependency:
#include "../mat3x3.hpp"
#include "../vec2.hpp"
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTX_matrix_transform_2d extension included")
#endif
namespace glm
{
/// @addtogroup gtx_matrix_transform_2d
/// @{
/// Builds a translation 3 * 3 matrix created from a vector of 2 components.
///
/// @param m Input matrix multiplied by this translation matrix.
/// @param v Coordinates of a translation vector.
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> translate(
tmat3x3<T, P> const & m,
tvec2<T, P> const & v);
/// Builds a rotation 3 * 3 matrix created from an angle.
///
/// @param m Input matrix multiplied by this translation matrix.
/// @param angle Rotation angle expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise.
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> rotate(
tmat3x3<T, P> const & m,
T angle);
/// Builds a scale 3 * 3 matrix created from a vector of 2 components.
///
/// @param m Input matrix multiplied by this translation matrix.
/// @param v Coordinates of a scale vector.
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> scale(
tmat3x3<T, P> const & m,
tvec2<T, P> const & v);
/// Builds an horizontal (parallel to the x axis) shear 3 * 3 matrix.
///
/// @param m Input matrix multiplied by this translation matrix.
/// @param y Shear factor.
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> shearX(
tmat3x3<T, P> const & m,
T y);
/// Builds a vertical (parallel to the y axis) shear 3 * 3 matrix.
///
/// @param m Input matrix multiplied by this translation matrix.
/// @param x Shear factor.
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> shearY(
tmat3x3<T, P> const & m,
T x);
/// @}
}//namespace glm
#include "matrix_transform_2d.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_matrix_transform_2d
/// @file glm/gtc/matrix_transform_2d.inl
/// @date 2014-02-20
/// @author Miguel Ángel Pérez Martínez
///////////////////////////////////////////////////////////////////////////////////
#include "../trigonometric.hpp"
namespace glm
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> translate(
tmat3x3<T, P> const & m,
tvec2<T, P> const & v)
{
tmat3x3<T, P> Result(m);
Result[2] = m[0] * v[0] + m[1] * v[1] + m[2];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> rotate(
tmat3x3<T, P> const & m,
T angle)
{
T const a = angle;
T const c = cos(a);
T const s = sin(a);
tmat3x3<T, P> Result(uninitialize);
Result[0] = m[0] * c + m[1] * s;
Result[1] = m[0] * -s + m[1] * c;
Result[2] = m[2];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> scale(
tmat3x3<T, P> const & m,
tvec2<T, P> const & v)
{
tmat3x3<T, P> Result(uninitialize);
Result[0] = m[0] * v[0];
Result[1] = m[1] * v[1];
Result[2] = m[2];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> shearX(
tmat3x3<T, P> const & m,
T y)
{
tmat3x3<T, P> Result(1);
Result[0][1] = y;
return m * Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> shearY(
tmat3x3<T, P> const & m,
T x)
{
tmat3x3<T, P> Result(1);
Result[1][0] = x;
return m * Result;
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_mixed_product
/// @file glm/gtx/mixed_product.hpp
/// @date 2007-04-03 / 2011-06-07
/// @author Christophe Riccio
///
/// @see core (dependence)
///
/// @defgroup gtx_mixed_product GLM_GTX_mixed_producte
/// @ingroup gtx
///
/// @brief Mixed product of 3 vectors.
///
/// <glm/gtx/mixed_product.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependency:
#include "../glm.hpp"
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTX_mixed_product extension included")
#endif
namespace glm
{
/// @addtogroup gtx_mixed_product
/// @{
/// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension)
template <typename T, precision P>
GLM_FUNC_DECL T mixedProduct(
tvec3<T, P> const & v1,
tvec3<T, P> const & v2,
tvec3<T, P> const & v3);
/// @}
}// namespace glm
#include "mixed_product.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_mixed_product
/// @file glm/gtx/mixed_product.inl
/// @date 2007-04-03 / 2008-09-17
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER T mixedProduct
(
tvec3<T, P> const & v1,
tvec3<T, P> const & v2,
tvec3<T, P> const & v3
)
{
return dot(cross(v1, v2), v3);
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_multiple
/// @file glm/gtx/multiple.hpp
/// @date 2009-10-26 / 2011-06-07
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtx_extented_min_max (dependence)
///
/// @defgroup gtx_multiple GLM_GTX_multiple
/// @ingroup gtx
///
/// @brief Find the closest number of a number multiple of other number.
///
/// <glm/gtx/multiple.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependency:
#include "../gtc/round.hpp"
#pragma message("GLM: GLM_GTX_multiple extension is deprecated, use GLM_GTC_round instead.")
namespace glm
{
/// @addtogroup gtx_multiple
/// @{
/// Higher multiple number of Source.
///
/// @tparam genType Floating-point or integer scalar or vector types.
/// @param Source
/// @param Multiple Must be a null or positive value
///
/// @see gtx_multiple
template <typename genType>
GLM_DEPRECATED GLM_FUNC_DECL genType higherMultiple(
genType Source,
genType Multiple);
/// Higher multiple number of Source.
///
/// @tparam genType Floating-point or integer scalar or vector types.
/// @param Source
/// @param Multiple Must be a null or positive value
///
/// @see gtx_multiple
template <typename T, precision P, template <typename, precision> class vecType>
GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> higherMultiple(
vecType<T, P> const & Source,
vecType<T, P> const & Multiple);
/// Lower multiple number of Source.
///
/// @tparam genType Floating-point or integer scalar or vector types.
/// @param Source
/// @param Multiple Must be a null or positive value
///
/// @see gtx_multiple
template <typename genType>
GLM_DEPRECATED GLM_FUNC_DECL genType lowerMultiple(
genType Source,
genType Multiple);
/// Lower multiple number of Source.
///
/// @tparam genType Floating-point or integer scalar or vector types.
/// @param Source
/// @param Multiple Must be a null or positive value
///
/// @see gtx_multiple
template <typename T, precision P, template <typename, precision> class vecType>
GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> lowerMultiple(
vecType<T, P> const & Source,
vecType<T, P> const & Multiple);
/// @}
}//namespace glm
#include "multiple.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_multiple
/// @file glm/gtx/multiple.inl
/// @date 2009-10-26 / 2011-06-07
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
//////////////////////
// higherMultiple
template <typename genType>
GLM_FUNC_QUALIFIER genType higherMultiple(genType Source, genType Multiple)
{
return detail::compute_ceilMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple);
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> higherMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple)
{
return detail::functor2<T, P, vecType>::call(higherMultiple, Source, Multiple);
}
//////////////////////
// lowerMultiple
template <typename genType>
GLM_FUNC_QUALIFIER genType lowerMultiple(genType Source, genType Multiple)
{
return detail::compute_floorMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple);
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> lowerMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple)
{
return detail::functor2<T, P, vecType>::call(lowerMultiple, Source, Multiple);
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_norm
/// @file glm/gtx/norm.hpp
/// @date 2005-12-21 / 2011-06-07
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtx_quaternion (dependence)
///
/// @defgroup gtx_norm GLM_GTX_norm
/// @ingroup gtx
///
/// @brief Various ways to compute vector norms.
///
/// <glm/gtx/norm.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependency:
#include "../glm.hpp"
#include "../gtx/quaternion.hpp"
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTX_norm extension included")
#endif
namespace glm
{
/// @addtogroup gtx_norm
/// @{
//! Returns the squared length of x.
//! From GLM_GTX_norm extension.
template <typename T>
GLM_FUNC_DECL T length2(
T const & x);
//! Returns the squared length of x.
//! From GLM_GTX_norm extension.
template <typename genType>
GLM_FUNC_DECL typename genType::value_type length2(
genType const & x);
//! Returns the squared distance between p0 and p1, i.e., length(p0 - p1).
//! From GLM_GTX_norm extension.
template <typename T>
GLM_FUNC_DECL T distance2(
T const & p0,
T const & p1);
//! Returns the squared distance between p0 and p1, i.e., length(p0 - p1).
//! From GLM_GTX_norm extension.
template <typename genType>
GLM_FUNC_DECL typename genType::value_type distance2(
genType const & p0,
genType const & p1);
//! Returns the L1 norm between x and y.
//! From GLM_GTX_norm extension.
template <typename T, precision P>
GLM_FUNC_DECL T l1Norm(
tvec3<T, P> const & x,
tvec3<T, P> const & y);
//! Returns the L1 norm of v.
//! From GLM_GTX_norm extension.
template <typename T, precision P>
GLM_FUNC_DECL T l1Norm(
tvec3<T, P> const & v);
//! Returns the L2 norm between x and y.
//! From GLM_GTX_norm extension.
template <typename T, precision P>
GLM_FUNC_DECL T l2Norm(
tvec3<T, P> const & x,
tvec3<T, P> const & y);
//! Returns the L2 norm of v.
//! From GLM_GTX_norm extension.
template <typename T, precision P>
GLM_FUNC_DECL T l2Norm(
tvec3<T, P> const & x);
//! Returns the L norm between x and y.
//! From GLM_GTX_norm extension.
template <typename T, precision P>
GLM_FUNC_DECL T lxNorm(
tvec3<T, P> const & x,
tvec3<T, P> const & y,
unsigned int Depth);
//! Returns the L norm of v.
//! From GLM_GTX_norm extension.
template <typename T, precision P>
GLM_FUNC_DECL T lxNorm(
tvec3<T, P> const & x,
unsigned int Depth);
/// @}
}//namespace glm
#include "norm.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_norm
/// @file glm/gtx/norm.inl
/// @date 2005-12-21 / 2008-07-24
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
template <typename T>
GLM_FUNC_QUALIFIER T length2
(
T const & x
)
{
return x * x;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T length2
(
tvec2<T, P> const & x
)
{
return dot(x, x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T length2
(
tvec3<T, P> const & x
)
{
return dot(x, x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T length2
(
tvec4<T, P> const & x
)
{
return dot(x, x);
}
template <typename T>
GLM_FUNC_QUALIFIER T distance2
(
T const & p0,
T const & p1
)
{
return length2(p1 - p0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T distance2
(
tvec2<T, P> const & p0,
tvec2<T, P> const & p1
)
{
return length2(p1 - p0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T distance2
(
tvec3<T, P> const & p0,
tvec3<T, P> const & p1
)
{
return length2(p1 - p0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T distance2
(
tvec4<T, P> const & p0,
tvec4<T, P> const & p1
)
{
return length2(p1 - p0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T l1Norm
(
tvec3<T, P> const & a,
tvec3<T, P> const & b
)
{
return abs(b.x - a.x) + abs(b.y - a.y) + abs(b.z - a.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T l1Norm
(
tvec3<T, P> const & v
)
{
return abs(v.x) + abs(v.y) + abs(v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T l2Norm
(
tvec3<T, P> const & a,
tvec3<T, P> const & b
)
{
return length(b - a);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T l2Norm
(
tvec3<T, P> const & v
)
{
return length(v);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T lxNorm
(
tvec3<T, P> const & x,
tvec3<T, P> const & y,
unsigned int Depth
)
{
return pow(pow(y.x - x.x, T(Depth)) + pow(y.y - x.y, T(Depth)) + pow(y.z - x.z, T(Depth)), T(1) / T(Depth));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T lxNorm
(
tvec3<T, P> const & v,
unsigned int Depth
)
{
return pow(pow(v.x, T(Depth)) + pow(v.y, T(Depth)) + pow(v.z, T(Depth)), T(1) / T(Depth));
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_normal
/// @file glm/gtx/normal.hpp
/// @date 2005-12-21 / 2011-06-07
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtx_extented_min_max (dependence)
///
/// @defgroup gtx_normal GLM_GTX_normal
/// @ingroup gtx
///
/// @brief Compute the normal of a triangle.
///
/// <glm/gtx/normal.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependency:
#include "../glm.hpp"
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTX_normal extension included")
#endif
namespace glm
{
/// @addtogroup gtx_normal
/// @{
//! Computes triangle normal from triangle points.
//! From GLM_GTX_normal extension.
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> triangleNormal(
tvec3<T, P> const & p1,
tvec3<T, P> const & p2,
tvec3<T, P> const & p3);
/// @}
}//namespace glm
#include "normal.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_normal
/// @file glm/gtx/normal.inl
/// @date 2005-12-21 / 2011-06-07
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> triangleNormal
(
tvec3<T, P> const & p1,
tvec3<T, P> const & p2,
tvec3<T, P> const & p3
)
{
return normalize(cross(p1 - p2, p1 - p3));
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_normalize_dot
/// @file glm/gtx/normalize_dot.hpp
/// @date 2007-09-28 / 2011-06-07
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtx_fast_square_root (dependence)
///
/// @defgroup gtx_normalize_dot GLM_GTX_normalize_dot
/// @ingroup gtx
///
/// @brief Dot product of vectors that need to be normalize with a single square root.
///
/// <glm/gtx/normalized_dot.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependency:
#include "../gtx/fast_square_root.hpp"
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTX_normalize_dot extension included")
#endif
namespace glm
{
/// @addtogroup gtx_normalize_dot
/// @{
/// Normalize parameters and returns the dot product of x and y.
/// It's faster that dot(normalize(x), normalize(y)).
///
/// @see gtx_normalize_dot extension.
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL T normalizeDot(vecType<T, P> const & x, vecType<T, P> const & y);
/// Normalize parameters and returns the dot product of x and y.
/// Faster that dot(fastNormalize(x), fastNormalize(y)).
///
/// @see gtx_normalize_dot extension.
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL T fastNormalizeDot(vecType<T, P> const & x, vecType<T, P> const & y);
/// @}
}//namespace glm
#include "normalize_dot.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_normalize_dot
/// @file glm/gtx/normalize_dot.inl
/// @date 2007-09-28 / 2008-10-07
/// @author Christophe Riccio
//////////////////////////////////////////////////////////////////////////////////
namespace glm
{
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T normalizeDot(vecType<T, P> const & x, vecType<T, P> const & y)
{
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T fastNormalizeDot(vecType<T, P> const & x, vecType<T, P> const & y)
{
return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y));
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_number_precision
/// @file glm/gtx/number_precision.hpp
/// @date 2007-05-10 / 2011-06-07
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtc_type_precision (dependence)
/// @see gtc_quaternion (dependence)
///
/// @defgroup gtx_number_precision GLM_GTX_number_precision
/// @ingroup gtx
///
/// @brief Defined size types.
///
/// <glm/gtx/number_precision.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependency:
#include "../glm.hpp"
#include "../gtc/type_precision.hpp"
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTX_number_precision extension included")
#endif
namespace glm{
namespace gtx
{
/////////////////////////////
// Unsigned int vector types
/// @addtogroup gtx_number_precision
/// @{
typedef u8 u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTX_number_precision extension)
typedef u16 u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTX_number_precision extension)
typedef u32 u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTX_number_precision extension)
typedef u64 u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTX_number_precision extension)
//////////////////////
// Float vector types
typedef f32 f32vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension)
typedef f64 f64vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension)
//////////////////////
// Float matrix types
typedef f32 f32mat1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension)
typedef f32 f32mat1x1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension)
typedef f64 f64mat1; //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension)
typedef f64 f64mat1x1; //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension)
/// @}
}//namespace gtx
}//namespace glm
#include "number_precision.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_number_precision
/// @file glm/gtx/number_precision.inl
/// @date 2007-05-10 / 2011-06-07
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
}
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_optimum_pow
/// @file glm/gtx/optimum_pow.hpp
/// @date 2005-12-21 / 2011-06-07
/// @author Christophe Riccio
///
/// @see core (dependence)
///
/// @defgroup gtx_optimum_pow GLM_GTX_optimum_pow
/// @ingroup gtx
///
/// @brief Integer exponentiation of power functions.
///
/// <glm/gtx/optimum_pow.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependency:
#include "../glm.hpp"
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTX_optimum_pow extension included")
#endif
namespace glm{
namespace gtx
{
/// @addtogroup gtx_optimum_pow
/// @{
/// Returns x raised to the power of 2.
///
/// @see gtx_optimum_pow
template <typename genType>
GLM_FUNC_DECL genType pow2(genType const & x);
/// Returns x raised to the power of 3.
///
/// @see gtx_optimum_pow
template <typename genType>
GLM_FUNC_DECL genType pow3(genType const & x);
/// Returns x raised to the power of 4.
///
/// @see gtx_optimum_pow
template <typename genType>
GLM_FUNC_DECL genType pow4(genType const & x);
/// @}
}//namespace gtx
}//namespace glm
#include "optimum_pow.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_optimum_pow
/// @file glm/gtx/optimum_pow.inl
/// @date 2005-12-21 / 2011-06-07
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
template <typename genType>
GLM_FUNC_QUALIFIER genType pow2(genType const & x)
{
return x * x;
}
template <typename genType>
GLM_FUNC_QUALIFIER genType pow3(genType const & x)
{
return x * x * x;
}
template <typename genType>
GLM_FUNC_QUALIFIER genType pow4(genType const & x)
{
return (x * x) * (x * x);
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_orthonormalize
/// @file glm/gtx/orthonormalize.hpp
/// @date 2005-12-21 / 2011-06-07
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtx_extented_min_max (dependence)
///
/// @defgroup gtx_orthonormalize GLM_GTX_orthonormalize
/// @ingroup gtx
///
/// @brief Orthonormalize matrices.
///
/// <glm/gtx/orthonormalize.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependency:
#include "../vec3.hpp"
#include "../mat3x3.hpp"
#include "../geometric.hpp"
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTX_orthonormalize extension included")
#endif
namespace glm
{
/// @addtogroup gtx_orthonormalize
/// @{
/// Returns the orthonormalized matrix of m.
///
/// @see gtx_orthonormalize
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> orthonormalize(tmat3x3<T, P> const & m);
/// Orthonormalizes x according y.
///
/// @see gtx_orthonormalize
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> orthonormalize(tvec3<T, P> const & x, tvec3<T, P> const & y);
/// @}
}//namespace glm
#include "orthonormalize.inl"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment