Constructor
new Agent()
- Source:
Members
behaviours :Array.<Behaviour>
- Source:
Type:
maxSpeed :number
- Description:
- The maximum speed of the agent in pixels per second.
- Source:
The maximum speed of the agent in pixels per second.
Type:
maxTurnRate :number
- Description:
- Maximum rotation of the agent in radians per second
Not yet implemented.
- Source:
Maximum rotation of the agent in radians per second
Not yet implemented.
Type:
Methods
add(behaviour)
- Description:
- Adds a behavior to the agent.
- Source:
Parameters:
remove(behaviour)
- Description:
- Removes a behavior to the agent.
- Source:
Parameters:
(static) update(inv_dt, agent, transform, movable)
- Description:
- Source:
Parameters:
Name |
Type |
Description |
inv_dt |
number
|
Inverse of delta time i.e frameRate. |
agent |
Agent
|
|
transform |
any
|
|
movable |
any
|
|
(static) updateBehaviours(inv_dt, behaviours, transform, inv_dt)
- Description:
- Updates the behaviours of the agent and applies changes to agent.
- Source:
Parameters:
Name |
Type |
Description |
inv_dt |
number
|
|
behaviours |
string
|
Array.<any>
|
|
transform |
any
|
|
inv_dt |
|
|