Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MotionState::MotionState(Transform* visualTransform, const btTransform& bulletTransform)
- : mVisualTransform(visualTransform)
- , mTransform(bulletTransform)
- {}
- void MotionState::getWorldTransform(btTransform &worldTrans) const
- {
- worldTrans = mTransform;
- }
- void MotionState::setWorldTransform(const btTransform &worldTrans)
- {
- if(!mVisualTransform)
- return;
- mTransform = worldTrans;
- btQuaternion rot = mTransform.getRotation();
- btVector3 pos = mTransform.getOrigin();
- mVisualTransform->setOrientation(Quaternion(rot.w(), rot.x(), rot.y(), rot.z()));
- mVisualTransform->setPosition(Vector3(pos.x(), pos.y(), pos.z()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement