diff --git a/glm/gtc/matrix_inverse.inl b/glm/gtc/matrix_inverse.inl index 2ab9530c..94e0196d 100644 --- a/glm/gtc/matrix_inverse.inl +++ b/glm/gtc/matrix_inverse.inl @@ -37,10 +37,7 @@ namespace glm { template - GLM_FUNC_QUALIFIER tmat3x3 affineInverse - ( - tmat3x3 const & m - ) + GLM_FUNC_QUALIFIER tmat3x3 affineInverse(tmat3x3 const & m) { tmat3x3 Result(m); Result[2] = tvec3(0, 0, 1); @@ -51,10 +48,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat4x4 affineInverse - ( - tmat4x4 const & m - ) + GLM_FUNC_QUALIFIER tmat4x4 affineInverse(tmat4x4 const & m) { tmat4x4 Result(m); Result[3] = tvec4(0, 0, 0, 1); @@ -65,10 +59,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x2 inverseTranspose - ( - tmat2x2 const & m - ) + GLM_FUNC_QUALIFIER tmat2x2 inverseTranspose(tmat2x2 const & m) { T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; @@ -82,10 +73,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat3x3 inverseTranspose - ( - tmat3x3 const & m - ) + GLM_FUNC_QUALIFIER tmat3x3 inverseTranspose(tmat3x3 const & m) { T Determinant = + m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) @@ -108,10 +96,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat4x4 inverseTranspose - ( - tmat4x4 const & m - ) + GLM_FUNC_QUALIFIER tmat4x4 inverseTranspose(tmat4x4 const & m) { T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; diff --git a/glm/gtx/fast_square_root.hpp b/glm/gtx/fast_square_root.hpp index 0271966d..f005bc7c 100644 --- a/glm/gtx/fast_square_root.hpp +++ b/glm/gtx/fast_square_root.hpp @@ -44,7 +44,9 @@ #pragma once // Dependency: -#include "../glm.hpp" +#include "../common.hpp" +#include "../exponential.hpp" +#include "../geometric.hpp" #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) # pragma message("GLM: GLM_GTX_fast_square_root extension included") @@ -55,38 +57,57 @@ namespace glm /// @addtogroup gtx_fast_square_root /// @{ - //! Faster than the common sqrt function but less accurate. - //! From GLM_GTX_fast_square_root extension. + /// Faster than the common sqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. template GLM_FUNC_DECL genType fastSqrt(genType x); - //! Faster than the common inversesqrt function but less accurate. - //! From GLM_GTX_fast_square_root extension. + /// Faster than the common sqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template class vecType> + GLM_FUNC_DECL vecType fastSqrt(vecType const & x); + + /// Faster than the common inversesqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. template GLM_FUNC_DECL genType fastInverseSqrt(genType x); - //! Faster than the common inversesqrt function but less accurate. - //! From GLM_GTX_fast_square_root extension. + /// Faster than the common inversesqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. template class vecType> GLM_FUNC_DECL vecType fastInverseSqrt(vecType const & x); - //! Faster than the common length function but less accurate. - //! From GLM_GTX_fast_square_root extension. - template - GLM_FUNC_DECL typename genType::value_type fastLength(genType const & x); + /// Faster than the common length function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL genType fastLength(genType x); - //! Faster than the common distance function but less accurate. - //! From GLM_GTX_fast_square_root extension. + /// Faster than the common length function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template class vecType> + GLM_FUNC_DECL T fastLength(vecType const & x); + + /// Faster than the common distance function but less accurate. + /// + /// @see gtx_fast_square_root extension. template GLM_FUNC_DECL genType fastDistance(genType x, genType y); - //! Faster than the common distance function but less accurate. - //! From GLM_GTX_fast_square_root extension. + /// Faster than the common distance function but less accurate. + /// + /// @see gtx_fast_square_root extension. template class vecType> GLM_FUNC_DECL T fastDistance(vecType const & x, vecType const & y); - //! Faster than the common normalize function but less accurate. - //! From GLM_GTX_fast_square_root extension. + /// Faster than the common normalize function but less accurate. + /// + /// @see gtx_fast_square_root extension. template GLM_FUNC_DECL genType fastNormalize(genType const & x); diff --git a/glm/gtx/fast_trigonometry.hpp b/glm/gtx/fast_trigonometry.hpp index 091fac20..9f8c1035 100644 --- a/glm/gtx/fast_trigonometry.hpp +++ b/glm/gtx/fast_trigonometry.hpp @@ -42,7 +42,6 @@ #pragma once // Dependency: -#include "../glm.hpp" #include "../gtc/constants.hpp" #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) diff --git a/glm/gtx/normalize_dot.hpp b/glm/gtx/normalize_dot.hpp index 406f7a24..5b1fe1d5 100644 --- a/glm/gtx/normalize_dot.hpp +++ b/glm/gtx/normalize_dot.hpp @@ -43,7 +43,6 @@ #pragma once // Dependency: -#include "../glm.hpp" #include "../gtx/fast_square_root.hpp" #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) @@ -55,21 +54,19 @@ 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)). - //! From GLM_GTX_normalize_dot extension. - template - GLM_FUNC_DECL typename genType::value_type normalizeDot( - genType const & x, - genType const & y); + /// 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 class vecType> + GLM_FUNC_DECL T normalizeDot(vecType const & x, vecType const & y); - //! Normalize parameters and returns the dot product of x and y. - //! Faster that dot(fastNormalize(x), fastNormalize(y)). - //! From GLM_GTX_normalize_dot extension. - template - GLM_FUNC_DECL typename genType::value_type fastNormalizeDot( - genType const & x, - genType 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 class vecType> + GLM_FUNC_DECL T fastNormalizeDot(vecType const & x, vecType const & y); /// @} }//namespace glm diff --git a/glm/gtx/normalize_dot.inl b/glm/gtx/normalize_dot.inl index b231a566..775ffb27 100644 --- a/glm/gtx/normalize_dot.inl +++ b/glm/gtx/normalize_dot.inl @@ -32,101 +32,15 @@ namespace glm { - template - GLM_FUNC_QUALIFIER genType normalizeDot - ( - genType const & x, - genType const & y - ) + template class vecType> + GLM_FUNC_QUALIFIER T normalizeDot(vecType const & x, vecType const & y) { return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); } - template - GLM_FUNC_QUALIFIER T normalizeDot - ( - tvec2 const & x, - tvec2 const & y - ) + template class vecType> + GLM_FUNC_QUALIFIER T fastNormalizeDot(vecType const & x, vecType const & y) { - return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); - } - - template - GLM_FUNC_QUALIFIER T normalizeDot - ( - tvec3 const & x, - tvec3 const & y - ) - { - return - glm::dot(x, y) * - glm::inversesqrt(glm::dot(x, x) * - glm::dot(y, y)); - } - - template - GLM_FUNC_QUALIFIER T normalizeDot - ( - tvec4 const & x, - tvec4 const & y - ) - { - return - glm::dot(x, y) * - glm::inversesqrt(glm::dot(x, x) * - glm::dot(y, y)); - } - - template - GLM_FUNC_QUALIFIER genType fastNormalizeDot - ( - genType const & x, - genType const & y - ) - { - return - glm::dot(x, y) * - fastInverseSqrt(glm::dot(x, x) * - glm::dot(y, y)); - } - - template - GLM_FUNC_QUALIFIER T fastNormalizeDot - ( - tvec2 const & x, - tvec2 const & y - ) - { - return - glm::dot(x, y) * - fastInverseSqrt(glm::dot(x, x) * - glm::dot(y, y)); - } - - template - GLM_FUNC_QUALIFIER T fastNormalizeDot - ( - tvec3 const & x, - tvec3 const & y - ) - { - return - glm::dot(x, y) * - fastInverseSqrt(glm::dot(x, x) * - glm::dot(y, y)); - } - - template - GLM_FUNC_QUALIFIER T fastNormalizeDot - ( - tvec4 const & x, - tvec4 const & y - ) - { - return - glm::dot(x, y) * - fastInverseSqrt(glm::dot(x, x) * - glm::dot(y, y)); + return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); } }//namespace glm