[ODE] Bug found in trimesh vs ccylinder

Flavien Brebion f.brebion at vrcontext.com
Wed Jul 14 17:16:08 MST 2004


Hi,

I just fixed a small bug in the trimesh vs ccylinder code.
It internally uses an array of 32 contacts (hard coded) but does
not check against this limit when filling the contacts.

In file collision_trimesh_ccylinder.cpp,
in function _cldTestOneTriangleVSCCylinder,

Add this check 2 times:
	 /// Patch: fixed crash in cylinder-trimesh code
	 if (ctContacts >= gMaxLocalContacts)
		return;

Just before these 2 lines:
	// contact 0
	gLocalContacts[ctContacts].fDepth = fDepth0;
and
	// contact 1
	gLocalContacts[ctContacts].fDepth = fDepth1;

Also don't forget to apply the patch to CVS, thanks.

F. Brebion



More information about the ODE mailing list