Matching headers and implementations
This commit is contained in:
parent
25a57418bd
commit
67964bfd0a
@ -37,10 +37,7 @@
|
|||||||
namespace glm
|
namespace glm
|
||||||
{
|
{
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> affineInverse
|
GLM_FUNC_QUALIFIER tmat3x3<T, P> affineInverse(tmat3x3<T, P> const & m)
|
||||||
(
|
|
||||||
tmat3x3<T, P> const & m
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
tmat3x3<T, P> Result(m);
|
tmat3x3<T, P> Result(m);
|
||||||
Result[2] = tvec3<T, P>(0, 0, 1);
|
Result[2] = tvec3<T, P>(0, 0, 1);
|
||||||
@ -51,10 +48,7 @@ namespace glm
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> affineInverse
|
GLM_FUNC_QUALIFIER tmat4x4<T, P> affineInverse(tmat4x4<T, P> const & m)
|
||||||
(
|
|
||||||
tmat4x4<T, P> const & m
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
tmat4x4<T, P> Result(m);
|
tmat4x4<T, P> Result(m);
|
||||||
Result[3] = tvec4<T, P>(0, 0, 0, 1);
|
Result[3] = tvec4<T, P>(0, 0, 0, 1);
|
||||||
@ -65,10 +59,7 @@ namespace glm
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> inverseTranspose
|
GLM_FUNC_QUALIFIER tmat2x2<T, P> inverseTranspose(tmat2x2<T, P> const & m)
|
||||||
(
|
|
||||||
tmat2x2<T, P> const & m
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];
|
T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];
|
||||||
|
|
||||||
@ -82,10 +73,7 @@ namespace glm
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> inverseTranspose
|
GLM_FUNC_QUALIFIER tmat3x3<T, P> inverseTranspose(tmat3x3<T, P> const & m)
|
||||||
(
|
|
||||||
tmat3x3<T, P> const & m
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
T Determinant =
|
T Determinant =
|
||||||
+ m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1])
|
+ m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1])
|
||||||
@ -108,10 +96,7 @@ namespace glm
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> inverseTranspose
|
GLM_FUNC_QUALIFIER tmat4x4<T, P> inverseTranspose(tmat4x4<T, P> const & m)
|
||||||
(
|
|
||||||
tmat4x4<T, P> const & m
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
|
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];
|
T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
|
||||||
|
|||||||
@ -44,7 +44,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Dependency:
|
// Dependency:
|
||||||
#include "../glm.hpp"
|
#include "../common.hpp"
|
||||||
|
#include "../exponential.hpp"
|
||||||
|
#include "../geometric.hpp"
|
||||||
|
|
||||||
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
|
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
|
||||||
# pragma message("GLM: GLM_GTX_fast_square_root extension included")
|
# pragma message("GLM: GLM_GTX_fast_square_root extension included")
|
||||||
@ -55,38 +57,57 @@ namespace glm
|
|||||||
/// @addtogroup gtx_fast_square_root
|
/// @addtogroup gtx_fast_square_root
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
//! Faster than the common sqrt function but less accurate.
|
/// Faster than the common sqrt function but less accurate.
|
||||||
//! From GLM_GTX_fast_square_root extension.
|
///
|
||||||
|
/// @see gtx_fast_square_root extension.
|
||||||
template <typename genType>
|
template <typename genType>
|
||||||
GLM_FUNC_DECL genType fastSqrt(genType x);
|
GLM_FUNC_DECL genType fastSqrt(genType x);
|
||||||
|
|
||||||
//! Faster than the common inversesqrt function but less accurate.
|
/// Faster than the common sqrt function but less accurate.
|
||||||
//! From GLM_GTX_fast_square_root extension.
|
///
|
||||||
|
/// @see gtx_fast_square_root extension.
|
||||||
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
|
GLM_FUNC_DECL vecType<T, P> fastSqrt(vecType<T, P> const & x);
|
||||||
|
|
||||||
|
/// Faster than the common inversesqrt function but less accurate.
|
||||||
|
///
|
||||||
|
/// @see gtx_fast_square_root extension.
|
||||||
template <typename genType>
|
template <typename genType>
|
||||||
GLM_FUNC_DECL genType fastInverseSqrt(genType x);
|
GLM_FUNC_DECL genType fastInverseSqrt(genType x);
|
||||||
|
|
||||||
//! Faster than the common inversesqrt function but less accurate.
|
/// Faster than the common inversesqrt function but less accurate.
|
||||||
//! From GLM_GTX_fast_square_root extension.
|
///
|
||||||
|
/// @see gtx_fast_square_root extension.
|
||||||
template <typename T, precision P, template <typename, precision> class vecType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_DECL vecType<T, P> fastInverseSqrt(vecType<T, P> const & x);
|
GLM_FUNC_DECL vecType<T, P> fastInverseSqrt(vecType<T, P> const & x);
|
||||||
|
|
||||||
//! Faster than the common length function but less accurate.
|
/// Faster than the common length function but less accurate.
|
||||||
//! From GLM_GTX_fast_square_root extension.
|
///
|
||||||
|
/// @see gtx_fast_square_root extension.
|
||||||
template <typename genType>
|
template <typename genType>
|
||||||
GLM_FUNC_DECL typename genType::value_type fastLength(genType const & x);
|
GLM_FUNC_DECL genType fastLength(genType x);
|
||||||
|
|
||||||
//! Faster than the common distance function but less accurate.
|
/// Faster than the common length function but less accurate.
|
||||||
//! From GLM_GTX_fast_square_root extension.
|
///
|
||||||
|
/// @see gtx_fast_square_root extension.
|
||||||
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
|
GLM_FUNC_DECL T fastLength(vecType<T, P> const & x);
|
||||||
|
|
||||||
|
/// Faster than the common distance function but less accurate.
|
||||||
|
///
|
||||||
|
/// @see gtx_fast_square_root extension.
|
||||||
template <typename genType>
|
template <typename genType>
|
||||||
GLM_FUNC_DECL genType fastDistance(genType x, genType y);
|
GLM_FUNC_DECL genType fastDistance(genType x, genType y);
|
||||||
|
|
||||||
//! Faster than the common distance function but less accurate.
|
/// Faster than the common distance function but less accurate.
|
||||||
//! From GLM_GTX_fast_square_root extension.
|
///
|
||||||
|
/// @see gtx_fast_square_root extension.
|
||||||
template <typename T, precision P, template <typename, precision> class vecType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_DECL T fastDistance(vecType<T, P> const & x, vecType<T, P> const & y);
|
GLM_FUNC_DECL T fastDistance(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||||
|
|
||||||
//! Faster than the common normalize function but less accurate.
|
/// Faster than the common normalize function but less accurate.
|
||||||
//! From GLM_GTX_fast_square_root extension.
|
///
|
||||||
|
/// @see gtx_fast_square_root extension.
|
||||||
template <typename genType>
|
template <typename genType>
|
||||||
GLM_FUNC_DECL genType fastNormalize(genType const & x);
|
GLM_FUNC_DECL genType fastNormalize(genType const & x);
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Dependency:
|
// Dependency:
|
||||||
#include "../glm.hpp"
|
|
||||||
#include "../gtc/constants.hpp"
|
#include "../gtc/constants.hpp"
|
||||||
|
|
||||||
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
|
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
|
||||||
|
|||||||
@ -43,7 +43,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Dependency:
|
// Dependency:
|
||||||
#include "../glm.hpp"
|
|
||||||
#include "../gtx/fast_square_root.hpp"
|
#include "../gtx/fast_square_root.hpp"
|
||||||
|
|
||||||
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
|
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
|
||||||
@ -55,21 +54,19 @@ namespace glm
|
|||||||
/// @addtogroup gtx_normalize_dot
|
/// @addtogroup gtx_normalize_dot
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
//! Normalize parameters and returns the dot product of x and y.
|
/// Normalize parameters and returns the dot product of x and y.
|
||||||
//! It's faster that dot(normalize(x), normalize(y)).
|
/// It's faster that dot(normalize(x), normalize(y)).
|
||||||
//! From GLM_GTX_normalize_dot extension.
|
///
|
||||||
template <typename genType>
|
/// @see gtx_normalize_dot extension.
|
||||||
GLM_FUNC_DECL typename genType::value_type normalizeDot(
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
genType const & x,
|
GLM_FUNC_DECL T normalizeDot(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||||
genType const & y);
|
|
||||||
|
|
||||||
//! Normalize parameters and returns the dot product of x and y.
|
/// Normalize parameters and returns the dot product of x and y.
|
||||||
//! Faster that dot(fastNormalize(x), fastNormalize(y)).
|
/// Faster that dot(fastNormalize(x), fastNormalize(y)).
|
||||||
//! From GLM_GTX_normalize_dot extension.
|
///
|
||||||
template <typename genType>
|
/// @see gtx_normalize_dot extension.
|
||||||
GLM_FUNC_DECL typename genType::value_type fastNormalizeDot(
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
genType const & x,
|
GLM_FUNC_DECL T fastNormalizeDot(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||||
genType const & y);
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|||||||
@ -32,101 +32,15 @@
|
|||||||
|
|
||||||
namespace glm
|
namespace glm
|
||||||
{
|
{
|
||||||
template <typename genType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_QUALIFIER genType normalizeDot
|
GLM_FUNC_QUALIFIER T normalizeDot(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||||
(
|
|
||||||
genType const & x,
|
|
||||||
genType const & y
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
|
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_QUALIFIER T normalizeDot
|
GLM_FUNC_QUALIFIER T fastNormalizeDot(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||||
(
|
|
||||||
tvec2<T, P> const & x,
|
|
||||||
tvec2<T, P> const & y
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
|
return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y));
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER T normalizeDot
|
|
||||||
(
|
|
||||||
tvec3<T, P> const & x,
|
|
||||||
tvec3<T, P> const & y
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
glm::dot(x, y) *
|
|
||||||
glm::inversesqrt(glm::dot(x, x) *
|
|
||||||
glm::dot(y, y));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER T normalizeDot
|
|
||||||
(
|
|
||||||
tvec4<T, P> const & x,
|
|
||||||
tvec4<T, P> const & y
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
glm::dot(x, y) *
|
|
||||||
glm::inversesqrt(glm::dot(x, x) *
|
|
||||||
glm::dot(y, y));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename genType>
|
|
||||||
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 <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER T fastNormalizeDot
|
|
||||||
(
|
|
||||||
tvec2<T, P> const & x,
|
|
||||||
tvec2<T, P> const & y
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
glm::dot(x, y) *
|
|
||||||
fastInverseSqrt(glm::dot(x, x) *
|
|
||||||
glm::dot(y, y));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER T fastNormalizeDot
|
|
||||||
(
|
|
||||||
tvec3<T, P> const & x,
|
|
||||||
tvec3<T, P> const & y
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
glm::dot(x, y) *
|
|
||||||
fastInverseSqrt(glm::dot(x, x) *
|
|
||||||
glm::dot(y, y));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER T fastNormalizeDot
|
|
||||||
(
|
|
||||||
tvec4<T, P> const & x,
|
|
||||||
tvec4<T, P> const & y
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
glm::dot(x, y) *
|
|
||||||
fastInverseSqrt(glm::dot(x, x) *
|
|
||||||
glm::dot(y, y));
|
|
||||||
}
|
}
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user