The read-only view of a neighbouring agent that flocking needs (§12).
Structural, and deliberately smaller than SteeringContext: a
neighbour contributes only where it is and how fast it is going, so anything
with a position and a velocity — a SteeringAgent, a { position, velocity }
literal, a physics body wrapper — is a neighbour without adapting to a class.
readonly marks intent: no behaviour in this module ever mutates a
neighbour's or a context's vectors. It cannot be enforced deeper — TypeScript
readonly stops reassignment of the property, not mutation of the Vector3
it points at — so the guarantee is the implementation's, and is tested.
The read-only view of a neighbouring agent that flocking needs (§12).
Structural, and deliberately smaller than SteeringContext: a neighbour contributes only where it is and how fast it is going, so anything with a position and a velocity — a
SteeringAgent, a{ position, velocity }literal, a physics body wrapper — is a neighbour without adapting to a class.readonlymarks intent: no behaviour in this module ever mutates a neighbour's or a context's vectors. It cannot be enforced deeper — TypeScriptreadonlystops reassignment of the property, not mutation of theVector3it points at — so the guarantee is the implementation's, and is tested.