API Docs for: 0.3
Show:

Engine Class

Defined in: src\sim\Engine.js:5
Module: Engine
Parent Module: CrowdSim

The simulation engine. Manages the state running of the simulation

Constructor

Engine

(
  • world
  • options
)

Defined in src\sim\Engine.js:5

Parameters:

Methods

_step

()

Internal step of the simulation engine. Periodically called.

getSettings

() Object

Get the engine settings, configured in constructor [options]

Returns:

Object:

options

getWorld

() World

Gets the simulation world

Returns:

reset

() Boolean

Resets=Restarts the state of the simulation.

Returns:

Boolean:

true if running; false otherwise

run

(
  • entity
)
Boolean

Starts the simulation

Parameters:

  • entity Entity

    to report in the onStart callback as trigger

Returns:

Boolean:

true if running; false otherwise

setWorld

(
  • world
)

Sets the simulation world

Parameters:

step

() Boolean

Advance one step the simulation and stops.

Returns:

Boolean:

true if running; false otherwise

stop

(
  • entity
)
Boolean

Stops the simulation

Parameters:

  • entity Entity

    to report in the onStart callback as trigger

Returns:

Boolean:

true if running; false otherwise