The btHinge::setLimit only accepts radians, not degrees. So instead of 90*PI (which mixes degrees and radians), you should use SIMD_HALF_PI (as defined in LinearMath/btScalar.h), or multiply degrees by SIMD_RADS_PER_DEG to get radians:
Code: Select all
hinge->setLimit( 0.0f, SIMD_HALF_PI );
//or equivalent
hinge->setLimit( 0.0f, 90 * SIMD_RADS_PER_DEG );
This specific situation can only be fixed with the new constructor I mentioned above taking both frames.
Or, as Marcus mentioned, we can also center the b frame around the axis of revolution inside the hinge->setLimit(...) implementation.
He should be frequenting this board so if he considers it important he takes a stab at it.
I'm indeed too busy to process each patch/comment straight away, even though a few other developers are helping with develpment now. We recently started using Google Code, including the issue tracker, and you issue is here:
http://code.google.com/p/bullet/issues/detail?id=41
Can you try to create a new fix and submit a patch/code snippet for btHinge::setLimit to that issue, that rotates the frame B?
On the softness/relaxation tuning, please experiment a bit more, and otherwise hopefully Marcus can help out.
Thanks for the feedback/fixes!
Erwin