Added support for rapid movement of the emitter, with particle now seeding between

the position of the emitter in the previous frame and the new position in the new
frame, the number of particles added also scales up to compensate for this movement.
This commit is contained in:
Robert Osfield
2005-08-25 14:12:08 +00:00
parent 320d0f67e4
commit be285c62c0
14 changed files with 183 additions and 28 deletions

View File

@@ -57,6 +57,13 @@ namespace osgParticle
/// Set the Counter object.
inline void setCounter(Counter* c);
/// Get the ratio between number of particle to create in compenstation for movement of the emitter
inline float getNumParticlesToCreateMovementCompenstationRatio() const;
/// Set the ratio between number of particle to create in compenstation for movement of the emitter
inline void setNumParticlesToCreateMovementCompenstationRatio(float r);
/// Get the Placer object.
inline Placer* getPlacer();
@@ -82,6 +89,8 @@ namespace osgParticle
virtual void emit(double dt);
private:
float _numParticleToCreateMovementCompensationRatio;
osg::ref_ptr<Counter> _counter;
osg::ref_ptr<Placer> _placer;
osg::ref_ptr<Shooter> _shooter;
@@ -104,6 +113,16 @@ namespace osgParticle
_counter = c;
}
inline float ModularEmitter::getNumParticlesToCreateMovementCompenstationRatio() const
{
return _numParticleToCreateMovementCompensationRatio;
}
inline void ModularEmitter::setNumParticlesToCreateMovementCompenstationRatio(float r)
{
_numParticleToCreateMovementCompensationRatio = r;
}
inline Placer* ModularEmitter::getPlacer()
{
return _placer.get();