diff --git a/doc/glm.docx b/doc/glm.docx index 4ea8fca2..299f1bba 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 c611c609..527c80ad 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -81,7 +81,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, vecType const & a) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_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 17602397..edf2cfe1 100644 --- a/glm/detail/func_matrix.inl +++ b/glm/detail/func_matrix.inl @@ -45,7 +45,7 @@ namespace detail { GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(tvec2 const & c, tvec2 const & r) { - tmat2x2 m(tmat2x2::_null); + tmat2x2 m(uninitialize); m[0][0] = c[0] * r[0]; m[0][1] = c[1] * r[0]; m[1][0] = c[0] * r[1]; @@ -59,7 +59,7 @@ namespace detail { GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(tvec3 const & c, tvec3 const & r) { - tmat3x3 m(tmat3x3::_null); + tmat3x3 m(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) m[i] = c * r[i]; return m; @@ -71,7 +71,7 @@ namespace detail { GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(tvec4 const & c, tvec4 const & r) { - tmat4x4 m(tmat4x4::_null); + tmat4x4 m(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) m[i] = c * r[i]; return m; @@ -83,7 +83,7 @@ namespace detail { GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(tvec3 const & c, tvec2 const & r) { - tmat2x3 m(tmat2x3::_null); + tmat2x3 m(uninitialize); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[0][2] = c.z * r.x; @@ -99,7 +99,7 @@ namespace detail { GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(tvec2 const & c, tvec3 const & r) { - tmat3x2 m(tmat3x2::_null); + tmat3x2 m(uninitialize); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[1][0] = c.x * r.y; @@ -115,7 +115,7 @@ namespace detail { GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(tvec4 const & c, tvec2 const & r) { - tmat2x4 m(tmat2x4::_null); + tmat2x4 m(uninitialize); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[0][2] = c.z * r.x; @@ -133,7 +133,7 @@ namespace detail { GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(tvec2 const & c, tvec4 const & r) { - tmat4x2 m(tmat4x2::_null); + tmat4x2 m(uninitialize); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[1][0] = c.x * r.y; @@ -151,7 +151,7 @@ namespace detail { GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(tvec4 const & c, tvec3 const & r) { - tmat3x4 m(tmat3x4::_null); + tmat3x4 m(uninitialize); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[0][2] = c.z * r.x; @@ -173,7 +173,7 @@ namespace detail { GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(tvec3 const & c, tvec4 const & r) { - tmat4x3 m(tmat4x3::_null); + tmat4x3 m(uninitialize); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[0][2] = c.z * r.x; @@ -198,7 +198,7 @@ namespace detail { GLM_FUNC_QUALIFIER static tmat2x2 call(tmat2x2 const & m) { - tmat2x2 result(tmat2x2::_null); + tmat2x2 result(uninitialize); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[1][0] = m[0][1]; @@ -212,7 +212,7 @@ namespace detail { GLM_FUNC_QUALIFIER static tmat3x2 call(tmat2x3 const & m) { - tmat3x2 result(tmat3x2::_null); + tmat3x2 result(uninitialize); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[1][0] = m[0][1]; @@ -228,7 +228,7 @@ namespace detail { GLM_FUNC_QUALIFIER static tmat4x2 call(tmat2x4 const & m) { - tmat4x2 result(tmat4x2::_null); + tmat4x2 result(uninitialize); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[1][0] = m[0][1]; @@ -246,7 +246,7 @@ namespace detail { GLM_FUNC_QUALIFIER static tmat2x3 call(tmat3x2 const & m) { - tmat2x3 result(tmat2x3::_null); + tmat2x3 result(uninitialize); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; @@ -262,7 +262,7 @@ namespace detail { GLM_FUNC_QUALIFIER static tmat3x3 call(tmat3x3 const & m) { - tmat3x3 result(tmat3x3::_null); + tmat3x3 result(uninitialize); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; @@ -283,7 +283,7 @@ namespace detail { GLM_FUNC_QUALIFIER static tmat4x3 call(tmat3x4 const & m) { - tmat4x3 result(tmat4x3::_null); + tmat4x3 result(uninitialize); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; @@ -305,7 +305,7 @@ namespace detail { GLM_FUNC_QUALIFIER static tmat2x4 call(tmat4x2 const & m) { - tmat2x4 result(tmat2x4::_null); + tmat2x4 result(uninitialize); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; @@ -323,7 +323,7 @@ namespace detail { GLM_FUNC_QUALIFIER static tmat3x4 call(tmat4x3 const & m) { - tmat3x4 result(tmat3x4::_null); + tmat3x4 result(uninitialize); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; @@ -345,7 +345,7 @@ namespace detail { GLM_FUNC_QUALIFIER static tmat4x4 call(tmat4x4 const & m) { - tmat4x4 result(tmat4x4::_null); + tmat4x4 result(uninitialize); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; @@ -423,7 +423,7 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'matrixCompMult' only accept floating-point inputs"); - matType result(matType::_null); + matType result(uninitialize); 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 20645801..4e32a8a9 100644 --- a/glm/detail/func_vector_relational.inl +++ b/glm/detail/func_vector_relational.inl @@ -41,7 +41,7 @@ namespace glm "Invalid template instantiation of 'lessThan', GLM vector types required floating-point or integer value types vectors"); assert(detail::component_count(x) == detail::component_count(y)); - typename vecType::bool_type Result(vecType::_null); + typename vecType::bool_type Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] < y[i]; @@ -59,7 +59,7 @@ namespace glm "Invalid template instantiation of 'lessThanEqual', GLM vector types required floating-point or integer value types vectors"); assert(detail::component_count(x) == detail::component_count(y)); - typename vecType::bool_type Result(vecType::_null); + typename vecType::bool_type Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] <= y[i]; return Result; @@ -76,7 +76,7 @@ namespace glm "Invalid template instantiation of 'greaterThan', GLM vector types required floating-point or integer value types vectors"); assert(detail::component_count(x) == detail::component_count(y)); - typename vecType::bool_type Result(vecType::_null); + typename vecType::bool_type Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] > y[i]; return Result; @@ -93,7 +93,7 @@ namespace glm "Invalid template instantiation of 'greaterThanEqual', GLM vector types required floating-point or integer value types vectors"); assert(detail::component_count(x) == detail::component_count(y)); - typename vecType::bool_type Result(vecType::_null); + typename vecType::bool_type Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] >= y[i]; return Result; @@ -108,7 +108,7 @@ namespace glm { assert(detail::component_count(x) == detail::component_count(y)); - typename vecType::bool_type Result(vecType::_null); + typename vecType::bool_type Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] == y[i]; return Result; @@ -123,7 +123,7 @@ namespace glm { assert(detail::component_count(x) == detail::component_count(y)); - typename vecType::bool_type Result(vecType::_null); + typename vecType::bool_type Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] != y[i]; return Result; @@ -150,7 +150,7 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType not_(vecType const & v) { - typename vecType::bool_type Result(vecType::_null); + typename vecType::bool_type Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) Result[i] = !v[i]; return Result; diff --git a/glm/detail/intrinsic_matrix.inl b/glm/detail/intrinsic_matrix.inl index 81f1538d..26c43b38 100644 --- a/glm/detail/intrinsic_matrix.inl +++ b/glm/detail/intrinsic_matrix.inl @@ -1049,7 +1049,7 @@ GLM_FUNC_QUALIFIER void sse_rotate_ps(__m128 const in[4], float Angle, float con Result[2] = TmpC4; Result[3] = _mm_set_ps(1, 0, 0, 0); - //tmat4x4 Result(tmat4x4::_null); + //tmat4x4 Result(uninitialize); //Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; //Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; //Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index c3f2a81f..08aff9b5 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -39,7 +39,6 @@ namespace glm template struct tmat2x2 { - enum ctor{_null}; typedef T value_type; typedef std::size_t size_type; typedef tvec2 col_type; diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index bf80a7f8..3a135de8 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -83,8 +83,10 @@ namespace detail template GLM_FUNC_QUALIFIER tmat2x2::tmat2x2() { - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); +# endif } template diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 73b611f7..7fef267d 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -40,7 +40,6 @@ namespace glm template struct tmat2x3 { - enum ctor{_null}; typedef T value_type; typedef std::size_t size_type; typedef tvec3 col_type; diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index 545c41ee..ef697645 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -73,8 +73,10 @@ namespace glm template GLM_FUNC_QUALIFIER tmat2x3::tmat2x3() { - this->value[0] = col_type(T(1), T(0), T(0)); - this->value[1] = col_type(T(0), T(1), T(0)); +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); +# endif } template @@ -498,7 +500,7 @@ namespace glm T SrcB20 = m2[2][0]; T SrcB21 = m2[2][1]; - tmat3x3 Result(tmat3x3::_null); + tmat3x3 Result(uninitialize); Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index a5bf867f..cc320ec0 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -40,7 +40,6 @@ namespace glm template struct tmat2x4 { - enum ctor{_null}; typedef T value_type; typedef std::size_t size_type; typedef tvec4 col_type; diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 10905fa7..6a734847 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -73,10 +73,10 @@ namespace glm template GLM_FUNC_QUALIFIER tmat2x4::tmat2x4() { - value_type const Zero(0); - value_type const One(1); - this->value[0] = col_type(One, Zero, Zero, Zero); - this->value[1] = col_type(Zero, One, Zero, Zero); +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); +# endif } template @@ -492,7 +492,7 @@ namespace glm T SrcB30 = m2[3][0]; T SrcB31 = m2[3][1]; - tmat4x4 Result(tmat4x4::_null); + tmat4x4 Result(uninitialize); Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index abf1fb73..462f602f 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -40,7 +40,6 @@ namespace glm template struct tmat3x2 { - enum ctor{_null}; typedef T value_type; typedef std::size_t size_type; typedef tvec2 col_type; diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index 3bfae905..4074b78e 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -73,9 +73,11 @@ namespace glm template GLM_FUNC_QUALIFIER tmat3x2::tmat3x2() { - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); - this->value[2] = col_type(0, 0); +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); + this->value[2] = col_type(0, 0); +# endif } template @@ -520,7 +522,7 @@ namespace glm const T SrcB11 = m2[1][1]; const T SrcB12 = m2[1][2]; - tmat2x2 Result(tmat2x2::_null); + tmat2x2 Result(uninitialize); Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 5fd1eb5f..db1fe0cd 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -39,7 +39,6 @@ namespace glm template struct tmat3x3 { - enum ctor{_null}; typedef T value_type; typedef std::size_t size_type; typedef tvec3 col_type; diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index b9ca0b5d..2059e56b 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -37,7 +37,7 @@ namespace detail - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2])); - tmat3x3 Inverse(tmat3x3::_null); + tmat3x3 Inverse(uninitialize); Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * OneOverDeterminant; Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * OneOverDeterminant; Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * OneOverDeterminant; @@ -97,11 +97,11 @@ namespace detail template GLM_FUNC_QUALIFIER tmat3x3::tmat3x3() { - value_type const Zero(0); - value_type const One(1); - this->value[0] = col_type(One, Zero, Zero); - this->value[1] = col_type(Zero, One, Zero); - this->value[2] = col_type(Zero, Zero, One); +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); + this->value[2] = col_type(0, 0, 1); +# endif } template @@ -596,7 +596,7 @@ namespace detail T const SrcB21 = m2[2][1]; T const SrcB22 = m2[2][2]; - tmat3x3 Result(tmat3x3::_null); + tmat3x3 Result(uninitialize); Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index dd5e746d..48f79caf 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -40,7 +40,6 @@ namespace glm template struct tmat3x4 { - enum ctor{_null}; typedef T value_type; typedef size_t size_type; typedef tvec4 col_type; diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index 1d9096db..bfbd2923 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -73,9 +73,11 @@ namespace glm template GLM_FUNC_QUALIFIER tmat3x4::tmat3x4() { - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); - this->value[2] = col_type(0, 0, 1, 0); +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); + this->value[2] = col_type(0, 0, 1, 0); +# endif } template @@ -535,7 +537,7 @@ namespace glm const T SrcB31 = m2[3][1]; const T SrcB32 = m2[3][2]; - tmat4x4 Result(tmat4x4::_null); + tmat4x4 Result(uninitialize); Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index ca3fa591..b67009d0 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -40,7 +40,6 @@ namespace glm template struct tmat4x2 { - enum ctor{_null}; typedef T value_type; typedef std::size_t size_type; typedef tvec2 col_type; diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index 9db63246..c790ee07 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -73,12 +73,12 @@ namespace glm template GLM_FUNC_QUALIFIER tmat4x2::tmat4x2() { - value_type const Zero(0); - value_type const One(1); - this->value[0] = col_type(One, Zero); - this->value[1] = col_type(Zero, One); - this->value[2] = col_type(Zero, Zero); - this->value[3] = col_type(Zero, Zero); +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); + this->value[2] = col_type(0, 0); + this->value[3] = col_type(0, 0); +# endif } template @@ -569,7 +569,7 @@ namespace glm T const SrcB12 = m2[1][2]; T const SrcB13 = m2[1][3]; - tmat2x2 Result(tmat2x2::_null); + tmat2x2 Result(uninitialize); Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index f4f278aa..9f09035e 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -40,7 +40,6 @@ namespace glm template struct tmat4x3 { - enum ctor{_null}; typedef T value_type; typedef std::size_t size_type; typedef tvec3 col_type; diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index 292c4aa6..d87b5de4 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -73,12 +73,12 @@ namespace glm template GLM_FUNC_QUALIFIER tmat4x3::tmat4x3() { - value_type const Zero(0); - value_type const One(1); - this->value[0] = col_type(One, Zero, Zero); - this->value[1] = col_type(Zero, One, Zero); - this->value[2] = col_type(Zero, Zero, One); - this->value[3] = col_type(Zero, Zero, Zero); +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0, 0, 0); +# endif } template @@ -563,7 +563,7 @@ namespace glm T const SrcB22 = m2[2][2]; T const SrcB23 = m2[2][3]; - tmat3x3 Result(tmat3x3::_null); + tmat3x3 Result(uninitialize); Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index a1c6d3fb..3f2fa07b 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -39,7 +39,6 @@ namespace glm template struct tmat4x4 { - enum ctor{_null}; typedef T value_type; typedef std::size_t size_type; typedef tvec4 col_type; diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index 52015759..f6567757 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -133,12 +133,12 @@ namespace detail template GLM_FUNC_QUALIFIER tmat4x4::tmat4x4() { - T Zero(0); - T One(1); - this->value[0] = col_type(One, Zero, Zero, Zero); - this->value[1] = col_type(Zero, One, Zero, Zero); - this->value[2] = col_type(Zero, Zero, One, Zero); - this->value[3] = col_type(Zero, Zero, Zero, One); +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif } template @@ -772,7 +772,7 @@ namespace detail typename tmat4x4::col_type const SrcB2 = m2[2]; typename tmat4x4::col_type const SrcB3 = m2[3]; - tmat4x4 Result(tmat4x4::_null); + tmat4x4 Result(uninitialize); Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3]; Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3]; Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3]; diff --git a/glm/detail/type_vec.hpp b/glm/detail/type_vec.hpp index 95e1e9f5..fd511dbe 100644 --- a/glm/detail/type_vec.hpp +++ b/glm/detail/type_vec.hpp @@ -33,6 +33,8 @@ namespace glm { + enum ctor{uninitialize}; + template struct tvec1; template struct tvec2; template struct tvec3; diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index 696ce788..fbe19189 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -47,8 +47,6 @@ namespace glm ////////////////////////////////////// // Implementation detail - enum ctor{_null}; - typedef tvec1 type; typedef tvec1 bool_type; typedef T value_type; diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index 7d031c87..a5abeaed 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -63,8 +63,10 @@ namespace glm // Implicit basic constructors template - GLM_FUNC_QUALIFIER tvec1::tvec1() : - x(static_cast(0)) + GLM_FUNC_QUALIFIER tvec1::tvec1() +# ifndef GLM_FORCE_NO_CTOR_INIT + : x(0) +# endif {} template diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 8b1b6211..274c3ec9 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -47,8 +47,6 @@ namespace glm ////////////////////////////////////// // Implementation detail - enum ctor{_null}; - typedef tvec2 type; typedef tvec2 bool_type; typedef T value_type; diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index c02a5c3f..b30f113a 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -63,22 +63,21 @@ namespace glm // Implicit basic constructors template - GLM_FUNC_QUALIFIER tvec2::tvec2() : - x(0), - y(0) + GLM_FUNC_QUALIFIER tvec2::tvec2() +# ifndef GLM_FORCE_NO_CTOR_INIT + : x(0), y(0) +# endif {} template - GLM_FUNC_QUALIFIER tvec2::tvec2(tvec2 const & v) : - x(v.x), - y(v.y) + GLM_FUNC_QUALIFIER tvec2::tvec2(tvec2 const & v) + : x(v.x), y(v.y) {} template template - GLM_FUNC_QUALIFIER tvec2::tvec2(tvec2 const & v) : - x(v.x), - y(v.y) + GLM_FUNC_QUALIFIER tvec2::tvec2(tvec2 const & v) + : x(v.x), y(v.y) {} ////////////////////////////////////// @@ -90,14 +89,12 @@ namespace glm template GLM_FUNC_QUALIFIER tvec2::tvec2(T const & s) : - x(s), - y(s) + x(s), y(s) {} template GLM_FUNC_QUALIFIER tvec2::tvec2(T const & s1, T const & s2) : - x(s1), - y(s2) + x(s1), y(s2) {} ////////////////////////////////////// diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 04064a96..df34d92b 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -47,8 +47,6 @@ namespace glm ////////////////////////////////////// // Implementation detail - enum ctor{_null}; - typedef tvec3 type; typedef tvec3 bool_type; typedef T value_type; diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 74bf891d..9413a928 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -63,25 +63,21 @@ namespace glm // Implicit basic constructors template - GLM_FUNC_QUALIFIER tvec3::tvec3() : - x(0), - y(0), - z(0) + GLM_FUNC_QUALIFIER tvec3::tvec3() +# ifndef GLM_FORCE_NO_CTOR_INIT + : x(0), y(0), z(0) +# endif {} template - GLM_FUNC_QUALIFIER tvec3::tvec3(tvec3 const & v) : - x(v.x), - y(v.y), - z(v.z) + GLM_FUNC_QUALIFIER tvec3::tvec3(tvec3 const & v) + : x(v.x), y(v.y), z(v.z) {} template template - GLM_FUNC_QUALIFIER tvec3::tvec3(tvec3 const & v) : - x(v.x), - y(v.y), - z(v.z) + GLM_FUNC_QUALIFIER tvec3::tvec3(tvec3 const & v) + : x(v.x), y(v.y), z(v.z) {} ////////////////////////////////////// @@ -92,17 +88,13 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tvec3::tvec3(T const & s) : - x(s), - y(s), - z(s) + GLM_FUNC_QUALIFIER tvec3::tvec3(T const & s) + : x(s), y(s), z(s) {} template - GLM_FUNC_QUALIFIER tvec3::tvec3(T const & a, T const & b, T const & c) : - x(a), - y(b), - z(c) + GLM_FUNC_QUALIFIER tvec3::tvec3(T const & a, T const & b, T const & c) + : x(a), y(b), z(c) {} ////////////////////////////////////// diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index a5769f65..bffc548c 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -70,8 +70,6 @@ namespace glm ////////////////////////////////////// // Implementation detail - enum ctor{_null}; - typedef tvec4 type; typedef tvec4 bool_type; typedef T value_type; diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 50f27543..56d8d4f0 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -63,42 +63,42 @@ namespace glm // Implicit basic constructors template - GLM_FUNC_QUALIFIER tvec4::tvec4() : - x(0), - y(0), - z(0), - w(0) + GLM_FUNC_QUALIFIER tvec4::tvec4() +# ifndef GLM_FORCE_NO_CTOR_INIT + : x(0), y(0), z(0), w(0) +# endif {} #if (GLM_HAS_UNRESTRICTED_UNIONS || GLM_HAS_ANONYMOUS_UNION) && (GLM_ARCH & GLM_ARCH_SSE2) template <> - GLM_FUNC_QUALIFIER tvec4::tvec4() : - data(_mm_setzero_ps()) + GLM_FUNC_QUALIFIER tvec4::tvec4() +# ifndef GLM_FORCE_NO_CTOR_INIT + : data(_mm_setzero_ps()) +# endif {} template <> - GLM_FUNC_QUALIFIER tvec4::tvec4() : - data(_mm_setzero_ps()) + GLM_FUNC_QUALIFIER tvec4::tvec4() +# ifndef GLM_FORCE_NO_CTOR_INIT + : data(_mm_setzero_ps()) +# endif {} #endif template - GLM_FUNC_QUALIFIER tvec4::tvec4(tvec4 const & v) : - x(v.x), - y(v.y), - z(v.z), - w(v.w) + GLM_FUNC_QUALIFIER tvec4::tvec4(tvec4 const & v) + : x(v.x), y(v.y), z(v.z), w(v.w) {} #if (GLM_HAS_UNRESTRICTED_UNIONS || GLM_HAS_ANONYMOUS_UNION) && (GLM_ARCH & GLM_ARCH_SSE2) template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(tvec4 const & v) : - data(v.data) + GLM_FUNC_QUALIFIER tvec4::tvec4(tvec4 const & v) + : data(v.data) {} template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(tvec4 const & v) : - data(v.data) + GLM_FUNC_QUALIFIER tvec4::tvec4(tvec4 const & v) + : data(v.data) {} #endif diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index bd68509b..84444455 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -59,7 +59,7 @@ namespace glm tvec3 axis(normalize(v)); tvec3 temp((T(1) - c) * axis); - tmat4x4 Rotate(tmat4x4::_null); + tmat4x4 Rotate(uninitialize); Rotate[0][0] = c + temp[0] * axis[0]; Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; @@ -72,7 +72,7 @@ namespace glm Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; Rotate[2][2] = c + temp[2] * axis[2]; - tmat4x4 Result(tmat4x4::_null); + tmat4x4 Result(uninitialize); Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; @@ -121,7 +121,7 @@ namespace glm tvec3 const & v ) { - tmat4x4 Result(tmat4x4::_null); + tmat4x4 Result(uninitialize); Result[0] = m[0] * v[0]; Result[1] = m[1] * v[1]; Result[2] = m[2] * v[2]; diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index a16a761e..b77b4948 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -58,8 +58,6 @@ namespace glm template struct tquat { - enum ctor{_null}; - typedef T value_type; typedef tvec4 bool_type; diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 01513156..df5fa036 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -60,34 +60,21 @@ namespace detail #endif template - GLM_FUNC_QUALIFIER tquat::tquat() : - x(0), - y(0), - z(0), - w(1) + GLM_FUNC_QUALIFIER tquat::tquat() +# ifndef GLM_FORCE_NO_CTOR_INIT + : x(0), y(0), z(0), w(1) +# endif {} template - GLM_FUNC_QUALIFIER tquat::tquat - ( - tquat const & q - ) : - x(q.x), - y(q.y), - z(q.z), - w(q.w) + GLM_FUNC_QUALIFIER tquat::tquat(tquat const & q) : + x(q.x), y(q.y), z(q.z), 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) + GLM_FUNC_QUALIFIER tquat::tquat(tquat const & q) : + x(q.x), y(q.y), z(q.z), w(q.w) {} template @@ -746,7 +733,7 @@ namespace detail T biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5); T mult = static_cast(0.25) / biggestVal; - tquat Result(tquat::_null); + tquat Result(uninitialize); switch(biggestIndex) { case 0: @@ -819,7 +806,7 @@ namespace detail tvec3 const & v ) { - tquat Result(tquat::_null); + tquat Result(uninitialize); T const a(angle); T const s = glm::sin(a * static_cast(0.5)); @@ -838,7 +825,7 @@ namespace detail tquat const & y ) { - tvec4 Result(tvec4::_null); + tvec4 Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] < y[i]; return Result; @@ -851,7 +838,7 @@ namespace detail tquat const & y ) { - tvec4 Result(tvec4::_null); + tvec4 Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] <= y[i]; return Result; @@ -864,7 +851,7 @@ namespace detail tquat const & y ) { - tvec4 Result(tvec4::_null); + tvec4 Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] > y[i]; return Result; @@ -877,7 +864,7 @@ namespace detail tquat const & y ) { - tvec4 Result(tvec4::_null); + tvec4 Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] >= y[i]; return Result; @@ -890,7 +877,7 @@ namespace detail tquat const & y ) { - tvec4 Result(tvec4::_null); + tvec4 Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) Result[i] = x[i] == y[i]; return Result; @@ -903,7 +890,7 @@ namespace detail tquat const & y ) { - tvec4 Result(tvec4::_null); + tvec4 Result(uninitialize); 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 aefd7cfc..2d0e730b 100644 --- a/glm/gtc/ulp.inl +++ b/glm/gtc/ulp.inl @@ -227,7 +227,7 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType next_float(vecType const & x) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = next_float(x[i]); return Result; @@ -262,7 +262,7 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType prev_float(vecType const & x) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = prev_float(x[i]); return Result; @@ -280,7 +280,7 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType next_float(vecType const & x, vecType const & ulps) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = next_float(x[i], ulps[i]); return Result; @@ -298,7 +298,7 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType prev_float(vecType const & x, vecType const & ulps) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = prev_float(x[i], ulps[i]); return Result; @@ -338,7 +338,7 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType float_distance(vecType const & x, vecType const & y) { - vecType Result(vecType::_null); + vecType Result(uninitialize); 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/associated_min_max.inl b/glm/gtx/associated_min_max.inl index 028cdd66..dd714d8e 100644 --- a/glm/gtx/associated_min_max.inl +++ b/glm/gtx/associated_min_max.inl @@ -23,7 +23,7 @@ GLM_FUNC_QUALIFIER tvec2 associatedMin vecType const & y, vecType const & b ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); 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; @@ -36,7 +36,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin T y, const vecType& b ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x < y ? a[i] : b[i]; return Result; @@ -49,7 +49,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin vecType const & y, U b ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] < y[i] ? a : b; return Result; @@ -76,7 +76,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin vecType const & z, vecType const & c ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); 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; @@ -110,7 +110,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin vecType const & w, vecType const & d ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = min(x[i], y[i]); @@ -135,7 +135,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin T Test1 = min(x, y); T Test2 = min(z, w); - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { U Result1 = x < y ? a[i] : b[i]; @@ -155,7 +155,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin vecType const & w, U d ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = min(x[i], y[i]); @@ -182,7 +182,7 @@ GLM_FUNC_QUALIFIER tvec2 associatedMax vecType const & y, vecType const & b ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); 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; @@ -196,7 +196,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax T y, vecType const & b ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x > y ? a[i] : b[i]; return Result; @@ -210,7 +210,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax vecType const & y, U b ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) Result[i] = x[i] > y[i] ? a : b; return Result; @@ -238,7 +238,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax vecType const & z, vecType const & c ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); 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; @@ -253,7 +253,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax T z, vecType const & c ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); 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; @@ -268,7 +268,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax vecType const & z, U c ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); 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; @@ -302,7 +302,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax vecType const & w, vecType const & d ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = max(x[i], y[i]); @@ -327,7 +327,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax T Test1 = max(x, y); T Test2 = max(z, w); - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { U Result1 = x > y ? a[i] : b[i]; @@ -347,7 +347,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax vecType const & w, U d ) { - vecType Result(vecType::_null); + vecType Result(uninitialize); for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) { T Test1 = max(x[i], y[i]); diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index bb97aad5..803a9f84 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -57,7 +57,6 @@ namespace glm template struct tdualquat { - enum ctor{_null}; typedef T value_type; typedef glm::tquat part_type; diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index 7df6a8ef..5672ec6d 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -46,26 +46,22 @@ namespace glm #endif template - GLM_FUNC_QUALIFIER tdualquat::tdualquat() : - real(tquat()), - dual(tquat(T(0), T(0), T(0), T(0))) + GLM_FUNC_QUALIFIER tdualquat::tdualquat() +# ifndef GLM_FORCE_NO_CTOR_INIT + : real(tquat()) + , dual(tquat(0, 0, 0, 0)) +# endif {} template - GLM_FUNC_QUALIFIER tdualquat::tdualquat - ( - tdualquat const & d - ) : + GLM_FUNC_QUALIFIER tdualquat::tdualquat(tdualquat const & d) : real(d.real), dual(d.dual) {} template template - GLM_FUNC_QUALIFIER tdualquat::tdualquat - ( - tdualquat const & d - ) : + GLM_FUNC_QUALIFIER tdualquat::tdualquat(tdualquat const & d) : real(d.real), dual(d.dual) {} @@ -78,12 +74,9 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tdualquat::tdualquat - ( - tquat const & r - ) : + GLM_FUNC_QUALIFIER tdualquat::tdualquat(tquat const & r) : real(r), - dual(tquat(T(0), T(0), T(0), T(0))) + dual(tquat(0, 0, 0, 0)) {} template diff --git a/glm/gtx/matrix_transform_2d.inl b/glm/gtx/matrix_transform_2d.inl index 280aa536..6bacd9c3 100644 --- a/glm/gtx/matrix_transform_2d.inl +++ b/glm/gtx/matrix_transform_2d.inl @@ -51,7 +51,7 @@ namespace glm T const c = cos(a); T const s = sin(a); - tmat3x3 Result(tmat3x3::_null); + tmat3x3 Result(uninitialize); Result[0] = m[0] * c + m[1] * s; Result[1] = m[0] * -s + m[1] * c; Result[2] = m[2]; @@ -63,7 +63,7 @@ namespace glm tmat3x3 const & m, tvec2 const & v) { - tmat3x3 Result(tmat3x3::_null); + tmat3x3 Result(uninitialize); Result[0] = m[0] * v[0]; Result[1] = m[1] * v[1]; Result[2] = m[2]; diff --git a/glm/gtx/rotate_normalized_axis.inl b/glm/gtx/rotate_normalized_axis.inl index e2d0db66..326bdb20 100644 --- a/glm/gtx/rotate_normalized_axis.inl +++ b/glm/gtx/rotate_normalized_axis.inl @@ -44,7 +44,7 @@ namespace glm tvec3 const temp((static_cast(1) - c) * axis); - tmat4x4 Rotate(tmat4x4::_null); + tmat4x4 Rotate(uninitialize); Rotate[0][0] = c + temp[0] * axis[0]; Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; @@ -57,7 +57,7 @@ namespace glm Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; Rotate[2][2] = c + temp[2] * axis[2]; - tmat4x4 Result(tmat4x4::_null); + tmat4x4 Result(uninitialize); Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp index e4857c83..3ea8d05d 100644 --- a/glm/gtx/simd_mat4.hpp +++ b/glm/gtx/simd_mat4.hpp @@ -60,7 +60,6 @@ namespace detail /// \ingroup gtx_simd_mat4 GLM_ALIGNED_STRUCT(16) fmat4x4SIMD { - enum ctor{_null}; typedef float value_type; typedef fvec4SIMD col_type; typedef fvec4SIMD row_type; diff --git a/glm/gtx/simd_mat4.inl b/glm/gtx/simd_mat4.inl index c6e41ea4..bac06506 100644 --- a/glm/gtx/simd_mat4.inl +++ b/glm/gtx/simd_mat4.inl @@ -43,12 +43,12 @@ GLM_FUNC_QUALIFIER fvec4SIMD const & fmat4x4SIMD::operator[] GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD() { -#ifndef GLM_SIMD_ENABLE_DEFAULT_INIT - 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); -#endif +# ifndef GLM_FORCE_NO_CTOR_INIT + this->Data[0] = fvec4SIMD(1, 0, 0, 0); + this->Data[1] = fvec4SIMD(0, 1, 0, 0); + this->Data[2] = fvec4SIMD(0, 0, 1, 0); + this->Data[3] = fvec4SIMD(0, 0, 0, 1); +# endif } GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD(float const & s) @@ -554,7 +554,7 @@ GLM_FUNC_QUALIFIER detail::fmat4x4SIMD outerProduct __m128 Shu2 = _mm_shuffle_ps(r.Data, r.Data, _MM_SHUFFLE(2, 2, 2, 2)); __m128 Shu3 = _mm_shuffle_ps(r.Data, r.Data, _MM_SHUFFLE(3, 3, 3, 3)); - detail::fmat4x4SIMD result(detail::fmat4x4SIMD::_null); + detail::fmat4x4SIMD result(uninitialize); result[0].Data = _mm_mul_ps(c.Data, Shu0); result[1].Data = _mm_mul_ps(c.Data, Shu1); result[2].Data = _mm_mul_ps(c.Data, Shu2); diff --git a/glm/gtx/simd_quat.hpp b/glm/gtx/simd_quat.hpp index 94e9ac30..f3aa2938 100644 --- a/glm/gtx/simd_quat.hpp +++ b/glm/gtx/simd_quat.hpp @@ -69,7 +69,6 @@ namespace detail /// \ingroup gtx_simd_vec4 GLM_ALIGNED_STRUCT(16) fquatSIMD { - enum ctor{null}; typedef __m128 value_type; typedef std::size_t size_type; static size_type value_size(); diff --git a/glm/gtx/simd_quat.inl b/glm/gtx/simd_quat.inl index aa6c5eda..760113e3 100644 --- a/glm/gtx/simd_quat.inl +++ b/glm/gtx/simd_quat.inl @@ -34,9 +34,9 @@ void print(const fvec4SIMD &v) // Implicit basic constructors GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD() -#ifdef GLM_SIMD_ENABLE_DEFAULT_INIT - : Data(_mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f)) -#endif +# ifdef GLM_FORCE_NO_CTOR_INIT + : Data(_mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f)) +# endif {} GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(__m128 const & Data) : diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp index cc117a4b..06a9db04 100644 --- a/glm/gtx/simd_vec4.hpp +++ b/glm/gtx/simd_vec4.hpp @@ -88,7 +88,6 @@ namespace detail /// \ingroup gtx_simd_vec4 GLM_ALIGNED_STRUCT(16) fvec4SIMD { - enum ctor{null}; typedef __m128 value_type; typedef std::size_t size_type; static size_type value_size(); diff --git a/glm/gtx/simd_vec4.inl b/glm/gtx/simd_vec4.inl index fc53e3fc..3e2cf9cc 100644 --- a/glm/gtx/simd_vec4.inl +++ b/glm/gtx/simd_vec4.inl @@ -20,9 +20,9 @@ struct mask // Implicit basic constructors GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD() -#ifdef GLM_SIMD_ENABLE_DEFAULT_INIT - : Data(_mm_set_ps(0.0f, 0.0f, 0.0f, 0.0f)) -#endif +# ifdef GLM_FORCE_NO_CTOR_INIT + : Data(_mm_set_ps(0.0f, 0.0f, 0.0f, 0.0f)) +# endif {} GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(__m128 const & Data) : diff --git a/readme.txt b/readme.txt index 4359434e..6bf0b337 100644 --- a/readme.txt +++ b/readme.txt @@ -73,6 +73,8 @@ GLM 0.9.6.0: 2014-XX-XX - Undetected C++ compiler automatically compile with GLM_FORCE_CXX98 and GLM_FORCE_PURE - Separated Apple Clang and LLVM compiler detection +- Added GLM_FORCE_NO_CTOR_INIT +- Added 'uninitialize' to explicitly not initialize a GLM type ================================================================================ GLM 0.9.5.4: 2014-06-21