diff --git a/glm/core/func_matrix.inl b/glm/core/func_matrix.inl index 096fa9f2..c4d12d1d 100644 --- a/glm/core/func_matrix.inl +++ b/glm/core/func_matrix.inl @@ -41,7 +41,7 @@ namespace glm GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'matrixCompMult' only accept floating-point inputs"); matType result(matType::_null); - for(typename matType::size_type i = 0; i < matType::row_size(); ++i) + for(length_t i = 0; i < result.length(); ++i) result[i] = x[i] * y[i]; return result; } @@ -74,7 +74,7 @@ namespace glm GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'outerProduct' only accept floating-point inputs"); detail::tmat3x3 m(detail::tmat3x3::null); - for(typename detail::tmat3x3::size_type i(0); i < m.length(); ++i) + for(length_t i(0); i < m.length(); ++i) m[i] = c * r[i]; return m; } @@ -89,7 +89,7 @@ namespace glm GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'outerProduct' only accept floating-point inputs"); detail::tmat4x4 m(detail::tmat4x4::null); - for(typename detail::tmat4x4::size_type i(0); i < m.length(); ++i) + for(length_t i(0); i < m.length(); ++i) m[i] = c * r[i]; return m; } diff --git a/glm/core/type_mat2x2.hpp b/glm/core/type_mat2x2.hpp index ebac369c..c299da18 100644 --- a/glm/core/type_mat2x2.hpp +++ b/glm/core/type_mat2x2.hpp @@ -48,9 +48,6 @@ namespace detail typedef tmat2x2 type; typedef tmat2x2 transpose_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); - GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const; friend tmat2x2 inverse(tmat2x2 const & m); @@ -123,8 +120,8 @@ namespace detail ////////////////////////////////////// // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + GLM_FUNC_DECL col_type & operator[](length_t i); + GLM_FUNC_DECL col_type const & operator[](length_t i) const; // Unary updatable operators GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & m); diff --git a/glm/core/type_mat2x2.inl b/glm/core/type_mat2x2.inl index e6a5ec2e..6046d451 100644 --- a/glm/core/type_mat2x2.inl +++ b/glm/core/type_mat2x2.inl @@ -35,18 +35,6 @@ namespace detail return 2; } - template - GLM_FUNC_QUALIFIER typename tmat2x2::size_type tmat2x2::col_size() - { - return 2; - } - - template - GLM_FUNC_QUALIFIER typename tmat2x2::size_type tmat2x2::row_size() - { - return 2; - } - ////////////////////////////////////// // Accesses @@ -54,7 +42,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat2x2::col_type & tmat2x2::operator[] ( - size_type i + length_t i ) { assert(i < this->length()); @@ -65,7 +53,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat2x2::col_type const & tmat2x2::operator[] ( - size_type i + length_t i ) const { assert(i < this->length()); diff --git a/glm/core/type_mat2x3.hpp b/glm/core/type_mat2x3.hpp index dd6d49b0..21cc8d01 100644 --- a/glm/core/type_mat2x3.hpp +++ b/glm/core/type_mat2x3.hpp @@ -49,9 +49,6 @@ namespace detail typedef tmat2x3 type; typedef tmat3x2 transpose_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); - GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const; private: @@ -114,8 +111,8 @@ namespace detail GLM_FUNC_DECL explicit tmat2x3(tmat4x3 const & x); // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + GLM_FUNC_DECL col_type & operator[](length_t i); + GLM_FUNC_DECL col_type const & operator[](length_t i) const; // Unary updatable operators GLM_FUNC_DECL tmat2x3 & operator= (tmat2x3 const & m); diff --git a/glm/core/type_mat2x3.inl b/glm/core/type_mat2x3.inl index 1e901a13..13becfc9 100644 --- a/glm/core/type_mat2x3.inl +++ b/glm/core/type_mat2x3.inl @@ -35,18 +35,6 @@ namespace detail return 2; } - template - GLM_FUNC_QUALIFIER typename tmat2x3::size_type tmat2x3::col_size() - { - return 3; - } - - template - GLM_FUNC_QUALIFIER typename tmat2x3::size_type tmat2x3::row_size() - { - return 2; - } - ////////////////////////////////////// // Accesses @@ -54,7 +42,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat2x3::col_type & tmat2x3::operator[] ( - size_type i + length_t i ) { assert(i < this->length()); @@ -65,7 +53,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat2x3::col_type const & tmat2x3::operator[] ( - size_type i + length_t i ) const { assert(i < this->length()); diff --git a/glm/core/type_mat2x4.hpp b/glm/core/type_mat2x4.hpp index 32ca4ae8..09b43f02 100644 --- a/glm/core/type_mat2x4.hpp +++ b/glm/core/type_mat2x4.hpp @@ -49,9 +49,6 @@ namespace detail typedef tmat2x4 type; typedef tmat4x2 transpose_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); - GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const; private: @@ -116,8 +113,8 @@ namespace detail GLM_FUNC_DECL explicit tmat2x4(tmat4x3 const & x); // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + GLM_FUNC_DECL col_type & operator[](length_t i); + GLM_FUNC_DECL col_type const & operator[](length_t i) const; // Unary updatable operators GLM_FUNC_DECL tmat2x4& operator= (tmat2x4 const & m); diff --git a/glm/core/type_mat2x4.inl b/glm/core/type_mat2x4.inl index dec217a8..93b2cc8d 100644 --- a/glm/core/type_mat2x4.inl +++ b/glm/core/type_mat2x4.inl @@ -35,18 +35,6 @@ namespace detail return 2; } - template - GLM_FUNC_QUALIFIER typename tmat2x4::size_type tmat2x4::col_size() - { - return 4; - } - - template - GLM_FUNC_QUALIFIER typename tmat2x4::size_type tmat2x4::row_size() - { - return 2; - } - ////////////////////////////////////// // Accesses @@ -54,7 +42,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat2x4::col_type & tmat2x4::operator[] ( - size_type i + length_t i ) { assert(i < this->length()); @@ -65,7 +53,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat2x4::col_type const & tmat2x4::operator[] ( - size_type i + length_t i ) const { assert(i < this->length()); diff --git a/glm/core/type_mat3x2.hpp b/glm/core/type_mat3x2.hpp index bd96605a..717c6092 100644 --- a/glm/core/type_mat3x2.hpp +++ b/glm/core/type_mat3x2.hpp @@ -49,9 +49,6 @@ namespace detail typedef tmat3x2 type; typedef tmat2x3 transpose_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); - GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const; private: @@ -120,8 +117,8 @@ namespace detail GLM_FUNC_DECL explicit tmat3x2(tmat4x3 const & x); // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + GLM_FUNC_DECL col_type & operator[](length_t i); + GLM_FUNC_DECL col_type const & operator[](length_t i) const; // Unary updatable operators GLM_FUNC_DECL tmat3x2 & operator= (tmat3x2 const & m); diff --git a/glm/core/type_mat3x2.inl b/glm/core/type_mat3x2.inl index 5fafff25..7f96cb4d 100644 --- a/glm/core/type_mat3x2.inl +++ b/glm/core/type_mat3x2.inl @@ -35,18 +35,6 @@ namespace detail return 3; } - template - GLM_FUNC_QUALIFIER typename tmat3x2::size_type tmat3x2::col_size() - { - return 2; - } - - template - GLM_FUNC_QUALIFIER typename tmat3x2::size_type tmat3x2::row_size() - { - return 3; - } - ////////////////////////////////////// // Accesses @@ -54,7 +42,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat3x2::col_type & tmat3x2::operator[] ( - size_type i + length_t i ) { assert(i < this->length()); @@ -65,7 +53,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat3x2::col_type const & tmat3x2::operator[] ( - size_type i + length_t i ) const { assert(i < this->length()); diff --git a/glm/core/type_mat3x3.hpp b/glm/core/type_mat3x3.hpp index 38f339dc..0000b1e6 100644 --- a/glm/core/type_mat3x3.hpp +++ b/glm/core/type_mat3x3.hpp @@ -48,9 +48,6 @@ namespace detail typedef tmat3x3 type; typedef tmat3x3 transpose_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); - GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const; friend tmat3x3 inverse(tmat3x3 const & m); @@ -126,8 +123,8 @@ namespace detail GLM_FUNC_DECL explicit tmat3x3(tmat4x3 const & x); // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + GLM_FUNC_DECL col_type & operator[](length_t i); + GLM_FUNC_DECL col_type const & operator[](length_t i) const; // Unary updatable operators GLM_FUNC_DECL tmat3x3& operator= (tmat3x3 const & m); diff --git a/glm/core/type_mat3x3.inl b/glm/core/type_mat3x3.inl index a1970e7e..f017ff9e 100644 --- a/glm/core/type_mat3x3.inl +++ b/glm/core/type_mat3x3.inl @@ -35,18 +35,6 @@ namespace detail return 3; } - template - GLM_FUNC_QUALIFIER typename tmat3x3::size_type tmat3x3::col_size() - { - return 3; - } - - template - GLM_FUNC_QUALIFIER typename tmat3x3::size_type tmat3x3::row_size() - { - return 3; - } - ////////////////////////////////////// // Accesses @@ -54,7 +42,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat3x3::col_type & tmat3x3::operator[] ( - size_type i + length_t i ) { assert(i < this->length()); @@ -65,7 +53,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat3x3::col_type const & tmat3x3::operator[] ( - size_type i + length_t i ) const { assert(i < this->length()); diff --git a/glm/core/type_mat3x4.hpp b/glm/core/type_mat3x4.hpp index 8475294d..611b0d3a 100644 --- a/glm/core/type_mat3x4.hpp +++ b/glm/core/type_mat3x4.hpp @@ -49,9 +49,6 @@ namespace detail typedef tmat3x4 type; typedef tmat4x3 transpose_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); - GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const; private: @@ -120,8 +117,8 @@ namespace detail GLM_FUNC_DECL explicit tmat3x4(tmat4x3 const & x); // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + GLM_FUNC_DECL col_type & operator[](length_t i); + GLM_FUNC_DECL col_type const & operator[](length_t i) const; // Unary updatable operators GLM_FUNC_DECL tmat3x4 & operator= (tmat3x4 const & m); diff --git a/glm/core/type_mat3x4.inl b/glm/core/type_mat3x4.inl index c948d3ce..5c39bd84 100644 --- a/glm/core/type_mat3x4.inl +++ b/glm/core/type_mat3x4.inl @@ -35,18 +35,6 @@ namespace detail return 3; } - template - GLM_FUNC_QUALIFIER typename tmat3x4::size_type tmat3x4::col_size() - { - return 4; - } - - template - GLM_FUNC_QUALIFIER typename tmat3x4::size_type tmat3x4::row_size() - { - return 3; - } - ////////////////////////////////////// // Accesses @@ -54,7 +42,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat3x4::col_type & tmat3x4::operator[] ( - size_type i + length_t i ) { assert(i < this->length()); @@ -65,7 +53,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat3x4::col_type const & tmat3x4::operator[] ( - size_type i + length_t i ) const { assert(i < this->length()); diff --git a/glm/core/type_mat4x2.hpp b/glm/core/type_mat4x2.hpp index faf79173..caecb2c4 100644 --- a/glm/core/type_mat4x2.hpp +++ b/glm/core/type_mat4x2.hpp @@ -49,9 +49,6 @@ namespace detail typedef tmat4x2 type; typedef tmat2x4 transpose_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); - GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const; private: @@ -125,8 +122,8 @@ namespace detail GLM_FUNC_DECL explicit tmat4x2(tmat3x4 const & x); // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + GLM_FUNC_DECL col_type & operator[](length_t i); + GLM_FUNC_DECL col_type const & operator[](length_t i) const; // Unary updatable operators GLM_FUNC_DECL tmat4x2& operator= (tmat4x2 const & m); diff --git a/glm/core/type_mat4x2.inl b/glm/core/type_mat4x2.inl index d7648ce0..89396ced 100644 --- a/glm/core/type_mat4x2.inl +++ b/glm/core/type_mat4x2.inl @@ -35,18 +35,6 @@ namespace detail return 4; } - template - GLM_FUNC_QUALIFIER typename tmat4x2::size_type tmat4x2::col_size() - { - return 2; - } - - template - GLM_FUNC_QUALIFIER typename tmat4x2::size_type tmat4x2::row_size() - { - return 4; - } - ////////////////////////////////////// // Accesses @@ -54,7 +42,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat4x2::col_type & tmat4x2::operator[] ( - size_type i + length_t i ) { assert(i < this->length()); @@ -65,7 +53,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat4x2::col_type const & tmat4x2::operator[] ( - size_type i + length_t i ) const { assert(i < this->length()); diff --git a/glm/core/type_mat4x3.hpp b/glm/core/type_mat4x3.hpp index 1452ab27..b5151daf 100644 --- a/glm/core/type_mat4x3.hpp +++ b/glm/core/type_mat4x3.hpp @@ -49,9 +49,6 @@ namespace detail typedef tmat4x3 type; typedef tmat3x4 transpose_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); - GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const; private: diff --git a/glm/core/type_mat4x3.inl b/glm/core/type_mat4x3.inl index 0c463518..69a10570 100644 --- a/glm/core/type_mat4x3.inl +++ b/glm/core/type_mat4x3.inl @@ -35,18 +35,6 @@ namespace detail return 4; } - template - GLM_FUNC_QUALIFIER typename tmat4x3::size_type tmat4x3::col_size() - { - return 3; - } - - template - GLM_FUNC_QUALIFIER typename tmat4x3::size_type tmat4x3::row_size() - { - return 4; - } - ////////////////////////////////////// // Accesses diff --git a/glm/core/type_mat4x4.hpp b/glm/core/type_mat4x4.hpp index 509bd490..59a5e4eb 100644 --- a/glm/core/type_mat4x4.hpp +++ b/glm/core/type_mat4x4.hpp @@ -52,9 +52,6 @@ namespace detail typedef tmat4x4 type; typedef tmat4x4 transpose_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); - GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const; friend tmat4x4 inverse(tmat4x4 const & m); @@ -135,8 +132,8 @@ namespace detail GLM_FUNC_DECL explicit tmat4x4(tmat4x3 const & x); // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + GLM_FUNC_DECL col_type & operator[](length_t i); + GLM_FUNC_DECL col_type const & operator[](length_t i) const; // Unary updatable operators GLM_FUNC_DECL tmat4x4 & operator= (tmat4x4 const & m); diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl index 2d155193..a52da05b 100644 --- a/glm/core/type_mat4x4.inl +++ b/glm/core/type_mat4x4.inl @@ -35,18 +35,6 @@ namespace detail return 4; } - template - GLM_FUNC_QUALIFIER typename tmat4x4::size_type tmat4x4::col_size() - { - return 4; - } - - template - GLM_FUNC_QUALIFIER typename tmat4x4::size_type tmat4x4::row_size() - { - return 4; - } - ////////////////////////////////////// // Accesses @@ -54,7 +42,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat4x4::col_type & tmat4x4::operator[] ( - size_type i + length_t i ) { assert(i < this->length()); @@ -65,7 +53,7 @@ namespace detail GLM_FUNC_QUALIFIER typename tmat4x4::col_type const & tmat4x4::operator[] ( - size_type i + length_t i ) const { assert(i < this->length()); diff --git a/glm/gtc/matrix_access.inl b/glm/gtc/matrix_access.inl index e587a4a2..530b796b 100644 --- a/glm/gtc/matrix_access.inl +++ b/glm/gtc/matrix_access.inl @@ -32,14 +32,14 @@ namespace glm GLM_FUNC_QUALIFIER genType row ( genType const & m, - int const & index, + length_t const & index, typename genType::row_type const & x ) { - assert(index >= 0 && index < m.col_size()); + assert(index >= 0 && index < m[0].length()); genType Result = m; - for(int i = 0; i < genType::row_size(); ++i) + for(length_t i = 0; i < m.length(); ++i) Result[i][index] = x[i]; return Result; } @@ -48,13 +48,13 @@ namespace glm GLM_FUNC_QUALIFIER typename genType::row_type row ( genType const & m, - int const & index + length_t const & index ) { - assert(index >= 0 && index < m.col_size()); + assert(index >= 0 && index < m[0].length()); typename genType::row_type Result; - for(int i = 0; i < genType::row_size(); ++i) + for(length_t i = 0; i < m.length(); ++i) Result[i] = m[i][index]; return Result; } @@ -63,11 +63,11 @@ namespace glm GLM_FUNC_QUALIFIER genType column ( genType const & m, - int const & index, + length_t const & index, typename genType::col_type const & x ) { - assert(index >= 0 && index < m.row_size()); + assert(index >= 0 && index < m.length()); genType Result = m; Result[index] = x; @@ -78,10 +78,10 @@ namespace glm GLM_FUNC_QUALIFIER typename genType::col_type column ( genType const & m, - int const & index + length_t const & index ) { - assert(index >= 0 && index < m.row_size()); + assert(index >= 0 && index < m.length()); return m[index]; } diff --git a/glm/gtx/matrix_query.inl b/glm/gtx/matrix_query.inl index 0f3b60f7..0429caa8 100644 --- a/glm/gtx/matrix_query.inl +++ b/glm/gtx/matrix_query.inl @@ -19,7 +19,7 @@ namespace glm T const & epsilon) { bool result = true; - for(int i = 0; result && i < 2 ; ++i) + for(length_t i = 0; result && i < 2 ; ++i) result = isNull(m[i], epsilon); return result; } @@ -32,7 +32,7 @@ namespace glm ) { bool result = true; - for(int i = 0; result && i < 3 ; ++i) + for(length_t i = 0; result && i < 3 ; ++i) result = isNull(m[i], epsilon); return result; } @@ -45,7 +45,7 @@ namespace glm ) { bool result = true; - for(int i = 0; result && i < 4 ; ++i) + for(length_t i = 0; result && i < 4 ; ++i) result = isNull(m[i], epsilon); return result; } @@ -58,13 +58,13 @@ namespace glm ) { bool result = true; - for(int i(0); result && i < matType::col_size(); ++i) + for(length_t i(0); result && i < m[0].length(); ++i) { - for(int j(0); result && j < i ; ++j) + for(length_t j(0); result && j < i ; ++j) result = abs(m[i][j]) <= epsilon; if(result) result = abs(m[i][i] - 1) <= epsilon; - for(int j(i + 1); result && j < matType::row_size(); ++j) + for(length_t j(i + 1); result && j < m.length(); ++j) result = abs(m[i][j]) <= epsilon; } return result; @@ -78,12 +78,12 @@ namespace glm ) { bool result(true); - for(int i(0); result && i < m.length(); ++i) + for(length_t i(0); result && i < m.length(); ++i) result = isNormalized(m[i], epsilon); - for(int i(0); result && i < m.length(); ++i) + for(length_t i(0); result && i < m.length(); ++i) { typename detail::tmat2x2::col_type v; - for(int j(0); j < m.length(); ++j) + for(length_t j(0); j < m.length(); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); } @@ -98,12 +98,12 @@ namespace glm ) { bool result(true); - for(int i(0); result && i < m.length(); ++i) + for(length_t i(0); result && i < m.length(); ++i) result = isNormalized(m[i], epsilon); - for(int i(0); result && i < m.length(); ++i) + for(length_t i(0); result && i < m.length(); ++i) { typename detail::tmat3x3::col_type v; - for(int j(0); j < m.length(); ++j) + for(length_t j(0); j < m.length(); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); } @@ -118,12 +118,12 @@ namespace glm ) { bool result(true); - for(int i(0); result && i < m.length(); ++i) + for(length_t i(0); result && i < m.length(); ++i) result = isNormalized(m[i], epsilon); - for(int i(0); result && i < m.length(); ++i) + for(length_t i(0); result && i < m.length(); ++i) { typename detail::tmat4x4::col_type v; - for(int j(0); j < m.length(); ++j) + for(length_t j(0); j < m.length(); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); } @@ -138,15 +138,15 @@ namespace glm ) { bool result(true); - for(int i(0); result && i < m.length() - 1; ++i) - for(int j(i + 1); result && j < m.length(); ++j) + for(length_t i(0); result && i < m.length() - 1; ++i) + for(length_t j(i + 1); result && j < m.length(); ++j) result = areOrthogonal(m[i], m[j], epsilon); if(result) { matType tmp = transpose(m); - for(int i(0); result && i < m.length() - 1 ; ++i) - for(int j(i + 1); result && j < m.length(); ++j) + for(length_t i(0); result && i < m.length() - 1 ; ++i) + for(length_t j(i + 1); result && j < m.length(); ++j) result = areOrthogonal(tmp[i], tmp[j], epsilon); } return result; diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp index 5acb81bc..b557eda5 100644 --- a/glm/gtx/simd_mat4.hpp +++ b/glm/gtx/simd_mat4.hpp @@ -68,8 +68,6 @@ namespace detail typedef fvec4SIMD row_type; typedef std::size_t size_type; static size_type value_size(); - static size_type col_size(); - static size_type row_size(); static bool is_matrix(); fvec4SIMD Data[4]; @@ -91,8 +89,8 @@ namespace detail fvec4SIMD const & v3); explicit fmat4x4SIMD( mat4x4 const & m); - explicit fmat4x4SIMD( - __m128 const in[4]); + explicit fmat4x4SIMD( + __m128 const in[4]); // Conversions //template @@ -108,8 +106,8 @@ namespace detail //explicit tmat4x4(tmat4x3 const & x); // Accesses - fvec4SIMD & operator[](size_type i); - fvec4SIMD const & operator[](size_type i) const; + fvec4SIMD & operator[](length_t i); + fvec4SIMD const & operator[](length_t i) const; // Unary updatable operators fmat4x4SIMD & operator= (fmat4x4SIMD const & m); diff --git a/glm/gtx/simd_mat4.inl b/glm/gtx/simd_mat4.inl index a5e2b68a..3731c494 100644 --- a/glm/gtx/simd_mat4.inl +++ b/glm/gtx/simd_mat4.inl @@ -15,20 +15,10 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD::size_type fmat4x4SIMD::value_size() return sizeof(value_type); } -GLM_FUNC_QUALIFIER fmat4x4SIMD::size_type fmat4x4SIMD::col_size() -{ - return 4; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD::size_type fmat4x4SIMD::row_size() -{ - return 4; -} - GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD() { #ifndef GLM_SIMD_ENABLE_DEFAULT_INIT - this->Data[0] = fvec4SIMD(1.0f, 0, 0, 0); + this->Data[0] = fvec4SIMD(1.0f, 0, 0, 0); this->Data[1] = fvec4SIMD(0, 1.0f, 0, 0); this->Data[2] = fvec4SIMD(0, 0, 1.0f, 0); this->Data[3] = fvec4SIMD(0, 0, 0, 1.0f); @@ -84,13 +74,13 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD ( - __m128 const in[4] + __m128 const in[4] ) { - this->Data[0] = in[0]; - this->Data[1] = in[1]; - this->Data[2] = in[2]; - this->Data[3] = in[3]; + this->Data[0] = in[0]; + this->Data[1] = in[1]; + this->Data[2] = in[2]; + this->Data[3] = in[3]; } ////////////////////////////////////// @@ -98,24 +88,20 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD GLM_FUNC_QUALIFIER fvec4SIMD & fmat4x4SIMD::operator[] ( - fmat4x4SIMD::size_type i + length i ) { - assert( - //i >= fmat4x4SIMD::size_type(0) && - i < fmat4x4SIMD::col_size()); + assert(i < this->length()); return this->Data[i]; } GLM_FUNC_QUALIFIER fvec4SIMD const & fmat4x4SIMD::operator[] ( - fmat4x4SIMD::size_type i + length i ) const { - assert( - //i >= fmat4x4SIMD::size_type(0) && - i < fmat4x4SIMD::col_size()); + assert(i < this->length()); return this->Data[i]; } @@ -132,7 +118,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD& fmat4x4SIMD::operator= this->Data[1] = m[1]; this->Data[2] = m[2]; this->Data[3] = m[3]; - return *this; + return *this; } GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator+= @@ -144,7 +130,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator+= this->Data[1].Data = _mm_add_ps(this->Data[1].Data, m[1].Data); this->Data[2].Data = _mm_add_ps(this->Data[2].Data, m[2].Data); this->Data[3].Data = _mm_add_ps(this->Data[3].Data, m[3].Data); - return *this; + return *this; } GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator-= @@ -157,7 +143,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator-= this->Data[2].Data = _mm_sub_ps(this->Data[2].Data, m[2].Data); this->Data[3].Data = _mm_sub_ps(this->Data[3].Data, m[3].Data); - return *this; + return *this; } GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator*= @@ -166,7 +152,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator*= ) { sse_mul_ps(&this->Data[0].Data, &m.Data[0].Data, &this->Data[0].Data); - return *this; + return *this; } GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator/= @@ -177,7 +163,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator/= __m128 Inv[4]; sse_inverse_ps(&m.Data[0].Data, Inv); sse_mul_ps(&this->Data[0].Data, Inv, &this->Data[0].Data); - return *this; + return *this; } GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator+= @@ -190,7 +176,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator+= this->Data[1].Data = _mm_add_ps(this->Data[1].Data, Operand); this->Data[2].Data = _mm_add_ps(this->Data[2].Data, Operand); this->Data[3].Data = _mm_add_ps(this->Data[3].Data, Operand); - return *this; + return *this; } GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator-= @@ -203,7 +189,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator-= this->Data[1].Data = _mm_sub_ps(this->Data[1].Data, Operand); this->Data[2].Data = _mm_sub_ps(this->Data[2].Data, Operand); this->Data[3].Data = _mm_sub_ps(this->Data[3].Data, Operand); - return *this; + return *this; } GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator*= @@ -216,7 +202,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator*= this->Data[1].Data = _mm_mul_ps(this->Data[1].Data, Operand); this->Data[2].Data = _mm_mul_ps(this->Data[2].Data, Operand); this->Data[3].Data = _mm_mul_ps(this->Data[3].Data, Operand); - return *this; + return *this; } GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator/= @@ -229,7 +215,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator/= this->Data[1].Data = _mm_mul_ps(this->Data[1].Data, Operand); this->Data[2].Data = _mm_mul_ps(this->Data[2].Data, Operand); this->Data[3].Data = _mm_mul_ps(this->Data[3].Data, Operand); - return *this; + return *this; } GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator++ () @@ -238,7 +224,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator++ () this->Data[1].Data = _mm_add_ps(this->Data[1].Data, one); this->Data[2].Data = _mm_add_ps(this->Data[2].Data, one); this->Data[3].Data = _mm_add_ps(this->Data[3].Data, one); - return *this; + return *this; } GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator-- () @@ -247,7 +233,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator-- () this->Data[1].Data = _mm_sub_ps(this->Data[1].Data, one); this->Data[2].Data = _mm_sub_ps(this->Data[2].Data, one); this->Data[3].Data = _mm_sub_ps(this->Data[3].Data, one); - return *this; + return *this; } @@ -256,32 +242,32 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator-- () GLM_FUNC_QUALIFIER fmat4x4SIMD operator+ ( - const fmat4x4SIMD &m, - float const & s + const fmat4x4SIMD &m, + float const & s ) { - return detail::fmat4x4SIMD - ( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s - ); + return detail::fmat4x4SIMD + ( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s + ); } GLM_FUNC_QUALIFIER fmat4x4SIMD operator+ ( - float const & s, - const fmat4x4SIMD &m + float const & s, + const fmat4x4SIMD &m ) { - return detail::fmat4x4SIMD - ( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s - ); + return detail::fmat4x4SIMD + ( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s + ); } GLM_FUNC_QUALIFIER fmat4x4SIMD operator+