Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualOlof Hedman

Posted 29 November 2012 - 04:31 PM

You got pretty much exactly what you wanted in the first post.
Here its modified with setting yaw, pitch and roll:

btMatrix3x3 orn = m_pRigidBody->getWorldTransform().getBasis(); //get basis of world transformation
btMatrix ypr;
ypr.setEulerYPR(0.2f,0.1f,0.1f);
orn *= ypr //Multiply it by rotation matrix, yaw, pitch, roll
m_pRigidBody->getWorldTransform().setBasis(orn); //set new rotation for the object


Edit:

No one is here to just write your code for you


Oops :)

#2Olof Hedman

Posted 29 November 2012 - 04:30 PM

You got pretty much exactly what you wanted in the first post.
Here its modified with setting yaw, pitch and roll:

btMatrix3x3 orn = m_pRigidBody->getWorldTransform().getBasis(); //get basis of world transformation
btMatrix ypr;
ypr.setEulerYPR(0.2f,0.1f,0.1f);
orn *= ypr //Multiply it by rotation matrix, yaw, pitch, roll
m_pRigidBody->getWorldTransform().setBasis(orn); //set new rotation for the object


No one is here to just write your code for you


Oops :)

#1Olof Hedman

Posted 29 November 2012 - 04:29 PM

You got pretty much exactly what you wanted in the first post.
Here its modified with setting yaw, pitch and roll:

btMatrix3x3 orn = m_pRigidBody->getWorldTransform().getBasis(); //get basis of world transformation
btMatrix ypr;
ypr.setEulerYPR(0.2f,0.1f,0.1f);
orn *= ypr //Multiply it by rotation matrix, yaw, pitch, roll
m_pRigidBody->getWorldTransform().setBasis(orn); //set new rotation for the object


PARTNERS