Skip to main content
gamedev.net
🔒 Locked

multiple collisions

Started by flounder Jan 23, 2006 at 12:32 PM 0 replies 1k views
Original Post
flounder
flounder
i've been working on improving my verlet collision system, here's the way it works loop 1: update the circles (apply friction, add velocities) end loop 1 loop 2: (loop through each circle) -loop 3: (loop through every other circle) --do they collide? ---is it the closest (in relation to time) collision? if so mark it -end loop 3 was there a collision? -handle the collision end loop 2 the problem that i've run into is that it only handles 2 collisions per circle. This means if a ton of circles are mashed together only the nearest circles will collide. Is there a better way to handle this so every collision is checked based on when they collide without using too many loops?
dawidjoubert
dawidjoubert
Not 100% physics correct no, because that first 2 collisions may stop other collisions from happening.

So that is why you handle the collisions time based, handle the first occuring collision first and then you have to restart because other new collisions may occur now.

However you may cheat and must!!!!

firstly you need some form of dynamic binary/octree partitioning as to cut down possible collisions.
Secondly you can (if it is not crucial to game mechanics) simple handle each collision without stepping back in time.
----------------------------http://djoubert.co.uk

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.