OpenSceneGraph 2.8.3
|
An operator that simulates the friction of a fluid. More...
Public Member Functions | |
FluidFrictionOperator () | |
FluidFrictionOperator (const FluidFrictionOperator ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
META_Object (osgParticle, FluidFrictionOperator) | |
void | setFluidDensity (float d) |
Set the density of the fluid. | |
float | getFluidDensity () const |
Get the density of the fluid. | |
void | setFluidViscosity (float v) |
Set the viscosity of the fluid. | |
float | getFluidViscosity () const |
Get the viscosity of the fluid. | |
void | setWind (const osg::Vec3 &wind) |
Set the wind vector. | |
const osg::Vec3 & | getWind () const |
Get the wind vector. | |
void | setOverrideRadius (float r) |
Set the overriden radius value (pass 0 if you want to use particle's radius). | |
float | getOverrideRadius () const |
Get the overriden radius value. | |
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). | |
void | operate (Particle *P, double dt) |
Apply the friction forces to a particle. Do not call this method manually. | |
void | beginOperate (Program *prg) |
Perform some initializations. Do not call this method manually. | |
Protected Member Functions | |
virtual | ~FluidFrictionOperator () |
FluidFrictionOperator & | operator= (const FluidFrictionOperator &) |
An operator that simulates the friction of a fluid.
By using this operator you can let the particles move in a fluid of a given density and viscosity. There are two functions to quickly setup the parameters for pure water and air. You can decide whether to compute the forces using the particle's physical radius or another value, by calling the setOverrideRadius()
method.
osgParticle::FluidFrictionOperator::FluidFrictionOperator | ( | ) |
osgParticle::FluidFrictionOperator::FluidFrictionOperator | ( | const FluidFrictionOperator & | copy, |
const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY |
||
) |
virtual osgParticle::FluidFrictionOperator::~FluidFrictionOperator | ( | ) | [inline, protected, virtual] |
void osgParticle::FluidFrictionOperator::beginOperate | ( | Program * | prg | ) | [inline, virtual] |
Perform some initializations. Do not call this method manually.
Reimplemented from osgParticle::Operator.
float osgParticle::FluidFrictionOperator::getFluidDensity | ( | ) | const [inline] |
Get the density of the fluid.
float osgParticle::FluidFrictionOperator::getFluidViscosity | ( | ) | const [inline] |
Get the viscosity of the fluid.
float osgParticle::FluidFrictionOperator::getOverrideRadius | ( | ) | const [inline] |
Get the overriden radius value.
const osg::Vec3& osgParticle::FluidFrictionOperator::getWind | ( | ) | const [inline] |
Get the wind vector.
osgParticle::FluidFrictionOperator::META_Object | ( | osgParticle | , |
FluidFrictionOperator | |||
) |
void osgParticle::FluidFrictionOperator::operate | ( | Particle * | P, |
double | dt | ||
) | [virtual] |
Apply the friction forces to a particle. Do not call this method manually.
Implements osgParticle::Operator.
FluidFrictionOperator& osgParticle::FluidFrictionOperator::operator= | ( | const FluidFrictionOperator & | ) | [inline, protected] |
void osgParticle::FluidFrictionOperator::setFluidDensity | ( | float | d | ) | [inline] |
Set the density of the fluid.
References osg::PI.
Referenced by setFluidToAir(), and setFluidToWater().
void osgParticle::FluidFrictionOperator::setFluidToAir | ( | ) | [inline] |
Set the fluid parameters as for air (20°C temperature).
References setFluidDensity(), and setFluidViscosity().
void osgParticle::FluidFrictionOperator::setFluidToWater | ( | ) | [inline] |
Set the fluid parameters as for pure water (20°C temperature).
References setFluidDensity(), and setFluidViscosity().
void osgParticle::FluidFrictionOperator::setFluidViscosity | ( | float | v | ) | [inline] |
Set the viscosity of the fluid.
References osg::PI.
Referenced by setFluidToAir(), and setFluidToWater().
void osgParticle::FluidFrictionOperator::setOverrideRadius | ( | float | r | ) | [inline] |
Set the overriden radius value (pass 0 if you want to use particle's radius).
void osgParticle::FluidFrictionOperator::setWind | ( | const osg::Vec3 & | wind | ) | [inline] |
Set the wind vector.
![]() | Generated at Tue Mar 22 2011 13:20:28 for the OpenSceneGraph by doxygen 1.7.3. |