From aed7317408ace2e760d861fb56d3fdacfd744499 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 4 Jan 2014 13:42:49 +0100 Subject: [PATCH] Fixed declaration and definision mismatches (#148) --- glm/detail/type_mat2x2.inl | 2 +- glm/detail/type_mat2x3.inl | 24 ++++++++++---------- glm/detail/type_mat2x4.inl | 32 +++++++++++++------------- glm/detail/type_mat3x3.inl | 36 +++++++++++++++--------------- glm/detail/type_mat4x4.inl | 16 ++++++------- glm/gtx/dual_quaternion.inl | 12 ++-------- glm/gtx/intersect.hpp | 2 +- glm/gtx/matrix_query.hpp | 2 +- glm/gtx/rotate_normalized_axis.inl | 4 ++-- glm/gtx/vector_query.hpp | 6 ++--- readme.txt | 3 +-- 11 files changed, 65 insertions(+), 74 deletions(-) diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index e3e77a7a..f949ac92 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -275,7 +275,7 @@ namespace detail template GLM_FUNC_QUALIFIER tmat2x2 tmat2x2::_inverse() const { - typename tmat2x2::value_type Determinant = this->value[0][0] * this->value[1][1] - this->value[1][0] * this->value[0][1]; + T Determinant = this->value[0][0] * this->value[1][1] - this->value[1][0] * this->value[0][1]; tmat2x2 Inverse( + this->value[1][1] / Determinant, diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index b269908d..2eef27ba 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -500,19 +500,19 @@ namespace detail tmat3x2 const & m2 ) { - typename tmat2x3::value_type SrcA00 = m1[0][0]; - typename tmat2x3::value_type SrcA01 = m1[0][1]; - typename tmat2x3::value_type SrcA02 = m1[0][2]; - typename tmat2x3::value_type SrcA10 = m1[1][0]; - typename tmat2x3::value_type SrcA11 = m1[1][1]; - typename tmat2x3::value_type SrcA12 = m1[1][2]; + T SrcA00 = m1[0][0]; + T SrcA01 = m1[0][1]; + T SrcA02 = m1[0][2]; + T SrcA10 = m1[1][0]; + T SrcA11 = m1[1][1]; + T SrcA12 = m1[1][2]; - typename tmat2x3::value_type SrcB00 = m2[0][0]; - typename tmat2x3::value_type SrcB01 = m2[0][1]; - typename tmat2x3::value_type SrcB10 = m2[1][0]; - typename tmat2x3::value_type SrcB11 = m2[1][1]; - typename tmat2x3::value_type SrcB20 = m2[2][0]; - typename tmat2x3::value_type SrcB21 = m2[2][1]; + T SrcB00 = m2[0][0]; + T SrcB01 = m2[0][1]; + T SrcB10 = m2[1][0]; + T SrcB11 = m2[1][1]; + T SrcB20 = m2[2][0]; + T SrcB21 = m2[2][1]; tmat3x3 Result(tmat3x3::null); Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 881db381..11d6a789 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -490,23 +490,23 @@ namespace detail tmat4x2 const & m2 ) { - typename tmat2x4::value_type SrcA00 = m1[0][0]; - typename tmat2x4::value_type SrcA01 = m1[0][1]; - typename tmat2x4::value_type SrcA02 = m1[0][2]; - typename tmat2x4::value_type SrcA03 = m1[0][3]; - typename tmat2x4::value_type SrcA10 = m1[1][0]; - typename tmat2x4::value_type SrcA11 = m1[1][1]; - typename tmat2x4::value_type SrcA12 = m1[1][2]; - typename tmat2x4::value_type SrcA13 = m1[1][3]; + T SrcA00 = m1[0][0]; + T SrcA01 = m1[0][1]; + T SrcA02 = m1[0][2]; + T SrcA03 = m1[0][3]; + T SrcA10 = m1[1][0]; + T SrcA11 = m1[1][1]; + T SrcA12 = m1[1][2]; + T SrcA13 = m1[1][3]; - typename tmat2x4::value_type SrcB00 = m2[0][0]; - typename tmat2x4::value_type SrcB01 = m2[0][1]; - typename tmat2x4::value_type SrcB10 = m2[1][0]; - typename tmat2x4::value_type SrcB11 = m2[1][1]; - typename tmat2x4::value_type SrcB20 = m2[2][0]; - typename tmat2x4::value_type SrcB21 = m2[2][1]; - typename tmat2x4::value_type SrcB30 = m2[3][0]; - typename tmat2x4::value_type SrcB31 = m2[3][1]; + T SrcB00 = m2[0][0]; + T SrcB01 = m2[0][1]; + T SrcB10 = m2[1][0]; + T SrcB11 = m2[1][1]; + T SrcB20 = m2[2][0]; + T SrcB21 = m2[2][1]; + T SrcB30 = m2[3][0]; + T SrcB31 = m2[3][1]; tmat4x4 Result(tmat4x4::null); Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index 9dff121b..16c3fba7 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -615,25 +615,25 @@ namespace detail tmat3x3 const & m2 ) { - typename tmat3x3::value_type const SrcA00 = m1[0][0]; - typename tmat3x3::value_type const SrcA01 = m1[0][1]; - typename tmat3x3::value_type const SrcA02 = m1[0][2]; - typename tmat3x3::value_type const SrcA10 = m1[1][0]; - typename tmat3x3::value_type const SrcA11 = m1[1][1]; - typename tmat3x3::value_type const SrcA12 = m1[1][2]; - typename tmat3x3::value_type const SrcA20 = m1[2][0]; - typename tmat3x3::value_type const SrcA21 = m1[2][1]; - typename tmat3x3::value_type const SrcA22 = m1[2][2]; + T const SrcA00 = m1[0][0]; + T const SrcA01 = m1[0][1]; + T const SrcA02 = m1[0][2]; + T const SrcA10 = m1[1][0]; + T const SrcA11 = m1[1][1]; + T const SrcA12 = m1[1][2]; + T const SrcA20 = m1[2][0]; + T const SrcA21 = m1[2][1]; + T const SrcA22 = m1[2][2]; - typename tmat3x3::value_type const SrcB00 = m2[0][0]; - typename tmat3x3::value_type const SrcB01 = m2[0][1]; - typename tmat3x3::value_type const SrcB02 = m2[0][2]; - typename tmat3x3::value_type const SrcB10 = m2[1][0]; - typename tmat3x3::value_type const SrcB11 = m2[1][1]; - typename tmat3x3::value_type const SrcB12 = m2[1][2]; - typename tmat3x3::value_type const SrcB20 = m2[2][0]; - typename tmat3x3::value_type const SrcB21 = m2[2][1]; - typename tmat3x3::value_type const SrcB22 = m2[2][2]; + T const SrcB00 = m2[0][0]; + T const SrcB01 = m2[0][1]; + T const SrcB02 = m2[0][2]; + T const SrcB10 = m2[1][0]; + T const SrcB11 = m2[1][1]; + T const SrcB12 = m2[1][2]; + T const SrcB20 = m2[2][0]; + T const SrcB21 = m2[2][1]; + T const SrcB22 = m2[2][2]; tmat3x3 Result(tmat3x3::_null); Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index 01f55d52..cde326cc 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -897,10 +897,10 @@ namespace detail ) { return tmat4x4( - m[0] + typename tmat4x4::value_type(1), - m[1] + typename tmat4x4::value_type(1), - m[2] + typename tmat4x4::value_type(1), - m[3] + typename tmat4x4::value_type(1)); + m[0] + static_cast(1), + m[1] + static_cast(1), + m[2] + static_cast(1), + m[3] + static_cast(1)); } template @@ -911,10 +911,10 @@ namespace detail ) { return tmat4x4( - m[0] - typename tmat4x4::value_type(1), - m[1] - typename tmat4x4::value_type(1), - m[2] - typename tmat4x4::value_type(1), - m[3] - typename tmat4x4::value_type(1)); + m[0] - static_cast(1), + m[1] - static_cast(1), + m[2] - static_cast(1), + m[3] - static_cast(1)); } ////////////////////////////////////// diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index d596a205..1d7f44b1 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -289,7 +289,7 @@ namespace detail // Lerp is only defined in [0, 1] assert(a >= static_cast(0)); assert(a <= static_cast(1)); - T const k = dot(x.real,y.real) < detail::tdualquat::value_type(0) ? -a : a; + T const k = dot(x.real,y.real) < static_cast(0) ? -a : a; T const one(1); return detail::tdualquat(x * (one - a) + y * k); } @@ -304,15 +304,7 @@ namespace detail const glm::detail::tquat dual = conjugate(q.dual); return detail::tdualquat(real, dual + (real * (-2.0f * dot(real,dual)))); } - /* - template - GLM_FUNC_QUALIFIER detail::tmat3x3 mat3_cast - ( - detail::tdualquat const & x - ) - { - } - */ + template GLM_FUNC_QUALIFIER detail::tmat2x4 mat2x4_cast ( diff --git a/glm/gtx/intersect.hpp b/glm/gtx/intersect.hpp index cfc4e50c..89f8d270 100644 --- a/glm/gtx/intersect.hpp +++ b/glm/gtx/intersect.hpp @@ -74,7 +74,7 @@ namespace glm template bool intersectRaySphere( genType const & rayStarting, genType const & rayNormalizedDirection, - genType const & sphereCenter, const typename genType::value_type sphereRadiusSquered, + genType const & sphereCenter, typename genType::value_type const sphereRadiusSquered, typename genType::value_type & intersectionDistance); //! Compute the intersection of a ray and a sphere. diff --git a/glm/gtx/matrix_query.hpp b/glm/gtx/matrix_query.hpp index 5342a43e..f2ddee74 100644 --- a/glm/gtx/matrix_query.hpp +++ b/glm/gtx/matrix_query.hpp @@ -79,7 +79,7 @@ namespace glm template bool isIdentity( genType const & m, - typename genType::T const & epsilon/* = std::numeric_limits::epsilon()*/); + typename genType::value_type const & epsilon/* = std::numeric_limits::epsilon()*/); /// Return whether a matrix is a normalized matrix. /// From GLM_GTX_matrix_query extension. diff --git a/glm/gtx/rotate_normalized_axis.inl b/glm/gtx/rotate_normalized_axis.inl index 343f9185..a7297225 100644 --- a/glm/gtx/rotate_normalized_axis.inl +++ b/glm/gtx/rotate_normalized_axis.inl @@ -74,7 +74,7 @@ namespace glm GLM_FUNC_QUALIFIER detail::tquat rotateNormalizedAxis ( detail::tquat const & q, - typename detail::tquat::T const & angle, + T const & angle, detail::tvec3 const & v ) { @@ -88,7 +88,7 @@ namespace glm #endif T const Sin = sin(AngleRad * T(0.5)); - return q * detail::tquat(cos(AngleRad * T(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); + return q * detail::tquat(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); //return gtc::quaternion::cross(q, detail::tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); } }//namespace glm diff --git a/glm/gtx/vector_query.hpp b/glm/gtx/vector_query.hpp index 724f68e6..b87cf8ef 100644 --- a/glm/gtx/vector_query.hpp +++ b/glm/gtx/vector_query.hpp @@ -58,7 +58,7 @@ namespace glm bool areCollinear( genType const & v0, genType const & v1, - typename genType::T const & epsilon); + typename genType::value_type const & epsilon); //! Check whether two vectors are orthogonals. /// @see gtx_vector_query extensions. @@ -66,7 +66,7 @@ namespace glm bool areOrthogonal( genType const & v0, genType const & v1, - typename genType::T const & epsilon); + typename genType::value_type const & epsilon); //! Check whether a vector is normalized. /// @see gtx_vector_query extensions. @@ -102,7 +102,7 @@ namespace glm bool areOrthonormal( genType const & v0, genType const & v1, - typename genType::T const & epsilon); + typename genType::value_type const & epsilon); /// @} }// namespace glm diff --git a/readme.txt b/readme.txt index b0d6355c..db80575d 100644 --- a/readme.txt +++ b/readme.txt @@ -43,8 +43,7 @@ GLM 0.9.5.1: 2014-XX-XX - Deprecated degrees for function parameters and display a message - Added possible static_cast conversion of GLM types (#72) - Fixed error 'inverse' is not a member of 'glm' from glm::unProject (#146) -- Fixed mismatch of GTC_packing declaration and definition prototypes -- Fixed rotate declaration for quat rotate function +- Fixed mismatch between some declarations and definitions ================================================================================ GLM 0.9.5.0: 2013-12-25