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 | null

The graph this agent navigates. A world may have several. Null means it cannot navigate.

ParameterTypeDescription
worldW
agentIdstring

positionOf

positionOf(world: W, agentId: string, out: Float32Array): boolean

Where the agent is now, written into out as x, y, z. False when the agent is gone.

ParameterTypeDescription
worldW
agentIdstring
outFloat32Array

pathOf

pathOf(world: W, agentId: string): NavPath | null

The route object this agent follows.

ParameterTypeDescription
worldW
agentIdstring
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.