vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TerrainRandom.h
Go to the documentation of this file.
1 
9 #ifndef VRECKO_NATURE_TERRAIN_TERRAINRANDOM_H
10 #define VRECKO_NATURE_TERRAIN_TERRAINRANDOM_H
11 
12 #include <osg/Vec3>
13 #include <iostream>
14 #include <string>
15 
17 
18 namespace APNature
19 {
21  {
22  public:
23 
31  static inline float GetRandomFloatUniform(float from, float to) { return from > to ? TerrainRandom::GetRandomFloatUniform(to, from) :
32  from + (((rand() % RAND_MAX) * (to - from)) / RAND_MAX); }
33 
44  static float GetRandomFloatGaussian(float mean, float standardDeviation);
45 
58  static float GetRandomFloatGaussianBasedOnPointDistance(int x1, int y1, int x2, int y2);
59 
69  /*static inline float GetModifiedVariance(unsigned int iteration, float variance, float hurstExponent)
70  {
71  return (1.0f * variance / pow(2.0f, 2 * hurstExponent * (iteration + 1)));
72  }*/
73 
74  private:
75 
76  static float _PreGeneratedGaussian;
77  static bool _PreGeneratedGaussianExists;
78  };
79 }
80 
81 #endif