[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) if (qz == 0 && qw == 0)
quat = Quat::fromAxisAngleRotation(G3D::Vector3::unitZ(), GetOrientation()); quat = Quat::fromAxisAngleRotation(G3D::Vector3::unitZ(), GetOrientation());
quat.unitize();
m_rotation = QuaternionCompressed(quat).m_raw; m_rotation = QuaternionCompressed(quat).m_raw;
SetFloatValue(GAMEOBJECT_PARENTROTATION+0, quat.x); SetFloatValue(GAMEOBJECT_PARENTROTATION+0, quat.x);
SetFloatValue(GAMEOBJECT_PARENTROTATION+1, quat.y); SetFloatValue(GAMEOBJECT_PARENTROTATION+1, quat.y);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11530" #define REVISION_NR "11531"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__