From 3ba374fa9c757a6f0e403e7e4eb892ea5f113afa Mon Sep 17 00:00:00 2001 From: xemuth Date: Tue, 6 Oct 2020 14:18:14 +0000 Subject: [PATCH] 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 --- bazaar/SurfaceCtrl/Transform.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bazaar/SurfaceCtrl/Transform.h b/bazaar/SurfaceCtrl/Transform.h index 46ffa44b6..1d71b6c55 100644 --- a/bazaar/SurfaceCtrl/Transform.h +++ b/bazaar/SurfaceCtrl/Transform.h @@ -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; }