1
\$\begingroup\$

Say I have a 2D grid of particles, and I wanted to find out if any of them were colliding. In my head I have come up with a system where you check every possible location for each particle in that 'tick' and see if there is a collision. But, I have found a problem with this system. If I check each particle against every other particle, (or in a smaller grid, that's radius is the particle's velocity) then how would I check if 3 or more particles have collided? The issue is that the system will see two particles collide, then set their velocities accordingly, but what if there was another particle which was going to collide, but wasn't checked in time, so the system doesn't see any collision, and lets it 'tunnel'.

\$\endgroup\$
  • \$\begingroup\$ Have you checked AABB? \$\endgroup\$ – Johan Holtby Feb 17 '15 at 18:47
  • 1
    \$\begingroup\$ @JohanHoltby Googles quickly \$\endgroup\$ – Orfby Feb 17 '15 at 18:51
  • \$\begingroup\$ @JohanHoltby So basically, create hexagons around where all the boxes could possibly be, then do physicsy/mathsy stuff. If I understand Google correctly \$\endgroup\$ – Orfby Feb 17 '15 at 18:54
  • \$\begingroup\$ You just have boxes aligned with the axis of the coordinate system which bounds the object completely. \$\endgroup\$ – Johan Holtby Feb 18 '15 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.