diff --git a/glm/core/dummy.cpp b/glm/core/dummy.cpp index 883f2d1a..add3fbb2 100644 --- a/glm/core/dummy.cpp +++ b/glm/core/dummy.cpp @@ -331,6 +331,5 @@ int main() } } - //glm::vec3 v{0, 1, 2}; return 0; } diff --git a/glm/core/precision.hpp b/glm/core/precision.hpp index 9880370d..8d503352 100644 --- a/glm/core/precision.hpp +++ b/glm/core/precision.hpp @@ -33,9 +33,9 @@ namespace glm { enum precision { - lowp, + highp, mediump, - highp + lowp }; }//namespace glm diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index 91188b0d..4767fa1b 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -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 +# include #endif //#if(GLM_ARCH != GLM_ARCH_PURE) diff --git a/glm/core/type_mat2x2.hpp b/glm/core/type_mat2x2.hpp index 3d000bc9..b3f5c34b 100644 --- a/glm/core/type_mat2x2.hpp +++ b/glm/core/type_mat2x2.hpp @@ -135,8 +135,14 @@ namespace detail GLM_FUNC_DECL tmat2x2 & operator/=(U const & s); template GLM_FUNC_DECL tmat2x2 & operator/=(tmat2x2 const & m); - GLM_FUNC_DECL tmat2x2 & operator++(); - GLM_FUNC_DECL tmat2x2 & operator--(); + + ////////////////////////////////////// + // Increment and decrement operators + + GLM_FUNC_DECL tmat2x2 & operator++ (); + GLM_FUNC_DECL tmat2x2 & operator-- (); + GLM_FUNC_DECL tmat2x2 operator++(int); + GLM_FUNC_DECL tmat2x2 operator--(int); }; // Binary operators @@ -232,18 +238,9 @@ namespace detail // Unary constant operators template - tmat2x2 const operator- ( + tmat2x2 const operator-( tmat2x2 const & m); - template - tmat2x2 const operator-- ( - tmat2x2 const & m, - int); - - template - tmat2x2 const operator++ ( - tmat2x2 const & m, - int); } //namespace detail } //namespace glm diff --git a/glm/core/type_mat2x2.inl b/glm/core/type_mat2x2.inl index f5a42b72..12e40677 100644 --- a/glm/core/type_mat2x2.inl +++ b/glm/core/type_mat2x2.inl @@ -397,7 +397,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator++ () + GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator++() { ++this->value[0]; ++this->value[1]; @@ -405,13 +405,29 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator-- () + GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator--() { --this->value[0]; --this->value[1]; return *this; } + template + GLM_FUNC_QUALIFIER tmat2x2 tmat2x2::operator++(int) + { + tmat2x2 Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER tmat2x2 tmat2x2::operator--(int) + { + tmat2x2 Result(*this); + --*this; + return Result; + } + ////////////////////////////////////////////////////////////// // Binary operators @@ -649,30 +665,6 @@ namespace detail -m[1]); } - template - GLM_FUNC_QUALIFIER tmat2x2 const operator++ - ( - tmat2x2 const & m, - int - ) - { - return tmat2x2( - m[0] + T(1), - m[1] + T(1)); - } - - template - GLM_FUNC_QUALIFIER tmat2x2 const operator-- - ( - tmat2x2 const & m, - int - ) - { - return tmat2x2( - m[0] - T(1), - m[1] - T(1)); - } - ////////////////////////////////////// // Boolean operators diff --git a/glm/core/type_mat2x3.hpp b/glm/core/type_mat2x3.hpp index 59072282..377910e4 100644 --- a/glm/core/type_mat2x3.hpp +++ b/glm/core/type_mat2x3.hpp @@ -124,8 +124,13 @@ namespace detail template GLM_FUNC_DECL tmat2x3 & operator/= (U const & s); + ////////////////////////////////////// + // Increment and decrement operators + GLM_FUNC_DECL tmat2x3 & operator++ (); GLM_FUNC_DECL tmat2x3 & operator-- (); + GLM_FUNC_DECL tmat2x3 operator++(int); + GLM_FUNC_DECL tmat2x3 operator--(int); }; // Binary operators @@ -196,18 +201,9 @@ namespace detail // Unary constant operators template - tmat2x3 const operator- ( + tmat2x3 const operator- ( tmat2x3 const & m); - template - tmat2x3 const operator-- ( - tmat2x3 const & m, - int); - - template - tmat2x3 const operator++ ( - tmat2x3 const & m, - int); }//namespace detail }//namespace glm diff --git a/glm/core/type_mat2x3.inl b/glm/core/type_mat2x3.inl index 43c38231..4f6d1934 100644 --- a/glm/core/type_mat2x3.inl +++ b/glm/core/type_mat2x3.inl @@ -374,7 +374,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator++ () + GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator++() { ++this->value[0]; ++this->value[1]; @@ -382,13 +382,29 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator-- () + GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator--() { --this->value[0]; --this->value[1]; return *this; } + template + GLM_FUNC_QUALIFIER tmat2x3 tmat2x3::operator++(int) + { + tmat2x3 Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER tmat2x3 tmat2x3::operator--(int) + { + tmat2x3 Result(*this); + --*this; + return Result; + } + ////////////////////////////////////////////////////////////// // Binary operators @@ -595,30 +611,6 @@ namespace detail -m[1]); } - template - GLM_FUNC_QUALIFIER tmat2x3 const operator++ - ( - tmat2x3 const & m, - int - ) - { - return tmat2x3( - m[0] + typename tmat2x3::value_type(1), - m[1] + typename tmat2x3::value_type(1)); - } - - template - GLM_FUNC_QUALIFIER tmat2x3 const operator-- - ( - tmat2x3 const & m, - int - ) - { - return tmat2x3( - m[0] - typename tmat2x3::value_type(1), - m[1] - typename tmat2x3::value_type(1)); - } - ////////////////////////////////////// // Boolean operators diff --git a/glm/core/type_mat2x4.hpp b/glm/core/type_mat2x4.hpp index cd3e4924..d560ca93 100644 --- a/glm/core/type_mat2x4.hpp +++ b/glm/core/type_mat2x4.hpp @@ -126,8 +126,13 @@ namespace detail template GLM_FUNC_DECL tmat2x4& operator/= (U const & s); - GLM_FUNC_DECL tmat2x4& operator++ (); - GLM_FUNC_DECL tmat2x4& operator-- (); + ////////////////////////////////////// + // Increment and decrement operators + + GLM_FUNC_DECL tmat2x4 & operator++ (); + GLM_FUNC_DECL tmat2x4 & operator-- (); + GLM_FUNC_DECL tmat2x4 operator++(int); + GLM_FUNC_DECL tmat2x4 operator--(int); }; // Binary operators @@ -201,16 +206,6 @@ namespace detail tmat2x4 const operator- ( tmat2x4 const & m); - template - tmat2x4 const operator-- ( - tmat2x4 const & m, - int); - - template - tmat2x4 const operator++ ( - tmat2x4 const & m, - int); - }//namespace detail }//namespace glm diff --git a/glm/core/type_mat2x4.inl b/glm/core/type_mat2x4.inl index d201abcd..75069041 100644 --- a/glm/core/type_mat2x4.inl +++ b/glm/core/type_mat2x4.inl @@ -377,7 +377,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat2x4& tmat2x4::operator++ () + GLM_FUNC_QUALIFIER tmat2x4& tmat2x4::operator++() { ++this->value[0]; ++this->value[1]; @@ -385,13 +385,29 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat2x4& tmat2x4::operator-- () + GLM_FUNC_QUALIFIER tmat2x4& tmat2x4::operator--() { --this->value[0]; --this->value[1]; return *this; } + template + GLM_FUNC_QUALIFIER tmat2x4 tmat2x4::operator++(int) + { + tmat2x4 Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER tmat2x4 tmat2x4::operator--(int) + { + tmat2x4 Result(*this); + --*this; + return Result; + } + ////////////////////////////////////////////////////////////// // Binary operators @@ -614,30 +630,6 @@ namespace detail -m[1]); } - template - GLM_FUNC_QUALIFIER tmat2x4 const operator++ - ( - tmat2x4 const & m, - int - ) - { - return tmat2x4( - m[0] + typename tmat2x4::value_type(1), - m[1] + typename tmat2x4::value_type(1)); - } - - template - GLM_FUNC_QUALIFIER tmat2x4 const operator-- - ( - tmat2x4 const & m, - int - ) - { - return tmat2x4( - m[0] - typename tmat2x4::value_type(1), - m[1] - typename tmat2x4::value_type(1)); - } - ////////////////////////////////////// // Boolean operators diff --git a/glm/core/type_mat3x2.hpp b/glm/core/type_mat3x2.hpp index 0f2056cb..b28ef7aa 100644 --- a/glm/core/type_mat3x2.hpp +++ b/glm/core/type_mat3x2.hpp @@ -132,8 +132,13 @@ namespace detail template GLM_FUNC_DECL tmat3x2 & operator/= (U const & s); + ////////////////////////////////////// + // Increment and decrement operators + GLM_FUNC_DECL tmat3x2 & operator++ (); GLM_FUNC_DECL tmat3x2 & operator-- (); + GLM_FUNC_DECL tmat3x2 operator++(int); + GLM_FUNC_DECL tmat3x2 operator--(int); }; // Binary operators @@ -204,18 +209,9 @@ namespace detail // Unary constant operators template - tmat3x2 const operator- ( + tmat3x2 const operator-( tmat3x2 const & m); - template - tmat3x2 const operator-- ( - tmat3x2 const & m, - int); - - template - tmat3x2 const operator++ ( - tmat3x2 const & m, - int); }//namespace detail }//namespace glm diff --git a/glm/core/type_mat3x2.inl b/glm/core/type_mat3x2.inl index a65e5117..ad174850 100644 --- a/glm/core/type_mat3x2.inl +++ b/glm/core/type_mat3x2.inl @@ -421,6 +421,22 @@ namespace detail return *this; } + template + GLM_FUNC_QUALIFIER tmat3x2 tmat3x2::operator++(int) + { + tmat3x2 Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER tmat3x2 tmat3x2::operator--(int) + { + tmat3x2 Result(*this); + --*this; + return Result; + } + ////////////////////////////////////////////////////////////// // Binary operators @@ -627,34 +643,6 @@ namespace detail -m[2]); } - template - GLM_FUNC_QUALIFIER tmat3x2 const operator++ - ( - tmat3x2 const & m, - int - ) - { - typename tmat3x2::value_type One(1); - return tmat3x2( - m[0] + One, - m[1] + One, - m[2] + One); - } - - template - GLM_FUNC_QUALIFIER tmat3x2 const operator-- - ( - tmat3x2 const & m, - int - ) - { - typename tmat3x2::value_type One(1); - return tmat3x2( - m[0] - One, - m[1] - One, - m[2] - One); - } - ////////////////////////////////////// // Boolean operators diff --git a/glm/core/type_mat3x3.hpp b/glm/core/type_mat3x3.hpp index 47708b67..af0e06f3 100644 --- a/glm/core/type_mat3x3.hpp +++ b/glm/core/type_mat3x3.hpp @@ -139,8 +139,14 @@ namespace detail GLM_FUNC_DECL tmat3x3& operator/= (U const & s); template GLM_FUNC_DECL tmat3x3& operator/= (tmat3x3 const & m); - GLM_FUNC_DECL tmat3x3& operator++ (); - GLM_FUNC_DECL tmat3x3& operator-- (); + + ////////////////////////////////////// + // Increment and decrement operators + + GLM_FUNC_DECL tmat3x3 & operator++ (); + GLM_FUNC_DECL tmat3x3 & operator-- (); + GLM_FUNC_DECL tmat3x3 operator++(int); + GLM_FUNC_DECL tmat3x3 operator--(int); }; // Binary operators @@ -236,18 +242,9 @@ namespace detail // Unary constant operators template - tmat3x3 const operator- ( + tmat3x3 const operator-( tmat3x3 const & m); - template - tmat3x3 const operator-- ( - tmat3x3 const & m, - int); - - template - tmat3x3 const operator++ ( - tmat3x3 const & m, - int); }//namespace detail }//namespace glm diff --git a/glm/core/type_mat3x3.inl b/glm/core/type_mat3x3.inl index 7e346448..d36518f3 100644 --- a/glm/core/type_mat3x3.inl +++ b/glm/core/type_mat3x3.inl @@ -426,7 +426,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat3x3 & tmat3x3::operator-- () + GLM_FUNC_QUALIFIER tmat3x3 & tmat3x3::operator--() { --this->value[0]; --this->value[1]; @@ -434,6 +434,22 @@ namespace detail return *this; } + template + GLM_FUNC_QUALIFIER tmat3x3 tmat3x3::operator++(int) + { + tmat3x3 Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER tmat3x3 tmat3x3::operator--(int) + { + tmat3x3 Result(*this); + --*this; + return Result; + } + template GLM_FUNC_QUALIFIER tmat3x3 tmat3x3::_inverse() const { @@ -759,32 +775,6 @@ namespace detail -m[2]); } - template - GLM_FUNC_QUALIFIER tmat3x3 const operator++ - ( - tmat3x3 const & m, - int - ) - { - return tmat3x3( - m[0] + T(1), - m[1] + T(1), - m[2] + T(1)); - } - - template - GLM_FUNC_QUALIFIER tmat3x3 const operator-- - ( - tmat3x3 const & m, - int - ) - { - return tmat3x3( - m[0] - T(1), - m[1] - T(1), - m[2] - T(1)); - } - ////////////////////////////////////// // Boolean operators diff --git a/glm/core/type_mat3x4.hpp b/glm/core/type_mat3x4.hpp index 9ed720fb..9d18f488 100644 --- a/glm/core/type_mat3x4.hpp +++ b/glm/core/type_mat3x4.hpp @@ -132,8 +132,13 @@ namespace detail template GLM_FUNC_DECL tmat3x4 & operator/= (U const & s); + ////////////////////////////////////// + // Increment and decrement operators + GLM_FUNC_DECL tmat3x4 & operator++ (); GLM_FUNC_DECL tmat3x4 & operator-- (); + GLM_FUNC_DECL tmat3x4 operator++(int); + GLM_FUNC_DECL tmat3x4 operator--(int); }; // Binary operators @@ -204,19 +209,9 @@ namespace detail // Unary constant operators template - tmat3x4 const operator- ( + tmat3x4 const operator-( tmat3x4 const & m); - template - tmat3x4 const operator-- ( - tmat3x4 const & m, - int); - - template - tmat3x4 const operator++ ( - tmat3x4 const & m, - int); - }//namespace detail }//namespace glm diff --git a/glm/core/type_mat3x4.inl b/glm/core/type_mat3x4.inl index 6bfbca2d..2a3839cf 100644 --- a/glm/core/type_mat3x4.inl +++ b/glm/core/type_mat3x4.inl @@ -420,6 +420,22 @@ namespace detail return *this; } + template + GLM_FUNC_QUALIFIER tmat3x4 tmat3x4::operator++(int) + { + tmat3x4 Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER tmat3x4 tmat3x4::operator--(int) + { + tmat3x4 Result(*this); + --*this; + return Result; + } + ////////////////////////////////////////////////////////////// // Binary operators @@ -660,32 +676,6 @@ namespace detail -m[2]); } - template - GLM_FUNC_QUALIFIER tmat3x4 const operator++ - ( - tmat3x4 const & m, - int - ) - { - return tmat3x4( - m[0] + T(1), - m[1] + T(1), - m[2] + T(1)); - } - - template - GLM_FUNC_QUALIFIER tmat3x4 const operator-- - ( - tmat3x4 const & m, - int - ) - { - return tmat3x4( - m[0] - T(1), - m[1] - T(1), - m[2] - T(1)); - } - ////////////////////////////////////// // Boolean operators diff --git a/glm/core/type_mat4x2.hpp b/glm/core/type_mat4x2.hpp index 9594d41f..a50c4d4c 100644 --- a/glm/core/type_mat4x2.hpp +++ b/glm/core/type_mat4x2.hpp @@ -137,8 +137,13 @@ namespace detail template GLM_FUNC_DECL tmat4x2& operator/= (U const & s); - GLM_FUNC_DECL tmat4x2& operator++ (); - GLM_FUNC_DECL tmat4x2& operator-- (); + ////////////////////////////////////// + // Increment and decrement operators + + GLM_FUNC_DECL tmat4x2 & operator++ (); + GLM_FUNC_DECL tmat4x2 & operator-- (); + GLM_FUNC_DECL tmat4x2 operator++(int); + GLM_FUNC_DECL tmat4x2 operator--(int); }; // Binary operators @@ -209,18 +214,9 @@ namespace detail // Unary constant operators template - tmat4x2 const operator- ( + tmat4x2 const operator-( tmat4x2 const & m); - template - tmat4x2 const operator-- ( - tmat4x2 const & m, - int); - - template - tmat4x2 const operator++ ( - tmat4x2 const & m, - int); }//namespace detail }//namespace glm diff --git a/glm/core/type_mat4x2.inl b/glm/core/type_mat4x2.inl index 009403d8..0d93542a 100644 --- a/glm/core/type_mat4x2.inl +++ b/glm/core/type_mat4x2.inl @@ -454,6 +454,22 @@ namespace detail return *this; } + template + GLM_FUNC_QUALIFIER tmat4x2 tmat4x2::operator++(int) + { + tmat4x2 Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER tmat4x2 tmat4x2::operator--(int) + { + tmat4x2 Result(*this); + --*this; + return Result; + } + ////////////////////////////////////////////////////////////// // Binary operators @@ -676,34 +692,6 @@ namespace detail -m[3]); } - template - GLM_FUNC_QUALIFIER tmat4x2 const operator++ - ( - tmat4x2 const & m, - int - ) - { - return tmat4x2( - m[0] + typename tmat4x2::value_type(1), - m[1] + typename tmat4x2::value_type(1), - m[2] + typename tmat4x2::value_type(1), - m[3] + typename tmat4x2::value_type(1)); - } - - template - GLM_FUNC_QUALIFIER tmat4x2 const operator-- - ( - tmat4x2 const & m, - int - ) - { - return tmat4x2( - m[0] - typename tmat4x2::value_type(1), - m[1] - typename tmat4x2::value_type(1), - m[2] - typename tmat4x2::value_type(1), - m[3] - typename tmat4x2::value_type(1)); - } - ////////////////////////////////////// // Boolean operators diff --git a/glm/core/type_mat4x3.hpp b/glm/core/type_mat4x3.hpp index d5106d6f..e0e376c0 100644 --- a/glm/core/type_mat4x3.hpp +++ b/glm/core/type_mat4x3.hpp @@ -135,8 +135,13 @@ namespace detail template GLM_FUNC_DECL tmat4x3 & operator/= (U const & s); + ////////////////////////////////////// + // Increment and decrement operators + GLM_FUNC_DECL tmat4x3 & operator++ (); GLM_FUNC_DECL tmat4x3 & operator-- (); + GLM_FUNC_DECL tmat4x3 operator++(int); + GLM_FUNC_DECL tmat4x3 operator--(int); }; // Binary operators @@ -210,15 +215,6 @@ namespace detail tmat4x3 const operator- ( tmat4x3 const & m); - template - tmat4x3 const operator-- ( - tmat4x3 const & m, - int); - - template - tmat4x3 const operator++ ( - tmat4x3 const & m, - int); }//namespace detail }//namespace glm diff --git a/glm/core/type_mat4x3.inl b/glm/core/type_mat4x3.inl index ab1c9ed6..807060c2 100644 --- a/glm/core/type_mat4x3.inl +++ b/glm/core/type_mat4x3.inl @@ -710,6 +710,22 @@ namespace detail m[3] - T(1)); } + template + GLM_FUNC_QUALIFIER tmat4x3 tmat4x3::operator++(int) + { + tmat4x3 Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER tmat4x3 tmat4x3::operator--(int) + { + tmat4x3 Result(*this); + --*this; + return Result; + } + ////////////////////////////////////// // Boolean operators diff --git a/glm/core/type_mat4x4.hpp b/glm/core/type_mat4x4.hpp index baa3c1a1..407c4341 100644 --- a/glm/core/type_mat4x4.hpp +++ b/glm/core/type_mat4x4.hpp @@ -142,8 +142,14 @@ namespace detail GLM_FUNC_DECL tmat4x4 & operator/= (U const & s); template GLM_FUNC_DECL tmat4x4 & operator/= (tmat4x4 const & m); + + ////////////////////////////////////// + // Increment and decrement operators + GLM_FUNC_DECL tmat4x4 & operator++ (); GLM_FUNC_DECL tmat4x4 & operator-- (); + GLM_FUNC_DECL tmat4x4 operator++(int); + GLM_FUNC_DECL tmat4x4 operator--(int); }; // Binary operators @@ -242,14 +248,6 @@ namespace detail tmat4x4 const operator- ( tmat4x4 const & m); - template - tmat4x4 const operator-- ( - tmat4x4 const & m, int); - - template - tmat4x4 const operator++ ( - tmat4x4 const & m, int); - }//namespace detail }//namespace glm diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl index c26f5687..9e613d0f 100644 --- a/glm/core/type_mat4x4.inl +++ b/glm/core/type_mat4x4.inl @@ -496,6 +496,22 @@ namespace detail return *this; } + template + GLM_FUNC_QUALIFIER tmat4x4 tmat4x4::operator++(int) + { + tmat4x4 Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER tmat4x4 tmat4x4::operator--(int) + { + tmat4x4 Result(*this); + --*this; + return Result; + } + template GLM_FUNC_QUALIFIER tmat4x4 tmat4x4::_inverse() const { @@ -692,11 +708,45 @@ namespace detail typename tmat4x4::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::col_type(a2); +*/ + + typename tmat4x4::col_type const Mov0(v[0]); + typename tmat4x4::col_type const Mov1(v[1]); + typename tmat4x4::col_type const Mul0 = m[0] * Mov0; + typename tmat4x4::col_type const Mul1 = m[1] * Mov1; + typename tmat4x4::col_type const Add0 = Mul0 * Mul1; + typename tmat4x4::col_type const Mov2(v[2]); + typename tmat4x4::col_type const Mov3(v[3]); + typename tmat4x4::col_type const Mul2 = m[2] * Mov2; + typename tmat4x4::col_type const Mul3 = m[3] * Mov3; + typename tmat4x4::col_type const Add1 = Mul2 * Mul3; + typename tmat4x4::col_type const Add2 = Add0 * Add1; + return Add2; + +/* return typename tmat4x4::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 @@ -707,10 +757,10 @@ namespace detail ) { return typename tmat4x4::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 diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index 69c35f38..2590d635 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -235,6 +235,102 @@ namespace detail GLM_DETAIL_IS_VECTOR(tvec2); + template + GLM_FUNC_DECL tvec2 operator+(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator+(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator+(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator-(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator-(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator- (tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator*(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator*(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator*(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator/(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator/(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator/(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator-(tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator%(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator%(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator%(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator&(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator&(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator&(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator|(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator|(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator|(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator^(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator^(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator^(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator<<(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator>>(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator>>(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator>>(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator~(tvec2 const & v); + }//namespace detail }//namespace glm diff --git a/glm/core/type_vec2.inl b/glm/core/type_vec2.inl index 290d9cd1..980309dc 100644 --- a/glm/core/type_vec2.inl +++ b/glm/core/type_vec2.inl @@ -957,7 +957,7 @@ namespace detail // tref definition template - tref2::tref2 + GLM_FUNC_QUALIFIER tref2::tref2 ( T & x, T & y @@ -967,7 +967,7 @@ namespace detail {} template - tref2::tref2 + GLM_FUNC_QUALIFIER tref2::tref2 ( tref2 const & r ) : @@ -976,7 +976,7 @@ namespace detail {} template - tref2::tref2 + GLM_FUNC_QUALIFIER tref2::tref2 ( tvec2 const & v ) : @@ -985,7 +985,7 @@ namespace detail {} template - tref2& tref2::operator= + GLM_FUNC_QUALIFIER tref2& tref2::operator= ( tref2 const & r ) @@ -996,7 +996,7 @@ namespace detail } template - tref2& tref2::operator= + GLM_FUNC_QUALIFIER tref2& tref2::operator= ( tvec2 const & v ) diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index 739b9c8c..44175246 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -260,6 +260,103 @@ namespace detail }; GLM_DETAIL_IS_VECTOR(tvec3); + + template + GLM_FUNC_DECL tvec3 operator+(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator+(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator+(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator-(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator-(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator- (tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator*(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator/(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator/(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator/(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator-(tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator%(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator%(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator%(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator&(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator&(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator&(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator|(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator|(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator|(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator^(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator^(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator^(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator<<(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator>>(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator~(tvec3 const & v); + }//namespace detail }//namespace glm diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 11eec86e..e773c8d0 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -37,7 +37,7 @@ namespace glm{ namespace detail { template - 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 + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator+(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator-(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator- (tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator*(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator/(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v); + + template + GLM_FUNC_DECL bool operator==(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL bool operator!=(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator%(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator%(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator%(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator&(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator&(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator&(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator|(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator|(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator|(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator^(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator^(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator^(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator<<(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator<<(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator<<(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator>>(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator>>(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator>>(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator~(tvec4 const & v); + }//namespace detail }//namespace glm diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl index 695f26a9..f8df571d 100644 --- a/glm/core/type_vec4.inl +++ b/glm/core/type_vec4.inl @@ -1294,7 +1294,7 @@ namespace detail // tref definition template - tref4::tref4 + GLM_FUNC_QUALIFIER tref4::tref4 ( T & x, T & y, @@ -1308,7 +1308,7 @@ namespace detail {} template - tref4::tref4 + GLM_FUNC_QUALIFIER tref4::tref4 ( tref4 const & r ) : @@ -1319,7 +1319,7 @@ namespace detail {} template - tref4::tref4 + GLM_FUNC_QUALIFIER tref4::tref4 ( tvec4 const & v ) : @@ -1330,7 +1330,7 @@ namespace detail {} template - tref4& tref4::operator= + GLM_FUNC_QUALIFIER tref4& tref4::operator= ( tref4 const & r ) @@ -1343,7 +1343,7 @@ namespace detail } template - tref4& tref4::operator= + GLM_FUNC_QUALIFIER tref4& tref4::operator= ( tvec4 const & v ) diff --git a/glm/gtc/matrix_access.hpp b/glm/gtc/matrix_access.hpp index d49e096f..84839fd5 100644 --- a/glm/gtc/matrix_access.hpp +++ b/glm/gtc/matrix_access.hpp @@ -54,14 +54,14 @@ namespace glm template 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 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::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 genType column( genType const & m, - int index, + typename genType::size_type const & index, typename genType::col_type const & x); /// @} diff --git a/glm/gtc/matrix_access.inl b/glm/gtc/matrix_access.inl index e5fa9e88..de59d5e4 100644 --- a/glm/gtc/matrix_access.inl +++ b/glm/gtc/matrix_access.inl @@ -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 diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index 8a2f9c40..df9b7ae9 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -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 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); diff --git a/glm/gtx/color_space.hpp b/glm/gtx/color_space.hpp index f144378f..73b42d04 100644 --- a/glm/gtx/color_space.hpp +++ b/glm/gtx/color_space.hpp @@ -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 + template detail::tvec3 rgbColor( detail::tvec3 const & hsvValue); /// Converts a color from RGB color space to its color in HSV color space. /// @see gtx_color_space - template + template detail::tvec3 hsvColor( detail::tvec3 const & rgbValue); /// Build a saturation matrix. /// @see gtx_color_space - template + template detail::tmat4x4 saturation( valType const s); - /// Modify the saturation of a color. + /// Modify the saturation of a color. /// @see gtx_color_space template detail::tvec3 saturation( @@ -77,7 +77,7 @@ namespace glm /// Modify the saturation of a color. /// @see gtx_color_space - template + template detail::tvec4 saturation( valType const s, detail::tvec4 const & color); diff --git a/glm/gtx/color_space_YCoCg.hpp b/glm/gtx/color_space_YCoCg.hpp index 8ca4b102..a4fecb91 100644 --- a/glm/gtx/color_space_YCoCg.hpp +++ b/glm/gtx/color_space_YCoCg.hpp @@ -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 detail::tvec3 rgb2YCoCg( detail::tvec3 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 + template detail::tvec3 YCoCg2rgb( detail::tvec3 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 detail::tvec3 rgb2YCoCgR( detail::tvec3 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 + template detail::tvec3 YCoCgR2rgb( detail::tvec3 const & YCoCgColor); diff --git a/glm/gtx/compatibility.hpp b/glm/gtx/compatibility.hpp index de3a501c..bd0ed9e4 100644 --- a/glm/gtx/compatibility.hpp +++ b/glm/gtx/compatibility.hpp @@ -88,84 +88,84 @@ namespace glm template detail::tvec4 isfinite(const detail::tvec4& 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 bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tvec3 bool3; //!< \brief boolean type with 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tvec4 bool4; //!< \brief boolean type with 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec2 bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec3 bool3; //!< \brief boolean type with 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec4 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 bool2x2; //!< \brief boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat2x3 bool2x3; //!< \brief boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat2x4 bool2x4; //!< \brief boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x2 bool3x2; //!< \brief boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x3 bool3x3; //!< \brief boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x4 bool3x4; //!< \brief boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x2 bool4x2; //!< \brief boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x3 bool4x3; //!< \brief boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x4 bool4x4; //!< \brief boolean matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x2 bool2x2; //!< \brief boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x3 bool2x3; //!< \brief boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x4 bool2x4; //!< \brief boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x2 bool3x2; //!< \brief boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x3 bool3x3; //!< \brief boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x4 bool3x4; //!< \brief boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x2 bool4x2; //!< \brief boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x3 bool4x3; //!< \brief boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x4 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 int2; //!< \brief integer vector with 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tvec3 int3; //!< \brief integer vector with 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tvec4 int4; //!< \brief integer vector with 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec2 int2; //!< \brief integer vector with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec3 int3; //!< \brief integer vector with 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec4 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 int2x2; //!< \brief integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat2x3 int2x3; //!< \brief integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat2x4 int2x4; //!< \brief integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x2 int3x2; //!< \brief integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x3 int3x3; //!< \brief integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x4 int3x4; //!< \brief integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x2 int4x2; //!< \brief integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x3 int4x3; //!< \brief integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x4 int4x4; //!< \brief integer matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x2 int2x2; //!< \brief integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x3 int2x3; //!< \brief integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x4 int2x4; //!< \brief integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x2 int3x2; //!< \brief integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x3 int3x3; //!< \brief integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x4 int3x4; //!< \brief integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x2 int4x2; //!< \brief integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x3 int4x3; //!< \brief integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x4 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 half2; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tvec3 half3; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tvec4 half4; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec2 half2; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec3 half3; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec4 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 half2x2; //!< \brief half-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat2x3 half2x3; //!< \brief half-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat2x4 half2x4; //!< \brief half-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x2 half3x2; //!< \brief half-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x3 half3x3; //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x4 half3x4; //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x2 half4x2; //!< \brief half-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x3 half4x3; //!< \brief half-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x4 half4x4; //!< \brief half-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x2 half2x2; //!< \brief half-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x3 half2x3; //!< \brief half-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x4 half2x4; //!< \brief half-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x2 half3x2; //!< \brief half-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x3 half3x3; //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x4 half3x4; //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x2 half4x2; //!< \brief half-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x3 half4x3; //!< \brief half-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x4 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 float2; //!< \brief single-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tvec3 float3; //!< \brief single-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tvec4 float4; //!< \brief single-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec2 float2; //!< \brief single-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec3 float3; //!< \brief single-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec4 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 float2x2; //!< \brief single-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat2x3 float2x3; //!< \brief single-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat2x4 float2x4; //!< \brief single-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x2 float3x2; //!< \brief single-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x3 float3x3; //!< \brief single-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x4 float3x4; //!< \brief single-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x2 float4x2; //!< \brief single-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x3 float4x3; //!< \brief single-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x4 float4x4; //!< \brief single-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x2 float2x2; //!< \brief single-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x3 float2x3; //!< \brief single-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x4 float2x4; //!< \brief single-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x2 float3x2; //!< \brief single-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x3 float3x3; //!< \brief single-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x4 float3x4; //!< \brief single-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x2 float4x2; //!< \brief single-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x3 float4x3; //!< \brief single-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x4 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 double2; //!< \brief double-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tvec3 double3; //!< \brief double-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tvec4 double4; //!< \brief double-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec2 double2; //!< \brief double-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec3 double3; //!< \brief double-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec4 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 double2x2; //!< \brief double-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat2x3 double2x3; //!< \brief double-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat2x4 double2x4; //!< \brief double-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x2 double3x2; //!< \brief double-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x3 double3x3; //!< \brief double-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat3x4 double3x4; //!< \brief double-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x2 double4x2; //!< \brief double-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x3 double4x3; //!< \brief double-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef detail::tmat4x4 double4x4; //!< \brief double-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x2 double2x2; //!< \brief double-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x3 double2x3; //!< \brief double-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x4 double2x4; //!< \brief double-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x2 double3x2; //!< \brief double-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x3 double3x3; //!< \brief double-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x4 double3x4; //!< \brief double-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x2 double4x2; //!< \brief double-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x3 double4x3; //!< \brief double-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x4 double4x4; //!< \brief double-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) /// @} }//namespace glm diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp index 927e7df8..0e8da15e 100644 --- a/glm/gtx/simd_vec4.hpp +++ b/glm/gtx/simd_vec4.hpp @@ -79,13 +79,13 @@ namespace detail typedef tvec4 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 diff --git a/glm/gtx/spline.hpp b/glm/gtx/spline.hpp index e9035ce1..9f811709 100644 --- a/glm/gtx/spline.hpp +++ b/glm/gtx/spline.hpp @@ -52,7 +52,7 @@ namespace glm /// @{ //! Return a point from a catmull rom curve. - //! From GLM_GTX_spline extension. + /// @see gtx_spline extension. template 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 + /// @see gtx_spline extension. + template 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 genType cubic( genType const & v1, diff --git a/glm/gtx/string_cast.hpp b/glm/gtx/string_cast.hpp index b3060931..f5efa6ac 100644 --- a/glm/gtx/string_cast.hpp +++ b/glm/gtx/string_cast.hpp @@ -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 std::string to_string(genType const & x); diff --git a/glm/gtx/transform.hpp b/glm/gtx/transform.hpp index b00239e8..59397399 100644 --- a/glm/gtx/transform.hpp +++ b/glm/gtx/transform.hpp @@ -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 - detail::tmat4x4 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 - detail::tmat4x4 translate( - detail::tmat4x4 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 translate( detail::tvec3 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 - detail::tmat4x4 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 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 - detail::tmat4x4 rotate( - detail::tmat4x4 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 - detail::tmat4x4 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 - detail::tmat4x4 scale( - detail::tmat4x4 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 diff --git a/glm/gtx/transform.inl b/glm/gtx/transform.inl index 39e20b5f..aa288df4 100644 --- a/glm/gtx/transform.inl +++ b/glm/gtx/transform.inl @@ -9,24 +9,6 @@ namespace glm { - template - GLM_FUNC_QUALIFIER detail::tmat4x4 translate( - T x, T y, T z) - { - return translate( - detail::tmat4x4(1.0f), - detail::tvec3(x, y , z)); - } - - template - GLM_FUNC_QUALIFIER detail::tmat4x4 translate( - detail::tmat4x4 const & m, - T x, T y, T z) - { - return translate( - m, detail::tvec3(x, y , z)); - } - template GLM_FUNC_QUALIFIER detail::tmat4x4 translate( detail::tvec3 const & v) @@ -35,15 +17,6 @@ namespace glm detail::tmat4x4(1.0f), v); } - template - GLM_FUNC_QUALIFIER detail::tmat4x4 rotate( - T angle, - T x, T y, T z) - { - return rotate( - detail::tmat4x4(1), angle, detail::tvec3(x, y, z)); - } - template GLM_FUNC_QUALIFIER detail::tmat4x4 rotate( T angle, @@ -53,32 +26,6 @@ namespace glm detail::tmat4x4(1), angle, v); } - template - GLM_FUNC_QUALIFIER detail::tmat4x4 rotate( - detail::tmat4x4 const & m, - T angle, - T x, T y, T z) - { - return rotate( - m, angle, detail::tvec3(x, y, z)); - } - - template - GLM_FUNC_QUALIFIER detail::tmat4x4 scale(T x, T y, T z) - { - return scale( - detail::tmat4x4(1), detail::tvec3(x, y, z)); - } - - template - GLM_FUNC_QUALIFIER detail::tmat4x4 scale( - detail::tmat4x4 const & m, - T x, T y, T z) - { - return scale( - m, detail::tvec3(x, y, z)); - } - template GLM_FUNC_QUALIFIER detail::tmat4x4 scale( detail::tvec3 const & v) diff --git a/glm/gtx/vec1.hpp b/glm/gtx/vec1.hpp index 346c7ffa..ddf9880d 100644 --- a/glm/gtx/vec1.hpp +++ b/glm/gtx/vec1.hpp @@ -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 diff --git a/glm/gtx/vector_access.hpp b/glm/gtx/vector_access.hpp index 89426611..29bb8971 100644 --- a/glm/gtx/vector_access.hpp +++ b/glm/gtx/vector_access.hpp @@ -51,16 +51,16 @@ namespace glm /// @{ //! Set values to a 2 components vector. - //! From GLM_GTX_vector_access extension. - template + /// @see gtx_vector_access extension. + template void set( detail::tvec2 & v, valType const & x, valType const & y); //! Set values to a 3 components vector. - //! From GLM_GTX_vector_access extension. - template + /// @see gtx_vector_access extension. + template void set( detail::tvec3 & 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 + /// @see gtx_vector_access extension. + template void set( detail::tvec4 & v, valType const & x, diff --git a/glm/gtx/vector_angle.hpp b/glm/gtx/vector_angle.hpp index 0fc99fb0..424c6920 100644 --- a/glm/gtx/vector_angle.hpp +++ b/glm/gtx/vector_angle.hpp @@ -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 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 GLM_FUNC_QUALIFIER T orientedAngle( detail::tvec2 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 GLM_FUNC_QUALIFIER T orientedAngle( detail::tvec3 const & x, diff --git a/glm/gtx/vector_query.hpp b/glm/gtx/vector_query.hpp index 557526d5..2474727d 100644 --- a/glm/gtx/vector_query.hpp +++ b/glm/gtx/vector_query.hpp @@ -53,7 +53,7 @@ namespace glm /// @{ //! Check whether two vectors are collinears. - //! From GLM_GTX_vector_query extensions. + /// @see gtx_vector_query extensions. template 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 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 class vecType> bool isNormalized( vecType const & v, genType const & epsilon); //! Check whether a vector is null. - //! From GLM_GTX_vector_query extensions. + /// @see gtx_vector_query extensions. template bool isNull( detail::tvec2 const & v, T const & epsilon); //! Check whether a vector is null. - //! From GLM_GTX_vector_query extensions. + /// @see gtx_vector_query extensions. template bool isNull( detail::tvec3 const & v, T const & epsilon); //! Check whether a vector is null. - //! From GLM_GTX_vector_query extensions. + /// @see gtx_vector_query extensions. template bool isNull( detail::tvec4 const & v, T const & epsilon); //! Check whether two vectors are orthonormal. - //! From GLM_GTX_vector_query extensions. + /// @see gtx_vector_query extensions. template bool areOrthonormal( genType const & v0, diff --git a/glm/gtx/verbose_operator.hpp b/glm/gtx/verbose_operator.hpp index 0a2f0e31..3780f42a 100644 --- a/glm/gtx/verbose_operator.hpp +++ b/glm/gtx/verbose_operator.hpp @@ -51,27 +51,27 @@ namespace glm /// @{ //! Addition of two values - //! From GLM_GTX_verbose_operator extension. + /// @see gtx_verbose_operator extension. template genTypeT add(genTypeT const & a, genTypeU const & b); //! Substration of two values - //! From GLM_GTX_verbose_operator extension. + /// @see gtx_verbose_operator extension. template genTypeT sub(genTypeT const & a, genTypeU const & b); //! Multiplication of two values - //! From GLM_GTX_verbose_operator extension. + /// @see gtx_verbose_operator extension. template genTypeT mul(genTypeT const & a, genTypeU const & b); //! Division of two values - //! From GLM_GTX_verbose_operator extension. + /// @see gtx_verbose_operator extension. template 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 genTypeT mad(genTypeT const & a, genTypeU const & b, genTypeV const & c); diff --git a/glm/gtx/wrap.hpp b/glm/gtx/wrap.hpp index a6713273..5b29008b 100644 --- a/glm/gtx/wrap.hpp +++ b/glm/gtx/wrap.hpp @@ -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 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 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 genType mirrorRepeat(genType const & Texcoord); diff --git a/readme.txt b/readme.txt index d0f7a698..8c9f749d 100644 --- a/readme.txt +++ b/readme.txt @@ -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 diff --git a/test/core/core_func_swizzle.cpp b/test/core/core_func_swizzle.cpp index 08aacad4..20351dd7 100644 --- a/test/core/core_func_swizzle.cpp +++ b/test/core/core_func_swizzle.cpp @@ -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; } diff --git a/test/gtc/gtc_matrix_access.cpp b/test/gtc/gtc_matrix_access.cpp index 4bcf214f..d256298e 100644 --- a/test/gtc/gtc_matrix_access.cpp +++ b/test/gtc/gtc_matrix_access.cpp @@ -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; } diff --git a/test/gtc/gtc_matrix_transform.cpp b/test/gtc/gtc_matrix_transform.cpp index 289e2b0d..4ecad93e 100644 --- a/test/gtc/gtc_matrix_transform.cpp +++ b/test/gtc/gtc_matrix_transform.cpp @@ -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;