Collision Detection using a Quadtree

In this demonstration I am using a quadtree to optimise collision detection. It is the third in a series of topics I have posted on collision detection, the first two being -
Collision Detection using Spatial Hashing
Collision Detection using Sweep and Prune

All three sketches use the same core code for the particle and vector classes so these would have to be included if you plan to use one of these in your own code.

You can find all of these sketches in my p5js sketch editor account.

All three sketches have the same initial starting particle domain configuration and appear to have similar performance metrics but I have not performed any serious testing to validate that.

2 Likes