Jump to content
  • Advertisement
Sign in to follow this  
EricDB

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

This topic is 4215 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 - http://www.gamasutra.com/features/20020118/vandenhuevel_01.htm

Share this post


Link to post
Share on other sites
Advertisement
This is the algorithm that i use to deactivate and activate things:
Deactivation:
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)

Activation:
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 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!