Flint Particle System Forum - Individual Particle Rotation in 2D2011-12-11T12:43:40+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Individual Particle Rotation in 2Dhttp://flintparticles.org/forum/comments.php?DiscussionID=441&Focus=1501#Comment_15012011-01-04T05:51:01+00:002011-12-11T12:43:40+00:00venhttp://flintparticles.org/forum/account.php?u=447
I'm trying to rotate particles (mine are squares, have 64 of them) during an explosion. Everything works except rotation. Any suggestions, I did read the past posts on rotating in 3D, and thought I ...
-ven
// create particles from our existing objects var particles:Array = Particle2DUtils.createParticles2DFromDisplayObjects( squares);
// add renderer var renderer:DisplayObjectRenderer = new DisplayObjectRenderer(); renderer.addEmitter( emitter); addChild( renderer );
// set up the explosion - good to play with explosion strenght, depth and epsilon emitter.addAction(new Explosion(5, (INIT_X + (width + SPC) * 4) - ((width + SPC) / 2), (INIT_Y + (height + SPC) * 4 ) - ((height + SPC) / 2), 300, 2)); // set up explosion
emitter.addInitializer( new RotateVelocity( 0, Math.PI / 2) ); emitter.addAction( new Rotate() ); emitter.addAction( new Move() ); // set to objects to move
emitter.start();]]>
Individual Particle Rotation in 2Dhttp://flintparticles.org/forum/comments.php?DiscussionID=441&Focus=1502#Comment_15022011-01-04T18:13:55+00:002011-12-11T12:43:40+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
You've added the RotateVelocity initializer after adding the particles, so it is too late to initialize the particles then.
You need to set up the emitter first, with its initializers and actions. ...
You need to set up the emitter first, with its initializers and actions. Then add the particles, setting the second parameter in the addExistingParticles method to true to indicate that the initializers should be applied to the particles. Then start the emitter.]]>