AW: [ODE] ODE 0.50 distribution

Torsten Stein torsten.stein at epost.de
Fri Jun 11 12:19:03 MST 2004


Hi!

> FYI; I've also experienced problems with the latest (0.5 release, single
> precision, msvc-dll) version of ODE when colliding CCylinders with
> Trimeshes.
> Boxes and Spheres work perfectly. Capped cylinders seem to go about
> halfway through the mesh then either slowly sink through the rest of the
> way or explode in random directions, depending on whether I set a
> maximum correction velocity or not.

I had exactly the same problem. I worked with the managed wrapper made
by David Walker so my solution might not fit to your problems, but may
be the following hints may help with your problems. Otherwise, just
ignore them :-)

The collider callback is called with parameters geometry o1 and geometry o2.
In the ode c++ examples the bodies b1 and b2 are derived at the very
beginning
of the callback from these geometries. When later on in the callback the
joint
are created, there is an dJointAttach done with b1 and b2 as paramers.

David made a different approach in his wrapper: He creates the joint with
body parameter, that were derived from the contactarray that was build up
from
the collision function (dCollide). It looks something like that:

  cj.Attach(contacts[i].Geom.Geom1.Body, contacts[i].Geom.Geom2.Body);

(It's c# code, but I hope you'll get what I mean ?)

What I figured out is, that sometimes - when talking about
ccylinder-trimesh-collision
- the geoms here are switched compared to the geoms that we got as
parameters to the
callback! (o1 matches contacts[i].Geom.Geom2 and o2 matches
contacts[i].Geom.Geom1).
As a result forces gets calculated in the wrong direction later on in the
solver! At least
lots of hours of debugging shows exactly this. And the obstacles behaviour
would
fit to this effect: When colliding, they move on (in the wrong direction, as
if forces
are applied in the wrong direction) until they get stuck somewhere in the
middle,
jiggeling around (as if forces are always applied in the wrong directions).

Long talk. And maybe somewhat unclear I guess. But try this: Please check
your
collsion callback and have a look at how you create the contact joints. Do
it like
in the original ode c++ examples: Use the bodies derived from the funtion
parameters.
Do not use the bodies derived from the contact array! This simple change
solved all
my ccylinder-trimesh-collision problems.

May be these hints guide you to you personal solution.

Torsten



More information about the ODE mailing list