I have a robot (btTriangleMeshShape for each component) and a chain of boxes used as a cable, which is anchored on two components of the robot. I want to rotate a robot component and when this happens, I want to twist/ roll the cable on that component. The problem is - when i rotate a robot component, collision does not work anymore with that component.
I cannot use btHullShape because of the lack of accuracy, neither btGimpact because of the complexity of computations (which gives a really unsatisfying performance). I couldn't improve enough any of these two shapes, so that is why I use btTriangleMeshShape and rotate it by code.
Also, I have replaced the btTriangleMeshShape of the rotating component with a simple static box and rotate the box. Using the box shape, collision is working with that box.
So the problem of collision not working is only when trying to rotate a (static) btTriangleMeshShape.
Here is the code I use to rotate the static body, although I don't think it's necessary (it works for box shape, not for triangle mesh shape):
btTransform tr = m_dynamicsWorld->getCollisionObjectArray()->getWorldTransform(); static float angle = 0.f; angle += 0.1f; tr.setRotation(btQuaternion(btVector3(1, 0, 0), -angle)); m_dynamicsWorld->getCollisionObjectArray()->setWorldTransform(tr); m_dynamicsWorld->updateAabbs(); m_dynamicsWorld->computeOverlappingPairs();
I have to mention that I've searched the web before and couldn't find any solution and also I'm a newbie on Bullet Physics and any graphic libraries.
Any help would by really apreciated,