Flint Particle System Forum - Jet Accelerator not working in 1.0.3?2011-12-13T01:18:17+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Jet Accelerator not working in 1.0.3?http://flintparticles.org/forum/comments.php?DiscussionID=50&Focus=247#Comment_2472008-07-16T14:23:53+01:002011-12-13T01:18:17+00:00Philliphttp://flintparticles.org/forum/account.php?u=44
Hi.
I'm trying to have a GravityWell pull my particles out of their ring shaped emitter towards a Jet that propells them in a certain direction. The Jet seems to have no effect what-so-ever. Can ...
I'm trying to have a GravityWell pull my particles out of their ring shaped emitter towards a Jet that propells them in a certain direction. The Jet seems to have no effect what-so-ever. Can someone tell me what's going on? It appears that Jet isn't working at all (I'm using the most recent version 1.0.3) ...?
Here's the relevant code: //[...] lots of the usual init-stuff here, as seen in the tutorial...
//A ring-shaped emitter: var emitCenter:Point = new Point(originX, originY);
var innerRadius:Number = 20; var outerRadius:Number = 30; var emitterZone:DiscZone = new DiscZone(emitCenter, innerRadius, outerRadius);
var position:Position = new Position( emitterZone ); emitter.addInitializer( position );
//Building the jet accelerator, a circle with 70px diameter, which should cover the emitter perfectly: var jetCenter:Point = new Point(originX, originY); innerRadius = 0; outerRadius = 70; var jetZone:DiscZone = new DiscZone(jetCenter, innerRadius, outerRadius);
//--> Jet(accelerationX:Number, accelerationY:Number, zone:Zone) ... invertZone = false) var jetLance:Jet = new Jet(100, 100, jetZone); emitter.addAction(jetLance);
//We need a gravity well to pull the particles out of the ring-shaped emitter: //--> GravityWell(power:Number , x:Number, y:Number, epsilon:Number = 100) var gravCenter:GravityWell = new GravityWell(20, originX, originY, 100); emitter.addAction(gravCenter);
//'Move' Action to move the particles var move:Move = new Move(); emitter.addAction(move);
emitter.start();
As I mentioned, the GravityWell works fine. So does Explosion, ApproachNeighbor and all kinds of stuff. It's only Jet that doesn't work. Neither alone or in conjuction with others. Any help is appreciated.
Thanks.
Phillip]]>
Jet Accelerator not working in 1.0.3?http://flintparticles.org/forum/comments.php?DiscussionID=50&Focus=250#Comment_2502008-07-16T20:16:07+01:002008-07-16T20:36:32+01:00Richardhttp://flintparticles.org/forum/account.php?u=1
Hi Phillip
You have the innerRadius and outerRadius the wrong way around in the constructor of your DiscZones. It should be
var emitterZone:DiscZone = new DiscZone(emitCenter, outerRadius, ...
You have the innerRadius and outerRadius the wrong way around in the constructor of your DiscZones. It should be
var emitterZone:DiscZone = new DiscZone(emitCenter, outerRadius, innerRadius); and
var jetZone:DiscZone = new DiscZone(jetCenter, outerRadius, innerRadius); I defined the arguments in this order because the innerRadius has a default value (zero) but the outerRadius doesn't, so the innerRadius has to come later in the arguments list.
Obviously, this ordering is unexpected and hence your understandable error. I will add an error check to the code to ensure that outerRadius is not smaller than innerRadius and throw a meaningful error message if it is - that at least should indicate the error as soon as it occurs.]]>
Jet Accelerator not working in 1.0.3?http://flintparticles.org/forum/comments.php?DiscussionID=50&Focus=253#Comment_2532008-07-17T08:48:04+01:002011-12-13T01:18:17+00:00Philliphttp://flintparticles.org/forum/account.php?u=44
Hey, Richard.
Thanks. I would've never figured that out on my own. It's indeed a tricky one.
Thanks for the help. It's a very neat Particle Sytem btw, thank you for that too.
Thanks. I would've never figured that out on my own. It's indeed a tricky one. Thanks for the help. It's a very neat Particle Sytem btw, thank you for that too.]]>