[11531] Normalize gameobject's quaternion, thanks to zergtmn for pointing

This commit is contained in:
SilverIce 2011-05-24 13:12:48 +03:00
parent d02bee5127
commit 1b709c8ff8
2 changed files with 2 additions and 1 deletions

View file

@ -1673,6 +1673,7 @@ void GameObject::SetRotationQuat(float qx, float qy, float qz, float qw)
if (qz == 0 && qw == 0)
quat = Quat::fromAxisAngleRotation(G3D::Vector3::unitZ(), GetOrientation());
quat.unitize();
m_rotation = QuaternionCompressed(quat).m_raw;
SetFloatValue(GAMEOBJECT_PARENTROTATION+0, quat.x);
SetFloatValue(GAMEOBJECT_PARENTROTATION+1, quat.y);