Hi all, I'm writing a game for my final year project and I'm using Bullet for physics and Ogre for graphics. I've learned that Bullet can automatically update Entities' positions in the scene graph via btMotionState interface. However, I find it unclear whether the btTransform should contain a global or a local vertex space information. In examples I found they simply set the Ogre's node position via setPosition which sets position relative to its parent.
Code: Select all
void MotionState::setWorldTransform(const btTransform &worldTrans) {
if(NULL == mVisibleobj) return; // silently return before we set a node
btQuaternion rot = worldTrans.getRotation();
mVisibleobj->setOrientation(rot.w(), rot.x(), rot.y(), rot.z());
btVector3 pos = worldTrans.getOrigin();
mVisibleobj->setPosition(pos.x(), pos.y(), pos.z());
}
So this will only work if the parent of the mVisibleobj node is the Root node. Otherwise, it will produce wrong results, since I presume that worldTrans returned from getWorldTransform() should be in the world space?
So, just to stress my question again, does Bullet use the world space for simulation?