Flint Particle System Forum - Understanding how TurnTowardsPoint() is suppose to work 2011-10-16T22:10:18+01:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher Understanding how TurnTowardsPoint() is suppose to work http://flintparticles.org/forum/comments.php?DiscussionID=512&Focus=1708#Comment_1708 2011-08-30T22:44:08+01:00 2011-10-16T22:10:18+01:00 graxbishop http://flintparticles.org/forum/account.php?u=537 Hi there, I need some help understand how the TurnTowardsPoint() action is suppose to work. I've tried modifying the Flocking example so that the Birds will flock towards and hover around the ...
I need some help understand how the TurnTowardsPoint() action is suppose to work.

I've tried modifying the Flocking example so that the Birds will flock towards and hover around the point of 100,100. But when I publish the code the Bird ignore the TurnTowardsPoint and move around on their own. It would appear that I don't understand how to use this action. Here's the code below.

---------
import org.flintparticles.common.counters.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.emitters.Emitter2D;
import org.flintparticles.twoD.initializers.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.zones.*;

var emitter:Emitter2D = new Emitter2D();
emitter.counter = new Blast( 20 );

emitter.addInitializer( new ImageClass( Bird ) );
emitter.addInitializer( new Position( new RectangleZone( 10, 10, 680, 480 ) ) );
emitter.addInitializer( new Velocity( new DiscZone( new Point( 0, 0 ), 150, 100 ) ) );

emitter.addAction( new ApproachNeighbours( 150, 100 ) );
emitter.addAction( new MatchVelocity( 20, 200 ) );
emitter.addAction( new MinimumDistance( 10, 600 ) );
emitter.addAction( new SpeedLimit( 100, true ) );
emitter.addAction( new RotateToDirection() );
emitter.addAction( new BoundingBox( 0, 0, 700, 500 ) );
emitter.addAction( new SpeedLimit( 200 ) );
emitter.addAction( new TurnTowardsPoint(100, 100, 5) );
emitter.addAction( new Move() );

var renderer:DisplayObjectRenderer = new DisplayObjectRenderer();
renderer.addEmitter( emitter );
addChild( renderer );

emitter.start( );
--------------

In the end I am planning to have the Points become changeable with a click of a mouse.

Any help would be greatly appreciated.]]>
Understanding how TurnTowardsPoint() is suppose to work http://flintparticles.org/forum/comments.php?DiscussionID=512&Focus=1729#Comment_1729 2011-09-27T08:43:01+01:00 2011-10-16T22:10:18+01:00 Richard http://flintparticles.org/forum/account.php?u=1 You have a number of actions there that all try to alter the birds' movement so it's very likely that the TurnTowardsPoint action is being overwhelmed by the others. Try removing the Approach ...