Advertisement Jump to content
Sign in to follow this  

2D circle physics with gravity...stability problems, help?

This topic is 4368 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 used the Gamasutra "Pool Hall Lessons" [1] article to develop a nice, working collision prediction/response system for my 2D colliding-discs game. So far, so good: I predict the next collision, run the simulation to that time, process the collision, find the next, run to it, repeat repeat repeat. The problem comes when I introduce gravity. Predicting the collisions is still no trouble: the same movement equations for disc-to-disc collisions work fine since they are all accelerating uniformly. Collisions with stationary walls are only trivially harder since you have to solve a quadratic. The real problem is stability. Once the balls start stacking up on the floor, the collision rate increases exponentially and my engine chokes. I've tried a couple of schemes for detecting when a disc is "stable" and dropping it out of the simulation until it gets hit, but I can't seem to make it work. Does anyone know of some good methods? 1 -

Share this post

Link to post
Share on other sites
This is the algorithm that i use to deactivate and activate things:
deactivate an object when it stays in the same position and rotation(with in a threshold) for a certain amount of time. In addition, i only deactivate something if there's an object that's touching it and under it that's also deactivated (the floor starts as deactivated and stays that way)

activate an object if it's linear or anguler speed goes above a certain threshold. then recursivly activate all the objects touching this one whose COM is above the current objects COM.

EDIT: this is similer to MrRowls algorithm in JigLib (google for it to get some great tips for making a physics engine.)

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!