I've encountered what appears to be the exact same behavior in a slightly different context. In the process of experimenting with the various types of constraints, I created two identical cubes with a constraint between them as seen in figs 3, 4, and 5 of the Bullet User Manual. All the other constraints seemed to work fine, but when I tried the btGeneric6DofConstraint I ended up with a crazily colliding system like Mako described.
For example, this slider constraint behaved exactly as I expected:
Code:
btTransform localA, localB;
localA.setIdentity();
localB.setIdentity();
btSliderConstraint *slider = new btSliderConstraint(bodyA, bodyB, localA, localB, true);
slider->setLowerLinLimit(3.0f);
slider->setUpperLinLimit(10.0f);
slider->setLowerAngLimit(0.0f);
slider->setUpperAngLimit(0.0f);
mWorld->addConstraint(slider, true);
While this generic6dof constraint caused the two-cube system to cartwheel wildly all over the place, constantly gaining energy:
Code:
btTransform localA, localB;
localA.setIdentity();
localB.setIdentity();
btGeneric6DofConstraint *genericConst = new btGeneric6DofConstraint(bodyA,bodyB, localA, localB,true);
genericConst->setLinearLowerLimit(btVector3(3,0,0));
genericConst->setLinearUpperLimit(btVector3(10,0,0));
genericConst->setAngularLowerLimit(btVector3(1,0,0));
genericConst->setAngularUpperLimit(btVector3(0,0,0));
mWorld->addConstraint(genericConst, true);
Mako, it sounds like you could get away with a btSliderConstraint constraint with a locked linear limit; based on my observations, you might want to try that. I'd still love to know what's going wrong though.