[ODE] Flat-ended cylinder to sphere collision unstable on cylinderends

John Miles jmiles at pop.net
Mon Jan 12 23:34:25 MST 2004


The dCylinders do seem a bit unstable.  I just merged dcylinder.cpp into my
copy of ODE 0.39, and uncommented the cylinder-dropping cases ('l' key) in
test_boxstack.cpp for dCylinderClassUser.  Anything dropped onto the flat
side of a cylinder tends to jitter severely for awhile, much more so than
objects dropped on boxes.  Spheres frequently dribble up and down for
several seconds before rolling off, although I haven't seen any
dramatically-explosive behavior.

Also, when two cylinders land near each other, the second one tends to float
above the lower one, as if the collision geoms are offset somewhat from the
cylinder body (http://www.speakeasy.net/~jmiles1/cyl.jpg, 125K).

If you hit the 'a' key to show geom AABBs, you'll see that the cylinder
AABBs are sometimes quite a bit larger than expected in the radial
dimensions.  As a dCylinder rolls across the landscape, its AABB expands and
contracts periodically, suggesting some unintended asymmetry in the math.

Note that if you're using the drawstuff library with dCylinders, you may
need to add something like this:

//
// Rotate -90 degrees in X so we can pass Y-aligned cylinder to
// Z-aligned renderer
//

float PI = 3.1415926535F;
float S = (float) sin(-PI/2);
float C = (float) cos(-PI/2);
GLfloat matrix[16];
memset(matrix, 0, sizeof(matrix));
matrix[0]=1;
matrix[5]=1;
matrix[10]=1;
matrix[15]=1;
matrix[1*4+1] = C;
matrix[2*4+1] = -S;
matrix[1*4+2] = S;
matrix[2*4+2] = C;
glMultMatrixf (matrix);

... before the calls to drawCylinder in drawstuff.cpp, to adjust for the
fact that Konstantin's cylinders are Y-aligned by default rather than
Z-aligned as assumed by drawCylinder().  If you don't, the cylinders will
appear to be misbehaving even more badly than they are.

-- jm

-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of Marty
Rabens
Sent: Monday, January 12, 2004 12:35 PM
To: ode at q12.org
Subject: [ODE] Flat-ended cylinder to sphere collision unstable on
cylinderends


I'm using the dCylinder class from the contrib folder of the ODE 0.39
distribution.  With a cylinder-sphere collision, the collision works nicely
when the sphere collides with the round side of the cylinder, but when it
collides with the flat end, the results are wild (the sphere ends up moving
away from the cylinder at extremely high velocity at unexpected angles).  It
does this with both the debug and release builds of ODE.  I'm building with
VC6.

Is this a known issue, and if so, does Konstantin have a more recent
version?

Thanks,
   Marty Rabens





More information about the ODE mailing list