[ODE] Putting in your own collision detection

Thomas Harte thomasharte at lycos.co.uk
Wed Dec 18 08:20:52 2002


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--=_NextPart_Lycos_0103261040224539_ID
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

>Ups.. Got it working better now, it looks like it comes to rest.. Generated 
>only one contactjoint even though there were several
>collisions..

This sort of thing is all a matter of fudging. As the docs point out, the strictly accurate 
thing to do is to talk about contact patches, and in real life there can never be any 
penetration depth whatsoever for genuinely rigid bodies...

>But I noticed no friction.. Even when setting:
>
>contact->surface.mu = 1;

Notice that 'dInfinity' corresponds to the case where there is 'maximum' friction (i.e. so 
much that the object may never move parallel to a surface it is resting upon). 1 is 
actually a fairly low value for many simulations.

Also, notice that the number of contact constraints you generate implicitly affects total 
friction on the body.

>Do I need to set the contect->fdir1 to get friction?.. Didn't see it in the 
>test examples but there was friction there.. hmm.
>Going to test that anyway.

No, you don't. But you almost certainly want to set dContactApprox1 if you expect mu 
to be anything like the mu you'd expect for the real Coulomb friction model. You still get 
a bit of a bodge implementation, which uses what the documents describe as a 'force 
pyrmaid' rather than the 'force cone' you'd expect from the real model. The idea behind 
this is seems to be reducing processing costs in the simulation, although if possible I'd 
personally like to see e.g. a dContactApprox2 flag which allows a proper 'force cone' to 
be used.

As it is, I personally have been driven to implementing friction forces myself. Not just 
because I require a genuine Coulomb implementation, but also because, for example, 
the following (pseudocode) doesn't seem to work anything like as expected in ODE :

.mode = dContactApprox1 | dContactFDir1 | dContactSlip1;
.slip1 = dInfinity;
.mu = dInfinity;
.dir1 = {0, 0, 1};
.normal = {0, 1, 0};

dAddTorque(1, 0, 0);

In this example, the body just spins on the spot.

-Thomas

When words aren't enough - Vodafone live! A new world of colour, sounds, picture messages and information on your mobile. <a href="http://ad.doubleclick.net/clk;4909903;7724245;q?http://www.vodafone.co.uk/live">
Click here</a> to find out more.


--=_NextPart_Lycos_0103261040224539_ID--