How do I find the Time Duration of ParticleGroupAnimator?

Software: Away3D 4.x

idleBishop, Newbie
Posted: 14 January 2014 08:21 PM   Total Posts: 5

I’m using some effects generated by the Sparticle tool (http://www.effecthub.com/t/sparticle) and I’m having a hard time figuring out how to know when a particle is done playing it’s animation. My understanding is that the ParticleGroup and ParticleGroupAnimator classes are part of the Away3d API, so I’m starting here instead of the effecthub forum.

I can’t find any properties to inspect that tell me the effects’ animation length, and I can’t find any events that dispatch when the animation is done.

The closest things I can find is the ParticleGroupEvent.OCCUR event, which can be configured to dispatch in the sparticle tool, but I get several of these events dispatched for any given animation… and some of them are dispatched before the effect actually ends, so listening for them isn’t sufficient.

   

idleBishop, Newbie
Posted: 14 January 2014 09:01 PM   Total Posts: 5   [ # 1 ]

Update:

I think the multiple event dispatches were my fault, but it seems that the event is still being dispatched before the last frame of the animation.

For example, I’ve got an effect that lasts .053 seconds, and if I listen for ParticleGroupEvent.OCCUR, and stop the animation on that event, I can see that it stops before the last frame.

I suspect that the time calculation in ParticleGroupAnimator.updateDeltaTime() is dispatching the event AT the last frame of the effect, as opposed to showing the last frame, and THEN dispatching the event.

I might be able to work around it for now by padding the time of the end of the effect a bit.

   

idleBishop, Newbie
Posted: 15 January 2014 01:13 AM   Total Posts: 5   [ # 2 ]

So… turns out the artist that made the animation accidentally set the “occur time” to slightly too fast.

Once adjusted, everything seems to work fine. Glad that worked itself out…

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X