Fix converting HPR to bullet quaternion

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11686 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2012-10-15 23:51:36 +00:00
parent e37603a8bc
commit a6c2efc48a

View File

@ -327,8 +327,14 @@ void ThreeDAnimation::update(float dt)
Vec3 hpr2(hpr);
hpr2.degreeToRad();
btQuaternion q;
q.setEuler(hpr2.getY(), hpr2.getX(), hpr2.getZ());
core::matrix4 mat;
mat.setRotationDegrees(hpr);
irr::core::quaternion tempQuat(mat);
q = btQuaternion(-tempQuat.X, -tempQuat.Y, -tempQuat.Z, tempQuat.W);
Vec3 p(xyz);
btTransform trans(q,p);
m_motion_state->setWorldTransform(trans);