1681-engine / index / cohesion
Function: cohesion() ​
ts
function cohesion(
agent,
neighbours,
radius,
maxSpeed
): SteerVec;Defined in: src/nav/steering.ts:99
Towards the middle of neighbours within radius (a flock keeping together).
Parameters ​
| Parameter | Type |
|---|---|
agent | SteerAgent |
neighbours | Iterable<SteerAgent> |
radius | number |
maxSpeed | number |