Browse Source

Added new GTC API for random

Christophe Riccio 14 years ago
parent
commit
a18a7dfac9
1 changed files with 28 additions and 4 deletions
  1. 28 4
      glm/gtc/random.hpp

+ 28 - 4
glm/gtc/random.hpp

@@ -52,11 +52,35 @@ namespace glm
 {
 	/// @addtogroup gtc_random
 	/// @{
+	
+	/// Generate random numbers in the interval [Min, Max], according a linear distribution 
+	/// 
+	/// @param Min 
+	/// @param Max 
+	/// @tparam genType Value type. Currently supported: half (not recommanded), float or double scalars and vectors.
+	/// @see gtc_random
+	template <typename genType> 
+	genType linearRand(
+		genType const & Min, 
+		genType const & Max);
 
-	/// Generate a random number in the interval [-1, 1], according a linear distribution.
-	/// From GLM_GTC_random extension.
-    template <typename T> T signedRand1();
-
+	/// Generate random numbers in the interval [Min, Max], according a gaussian distribution 
+	/// (From GLM_GTX_random extension)
+	template <typename T, template <typename> class vecType> 
+	vecType<T> gaussRand(
+		vecType<T> const & Mean, 
+		vecType<T> const & Deviation);
+	
+	/// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius
+	/// (From GLM_GTX_random extension)
+	template <typename T> 
+	detail::tvec2<T> circularRand(T const & Radius); 
+	
+	/// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius
+	/// (From GLM_GTX_random extension)
+	template <typename T> 
+	detail::tvec3<T> sphericalRand(T const & Radius); 
+	
 	/// @}
 }//namespace glm