mirror of
https://github.com/mangosfour/server.git
synced 2025-12-19 13:37:01 +00:00
[11531] Normalize gameobject's quaternion, thanks to zergtmn for pointing
This commit is contained in:
parent
d02bee5127
commit
1b709c8ff8
2 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue