Re: [osg-users] Vanishing Particles

2008-09-18 Thread Charles Cossé
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  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.
-Charles

On Thu, Sep 18, 2008 at 9:36 AM, b boltze <[EMAIL PROTECTED]> wrote:
> Hi Charles,
>
> thanks for your guess, but I found the problem already:
>
> osgParticle::ParticleSystem is storing its particles in a
> std::vector.
>
> 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@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
AsymptopiaSoftware | [EMAIL PROTECTED]
 www.asymptopia.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Vanishing Particles

2008-09-18 Thread b boltze
Hi Charles,

thanks for your guess, but I found the problem already:

osgParticle::ParticleSystem is storing its particles in a 
std::vector.

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@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Vanishing Particles

2008-09-16 Thread Charles Cossé
Hi Bastion,
just a wild guess, but if you followed that last reply to your
previous post, then maybe you are no longer setting lifetime to -1?
Are you implementing that advice from previous thread ... ie where you
reset default_particle_template?
-Charles

On Tue, Sep 16, 2008 at 1:51 PM, b boltze <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I don't know whether it's considered rude to just appear and ask stupid
> questions on this list. But at the moment I don't know where else to go,
> so... well, I'll just ask my stupid question:
>
> I have setup a ParticleSystem. I store all the particles created for that
> system in a separate place; actually an array of particle pointers. Also, all
> particles have infinite lifetime, i.e. lifetime is set to 0.
>
> After some time, when I walk through my separate array, some of the particles
> have vanished from the system: looping over all particles using
> system->numParticles and system->getParticle, I can't find them anymore, and
> when I try to access them using my pointer, I get a segfault.
>
> Unfortunately, I have no idea, where those particles might get deleted.
>
> Could someone please give me a hint?
>
> TIA
>bastian
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
AsymptopiaSoftware | [EMAIL PROTECTED]
 www.asymptopia.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Vanishing Particles

2008-09-16 Thread b boltze
Hello everyone,

I don't know whether it's considered rude to just appear and ask stupid 
questions on this list. But at the moment I don't know where else to go, 
so... well, I'll just ask my stupid question:

I have setup a ParticleSystem. I store all the particles created for that 
system in a separate place; actually an array of particle pointers. Also, all 
particles have infinite lifetime, i.e. lifetime is set to 0.

After some time, when I walk through my separate array, some of the particles 
have vanished from the system: looping over all particles using 
system->numParticles and system->getParticle, I can't find them anymore, and 
when I try to access them using my pointer, I get a segfault.

Unfortunately, I have no idea, where those particles might get deleted. 

Could someone please give me a hint?

TIA
bastian



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org