Rigid Body Collision Resolution Problem [Solved]

Started by
13 comments, last by oliii 18 years, 6 months ago
I can't see how I can translate the information in the Mirtich paper into something I can use. As I'm only using a 2D simulation, and my maths or understanding of entirely what is mentioned, is good enough to translate the 3D down one dimension (and also because it would require a lot of recoding) I'll give Baraff's work a go.

Advertisement
The penalty force method can be a good approach. It is elegant, and easy to implement (apart from that pesky finding the penetration depth thing). And it can run faster than the impulse-momentum approach, in the case that you intend to totally, 100% disallow interpenetration.

The difficulty is that you must essentially use implicit integration to make it stable in general. And implicit integration is the wrench in the works---not always easy to implement.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
I have to admit, that despite all the helpful posts, I'm not entirely sure what the root of my woes are. Today, because I've been too tired to grasp the the complexities of the papers suggested, I tried to limit the number of subdivisions that are being made.

Objects which have collided are now added to a list in pairs with the size of the unsucceful time step. Once the time step gets too small, there's a kind of "shut up" function, which pretends that the objects are as close as I'd like and applies impulse to drive them appart. This has had not effect. I had thought it would lead to some inaccruacies, but that the program would run. Instead nothing has changed. When the program grinds to a halt, it's not that it doesn't try to seperate objects by applying impulse, it just fails to do so.

The problem even arises when just two blocks collide, which shouldn't be a problem for subdivision, particualarily given that I am asking for a very low accruacy (objects are 2 units across and only need to be with in 0.3 units of each other and closing to be dealt with). That said the limit is definately reached. So, most times it works, but often it doesn't. Curse my impotent impulses :P
Hahaha ha... ha... *sob*

I finally found the problem! After months of looking for it, I came across it by pure accident! It was the collision normal. The code that found it looked at each object in the collision, finding the contact point and the edge (for the normal) involved. Some time ago, in a bout of optimisation, I replaced several calls to the vector magnitude function with a magnitude squared function.

I missed one.

ARRRGH!!

Two months after the change, a bug fix (the impulse) causes the code to have an impact (excuse the pun) and it's taken several weeks to track it down. Once again thanks to every one for the help. I'm going to cry :'(
hehehe [grin]

Everything is better with Metal.

This topic is closed to new replies.

Advertisement