I'd like to make a rigidbody rotate around another rigidbody. So far i've managed to make the rigidbody rotate around its own axis, but i want it to rotate around the other object's axis/position
this is the code until now:
Code: Select all
btTransform starTransform;
starTransform = bulletPhysics->->getRigidBody()->getWorldTransform();
btQuaternion rot = starTransform.getRotation();
float angleDiff = 50;
btQuaternion diffRot = btQuaternion(btVector3(0, 1, 0), angleDiff);
rot = diffRot * rot;
starTransform.setRotation(rot);
bulletPhysics->getRigidBody()->setWorldTransform(starTransform);