mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-10 14:22:46 -06:00
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:
parent
2f1887ee16
commit
3ba374fa9c
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue