[ODE] patch: TriMesh-Box collision bugfix

Aras Pranckevicius nearaz at interamotion.com
Mon Oct 20 16:03:35 MST 2003


Hi,

Trimesh-Box collision again doesn't respect contacts count (can overwrite
past the end of supplied array). I've written a bugfix before, but after
that the collision routine was changed, making the previous fix ineffective.
The previous fix tested contacts count in each loop over touched faces
iteration, but now in a single iteration several contacts can be generated.

So, changes to collision_trimesh_box.cpp, dCollideBTL():

around line 410, at start of "for (int i = 0; i < TriCount; i++)" loop:
comment out whole "if (OutTriCount == (Flags & 0xffff))" test.

after each call to GenerateContacts, add this (nasty goto's!):
    if( OutTriCount == (Flags & 0xffff) )
        goto _fullContacts;
the calls are in two places inside main "over faces" loop.

after main "over faces" loop, and before the final small "over contacts"
loop, add label:
    _fullContacts:


Aras Pranckevicius aka NeARAZ
http://www.gim.ktu.lt/nesnausk/nearaz/



More information about the ODE mailing list