[4.0] Initialize random number generator
[platform/core/uifw/dali-core.git] / dali / public-api / math / random.h
index b270f8a..97818f5 100644 (file)
@@ -30,6 +30,7 @@ namespace Dali
 
 /**
  * @brief Provides methods to generate and use random values.
+ * @SINCE_1_0.0
  */
 namespace Random
 {
@@ -38,21 +39,24 @@ namespace Random
  * @brief Returns a random number between f0 and f1.
  *
  * Note, uses a limited number of values.
- * @param[in] f0 the lower bound
- * @param[in] f1 the upper bound
- * @return a random value between the lower and upper bound
+ * @SINCE_1_0.0
+ * @param[in] f0 The lower bound
+ * @param[in] f1 The upper bound
+ * @return A random value between the lower and upper bound
  */
 inline float Range(float f0, float f1)
 {
   float min = std::min(f0, f1);
   float max = std::max(f0, f1);
+  srand( time( NULL ) );
   return min + (rand() & 0xfff) * (max-min) * (1.0f/4095.0f);
 }
 
 /**
  * @brief Function to return a normalized axis in a random direction.
  *
- * @return the axis
+ * @SINCE_1_0.0
+ * @return The axis
  */
 inline Vector4 Axis()
 {