[ODE] Trimesh-CCylinder problem

Colin Bonstead colin at cyan.com
Wed Jun 2 13:45:39 MST 2004

I'm running into a problem with the new Croteam trimesh-ccylinder 
collider.  Basically, I've got an extra ccylinder around my avatars 
physical ccylinder, for detecting when he's near walls.  The extra 
ccylinder doesn't actually create contacts with anything, but I do call 
the collide function on it so I can get normals.

When the ccylinder is touching the edge of a polygon I get a normal back 
that's significantly off from the normal of the polygon.  I found a note 
about this in the code (in collision_trimesh_ccylinder.cpp):

NOTES from Croteam's Alen
As a side note... there are some extra contacts that can be generated on 
the edge between two triangles, and if the capsule penetrates deeply 
into the triangle (usually happens with large mass or low FPS), some 
such contacts can in some cases push the capsule away from the edge 
instead of away from the two triangles. This shows up as capsule slowing 
down a bit when hitting an edge while sliding along a flat tesselated 
grid of triangles. This is only if capsule is standing upwards.

Same thing can appear whenever a smooth object (e.g sphere) hits such an 
edge, and it needs to be solved as a special case probably. This is a 
problem we are looking forward to address soon.

So, anyone have any ideas on how to fix this?  I really don't know 
enough about collision detection to fix it myself.  My one idea was to 
just filter my contacts and throw any that were significantly different 
from the normal of the polygon that generated them.  The problem with 
that is, I don't think there's any easy way to get the specific polygon 
that created a contact.

More information about the ODE mailing list