Public Member Functions | |
FluidProgram () | |
FluidProgram (const FluidProgram ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
META_Node (osgParticle, FluidProgram) | |
void | setFluidViscosity (float v) |
Set the viscosity of the fluid. | |
float | getFluidViscosity () const |
Get the viscosity of the fluid. | |
void | setFluidDensity (float d) |
Set the density of the fluid. | |
float | getFluidDensity () const |
Get the density of the fluid. | |
void | setWind (const osg::Vec3 &wind) |
Set the wind vector. | |
const osg::Vec3 & | getWind () const |
Get the wind vector. | |
void | setAcceleration (const osg::Vec3 &v) |
Set the acceleration vector. | |
const osg::Vec3 & | getAcceleration () const |
Get the acceleration vector. | |
void | setToGravity (float scale=1.0f) |
Set the acceleration vector to the gravity on earth (0, 0, -9.81). | |
void | setFluidToAir () |
Set the fluid parameters as for air (20°C temperature). | |
void | setFluidToWater () |
Set the fluid parameters as for pure water (20°C temperature). | |
Protected Member Functions | |
virtual | ~FluidProgram () |
FluidProgram & | operator= (const FluidProgram &) |
virtual void | execute (double dt) |
Execute the program on the particle system. Must be overriden in descendant classes. | |
Protected Attributes | |
osg::Vec3 | _acceleration |
float | _viscosity |
float | _density |
osg::Vec3 | _wind |
float | _viscosityCoefficient |
float | _densityCoefficient |
To use a FluidProgram
you have to create some Operator
objects and add them to the program. All operators will be applied to each particle in the same order they've been added to the program.
osgParticle::FluidProgram::FluidProgram | ( | ) |
osgParticle::FluidProgram::FluidProgram | ( | const FluidProgram & | copy, | |
const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY | |||
) |
virtual osgParticle::FluidProgram::~FluidProgram | ( | ) | [inline, protected, virtual] |
osgParticle::FluidProgram::META_Node | ( | osgParticle | , | |
FluidProgram | ||||
) |
void osgParticle::FluidProgram::setFluidViscosity | ( | float | v | ) | [inline] |
Set the viscosity of the fluid.
float osgParticle::FluidProgram::getFluidViscosity | ( | ) | const [inline] |
Get the viscosity of the fluid.
void osgParticle::FluidProgram::setFluidDensity | ( | float | d | ) | [inline] |
Set the density of the fluid.
float osgParticle::FluidProgram::getFluidDensity | ( | ) | const [inline] |
Get the density of the fluid.
void osgParticle::FluidProgram::setWind | ( | const osg::Vec3 & | wind | ) | [inline] |
Set the wind vector.
const osg::Vec3& osgParticle::FluidProgram::getWind | ( | ) | const [inline] |
Get the wind vector.
void osgParticle::FluidProgram::setAcceleration | ( | const osg::Vec3 & | v | ) | [inline] |
Set the acceleration vector.
const osg::Vec3& osgParticle::FluidProgram::getAcceleration | ( | ) | const [inline] |
Get the acceleration vector.
void osgParticle::FluidProgram::setToGravity | ( | float | scale = 1.0f |
) | [inline] |
Set the acceleration vector to the gravity on earth (0, 0, -9.81).
The acceleration will be multiplied by the scale
parameter.
void osgParticle::FluidProgram::setFluidToAir | ( | ) | [inline] |
Set the fluid parameters as for air (20°C temperature).
void osgParticle::FluidProgram::setFluidToWater | ( | ) | [inline] |
Set the fluid parameters as for pure water (20°C temperature).
FluidProgram& osgParticle::FluidProgram::operator= | ( | const FluidProgram & | ) | [inline, protected] |
virtual void osgParticle::FluidProgram::execute | ( | double | dt | ) | [protected, virtual] |
Execute the program on the particle system. Must be overriden in descendant classes.
Implements osgParticle::Program.
osg::Vec3 osgParticle::FluidProgram::_acceleration [protected] |
float osgParticle::FluidProgram::_viscosity [protected] |
float osgParticle::FluidProgram::_density [protected] |
osg::Vec3 osgParticle::FluidProgram::_wind [protected] |
float osgParticle::FluidProgram::_viscosityCoefficient [protected] |
float osgParticle::FluidProgram::_densityCoefficient [protected] |