SurfaceCtrl: Updated the LookAt function, added Inverse of quaterion to ensure good LookAt

git-svn-id: svn://ultimatepp.org/upp/trunk@15205 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
xemuth 2020-10-06 14:18:14 +00:00
parent 2f1887ee16
commit 3ba374fa9c

View file

@ -48,9 +48,9 @@ class Transform{
if(directionLength > 0.0001){
direction /= directionLength;
if(customUp != glm::vec3(0.0f,0.0f,0.0f))
SetRotation(glm::quatLookAt(glm::normalize(direction), customUp));
SetRotation(glm::inverse(glm::quatLookAt(glm::normalize(direction), customUp)));
else
SetRotation(glm::quatLookAt(glm::normalize(direction), Up));
SetRotation(glm::inverse(glm::quatLookAt(glm::normalize(direction), Up)));
}
return *this;
}