Showing the changes to interface/src/Application.cpp (1 of 5 files). Show all
Unified · Split
| @@ -2361,6 +2361,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 2360 unmodified lines | |||
| 2361 | }); | 2361 | }); |
| 2362 | 2362 | ||
| 2363 | // Preload Tablet sounds | 2363 | // Preload Tablet sounds |
| 2364 | DependencyManager::get<EntityScriptingInterface>()->setEntityTree(qApp->getEntities()->getTree()); | ||
| 2364 | DependencyManager::get<TabletScriptingInterface>()->preloadSounds(); | 2365 | DependencyManager::get<TabletScriptingInterface>()->preloadSounds(); |
| 2365 | DependencyManager::get<Keyboard>()->createKeyboard(); | 2366 | DependencyManager::get<Keyboard>()->createKeyboard(); |
| 2366 | 2367 | ||
| @@ -8692,12 +8693,11 @@ void Application::createLoginDialog() { · 6325 unmodified lines | |||
| 8692 | 8693 | ||
| 8693 | auto keyboard = DependencyManager::get<Keyboard>().data(); | 8694 | auto keyboard = DependencyManager::get<Keyboard>().data(); |
| 8694 | if (!keyboard->getAnchorID().isNull() && !_loginDialogID.isNull()) { | 8695 | if (!keyboard->getAnchorID().isNull() && !_loginDialogID.isNull()) { |
| 8695 | const auto KEYBOARD_LOCAL_ORIENTATION = glm::quat(0.0f, 0.0, 1.0f, 0.25f); | ||
| 8696 | auto keyboardLocalOffset = cameraOrientation * glm::vec3(-0.4f * getMyAvatar()->getSensorToWorldScale(), -0.3f, 0.2f); | 8696 | auto keyboardLocalOffset = cameraOrientation * glm::vec3(-0.4f * getMyAvatar()->getSensorToWorldScale(), -0.3f, 0.2f); |
| 8697 | 8697 | ||
| 8698 | EntityItemProperties properties; | 8698 | EntityItemProperties properties; |
| 8699 | properties.setPosition(position + keyboardLocalOffset); | 8699 | properties.setPosition(position + keyboardLocalOffset); |
| 8700 | properties.setRotation(cameraOrientation * KEYBOARD_LOCAL_ORIENTATION); | 8700 | properties.setRotation(cameraOrientation * Quaternions::Y_180); |
| 8701 | 8701 | ||
| 8702 | entityScriptingInterface->editEntity(keyboard->getAnchorID(), properties); | 8702 | entityScriptingInterface->editEntity(keyboard->getAnchorID(), properties); |
| 8703 | keyboard->setResetKeyboardPositionOnRaise(false); | 8703 | keyboard->setResetKeyboardPositionOnRaise(false); |
| @@ -8728,7 +8728,6 @@ void Application::updateLoginDialogPosition() { · 24 unmodified lines | |||
| 8728 | auto upVec = getMyAvatar()->getWorldOrientation() * Vectors::UNIT_Y; | 8728 | auto upVec = getMyAvatar()->getWorldOrientation() * Vectors::UNIT_Y; |
| 8729 | auto offset = headLookVec * OFFSET.x; | 8729 | auto offset = headLookVec * OFFSET.x; |
| 8730 | auto newPositionVec = (cameraPositionVec + offset) + (upVec * OFFSET.y); | 8730 | auto newPositionVec = (cameraPositionVec + offset) + (upVec * OFFSET.y); |
| 8731 | auto newOrientation = glm::inverse(glm::quat_cast(glm::lookAt(newPositionVec, cameraPositionVec, upVec))) * Quaternions::Y_180; | ||
| 8732 | 8731 | ||
| 8733 | bool outOfBounds = glm::distance(positionVec, cameraPositionVec) > 1.0f; | 8732 | bool outOfBounds = glm::distance(positionVec, cameraPositionVec) > 1.0f; |
| 8734 | 8733 | ||
| @@ -8736,17 +8735,17 @@ void Application::updateLoginDialogPosition() { · 1 unmodified line | |||
| 8736 | { | 8735 | { |
| 8737 | EntityItemProperties properties; | 8736 | EntityItemProperties properties; |
| 8738 | properties.setPosition(newPositionVec); | 8737 | properties.setPosition(newPositionVec); |
| 8739 | properties.setRotation(newOrientation); | 8738 | properties.setRotation(cameraOrientation); |
| 8740 | entityScriptingInterface->editEntity(_loginDialogID, properties); | 8739 | entityScriptingInterface->editEntity(_loginDialogID, properties); |
| 8741 | } | 8740 | } |
| 8742 | 8741 | ||
| 8743 | { | 8742 | { |
| 8744 | const auto KEYBOARD_LOCAL_ORIENTATION = glm::quat(0.0f, 0.0, 1.0f, 0.25f); | 8743 | glm::vec3 keyboardLocalOffset = cameraOrientation * glm::vec3(-0.4f * getMyAvatar()->getSensorToWorldScale(), -0.3f, 0.2f); |
| 8745 | auto keyboardLocalOffset = newOrientation * glm::vec3(-0.4f * getMyAvatar()->getSensorToWorldScale(), -0.3f, 0.2f); | 8744 | glm::quat keyboardOrientation = cameraOrientation * glm::quat(glm::radians(glm::vec3(-30.0f, 180.0f, 0.0f))); |
| 8746 | 8745 | ||
| 8747 | EntityItemProperties properties; | 8746 | EntityItemProperties properties; |
| 8748 | properties.setPosition(newPositionVec + keyboardLocalOffset); | 8747 | properties.setPosition(newPositionVec + keyboardLocalOffset); |
| 8749 | properties.setRotation(newOrientation * KEYBOARD_LOCAL_ORIENTATION); | 8748 | properties.setRotation(keyboardOrientation); |
| 8750 | entityScriptingInterface->editEntity(DependencyManager::get<Keyboard>()->getAnchorID(), properties); | 8749 | entityScriptingInterface->editEntity(DependencyManager::get<Keyboard>()->getAnchorID(), properties); |
| 8751 | } | 8750 | } |
| 8752 | } | 8751 | } |