-
Notifications
You must be signed in to change notification settings - Fork 5
SeparationBehavior
Oğuz Eroğlu edited this page Jun 13, 2020
·
1 revision
SeparationBehavior
iterates through all the nearby steerables for given steerable and produces a linear acceleration repelling from them. The strength
parameter decides the strength of the repelling force.
// create steerables
var steerable = new Kompute.Steerable("steerable1", new Kompute.Vector3D(), new Kompute.Vector3D(10, 10, 10));
var steerable2 = new Kompute.Steerable("steerable2", new Kompute.Vector3D(10, 10, 10), new Kompute.Vector3D(10, 10, 10));
// create a World
var world = new Kompute.World(1000, 1000, 1000, 50);
// insert steerables into the world
world.insertEntity(steerable);
world.insertEntity(steerable2);
// create an instance of Separation behavior
var separationBehavior = new Kompute.SeparationBehavior({ strength: 50 });
// set the behavior
steerable.setBehavior(separationBehavior);
- 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