vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CloudsManager Class Reference

Manages all the clouds in the scene. More...

#include <CloudsManager.h>

Public Member Functions

 CloudsManager ()
 
 ~CloudsManager ()
 
void LoadAndInitiate (void)
 
void SetUVCoords (bool singleTexture=false)
 
void Update (const osg::Vec3f &cameraPosition, const osg::Vec3f &cameraView, const osg::Vec3f &cameraUp)
 
int SaveToFile (void)
 
int LoadFromFile (void)
 
void Delete (void)
 

Public Attributes

std::vector< Cloudclouds
 
CloudsProperties properties
 
CloudSceneInfo sceneInfo
 
PseudoRand2DPlacement flatLayer
 

Detailed Description

Manages all the clouds in the scene.

Constructor & Destructor Documentation

CloudsManager::CloudsManager ( )
inline
CloudsManager::~CloudsManager ( )
inline

Member Function Documentation

void CloudsManager::Delete ( void  )

Deletes the cloud manager and all clouds associated with it.

void CloudsManager::LoadAndInitiate ( void  )

Initializes and generates (loads from files) all the clouds and attributes associated with them (also saves them afterwards to disk if necessary).

int CloudsManager::LoadFromFile ( void  )

Loads previously saved cloud files from the disk into the manager's std::vector. Files are loaded sequentially in ascending order. If the loading process of one of any them fails, all the following files are not loaded.

Returns
0 if at least one cloud file was successfully loaded, false otherwise.
int CloudsManager::SaveToFile ( void  )

Saves the clouds into filesystem, every cloud in a separate .txt file.

Returns
0 if everything went well and all files were saved to the disk, -1 otherwise.
void CloudsManager::SetUVCoords ( bool  singleTexture = false)

Set up the UV texture coordinates for all of the cloud particles.

Parameters
singleTextureIndicates whether the cloud texture cotains a single texture which is displayed on every particle or four different textures for different values of alpha channel (optional, default = false)
void CloudsManager::Update ( const osg::Vec3f &  cameraPosition,
const osg::Vec3f &  cameraView,
const osg::Vec3f &  cameraUp 
)

Updates the status of all of the clouds and launches the realization of the update of impostors from the priority queue.

Parameters
[in]cameraPosPosition of the camera.
[in]cameraViewDirection in which the camera is looking.
[in]cameraUpThe 'Up' direction of the camera.

Member Data Documentation

std::vector<Cloud> CloudsManager::clouds
PseudoRand2DPlacement CloudsManager::flatLayer
CloudsProperties CloudsManager::properties
CloudSceneInfo CloudsManager::sceneInfo

The documentation for this class was generated from the following files: