[ODE] Trimesh collision problem

David Walters hidden.asbestos at googlemail.com
Wed Mar 21 05:01:30 MST 2007

> No the wiki says, that 0 means 1 collision. It also works checking
> collisions box <-> ray with 0 as flag

You're right, it's a subtle feature that I didn't know about - however
the documentation for dCollide clearly states:

 * @param flags The flags specify how contacts should be generated if
 * the geoms touch. The lower 16 bits of flags is an integer that
 * specifies the maximum number of contact points to generate. Note
 * that if this number is zero, this function just pretends that it is
 * one -- in other words you can not ask for zero contacts. All other bits
 * in flags must be zero. In the future the other bits may be used to
 * select from different contact generation strategies.

So I've created a patch to respect this behaviour, but I've not
applied it immediately because it may be preferable to be stricter -
ie. assert when flags == 0 and reword this documentation to say it
must be at least one.  That seems to make more sense to me really, if
you put X contacts in you should get (at most) X contacts out.  If you
put zero in you needn't be calling dCollide at all... so it might be
more helpful to point this out than tolerate it...

Anyway here's the link ... hope we can get a discussion going about
this behaviour!



p.s. I made a 'strict' patch as well to save time if a decision is made.

More information about the ODE mailing list