Jump to content
  • Advertisement
Sign in to follow this  
LonelyStar

Object stacking again - Should this algorithem work?

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

Hello together, I am trying to get my physics engine to be able to be able to handle object stacking. I had and Idea about an algorithem, and I found similar Ideas in this forum what I am trying to do now is the following: ----------------------------------------------------------------- - Detect all object-object collisions and make a time sorted list of them. In this list, for every object only the first collision is inserted. while the collision-list is not empty do: - Take the first pair of objects from the list and do collision response. Do the following for both objects: - Test the object against all other objects in the world. Take the earliest collision. - Travel through the collision list. - If you find a earlier collision with the object, do not insert anything. - Otherwise, insert it at the correct position (so that the list remains time-sorted). return to beginning of loop ------------------------------------------------------------------- I think in theory this should work. But for more than 4 objects, the algorithem does not converge (meaning, the collision list never gets empty). Has it been done does way before? Is this just a bad Idea? Advice and Tips are welcome :) Thanks! Nathan

Share this post


Link to post
Share on other sites
Advertisement
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!