Added SmokeTrailEffect which renders created particles as single quad or line

strip, in the case of the quad strip the strip is aligned to the be orthogonal with
the eye point.
This commit is contained in:
Robert Osfield
2005-10-12 18:42:36 +00:00
parent 540e676dae
commit 1e508d432b
16 changed files with 611 additions and 73 deletions

View File

@@ -1,5 +1,6 @@
#include <osgParticle/ModularEmitter>
#include <osgParticle/Emitter>
#include <osgParticle/ConnectedParticleSystem>
#include <osg/Notify>
osgParticle::ModularEmitter::ModularEmitter()
@@ -22,6 +23,8 @@ osgParticle::ModularEmitter::ModularEmitter(const ModularEmitter& copy, const os
void osgParticle::ModularEmitter::emit(double dt)
{
ConnectedParticleSystem* cps = dynamic_cast<ConnectedParticleSystem*>(getParticleSystem());
if (getReferenceFrame() == RELATIVE_RF)
{
const osg::Matrix& ltw = getLocalToWorldMatrix();
@@ -60,6 +63,9 @@ void osgParticle::ModularEmitter::emit(double dt)
float r = ((float)rand()/(float)RAND_MAX);
P->transformPositionVelocity(ltw, previous_ltw, r);
//P->transformPositionVelocity(ltw);
if (cps) P->setUpTexCoordsAsPartOfConnectedParticleSystem(cps);
}
else
{
@@ -77,6 +83,8 @@ void osgParticle::ModularEmitter::emit(double dt)
{
_placer->place(P);
_shooter->shoot(P);
if (cps) P->setUpTexCoordsAsPartOfConnectedParticleSystem(cps);
}
}
}