Skip to content

1681-engine / index / alignment

Function: alignment() ​

ts
function alignment(
   agent, 
   neighbours, 
   radius
): SteerVec;

Defined in: src/nav/steering.ts:85

Towards the average heading of neighbours within radius (a flock turning together).

Parameters ​

ParameterType
agentSteerAgent
neighboursIterable<SteerAgent>
radiusnumber

Returns ​

SteerVec

Released under the MIT License.