Browse Source

Fixed uintBitsToFloat, function more os less missing

Christophe Riccio 14 years ago
parent
commit
961f4e3eed
1 changed files with 45 additions and 12 deletions
  1. 45 12
      glm/core/func_common.inl

+ 45 - 12
glm/core/func_common.inl

@@ -1402,18 +1402,6 @@ namespace glm
 		return fi.f;
 	}
 
-	inline float intBitsToFloat(uint const & value)
-	{
-		union
-		{
-			float f;
-			uint u;
-		} fu;
-
-		fu.u = value;
-		return fu.f;
-	}
-
     template <typename T>
     inline detail::tvec2<float> intBitsToFloat
 	(
@@ -1447,6 +1435,51 @@ namespace glm
             intBitsToFloat(value.y));
     }
 
+    inline float uintBitsToFloat(uint const & value)
+    {
+        union
+        {
+            float f;
+            uint u;
+        } fu;
+
+        fu.u = value;
+        return fu.f;
+    }
+
+    template <typename T>
+    inline detail::tvec2<float> uintBitsToFloat
+	(
+		detail::tvec2<T> const & value
+	)
+    {
+        return detail::tvec2<T>(
+            uintBitsToFloat(value.x),
+            uintBitsToFloat(value.y));
+    }
+
+    template <typename T>
+    inline detail::tvec3<float> uintBitsToFloat
+	(
+		detail::tvec3<T> const & value
+	)
+    {
+        return detail::tvec3<T>(
+            uintBitsToFloat(value.x),
+            uintBitsToFloat(value.y));
+    }
+
+    template <typename T>
+    inline detail::tvec4<float> uintBitsToFloat
+	(
+		detail::tvec4<T> const & value
+	)
+    {
+        return detail::tvec4<T>(
+            uintBitsToFloat(value.x),
+            uintBitsToFloat(value.y));
+    }
+
 	template <typename genType>
 	inline genType fma
 	(