diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e38d156336..bad0b6a3aa 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2462,7 +2462,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo glm::vec3 dPosition = frustumPos - position; // If x and z are 0, atan(x, z) is undefined, so default to 0 degrees float yawRotation = dPosition.x == 0.0f && dPosition.z == 0.0f ? 0.0f : glm::atan(dPosition.x, dPosition.z); - glm::quat result = glm::quat(glm::vec3(0.0f, yawRotation, 0.0f)); + glm::quat result = glm::quat(glm::vec3(0.0f, yawRotation, 0.0f)) * rotation; if (rotate90x) { result *= ROTATE_90X; } @@ -2475,7 +2475,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo // make sure s is not NaN for any component if (glm::length2(s) > 0.0f) { - glm::quat result = glm::conjugate(glm::toQuat(glm::lookAt(frustumPos, position, avatarUP))); + glm::quat result = glm::conjugate(glm::toQuat(glm::lookAt(frustumPos, position, avatarUP))) * rotation; if (rotate90x) { result *= ROTATE_90X; } diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp index 870ed09515..1e771d8e43 100644 --- a/libraries/entities/src/EntityItemProperties.cpp +++ b/libraries/entities/src/EntityItemProperties.cpp @@ -811,7 +811,8 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const { * @property {Uuid[]} renderWithZones=[]] - A list of entity IDs representing with which zones this entity should render. * If it is empty, this entity will render normally. Otherwise, this entity will only render if your avatar is within * one of the zones in this list. - * @property {BillboardMode} billboardMode="none" - Whether the entity is billboarded to face the camera. + * @property {BillboardMode} billboardMode="none" - Whether the entity is billboarded to face the camera. Use the rotation + * property to control which axis is facing you. * * @property {Entities.Grab} grab - The entity's grab-related properties. * diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 3ed1ad581c..eeb42626c2 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -3141,6 +3141,13 @@ bool EntityTree::readFromMap(QVariantMap& map, const bool isImport) { } } + // Before, billboarded entities ignored rotation. Now, they use it to determine which axis is facing you. + if (contentVersion < (int)EntityVersion::AllBillboardMode) { + if (properties.getBillboardMode() != BillboardMode::NONE) { + properties.setRotation(glm::quat()); + } + } + EntityItemPointer entity = addEntity(entityItemID, properties, isImport); if (!entity) { qCDebug(entities) << "adding Entity failed:" << entityItemID << properties.getType();