From 5ea6973fe73940de02025e601fd8f94c543dd1bc Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 23 Nov 2014 10:53:03 -0800 Subject: [PATCH] fix isFacingAvatar for 3d text overlays --- interface/src/ui/overlays/Text3DOverlay.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/ui/overlays/Text3DOverlay.cpp b/interface/src/ui/overlays/Text3DOverlay.cpp index 88ac009ac7..dbb423ad99 100644 --- a/interface/src/ui/overlays/Text3DOverlay.cpp +++ b/interface/src/ui/overlays/Text3DOverlay.cpp @@ -75,13 +75,14 @@ void Text3DOverlay::render(RenderArgs* args) { glPushMatrix(); { glTranslatef(_position.x, _position.y, _position.z); glm::quat rotation; + if (_isFacingAvatar) { // rotate about vertical to face the camera rotation = Application::getInstance()->getCamera()->getRotation(); - rotation *= glm::angleAxis(glm::pi(), glm::vec3(0.0f, 1.0f, 0.0f)); } else { rotation = getRotation(); } + glm::vec3 axis = glm::axis(rotation); glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);