24#ifndef _SkyX_VClouds_DataManager_H_
25#define _SkyX_VClouds_DataManager_H_
27#include "Prerequisites.h"
31namespace SkyX {
namespace VClouds{
78 void create(
const int& nx,
const int& ny,
const int& nz);
83 void update(
const Ogre::Real &timeSinceLastFrame);
130 void setWheater(
const float& Humidity,
const float& AverageCloudsSize,
const bool& delayedResponse =
true);
150 void _initData(
const int& nx,
const int& ny,
const int& nz);
159 Cell ***
_create3DCellArray(
const int& nx,
const int& ny,
const int& nz,
const bool& init =
true);
185 void _performCalculations(
const int& nx,
const int& ny,
const int& nz,
const int& step,
const int& xStart,
const int& xEnd);
207 const float _getDensityAt(Cell ***c,
const int& nx,
const int& ny,
const int& nz,
const int&
x,
const int&
y,
const int&
z,
const int& r,
const float& strength)
const;
215 const float _getDensityAt(Cell ***c,
const int&
x,
const int&
y,
const int&
z)
const;
226 const bool _fact(Cell ***c,
const int& nx,
const int& ny,
const int& nz,
const int&
x,
const int&
y,
const int&
z)
const;
235 void _clearProbabilities(Cell*** c,
const int& nx,
const int& ny,
const int& nz,
const bool& clearData);
244 void _updateProbabilities(Cell*** c,
const int& nx,
const int& ny,
const int& nz,
const bool& delayedResponse);
257 const Ogre::Real
_getLightAbsorcionAt(Cell*** c,
const int& nx,
const int& ny,
const int& nz,
const int&
x,
const int&
y,
const int&
z,
const Ogre::Vector3& d,
const float& att)
const;
VClouds * mVClouds
SkyX parent pointer.
int mMaxNumberOfClouds
Max number of clouds(Ellipsoids)
const Ogre::Real _getInterpolation() const
Get current interpolation factor.
float mCurrentTransition
Current transition.
Cell *** mCellsCurrent
Simulation data.
void _updateProbabilities(Cell ***c, const int &nx, const int &ny, const int &nz, const bool &delayedResponse)
Update probabilities based from the Ellipsoid vector.
std::vector< Ellipsoid * > mEllipsoids
Ellipsoids.
const bool & isCreated() const
Has been create(...) already called?
~DataManager()
Destructor.
const Ogre::Real _getLightAbsorcionAt(Cell ***c, const int &nx, const int &ny, const int &nz, const int &x, const int &y, const int &z, const Ogre::Vector3 &d, const float &att) const
Get light absorcion factor at a point.
void setWheater(const float &Humidity, const float &AverageCloudsSize, const bool &delayedResponse=true)
Set wheater parameters Use this funtion to update the cloud field parameters, you'll get a smart and ...
void addEllipsoid(Ellipsoid *e, const bool &UpdateProbabilities=true)
Add ellipsoid: clouds are modelled as ellipsoids in our simulation approach, so.
bool mVolTexToUpdate
Current texture.
void create(const int &nx, const int &ny, const int &nz)
Create.
FastFakeRandom * mFFRandom
Fast fake random.
void _updateVolTextureData(Cell ***c, const VolTextureId &TexId, const int &nx, const int &ny, const int &nz)
Update volumetric texture data.
void _initData(const int &nx, const int &ny, const int &nz)
Initialize data.
void setUpdateTime(const float &UpdateTime)
Set update time.
const float _getDensityAt(Cell ***c, const int &nx, const int &ny, const int &nz, const int &x, const int &y, const int &z, const int &r, const float &strength) const
Get continous density at a point.
const Ogre::Real & getUpdateTime() const
Get update time.
int mStep
Current calculation state.
VolTextureId
Volumetric textures enumeration.
bool mCreated
Has been create(...) already called?
void forceToUpdateData()
Forces the data manager to calculate the next step right now.
const bool _fact(Cell ***c, const int &nx, const int &ny, const int &nz, const int &x, const int &y, const int &z) const
Fact funtion.
Cell *** _create3DCellArray(const int &nx, const int &ny, const int &nz, const bool &init=true)
Create tridimensional cell array.
Ogre::TexturePtr mVolTextures[2]
Volumetric textures array.
void _clearProbabilities(Cell ***c, const int &nx, const int &ny, const int &nz, const bool &clearData)
Clear probabilities.
void _createVolTexture(const VolTextureId &TexId, const int &nx, const int &ny, const int &nz)
Create volumetric texture.
float mUpdateTime
Update time.
void _delete3DCellArray(Cell ***c, const int &nx, const int &ny)
Delete tridimensional cell array.
void _performCalculations(const int &nx, const int &ny, const int &nz, const int &step, const int &xStart, const int &xEnd)
Perform celullar automata simulation.
void _copy3DCellArraysData(Cell ***src, Cell ***dest, const int &nx, const int &ny, const int &nz)
Copy 3d cells arrays data.
void update(const Ogre::Real &timeSinceLastFrame)
Update.
Ellipsoid class x^2 y^2 z^2 / + / + / = 1 a^2 b^2 c^2.
float dens
Continous density.
float light
Light absorcion.
bool hum
Humidity, phase and cloud.