[osg-users] LocalParticleSystem and ModularEmitter.cpp
ginbot462 at yahoo.com
Fri Mar 20 12:33:02 PDT 2009
Some background first:
I've upgraded my code from 2.4 to 2.8.
I have a queue of ParticleEffects contained by osg::PositionAttitudeTransform's that get moved around. So whoever was the last effect to move, gets put into a new position and reset to look as if it's a totally new effect.
An alternative method would be to delete the oldest when adding a new one and a preset limit is reached. However, this is what I did to just reuse the previously created effect.
If you don't use LocalParticleSystem, you'll get a smoke trail (from the old to new pos) for smoke (which in this case we don't want) or a fire trail or whatever.
This issue I've noticed in 2.8:
When you use a LocalParticleSystem on an Effect in 2.8, the Effects just sit at the origin (which is not what happened before). It seems to happen due to a change in ModularEmitter.cpp. It seems the code was changed to support Earth-centric coordinate system. The full comment on the change is:
From Tim Moore, "his submission fixes a bug when the ModularEmitter and ParticleSystem are in different frames of reference. Specifically, it supports the case where the ParticleSystem is not in the world frame. One way this can come up is if your world coordinate system is Earth-centric; the float coordinates of particles don't have enough precision to avoid terrible jitter and other rendering artifacts, so it's convenient to root the particle systems in a local Z-up coordinate system that gets moved around from time to time."
So, is there a way to get ParticleEffects with setUseLocalParticleSystem(true) to behave like the use too?
More information about the osg-users