Created
March 19, 2013 21:14
-
-
Save IQAndreas/5200218 to your computer and use it in GitHub Desktop.
Seek and Flee steering behaviors using OpenSteer ("orbiting" result)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function init() | |
seekVehicle = new SimpleVehicle(); | |
seekVehicle.setPosition(Math.random() * displayWidth, 0, Math.random() * displayHeight); | |
seekVehicle.radius = 10; | |
seekVehicle.maxForce = 800.0; //steering force | |
seekVehicle.maxSpeed = 300.0; //velocity | |
seekVehicle.speed = 100; | |
seekBoid = this.addBoid(seekVehicle, 0x00CC00); | |
// function update(currentTime:Number, elapsedTime:Number) | |
var seekVec:Vector3 = seekVehicle.steerForSeek(target.getVector3()); | |
seekVehicle.applySteeringForce(seekVec, elapsedTime); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment