I have no knowledge of collision detection algorithms but I'm trying to play around with collision in a particle system in Python for educational purposes.
The way I'm detecting collision right now seems very inefficient. Probably the slowest algorithm out there:
- Loop through all particles (which are circles defined by radius) in my particle list (via a for loop), call the current particle
p - On every iteration, compare
pto every other particle (another for loop) - Detect collision
With the method above, some of my particles aren't even detecting collisions when the particle count is high and FPS is low. Is there a way to prevent this in my current method or will I have to implement another, more efficient one (which is probably the way to go)?