Skip to content

hortom/boids-pixi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Boids - Flocking Simulation

This implementation is based on Daniel Shiffman's CodingTrain video.

Demo: https://hortom.github.io/boids-pixi/

There are some minor optimisations to get a higher number (1000+) agents to be handled.

  • Avoid creating new Vector object if possible.
  • Avoid sqrt calculation when possible.
  • Cache distance values.
  • After a certain amount of nearby agent, just 100 (maxNearCount) are used to calculate the alignment, cohesion and separation. Statistically, it should be ok.

The used pixi.js is more performant than p5.js but has less built in features. That is why there are a few additional small JS libs in this repo.

Victor.js is used for vector implementation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published