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)
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue