vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GenClouds.cpp File Reference
#include <iostream>
#include <cstdlib>
#include <vreckoAP/Nature/Clouds/GenClouds.h>
#include <vreckoAP/Nature/Clouds/math_aux.h>

Macros

#define NX   100
 
#define NY   100
 
#define NZ   100
 

Functions

void InitCloudGrowth (int ellips_a, int ellips_b, int ellips_c)
 
bool f_act (unsigned int i, unsigned int j, unsigned int k)
 
void GrowthSimulation (int timeSteps)
 
float weightedSum (unsigned int i, unsigned int j, unsigned int k)
 
void CreateCloudFromVoxels (Cloud &cloud, const osg::Vec3f &cloudPos, float scale)
 

Variables

CloudVoxel voxel_space [NX][NY][NZ]
 
int ellipsoid_2a = 0
 
int ellipsoid_2b = 0
 
int ellipsoid_2c = 0
 

Detailed Description

Author
Jakub Kroupal (original Atmospheric plug-in)
Rastislav Tisovcik (revised Clouds ability)
Version
2.0
Date
2008 (Atmospheric), January 2011 (Clouds)

Macro Definition Documentation

#define NX   100
#define NY   100
#define NZ   100

Function Documentation

void CreateCloudFromVoxels ( Cloud cloud,
const osg::Vec3f &  cloudPos,
float  scale 
)

Converts the voxel space into the final cloud

Parameters
[in]cloudInstance of a cloud which is used to store the data from the voxel space
[in]cloudPosPosition of the cloud in the scene
[in]scaleScale of the cloud
bool f_act ( unsigned int  i,
unsigned int  j,
unsigned int  k 
)

Function computing the active value of the given cell as described in the thesis (p.3, formula 2.4)

Parameters
[in]iX-coordinate of the voxel in the cloud
[in]jY-coordinate of the voxel in the cloud
[in]kZ-coordinate of the voxel in the cloud
void GrowthSimulation ( int  timeSteps)

Simulates the growth of the cloud

Parameters
timeStepsNumber of steps the generation process should take
void InitCloudGrowth ( int  ellips_a,
int  ellips_b,
int  ellips_c 
)

Initializes the growth simulation of the cloud

Parameters
[in]ellips_aSize of the half-axis a of the ellipsoid
[in]ellips_bSize of the half-axis b of the ellipsoid
[in]ellips_cSize of the half-axis c of the ellipsoid
float weightedSum ( unsigned int  i,
unsigned int  j,
unsigned int  k 
)

Computes the weighted sum of the cloud cell and cells related to it.

Parameters
[in]iX coordinate of the cloud cell in the voxel space
[in]jY coordinate of the cloud cell in the voxel space
[in]kZ coordinate of the cloud cell in the voxel space
Returns
Weighted sum of the cloud cell and cells related to it.

Variable Documentation

int ellipsoid_2a = 0
int ellipsoid_2b = 0
int ellipsoid_2c = 0
CloudVoxel voxel_space[NX][NY][NZ]