Intelligence · interface
NavigationAdapter
What the consumer answers, because only the consumer knows what an agent is.
Explained in Agents and behaviour.
interface NavigationAdapter<W>import type { NavigationAdapter } from '@driftengine/ai';Methods
graphOf
graphOf(world: W, agentId: string): NavGraph | nullThe graph this agent navigates. A world may have several. Null means it cannot navigate.
| Parameter | Type | Description |
|---|---|---|
world | W | |
agentId | string |
positionOf
positionOf(world: W, agentId: string, out: Float32Array): booleanWhere the agent is now, written into out as x, y, z. False when the agent is gone.
| Parameter | Type | Description |
|---|---|---|
world | W | |
agentId | string | |
out | Float32Array |
pathOf
pathOf(world: W, agentId: string): NavPath | nullThe route object this agent follows.
| Parameter | Type | Description |
|---|---|---|
world | W | |
agentId | string |
More
The consumer's and not the bridge's, deliberately: they already own its lifetime, its capacity and its steering options, and a second one owned here would be a second answer to where the agent is going.