OpenSceneGraph
3.0.1
|
A program class for performing operations on particles using a sequence of operators. More...
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 |
A program class for performing operations on particles using a sequence of operators.
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] |
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.
const osg::Vec3& osgParticle::FluidProgram::getAcceleration | ( | ) | const [inline] |
Get the acceleration vector.
float osgParticle::FluidProgram::getFluidDensity | ( | ) | const [inline] |
Get the density of the fluid.
float osgParticle::FluidProgram::getFluidViscosity | ( | ) | const [inline] |
Get the viscosity of the fluid.
const osg::Vec3& osgParticle::FluidProgram::getWind | ( | ) | const [inline] |
Get the wind vector.
osgParticle::FluidProgram::META_Node | ( | osgParticle | , |
FluidProgram | |||
) |
FluidProgram& osgParticle::FluidProgram::operator= | ( | const FluidProgram & | ) | [inline, protected] |
void osgParticle::FluidProgram::setAcceleration | ( | const osg::Vec3 & | v | ) | [inline] |
Set the acceleration vector.
void osgParticle::FluidProgram::setFluidDensity | ( | float | d | ) | [inline] |
Set the density of the fluid.
References osg::PI.
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).
void osgParticle::FluidProgram::setFluidViscosity | ( | float | v | ) | [inline] |
Set the viscosity of the fluid.
References osg::PI.
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::setWind | ( | const osg::Vec3 & | wind | ) | [inline] |
Set the wind vector.
osg::Vec3 osgParticle::FluidProgram::_acceleration [protected] |
float osgParticle::FluidProgram::_density [protected] |
float osgParticle::FluidProgram::_densityCoefficient [protected] |
float osgParticle::FluidProgram::_viscosity [protected] |
float osgParticle::FluidProgram::_viscosityCoefficient [protected] |
osg::Vec3 osgParticle::FluidProgram::_wind [protected] |
![]() | Generated at Mon Oct 3 2011 12:39:48 for the OpenSceneGraph by doxygen 1.7.5. |