Flint Particle System Forum - Stop then restart Particle movement2011-12-12T22:10:06+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Stop then restart Particle movementhttp://flintparticles.org/forum/comments.php?DiscussionID=405&Focus=1391#Comment_13912010-09-30T10:49:24+01:002011-12-12T22:10:06+00:001ndivisiblehttp://flintparticles.org/forum/account.php?u=416
Hi,
I've just started using Flint which I'm really enjoying, but I'm a little unclear on something. I want any emitted particles that make contact with a zone to stop moving and collect which I ...
I've just started using Flint which I'm really enjoying, but I'm a little unclear on something. I want any emitted particles that make contact with a zone to stop moving and collect which I have achieved by creating a custom StopAction (which sets their velocity to 0/0) and using a ZonedAction to apply it. However, I need to be able to release these particles so that they continue onwards with the same velocity as they hit the zone with. Removing the ZonedAction causes the particles to drift off in random directions.
How could I set this up?
Thanks.]]>
Stop then restart Particle movementhttp://flintparticles.org/forum/comments.php?DiscussionID=405&Focus=1394#Comment_13942010-10-02T15:06:06+01:002011-12-12T22:10:06+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
A couple of ideas...
1. When you stop the particle, store the current velocity in the particle's dictionary, then retrieve it when restarting the particle.
2. Don't use your custom stop action. ...
1. When you stop the particle, store the current velocity in the particle's dictionary, then retrieve it when restarting the particle.
2. Don't use your custom stop action. Instead, apply the move action as a zoned action, using the invertZone property to apply it only to particles outside your zone. Then, when you want to resume the particle's motion, remove the zoned move action and apply a simple move action instead, which will apply to all particles. This way there is no need to set the particle's velocity to zero, so they retain their velocity from before.
I favour option 2.]]>
Stop then restart Particle movementhttp://flintparticles.org/forum/comments.php?DiscussionID=405&Focus=1396#Comment_13962010-10-03T22:10:28+01:002011-12-12T22:10:06+00:001ndivisiblehttp://flintparticles.org/forum/account.php?u=416
Thanks.
I had blundered my way to number 1, but your second solution is far more elegant.
I had blundered my way to number 1, but your second solution is far more elegant.]]>