From 059c5c1806d287e3072b6f0a9b56d86fb0325a79 Mon Sep 17 00:00:00 2001 From: Daniela Date: Tue, 24 Oct 2017 14:49:17 +0100 Subject: [PATCH] billboard is now using a general formula to calculate the rotation, where we don't assume y is up. Added dependency on the avatar. --- interface/src/ui/overlays/Billboardable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/ui/overlays/Billboardable.cpp b/interface/src/ui/overlays/Billboardable.cpp index e71e8bb951..892a9d998d 100644 --- a/interface/src/ui/overlays/Billboardable.cpp +++ b/interface/src/ui/overlays/Billboardable.cpp @@ -3,6 +3,7 @@ // interface/src/ui/overlays // // Created by Zander Otavka on 8/7/15. +// Modified by Daniela Fontes on 24/10/17. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. @@ -33,7 +34,7 @@ bool Billboardable::pointTransformAtCamera(Transform& transform, glm::quat offse if (isFacingAvatar()) { glm::vec3 billboardPos = transform.getTranslation(); glm::vec3 cameraPos = qApp->getCamera().getPosition(); - + // use the referencial from the avatar, y isn't always up glm::vec3 avatarUP = DependencyManager::get()->getMyAvatar()->getOrientation()*Vectors::UP; glm::quat rotation(conjugate(toQuat(glm::lookAt(billboardPos, cameraPos, avatarUP))));