-
Notifications
You must be signed in to change notification settings - Fork 5
EvadeBehavior
Oğuz Eroğlu edited this page Jun 10, 2020
·
3 revisions
EvadeBehavior
makes a steerable run away from a target entity. It calculates where the target entity will be in maxPredictionTime
frames and flees from that position. This behavior produces inverse of what PursueBehavior produces.
// create a steerable
var steerable = new Kompute.Steerable("steerable1", new Kompute.Vector3D(5, 5, 5), new Kompute.Vector3D(10, 10, 10));
// set max speed and acceleration
steerable.maxSpeed = 100;
steerable.maxAcceleration = 50;
// create a target steerable to chase
var targetSteerable = new Kompute.Steerable("target", new Kompute.Vector3D(), new Kompute.Vector3D(10, 10, 10));
// set the target entity
steerable.setTargetEntity(targetSteerable);
// create an instance of EvadeBehavior
var evadeBehavior = new Kompute.EvadeBehavior({maxPredictionTime: 10});
// set EvadeBehavior
steerable.setBehavior(evadeBehavior);
- Core
- Path
-
Steering Behaviors
- AlignBehavior
- ArriveBehavior
- AvoidBehavior
- BlendedSteeringBehavior
- CohesionBehavior
- EvadeBehavior
- FleeBehavior
- HideBehavior
- JumpBehavior
- LookWhereYouAreGoingBehavior
- PathFollowingBehavior
- PrioritySteeringBehavior
- PursueBehavior
- RandomPathBehavior
- RandomWaypointBehavior
- SeekBehavior
- SeparationBehavior
- Wander2DBehavior
- Wander3DBehavior
- Math
- Extra