[osg-users] Vanishing Particles

Charles Cossé ccosse at gmail.com
Thu Sep 18 09:11:56 PDT 2008

Hmm...I didn't realize you were trying to use a persistent pointer
like that;  I've been having similar troubles with the color setting
... and have tried a nuber of thing, both sub-classing osg::Particle
and osg::ParticleSystem both, each resulting in new problems.  If you
subclass osg::Particle to "MyParticle" and add a constant member ID
variable with the intent of then iterating over the vector to find
specific particles, you suddenly find that the vector is part of
osg::ParticleSystem, which thinks it's a vector of <osg::Particle> and
so everything gets messed up.  Yup, I don't know the best solution to
this sort of problem, but it must be a very common problem.  I'll be
watching for someone to post a good solution.

On Thu, Sep 18, 2008 at 9:36 AM, b boltze <con at bspot.de> wrote:
> Hi Charles,
> thanks for your guess, but I found the problem already:
> osgParticle::ParticleSystem is storing its particles in a
> std::vector<Particle>.
> That means, of course, that pointers to particles may not remain valid all the
> time. Especially when the vector resizes itself, particles get copied, and
> hence pointers to them become invalid.
> I'm not quite sure what to make out of this... essentially it means, that you
> can not track individual particles over their lifetime, which I definitely
> need to do for my application.
> Now I'll go figure out something...
> bastian
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

AsymptopiaSoftware | Software at theLimit

More information about the osg-users mailing list