From a18a7dfac96e1da898881c154360a9527687bc6c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 21 Sep 2011 21:10:51 +0100 Subject: [PATCH] Added new GTC API for random --- glm/gtc/random.hpp | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/glm/gtc/random.hpp b/glm/gtc/random.hpp index 1896e1ed..79d66bfd 100644 --- a/glm/gtc/random.hpp +++ b/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 + 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 T signedRand1(); - + /// Generate random numbers in the interval [Min, Max], according a gaussian distribution + /// (From GLM_GTX_random extension) + template class vecType> + vecType gaussRand( + vecType const & Mean, + vecType 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 + detail::tvec2 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 + detail::tvec3 sphericalRand(T const & Radius); + /// @} }//namespace glm