vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CloudsManager.h
Go to the documentation of this file.
1 
9 #ifndef _VRECKO_CLOUDS_CLOUDSMANAGER_H
10 #define _VRECKO_CLOUDS_CLOUDSMANAGER_H
11 
12 #include "cloud.h"
13 #include "Cloud2DPlacement.h"
14 
15 extern bool g_Anisotropic_scattering;
16 extern bool g_MultipleForwardScattering;
17 
23 {
24  // Contains the sun properties
26  bool sunShow;
27 
28  // Number of clouds in the scene
29  unsigned int numOfClouds;
30 
31  // Scale of the clouds
32  float scale;
33 
34  // CloudGrowth - half-axis of the ellipsoid from which the cloud is generated (all three coordinates)
35  // CloudGrowthRand - pseudo random numbers from the interval <0, CloudGrowthRand - 1> are added to the CloudGrowth
36  // to increase the randomness
37  // GrowthSimulationSteps - number of simulation steps
38  // GrowthSimulationStepsRand - pseudo random number from the interval <0, GrowthSimulationStepsRand - 1> is added
39  // to the GrowthSimulationSteps to increase the randomness
40  unsigned int CloudGrowth[3], CloudGrowthRand[3],
42 
43 
44  // Position of the block in which the clouds are located
46  // Dimensions of the block in which the clouds are located
47  unsigned int CloudFlatAreaSize[3];
48 
49  // Path to the cloud texture
51 
52  // maxCloudUpdatesParFrame - maximum number of clouds updated in one frame
53  // translateErrorTolerance - error tolerance
56 
57  // loadFromFile - Indicates if the scene is loaded from files and not generated from parameters
58  // saveToFile - Indicates if the scene is saved to files afterwards
60 
61  // Skybox properties
62  bool skyboxShow; // Indicates if the skybox should be used
63  long skyboxSize; // Length of the skybox cube edge
65  std::string skyBoxTexturePathTop;
68  std::string skyBoxTexturePathWest;
69  std::string skyBoxTexturePathEast;
70 
71  // Ground properties
72  bool groundShow;
74  std::string groundTexturePath;
75 };
76 
82 {
83 public:
84  std::vector<Cloud> clouds;
85 
89 public:
91  ~CloudsManager() { this->Delete(); }
92 
96  void LoadAndInitiate(void);
97 
103  void SetUVCoords(bool singleTexture = false);
104 
112  void Update(const osg::Vec3f& cameraPosition, const osg::Vec3f& cameraView, const osg::Vec3f& cameraUp);
113 
119  int SaveToFile(void);
120 
128  int LoadFromFile(void);
129 
133  void Delete(void);
134 };
135 
136 extern CloudsManager g_Clouds;
137 
138 #endif