vrecko
virtual reality framework
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
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
22
struct
CloudsProperties
23
{
24
// Contains the sun properties
25
SunLight
sun
;
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],
41
GrowthSimulationSteps
,
GrowthSimulationStepsRand
;
42
43
44
// Position of the block in which the clouds are located
45
int
CloudFlatAreaPosition
[3];
46
// Dimensions of the block in which the clouds are located
47
unsigned
int
CloudFlatAreaSize
[3];
48
49
// Path to the cloud texture
50
std::string
renderCloudTexturePath
;
51
52
// maxCloudUpdatesParFrame - maximum number of clouds updated in one frame
53
// translateErrorTolerance - error tolerance
54
unsigned
int
maxCloudUpdatesParFrame
;
55
float
translateErrorTolerance
;
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
59
bool
loadFromFile
,
saveToFile
;
60
61
// Skybox properties
62
bool
skyboxShow
;
// Indicates if the skybox should be used
63
long
skyboxSize
;
// Length of the skybox cube edge
64
long
skyboxCenterPosition
[3];
65
std::string
skyBoxTexturePathTop
;
66
std::string
skyBoxTexturePathNorth
;
67
std::string
skyBoxTexturePathSouth
;
68
std::string
skyBoxTexturePathWest
;
69
std::string
skyBoxTexturePathEast
;
70
71
// Ground properties
72
bool
groundShow
;
73
long
groundCenterPosition
[3];
74
std::string
groundTexturePath
;
75
};
76
81
class
CloudsManager
82
{
83
public
:
84
std::vector<Cloud>
clouds
;
85
86
CloudsProperties
properties
;
87
CloudSceneInfo
sceneInfo
;
88
PseudoRand2DPlacement
flatLayer
;
89
public
:
90
CloudsManager
() {}
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
include
vreckoAP
Nature
Clouds
CloudsManager.h
Generated on Tue Feb 19 2013 10:23:44 for vrecko by
1.8.3.1