Fixed the double transform of ParticleEffects

This commit is contained in:
Robert Osfield 2005-03-22 17:00:41 +00:00
parent 8e9f14a374
commit 1c808e4959
4 changed files with 12 additions and 3 deletions

View File

@ -220,9 +220,9 @@ void build_world(osg::Group *root)
osgParticle::SmokeEffect* smoke = new osgParticle::SmokeEffect;
osgParticle::FireEffect* fire = new osgParticle::FireEffect;
osg::Geode* geode = new osg::Geode;
geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f,0.0f,0.0f),10.0f)));
positionEffects->addChild(geode);
//osg::Geode* geode = new osg::Geode;
//geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f,0.0f,0.0f),10.0f)));
//positionEffects->addChild(geode);
positionEffects->addChild(explosion);
positionEffects->addChild(smoke);

View File

@ -42,11 +42,13 @@ void ExplosionEffect::setDefaults()
ps->setDefaultAttributes("Images/particle.rgb", false, false);
_particleSystem = ps;
//_particleSystem->setUseIntialViewMatrix(true);
// set up the emitter
{
osgParticle::ModularEmitter *emitter = new osgParticle::ModularEmitter;
emitter->setParticleSystem(ps);
emitter->setReferenceFrame(osgParticle::ParticleProcessor::ABSOLUTE_RF);
osgParticle::Particle ptemplate;
@ -128,6 +130,7 @@ void ExplosionEffect::buildEffect()
osg::Geode *geode = new osg::Geode;
geode->addDrawable(_particleSystem.get());
//geode->setCullingActive(false);
// add the geode to the scene graph
addChild(geode);

View File

@ -41,11 +41,13 @@ void FireEffect::setDefaults()
ps->setDefaultAttributes("Images/smoke.rgb", true, false);
_particleSystem = ps;
// _particleSystem->setUseIntialViewMatrix(true);
// set up the emitter
{
osgParticle::ModularEmitter *emitter = new osgParticle::ModularEmitter;
emitter->setParticleSystem(ps);
emitter->setReferenceFrame(osgParticle::ParticleProcessor::ABSOLUTE_RF);
osgParticle::Particle ptemplate;
@ -125,6 +127,7 @@ void FireEffect::buildEffect()
osg::Geode *geode = new osg::Geode;
geode->addDrawable(_particleSystem.get());
//geode->setCullingActive(false);
// add the geode to the scene graph
addChild(geode);

View File

@ -42,11 +42,13 @@ void SmokeEffect::setDefaults()
ps->setDefaultAttributes("Images/smoke.rgb", false, false);
_particleSystem = ps;
// _particleSystem->setUseIntialViewMatrix(true);
// set up the emitter
{
osgParticle::ModularEmitter *emitter = new osgParticle::ModularEmitter;
emitter->setParticleSystem(ps);
emitter->setReferenceFrame(osgParticle::ParticleProcessor::ABSOLUTE_RF);
osgParticle::Particle ptemplate;
@ -124,6 +126,7 @@ void SmokeEffect::buildEffect()
osg::Geode *geode = new osg::Geode;
geode->addDrawable(_particleSystem.get());
// geode->setCullingActive(false);
// add the geode to the scene graph
addChild(geode);