diff --git a/doc/glm.docx b/doc/glm.docx index 6fec4de4..4ea8fca2 100644 Binary files a/doc/glm.docx and b/doc/glm.docx differ diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 9a9ecf7e..2d346d09 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -82,7 +82,7 @@ namespace detail GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, vecType const & a) { vecType Result; - for(length_t i = 0; i < x.length(); ++i) + for(length_t i = 0; i < detail::component_count(x); ++i) Result[i] = a[i] ? y[i] : x[i]; return Result; } diff --git a/glm/detail/func_matrix.inl b/glm/detail/func_matrix.inl index 6a3b3099..17602397 100644 --- a/glm/detail/func_matrix.inl +++ b/glm/detail/func_matrix.inl @@ -60,7 +60,7 @@ namespace detail GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(tvec3 const & c, tvec3 const & r) { tmat3x3 m(tmat3x3::_null); - for(length_t i(0); i < m.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) m[i] = c * r[i]; return m; } @@ -72,7 +72,7 @@ namespace detail GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(tvec4 const & c, tvec4 const & r) { tmat4x4 m(tmat4x4::_null); - for(length_t i(0); i < m.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) m[i] = c * r[i]; return m; } @@ -424,7 +424,7 @@ namespace detail GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'matrixCompMult' only accept floating-point inputs"); matType result(matType::_null); - for(length_t i = 0; i < result.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(result); ++i) result[i] = x[i] * y[i]; return result; } diff --git a/glm/detail/func_vector_relational.inl b/glm/detail/func_vector_relational.inl index 5202bcc1..20645801 100644 --- a/glm/detail/func_vector_relational.inl +++ b/glm/detail/func_vector_relational.inl @@ -39,10 +39,10 @@ namespace glm { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "Invalid template instantiation of 'lessThan', GLM vector types required floating-point or integer value types vectors"); - assert(x.length() == y.length()); + assert(detail::component_count(x) == detail::component_count(y)); typename vecType::bool_type Result(vecType::_null); - for(int i = 0; i < x.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] < y[i]; return Result; @@ -57,10 +57,10 @@ namespace glm { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "Invalid template instantiation of 'lessThanEqual', GLM vector types required floating-point or integer value types vectors"); - assert(x.length() == y.length()); + assert(detail::component_count(x) == detail::component_count(y)); typename vecType::bool_type Result(vecType::_null); - for(int i = 0; i < x.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] <= y[i]; return Result; } @@ -74,10 +74,10 @@ namespace glm { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "Invalid template instantiation of 'greaterThan', GLM vector types required floating-point or integer value types vectors"); - assert(x.length() == y.length()); + assert(detail::component_count(x) == detail::component_count(y)); typename vecType::bool_type Result(vecType::_null); - for(int i = 0; i < x.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] > y[i]; return Result; } @@ -91,10 +91,10 @@ namespace glm { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "Invalid template instantiation of 'greaterThanEqual', GLM vector types required floating-point or integer value types vectors"); - assert(x.length() == y.length()); + assert(detail::component_count(x) == detail::component_count(y)); typename vecType::bool_type Result(vecType::_null); - for(int i = 0; i < x.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] >= y[i]; return Result; } @@ -106,10 +106,10 @@ namespace glm vecType const & y ) { - assert(x.length() == y.length()); + assert(detail::component_count(x) == detail::component_count(y)); typename vecType::bool_type Result(vecType::_null); - for(int i = 0; i < x.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] == y[i]; return Result; } @@ -121,10 +121,10 @@ namespace glm vecType const & y ) { - assert(x.length() == y.length()); + assert(detail::component_count(x) == detail::component_count(y)); typename vecType::bool_type Result(vecType::_null); - for(int i = 0; i < x.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] != y[i]; return Result; } @@ -133,7 +133,7 @@ namespace glm GLM_FUNC_QUALIFIER bool any(vecType const & v) { bool Result = false; - for(int i = 0; i < v.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) Result = Result || v[i]; return Result; } @@ -142,7 +142,7 @@ namespace glm GLM_FUNC_QUALIFIER bool all(vecType const & v) { bool Result = true; - for(int i = 0; i < v.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) Result = Result && v[i]; return Result; } @@ -151,7 +151,7 @@ namespace glm GLM_FUNC_QUALIFIER vecType not_(vecType const & v) { typename vecType::bool_type Result(vecType::_null); - for(int i = 0; i < v.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) Result[i] = !v[i]; return Result; } diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index f46cb703..935a1f58 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -757,31 +757,6 @@ # endif #endif//GLM_MESSAGE -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Length type - -// User defines: GLM_FORCE_SIZE_T_LENGTH GLM_FORCE_SIZE_FUNC - -namespace glm -{ - typedef std::size_t size_t; -#if defined(GLM_FORCE_SIZE_T_LENGTH) || defined(GLM_FORCE_SIZE_FUNC) - typedef std::size_t length_t; -#else - typedef int length_t; -#endif -}//namespace glm - -#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_FORCE_SIZE_T_LENGTH)) -# define GLM_MESSAGE_FORCE_SIZE_T_LENGTH -# if defined(GLM_FORCE_SIZE_T_LENGTH) -# pragma message("GLM: .length() returns glm::length_t, a typedef of std::size_t") -# else -# pragma message("GLM: .length() returns glm::length_t, a typedef of int following the GLSL specification") -# pragma message("GLM: #define GLM_FORCE_SIZE_T_LENGTH for .length() to return a std::size_t") -# endif -#endif//GLM_MESSAGE - /////////////////////////////////////////////////////////////////////////////////////////////////// // Qualifiers @@ -816,3 +791,47 @@ namespace glm #else # define GLM_CONSTEXPR #endif + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Length type + +// User defines: GLM_FORCE_SIZE_T_LENGTH GLM_FORCE_SIZE_FUNC + +namespace glm +{ + typedef std::size_t size_t; +#if defined(GLM_FORCE_SIZE_T_LENGTH) || defined(GLM_FORCE_SIZE_FUNC) + typedef size_t length_t; +#else + typedef int length_t; +#endif + +namespace detail +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t component_count(genType const & m) + { +# if GLM_FORCE_SIZE_FUNC + return m.size(); +# else + return m.length(); +# endif + } + +# if GLM_FORCE_SIZE_FUNC + typedef size_t component_count_t; +# else + typedef length_t component_count_t; +# endif +}//namespace detail +}//namespace glm + +#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_FORCE_SIZE_T_LENGTH)) +# define GLM_MESSAGE_FORCE_SIZE_T_LENGTH +# if defined(GLM_FORCE_SIZE_T_LENGTH) +# pragma message("GLM: .length() returns glm::length_t, a typedef of std::size_t") +# else +# pragma message("GLM: .length() returns glm::length_t, a typedef of int following the GLSL specification") +# pragma message("GLM: #define GLM_FORCE_SIZE_T_LENGTH for .length() to return a size_t") +# endif +#endif//GLM_MESSAGE diff --git a/glm/detail/type_mat.inl b/glm/detail/type_mat.inl index fd7e1208..620b6d9c 100644 --- a/glm/detail/type_mat.inl +++ b/glm/detail/type_mat.inl @@ -25,3 +25,4 @@ /// @date 2011-06-15 / 2011-06-15 /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// + diff --git a/glm/ext.hpp b/glm/ext.hpp index fba4c0c5..59d70512 100644 --- a/glm/ext.hpp +++ b/glm/ext.hpp @@ -76,6 +76,7 @@ #include "./gtc/type_precision.hpp" #include "./gtc/type_ptr.hpp" #include "./gtc/ulp.hpp" +#include "./gtc/vec1.hpp" #include "./gtx/associated_min_max.hpp" #include "./gtx/bit.hpp" @@ -123,7 +124,6 @@ #endif #include "./gtx/transform.hpp" #include "./gtx/transform2.hpp" -#include "./gtx/vec1.hpp" #include "./gtx/vector_angle.hpp" #include "./gtx/vector_query.hpp" #include "./gtx/wrap.hpp" diff --git a/glm/gtc/matrix_access.inl b/glm/gtc/matrix_access.inl index cc7b9a32..bd6907ab 100644 --- a/glm/gtc/matrix_access.inl +++ b/glm/gtc/matrix_access.inl @@ -36,10 +36,10 @@ namespace glm typename genType::row_type const & x ) { - assert(index >= 0 && index < m[0].length()); + assert(index >= 0 && static_cast(index) < detail::component_count(m[0])); genType Result = m; - for(length_t i = 0; i < m.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) Result[i][index] = x[i]; return Result; } @@ -51,10 +51,10 @@ namespace glm length_t const & index ) { - assert(index >= 0 && index < m[0].length()); + assert(index >= 0 && static_cast(index) < detail::component_count(m[0])); typename genType::row_type Result; - for(length_t i = 0; i < m.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) Result[i] = m[i][index]; return Result; } @@ -67,7 +67,7 @@ namespace glm typename genType::col_type const & x ) { - assert(index >= 0 && index < m.length()); + assert(index >= 0 && static_cast(index) < detail::component_count(m)); genType Result = m; Result[index] = x; @@ -81,7 +81,7 @@ namespace glm length_t const & index ) { - assert(index >= 0 && index < m.length()); + assert(index >= 0 && static_cast(index) < detail::component_count(m)); return m[index]; } diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 6ac9812d..a16a761e 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -58,7 +58,7 @@ namespace glm template struct tquat { - enum ctor{null}; + enum ctor{_null}; typedef T value_type; typedef tvec4 bool_type; @@ -74,19 +74,20 @@ namespace glm GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const; #endif//GLM_FORCE_SIZE_FUNC - // Constructors + ////////////////////////////////////// + // Implicit basic constructors + GLM_FUNC_DECL tquat(); - template - GLM_FUNC_DECL explicit tquat( - tquat const & q); - GLM_FUNC_DECL tquat( - T const & s, - tvec3 const & v); - GLM_FUNC_DECL tquat( - T const & w, - T const & x, - T const & y, - T const & z); + GLM_FUNC_DECL tquat(tquat const & q); + template + GLM_FUNC_DECL tquat(tquat const & q); + + ////////////////////////////////////// + // Explicit basic constructors + + GLM_FUNC_DECL explicit tquat(ctor); + GLM_FUNC_DECL explicit tquat(T const & s, tvec3 const & v); + GLM_FUNC_DECL tquat(T const & w, T const & x, T const & y, T const & z); // Convertions diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 484dc5ed..01513156 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -68,10 +68,9 @@ namespace detail {} template - template GLM_FUNC_QUALIFIER tquat::tquat ( - tquat const & q + tquat const & q ) : x(q.x), y(q.y), @@ -79,6 +78,22 @@ namespace detail w(q.w) {} + template + template + GLM_FUNC_QUALIFIER tquat::tquat + ( + tquat const & q + ) : + x(q.x), + y(q.y), + z(q.z), + w(q.w) + {} + + template + GLM_FUNC_QUALIFIER tquat::tquat(ctor) + {} + template GLM_FUNC_QUALIFIER tquat::tquat ( @@ -731,7 +746,7 @@ namespace detail T biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5); T mult = static_cast(0.25) / biggestVal; - tquat Result; + tquat Result(tquat::_null); switch(biggestIndex) { case 0: @@ -804,16 +819,16 @@ namespace detail tvec3 const & v ) { - tquat result; + tquat Result(tquat::_null); T const a(angle); T const s = glm::sin(a * static_cast(0.5)); - result.w = glm::cos(a * static_cast(0.5)); - result.x = v.x * s; - result.y = v.y * s; - result.z = v.z * s; - return result; + Result.w = glm::cos(a * static_cast(0.5)); + Result.x = v.x * s; + Result.y = v.y * s; + Result.z = v.z * s; + return Result; } template @@ -823,8 +838,8 @@ namespace detail tquat const & y ) { - tvec4 Result; - for(length_t i = 0; i < x.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] < y[i]; return Result; } @@ -836,8 +851,8 @@ namespace detail tquat const & y ) { - tvec4 Result; - for(length_t i = 0; i < x.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] <= y[i]; return Result; } @@ -849,8 +864,8 @@ namespace detail tquat const & y ) { - tvec4 Result; - for(length_t i = 0; i < x.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] > y[i]; return Result; } @@ -862,8 +877,8 @@ namespace detail tquat const & y ) { - tvec4 Result; - for(length_t i = 0; i < x.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] >= y[i]; return Result; } @@ -875,8 +890,8 @@ namespace detail tquat const & y ) { - tvec4 Result; - for(length_t i = 0; i < x.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] == y[i]; return Result; } @@ -888,8 +903,8 @@ namespace detail tquat const & y ) { - tvec4 Result; - for(length_t i = 0; i < x.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] != y[i]; return Result; } diff --git a/glm/gtc/ulp.inl b/glm/gtc/ulp.inl index be2770f9..aefd7cfc 100644 --- a/glm/gtc/ulp.inl +++ b/glm/gtc/ulp.inl @@ -227,8 +227,8 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType next_float(vecType const & x) { - vecType Result; - for(length_t i = 0; i < Result.length(); ++i) + vecType Result(vecType::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = next_float(x[i]); return Result; } @@ -262,8 +262,8 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType prev_float(vecType const & x) { - vecType Result; - for(length_t i = 0; i < Result.length(); ++i) + vecType Result(vecType::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = prev_float(x[i]); return Result; } @@ -280,8 +280,8 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType next_float(vecType const & x, vecType const & ulps) { - vecType Result; - for(length_t i = 0; i < Result.length(); ++i) + vecType Result(vecType::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = next_float(x[i], ulps[i]); return Result; } @@ -298,8 +298,8 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType prev_float(vecType const & x, vecType const & ulps) { - vecType Result; - for(length_t i = 0; i < Result.length(); ++i) + vecType Result(vecType::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = prev_float(x[i], ulps[i]); return Result; } @@ -338,8 +338,8 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType float_distance(vecType const & x, vecType const & y) { - vecType Result; - for(length_t i = 0; i < Result.length(); ++i) + vecType Result(vecType::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = float_distance(x[i], y[i]); return Result; } diff --git a/glm/gtx/vec1.hpp b/glm/gtc/vec1.hpp similarity index 100% rename from glm/gtx/vec1.hpp rename to glm/gtc/vec1.hpp diff --git a/glm/gtx/vec1.inl b/glm/gtc/vec1.inl similarity index 100% rename from glm/gtx/vec1.inl rename to glm/gtc/vec1.inl diff --git a/glm/gtx/associated_min_max.inl b/glm/gtx/associated_min_max.inl index 9603d615..cbb60c79 100644 --- a/glm/gtx/associated_min_max.inl +++ b/glm/gtx/associated_min_max.inl @@ -23,10 +23,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMin const tvec2& y, const tvec2& b ) { - tvec2 Result; - //Result.x = x[0] < y[0] ? a[0] : b[0]; - //Result.y = x[1] < y[1] ? a[1] : b[1]; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] < y[i] ? a[i] : b[i]; return Result; } @@ -38,8 +36,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMin const tvec3& y, const tvec3& b ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] < y[i] ? a[i] : b[i]; return Result; } @@ -51,8 +49,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMin const tvec4& y, const tvec4& b ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] < y[i] ? a[i] : b[i]; return Result; } @@ -64,8 +62,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMin T y, const tvec2& b ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x < y ? a[i] : b[i]; return Result; } @@ -77,8 +75,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMin T y, const tvec3& b ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x < y ? a[i] : b[i]; return Result; } @@ -90,8 +88,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMin T y, const tvec4& b ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x < y ? a[i] : b[i]; return Result; } @@ -103,8 +101,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMin tvec2 const & y, U b ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] < y[i] ? a : b; return Result; } @@ -112,12 +110,12 @@ GLM_FUNC_QUALIFIER tvec2 associatedMin template GLM_FUNC_QUALIFIER tvec3 associatedMin ( - const tvec3& x, U a, - const tvec3& y, U b + tvec3 const & x, U a, + tvec3 const & y, U b ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] < y[i] ? a : b; return Result; } @@ -129,8 +127,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMin const tvec4& y, U b ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] < y[i] ? a : b; return Result; } @@ -156,8 +154,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMin const tvec2& z, const tvec2& c ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); return Result; } @@ -170,8 +168,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMin const tvec3& z, const tvec3& c ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); return Result; } @@ -184,8 +182,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMin const tvec4& z, const tvec4& c ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); return Result; } @@ -218,8 +216,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMin const tvec2& w, const tvec2& d ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = min(x[i], y[i]); T Test2 = min(z[i], w[i]); @@ -240,8 +238,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMin const tvec3& w, const tvec3& d ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = min(x[i], y[i]); T Test2 = min(z[i], w[i]); @@ -262,8 +260,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMin const tvec4& w, const tvec4& d ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = min(x[i], y[i]); T Test2 = min(z[i], w[i]); @@ -287,8 +285,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMin T Test1 = min(x, y); T Test2 = min(z, w); - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { U Result1 = x < y ? a[i] : b[i]; U Result2 = z < w ? c[i] : d[i]; @@ -310,8 +308,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMin T Test1 = min(x, y); T Test2 = min(z, w); - tvec3 Result; - for(typename tvec3::size_type i = 0; i < tvec3::value_size; ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { U Result1 = x < y ? a[i] : b[i]; U Result2 = z < w ? c[i] : d[i]; @@ -333,8 +331,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMin T Test1 = min(x, y); T Test2 = min(z, w); - tvec4 Result; - for(typename tvec4::size_type i = 0; i < tvec4::value_size; ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { U Result1 = x < y ? a[i] : b[i]; U Result2 = z < w ? c[i] : d[i]; @@ -353,8 +351,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMin const tvec2& w, U d ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < tvec2::value_size(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = min(x[i], y[i]); T Test2 = min(z[i], w[i]);; @@ -375,8 +373,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMin const tvec3& w, U d ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < tvec3::value_size(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = min(x[i], y[i]); T Test2 = min(z[i], w[i]);; @@ -397,8 +395,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMin const tvec4& w, U d ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < tvec4::value_size(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = min(x[i], y[i]); T Test2 = min(z[i], w[i]);; @@ -424,8 +422,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMax const tvec2& y, const tvec2& b ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? a[i] : b[i]; return Result; } @@ -438,8 +436,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMax const tvec3& y, const tvec3& b ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? a[i] : b[i]; return Result; } @@ -452,8 +450,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMax const tvec4& y, const tvec4& b ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? a[i] : b[i]; return Result; } @@ -466,8 +464,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMax T y, const tvec2& b ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x > y ? a[i] : b[i]; return Result; } @@ -480,8 +478,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMax T y, const tvec3& b ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x > y ? a[i] : b[i]; return Result; } @@ -494,8 +492,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMax T y, const tvec4& b ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x > y ? a[i] : b[i]; return Result; } @@ -508,8 +506,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMax const tvec2& y, U b ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? a : b; return Result; } @@ -522,8 +520,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMax const tvec3& y, U b ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? a : b; return Result; } @@ -536,8 +534,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMax const tvec4& y, U b ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? a : b; return Result; } @@ -564,8 +562,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMax const tvec2& z, const tvec2& c ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); return Result; } @@ -579,8 +577,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMax const tvec3& z, const tvec3& c ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); return Result; } @@ -594,8 +592,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMax const tvec4& z, const tvec4& c ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); return Result; } @@ -609,8 +607,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMax T z, const tvec2& c ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); return Result; } @@ -624,8 +622,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMax T z, const tvec3& c ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); return Result; } @@ -639,8 +637,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMax T z, const tvec4& c ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); return Result; } @@ -654,8 +652,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMax const tvec2& z, U c ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); return Result; } @@ -669,8 +667,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMax const tvec3& z, U c ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); return Result; } @@ -684,8 +682,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMax const tvec4& z, U c ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); return Result; } @@ -718,8 +716,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMax const tvec2& w, const tvec2& d ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = max(x[i], y[i]); T Test2 = max(z[i], w[i]); @@ -740,8 +738,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMax const tvec3& w, const tvec3& d ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = max(x[i], y[i]); T Test2 = max(z[i], w[i]); @@ -762,8 +760,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMax const tvec4& w, const tvec4& d ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = max(x[i], y[i]); T Test2 = max(z[i], w[i]); @@ -787,8 +785,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMax T Test1 = max(x, y); T Test2 = max(z, w); - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { U Result1 = x > y ? a[i] : b[i]; U Result2 = z > w ? c[i] : d[i]; @@ -810,8 +808,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMax T Test1 = max(x, y); T Test2 = max(z, w); - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { U Result1 = x > y ? a[i] : b[i]; U Result2 = z > w ? c[i] : d[i]; @@ -833,8 +831,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMax T Test1 = max(x, y); T Test2 = max(z, w); - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { U Result1 = x > y ? a[i] : b[i]; U Result2 = z > w ? c[i] : d[i]; @@ -853,8 +851,8 @@ GLM_FUNC_QUALIFIER tvec2 associatedMax const tvec2& w, U d ) { - tvec2 Result; - for(typename tvec2::size_type i = 0; i < Result.length(); ++i) + tvec2 Result(tvec2::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = max(x[i], y[i]); T Test2 = max(z[i], w[i]);; @@ -875,8 +873,8 @@ GLM_FUNC_QUALIFIER tvec3 associatedMax const tvec3& w, U d ) { - tvec3 Result; - for(typename tvec3::size_type i = 0; i < Result.length(); ++i) + tvec3 Result(tvec3::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = max(x[i], y[i]); T Test2 = max(z[i], w[i]);; @@ -897,8 +895,8 @@ GLM_FUNC_QUALIFIER tvec4 associatedMax const tvec4& w, U d ) { - tvec4 Result; - for(typename tvec4::size_type i = 0; i < Result.length(); ++i) + tvec4 Result(tvec4::_null); + for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = max(x[i], y[i]); T Test2 = max(z[i], w[i]);; diff --git a/glm/gtx/common.hpp b/glm/gtx/common.hpp index da035553..0d7aaff5 100644 --- a/glm/gtx/common.hpp +++ b/glm/gtx/common.hpp @@ -42,7 +42,7 @@ #include "../vec2.hpp" #include "../vec3.hpp" #include "../vec4.hpp" -#include "../gtx/vec1.hpp" +#include "../gtc/vec1.hpp" #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) # pragma message("GLM: GLM_GTX_common extension included") diff --git a/glm/gtx/component_wise.inl b/glm/gtx/component_wise.inl index fd1c1d4d..89c5ac7f 100644 --- a/glm/gtx/component_wise.inl +++ b/glm/gtx/component_wise.inl @@ -13,7 +13,7 @@ namespace glm GLM_FUNC_QUALIFIER T compAdd(vecType const & v) { T result(0); - for(length_t i = 0; i < v.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) result += v[i]; return result; } @@ -22,7 +22,7 @@ namespace glm GLM_FUNC_QUALIFIER T compMul(vecType const & v) { T result(1); - for(length_t i = 0; i < v.length(); ++i) + for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) result *= v[i]; return result; } @@ -31,7 +31,7 @@ namespace glm GLM_FUNC_QUALIFIER T compMin(vecType const & v) { T result(v[0]); - for(length_t i = 1; i < v.length(); ++i) + for(detail::component_count_t i = 1; i < detail::component_count(v); ++i) result = min(result, v[i]); return result; } @@ -40,7 +40,7 @@ namespace glm GLM_FUNC_QUALIFIER T compMax(vecType const & v) { T result(v[0]); - for(length_t i = 1; i < v.length(); ++i) + for(detail::component_count_t i = 1; i < detail::component_count(v); ++i) result = max(result, v[i]); return result; } diff --git a/glm/gtx/matrix_query.inl b/glm/gtx/matrix_query.inl index ef795d31..f3dc9208 100644 --- a/glm/gtx/matrix_query.inl +++ b/glm/gtx/matrix_query.inl @@ -16,7 +16,7 @@ namespace glm GLM_FUNC_QUALIFIER bool isNull(tmat2x2 const & m, T const & epsilon) { bool result = true; - for(length_t i = 0; result && i < 2 ; ++i) + for(detail::component_count_t i = 0; result && i < 2 ; ++i) result = isNull(m[i], epsilon); return result; } @@ -25,7 +25,7 @@ namespace glm GLM_FUNC_QUALIFIER bool isNull(tmat3x3 const & m, T const & epsilon) { bool result = true; - for(length_t i = 0; result && i < 3 ; ++i) + for(detail::component_count_t i = 0; result && i < 3 ; ++i) result = isNull(m[i], epsilon); return result; } @@ -34,7 +34,7 @@ namespace glm GLM_FUNC_QUALIFIER bool isNull(tmat4x4 const & m, T const & epsilon) { bool result = true; - for(length_t i = 0; result && i < 4 ; ++i) + for(detail::component_count_t i = 0; result && i < 4 ; ++i) result = isNull(m[i], epsilon); return result; } @@ -43,13 +43,13 @@ namespace glm GLM_FUNC_QUALIFIER bool isIdentity(matType const & m, T const & epsilon) { bool result = true; - for(length_t i(0); result && i < m[0].length(); ++i) + for(detail::component_count_t i(0); result && i < detail::component_count(m[0]); ++i) { - for(length_t j(0); result && j < i ; ++j) + for(detail::component_count_t j(0); result && j < i ; ++j) result = abs(m[i][j]) <= epsilon; if(result) result = abs(m[i][i] - 1) <= epsilon; - for(length_t j(i + 1); result && j < m.length(); ++j) + for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j) result = abs(m[i][j]) <= epsilon; } return result; @@ -59,12 +59,12 @@ namespace glm GLM_FUNC_QUALIFIER bool isNormalized(tmat2x2 const & m, T const & epsilon) { bool result(true); - for(length_t i(0); result && i < m.length(); ++i) + for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) result = isNormalized(m[i], epsilon); - for(length_t i(0); result && i < m.length(); ++i) + for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) { typename tmat2x2::col_type v; - for(length_t j(0); j < m.length(); ++j) + for(detail::component_count_t j(0); j < detail::component_count(m); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); } @@ -75,12 +75,12 @@ namespace glm GLM_FUNC_QUALIFIER bool isNormalized(tmat3x3 const & m, T const & epsilon) { bool result(true); - for(length_t i(0); result && i < m.length(); ++i) + for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) result = isNormalized(m[i], epsilon); - for(length_t i(0); result && i < m.length(); ++i) + for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) { typename tmat3x3::col_type v; - for(length_t j(0); j < m.length(); ++j) + for(detail::component_count_t j(0); j < detail::component_count(m); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); } @@ -91,12 +91,12 @@ namespace glm GLM_FUNC_QUALIFIER bool isNormalized(tmat4x4 const & m, T const & epsilon) { bool result(true); - for(length_t i(0); result && i < m.length(); ++i) + for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) result = isNormalized(m[i], epsilon); - for(length_t i(0); result && i < m.length(); ++i) + for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) { typename tmat4x4::col_type v; - for(length_t j(0); j < m.length(); ++j) + for(detail::component_count_t j(0); j < detail::component_count(m); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); } @@ -107,15 +107,15 @@ namespace glm GLM_FUNC_QUALIFIER bool isOrthogonal(matType const & m, T const & epsilon) { bool result(true); - for(length_t i(0); result && i < m.length() - 1; ++i) - for(length_t j(i + 1); result && j < m.length(); ++j) + for(detail::component_count_t i(0); result && i < detail::component_count(m) - 1; ++i) + for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j) result = areOrthogonal(m[i], m[j], epsilon); if(result) { matType tmp = transpose(m); - for(length_t i(0); result && i < m.length() - 1 ; ++i) - for(length_t j(i + 1); result && j < m.length(); ++j) + for(detail::component_count_t i(0); result && i < detail::component_count(m) - 1 ; ++i) + for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j) result = areOrthogonal(tmp[i], tmp[j], epsilon); } return result; diff --git a/glm/gtx/range.hpp b/glm/gtx/range.hpp index ac5f9339..d86161ba 100644 --- a/glm/gtx/range.hpp +++ b/glm/gtx/range.hpp @@ -45,32 +45,32 @@ namespace glm /* The glm types provide a .length() member, but for matrices this only defines the number of columns, so we need to work around this */ template - length_t number_of_elements_(tvec2 const & v){ - return v.length(); + detail::component_count_t number_of_elements_(tvec2 const & v){ + return detail::component_count(v); } template - length_t number_of_elements_(tvec3 const & v){ - return v.length(); + detail::component_count_t number_of_elements_(tvec3 const & v){ + return detail::component_count(v); } template - length_t number_of_elements_(tvec4 const & v){ - return v.length(); + detail::component_count_t number_of_elements_(tvec4 const & v){ + return detail::component_count(v); } template - length_t number_of_elements_(genType const & v){ - return v.length() * v[0].length(); + detail::component_count_t number_of_elements_(genType const & m){ + return detail::component_count(m) * detail::component_count(m[0]); } template - const typename genType::value_type * begin(const genType& v){ + const typename genType::value_type * begin(genType const & v){ return value_ptr(v); } template - const typename genType::value_type * end(const genType& v){ + const typename genType::value_type * end(genType const & v){ return begin(v) + number_of_elements_(v); } diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index b08da197..b5ebbf71 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -12,7 +12,7 @@ //#include #include #include -#include +#include #include #include diff --git a/test/core/core_func_exponential.cpp b/test/core/core_func_exponential.cpp index 33f16fc7..8eeaa302 100644 --- a/test/core/core_func_exponential.cpp +++ b/test/core/core_func_exponential.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include int test_pow() { diff --git a/test/core/core_type_mat2x2.cpp b/test/core/core_type_mat2x2.cpp index e777dfa2..6c6e5b5d 100644 --- a/test/core/core_type_mat2x2.cpp +++ b/test/core/core_type_mat2x2.cpp @@ -60,7 +60,7 @@ int test_ctr() { int Error(0); -#if(GLM_HAS_INITIALIZER_LISTS) +#if GLM_HAS_INITIALIZER_LISTS glm::mat2x2 m0( glm::vec2(0, 1), glm::vec2(2, 3)); diff --git a/test/core/core_type_mat2x3.cpp b/test/core/core_type_mat2x3.cpp index 68415c9d..1106b625 100644 --- a/test/core/core_type_mat2x3.cpp +++ b/test/core/core_type_mat2x3.cpp @@ -34,7 +34,7 @@ int test_ctr() { int Error(0); -#if(GLM_HAS_INITIALIZER_LISTS) +#if GLM_HAS_INITIALIZER_LISTS glm::mat2x3 m0( glm::vec3(0, 1, 2), glm::vec3(3, 4, 5)); diff --git a/test/core/core_type_vec1.cpp b/test/core/core_type_vec1.cpp index 3a08c1a7..7b9c90fb 100644 --- a/test/core/core_type_vec1.cpp +++ b/test/core/core_type_vec1.cpp @@ -1,14 +1,14 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 +// Created : 2014-10-11 +// Updated : 2014-10-11 // Licence : This source is under MIT License // File : test/core/type_vec1.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// #define GLM_SWIZZLE -#include +#include int test_operators() { diff --git a/test/gtc/CMakeLists.txt b/test/gtc/CMakeLists.txt index 895a99f0..b3d61b0d 100644 --- a/test/gtc/CMakeLists.txt +++ b/test/gtc/CMakeLists.txt @@ -12,3 +12,4 @@ glmCreateTestGTC(gtc_reciprocal) glmCreateTestGTC(gtc_type_precision) glmCreateTestGTC(gtc_type_ptr) glmCreateTestGTC(gtc_ulp) +glmCreateTestGTC(gtc_vec1) diff --git a/test/gtc/gtc_quaternion.cpp b/test/gtc/gtc_quaternion.cpp index 9b98018c..a78d06cf 100644 --- a/test/gtc/gtc_quaternion.cpp +++ b/test/gtc/gtc_quaternion.cpp @@ -273,7 +273,7 @@ int test_quat_ctr() { int Error(0); -# if(GLM_HAS_INITIALIZER_LISTS) +# if GLM_HAS_INITIALIZER_LISTS { glm::quat A{0, 1, 2, 3}; diff --git a/test/gtc/gtc_vec1.cpp b/test/gtc/gtc_vec1.cpp new file mode 100644 index 00000000..129c76f0 --- /dev/null +++ b/test/gtc/gtc_vec1.cpp @@ -0,0 +1,17 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2014-10-11 +// Updated : 2014-10-11 +// Licence : This source is under MIT License +// File : test/gtc/vec1.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +int main() +{ + int Error = 0; + + return Error; +} diff --git a/test/gtx/gtx_common.cpp b/test/gtx/gtx_common.cpp index 2bd3b025..8f06dcd7 100644 --- a/test/gtx/gtx_common.cpp +++ b/test/gtx/gtx_common.cpp @@ -8,7 +8,6 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// #include -#include int test_isdenormal() {