Fixed merge

This commit is contained in:
Christophe Riccio 2013-05-12 15:53:00 +02:00
commit 2968f85b66
47 changed files with 1009 additions and 811 deletions

View File

@ -331,6 +331,5 @@ int main()
}
}
//glm::vec3 v{0, 1, 2};
return 0;
}

View File

@ -33,9 +33,9 @@ namespace glm
{
enum precision
{
lowp,
highp,
mediump,
highp
lowp
};
}//namespace glm

View File

@ -576,7 +576,7 @@
// that windows.h (and maybe other headers) will silently include intrin.h, which of course causes problems.
// To fix, we just explicitly include intrin.h here.
#if defined(__MINGW32__) && (GLM_ARCH != GLM_ARCH_PURE)
# include <intrin.h>
# include <intrin.h>
#endif
//#if(GLM_ARCH != GLM_ARCH_PURE)

View File

@ -135,8 +135,14 @@ namespace detail
GLM_FUNC_DECL tmat2x2<T, P> & operator/=(U const & s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator/=(tmat2x2<U, P> const & m);
GLM_FUNC_DECL tmat2x2<T, P> & operator++();
GLM_FUNC_DECL tmat2x2<T, P> & operator--();
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat2x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x2<T, P> operator++(int);
GLM_FUNC_DECL tmat2x2<T, P> operator--(int);
};
// Binary operators
@ -232,18 +238,9 @@ namespace detail
// Unary constant operators
template <typename T, precision P>
tmat2x2<T, P> const operator- (
tmat2x2<T, P> const operator-(
tmat2x2<T, P> const & m);
template <typename T, precision P>
tmat2x2<T, P> const operator-- (
tmat2x2<T, P> const & m,
int);
template <typename T, precision P>
tmat2x2<T, P> const operator++ (
tmat2x2<T, P> const & m,
int);
} //namespace detail
} //namespace glm

View File

@ -397,7 +397,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator++ ()
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator++()
{
++this->value[0];
++this->value[1];
@ -405,13 +405,29 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-- ()
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> tmat2x2<T, P>::operator++(int)
{
tmat2x2<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> tmat2x2<T, P>::operator--(int)
{
tmat2x2<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -649,30 +665,6 @@ namespace detail
-m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> const operator++
(
tmat2x2<T, P> const & m,
int
)
{
return tmat2x2<T, P>(
m[0] + T(1),
m[1] + T(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> const operator--
(
tmat2x2<T, P> const & m,
int
)
{
return tmat2x2<T, P>(
m[0] - T(1),
m[1] - T(1));
}
//////////////////////////////////////
// Boolean operators

View File

@ -124,8 +124,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator/= (U const & s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat2x3<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x3<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x3<T, P> operator++(int);
GLM_FUNC_DECL tmat2x3<T, P> operator--(int);
};
// Binary operators
@ -196,18 +201,9 @@ namespace detail
// Unary constant operators
template <typename T, precision P>
tmat2x3<T, P> const operator- (
tmat2x3<T, P> const operator- (
tmat2x3<T, P> const & m);
template <typename T, precision P>
tmat2x3<T, P> const operator-- (
tmat2x3<T, P> const & m,
int);
template <typename T, precision P>
tmat2x3<T, P> const operator++ (
tmat2x3<T, P> const & m,
int);
}//namespace detail
}//namespace glm

View File

@ -374,7 +374,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator++ ()
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator++()
{
++this->value[0];
++this->value[1];
@ -382,13 +382,29 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator-- ()
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> tmat2x3<T, P>::operator++(int)
{
tmat2x3<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> tmat2x3<T, P>::operator--(int)
{
tmat2x3<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -595,30 +611,6 @@ namespace detail
-m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> const operator++
(
tmat2x3<T, P> const & m,
int
)
{
return tmat2x3<T, P>(
m[0] + typename tmat2x3<T, P>::value_type(1),
m[1] + typename tmat2x3<T, P>::value_type(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> const operator--
(
tmat2x3<T, P> const & m,
int
)
{
return tmat2x3<T, P>(
m[0] - typename tmat2x3<T, P>::value_type(1),
m[1] - typename tmat2x3<T, P>::value_type(1));
}
//////////////////////////////////////
// Boolean operators

View File

@ -126,8 +126,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P>& operator/= (U const & s);
GLM_FUNC_DECL tmat2x4<T, P>& operator++ ();
GLM_FUNC_DECL tmat2x4<T, P>& operator-- ();
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat2x4<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x4<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x4<T, P> operator++(int);
GLM_FUNC_DECL tmat2x4<T, P> operator--(int);
};
// Binary operators
@ -201,16 +206,6 @@ namespace detail
tmat2x4<T, P> const operator- (
tmat2x4<T, P> const & m);
template <typename T, precision P>
tmat2x4<T, P> const operator-- (
tmat2x4<T, P> const & m,
int);
template <typename T, precision P>
tmat2x4<T, P> const operator++ (
tmat2x4<T, P> const & m,
int);
}//namespace detail
}//namespace glm

View File

@ -377,7 +377,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator++ ()
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator++()
{
++this->value[0];
++this->value[1];
@ -385,13 +385,29 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator-- ()
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> tmat2x4<T, P>::operator++(int)
{
tmat2x4<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> tmat2x4<T, P>::operator--(int)
{
tmat2x4<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -614,30 +630,6 @@ namespace detail
-m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> const operator++
(
tmat2x4<T, P> const & m,
int
)
{
return tmat2x4<T, P>(
m[0] + typename tmat2x4<T, P>::value_type(1),
m[1] + typename tmat2x4<T, P>::value_type(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> const operator--
(
tmat2x4<T, P> const & m,
int
)
{
return tmat2x4<T, P>(
m[0] - typename tmat2x4<T, P>::value_type(1),
m[1] - typename tmat2x4<T, P>::value_type(1));
}
//////////////////////////////////////
// Boolean operators

View File

@ -132,8 +132,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator/= (U const & s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat3x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat3x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat3x2<T, P> operator++(int);
GLM_FUNC_DECL tmat3x2<T, P> operator--(int);
};
// Binary operators
@ -204,18 +209,9 @@ namespace detail
// Unary constant operators
template <typename T, precision P>
tmat3x2<T, P> const operator- (
tmat3x2<T, P> const operator-(
tmat3x2<T, P> const & m);
template <typename T, precision P>
tmat3x2<T, P> const operator-- (
tmat3x2<T, P> const & m,
int);
template <typename T, precision P>
tmat3x2<T, P> const operator++ (
tmat3x2<T, P> const & m,
int);
}//namespace detail
}//namespace glm

View File

@ -421,6 +421,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> tmat3x2<T, P>::operator++(int)
{
tmat3x2<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> tmat3x2<T, P>::operator--(int)
{
tmat3x2<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -627,34 +643,6 @@ namespace detail
-m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> const operator++
(
tmat3x2<T, P> const & m,
int
)
{
typename tmat3x2<T, P>::value_type One(1);
return tmat3x2<T, P>(
m[0] + One,
m[1] + One,
m[2] + One);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> const operator--
(
tmat3x2<T, P> const & m,
int
)
{
typename tmat3x2<T, P>::value_type One(1);
return tmat3x2<T, P>(
m[0] - One,
m[1] - One,
m[2] - One);
}
//////////////////////////////////////
// Boolean operators

View File

@ -139,8 +139,14 @@ namespace detail
GLM_FUNC_DECL tmat3x3<T, P>& operator/= (U const & s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator/= (tmat3x3<U, P> const & m);
GLM_FUNC_DECL tmat3x3<T, P>& operator++ ();
GLM_FUNC_DECL tmat3x3<T, P>& operator-- ();
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat3x3<T, P> & operator++ ();
GLM_FUNC_DECL tmat3x3<T, P> & operator-- ();
GLM_FUNC_DECL tmat3x3<T, P> operator++(int);
GLM_FUNC_DECL tmat3x3<T, P> operator--(int);
};
// Binary operators
@ -236,18 +242,9 @@ namespace detail
// Unary constant operators
template <typename T, precision P>
tmat3x3<T, P> const operator- (
tmat3x3<T, P> const operator-(
tmat3x3<T, P> const & m);
template <typename T, precision P>
tmat3x3<T, P> const operator-- (
tmat3x3<T, P> const & m,
int);
template <typename T, precision P>
tmat3x3<T, P> const operator++ (
tmat3x3<T, P> const & m,
int);
}//namespace detail
}//namespace glm

View File

@ -426,7 +426,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator-- ()
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator--()
{
--this->value[0];
--this->value[1];
@ -434,6 +434,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::operator++(int)
{
tmat3x3<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::operator--(int)
{
tmat3x3<T, P> Result(*this);
--*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::_inverse() const
{
@ -759,32 +775,6 @@ namespace detail
-m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> const operator++
(
tmat3x3<T, P> const & m,
int
)
{
return tmat3x3<T, P>(
m[0] + T(1),
m[1] + T(1),
m[2] + T(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> const operator--
(
tmat3x3<T, P> const & m,
int
)
{
return tmat3x3<T, P>(
m[0] - T(1),
m[1] - T(1),
m[2] - T(1));
}
//////////////////////////////////////
// Boolean operators

View File

@ -132,8 +132,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator/= (U const & s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat3x4<T, P> & operator++ ();
GLM_FUNC_DECL tmat3x4<T, P> & operator-- ();
GLM_FUNC_DECL tmat3x4<T, P> operator++(int);
GLM_FUNC_DECL tmat3x4<T, P> operator--(int);
};
// Binary operators
@ -204,19 +209,9 @@ namespace detail
// Unary constant operators
template <typename T, precision P>
tmat3x4<T, P> const operator- (
tmat3x4<T, P> const operator-(
tmat3x4<T, P> const & m);
template <typename T, precision P>
tmat3x4<T, P> const operator-- (
tmat3x4<T, P> const & m,
int);
template <typename T, precision P>
tmat3x4<T, P> const operator++ (
tmat3x4<T, P> const & m,
int);
}//namespace detail
}//namespace glm

View File

@ -420,6 +420,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> tmat3x4<T, P>::operator++(int)
{
tmat3x4<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> tmat3x4<T, P>::operator--(int)
{
tmat3x4<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -660,32 +676,6 @@ namespace detail
-m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> const operator++
(
tmat3x4<T, P> const & m,
int
)
{
return tmat3x4<T, P>(
m[0] + T(1),
m[1] + T(1),
m[2] + T(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> const operator--
(
tmat3x4<T, P> const & m,
int
)
{
return tmat3x4<T, P>(
m[0] - T(1),
m[1] - T(1),
m[2] - T(1));
}
//////////////////////////////////////
// Boolean operators

View File

@ -137,8 +137,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P>& operator/= (U const & s);
GLM_FUNC_DECL tmat4x2<T, P>& operator++ ();
GLM_FUNC_DECL tmat4x2<T, P>& operator-- ();
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat4x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat4x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat4x2<T, P> operator++(int);
GLM_FUNC_DECL tmat4x2<T, P> operator--(int);
};
// Binary operators
@ -209,18 +214,9 @@ namespace detail
// Unary constant operators
template <typename T, precision P>
tmat4x2<T, P> const operator- (
tmat4x2<T, P> const operator-(
tmat4x2<T, P> const & m);
template <typename T, precision P>
tmat4x2<T, P> const operator-- (
tmat4x2<T, P> const & m,
int);
template <typename T, precision P>
tmat4x2<T, P> const operator++ (
tmat4x2<T, P> const & m,
int);
}//namespace detail
}//namespace glm

View File

@ -454,6 +454,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> tmat4x2<T, P>::operator++(int)
{
tmat4x2<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> tmat4x2<T, P>::operator--(int)
{
tmat4x2<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -676,34 +692,6 @@ namespace detail
-m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> const operator++
(
tmat4x2<T, P> const & m,
int
)
{
return tmat4x2<T, P>(
m[0] + typename tmat4x2<T, P>::value_type(1),
m[1] + typename tmat4x2<T, P>::value_type(1),
m[2] + typename tmat4x2<T, P>::value_type(1),
m[3] + typename tmat4x2<T, P>::value_type(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> const operator--
(
tmat4x2<T, P> const & m,
int
)
{
return tmat4x2<T, P>(
m[0] - typename tmat4x2<T, P>::value_type(1),
m[1] - typename tmat4x2<T, P>::value_type(1),
m[2] - typename tmat4x2<T, P>::value_type(1),
m[3] - typename tmat4x2<T, P>::value_type(1));
}
//////////////////////////////////////
// Boolean operators

View File

@ -135,8 +135,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator/= (U const & s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat4x3<T, P> & operator++ ();
GLM_FUNC_DECL tmat4x3<T, P> & operator-- ();
GLM_FUNC_DECL tmat4x3<T, P> operator++(int);
GLM_FUNC_DECL tmat4x3<T, P> operator--(int);
};
// Binary operators
@ -210,15 +215,6 @@ namespace detail
tmat4x3<T, P> const operator- (
tmat4x3<T, P> const & m);
template <typename T, precision P>
tmat4x3<T, P> const operator-- (
tmat4x3<T, P> const & m,
int);
template <typename T, precision P>
tmat4x3<T, P> const operator++ (
tmat4x3<T, P> const & m,
int);
}//namespace detail
}//namespace glm

View File

@ -710,6 +710,22 @@ namespace detail
m[3] - T(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator++(int)
{
tmat4x3<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator--(int)
{
tmat4x3<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////
// Boolean operators

View File

@ -142,8 +142,14 @@ namespace detail
GLM_FUNC_DECL tmat4x4<T, P> & operator/= (U const & s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator/= (tmat4x4<U, P> const & m);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat4x4<T, P> & operator++ ();
GLM_FUNC_DECL tmat4x4<T, P> & operator-- ();
GLM_FUNC_DECL tmat4x4<T, P> operator++(int);
GLM_FUNC_DECL tmat4x4<T, P> operator--(int);
};
// Binary operators
@ -242,14 +248,6 @@ namespace detail
tmat4x4<T, P> const operator- (
tmat4x4<T, P> const & m);
template <typename T, precision P>
tmat4x4<T, P> const operator-- (
tmat4x4<T, P> const & m, int);
template <typename T, precision P>
tmat4x4<T, P> const operator++ (
tmat4x4<T, P> const & m, int);
}//namespace detail
}//namespace glm

View File

@ -496,6 +496,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::operator++(int)
{
tmat4x4<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::operator--(int)
{
tmat4x4<T, P> Result(*this);
--*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::_inverse() const
{
@ -692,11 +708,45 @@ namespace detail
typename tmat4x4<T, P>::row_type const & v
)
{
/*
__m128 v0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(0, 0, 0, 0));
__m128 v1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(1, 1, 1, 1));
__m128 v2 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(2, 2, 2, 2));
__m128 v3 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 3, 3, 3));
__m128 m0 = _mm_mul_ps(m[0].data, v0);
__m128 m1 = _mm_mul_ps(m[1].data, v1);
__m128 a0 = _mm_add_ps(m0, m1);
__m128 m2 = _mm_mul_ps(m[2].data, v2);
__m128 m3 = _mm_mul_ps(m[3].data, v3);
__m128 a1 = _mm_add_ps(m2, m3);
__m128 a2 = _mm_add_ps(a0, a1);
return typename tmat4x4<T, P>::col_type(a2);
*/
typename tmat4x4<T, P>::col_type const Mov0(v[0]);
typename tmat4x4<T, P>::col_type const Mov1(v[1]);
typename tmat4x4<T, P>::col_type const Mul0 = m[0] * Mov0;
typename tmat4x4<T, P>::col_type const Mul1 = m[1] * Mov1;
typename tmat4x4<T, P>::col_type const Add0 = Mul0 * Mul1;
typename tmat4x4<T, P>::col_type const Mov2(v[2]);
typename tmat4x4<T, P>::col_type const Mov3(v[3]);
typename tmat4x4<T, P>::col_type const Mul2 = m[2] * Mov2;
typename tmat4x4<T, P>::col_type const Mul3 = m[3] * Mov3;
typename tmat4x4<T, P>::col_type const Add1 = Mul2 * Mul3;
typename tmat4x4<T, P>::col_type const Add2 = Add0 * Add1;
return Add2;
/*
return typename tmat4x4<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w,
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w,
m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z + m[3][3] * v.w);
m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0] * v[3],
m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3],
m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3],
m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3] * v[3]);
*/
}
template <typename T, precision P>
@ -707,10 +757,10 @@ namespace detail
)
{
return typename tmat4x4<T, P>::row_type(
m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w,
m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w,
m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w,
m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] * v.w);
m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2] + m[0][3] * v[3],
m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2] + m[1][3] * v[3],
m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2] + m[2][3] * v[3],
m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]);
}
template <typename T, precision P>

View File

@ -235,6 +235,102 @@ namespace detail
GLM_DETAIL_IS_VECTOR(tvec2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator+(T const & s, tvec2<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator-(T const & s, tvec2<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator- (tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator*(T const & s, tvec2<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator/(T const & s, tvec2<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator%(T const & s, tvec2<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator&(T const & s, tvec2<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator|(T const & s, tvec2<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator^(T const & s, tvec2<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator<<(T const & s, tvec2<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator>>(T const & s, tvec2<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator~(tvec2<T, P> const & v);
}//namespace detail
}//namespace glm

View File

@ -957,7 +957,7 @@ namespace detail
// tref definition
template <typename T, precision P>
tref2<T, P>::tref2
GLM_FUNC_QUALIFIER tref2<T, P>::tref2
(
T & x,
T & y
@ -967,7 +967,7 @@ namespace detail
{}
template <typename T, precision P>
tref2<T, P>::tref2
GLM_FUNC_QUALIFIER tref2<T, P>::tref2
(
tref2<T, P> const & r
) :
@ -976,7 +976,7 @@ namespace detail
{}
template <typename T, precision P>
tref2<T, P>::tref2
GLM_FUNC_QUALIFIER tref2<T, P>::tref2
(
tvec2<T, P> const & v
) :
@ -985,7 +985,7 @@ namespace detail
{}
template <typename T, precision P>
tref2<T, P>& tref2<T, P>::operator=
GLM_FUNC_QUALIFIER tref2<T, P>& tref2<T, P>::operator=
(
tref2<T, P> const & r
)
@ -996,7 +996,7 @@ namespace detail
}
template <typename T, precision P>
tref2<T, P>& tref2<T, P>::operator=
GLM_FUNC_QUALIFIER tref2<T, P>& tref2<T, P>::operator=
(
tvec2<T, P> const & v
)

View File

@ -260,6 +260,103 @@ namespace detail
};
GLM_DETAIL_IS_VECTOR(tvec3);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator- (tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator~(tvec3<T, P> const & v);
}//namespace detail
}//namespace glm

View File

@ -37,7 +37,7 @@ namespace glm{
namespace detail
{
template <typename T, precision P>
struct tvec4
struct __declspec(align(16)) tvec4
{
enum ctor{_null};
@ -54,17 +54,17 @@ namespace detail
# if(GLM_COMPONENT == GLM_COMPONENT_CXXMS)
union
{
# if(defined(GLM_SWIZZLE))
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w)
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, r, g, b, a)
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, s, t, p, q)
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, x, y, z, w)
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, r, g, b, a)
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, s, t, p, q)
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, x, y, z, w)
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, r, g, b, a)
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, s, t, p, q)
# endif//(defined(GLM_SWIZZLE))
# if(defined(GLM_SWIZZLE))
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w)
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, r, g, b, a)
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, s, t, p, q)
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, x, y, z, w)
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, r, g, b, a)
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, s, t, p, q)
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, x, y, z, w)
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, r, g, b, a)
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, s, t, p, q)
# endif//(defined(GLM_SWIZZLE))
struct {value_type r, g, b, a;};
struct {value_type s, t, p, q;};
@ -317,6 +317,109 @@ namespace detail
};
GLM_DETAIL_IS_VECTOR(tvec4);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, typename tvec4<T, P>::value_type const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(typename tvec4<T, P>::value_type const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, typename tvec4<T, P>::value_type const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(typename tvec4<T, P>::value_type const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator- (tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, typename tvec4<T, P>::value_type const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(typename tvec4<T, P>::value_type const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, typename tvec4<T, P>::value_type const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(typename tvec4<T, P>::value_type const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, typename tvec4<T, P>::value_type const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(typename tvec4<T, P>::value_type const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, typename tvec4<T, P>::value_type const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(typename tvec4<T, P>::value_type const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, typename tvec4<T, P>::value_type const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(typename tvec4<T, P>::value_type const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, typename tvec4<T, P>::value_type const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(typename tvec4<T, P>::value_type const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, typename tvec4<T, P>::value_type const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(typename tvec4<T, P>::value_type const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, typename tvec4<T, P>::value_type const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(typename tvec4<T, P>::value_type const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator~(tvec4<T, P> const & v);
}//namespace detail
}//namespace glm

View File

@ -1294,7 +1294,7 @@ namespace detail
// tref definition
template <typename T, precision P>
tref4<T, P>::tref4
GLM_FUNC_QUALIFIER tref4<T, P>::tref4
(
T & x,
T & y,
@ -1308,7 +1308,7 @@ namespace detail
{}
template <typename T, precision P>
tref4<T, P>::tref4
GLM_FUNC_QUALIFIER tref4<T, P>::tref4
(
tref4<T, P> const & r
) :
@ -1319,7 +1319,7 @@ namespace detail
{}
template <typename T, precision P>
tref4<T, P>::tref4
GLM_FUNC_QUALIFIER tref4<T, P>::tref4
(
tvec4<T, P> const & v
) :
@ -1330,7 +1330,7 @@ namespace detail
{}
template <typename T, precision P>
tref4<T, P>& tref4<T, P>::operator=
GLM_FUNC_QUALIFIER tref4<T, P>& tref4<T, P>::operator=
(
tref4<T, P> const & r
)
@ -1343,7 +1343,7 @@ namespace detail
}
template <typename T, precision P>
tref4<T, P>& tref4<T, P>::operator=
GLM_FUNC_QUALIFIER tref4<T, P>& tref4<T, P>::operator=
(
tvec4<T, P> const & v
)

View File

@ -54,14 +54,14 @@ namespace glm
template <typename genType>
typename genType::row_type row(
genType const & m,
int index);
typename genType::size_type const & index);
/// Set a specific row to a matrix.
/// @see gtc_matrix_access
template <typename genType>
genType row(
genType const & m,
int index,
typename genType::size_type const & index,
typename genType::row_type const & x);
/// Get a specific column of a matrix.
@ -69,14 +69,14 @@ namespace glm
template <typename genType>
typename genType::col_type column(
genType const & m,
int index);
typename genType::size_type const & index);
/// Set a specific column to a matrix.
/// @see gtc_matrix_access
template <typename genType>
genType column(
genType const & m,
int index,
typename genType::size_type const & index,
typename genType::col_type const & x);
/// @}

View File

@ -32,10 +32,12 @@ namespace glm
GLM_FUNC_QUALIFIER genType row
(
genType const & m,
int index,
typename genType::size_type const & index,
typename genType::row_type const & x
)
{
assert(index < m.col_size());
genType Result = m;
for(typename genType::size_type i = 0; i < genType::row_size(); ++i)
Result[i][index] = x[i];
@ -46,9 +48,11 @@ namespace glm
GLM_FUNC_QUALIFIER typename genType::row_type row
(
genType const & m,
int index
typename genType::size_type const & index
)
{
assert(index < m.col_size());
typename genType::row_type Result;
for(typename genType::size_type i = 0; i < genType::row_size(); ++i)
Result[i] = m[i][index];
@ -59,10 +63,12 @@ namespace glm
GLM_FUNC_QUALIFIER genType column
(
genType const & m,
int index,
typename genType::size_type const & index,
typename genType::col_type const & x
)
{
assert(index < m.row_size());
genType Result = m;
Result[index] = x;
return Result;
@ -72,9 +78,11 @@ namespace glm
GLM_FUNC_QUALIFIER typename genType::col_type column
(
genType const & m,
int index
typename genType::size_type const & index
)
{
assert(index < m.row_size());
return m[index];
}
}//namespace glm

View File

@ -243,15 +243,11 @@ namespace glm
#else
valType const rad = glm::radians(fovy);
#endif
valType range = tan(rad / valType(2)) * zNear;
valType left = -range * aspect;
valType right = range * aspect;
valType bottom = -range;
valType top = range;
valType tanHalfFovy = tan(rad / valType(2));
detail::tmat4x4<valType, defaultp> Result(valType(0));
Result[0][0] = (valType(2) * zNear) / (right - left);
Result[1][1] = (valType(2) * zNear) / (top - bottom);
Result[0][0] = valType(1) / (aspect * tanHalfFovy);
Result[1][1] = valType(1) / (tanHalfFovy);
Result[2][2] = - (zFar + zNear) / (zFar - zNear);
Result[2][3] = - valType(1);
Result[3][2] = - (valType(2) * zFar * zNear) / (zFar - zNear);

View File

@ -52,23 +52,23 @@ namespace glm
/// Converts a color from HSV color space to its color in RGB color space.
/// @see gtx_color_space
template <typename valType>
template <typename valType>
detail::tvec3<valType> rgbColor(
detail::tvec3<valType> const & hsvValue);
/// Converts a color from RGB color space to its color in HSV color space.
/// @see gtx_color_space
template <typename valType>
template <typename valType>
detail::tvec3<valType> hsvColor(
detail::tvec3<valType> const & rgbValue);
/// Build a saturation matrix.
/// @see gtx_color_space
template <typename valType>
template <typename valType>
detail::tmat4x4<valType> saturation(
valType const s);
/// Modify the saturation of a color.
/// Modify the saturation of a color.
/// @see gtx_color_space
template <typename valType>
detail::tvec3<valType> saturation(
@ -77,7 +77,7 @@ namespace glm
/// Modify the saturation of a color.
/// @see gtx_color_space
template <typename valType>
template <typename valType>
detail::tvec4<valType> saturation(
valType const s,
detail::tvec4<valType> const & color);

View File

@ -50,29 +50,29 @@ namespace glm
/// @addtogroup gtx_color_space_YCoCg
/// @{
/// Convert a color from RGB color space to YCoCg color space.
/// Convert a color from RGB color space to YCoCg color space.
/// @see gtx_color_space_YCoCg
template <typename valType>
detail::tvec3<valType> rgb2YCoCg(
detail::tvec3<valType> const & rgbColor);
/// Convert a color from YCoCg color space to RGB color space.
/// Convert a color from YCoCg color space to RGB color space.
/// @see gtx_color_space_YCoCg
template <typename valType>
template <typename valType>
detail::tvec3<valType> YCoCg2rgb(
detail::tvec3<valType> const & YCoCgColor);
/// Convert a color from RGB color space to YCoCgR color space.
/// Convert a color from RGB color space to YCoCgR color space.
/// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"
/// @see gtx_color_space_YCoCg
template <typename valType>
detail::tvec3<valType> rgb2YCoCgR(
detail::tvec3<valType> const & rgbColor);
/// Convert a color from YCoCgR color space to RGB color space.
/// Convert a color from YCoCgR color space to RGB color space.
/// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"
/// @see gtx_color_space_YCoCg
template <typename valType>
template <typename valType>
detail::tvec3<valType> YCoCgR2rgb(
detail::tvec3<valType> const & YCoCgColor);

View File

@ -88,84 +88,84 @@ namespace glm
template <typename valType> detail::tvec4<bool> isfinite(const detail::tvec4<valType>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
typedef bool bool1; //!< \brief boolean type with 1 component. (From GLM_GTX_compatibility extension)
typedef detail::tvec2<bool> bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec3<bool> bool3; //!< \brief boolean type with 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec4<bool> bool4; //!< \brief boolean type with 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec2<bool, highp> bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec3<bool, highp> bool3; //!< \brief boolean type with 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec4<bool, highp> bool4; //!< \brief boolean type with 4 components. (From GLM_GTX_compatibility extension)
typedef bool bool1x1; //!< \brief boolean matrix with 1 x 1 component. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x2<bool> bool2x2; //!< \brief boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x3<bool> bool2x3; //!< \brief boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x4<bool> bool2x4; //!< \brief boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x2<bool> bool3x2; //!< \brief boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x3<bool> bool3x3; //!< \brief boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x4<bool> bool3x4; //!< \brief boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x2<bool> bool4x2; //!< \brief boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x3<bool> bool4x3; //!< \brief boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x4<bool> bool4x4; //!< \brief boolean matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x2<bool, highp> bool2x2; //!< \brief boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x3<bool, highp> bool2x3; //!< \brief boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x4<bool, highp> bool2x4; //!< \brief boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x2<bool, highp> bool3x2; //!< \brief boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x3<bool, highp> bool3x3; //!< \brief boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x4<bool, highp> bool3x4; //!< \brief boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x2<bool, highp> bool4x2; //!< \brief boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x3<bool, highp> bool4x3; //!< \brief boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x4<bool, highp> bool4x4; //!< \brief boolean matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
typedef int int1; //!< \brief integer vector with 1 component. (From GLM_GTX_compatibility extension)
typedef detail::tvec2<int> int2; //!< \brief integer vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec3<int> int3; //!< \brief integer vector with 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec4<int> int4; //!< \brief integer vector with 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec2<int, highp> int2; //!< \brief integer vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec3<int, highp> int3; //!< \brief integer vector with 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec4<int, highp> int4; //!< \brief integer vector with 4 components. (From GLM_GTX_compatibility extension)
typedef int int1x1; //!< \brief integer matrix with 1 component. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x2<int> int2x2; //!< \brief integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x3<int> int2x3; //!< \brief integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x4<int> int2x4; //!< \brief integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x2<int> int3x2; //!< \brief integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x3<int> int3x3; //!< \brief integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x4<int> int3x4; //!< \brief integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x2<int> int4x2; //!< \brief integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x3<int> int4x3; //!< \brief integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x4<int> int4x4; //!< \brief integer matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x2<int, highp> int2x2; //!< \brief integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x3<int, highp> int2x3; //!< \brief integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x4<int, highp> int2x4; //!< \brief integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x2<int, highp> int3x2; //!< \brief integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x3<int, highp> int3x3; //!< \brief integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x4<int, highp> int3x4; //!< \brief integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x2<int, highp> int4x2; //!< \brief integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x3<int, highp> int4x3; //!< \brief integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x4<int, highp> int4x4; //!< \brief integer matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::half half1; //!< \brief half-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension)
typedef detail::tvec2<detail::half> half2; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec3<detail::half> half3; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec4<detail::half> half4; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec2<detail::half, highp> half2; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec3<detail::half, highp> half3; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec4<detail::half, highp> half4; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::half half1x1; //!< \brief half-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x2<detail::half> half2x2; //!< \brief half-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x3<detail::half> half2x3; //!< \brief half-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x4<detail::half> half2x4; //!< \brief half-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x2<detail::half> half3x2; //!< \brief half-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x3<detail::half> half3x3; //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x4<detail::half> half3x4; //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x2<detail::half> half4x2; //!< \brief half-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x3<detail::half> half4x3; //!< \brief half-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x4<detail::half> half4x4; //!< \brief half-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x2<detail::half, highp> half2x2; //!< \brief half-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x3<detail::half, highp> half2x3; //!< \brief half-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x4<detail::half, highp> half2x4; //!< \brief half-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x2<detail::half, highp> half3x2; //!< \brief half-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x3<detail::half, highp> half3x3; //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x4<detail::half, highp> half3x4; //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x2<detail::half, highp> half4x2; //!< \brief half-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x3<detail::half, highp> half4x3; //!< \brief half-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x4<detail::half, highp> half4x4; //!< \brief half-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
typedef float float1; //!< \brief single-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension)
typedef detail::tvec2<float> float2; //!< \brief single-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec3<float> float3; //!< \brief single-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec4<float> float4; //!< \brief single-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec2<float, highp> float2; //!< \brief single-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec3<float, highp> float3; //!< \brief single-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec4<float, highp> float4; //!< \brief single-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension)
typedef float float1x1; //!< \brief single-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x2<float> float2x2; //!< \brief single-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x3<float> float2x3; //!< \brief single-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x4<float> float2x4; //!< \brief single-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x2<float> float3x2; //!< \brief single-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x3<float> float3x3; //!< \brief single-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x4<float> float3x4; //!< \brief single-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x2<float> float4x2; //!< \brief single-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x3<float> float4x3; //!< \brief single-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x4<float> float4x4; //!< \brief single-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x2<float, highp> float2x2; //!< \brief single-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x3<float, highp> float2x3; //!< \brief single-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x4<float, highp> float2x4; //!< \brief single-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x2<float, highp> float3x2; //!< \brief single-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x3<float, highp> float3x3; //!< \brief single-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x4<float, highp> float3x4; //!< \brief single-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x2<float, highp> float4x2; //!< \brief single-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x3<float, highp> float4x3; //!< \brief single-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x4<float, highp> float4x4; //!< \brief single-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
typedef double double1; //!< \brief double-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension)
typedef detail::tvec2<double> double2; //!< \brief double-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec3<double> double3; //!< \brief double-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec4<double> double4; //!< \brief double-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec2<double, highp> double2; //!< \brief double-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec3<double, highp> double3; //!< \brief double-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tvec4<double, highp> double4; //!< \brief double-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension)
typedef double double1x1; //!< \brief double-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x2<double> double2x2; //!< \brief double-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x3<double> double2x3; //!< \brief double-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x4<double> double2x4; //!< \brief double-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x2<double> double3x2; //!< \brief double-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x3<double> double3x3; //!< \brief double-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x4<double> double3x4; //!< \brief double-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x2<double> double4x2; //!< \brief double-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x3<double> double4x3; //!< \brief double-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x4<double> double4x4; //!< \brief double-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x2<double, highp> double2x2; //!< \brief double-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x3<double, highp> double2x3; //!< \brief double-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat2x4<double, highp> double2x4; //!< \brief double-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x2<double, highp> double3x2; //!< \brief double-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x3<double, highp> double3x3; //!< \brief double-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat3x4<double, highp> double3x4; //!< \brief double-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x2<double, highp> double4x2; //!< \brief double-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x3<double, highp> double4x3; //!< \brief double-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
typedef detail::tmat4x4<double, highp> double4x4; //!< \brief double-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
/// @}
}//namespace glm

View File

@ -79,13 +79,13 @@ namespace detail
typedef tvec4<bool, highp> bool_type;
#ifdef GLM_SIMD_ENABLE_XYZW_UNION
union
{
__m128 Data;
struct {float x, y, z, w;};
};
union
{
__m128 Data;
struct {float x, y, z, w;};
};
#else
__m128 Data;
__m128 Data;
#endif
//////////////////////////////////////
@ -160,60 +160,65 @@ namespace detail
/// @{
//! Convert a simdVec4 to a vec4.
//! (From GLM_GTX_simd_vec4 extension)
/// @see gtx_simd_vec4
vec4 vec4_cast(
detail::fvec4SIMD const & x);
//! Returns x if x >= 0; otherwise, it returns -x.
//! (From GLM_GTX_simd_vec4 extension, common function)
//! Returns x if x >= 0; otherwise, it returns -x.
/// @see gtx_simd_vec4
detail::fvec4SIMD abs(detail::fvec4SIMD const & x);
//! Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0.
//! (From GLM_GTX_simd_vec4 extension, common function)
//! Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0.
/// @see gtx_simd_vec4
detail::fvec4SIMD sign(detail::fvec4SIMD const & x);
//! Returns a value equal to the nearest integer that is less then or equal to x.
//! (From GLM_GTX_simd_vec4 extension, common function)
//! Returns a value equal to the nearest integer that is less then or equal to x.
/// @see gtx_simd_vec4
detail::fvec4SIMD floor(detail::fvec4SIMD const & x);
//! Returns a value equal to the nearest integer to x
//! whose absolute value is not larger than the absolute value of x.
//! (From GLM_GTX_simd_vec4 extension, common function)
//! Returns a value equal to the nearest integer to x
//! whose absolute value is not larger than the absolute value of x.
/// @see gtx_simd_vec4
detail::fvec4SIMD trunc(detail::fvec4SIMD const & x);
//! Returns a value equal to the nearest integer to x.
//! The fraction 0.5 will round in a direction chosen by the
//! implementation, presumably the direction that is fastest.
//! This includes the possibility that round(x) returns the
//! same value as roundEven(x) for all values of x.
//! (From GLM_GTX_simd_vec4 extension, common function)
//! Returns a value equal to the nearest integer to x.
//! The fraction 0.5 will round in a direction chosen by the
//! implementation, presumably the direction that is fastest.
//! This includes the possibility that round(x) returns the
//! same value as roundEven(x) for all values of x.
///
/// @see gtx_simd_vec4
detail::fvec4SIMD round(detail::fvec4SIMD const & x);
//! Returns a value equal to the nearest integer to x.
//! A fractional part of 0.5 will round toward the nearest even
//! integer. (Both 3.5 and 4.5 for x will return 4.0.)
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
//detail::fvec4SIMD roundEven(detail::fvec4SIMD const & x);
//! Returns a value equal to the nearest integer
//! that is greater than or equal to x.
//! (From GLM_GTX_simd_vec4 extension, common function)
/// @see gtx_simd_vec4
detail::fvec4SIMD ceil(detail::fvec4SIMD const & x);
//! Return x - floor(x).
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD fract(detail::fvec4SIMD const & x);
//! Modulus. Returns x - y * floor(x / y)
//! Modulus. Returns x - y * floor(x / y)
//! for each component in x using the floating point value y.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD mod(
detail::fvec4SIMD const & x,
detail::fvec4SIMD const & y);
//! Modulus. Returns x - y * floor(x / y)
//! Modulus. Returns x - y * floor(x / y)
//! for each component in x using the floating point value y.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD mod(
detail::fvec4SIMD const & x,
float const & y);
@ -228,7 +233,8 @@ namespace detail
// detail::fvec4SIMD & i);
//! Returns y if y < x; otherwise, it returns x.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD min(
detail::fvec4SIMD const & x,
detail::fvec4SIMD const & y);
@ -238,7 +244,8 @@ namespace detail
float const & y);
//! Returns y if x < y; otherwise, it returns x.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD max(
detail::fvec4SIMD const & x,
detail::fvec4SIMD const & y);
@ -249,7 +256,8 @@ namespace detail
//! Returns min(max(x, minVal), maxVal) for each component in x
//! using the floating-point values minVal and maxVal.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD clamp(
detail::fvec4SIMD const & x,
detail::fvec4SIMD const & minVal,
@ -283,15 +291,17 @@ namespace detail
//! \param[in] y Floating point scalar or vector.
//! \param[in] a Floating point or boolean scalar or vector.
//!
// \todo Test when 'a' is a boolean.
//! (From GLM_GTX_simd_vec4 extension, common function)
/// \todo Test when 'a' is a boolean.
///
/// @see gtx_simd_vec4
detail::fvec4SIMD mix(
detail::fvec4SIMD const & x,
detail::fvec4SIMD const & y,
detail::fvec4SIMD const & a);
//! Returns 0.0 if x < edge, otherwise it returns 1.0.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD step(
detail::fvec4SIMD const & edge,
detail::fvec4SIMD const & x);
@ -309,7 +319,8 @@ namespace detail
//! t = clamp ((x - edge0) / (edge1 - edge0), 0, 1);
//! return t * t * (3 - 2 * t);
//! Results are undefined if edge0 >= edge1.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD smoothstep(
detail::fvec4SIMD const & edge0,
detail::fvec4SIMD const & edge1,
@ -325,7 +336,8 @@ namespace detail
//! floating point representations. Returns false otherwise,
//! including for implementations with no NaN
//! representations.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
//bvec4 isnan(detail::fvec4SIMD const & x);
//! Returns true if x holds a positive infinity or negative
@ -333,13 +345,15 @@ namespace detail
//! set of floating point representations. Returns false
//! otherwise, including for implementations with no infinity
//! representations.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
//bvec4 isinf(detail::fvec4SIMD const & x);
//! Returns a signed or unsigned integer value representing
//! the encoding of a floating-point value. The floatingpoint
//! value's bit-level representation is preserved.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
//detail::ivec4SIMD floatBitsToInt(detail::fvec4SIMD const & value);
//! Returns a floating-point value corresponding to a signed
@ -347,11 +361,13 @@ namespace detail
//! If an inf or NaN is passed in, it will not signal, and the
//! resulting floating point value is unspecified. Otherwise,
//! the bit-level representation is preserved.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
//detail::fvec4SIMD intBitsToFloat(detail::ivec4SIMD const & value);
//! Computes and returns a * b + c.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD fma(
detail::fvec4SIMD const & a,
detail::fvec4SIMD const & b,
@ -365,7 +381,8 @@ namespace detail
//! floating-point value of zero, the significant and exponent
//! are both zero. For a floating-point value that is an
//! infinity or is not a number, the results are undefined.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
//detail::fvec4SIMD frexp(detail::fvec4SIMD const & x, detail::ivec4SIMD & exp);
//! Builds a floating-point number from x and the
@ -373,86 +390,101 @@ namespace detail
//! significand * exp(2, exponent)
//! If this product is too large to be represented in the
//! floating-point type, the result is undefined.
//! (From GLM_GTX_simd_vec4 extension, common function)
///
/// @see gtx_simd_vec4
//detail::fvec4SIMD ldexp(detail::fvec4SIMD const & x, detail::ivec4SIMD const & exp);
//! Returns the length of x, i.e., sqrt(x * x).
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
float length(
detail::fvec4SIMD const & x);
//! Returns the length of x, i.e., sqrt(x * x).
//! Less accurate but much faster than simdLength.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
float fastLength(
detail::fvec4SIMD const & x);
//! Returns the length of x, i.e., sqrt(x * x).
//! Slightly more accurate but much slower than simdLength.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
float niceLength(
detail::fvec4SIMD const & x);
//! Returns the length of x, i.e., sqrt(x * x).
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD length4(
detail::fvec4SIMD const & x);
//! Returns the length of x, i.e., sqrt(x * x).
//! Less accurate but much faster than simdLength4.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD fastLength4(
detail::fvec4SIMD const & x);
//! Returns the length of x, i.e., sqrt(x * x).
//! Slightly more accurate but much slower than simdLength4.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD niceLength4(
detail::fvec4SIMD const & x);
//! Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
float distance(
detail::fvec4SIMD const & p0,
detail::fvec4SIMD const & p1);
//! Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD distance4(
detail::fvec4SIMD const & p0,
detail::fvec4SIMD const & p1);
//! Returns the dot product of x and y, i.e., result = x * y.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
float simdDot(
detail::fvec4SIMD const & x,
detail::fvec4SIMD const & y);
//! Returns the dot product of x and y, i.e., result = x * y.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD dot4(
detail::fvec4SIMD const & x,
detail::fvec4SIMD const & y);
//! Returns the cross product of x and y.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD cross(
detail::fvec4SIMD const & x,
detail::fvec4SIMD const & y);
//! Returns a vector in the same direction as x but with length of 1.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD normalize(
detail::fvec4SIMD const & x);
//! Returns a vector in the same direction as x but with length of 1.
//! Less accurate but much faster than simdNormalize.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD fastNormalize(
detail::fvec4SIMD const & x);
//! If dot(Nref, I) < 0.0, return N, otherwise, return -N.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD simdFaceforward(
detail::fvec4SIMD const & N,
detail::fvec4SIMD const & I,
@ -460,7 +492,8 @@ namespace detail
//! For the incident vector I and surface orientation N,
//! returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD reflect(
detail::fvec4SIMD const & I,
detail::fvec4SIMD const & N);
@ -468,37 +501,43 @@ namespace detail
//! For the incident vector I and surface normal N,
//! and the ratio of indices of refraction eta,
//! return the refraction vector.
//! (From GLM_GTX_simd_vec4 extension, geometry functions)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD refract(
detail::fvec4SIMD const & I,
detail::fvec4SIMD const & N,
float const & eta);
//! Returns the positive square root of x.
//! (From GLM_GTX_simd_vec4 extension, exponential function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD sqrt(
detail::fvec4SIMD const & x);
//! Returns the positive square root of x with the nicest quality but very slow.
//! Slightly more accurate but much slower than simdSqrt.
//! (From GLM_GTX_simd_vec4 extension, exponential function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD niceSqrt(
detail::fvec4SIMD const & x);
//! Returns the positive square root of x
//! Less accurate but much faster than sqrt.
//! (From GLM_GTX_simd_vec4 extension, exponential function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD fastSqrt(
detail::fvec4SIMD const & x);
//! Returns the reciprocal of the positive square root of x.
//! (From GLM_GTX_simd_vec4 extension, exponential function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD inversesqrt(
detail::fvec4SIMD const & x);
//! Returns the reciprocal of the positive square root of x.
//! Faster than inversesqrt but less accurate.
//! (From GLM_GTX_simd_vec4 extension, exponential function)
///
/// @see gtx_simd_vec4
detail::fvec4SIMD fastInversesqrt(
detail::fvec4SIMD const & x);
@ -507,12 +546,10 @@ namespace detail
#include "simd_vec4.inl"
#if (GLM_COMPILER & GLM_COMPILER_VC)
# pragma warning(pop)
# pragma warning(pop)
#endif
#endif//(GLM_ARCH != GLM_ARCH_PURE)
#endif//GLM_GTX_simd_vec4

View File

@ -52,7 +52,7 @@ namespace glm
/// @{
//! Return a point from a catmull rom curve.
//! From GLM_GTX_spline extension.
/// @see gtx_spline extension.
template <typename genType>
genType catmullRom(
genType const & v1,
@ -62,8 +62,8 @@ namespace glm
typename genType::value_type const & s);
//! Return a point from a hermite curve.
//! From GLM_GTX_spline extension.
template <typename genType>
/// @see gtx_spline extension.
template <typename genType>
genType hermite(
genType const & v1,
genType const & t1,
@ -71,8 +71,8 @@ namespace glm
genType const & t2,
typename genType::value_type const & s);
//! Return a point from a cubic curve.
//! From GLM_GTX_spline extension.
//! Return a point from a cubic curve.
/// @see gtx_spline extension.
template <typename genType>
genType cubic(
genType const & v1,

View File

@ -58,7 +58,7 @@ namespace glm
/// @{
/// Create a string from a GLM type value.
/// From GLM_GTX_string_cast extension.
/// @see gtx_string_cast extension.
template <typename genType>
std::string to_string(genType const & x);

View File

@ -54,21 +54,6 @@ namespace glm
/// @addtogroup gtx_transform
/// @{
/// Builds a translation 4 * 4 matrix created from 3 scalars.
/// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::translate GLM_GTC_matrix_transform \endlink
template <typename T>
detail::tmat4x4<T, defaultp> translate(
T x, T y, T z);
/// Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars.
/// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::translate GLM_GTC_matrix_transform \endlink
template <typename T>
detail::tmat4x4<T, defaultp> translate(
detail::tmat4x4<T, defaultp> const & m,
T x, T y, T z);
/// Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars.
/// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::translate GLM_GTC_matrix_transform \endlink
@ -76,14 +61,6 @@ namespace glm
detail::tmat4x4<T, P> translate(
detail::tvec3<T, P> const & v);
/// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.
/// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::rotate GLM_GTC_matrix_transform \endlink
template <typename T>
detail::tmat4x4<T, defaultp> rotate(
T angle,
T x, T y, T z);
/// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.
/// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::rotate GLM_GTC_matrix_transform \endlink
@ -92,30 +69,6 @@ namespace glm
T angle,
detail::tvec3<T, P> const & v);
/// Transforms a matrix with a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.
/// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::rotate GLM_GTC_matrix_transform \endlink
template <typename T, precision P>
detail::tmat4x4<T, P> rotate(
detail::tmat4x4<T, P> const & m,
T angle,
T x, T y, T z);
/// Builds a scale 4 * 4 matrix created from 3 scalars.
/// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::scale GLM_GTC_matrix_transform \endlink
template <typename T>
detail::tmat4x4<T, defaultp> scale(
T x, T y, T z);
/// Transforms a matrix with a scale 4 * 4 matrix created from 3 scalars.
/// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::scale GLM_GTC_matrix_transform \endlink
template <typename T, precision P>
detail::tmat4x4<T, P> scale(
detail::tmat4x4<T, P> const & m,
T x, T y, T z);
/// Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components.
/// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::scale GLM_GTC_matrix_transform \endlink

View File

@ -9,24 +9,6 @@
namespace glm
{
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, defaultp> translate(
T x, T y, T z)
{
return translate(
detail::tmat4x4<T, defaultp>(1.0f),
detail::tvec3<T, defaultp>(x, y , z));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> translate(
detail::tmat4x4<T, P> const & m,
T x, T y, T z)
{
return translate(
m, detail::tvec3<T, P>(x, y , z));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> translate(
detail::tvec3<T, P> const & v)
@ -35,15 +17,6 @@ namespace glm
detail::tmat4x4<T, P>(1.0f), v);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, defaultp> rotate(
T angle,
T x, T y, T z)
{
return rotate(
detail::tmat4x4<T, defaultp>(1), angle, detail::tvec3<T, defaultp>(x, y, z));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> rotate(
T angle,
@ -53,32 +26,6 @@ namespace glm
detail::tmat4x4<T, P>(1), angle, v);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> rotate(
detail::tmat4x4<T, P> const & m,
T angle,
T x, T y, T z)
{
return rotate(
m, angle, detail::tvec3<T, P>(x, y, z));
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, defaultp> scale(T x, T y, T z)
{
return scale(
detail::tmat4x4<T, defaultp>(1), detail::tvec3<T, defaultp>(x, y, z));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> scale(
detail::tmat4x4<T, P> const & m,
T x, T y, T z)
{
return scale(
m, detail::tvec3<T, P>(x, y, z));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> scale(
detail::tvec3<T, P> const & v)

View File

@ -49,62 +49,62 @@ namespace glm
{
//! 1 component vector of high precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef highp_vec1_t highp_vec1;
//! 1 component vector of medium precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef mediump_vec1_t mediump_vec1;
//! 1 component vector of low precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef lowp_vec1_t lowp_vec1;
//! 1 component vector of high precision signed integer numbers.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef highp_ivec1_t highp_ivec1;
//! 1 component vector of medium precision signed integer numbers.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef mediump_ivec1_t mediump_ivec1;
//! 1 component vector of low precision signed integer numbers.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef lowp_ivec1_t lowp_ivec1;
//! 1 component vector of high precision unsigned integer numbers.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef highp_uvec1_t highp_uvec1;
//! 1 component vector of medium precision unsigned integer numbers.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef mediump_uvec1_t mediump_uvec1;
//! 1 component vector of low precision unsigned integer numbers.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef lowp_uvec1_t lowp_uvec1;
//! 1 component vector of high precision boolean.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef highp_bvec1_t highp_bvec1;
//! 1 component vector of medium precision boolean.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef mediump_bvec1_t mediump_bvec1;
//! 1 component vector of low precision boolean.
//! There is no guarantee on the actual precision.
//! From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef lowp_bvec1_t lowp_bvec1;
//////////////////////////
@ -118,7 +118,7 @@ namespace glm
typedef lowp_bvec1 bvec1;
#else
/// 1 component vector of boolean.
/// From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef highp_bvec1 bvec1;
#endif//GLM_PRECISION
@ -130,7 +130,7 @@ namespace glm
typedef lowp_vec1 vec1;
#else
/// 1 component vector of floating-point numbers.
/// From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef highp_vec1 vec1;
#endif//GLM_PRECISION
@ -142,7 +142,7 @@ namespace glm
typedef lowp_ivec1 ivec1;
#else
/// 1 component vector of signed integer numbers.
/// From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef highp_ivec1 ivec1;
#endif//GLM_PRECISION
@ -154,7 +154,7 @@ namespace glm
typedef lowp_uvec1 uvec1;
#else
/// 1 component vector of unsigned integer numbers.
/// From GLM_GTX_vec1 extension.
/// @see gtx_vec1 extension.
typedef highp_uvec1 uvec1;
#endif//GLM_PRECISION

View File

@ -51,16 +51,16 @@ namespace glm
/// @{
//! Set values to a 2 components vector.
//! From GLM_GTX_vector_access extension.
template <typename valType>
/// @see gtx_vector_access extension.
template <typename valType>
void set(
detail::tvec2<valType> & v,
valType const & x,
valType const & y);
//! Set values to a 3 components vector.
//! From GLM_GTX_vector_access extension.
template <typename valType>
/// @see gtx_vector_access extension.
template <typename valType>
void set(
detail::tvec3<valType> & v,
valType const & x,
@ -68,8 +68,8 @@ namespace glm
valType const & z);
//! Set values to a 4 components vector.
//! From GLM_GTX_vector_access extension.
template <typename valType>
/// @see gtx_vector_access extension.
template <typename valType>
void set(
detail::tvec4<valType> & v,
valType const & x,

View File

@ -57,7 +57,7 @@ namespace glm
//! Returns the absolute angle between two vectors
//! Parameters need to be normalized.
//! From GLM_GTX_vector_angle extension
/// @see gtx_vector_angle extension
template <typename vecType>
GLM_FUNC_QUALIFIER typename vecType::value_type angle(
vecType const & x,
@ -65,7 +65,7 @@ namespace glm
//! Returns the oriented angle between two 2d vectors
//! Parameters need to be normalized.
//! From GLM_GTX_vector_angle extension.
/// @see gtx_vector_angle extension.
template <typename T, precision P>
GLM_FUNC_QUALIFIER T orientedAngle(
detail::tvec2<T, P> const & x,
@ -73,7 +73,7 @@ namespace glm
//! Returns the oriented angle between two 3d vectors based from a reference axis.
//! Parameters need to be normalized.
//! From GLM_GTX_vector_angle extension.
/// @see gtx_vector_angle extension.
template <typename T, precision P>
GLM_FUNC_QUALIFIER T orientedAngle(
detail::tvec3<T, P> const & x,

View File

@ -53,7 +53,7 @@ namespace glm
/// @{
//! Check whether two vectors are collinears.
//! From GLM_GTX_vector_query extensions.
/// @see gtx_vector_query extensions.
template <typename genType>
bool areCollinear(
genType const & v0,
@ -61,7 +61,7 @@ namespace glm
typename genType::value_type const & epsilon);
//! Check whether two vectors are orthogonals.
//! From GLM_GTX_vector_query extensions.
/// @see gtx_vector_query extensions.
template <typename genType>
bool areOrthogonal(
genType const & v0,
@ -69,35 +69,35 @@ namespace glm
typename genType::value_type const & epsilon);
//! Check whether a vector is normalized.
//! From GLM_GTX_vector_query extensions.
/// @see gtx_vector_query extensions.
template <typename genType, precision P, template <typename, precision> class vecType>
bool isNormalized(
vecType<genType, P> const & v,
genType const & epsilon);
//! Check whether a vector is null.
//! From GLM_GTX_vector_query extensions.
/// @see gtx_vector_query extensions.
template <typename T, precision P>
bool isNull(
detail::tvec2<T, P> const & v,
T const & epsilon);
//! Check whether a vector is null.
//! From GLM_GTX_vector_query extensions.
/// @see gtx_vector_query extensions.
template <typename T, precision P>
bool isNull(
detail::tvec3<T, P> const & v,
T const & epsilon);
//! Check whether a vector is null.
//! From GLM_GTX_vector_query extensions.
/// @see gtx_vector_query extensions.
template <typename T, precision P>
bool isNull(
detail::tvec4<T, P> const & v,
T const & epsilon);
//! Check whether two vectors are orthonormal.
//! From GLM_GTX_vector_query extensions.
/// @see gtx_vector_query extensions.
template <typename genType>
bool areOrthonormal(
genType const & v0,

View File

@ -51,27 +51,27 @@ namespace glm
/// @{
//! Addition of two values
//! From GLM_GTX_verbose_operator extension.
/// @see gtx_verbose_operator extension.
template <typename genTypeT, typename genTypeU>
genTypeT add(genTypeT const & a, genTypeU const & b);
//! Substration of two values
//! From GLM_GTX_verbose_operator extension.
/// @see gtx_verbose_operator extension.
template <typename genTypeT, typename genTypeU>
genTypeT sub(genTypeT const & a, genTypeU const & b);
//! Multiplication of two values
//! From GLM_GTX_verbose_operator extension.
/// @see gtx_verbose_operator extension.
template <typename genTypeT, typename genTypeU>
genTypeT mul(genTypeT const & a, genTypeU const & b);
//! Division of two values
//! From GLM_GTX_verbose_operator extension.
/// @see gtx_verbose_operator extension.
template <typename genTypeT, typename genTypeU>
genTypeT div(genTypeT const & a, genTypeU const & b);
//! Multiplication and addition of three values
//! From GLM_GTX_verbose_operator extension.
/// @see gtx_verbose_operator extension.
template <typename genTypeT, typename genTypeU, typename genTypeV>
genTypeT mad(genTypeT const & a, genTypeU const & b, genTypeV const & c);

View File

@ -50,18 +50,18 @@ namespace glm
/// @addtogroup gtx_wrap
/// @{
//! Simulate GL_CLAMP OpenGL wrap mode
//! From GLM_GTX_wrap extension.
/// Simulate GL_CLAMP OpenGL wrap mode
/// @see gtx_wrap extension.
template <typename genType>
genType clamp(genType const & Texcoord);
//! Simulate GL_REPEAT OpenGL wrap mode
//! From GLM_GTX_wrap extension.
/// Simulate GL_REPEAT OpenGL wrap mode
/// @see gtx_wrap extension.
template <typename genType>
genType repeat(genType const & Texcoord);
//! Simulate GL_MIRROR_REPEAT OpenGL wrap mode
//! From GLM_GTX_wrap extension.
/// Simulate GL_MIRROR_REPEAT OpenGL wrap mode
/// @see gtx_wrap extension.
template <typename genType>
genType mirrorRepeat(genType const & Texcoord);

View File

@ -50,10 +50,7 @@ GLM 0.9.5.0: 2013-XX-XX
- Fixed GTX_multiple for negative value
- Removed GTX_ocl_type extension
- Fixed post increment and decrement operators
================================================================================
GLM 0.9.4.4: 2013-0X-XX
--------------------------------------------------------------------------------
- Fixed perspective with zNear == 0 (#71)
- Fixed slerp when costheta is close to 1
- Fixed mat4x2 value_type constructor

View File

@ -28,7 +28,7 @@ int test_vec2_swizzle()
{
int Error = 0;
glm::ivec2 A(1, 2);
glm::ivec2 A(1, 2);
glm::ivec2 B = A.xy();
glm::ivec2 C(0);
C.xy() = B.xy();
@ -43,7 +43,7 @@ int test_vec3_swizzle()
{
int Error = 0;
glm::ivec3 A(1, 2, 3);
glm::ivec3 A(1, 2, 3);
glm::ivec3 B = A.xyz();
glm::ivec3 C(0);
C.xyz() = B.xyz();
@ -58,7 +58,7 @@ int test_vec4_swizzle()
{
int Error = 0;
glm::ivec4 A(1, 2, 3, 4);
glm::ivec4 A(1, 2, 3, 4);
glm::ivec4 B = A.xyzw();
glm::ivec4 C(0);
C.xyzw() = B.xyzw();
@ -71,12 +71,12 @@ int test_vec4_swizzle()
int main()
{
int Error = 0;
int Error = 0;
Error += test_vec2_swizzle();
Error += test_vec3_swizzle();
Error += test_vec4_swizzle();
Error += test_vec4_swizzle();
return Error;
}

View File

@ -2,7 +2,7 @@
// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2010-09-16
// Updated : 2011-05-07
// Updated : 2013-05-10
// Licence : This source is under MIT licence
// File : test/gtc/matrix_access.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
@ -12,344 +12,344 @@
int test_mat2x2_row_set()
{
int Error = 0;
glm::mat2x2 m(1);
int Error = 0;
glm::mat2x2 m(1);
m = glm::row(m, 0, glm::vec2( 0, 1));
m = glm::row(m, 1, glm::vec2( 4, 5));
Error += glm::row(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
return Error;
return Error;
}
int test_mat2x2_col_set()
{
int Error = 0;
glm::mat2x2 m(1);
int Error = 0;
glm::mat2x2 m(1);
m = glm::column(m, 0, glm::vec2( 0, 1));
m = glm::column(m, 1, glm::vec2( 4, 5));
Error += glm::column(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
return Error;
return Error;
}
int test_mat2x3_row_set()
{
int Error = 0;
glm::mat2x3 m(1);
int Error = 0;
glm::mat2x3 m(1);
m = glm::row(m, 0, glm::vec2( 0, 1));
m = glm::row(m, 1, glm::vec2( 4, 5));
m = glm::row(m, 2, glm::vec2( 8, 9));
Error += glm::row(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec2( 8, 9) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec2( 8, 9) ? 0 : 1;
return Error;
return Error;
}
int test_mat2x3_col_set()
{
int Error = 0;
glm::mat2x3 m(1);
int Error = 0;
glm::mat2x3 m(1);
m = glm::column(m, 0, glm::vec3( 0, 1, 2));
m = glm::column(m, 1, glm::vec3( 4, 5, 6));
Error += glm::column(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
return Error;
return Error;
}
int test_mat2x4_row_set()
{
int Error = 0;
glm::mat2x4 m(1);
int Error = 0;
glm::mat2x4 m(1);
m = glm::row(m, 0, glm::vec2( 0, 1));
m = glm::row(m, 1, glm::vec2( 4, 5));
m = glm::row(m, 2, glm::vec2( 8, 9));
m = glm::row(m, 3, glm::vec2(12, 13));
Error += glm::row(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec2( 8, 9) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec2( 8, 9) ? 0 : 1;
Error += glm::row(m, 3) == glm::vec2(12, 13) ? 0 : 1;
return Error;
return Error;
}
int test_mat2x4_col_set()
{
int Error = 0;
glm::mat2x4 m(1);
int Error = 0;
glm::mat2x4 m(1);
m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3));
m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7));
Error += glm::column(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
return Error;
return Error;
}
int test_mat3x2_row_set()
{
int Error = 0;
glm::mat3x2 m(1);
int Error = 0;
glm::mat3x2 m(1);
m = glm::row(m, 0, glm::vec3( 0, 1, 2));
m = glm::row(m, 1, glm::vec3( 4, 5, 6));
Error += glm::row(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
return Error;
return Error;
}
int test_mat3x2_col_set()
{
int Error = 0;
glm::mat3x2 m(1);
int Error = 0;
glm::mat3x2 m(1);
m = glm::column(m, 0, glm::vec2( 0, 1));
m = glm::column(m, 1, glm::vec2( 4, 5));
m = glm::column(m, 2, glm::vec2( 8, 9));
Error += glm::column(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec2( 8, 9) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec2( 8, 9) ? 0 : 1;
return Error;
return Error;
}
int test_mat3x3_row_set()
{
int Error = 0;
glm::mat3x3 m(1);
int Error = 0;
glm::mat3x3 m(1);
m = glm::row(m, 0, glm::vec3( 0, 1, 2));
m = glm::row(m, 1, glm::vec3( 4, 5, 6));
m = glm::row(m, 2, glm::vec3( 8, 9, 10));
Error += glm::row(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec3( 8, 9, 10) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec3( 8, 9, 10) ? 0 : 1;
return Error;
return Error;
}
int test_mat3x3_col_set()
{
int Error = 0;
glm::mat3x3 m(1);
int Error = 0;
glm::mat3x3 m(1);
m = glm::column(m, 0, glm::vec3( 0, 1, 2));
m = glm::column(m, 1, glm::vec3( 4, 5, 6));
m = glm::column(m, 2, glm::vec3( 8, 9, 10));
Error += glm::column(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec3( 8, 9, 10) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec3( 8, 9, 10) ? 0 : 1;
return Error;
return Error;
}
int test_mat3x4_row_set()
{
int Error = 0;
glm::mat3x4 m(1);
int Error = 0;
glm::mat3x4 m(1);
m = glm::row(m, 0, glm::vec3( 0, 1, 2));
m = glm::row(m, 1, glm::vec3( 4, 5, 6));
m = glm::row(m, 2, glm::vec3( 8, 9, 10));
m = glm::row(m, 3, glm::vec3(12, 13, 14));
Error += glm::row(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec3( 8, 9, 10) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec3( 8, 9, 10) ? 0 : 1;
Error += glm::row(m, 3) == glm::vec3(12, 13, 14) ? 0 : 1;
return Error;
return Error;
}
int test_mat3x4_col_set()
{
int Error = 0;
glm::mat3x4 m(1);
int Error = 0;
glm::mat3x4 m(1);
m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3));
m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7));
m = glm::column(m, 2, glm::vec4( 8, 9, 10, 11));
Error += glm::column(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
return Error;
return Error;
}
int test_mat4x2_row_set()
{
int Error = 0;
glm::mat4x2 m(1);
int Error = 0;
glm::mat4x2 m(1);
m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3));
m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7));
Error += glm::row(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
return Error;
return Error;
}
int test_mat4x2_col_set()
{
int Error = 0;
glm::mat4x2 m(1);
int Error = 0;
glm::mat4x2 m(1);
m = glm::column(m, 0, glm::vec2( 0, 1));
m = glm::column(m, 1, glm::vec2( 4, 5));
m = glm::column(m, 2, glm::vec2( 8, 9));
m = glm::column(m, 3, glm::vec2(12, 13));
Error += glm::column(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec2( 8, 9) ? 0 : 1;
Error += glm::column(m, 3) == glm::vec2(12, 13) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec2( 0, 1) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec2( 4, 5) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec2( 8, 9) ? 0 : 1;
Error += glm::column(m, 3) == glm::vec2(12, 13) ? 0 : 1;
return Error;
return Error;
}
int test_mat4x3_row_set()
{
int Error = 0;
glm::mat4x3 m(1);
int Error = 0;
glm::mat4x3 m(1);
m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3));
m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7));
m = glm::row(m, 2, glm::vec4( 8, 9, 10, 11));
Error += glm::row(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
return Error;
return Error;
}
int test_mat4x3_col_set()
{
int Error = 0;
glm::mat4x3 m(1);
int Error = 0;
glm::mat4x3 m(1);
m = glm::column(m, 0, glm::vec3( 0, 1, 2));
m = glm::column(m, 1, glm::vec3( 4, 5, 6));
m = glm::column(m, 2, glm::vec3( 8, 9, 10));
m = glm::column(m, 3, glm::vec3(12, 13, 14));
Error += glm::column(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec3( 8, 9, 10) ? 0 : 1;
Error += glm::column(m, 3) == glm::vec3(12, 13, 14) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec3( 0, 1, 2) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec3( 4, 5, 6) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec3( 8, 9, 10) ? 0 : 1;
Error += glm::column(m, 3) == glm::vec3(12, 13, 14) ? 0 : 1;
return Error;
return Error;
}
int test_mat4x4_row_set()
{
int Error = 0;
glm::mat4 m(1);
int Error = 0;
glm::mat4 m(1);
m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3));
m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7));
m = glm::row(m, 2, glm::vec4( 8, 9, 10, 11));
m = glm::row(m, 3, glm::vec4(12, 13, 14, 15));
Error += glm::row(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
Error += glm::row(m, 3) == glm::vec4(12, 13, 14, 15) ? 0 : 1;
Error += glm::row(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::row(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::row(m, 2) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
Error += glm::row(m, 3) == glm::vec4(12, 13, 14, 15) ? 0 : 1;
return Error;
return Error;
}
int test_mat4x4_col_set()
{
int Error = 0;
glm::mat4 m(1);
int Error = 0;
glm::mat4 m(1);
m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3));
m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7));
m = glm::column(m, 2, glm::vec4( 8, 9, 10, 11));
m = glm::column(m, 3, glm::vec4(12, 13, 14, 15));
Error += glm::column(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
Error += glm::column(m, 3) == glm::vec4(12, 13, 14, 15) ? 0 : 1;
Error += glm::column(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
Error += glm::column(m, 1) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
Error += glm::column(m, 2) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
Error += glm::column(m, 3) == glm::vec4(12, 13, 14, 15) ? 0 : 1;
return Error;
return Error;
}
int test_mat4x4_row_get()
{
int Error = 0;
glm::mat4 m(1);
glm::vec4 A = glm::row(m, 0);
Error += A == glm::vec4(1, 0, 0, 0) ? 0 : 1;
glm::vec4 B = glm::row(m, 1);
Error += B == glm::vec4(0, 1, 0, 0) ? 0 : 1;
glm::vec4 C = glm::row(m, 2);
Error += C == glm::vec4(0, 0, 1, 0) ? 0 : 1;
glm::vec4 D = glm::row(m, 3);
Error += D == glm::vec4(0, 0, 0, 1) ? 0 : 1;
int Error = 0;
return Error;
glm::mat4 m(1);
glm::vec4 A = glm::row(m, 0);
Error += A == glm::vec4(1, 0, 0, 0) ? 0 : 1;
glm::vec4 B = glm::row(m, 1);
Error += B == glm::vec4(0, 1, 0, 0) ? 0 : 1;
glm::vec4 C = glm::row(m, 2);
Error += C == glm::vec4(0, 0, 1, 0) ? 0 : 1;
glm::vec4 D = glm::row(m, 3);
Error += D == glm::vec4(0, 0, 0, 1) ? 0 : 1;
return Error;
}
int test_mat4x4_col_get()
{
int Error = 0;
glm::mat4 m(1);
glm::vec4 A = glm::column(m, 0);
Error += A == glm::vec4(1, 0, 0, 0) ? 0 : 1;
glm::vec4 B = glm::column(m, 1);
Error += B == glm::vec4(0, 1, 0, 0) ? 0 : 1;
glm::vec4 C = glm::column(m, 2);
Error += C == glm::vec4(0, 0, 1, 0) ? 0 : 1;
glm::vec4 D = glm::column(m, 3);
Error += D == glm::vec4(0, 0, 0, 1) ? 0 : 1;
return Error;
int Error = 0;
glm::mat4 m(1);
glm::vec4 A = glm::column(m, 0);
Error += A == glm::vec4(1, 0, 0, 0) ? 0 : 1;
glm::vec4 B = glm::column(m, 1);
Error += B == glm::vec4(0, 1, 0, 0) ? 0 : 1;
glm::vec4 C = glm::column(m, 2);
Error += C == glm::vec4(0, 0, 1, 0) ? 0 : 1;
glm::vec4 D = glm::column(m, 3);
Error += D == glm::vec4(0, 0, 0, 1) ? 0 : 1;
return Error;
}
int main()
@ -357,26 +357,26 @@ int main()
int Error = 0;
Error += test_mat2x2_row_set();
Error += test_mat2x2_col_set();
Error += test_mat2x2_col_set();
Error += test_mat2x3_row_set();
Error += test_mat2x3_col_set();
Error += test_mat2x3_col_set();
Error += test_mat2x4_row_set();
Error += test_mat2x4_col_set();
Error += test_mat2x4_col_set();
Error += test_mat3x2_row_set();
Error += test_mat3x2_col_set();
Error += test_mat3x2_col_set();
Error += test_mat3x3_row_set();
Error += test_mat3x3_col_set();
Error += test_mat3x3_col_set();
Error += test_mat3x4_row_set();
Error += test_mat3x4_col_set();
Error += test_mat3x4_col_set();
Error += test_mat4x2_row_set();
Error += test_mat4x2_col_set();
Error += test_mat4x2_col_set();
Error += test_mat4x3_row_set();
Error += test_mat4x3_col_set();
Error += test_mat4x3_col_set();
Error += test_mat4x4_row_set();
Error += test_mat4x4_col_set();
Error += test_mat4x4_col_set();
Error += test_mat4x4_row_get();
Error += test_mat4x4_col_get();
Error += test_mat4x4_row_get();
Error += test_mat4x4_col_get();
return Error;
}

View File

@ -14,6 +14,7 @@ int main()
{
int Error = 0;
glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.0f);
glm::mat4 Pick = glm::pickMatrix(glm::vec2(1, 2), glm::vec2(3, 4), glm::ivec4(0, 0, 320, 240));
return Error;