![]() |
VR-Forces 4.1 Class Documentation
|
A particle system for creating a single puff of smoke with a normal (or Gaussian) distribution of particles to simulate a tactical smoke cloud. More...

Public Member Functions | |
| DtTacticalSmokeEffect () | |
| Default constructor. | |
| DtTacticalSmokeEffect (const DtTacticalSmokeEffect ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
| Copy constructor. | |
| META_Node (makVrv, DtTacticalSmokeEffect) | |
| osg::MatrixTransform * | particleTransform () |
| Get the transform for the particle system. | |
| const osg::MatrixTransform * | particleTransform () const |
| DtTacticalSmokeEmitter * | particleEmitter () |
| Get the particle emitter. | |
| const DtTacticalSmokeEmitter * | particleEmitter () const |
| osgParticle::Shooter * | particleShooter () |
| Get the particle emitter shooter. | |
| const osgParticle::Shooter * | particleShooter () const |
| osgParticle::Placer * | particlePlacer () |
| Get the particle emitter placer. | |
| const osgParticle::Placer * | particlePlacer () const |
| osgParticle::Counter * | particleCounter () |
| Get the particle emitter counter. | |
| const osgParticle::Counter * | particleCounter () const |
| osgParticle::ParticleSystem * | particleSystem () |
| Get the particle system. | |
| const osgParticle::ParticleSystem * | particleSystem () const |
| osgParticle::Particle & | particleTemplate () |
| Get the particle template. | |
| const osgParticle::Particle & | particleTemplate () const |
| DtTranslateOperator * | particleOperator () |
| Get the particle operator for simple wind. | |
| const DtTranslateOperator * | particleOperator () const |
| void | setParticleSpeed (double speed) |
| Set the constant speed of particles. | |
| void | setParticleLifetime (double life) |
| Set the constant lifetime of particles. | |
| void | setOneSigmaDistance (int puffIndex, const osg::Vec3d &dist) |
| Set the one-sigma distance per orthogonal direction. | |
| void | setDensity (int puffIndex, double dens) |
| Set the density of the tactical smoke. | |
| void | setPlacement (int puffIndex, const osg::Vec3d &pos) |
| Set the placement position particles are emitted from for a puff. | |
| void | setEmitterLifetime (double life) |
| Set the lifetime of the emitter. | |
| void | setParticleSizeRange (double isz, double fsz) |
| Set the particle size range. | |
| void | setParticleRotationRange (double mn, double mx) |
| Set the particle rotation range. | |
| void | setParticleColorRange (const osg::Vec4 &icl, const osg::Vec4 &fcl) |
| Set the particle color range. | |
| void | setParticleAlphaMultiplier (double alpha) |
| Set the initial particle alpha value multiplier. | |
| void | setIntensityRange (double mn, double mx) |
| Set the intensity range. | |
| void | setWind (const osg::Vec3d &wnd) |
| Set the wind direction and magnitude. | |
| void | setTexture (const std::string &txt) |
| Set the filename of the texture used on each particle. | |
| void | start () |
| Start emitting particles. | |
| void | stop () |
| Stop emitting particles. | |
| void | pause () |
| Freeze particle generation. | |
| void | resume () |
| Resume particle generation. | |
| void | setDefaults () |
| Set the system to default values. | |
| virtual void | traverse (osg::NodeVisitor &nv) |
| Interrupt CullVisitors to update the internal transforms. | |
Protected Member Functions | |
| void | initialize () |
| Set up the particle system. | |
| virtual | ~DtTacticalSmokeEffect () |
| Virtual destructor. | |
Private Attributes | |
| osg::ref_ptr < osg::MatrixTransform > | myParticleTransform |
| osg::ref_ptr < osgParticle::ParticleSystem > | myParticleSystem |
| osg::ref_ptr < DtTacticalSmokeEmitter > | myEmitter |
| osg::ref_ptr< DtTranslateOperator > | myWindOperator |
| bool | myTransformIsSet |
| std::string | myTexture |
A particle system for creating a single puff of smoke with a normal (or Gaussian) distribution of particles to simulate a tactical smoke cloud.
This class provides a facade around a single osgParticle class hierarchy. This class is designed specifically for tactical smoke effects which require augmenting an effect over time, which usual effect systems do not handle. This class defines a smoke cloud 'puff' with a Gaussian distribution of particles, and the cloud can be resized and and deformed over the lifetime of the effect without having to stop and restart the effect. The distribution of particles is defined by a custom shooter attached to the particle emitter.
| makVrv::DtTacticalSmokeEffect::DtTacticalSmokeEffect | ( | ) |
Default constructor.
| makVrv::DtTacticalSmokeEffect::DtTacticalSmokeEffect | ( | const DtTacticalSmokeEffect & | copy, |
| const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY |
||
| ) |
Copy constructor.
| [in] | copy | is the object to copy from. |
| [in] | copyop | is a flag describing the type of copy. |
|
protectedvirtual |
Virtual destructor.
| makVrv::DtTacticalSmokeEffect::META_Node | ( | makVrv | , |
| DtTacticalSmokeEffect | |||
| ) |
| osg::MatrixTransform* makVrv::DtTacticalSmokeEffect::particleTransform | ( | ) |
Get the transform for the particle system.
| const osg::MatrixTransform* makVrv::DtTacticalSmokeEffect::particleTransform | ( | ) | const |
| DtTacticalSmokeEmitter* makVrv::DtTacticalSmokeEffect::particleEmitter | ( | ) |
Get the particle emitter.
| const DtTacticalSmokeEmitter* makVrv::DtTacticalSmokeEffect::particleEmitter | ( | ) | const |
| osgParticle::Shooter* makVrv::DtTacticalSmokeEffect::particleShooter | ( | ) |
Get the particle emitter shooter.
| const osgParticle::Shooter* makVrv::DtTacticalSmokeEffect::particleShooter | ( | ) | const |
| osgParticle::Placer* makVrv::DtTacticalSmokeEffect::particlePlacer | ( | ) |
Get the particle emitter placer.
| const osgParticle::Placer* makVrv::DtTacticalSmokeEffect::particlePlacer | ( | ) | const |
| osgParticle::Counter* makVrv::DtTacticalSmokeEffect::particleCounter | ( | ) |
Get the particle emitter counter.
| const osgParticle::Counter* makVrv::DtTacticalSmokeEffect::particleCounter | ( | ) | const |
| osgParticle::ParticleSystem* makVrv::DtTacticalSmokeEffect::particleSystem | ( | ) |
Get the particle system.
| const osgParticle::ParticleSystem* makVrv::DtTacticalSmokeEffect::particleSystem | ( | ) | const |
| osgParticle::Particle& makVrv::DtTacticalSmokeEffect::particleTemplate | ( | ) |
Get the particle template.
| const osgParticle::Particle& makVrv::DtTacticalSmokeEffect::particleTemplate | ( | ) | const |
| DtTranslateOperator* makVrv::DtTacticalSmokeEffect::particleOperator | ( | ) |
Get the particle operator for simple wind.
| const DtTranslateOperator* makVrv::DtTacticalSmokeEffect::particleOperator | ( | ) | const |
| void makVrv::DtTacticalSmokeEffect::setParticleSpeed | ( | double | speed | ) |
Set the constant speed of particles.
| [in] | speed | is the speed in meter-per-second, default 0.25. |
lifetime = (| rand | * sigma) / speed where rand is a Gaussian distribution. | void makVrv::DtTacticalSmokeEffect::setParticleLifetime | ( | double | life | ) |
Set the constant lifetime of particles.
| [in] | life | is the lifetime in second, default 30.0. |
speed = (| rand | * sigma) / lifetime where rand is a Gaussian distribution. | void makVrv::DtTacticalSmokeEffect::setOneSigmaDistance | ( | int | puffIndex, |
| const osg::Vec3d & | dist | ||
| ) |
Set the one-sigma distance per orthogonal direction.
| [in] | puffIndex | is the index of the puff for sigma-distances. |
| [in] | dist | is the distance in each direction where the probability of particle distribution within that distance is one-sigma (68.3%), default is Vec3d(1.0, 1.0, 1.0). |
| void makVrv::DtTacticalSmokeEffect::setDensity | ( | int | puffIndex, |
| double | dens | ||
| ) |
Set the density of the tactical smoke.
Density is simulated by the starting alpha value of the particles.
| [in] | puffIndex | is the index of the puff for density changes. |
| [in] | dens | is the density of smoke, default 1.0. |
| void makVrv::DtTacticalSmokeEffect::setPlacement | ( | int | puffIndex, |
| const osg::Vec3d & | pos | ||
| ) |
Set the placement position particles are emitted from for a puff.
| [in] | puffIndex | is the index of the placement |
| [in] | pos | is the position for the placer. |
| void makVrv::DtTacticalSmokeEffect::setEmitterLifetime | ( | double | life | ) |
Set the lifetime of the emitter.
| [in] | life | is the lifetime in second, default is 0.0. |
| void makVrv::DtTacticalSmokeEffect::setParticleSizeRange | ( | double | isz, |
| double | fsz | ||
| ) |
Set the particle size range.
The particles will each change size over their lifetime from an initial size to a final size.
| [in] | isz | is the initial size of particles, default 1.0. |
| [in] | fsz | is the final size of particles, default 1.0. |
| void makVrv::DtTacticalSmokeEffect::setParticleRotationRange | ( | double | mn, |
| double | mx | ||
| ) |
Set the particle rotation range.
The particles will each continuously rotate over their lifetime at a constant rate. The range defines the boundaries of the randomly chosen angular-velocity. Angular-velocity is defined in degrees.
| [in] | mn | is the lower boundary of the range, default -10.0. |
| [in] | mx | is the upper boundary of the range, default 10.0. |
| void makVrv::DtTacticalSmokeEffect::setParticleColorRange | ( | const osg::Vec4 & | icl, |
| const osg::Vec4 & | fcl | ||
| ) |
Set the particle color range.
The particles will each change color over their lifetime from an initial color to a final color.
| [in] | icl | is the initial color, default (1.0, 1.0, 1.0, 1.0). |
| [in] | fcl | is the final color, default (1.0, 1.0, 1.0, 1.0). |
| void makVrv::DtTacticalSmokeEffect::setParticleAlphaMultiplier | ( | double | alpha | ) |
Set the initial particle alpha value multiplier.
This is multiplied to the starting alpha value of the particles, the ending value is always zero. The alpha value should be a normalized value from zero to one.
| [in] | alpha | is the starting alpha value, default 1.0. |
| void makVrv::DtTacticalSmokeEffect::setIntensityRange | ( | double | mn, |
| double | mx | ||
| ) |
Set the intensity range.
This range produces a random rate of particle generation between a lower and upper bound.
| [in] | mn | is the lower boundary of the range, default 25.0. |
| [in] | mx | is the upper boundary of the range, default 25.0. |
| void makVrv::DtTacticalSmokeEffect::setWind | ( | const osg::Vec3d & | wnd | ) |
Set the wind direction and magnitude.
| [in] | wnd | is the direction and magnitude of wind in meters-per-second, default is (0.0, 0.0, 0.0). |
| void makVrv::DtTacticalSmokeEffect::setTexture | ( | const std::string & | txt | ) |
Set the filename of the texture used on each particle.
| [in] | txt | is the texture filename. |
| void makVrv::DtTacticalSmokeEffect::start | ( | ) |
| void makVrv::DtTacticalSmokeEffect::stop | ( | ) |
| void makVrv::DtTacticalSmokeEffect::pause | ( | ) |
| void makVrv::DtTacticalSmokeEffect::resume | ( | ) |
| void makVrv::DtTacticalSmokeEffect::setDefaults | ( | ) |
Set the system to default values.
|
virtual |
Interrupt CullVisitors to update the internal transforms.
| [in] | nv | is the node-visitor for the current frame. |
|
protected |
Set up the particle system.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |