First of all, thanks a lot for the btMultiBody, I think it's a great feature. I have been playing with it, and found some strange behavior when I enable limit constraints. I attached a file based on FeatherstoneMultiBodyDemo.cpp that reproduces the error I have been seeing. It is a very simple multibody with just two pieces. Steps to reproduce:
1. Open the demo
2. Grab the object and make it fall on the side
Expected:
- Stays on the floor, still
Actual:
- It starts rotating randomly
Another test that can be done is to comment out the following line:
Code: Select all
limitCons->setMaxAppliedImpulse(40);
I also reproduced the strange behavior by creating the whole scene in Z-UP mode (with gravity [0,0,-10]) instead of Y-UP, and in this case I don't even need to make it fall on the side, it keeps rotating while standing on the base of the cylinder (and eventually falls by itself).
Am I using the API wrong? Or is it a bug?
Also, if I may make a suggestion, please add an API to set link colliders, having to do the following is unintuitive, given that there is an API for the base:
Code: Select all
multiBody->getLink(linkIndex).m_collider = linkCollider;