[ODE] TriMesh collision proposed fixes
nearaz
nearaz at interamotion.com
Wed Jul 2 11:47:02 2003
Hi,
While developing LTGameJam2003 (jammy.sourceforge.net/2003), I've fixed some
seemed-to-be-bugs in ODE's tricollider. Now that it's in the core, I think
some of them are there:
In some places it doesn't respect the given max. contact count, and
overwrites past the end of user-supplied contact array. For tri-box and tri-
sphere collision I've fixed it like:
collision_trimesh_box.cpp, at line 424:
insert just after "for (int j = 0; j < InContacts.Count; j++) {" this: "if(
OutTriCount >= Flags ) break;"
collision_trimesh_sphere.cpp, at line 284:
insert just after "for (int i = 0; i < TriCount; i++){" this: "if(
OutTriCount >= Flags ) break;"
Also, tri-ray collision was reporting the distance from the end of the ray
for me (not from the start). Well, that might have been just my bug somewhere
else, I've quick-fixed it by modifying collision_trimesh_ray.cpp, line 112:
change "Length - T" to "T".
Aras Pranckevicius aka NeARAZ
http://www.gim.ktu.lt/nesnausk/nearaz/