Browse Source

Added declarations for missing constructors

Christophe Riccio 14 năm trước cách đây
mục cha
commit
35ed096cc8

+ 6 - 6
glm/core/type_mat2x2.hpp

@@ -79,7 +79,7 @@ namespace glm
 				col_type const & v2);
 				col_type const & v2);
 
 
 			//////////////////////////////////////
 			//////////////////////////////////////
-			// Convertion constructors
+			// Conversions
 			template <typename U> 
 			template <typename U> 
 			GLM_FUNC_DECL explicit tmat2x2(
 			GLM_FUNC_DECL explicit tmat2x2(
 				U const & x);
 				U const & x);
@@ -89,13 +89,13 @@ namespace glm
 				U const & x1, V const & y1, 
 				U const & x1, V const & y1, 
 				M const & x2, N const & y2);
 				M const & x2, N const & y2);
 			
 			
-			//template <typename U, typename V, typename M, typename N> 
-			//GLM_FUNC_DECL explicit tmat2x2(
-			//	tvec2<U, V> const & v1, 
-			//	tvec2<M, N> const & v2);
+			template <typename U, typename V> 
+			GLM_FUNC_DECL explicit tmat2x2(
+				tvec2<U> const & v1, 
+				tvec2<V> const & v2);
 
 
 			//////////////////////////////////////
 			//////////////////////////////////////
-			// Conversions
+			// Matrix conversions
 			template <typename U> 
 			template <typename U> 
 			GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U> const & m);
 			GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U> const & m);
 
 

+ 11 - 11
glm/core/type_mat2x2.inl

@@ -133,17 +133,17 @@ namespace detail
         this->value[1] = col_type(value_type(x2), value_type(y2));
         this->value[1] = col_type(value_type(x2), value_type(y2));
 	}
 	}
 	
 	
-	//template <typename T> 
-	//template <typename U, typename V, typename M, typename N> 
-	//GLM_FUNC_DECL tmat2x2<T>::tmat2x2
-	//(
-	//	tvec2<U, V> const & v1, 
-	//	tvec2<M, N> const & v2
-	//)		
-	//{
- //       this->value[0] = col_type(v1);
- //       this->value[1] = col_type(v2);
-	//}
+	template <typename T> 
+	template <typename U, typename V> 
+	GLM_FUNC_DECL tmat2x2<T>::tmat2x2
+	(
+		tvec2<U> const & v1, 
+		tvec2<V> const & v2
+	)		
+	{
+        this->value[0] = col_type(v1);
+        this->value[1] = col_type(v2);
+	}
 
 
     //////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////
     // mat2x2 conversions
     // mat2x2 conversions

+ 19 - 1
glm/core/type_mat2x3.hpp

@@ -71,7 +71,25 @@ namespace glm
 				col_type const & v0, 
 				col_type const & v0, 
 				col_type const & v1);
 				col_type const & v1);
 
 
-			// Conversion
+            
+			//////////////////////////////////////
+			// Conversions
+			template <typename U> 
+			GLM_FUNC_DECL explicit tmat2x3(
+                U const & x);
+			
+			template <typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2> 
+			GLM_FUNC_DECL explicit tmat2x3(
+                X1 const & x1, Y1 const & y1, Z1 const & z1, 
+                X2 const & x2, Y2 const & y2, Z2 const & z2);
+			
+			template <typename U, typename V> 
+			GLM_FUNC_DECL explicit tmat2x3(
+                tvec3<U> const & v1, 
+                tvec3<V> const & v2);
+            
+			//////////////////////////////////////
+            // Matrix conversion
 			template <typename U> 
 			template <typename U> 
 			GLM_FUNC_DECL explicit tmat2x3(tmat2x3<U> const & m);
 			GLM_FUNC_DECL explicit tmat2x3(tmat2x3<U> const & m);
 
 

+ 23 - 2
glm/core/type_mat2x4.hpp

@@ -70,8 +70,29 @@ namespace glm
 			GLM_FUNC_DECL explicit tmat2x4(
 			GLM_FUNC_DECL explicit tmat2x4(
 				col_type const & v0, 
 				col_type const & v0, 
 				col_type const & v1);
 				col_type const & v1);
-
-			// Conversion
+            
+			//////////////////////////////////////
+			// Conversions
+			template <typename U> 
+			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 <typename U, typename V> 
+			GLM_FUNC_DECL explicit tmat2x4(
+                tvec4<U> const & v1, 
+                tvec4<V> const & v2);
+            
+            //////////////////////////////////////
+			// Matrix conversions
 			template <typename U> 
 			template <typename U> 
 			GLM_FUNC_DECL explicit tmat2x4(tmat2x4<U> const & m);
 			GLM_FUNC_DECL explicit tmat2x4(tmat2x4<U> const & m);
 
 

+ 24 - 1
glm/core/type_mat3x2.hpp

@@ -73,7 +73,30 @@ namespace glm
 				col_type const & v1,
 				col_type const & v1,
 				col_type const & v2);
 				col_type const & v2);
 
 
-			// Conversion
+			//////////////////////////////////////
+			// Conversions
+			template <typename U> 
+			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 <typename V1, typename V2, typename V3> 
+			GLM_FUNC_DECL explicit tmat3x2(
+                tvec2<V1> const & v1, 
+                tvec2<V2> const & v2,
+                tvec2<V3> const & v3);
+            
+			// Matrix conversions
 			template <typename U> 
 			template <typename U> 
 			GLM_FUNC_DECL explicit tmat3x2(tmat3x2<U> const & m);
 			GLM_FUNC_DECL explicit tmat3x2(tmat3x2<U> const & m);
 
 

+ 23 - 0
glm/core/type_mat3x3.hpp

@@ -77,8 +77,31 @@ namespace glm
 				col_type const & v1,
 				col_type const & v1,
 				col_type const & v2);
 				col_type const & v2);
 
 
+			//////////////////////////////////////
 			// Conversions
 			// Conversions
 			template <typename U> 
 			template <typename U> 
+			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 <typename V1, typename V2, typename V3> 
+			GLM_FUNC_DECL explicit tmat3x3(
+                tvec3<V1> const & v1, 
+                tvec3<V2> const & v2,
+                tvec3<V3> const & v3);
+            
+			// Matrix conversions
+			template <typename U> 
 			GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U> const & m);
 			GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U> const & m);
 
 
 			GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T> const & x);
 			GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T> const & x);

+ 24 - 1
glm/core/type_mat3x4.hpp

@@ -73,7 +73,30 @@ namespace glm
 				col_type const & v1,
 				col_type const & v1,
 				col_type const & v2);
 				col_type const & v2);
 
 
-			// Conversion
+			//////////////////////////////////////
+			// Conversions
+			template <typename U> 
+			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 <typename V1, typename V2, typename V3> 
+			GLM_FUNC_DECL explicit tmat3x4(
+                tvec4<V1> const & v1, 
+                tvec4<V2> const & v2,
+                tvec4<V3> const & v3);
+            
+			// Matrix conversion
 			template <typename U> 
 			template <typename U> 
 			GLM_FUNC_DECL explicit tmat3x4(tmat3x4<U> const & m);
 			GLM_FUNC_DECL explicit tmat3x4(tmat3x4<U> const & m);
 
 

+ 27 - 1
glm/core/type_mat4x2.hpp

@@ -74,9 +74,35 @@ namespace glm
 				col_type const & v1,
 				col_type const & v1,
 				col_type const & v2,
 				col_type const & v2,
 				col_type const & v3);
 				col_type const & v3);
-
+            
+			//////////////////////////////////////
 			// Conversions
 			// Conversions
 			template <typename U> 
 			template <typename U> 
+			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 <typename V1, typename V2, typename V3, typename V4> 
+			GLM_FUNC_DECL explicit tmat4x2(
+                tvec2<V1> const & v1, 
+                tvec2<V2> const & v2,
+                tvec2<V3> const & v3,
+                tvec2<V4> const & v4);
+            
+			// Matrix conversions
+			template <typename U> 
 			GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U> const & m);
 			GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U> const & m);
 			
 			
 			GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T> const & x);
 			GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T> const & x);

+ 27 - 3
glm/core/type_mat4x3.hpp

@@ -73,9 +73,33 @@ namespace glm
 				col_type const & v0, 
 				col_type const & v0, 
 				col_type const & v1,
 				col_type const & v1,
 				col_type const & v2,
 				col_type const & v2,
-				col_type const & v3);
-
-			// Conversion
+                col_type const & v3);
+            
+			//////////////////////////////////////
+			// Conversions
+			template <typename U> 
+			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 <typename V1, typename V2, typename V3, typename V4> 
+			GLM_FUNC_DECL explicit tmat4x3(
+                tvec3<V1> const & v1, 
+                tvec3<V2> const & v2,
+                tvec3<V3> const & v3,
+                tvec3<V4> const & v4);
+            
+			// Matrix conversions
 			template <typename U> 
 			template <typename U> 
 			GLM_FUNC_DECL explicit tmat4x3(tmat4x3<U> const & m);
 			GLM_FUNC_DECL explicit tmat4x3(tmat4x3<U> const & m);
 			
 			

+ 24 - 0
glm/core/type_mat4x4.hpp

@@ -79,8 +79,32 @@ namespace glm
 				col_type const & v2,
 				col_type const & v2,
 				col_type const & v3);
 				col_type const & v3);
 
 
+			//////////////////////////////////////
 			// Conversions
 			// Conversions
 			template <typename U> 
 			template <typename U> 
+			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 <typename V1, typename V2, typename V3, typename V4> 
+			GLM_FUNC_DECL explicit tmat4x4(
+                tvec4<V1> const & v1, 
+                tvec4<V2> const & v2,
+                tvec4<V3> const & v3,
+                tvec4<V4> const & v4);
+            
+			// Matrix conversions
+			template <typename U> 
 			GLM_FUNC_DECL explicit tmat4x4(tmat4x4<U> const & m);
 			GLM_FUNC_DECL explicit tmat4x4(tmat4x4<U> const & m);
 
 
 			GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T> const & x);
 			GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T> const & x);