Jump to content
  • Advertisement
Sign in to follow this  
Volgogradetzzz

Constraints + collision resolution

This topic is 3084 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. I'm trying to write a physics engine and look for advise. I need constraints for my engine and I'm usind method from famous Thomas Jakobsen article 'Advanced Character Phisycs'. I have iterations number of, say, 10. Also I'm looking for penetration of objects with separate axis theorem, which also need several iterations. And now question - what algorithm should I use for better perfomance. Currently I use this in each frame: 1. Find forces. 2. Satisfy constraints in current iteration. 3. Run through all shapes to find penetration and resolve penetration. 4. Increase iteration and go to p.2 if iterations left. 5. Set new velocities to my shapes. Is it right or I miss something.?

Share this post


Link to post
Share on other sites
Advertisement
A typical approach is to resolve collisions/penetrations and constraints in a single iteration loop, rather than solve constraints, then penetration, then possibly go back to resolve constraints again. These things, penetration included, are all, after all, constraints that have to be satisfied together, not separately. So, the challenge is to set up a system that treats penetration constraints together with rigid body constraints. I'm aware of the Jakobsen article, and know its pretty popular...but I've never read it to see how his approach deals with all this. So I can't really comment on that. I can say that the commercial and open source physics engines do typically have constraint solvers that can do what I said. At the start of each frame, they determine object/object contact (e.g., they might be touching, might have collided, might have interpenetrated...) and create new, temporary constraint for the duration of that frame. The new contact constraint gets put into the system of constraints, along with rigid body constraints, then the whole set gets sent to the constraint solver (which might be an iterative solver). After all the constraints are resolved, the contact constraints are removed and then the time integration is done to move the objects.

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!