Browse Source

Added implicit conversion of types with different precision qualifier

Christophe Riccio 12 years ago
parent
commit
16b9c79acc

+ 3 - 2
glm/core/type_mat2x2.hpp

@@ -65,8 +65,9 @@ namespace detail
 		//////////////////////////////////////
 		// Constructors
 		GLM_FUNC_DECL tmat2x2();
-		GLM_FUNC_DECL tmat2x2(
-			tmat2x2 const & m);
+		GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m);
+		template <precision Q>
+		GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
 
 		GLM_FUNC_DECL explicit tmat2x2(
 			ctor Null);

+ 10 - 1
glm/core/type_mat2x2.inl

@@ -92,6 +92,15 @@ namespace detail
 		this->value[1] = m.value[1];
 	}
 
+	template <typename T, precision P>
+	template <precision Q>
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(
+		tmat2x2<T, Q> const & m)
+	{
+		this->value[0] = m.value[0];
+		this->value[1] = m.value[1];
+	}
+
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
 	(
@@ -133,7 +142,7 @@ namespace detail
 	}
 
 	//////////////////////////////////////
-	// Convertion constructors
+	// Conversion constructors
 	template <typename T, precision P>
 	template <typename U>
 	GLM_FUNC_DECL tmat2x2<T, P>::tmat2x2

+ 3 - 1
glm/core/type_mat2x3.hpp

@@ -58,7 +58,9 @@ namespace detail
 	public:
 		// Constructors
 		GLM_FUNC_DECL tmat2x3();
-		GLM_FUNC_DECL tmat2x3(tmat2x3 const & m);
+		GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m);
+		template <precision Q>
+		GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m);
 
 		GLM_FUNC_DECL explicit tmat2x3(
 			ctor);

+ 10 - 1
glm/core/type_mat2x3.inl

@@ -92,6 +92,15 @@ namespace detail
 		this->value[1] = m.value[1];
 	}
 
+	template <typename T, precision P>
+	template <precision Q>
+	GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(
+		tmat2x3<T, Q> const & m)
+	{
+		this->value[0] = m.value[0];
+		this->value[1] = m.value[1];
+	}
+
 	template <typename T, precision P> 
 	GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
 	(
@@ -132,7 +141,7 @@ namespace detail
 	}
 
 	//////////////////////////////////////
-	// Convertion constructors
+	// Conversion constructors
 	template <typename T, precision P>
 	template <typename U>
 	GLM_FUNC_DECL tmat2x3<T, P>::tmat2x3

+ 3 - 1
glm/core/type_mat2x4.hpp

@@ -58,7 +58,9 @@ namespace detail
 	public:
 		// Constructors
 		GLM_FUNC_DECL tmat2x4();
-		GLM_FUNC_DECL tmat2x4(tmat2x4 const & m);
+		GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m);
+		template <precision Q>
+		GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m);
 
 		GLM_FUNC_DECL explicit tmat2x4(
 			ctor);

+ 10 - 1
glm/core/type_mat2x4.inl

@@ -94,6 +94,15 @@ namespace detail
 		this->value[1] = m.value[1];
 	}
 
+	template <typename T, precision P>
+	template <precision Q>
+	GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(
+		tmat2x4<T, Q> const & m)
+	{
+		this->value[0] = m.value[0];
+		this->value[1] = m.value[1];
+	}
+
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
 	(
@@ -135,7 +144,7 @@ namespace detail
 	}
 
 	//////////////////////////////////////
-	// Convertion constructors
+	// Conversion constructors
 	template <typename T, precision P>
 	template <typename U>
 	GLM_FUNC_DECL tmat2x4<T, P>::tmat2x4

+ 2 - 0
glm/core/type_mat3x2.hpp

@@ -59,6 +59,8 @@ namespace detail
 		// Constructors
 		GLM_FUNC_DECL tmat3x2();
 		GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m);
+		template <precision Q>
+		GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);
 
 		GLM_FUNC_DECL explicit tmat3x2(
 			ctor);

+ 11 - 1
glm/core/type_mat3x2.inl

@@ -94,6 +94,16 @@ namespace detail
 		this->value[2] = m.value[2];
 	}
 
+	template <typename T, precision P>
+	template <precision Q>
+	GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(
+		tmat3x2<T, Q> const & m)
+	{
+		this->value[0] = m.value[0];
+		this->value[1] = m.value[1];
+		this->value[2] = m.value[2];
+	}
+
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
 	(
@@ -139,7 +149,7 @@ namespace detail
 	}
 
 	//////////////////////////////////////
-	// Convertion constructors
+	// Conversion constructors
 	template <typename T, precision P>
 	template <typename U>
 	GLM_FUNC_DECL tmat3x2<T, P>::tmat3x2

+ 2 - 0
glm/core/type_mat3x3.hpp

@@ -65,6 +65,8 @@ namespace detail
 		// Constructors
 		GLM_FUNC_DECL tmat3x3();
 		GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m);
+		template <precision Q>
+		GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
 
 		GLM_FUNC_DECL explicit tmat3x3(
 			ctor Null);

+ 11 - 1
glm/core/type_mat3x3.inl

@@ -103,6 +103,16 @@ namespace detail
 	)
 	{}
 
+	template <typename T, precision P>
+	template <precision Q>
+	GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(
+		tmat3x3<T, Q> const & m)
+	{
+		this->value[0] = m.value[0];
+		this->value[1] = m.value[1];
+		this->value[2] = m.value[2];
+	}
+
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
 	(
@@ -142,7 +152,7 @@ namespace detail
 	}
 
 	//////////////////////////////////////
-	// Convertion constructors
+	// Conversion constructors
 	template <typename T, precision P>
 	template <typename U>
 	GLM_FUNC_DECL tmat3x3<T, P>::tmat3x3

+ 3 - 1
glm/core/type_mat3x4.hpp

@@ -58,7 +58,9 @@ namespace detail
 	public:
 		// Constructors
 		GLM_FUNC_DECL tmat3x4();
-		GLM_FUNC_DECL tmat3x4(tmat3x4 const & m);
+		GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> const & m);
+		template <precision Q>
+		GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m);
 
 		GLM_FUNC_DECL explicit tmat3x4(
 			ctor Null);

+ 11 - 1
glm/core/type_mat3x4.inl

@@ -94,6 +94,16 @@ namespace detail
 		this->value[2] = m.value[2];
 	}
 
+	template <typename T, precision P>
+	template <precision Q>
+	GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(
+		tmat3x4<T, Q> const & m)
+	{
+		this->value[0] = m.value[0];
+		this->value[1] = m.value[1];
+		this->value[2] = m.value[2];
+	}
+
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
 	(
@@ -140,7 +150,7 @@ namespace detail
 	}
 
 	//////////////////////////////////////
-	// Convertion constructors
+	// Conversion constructors
 	template <typename T, precision P>
 	template <typename U>
 	GLM_FUNC_DECL tmat3x4<T, P>::tmat3x4

+ 3 - 1
glm/core/type_mat4x2.hpp

@@ -58,7 +58,9 @@ namespace detail
 	public:
 		// Constructors
 		GLM_FUNC_DECL tmat4x2();
-		GLM_FUNC_DECL tmat4x2(tmat4x2 const & m);
+		GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m);
+		template <precision Q>
+		GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);
 
 		GLM_FUNC_DECL explicit tmat4x2(
 			ctor Null);

+ 15 - 9
glm/core/type_mat4x2.inl

@@ -87,10 +87,8 @@ namespace detail
 	}
 
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
-	(
-		tmat4x2<T, P> const & m
-	)
+	GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(
+		tmat4x2<T, P> const & m)
 	{
 		this->value[0] = m.value[0];
 		this->value[1] = m.value[1];
@@ -99,10 +97,18 @@ namespace detail
 	}
 
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
-	(
-		ctor
-	)
+	template <precision Q>
+	GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(
+		tmat4x2<T, Q> const & m)
+	{
+		this->value[0] = m.value[0];
+		this->value[1] = m.value[1];
+		this->value[2] = m.value[2];
+		this->value[3] = m.value[3];
+	}
+
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(ctor)
 	{}
 
 	template <typename T, precision P>
@@ -149,7 +155,7 @@ namespace detail
 	}
 
 	//////////////////////////////////////
-	// Convertion constructors
+	// Conversion constructors
 	template <typename T, precision P>
 	template <typename U>
 	GLM_FUNC_DECL tmat4x2<T, P>::tmat4x2

+ 3 - 1
glm/core/type_mat4x3.hpp

@@ -58,7 +58,9 @@ namespace detail
 	public:
 		// Constructors
 		GLM_FUNC_DECL tmat4x3();
-		GLM_FUNC_DECL tmat4x3(tmat4x3 const & m);
+		GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> const & m);
+		template <precision Q>
+		GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m);
 
 		GLM_FUNC_DECL explicit tmat4x3(
 			ctor Null);

+ 17 - 13
glm/core/type_mat4x3.inl

@@ -87,10 +87,19 @@ namespace detail
 	}
 
 	template <typename T, precision P> 
-	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
-	(
-		tmat4x3<T, P> const & m
-	)
+	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(
+		tmat4x3<T, P> const & m)
+	{
+		this->value[0] = m.value[0];
+		this->value[1] = m.value[1];
+		this->value[2] = m.value[2];
+		this->value[3] = m.value[3];
+	}
+
+	template <typename T, precision P>
+	template <precision Q>
+	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(
+		tmat4x3<T, Q> const & m)
 	{
 		this->value[0] = m.value[0];
 		this->value[1] = m.value[1];
@@ -99,17 +108,12 @@ namespace detail
 	}
 
 	template <typename T, precision P> 
-	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
-	(
-		ctor
-	)
+	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(ctor)
 	{}
 
 	template <typename T, precision P> 
-	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
-	(
-		value_type const & s
-	)
+	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(
+		value_type const & s)
 	{
 		value_type const Zero(0);
 		this->value[0] = col_type(s, Zero, Zero);
@@ -149,7 +153,7 @@ namespace detail
 	}
 
 	//////////////////////////////////////
-	// Convertion constructors
+	// Conversion constructors
 	template <typename T, precision P> 
 	template <typename U> 
 	GLM_FUNC_DECL tmat4x3<T, P>::tmat4x3

+ 3 - 1
glm/core/type_mat4x4.hpp

@@ -64,7 +64,9 @@ namespace detail
 	public:
 		// Constructors
 		GLM_FUNC_DECL tmat4x4();
-		GLM_FUNC_DECL tmat4x4(tmat4x4 const & m);
+		GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m);
+		template <precision Q>
+		GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
 
 		GLM_FUNC_DECL explicit tmat4x4(
 			ctor Null);

+ 14 - 1
glm/core/type_mat4x4.inl

@@ -98,6 +98,19 @@ namespace detail
 		this->value[3] = m.value[3];
 	}
 
+	template <typename T, precision P>
+	template <precision Q>
+	GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
+	(
+		tmat4x4<T, Q> const & m
+	)
+	{
+		this->value[0] = m.value[0];
+		this->value[1] = m.value[1];
+		this->value[2] = m.value[2];
+		this->value[3] = m.value[3];
+	}
+
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
 	(
@@ -162,7 +175,7 @@ namespace detail
 	}
 
 	//////////////////////////////////////
-	// Convertion constructors
+	// Conversion constructors
 	template <typename T, precision P>
 	template <typename U>
 	GLM_FUNC_DECL tmat4x4<T, P>::tmat4x4

+ 4 - 2
glm/core/type_vec1.hpp

@@ -68,6 +68,8 @@ namespace detail
 
 		GLM_FUNC_DECL tvec1();
 		GLM_FUNC_DECL tvec1(tvec1<T, P> const & v);
+		template <precision Q>
+		GLM_FUNC_DECL tvec1(tvec1<T, Q> const & v);
 
 		//////////////////////////////////////
 		// Explicit basic constructors
@@ -83,14 +85,14 @@ namespace detail
 		GLM_FUNC_DECL tvec1(tref1<T, P> const & r);
 
 		//////////////////////////////////////
-		// Convertion scalar constructors
+		// Conversion scalar constructors
 
 		//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename U>
 		GLM_FUNC_DECL explicit tvec1(U const & s);
 
 		//////////////////////////////////////
-		// Convertion vector constructors
+		// Conversion vector constructors
 		
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename U, precision Q>

+ 14 - 5
glm/core/type_vec1.inl

@@ -69,14 +69,16 @@ namespace detail
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
 	(
-		ctor
-	)
+		tvec1<T, P> const & v
+	) :
+		x(v.x)
 	{}
 
 	template <typename T, precision P>
+	template <precision Q>
 	GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
 	(
-		tvec1<T, P> const & v
+		tvec1<T, Q> const & v
 	) :
 		x(v.x)
 	{}
@@ -84,6 +86,13 @@ namespace detail
 	//////////////////////////////////////
 	// Explicit basic constructors
 
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
+	(
+		ctor
+	)
+	{}
+
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
 	(
@@ -104,7 +113,7 @@ namespace detail
 	{}
 
 	//////////////////////////////////////
-	// Convertion scalar constructors
+	// Conversion scalar constructors
 		
 	template <typename T, precision P>
 	template <typename U> 
@@ -116,7 +125,7 @@ namespace detail
 	{}
 
 	//////////////////////////////////////
-	// Convertion vector constructors
+	// Conversion vector constructors
 
 	template <typename T, precision P>
 	template <typename U, precision Q>

+ 4 - 2
glm/core/type_vec2.hpp

@@ -89,6 +89,8 @@ namespace detail
 
 		GLM_FUNC_DECL tvec2();
 		GLM_FUNC_DECL tvec2(tvec2<T, P> const & v);
+		template <precision Q>
+		GLM_FUNC_DECL tvec2(tvec2<T, Q> const & v);
 
 		//////////////////////////////////////
 		// Explicit basic constructors
@@ -113,7 +115,7 @@ namespace detail
 		}
 
 		//////////////////////////////////////
-		// Convertion constructors
+		// Conversion constructors
 
 		//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename U>
@@ -126,7 +128,7 @@ namespace detail
 			V const & y);
 
 		//////////////////////////////////////
-		// Convertion vector constructors
+		// Conversion vector constructors
 
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename U, precision Q>

+ 15 - 5
glm/core/type_vec2.inl

@@ -64,14 +64,17 @@ namespace detail
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2
 	(
-		ctor
-	)
+		tvec2<T, P> const & v
+	) :
+		x(v.x),
+		y(v.y)
 	{}
 
 	template <typename T, precision P>
+	template <precision Q>
 	GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2
 	(
-		tvec2<T, P> const & v
+		tvec2<T, Q> const & v
 	) :
 		x(v.x),
 		y(v.y)
@@ -80,6 +83,13 @@ namespace detail
 	//////////////////////////////////////
 	// Explicit basic constructors
 
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2
+	(
+		ctor
+	)
+	{}
+
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2
 	(
@@ -112,7 +122,7 @@ namespace detail
 	{}
 
 	//////////////////////////////////////
-	// Convertion scalar constructors
+	// Conversion scalar constructors
 		
 	template <typename T, precision P>
 	template <typename U>
@@ -136,7 +146,7 @@ namespace detail
 	{}
 
 	//////////////////////////////////////
-	// Convertion vector constructors
+	// Conversion vector constructors
 
 	template <typename T, precision P>
 	template <typename U, precision Q>

+ 4 - 2
glm/core/type_vec3.hpp

@@ -90,6 +90,8 @@ namespace detail
 
 		GLM_FUNC_DECL tvec3();
 		GLM_FUNC_DECL tvec3(tvec3<T, P> const & v);
+		template <precision Q>
+		GLM_FUNC_DECL tvec3(tvec3<T, Q> const & v);
 
 		//////////////////////////////////////
 		// Explicit basic constructors
@@ -104,7 +106,7 @@ namespace detail
 			value_type const & s3);
 
 		//////////////////////////////////////
-		// Convertion scalar constructors
+		// Conversion scalar constructors
 
 		//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename U>
@@ -118,7 +120,7 @@ namespace detail
 			W const & z);			
 
 		//////////////////////////////////////
-		// Convertion vector constructors
+		// Conversion vector constructors
 
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename A, typename B, precision Q>

+ 16 - 5
glm/core/type_vec3.inl

@@ -65,14 +65,18 @@ namespace detail
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
 	(
-		ctor
-	)
+		tvec3<T, P> const & v
+	) :
+		x(v.x),
+		y(v.y),
+		z(v.z)
 	{}
 
 	template <typename T, precision P>
+	template <precision Q>
 	GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
 	(
-		tvec3<T, P> const & v
+		tvec3<T, Q> const & v
 	) :
 		x(v.x),
 		y(v.y),
@@ -82,6 +86,13 @@ namespace detail
 	//////////////////////////////////////
 	// Explicit basic constructors
 
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
+	(
+		ctor
+	)
+	{}
+
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
 	(
@@ -142,7 +153,7 @@ namespace detail
 	{}
 
 	//////////////////////////////////////
-	// Convertion scalar constructors
+	// Conversion scalar constructors
 		
 	template <typename T, precision P>
 	template <typename U>
@@ -169,7 +180,7 @@ namespace detail
 	{}
 
 	//////////////////////////////////////
-	// Convertion vector constructors
+	// Conversion vector constructors
 
 	template <typename T, precision P>
 	template <typename A, typename B, precision Q>

+ 9 - 7
glm/core/type_vec4.hpp

@@ -91,6 +91,8 @@ namespace detail
 
 		GLM_FUNC_DECL tvec4();
 		GLM_FUNC_DECL tvec4(type const & v);
+		template <precision Q>
+		GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v);
 
 		//////////////////////////////////////
 		// Explicit basic constructors
@@ -106,22 +108,22 @@ namespace detail
 			value_type const & s3);
 
 		//////////////////////////////////////
-		// Convertion scalar constructors
+		// Conversion scalar constructors
 
-		//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
+		/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename U>
 		GLM_FUNC_DECL explicit tvec4(
 			U const & x);
-		//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
+		/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename A, typename B, typename C, typename D>
 		GLM_FUNC_DECL explicit tvec4(
 			A const & x,
 			B const & y,
 			C const & z,
-			D const & w);			
+			D const & w);
 
 		//////////////////////////////////////
-		// Convertion vector constructors
+		// Conversion vector constructors
 
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename A, typename B, typename C, precision Q>
@@ -221,8 +223,8 @@ namespace detail
 		// Unary arithmetic operators
 
 		GLM_FUNC_DECL tvec4<T, P> & operator= (tvec4<T, P> const & v);
-		template <typename U>
-		GLM_FUNC_DECL tvec4<T, P> & operator= (tvec4<U, P> const & v);
+		template <typename U, precision Q>
+		GLM_FUNC_DECL tvec4<T, P> & operator= (tvec4<U, Q> const & v);
 
 		template <typename U>
 		GLM_FUNC_DECL tvec4<T, P> & operator+=(U const & s);

+ 32 - 20
glm/core/type_vec4.inl

@@ -72,14 +72,19 @@ namespace detail
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
 	(
-		ctor
-	)
+		type const & v
+	) :
+		x(v.x),
+		y(v.y),
+		z(v.z),
+		w(v.w)
 	{}
 
 	template <typename T, precision P>
+	template <precision Q>
 	GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
 	(
-		type const & v
+		tvec4<T, Q> const & v
 	) :
 		x(v.x),
 		y(v.y),
@@ -90,6 +95,13 @@ namespace detail
 	//////////////////////////////////////
 	// Explicit basic constructors
 
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
+	(
+		ctor
+	)
+	{}
+
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
 	(
@@ -237,8 +249,8 @@ namespace detail
 	{}
 
 	//////////////////////////////////////
-	// Convertion scalar constructors
-		
+	// Conversion scalar constructors
+
 	template <typename T, precision P>
 	template <typename U>
 	GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
@@ -266,8 +278,20 @@ namespace detail
 		w(value_type(w))
 	{}
 
+	template <typename T, precision P>
+	template <typename U, precision Q>
+	GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
+		(
+		tvec4<U, Q> const & v
+		) :
+		x(value_type(v.x)),
+		y(value_type(v.y)),
+		z(value_type(v.z)),
+		w(value_type(v.w))
+	{}
+
 	//////////////////////////////////////
-	// Convertion vector constructors
+	// Conversion vector constructors
 
 	template <typename T, precision P>
 	template <typename A, typename B, typename C, precision Q>
@@ -350,18 +374,6 @@ namespace detail
 		w(value_type(v2.y))
 	{}
 
-	template <typename T, precision P>
-	template <typename U, precision Q>
-	GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
-	(
-		tvec4<U, Q> const & v
-	) :
-		x(value_type(v.x)),
-		y(value_type(v.y)),
-		z(value_type(v.z)),
-		w(value_type(v.w))
-	{}
-
 	//////////////////////////////////////
 	// Unary arithmetic operators
 
@@ -379,10 +391,10 @@ namespace detail
 	}
 
 	template <typename T, precision P>
-	template <typename U> 
+	template <typename U, precision Q>
 	GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator=
 	(
-		tvec4<U, P> const & v
+		tvec4<U, Q> const & v
 	)
 	{
 		this->x = T(v.x);

+ 1 - 1
glm/gtx/simd_vec4.hpp

@@ -111,7 +111,7 @@ namespace detail
 			vec4 const & v);
 
 		////////////////////////////////////////
-		//// Convertion vector constructors
+		//// Conversion vector constructors
 
 		fvec4SIMD(vec2 const & v, float const & s1, float const & s2);
 		fvec4SIMD(float const & s1, vec2 const & v, float const & s2);

+ 1 - 1
glm/gtx/simd_vec4.inl

@@ -59,7 +59,7 @@ GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(float const v[4]) :
 //fvec4SIMD(ref4<float> const & r);
 
 //////////////////////////////////////
-// Convertion vector constructors
+// Conversion vector constructors
 
 GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(vec2 const & v, float const & s1, float const & s2) :
 	Data(_mm_set_ps(s2, s1, v.y, v.x))

+ 19 - 0
test/gtc/gtc_type_precision.cpp

@@ -836,12 +836,31 @@ static int test_quat_precision()
 	return Error;
 }
 
+static int test_fvec_conversion()
+{
+	int Error(0);
+
+	{
+		glm::highp_vec4 a = glm::vec4(1, 2, 3, 4);
+		glm::mediump_vec4 b = glm::vec4(1, 2, 3, 4);
+		glm::lowp_vec4 c = b;
+		glm::mediump_vec4 d = c;
+		glm::lowp_ivec4 e = glm::ivec4(d);
+		glm::lowp_ivec3 f = glm::ivec3(e);
+
+		Error += glm::all(glm::equal(b, d)) ? 0 : 1;
+	}
+
+	return Error;
+}
+
 int main()
 {
 	int Error(0);
 	Error += test_scalar_size();
 	Error += test_fvec_size();
 	Error += test_fvec_precision();
+	Error += test_fvec_conversion();
 	Error += test_dvec_precision();
 	Error += test_ivec_size();
 	Error += test_ivec_precision();