Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

vicviper

rigid body stacking

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

hi, I''ve been looking at some of the physic packages arround, all of them put a lot of emphasis on the cube stacking demos... I know this stresses a lot physic engines, so I figure solving this would be key for a good phy engine... so, which are the techniques used to handle this situations? I don''t expect a detailed explanation... just general ideas... thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
I''m sure Jakobsen physics could handle that.

http://www.ioi.dk/Homepages/thomasj/publications/gdc2001.htm

Although the paper doesn''t have much in the area of this type of coldet (nowhere does it mention body-body coldet), I''m sure it could be tweaked.

Share this post


Link to post
Share on other sites
Two ways:

1. If you''re solving for collisions/resting contact all in one go, e.g. using a LCP solver, then stacking will just happen - the solver will automatically handle the case of one contact force affecting another.

2. If you''re solving contacts sequentially, then you have to iterate - i.e. for each physics step walk through each of your contacts and resolve - and repeat until all contacts are sorted (or until you get bored). The forces required for stacking etc will eventually propogate through the system (same will happen in the "Jakobsen" method).

Advantage of the former method is that you can guarantee all contacts will get resolved. With the latter method when you have objects of different mass stacked up then the propogation happens rather slowly - you need a lot of iterations. Even then, you may have to stop before all your contacts are fully resolved - so you need some "safety-net" code to actually handle penetration.

Having said that, I can stack more than 30 boxes on top of each other at 80 FPS using the second method (and I know of lots of places to optimise) on a fairly fast machine. And the sequential method can handle jointed objects OK too, so long as the components don''t differ hugely in mass.

One big advantage of the sequential method is that you can add all sorts of extra code into the algorithm - e.g. sleeping/deactivation, and constraints that might be awkward to get into the LCP solver. Much simpler to code and debug too

Incidently, my experience with stacking using the Jakobsen method is that it was pretty slow (limit of around 10 boxes stacked on the same machine as above) - though my implementation was a functional experiment rather than a exercise in efficiency...

See my website via profile for demos (jiggle and carsim).

Share this post


Link to post
Share on other sites
I don''t think the emphasis is on the importance of stacking boxes, it is just a neat little example. It shows that the objects can interact with themselves in a reasonably realistic fashion.

The method is just your basic overlap collision test. The top box would add a force to the next box which would add a force to the next etc...

The idea is that the force actually moves the boxes and when the overlap is found it moves them back, so if it moves them too much when it moves them back the boxes will be very jumpy.

So maybe they use some method that tests if the move although insighnificant will cause an overlap and if so don''t move (but still use the collisions (in cause the box isn''t lying flat against the other box and may need to rotate) and add the force to the other box), this will prevent it from having tiny moves that will cause it too appear that the boxes are shaky on top of each other.

But say the force is great enough to push a box most of the way through another box it would probably fail and it appears that most of these physics engine do fail at high velocites or massive force (the awful perils of the overlap test).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!