-
Notifications
You must be signed in to change notification settings - Fork 5
RandomWaypointBehavior
Oğuz Eroğlu edited this page Jun 11, 2020
·
1 revision
RandomWaypointBehavior
chooses a random waypoint from a path
and makes a steerable seek towards there. When the distance between the steerable and the current waypoint is less than satisfactionRadius
, RandomWaypointBehavior
chooses another random waypoint to seek towards.
// create a Steerable
var steerable = new Kompute.Steerable("steerable1", new Kompute.Vector3D(), new Kompute.Vector3D(10, 10, 10));
// set max speed and acceleration of the Steerable
steerable.maxSpeed = 100;
steerable.maxAcceleration = 100;
// Create a Path
var path = new Kompute.Path();
path.addWaypoint(new Kompute.Vector3D(0, 0, 0));
path.addWaypoint(new Kompute.Vector3D(100, 200, 300));
// Create an instance of RandomWaypointBehavior
var randomWaypointBehavior = new Kompute.RandomWaypointBehavior({ path: path, satisfactionRadius: 50 });
// set the behavior
steerable.setBehavior(randomWaypointBehavior);
- 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