I just installed bullet and messing around with it.
I'm having a strangle problem. when I set up a rigidbody I want the motion state origin to start at the current position of my object. I have a transform class that takes care of all that. Here's the issue, if I set up my motion state like this:
Code: Select all
motionState = new btDefaultMotionState(btTransform(btQuaternion(), btVector3(0,0,0)));
Code: Select all
btTransform t;
btrb->getMotionState()->getWorldTransform(t);
Logger::LogWarning("In update, y is", t.getOrigin().getY());
However, if I set the motion state this way:
Code: Select all
btScalar x = go->transform.GetGlobalPosition().x;
btScalar y = go->transform.GetGlobalPosition().y;
btScalar z = go->transform.GetGlobalPosition().z;
motionState = new btDefaultMotionState(btTransform(btQuaternion(), btVector3(x,y,z)));
Those parameters (x,y,z) from my transform class are all 0. So it works with hard coded values, but not if I pass in parameters.
Anybody else find this strange?
Thanks!