Jump to content
  • Advertisement
Sign in to follow this  
Raeldor

How to handle multiple collisions?

This topic is 4555 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a collision that is then being set back to the penetration point along the collision normal, but this is then making the object collide with yet another object. How is this normally handled? Does the routine need to keep processing and moving back along the normal for all objects until there are no collisions? What happens if it gets stuck in a loop between two objects? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
You could do that. But how often do you expect that to actually happen? Sometimes if you have a lot of objects bumping around, it gets weird. But if you only have a few objects in your game, you might choose to just let it go and not worry about it. Somewhat depends on how robust your collision algorithm is.

Share this post


Link to post
Share on other sites
I think that this is one of the hardest problems of all in simulating physics on computers. You could do what the last guy said but if you do, try and use as small a time step as possible and this can reduce the problem somewhat. If you have big time steps then objects can pass right through each other and no collision will be detected or else the wrong collision.

Another possible approach is, rather than upating the positions of all the objects and then evaluating collisions afterwards, you could, for each object in turn move it along its path until it collides with something. Then evaluate the consequences of the collision and update the velocities of the 2 objects involved. Then you move on to the next object.

Another similiar but more difficult approach, is to update all the objects motion simultaneously until 2 of them collide. Then you would update thier velocities according to the collision and continue as before until you have completed the required time.

Share this post


Link to post
Share on other sites
what about if you scanned all of the objects for collisions. apply the proper response to the objects and flag them. go through the list of objects again only checking the flagged ones. keep going through the list until none of the objects are colliding.

would that be asking too much power?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!