Sharing with you the quad tree algorithm I implemented in JS with the help of Daniel Shiffman: https://www.youtube.com/watch?v=OJxEcs0w_kE&t=2057s
and this website: https://www.geeksforgeeks.org/quad-tree/
In this patch the quad tree algorithm is used to subdivide particles into boxes and find all the close neighbours in a fast way.
You can watch a demo video on FB:
You can find the patch in the dropbox folder I share with you if you supported me for more than 3 months or you are a 20$ tier.
If I didn't share the folder with you yet just write me!
See you soon