-
Notifications
You must be signed in to change notification settings - Fork 4
World
Oğuz Eroğlu edited this page Jun 20, 2020
·
5 revisions
World
is an object that contains all the Kompute
entities. A World
also defines what distance is nearby
for entities (What is the maximum distance in order to make an entity close to another entity). World
class internally uses Nearby algorithm.
Note that steerables need to be insert into a world
in order to move.
A World
may have a gravity set via setGravity
API. This is necessary for jumping.
var worldWidth = 1000;
var worldHeight = 1000;
var worldDepth = 1000;
var binSize = 50; // binSize defines what is considered nearby. A greater binSize means objects more far away are considered nearby to a given position
var world = new Kompute.World(worldWidth, worldHeight, worldDepth, binSize);
// This is useful for jumping
world.setGravity(-900);
// Create an entity
var entity = new Kompute.Entity("entity1", new Kompute.Vector3D(), new Kompute.Vector3D(10, 10, 10));
// Insert the entity to the world
world.insertEntity(entity);
// Remove the entity from the world
world.removeEntity(entity);
- 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