Jump to content
• Advertisement

# How to handle multiple collisions?

This topic is 4637 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

##### 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

##### 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

##### 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

##### Share on other sites

• Advertisement

### Announcements

• Advertisement

• ### Popular Contributors

1. 1
2. 2
3. 3
Rutin
18
4. 4
khawk
14
5. 5
frob
12
• Advertisement

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633659
• Total Posts
3013216
×

## Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!