Eulerian Smoke Simulation on the GPU
FluidEngine Class Reference

A container class that simulates smoke and renders it as a mesh or as a 2D plane. More...

#include <FluidEngine.h>

List of all members.

Public Types

enum  RenderField { VELOCITY, PRESSURE, TEMPERATURE, DENSITY }

Public Member Functions

 FluidEngine (int _simResX, int _simResY, int _simResZ)
 Constructor.
 ~FluidEngine ()
 Destructor.
void init ()
 Initialization function.
void updateOutputs ()
 Updates the simulaton outputs.
void drawMesh (RenderField _field, ngl::TransformStack &_transformStack)
 Draws a field as a mesh.
void setIsoLevel (float _isoLevel)
 Set the iso level value for the meshing operation.
void setSamplingChannel (int _channelIndex)
 Sets the 3D texture channel to sample from.
void setMeshingMethod (int _meshingMethod)
 Changes the active meshing method.
void setMeshColour (float _r, float _g, float _b)
 Sets the mesh's colour.
void drawSlice (RenderField _field, ngl::TransformStack &_transformStack)
 Draws a field as a 2D slice.
void setSliceOpacity (float _opacity)
 Sets the slice's opacity.
void setSlicePos (int _slicePos)
 Sets the slice's position in the Z axis.
void drawObstacles (ngl::TransformStack &_transformStack)
 Draws the simulation obstacles.
void drawContainer (ngl::TransformStack &_transformStack)
 Draws the simulation's container.
void passViewProjectionMatrix (ngl::Matrix _modelView, ngl::Matrix _projection)
 Passes the view and projection matrices to the engine.
int getSimResX () const
 Accessor for the simulation's resolution in X.
int getSimResY () const
 Accessor for the simulation's resolution in Y.
int getSimResZ () const
 Accessor for the simulation's resolution in Z.
void resetResolution ()
 Resets the simulation's resolution.
GasSolvergetGasSolver () const
 Accessor for the engine's gas solver.
void setObstacleGeometry (int _geoIndex)
 Sets the obstacle's geometry type.
void setCellSize (float _cellSize)
 Sets the simulation's cell size.
void setSplatRadius (float _splatRadius)
 Sets the splat radius.
void setAmbientTemperature (float _ambientTemperature)
 Set the ambient temperature.
void setImpulseTemperature (float _impulseTemperature)
 Sets the impulse temperature.
void setImpulseDensity (float _impulseDensity)
 Sets the impulse density amount.
void setImpulsePosition (float _posX, float _posY, float _posZ)
 Sets the impulse's position.
void setPoissonIterations (int _numPoissonIterations)
 Sets the number of iterations of the Poisson solver.
void setTimestep (float _timestep)
 Sets the time-step.
void setBuoyancyLift (float _buoyancyLift)
 Sets the buoyancy lift factor.
void setGasWeight (float _gasWeight)
 Sets the gas weight.
void setBuoyancyDirection (float _dirX, float _dirY, float _dirZ)
 Sets the buoyancy force direction.
void togglePeriodicNoise (bool _enablePeriodicNoise)
 Toggles the periodic noise function.
void setNoiseVariance (float _noiseVarianceX, float _noiseVarianceY, float _noiseVarianceZ)
 Sets the periodic noise variance.
void setNoiseDrivingFunc (int _funcIndexX, int _funcIndexY, int _funcIndexZ)
 Sets the periodic noise driving function.
void setTemperatureDissipation (float _temperatureDissipation)
 Set the temperature's dissipation factor.
void setDensityDissipation (float _densityDissipation)
 Sets the density dissipation factor.
void setVelocityDissipation (float _velocityDissipation)
 Sets the velocity dissipation factor.

Detailed Description

A container class that simulates smoke and renders it as a mesh or as a 2D plane.

Author:
Nikolaos Verigakis
Version:
1.0
Date:
08/07/11 Revision History : Initial Version 08/07/11

Constructor & Destructor Documentation

FluidEngine::FluidEngine ( int  _simResX,
int  _simResY,
int  _simResZ 
)

Constructor.

Parameters:
[in]_simResXthe simulation's resolution in X
[in]_simResYthe simulation's resolution in Y
[in]_simResZthe simulation's resolution in Z

Member Function Documentation

void FluidEngine::drawContainer ( ngl::TransformStack &  _transformStack)

Draws the simulation's container.

Parameters:
[in]_transformStackthe active transform stack
void FluidEngine::drawMesh ( RenderField  _field,
ngl::TransformStack &  _transformStack 
)

Draws a field as a mesh.

Parameters:
[in]_fieldthe field to render
void FluidEngine::drawObstacles ( ngl::TransformStack &  _transformStack)

Draws the simulation obstacles.

Parameters:
[in]_transformStackthe active transform stack
void FluidEngine::drawSlice ( RenderField  _field,
ngl::TransformStack &  _transformStack 
)

Draws a field as a 2D slice.

Parameters:
[in]_fieldthe field to render
void FluidEngine::passViewProjectionMatrix ( ngl::Matrix  _modelView,
ngl::Matrix  _projection 
)

Passes the view and projection matrices to the engine.

Parameters:
[in]_modelViewthe model view matrix
[in]_projectionthe projection matrix
void FluidEngine::setAmbientTemperature ( float  _ambientTemperature) [inline]

Set the ambient temperature.

Parameters:
[in]_ambientTemperaturethe new ambient temperature
void FluidEngine::setBuoyancyDirection ( float  _dirX,
float  _dirY,
float  _dirZ 
) [inline]

Sets the buoyancy force direction.

Parameters:
[in]_dirXthe direction in X
[in]_dirYthe direction in Y
[in]_dirZthe direction in Z
void FluidEngine::setBuoyancyLift ( float  _buoyancyLift) [inline]

Sets the buoyancy lift factor.

Parameters:
[in]_buoyancyLiftthe new buoyancy lift factor
void FluidEngine::setCellSize ( float  _cellSize) [inline]

Sets the simulation's cell size.

Parameters:
[in]_cellSizethe new cell size
void FluidEngine::setDensityDissipation ( float  _densityDissipation) [inline]

Sets the density dissipation factor.

Parameters:
[in]_densityDissipationthe new density dissipation
void FluidEngine::setGasWeight ( float  _gasWeight) [inline]

Sets the gas weight.

Parameters:
[in]_gasWeightthe new gas weight
void FluidEngine::setImpulseDensity ( float  _impulseDensity) [inline]

Sets the impulse density amount.

Parameters:
[in]_impulseDensitythe new impulse density
void FluidEngine::setImpulsePosition ( float  _posX,
float  _posY,
float  _posZ 
) [inline]

Sets the impulse's position.

Parameters:
[in]_posXthe X coordinate of the splat
[in]_posYthe Y coordinate of the splat
[in]_posZthe Z coordinate of the splat
void FluidEngine::setImpulseTemperature ( float  _impulseTemperature) [inline]

Sets the impulse temperature.

Parameters:
[in]_impulseTemperaturethe new impulse temperature
void FluidEngine::setIsoLevel ( float  _isoLevel)

Set the iso level value for the meshing operation.

Parameters:
[in]_isoLevelthe new iso level
void FluidEngine::setMeshColour ( float  _r,
float  _g,
float  _b 
)

Sets the mesh's colour.

Parameters:
[in]_rthe colour's red channel
[in]_gthe colour's green channel
[in]_bthe colour's blue channel
void FluidEngine::setMeshingMethod ( int  _meshingMethod)

Changes the active meshing method.

Parameters:
[in]_meshingMethodthe meshing method
void FluidEngine::setNoiseDrivingFunc ( int  _funcIndexX,
int  _funcIndexY,
int  _funcIndexZ 
) [inline]

Sets the periodic noise driving function.

Parameters:
[in]_funcIndexXthe index of the driving function in X
[in]_funcIndexYthe index of the driving function in Y
[in]_funcIndexZthe index of the driving function in Z
void FluidEngine::setNoiseVariance ( float  _noiseVarianceX,
float  _noiseVarianceY,
float  _noiseVarianceZ 
) [inline]

Sets the periodic noise variance.

Parameters:
[in]_noiseVarianceXthe turbulance variance in X
[in]_noiseVarianceYthe turbulance variance in Y
[in]_noiseVarianceZthe turbulance variance in Z
void FluidEngine::setObstacleGeometry ( int  _geoIndex)

Sets the obstacle's geometry type.

Parameters:
[in]_geoIndexthe geometry index
void FluidEngine::setPoissonIterations ( int  _numPoissonIterations) [inline]

Sets the number of iterations of the Poisson solver.

Parameters:
[in]_numPoissonIterationsthe number of iterations
void FluidEngine::setSamplingChannel ( int  _channelIndex)

Sets the 3D texture channel to sample from.

Parameters:
[in]_channelIndexthe index of the channel to sample
void FluidEngine::setSliceOpacity ( float  _opacity)

Sets the slice's opacity.

Parameters:
[in]_opacitythe new opacity
void FluidEngine::setSlicePos ( int  _slicePos)

Sets the slice's position in the Z axis.

Parameters:
[in]_sliceNumthe slice's position
void FluidEngine::setSplatRadius ( float  _splatRadius) [inline]

Sets the splat radius.

Parameters:
[in]_splatRadiusthe new splat radius
void FluidEngine::setTemperatureDissipation ( float  _temperatureDissipation) [inline]

Set the temperature's dissipation factor.

Parameters:
[in]_temperatureDissipationthe new temperature dissipation
void FluidEngine::setTimestep ( float  _timestep) [inline]

Sets the time-step.

Parameters:
[in]_timestepthe new time-step
void FluidEngine::setVelocityDissipation ( float  _velocityDissipation) [inline]

Sets the velocity dissipation factor.

Parameters:
[in]_velocityDissipationthe new velocity dissipation
void FluidEngine::togglePeriodicNoise ( bool  _enablePeriodicNoise) [inline]

Toggles the periodic noise function.

Parameters:
[in]_enablePeriodicNoisethe periodic noise toggling flag

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables