Flint Particle System Forum - Understanding how TurnTowardsPoint() is suppose to work Sun, 16 Oct 2011 22:04:10 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Understanding how TurnTowardsPoint() is suppose to work http://flintparticles.org/forum/comments.php?DiscussionID=512&Focus=1708#Comment_1708 http://flintparticles.org/forum/comments.php?DiscussionID=512&Focus=1708#Comment_1708 Tue, 30 Aug 2011 22:44:08 +0100 graxbishop
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 http://flintparticles.org/forum/comments.php?DiscussionID=512&Focus=1729#Comment_1729 Tue, 27 Sep 2011 08:43:01 +0100 Richard