[ODE] cylinder collision. (and correction)

Jon Watte (ODE) hplus-ode at mindcontrol.org
Thu Oct 20 18:01:08 MST 2005


> To describe what I need:  lay out coins of all different
> types on a desk surface.  They collide and effect each
> other along their edges, but they lie flat on a surface.

A body can have more than one Geom.

I would add two geoms to the body: a sphere, and a thin, flat box. The 
sphere and box would share the same center: the center of mass of the 
body. I make sure the sphere fully encloses the box. (box side length == 
sqrt(0.5)*sphere radius, IAICR?)

Inside collision callbacks, I filter out contacts that are generated by 
the sphere, if they are located below or above the up/down surfaces of 
the box. I accept all collisions detected by the box. Just because you 
get a collision callback doesn't mean you have to create a contact joint.

This will give me coin-coin collisions using the bounding spheres, but 
the coins will slide flatly on the ground using the box geom contacts.

If you have slanted walls (at 45 degrees angle with the ground, say), 
you may get contacts with the spheres that you really want to react to, 
else you'll get a bit of interpenetration until the box picks up the 
slack -- you can formulate an appropriate heuristic for this case. Or 
just don't use slanted walls :-)

Cheers,

			/ h+



More information about the ODE mailing list