AgentIntent
new AgentIntent()AgentIntent - Output envelope for AI decision-making
Contains move, aim, and fire instructions that the AgentController consumes to drive agent behavior. Intents produce AgentIntent objects each frame to communicate their desired actions.
Usage
Example
// In an Intent's update() method:
update(body, state, memory, delta) {
const intent = new AgentIntent();
// Set movement
intent.move.destination = targetPosition;
intent.move.speed = 'run';
// Set aiming
intent.aim.target = enemyPosition;
intent.aim.smoothing = 0.2;
// Set firing
intent.fire.trigger = true;
intent.fire.mode = 'single';
return intent;
}
Properties
# .move : MoveIntent
Movement instructions.
# .aim : AimIntent
Aiming instructions.
# .fire : FireIntent
Firing instructions.
Methods
reset#
reset() : AgentIntentReset all intents to default values.
Returns
AgentIntent — This instance for chaining.copy#
copy(other : AgentIntent) : AgentIntentCopy values from another AgentIntent.
Parameters
The intent to copy from.
Returns
AgentIntent — This instance for chaining.