From 35ed096cc831c1ec71106be20878895ebcffa429 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 1 Jun 2011 10:02:02 +0100 Subject: [PATCH] Added declarations for missing constructors --- glm/core/type_mat2x2.hpp | 12 ++++++------ glm/core/type_mat2x2.inl | 22 +++++++++++----------- glm/core/type_mat2x3.hpp | 20 +++++++++++++++++++- glm/core/type_mat2x4.hpp | 25 +++++++++++++++++++++++-- glm/core/type_mat3x2.hpp | 25 ++++++++++++++++++++++++- glm/core/type_mat3x3.hpp | 23 +++++++++++++++++++++++ glm/core/type_mat3x4.hpp | 25 ++++++++++++++++++++++++- glm/core/type_mat4x2.hpp | 28 +++++++++++++++++++++++++++- glm/core/type_mat4x3.hpp | 30 +++++++++++++++++++++++++++--- glm/core/type_mat4x4.hpp | 24 ++++++++++++++++++++++++ 10 files changed, 208 insertions(+), 26 deletions(-) diff --git a/glm/core/type_mat2x2.hpp b/glm/core/type_mat2x2.hpp index 7f0df2c7..9ae7cd13 100644 --- a/glm/core/type_mat2x2.hpp +++ b/glm/core/type_mat2x2.hpp @@ -79,7 +79,7 @@ namespace glm col_type const & v2); ////////////////////////////////////// - // Convertion constructors + // Conversions template GLM_FUNC_DECL explicit tmat2x2( U const & x); @@ -89,13 +89,13 @@ namespace glm U const & x1, V const & y1, M const & x2, N const & y2); - //template - //GLM_FUNC_DECL explicit tmat2x2( - // tvec2 const & v1, - // tvec2 const & v2); + template + GLM_FUNC_DECL explicit tmat2x2( + tvec2 const & v1, + tvec2 const & v2); ////////////////////////////////////// - // Conversions + // Matrix conversions template GLM_FUNC_DECL explicit tmat2x2(tmat2x2 const & m); diff --git a/glm/core/type_mat2x2.inl b/glm/core/type_mat2x2.inl index 11a3f11c..77638dbb 100644 --- a/glm/core/type_mat2x2.inl +++ b/glm/core/type_mat2x2.inl @@ -133,17 +133,17 @@ namespace detail this->value[1] = col_type(value_type(x2), value_type(y2)); } - //template - //template - //GLM_FUNC_DECL tmat2x2::tmat2x2 - //( - // tvec2 const & v1, - // tvec2 const & v2 - //) - //{ - // this->value[0] = col_type(v1); - // this->value[1] = col_type(v2); - //} + template + template + GLM_FUNC_DECL tmat2x2::tmat2x2 + ( + tvec2 const & v1, + tvec2 const & v2 + ) + { + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + } ////////////////////////////////////////////////////////////// // mat2x2 conversions diff --git a/glm/core/type_mat2x3.hpp b/glm/core/type_mat2x3.hpp index ed87f9e2..4ff621e1 100644 --- a/glm/core/type_mat2x3.hpp +++ b/glm/core/type_mat2x3.hpp @@ -71,7 +71,25 @@ namespace glm col_type const & v0, col_type const & v1); - // Conversion + + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat2x3( + U const & x); + + template + GLM_FUNC_DECL explicit tmat2x3( + X1 const & x1, Y1 const & y1, Z1 const & z1, + X2 const & x2, Y2 const & y2, Z2 const & z2); + + template + GLM_FUNC_DECL explicit tmat2x3( + tvec3 const & v1, + tvec3 const & v2); + + ////////////////////////////////////// + // Matrix conversion template GLM_FUNC_DECL explicit tmat2x3(tmat2x3 const & m); diff --git a/glm/core/type_mat2x4.hpp b/glm/core/type_mat2x4.hpp index a14cc033..8eee4105 100644 --- a/glm/core/type_mat2x4.hpp +++ b/glm/core/type_mat2x4.hpp @@ -70,8 +70,29 @@ namespace glm GLM_FUNC_DECL explicit tmat2x4( col_type const & v0, col_type const & v1); - - // Conversion + + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat2x4( + U const & x); + + template + < + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2 + > + GLM_FUNC_DECL explicit tmat2x4( + X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, + X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,); + + template + GLM_FUNC_DECL explicit tmat2x4( + tvec4 const & v1, + tvec4 const & v2); + + ////////////////////////////////////// + // Matrix conversions template GLM_FUNC_DECL explicit tmat2x4(tmat2x4 const & m); diff --git a/glm/core/type_mat3x2.hpp b/glm/core/type_mat3x2.hpp index 3457b72f..70c0795a 100644 --- a/glm/core/type_mat3x2.hpp +++ b/glm/core/type_mat3x2.hpp @@ -73,7 +73,30 @@ namespace glm col_type const & v1, col_type const & v2); - // Conversion + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat3x2( + U const & x); + + template + < + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3 + > + GLM_FUNC_DECL explicit tmat3x2( + X1 const & x1, Y1 const & y1, + X2 const & x2, Y2 const & y2, + X3 const & x3, Y3 const & y3); + + template + GLM_FUNC_DECL explicit tmat3x2( + tvec2 const & v1, + tvec2 const & v2, + tvec2 const & v3); + + // Matrix conversions template GLM_FUNC_DECL explicit tmat3x2(tmat3x2 const & m); diff --git a/glm/core/type_mat3x3.hpp b/glm/core/type_mat3x3.hpp index 3f4725dc..4f47eb7a 100644 --- a/glm/core/type_mat3x3.hpp +++ b/glm/core/type_mat3x3.hpp @@ -77,8 +77,31 @@ namespace glm col_type const & v1, col_type const & v2); + ////////////////////////////////////// // Conversions template + GLM_FUNC_DECL explicit tmat3x3( + U const & x); + + template + < + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3 + > + GLM_FUNC_DECL explicit tmat3x3( + X1 const & x1, Y1 const & y1, Z1 const & z1, + X2 const & x2, Y2 const & y2, Z2 const & z2, + X3 const & x3, Y3 const & y3, Z3 const & z3); + + template + GLM_FUNC_DECL explicit tmat3x3( + tvec3 const & v1, + tvec3 const & v2, + tvec3 const & v3); + + // Matrix conversions + template GLM_FUNC_DECL explicit tmat3x3(tmat3x3 const & m); GLM_FUNC_DECL explicit tmat3x3(tmat2x2 const & x); diff --git a/glm/core/type_mat3x4.hpp b/glm/core/type_mat3x4.hpp index 1f84ec7b..7978361e 100644 --- a/glm/core/type_mat3x4.hpp +++ b/glm/core/type_mat3x4.hpp @@ -73,7 +73,30 @@ namespace glm col_type const & v1, col_type const & v2); - // Conversion + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat3x4( + U const & x); + + template + < + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2, + typename X3, typename Y3, typename Z3, typename W3 + > + GLM_FUNC_DECL explicit tmat3x4( + X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, + X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, + X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3); + + template + GLM_FUNC_DECL explicit tmat3x4( + tvec4 const & v1, + tvec4 const & v2, + tvec4 const & v3); + + // Matrix conversion template GLM_FUNC_DECL explicit tmat3x4(tmat3x4 const & m); diff --git a/glm/core/type_mat4x2.hpp b/glm/core/type_mat4x2.hpp index 3354ce8e..67c5b2b2 100644 --- a/glm/core/type_mat4x2.hpp +++ b/glm/core/type_mat4x2.hpp @@ -74,9 +74,35 @@ namespace glm col_type const & v1, col_type const & v2, col_type const & v3); - + + ////////////////////////////////////// // Conversions template + GLM_FUNC_DECL explicit tmat4x2( + U const & x); + + template + < + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3, + typename X4, typename Y4 + > + GLM_FUNC_DECL explicit tmat4x2( + X1 const & x1, Y1 const & y1, + X2 const & x2, Y2 const & y2, + X3 const & x3, Y3 const & y3, + X4 const & x4, Y4 const & y4); + + template + GLM_FUNC_DECL explicit tmat4x2( + tvec2 const & v1, + tvec2 const & v2, + tvec2 const & v3, + tvec2 const & v4); + + // Matrix conversions + template GLM_FUNC_DECL explicit tmat4x2(tmat4x2 const & m); GLM_FUNC_DECL explicit tmat4x2(tmat2x2 const & x); diff --git a/glm/core/type_mat4x3.hpp b/glm/core/type_mat4x3.hpp index b15a3c30..3876150b 100644 --- a/glm/core/type_mat4x3.hpp +++ b/glm/core/type_mat4x3.hpp @@ -73,9 +73,33 @@ namespace glm col_type const & v0, col_type const & v1, col_type const & v2, - col_type const & v3); - - // Conversion + col_type const & v3); + + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat4x3( + U const & x); + + template < + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3, + typename X4, typename Y4, typename Z4> + GLM_FUNC_DECL explicit tmat4x3( + X1 const & x1, Y1 const & y1, Z1 const & z1, + X2 const & x2, Y2 const & y2, Z2 const & z2, + X3 const & x3, Y3 const & y3, Z3 const & z3, + X4 const & x4, Y4 const & y4, Z4 const & z4); + + template + GLM_FUNC_DECL explicit tmat4x3( + tvec3 const & v1, + tvec3 const & v2, + tvec3 const & v3, + tvec3 const & v4); + + // Matrix conversions template GLM_FUNC_DECL explicit tmat4x3(tmat4x3 const & m); diff --git a/glm/core/type_mat4x4.hpp b/glm/core/type_mat4x4.hpp index e992ddaf..a470f34a 100644 --- a/glm/core/type_mat4x4.hpp +++ b/glm/core/type_mat4x4.hpp @@ -79,8 +79,32 @@ namespace glm col_type const & v2, col_type const & v3); + ////////////////////////////////////// // Conversions template + GLM_FUNC_DECL explicit tmat4x4( + U const & x); + + template < + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3, + typename X4, typename Y4, typename Z4> + GLM_FUNC_DECL explicit tmat4x4( + X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, + X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, + X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3, + X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4); + + template + GLM_FUNC_DECL explicit tmat4x4( + tvec4 const & v1, + tvec4 const & v2, + tvec4 const & v3, + tvec4 const & v4); + + // Matrix conversions + template GLM_FUNC_DECL explicit tmat4x4(tmat4x4 const & m); GLM_FUNC_DECL explicit tmat4x4(tmat2x2 const & x);