[ODE] Contact cache optimization

John Miles jmiles at pop.net
Mon Jul 26 12:18:24 MST 2004


Yeah, that's kind of awkward.  To keep everything consistent in the
application-level cache, I compare the g1 and g2 geoms passed to my
ODECollide() callback with the g1 and g2 for the (deepest) contact
structure, and negate the contact's normal if they don't match.  That's
obviously something that ought to be done by ODE rather than the
application.

That being said, I didn't bother to compare the normals before concluding
that the contacts were all the same, but it seems to be a safe assumption
since the floating-point depth values are exactly (bitwise) identical.

My reasoning is that even if I reject a collision incorrectly once in awhile
due to numerical coincidences, I'll just catch it on the next frame when the
depths are different.

-- jm


>  >I added a simple test to ignore any collisions that were already
> cached with
>  >identical object pairs and primary contact depths, and that
> eliminated
> the
>  >contact-cache thrashing nicely without appearing to cause any
> unwanted
> effects.
>
> Just depths and not normals too? Maybe it is they way I wrapped ODE,
> but
> it seems like the box-box contact generation is not very continuous. By
>
> that I mean contact normals flip back and forth between who is the
> owner
> for a pair. This is most obvious as a pair starts to rest together. I
> would guess this makes tolerance based caching much more difficult and
>
> I bet it also makes the solver work harder too.
>
> -billy
>



More information about the ODE mailing list