vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MidpointDisplacementAlgorithm.h
Go to the documentation of this file.
1 
9 #ifndef VRECKO_NATURE_TERRAIN_MIDPOINTDISPLACEMENTALGORITHM_H
10 #define VRECKO_NATURE_TERRAIN_MIDPOINTDISPLACEMENTALGORITHM_H
11 
12 #include "TerrainAlgorithm.h"
13 #include "../TerrainUtility.h"
14 #include <osg/Array>
15 
16 namespace APNature
17 {
19  {
20 
21  public:
22 
23  static const int InitialLevel;
24 
32  MidpointDisplacementAlgorithm(int width, int height, float cornerValueFrom, float cornerValueTo);
33 
40  void RandomizeSurfaceCorners(float cornerValueFrom, float cornerValueTo);
41 
53  float* GenerateSurfaceByMidpointDisplacement(int x1, int y1, int x2, int y2, int level);
54 
55  private:
56 
57  float ComputePseudoRandomError(int x1, int y1, int x2, int y2, int level);
58 
59  };
60 }
61 
62 #endif