UNPKG

@thi.ng/boids

Version:

n-dimensional boids simulation with modular behavior system

19 lines (18 loc) 334 B
const noAccel = () => { let boids; return { build($boids) { boids = $boids; }, queryNeighborhood(neighborhood) { for (let i = 0, n = boids.length; i < n; i++) { const b = boids[i]; neighborhood.consider(b.pos.curr, b); } return neighborhood; } }; }; export { noAccel };