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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user