From b72d5bf80c234a2d50a1f4ebfae787cbd683fd0b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 23 May 2020 14:53:43 +1200 Subject: [PATCH 01/74] Build OpenVR plugin on Linux --- cmake/ports/hifi-client-deps/CONTROL | 2 +- cmake/ports/openvr/portfile.cmake | 59 +++++++++++++++------- plugins/openvr/CMakeLists.txt | 6 ++- plugins/openvr/src/OpenVrDisplayPlugin.cpp | 6 +++ 4 files changed, 53 insertions(+), 20 deletions(-) diff --git a/cmake/ports/hifi-client-deps/CONTROL b/cmake/ports/hifi-client-deps/CONTROL index 7070cb6fb9..75c27090f9 100644 --- a/cmake/ports/hifi-client-deps/CONTROL +++ b/cmake/ports/hifi-client-deps/CONTROL @@ -1,4 +1,4 @@ Source: hifi-client-deps Version: 0.1 Description: Collected dependencies for High Fidelity applications -Build-Depends: hifi-deps, aristo (windows), glslang, liblo (windows), nlohmann-json, openvr (windows), quazip (!android), sdl2 (!android), spirv-cross (!android), spirv-tools (!android), sranipal (windows), vulkanmemoryallocator +Build-Depends: hifi-deps, aristo (windows), glslang, liblo (windows), nlohmann-json, openvr (linux), openvr (windows), quazip (!android), sdl2 (!android), spirv-cross (!android), spirv-tools (!android), sranipal (windows), vulkanmemoryallocator diff --git a/cmake/ports/openvr/portfile.cmake b/cmake/ports/openvr/portfile.cmake index b91bdd1d54..bcbac8613a 100644 --- a/cmake/ports/openvr/portfile.cmake +++ b/cmake/ports/openvr/portfile.cmake @@ -11,15 +11,23 @@ vcpkg_from_github( set(VCPKG_LIBRARY_LINKAGE dynamic) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(ARCH_PATH "win64") + if(WIN32) + set(ARCH_PATH "win64") + else() + set(ARCH_PATH "linux64") + endif() elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(ARCH_PATH "win32") + if(WIN32) + set(ARCH_PATH "win32") + else() + set(ARCH_PATH "linux32") + endif() else() - message(FATAL_ERROR "Package only supports x64 and x86 windows.") + message(FATAL_ERROR "Package only supports x64 and x86 Windows and Linux.") endif() -if(VCPKG_CMAKE_SYSTEM_NAME) - message(FATAL_ERROR "Package only supports windows desktop.") +if(VCPKG_CMAKE_SYSTEM_NAME AND NOT (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")) + message(FATAL_ERROR "Package only supports Windows or Linux desktop.") endif() file(MAKE_DIRECTORY @@ -28,18 +36,35 @@ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib ${CURRENT_PACKAGES_DIR}/debug/bin ) -file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/openvr_api.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/openvr_api.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(COPY - ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.dll - ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/bin -) -file(COPY - ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.dll - ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin -) + +if(WIN32) + file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/openvr_api.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/openvr_api.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(COPY + ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.dll + ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + ) + file(COPY + ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.dll + ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + ) +else() + file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/libopenvr_api.so DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/libopenvr_api.so DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(COPY + ${SOURCE_PATH}/bin/${ARCH_PATH}/libopenvr_api.so + ${SOURCE_PATH}/bin/${ARCH_PATH}/libopenvr_api.so.dbg + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + ) + file(COPY + ${SOURCE_PATH}/bin/${ARCH_PATH}/libopenvr_api.so + ${SOURCE_PATH}/bin/${ARCH_PATH}/libopenvr_api.so.dbg + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + ) +endif() + file(COPY ${SOURCE_PATH}/headers DESTINATION ${CURRENT_PACKAGES_DIR}) file(RENAME ${CURRENT_PACKAGES_DIR}/headers ${CURRENT_PACKAGES_DIR}/include) diff --git a/plugins/openvr/CMakeLists.txt b/plugins/openvr/CMakeLists.txt index dcb2e39e1b..06faf2c541 100644 --- a/plugins/openvr/CMakeLists.txt +++ b/plugins/openvr/CMakeLists.txt @@ -6,7 +6,7 @@ # See the accompanying file LICENSE or http:#www.apache.org/licenses/LICENSE-2.0.html # -if (WIN32 AND (NOT USE_GLES)) +if ((WIN32 OR UNIX) AND (NOT USE_GLES)) set(TARGET_NAME openvr) setup_hifi_plugin(Gui Qml Multimedia) link_hifi_libraries(shared task gl qml networking controllers ui @@ -15,5 +15,7 @@ if (WIN32 AND (NOT USE_GLES)) include_hifi_library_headers(octree) target_openvr() - target_link_libraries(${TARGET_NAME} Winmm.lib) + if (WIN32) + target_link_libraries(${TARGET_NAME} Winmm.lib) + endif() endif() diff --git a/plugins/openvr/src/OpenVrDisplayPlugin.cpp b/plugins/openvr/src/OpenVrDisplayPlugin.cpp index 7691d2ab70..126bdb352e 100644 --- a/plugins/openvr/src/OpenVrDisplayPlugin.cpp +++ b/plugins/openvr/src/OpenVrDisplayPlugin.cpp @@ -739,6 +739,8 @@ int OpenVrDisplayPlugin::getRequiredThreadCount() const { QString OpenVrDisplayPlugin::getPreferredAudioInDevice() const { QString device = getVrSettingString(vr::k_pch_audio_Section, vr::k_pch_audio_RecordingDeviceOverride_String); +// FIXME: Address Linux. +#ifdef Q_OS_WIN if (!device.isEmpty()) { static const WCHAR INIT = 0; size_t size = device.size() + 1; @@ -748,11 +750,14 @@ QString OpenVrDisplayPlugin::getPreferredAudioInDevice() const { // FIXME: This may not be necessary if vr::k_pch_audio_RecordingDeviceOverride_StringName is used above. device = AudioClient::getWinDeviceName(deviceW.data()); } +#endif return device; } QString OpenVrDisplayPlugin::getPreferredAudioOutDevice() const { QString device = getVrSettingString(vr::k_pch_audio_Section, vr::k_pch_audio_PlaybackDeviceOverride_String); + // FIXME: Address Linux. +#ifdef Q_OS_WIN if (!device.isEmpty()) { static const WCHAR INIT = 0; size_t size = device.size() + 1; @@ -762,6 +767,7 @@ QString OpenVrDisplayPlugin::getPreferredAudioOutDevice() const { // FIXME: This may not be necessary if vr::k_pch_audio_PlaybackDeviceOverride_StringName is used above. device = AudioClient::getWinDeviceName(deviceW.data()); } +#endif return device; } From 74f50ce07975e0eea66abeed23bf9e7ecd0f90ad Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 23 May 2020 15:48:48 +1200 Subject: [PATCH 02/74] Fix Linux build error --- plugins/openvr/src/OpenVrHelpers.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/openvr/src/OpenVrHelpers.cpp b/plugins/openvr/src/OpenVrHelpers.cpp index e55e7feaf4..61fab23b6d 100644 --- a/plugins/openvr/src/OpenVrHelpers.cpp +++ b/plugins/openvr/src/OpenVrHelpers.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include #include From f2232b89f03f9765b1e19d314da6dc515b9745ca Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 23 May 2020 17:18:03 +1200 Subject: [PATCH 03/74] Address Linux build warnings and errors --- plugins/openvr/src/OpenVrHelpers.cpp | 13 +++++++++++++ plugins/openvr/src/OpenVrHelpers.h | 4 ++-- plugins/openvr/src/ViveControllerManager.h | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/plugins/openvr/src/OpenVrHelpers.cpp b/plugins/openvr/src/OpenVrHelpers.cpp index 61fab23b6d..eab0e8d433 100644 --- a/plugins/openvr/src/OpenVrHelpers.cpp +++ b/plugins/openvr/src/OpenVrHelpers.cpp @@ -407,6 +407,14 @@ void showMinSpecWarning() { } // Needed here for PathUtils +#ifdef Q_OS_LINUX + char cmdline[4096]; + FILE* fp = fopen("/proc/self/cmdline", "r"); + fgets(cmdline, sizeof cmdline, fp); + fclose(fp); + int __argc = 1; + char* __argv[1] = { cmdline }; +#endif QCoreApplication miniApp(__argc, __argv); vrSystem->ResetSeatedZeroPose(); @@ -486,7 +494,12 @@ bool checkMinSpecImpl() { } extern "C" { +#if defined(Q_OS_WIN32) __declspec(dllexport) int __stdcall CheckMinSpec() { +#else + __attribute__((visibility("default"))) int CheckMinSpec() { +#endif return checkMinSpecImpl() ? 1 : 0; } + } diff --git a/plugins/openvr/src/OpenVrHelpers.h b/plugins/openvr/src/OpenVrHelpers.h index b0960a03eb..150405ce71 100644 --- a/plugins/openvr/src/OpenVrHelpers.h +++ b/plugins/openvr/src/OpenVrHelpers.h @@ -76,7 +76,7 @@ struct PoseData { } void update(const glm::mat4& resetMat) { - for (int i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) { + for (uint32_t i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) { if (!vrPoses[i].bPoseIsValid) { continue; } @@ -87,7 +87,7 @@ struct PoseData { } void resetToInvalid() { - for (int i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) { + for (uint32_t i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) { vrPoses[i].bPoseIsValid = false; } } diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index dbd248dc53..163d6f0e0a 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -52,7 +52,7 @@ public: bool activate() override; void deactivate() override; - QString getDeviceName() { return QString::fromStdString(_inputDevice->_headsetName); } + QString getDeviceName() override { return QString::fromStdString(_inputDevice->_headsetName); } void pluginFocusOutEvent() override { _inputDevice->focusOutEvent(); } void pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override; From 33a77a5dbd3851aea04c55b0874497f87e1afdb9 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 23 May 2020 19:08:16 +1200 Subject: [PATCH 04/74] Fix further Linux errors --- plugins/openvr/src/OpenVrHelpers.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/openvr/src/OpenVrHelpers.cpp b/plugins/openvr/src/OpenVrHelpers.cpp index eab0e8d433..0f915e972c 100644 --- a/plugins/openvr/src/OpenVrHelpers.cpp +++ b/plugins/openvr/src/OpenVrHelpers.cpp @@ -207,8 +207,10 @@ void finishOpenVrKeyboardInput() { updateFromOpenVrKeyboardInput(); // Simulate an enter press on the top level window to trigger the action if (0 == (_currentHints & Qt::ImhMultiLine)) { - qApp->sendEvent(offscreenUi->getWindow(), &QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::KeyboardModifiers(), QString("\n"))); - qApp->sendEvent(offscreenUi->getWindow(), &QKeyEvent(QEvent::KeyRelease, Qt::Key_Return, Qt::KeyboardModifiers())); + auto keyPress = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::KeyboardModifiers(), QString("\n")); + auto keyRelease = QKeyEvent(QEvent::KeyRelease, Qt::Key_Return, Qt::KeyboardModifiers()); + qApp->sendEvent(offscreenUi->getWindow(), &keyPress); + qApp->sendEvent(offscreenUi->getWindow(), &keyRelease); } } From 343c6a40279342e5455393f204d82067e4c0d70b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 23 May 2020 19:46:26 +1200 Subject: [PATCH 05/74] Fix Linux targeting --- cmake/ports/hifi-client-deps/CONTROL | 2 +- plugins/openvr/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/ports/hifi-client-deps/CONTROL b/cmake/ports/hifi-client-deps/CONTROL index 75c27090f9..4a8a2bc44e 100644 --- a/cmake/ports/hifi-client-deps/CONTROL +++ b/cmake/ports/hifi-client-deps/CONTROL @@ -1,4 +1,4 @@ Source: hifi-client-deps Version: 0.1 Description: Collected dependencies for High Fidelity applications -Build-Depends: hifi-deps, aristo (windows), glslang, liblo (windows), nlohmann-json, openvr (linux), openvr (windows), quazip (!android), sdl2 (!android), spirv-cross (!android), spirv-tools (!android), sranipal (windows), vulkanmemoryallocator +Build-Depends: hifi-deps, aristo (windows), glslang, liblo (windows), nlohmann-json, openvr (linux|windows), quazip (!android), sdl2 (!android), spirv-cross (!android), spirv-tools (!android), sranipal (windows), vulkanmemoryallocator diff --git a/plugins/openvr/CMakeLists.txt b/plugins/openvr/CMakeLists.txt index 06faf2c541..eea51ea15a 100644 --- a/plugins/openvr/CMakeLists.txt +++ b/plugins/openvr/CMakeLists.txt @@ -6,7 +6,7 @@ # See the accompanying file LICENSE or http:#www.apache.org/licenses/LICENSE-2.0.html # -if ((WIN32 OR UNIX) AND (NOT USE_GLES)) +if ((WIN32 OR UNIX AND NOT APPLE) AND NOT USE_GLES) set(TARGET_NAME openvr) setup_hifi_plugin(Gui Qml Multimedia) link_hifi_libraries(shared task gl qml networking controllers ui From 69819376979bf2d6c1122d7a2041833dadd99000 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 23 May 2020 20:42:22 +1200 Subject: [PATCH 06/74] Fix path to header file --- plugins/openvr/src/ViveControllerManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 8aa7311de4..9078812137 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include #include extern PoseData _nextSimPoseData; From 1ac184bd22bb48d26d3f5aa5c6ceb86dea570f6a Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sun, 24 May 2020 13:16:15 +1200 Subject: [PATCH 07/74] Fix further type errors --- plugins/openvr/src/ViveControllerManager.cpp | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 9078812137..9de6611b58 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -370,7 +370,7 @@ void ViveControllerManager::InputDevice::update(float deltaTime, const controlle handleHandController(deltaTime, rightHandDeviceIndex, inputCalibrationData, false); // collect poses for all generic trackers - for (int i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) { + for (uint32_t i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) { handleTrackedObject(i, inputCalibrationData); handleHmd(i, inputCalibrationData); } @@ -445,8 +445,8 @@ void ViveControllerManager::InputDevice::configureCalibrationSettings(const QJso bool overrideHead = headObject["override"].toBool(); if (overrideHead) { _headConfig = HeadConfig::Puck; - _headPuckYOffset = headObject["Y"].toDouble() * CM_TO_M; - _headPuckZOffset = headObject["Z"].toDouble() * CM_TO_M; + _headPuckYOffset = (float)headObject["Y"].toDouble() * CM_TO_M; + _headPuckZOffset = (float)headObject["Z"].toDouble() * CM_TO_M; } else { _headConfig = HeadConfig::HMD; } @@ -455,8 +455,8 @@ void ViveControllerManager::InputDevice::configureCalibrationSettings(const QJso bool overrideHands = handsObject["override"].toBool(); if (overrideHands) { _handConfig = HandConfig::Pucks; - _handPuckYOffset = handsObject["Y"].toDouble() * CM_TO_M; - _handPuckZOffset = handsObject["Z"].toDouble() * CM_TO_M; + _handPuckYOffset = (float)handsObject["Y"].toDouble() * CM_TO_M; + _handPuckZOffset = (float)handsObject["Z"].toDouble() * CM_TO_M; } else { _handConfig = HandConfig::HandController; } @@ -490,8 +490,8 @@ QJsonObject ViveControllerManager::InputDevice::configurationSettings() { configurationSettings["HMDHead"] = (_headConfig == HeadConfig::HMD); configurationSettings["handController"] = (_handConfig == HandConfig::HandController); configurationSettings["puckCount"] = (int)_validTrackedObjects.size(); - configurationSettings["armCircumference"] = (double)_armCircumference * M_TO_CM; - configurationSettings["shoulderWidth"] = (double)_shoulderWidth * M_TO_CM; + configurationSettings["armCircumference"] = (double)(_armCircumference * M_TO_CM); + configurationSettings["shoulderWidth"] = (double)(_shoulderWidth * M_TO_CM); configurationSettings["outOfRangeDataStrategy"] = outOfRangeDataStrategyToString(_outOfRangeDataStrategy); return configurationSettings; } @@ -984,11 +984,11 @@ void ViveControllerManager::InputDevice::printDeviceTrackingResultChange(uint32_ } bool ViveControllerManager::InputDevice::checkForCalibrationEvent() { - auto& endOfMap = _buttonPressedMap.end(); - auto& leftTrigger = _buttonPressedMap.find(controller::LT); - auto& rightTrigger = _buttonPressedMap.find(controller::RT); - auto& leftAppButton = _buttonPressedMap.find(LEFT_APP_MENU); - auto& rightAppButton = _buttonPressedMap.find(RIGHT_APP_MENU); + auto endOfMap = _buttonPressedMap.end(); + auto leftTrigger = _buttonPressedMap.find(controller::LT); + auto rightTrigger = _buttonPressedMap.find(controller::RT); + auto leftAppButton = _buttonPressedMap.find(LEFT_APP_MENU); + auto rightAppButton = _buttonPressedMap.find(RIGHT_APP_MENU); return ((leftTrigger != endOfMap && leftAppButton != endOfMap) && (rightTrigger != endOfMap && rightAppButton != endOfMap)); } From ce96fc61d6194cf24ad1ef5c65ceaf00c041d36b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sun, 24 May 2020 13:16:26 +1200 Subject: [PATCH 08/74] Remove unused code --- plugins/openvr/src/ViveControllerManager.cpp | 25 -------------------- 1 file changed, 25 deletions(-) diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 9de6611b58..760de4324c 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -43,13 +43,8 @@ vr::IVRSystem* acquireOpenVrSystem(); void releaseOpenVrSystem(); static const QString OPENVR_LAYOUT = QString("OpenVrConfiguration.qml"); -static const char* CONTROLLER_MODEL_STRING = "vr_controller_05_wireless_b"; const quint64 CALIBRATION_TIMELAPSE = 1 * USECS_PER_SECOND; -static const char* MENU_PARENT = "Avatar"; -static const char* MENU_NAME = "Vive Controllers"; -static const char* MENU_PATH = "Avatar" ">" "Vive Controllers"; - static const int MIN_HEAD = 1; static const int MIN_PUCK_COUNT = 2; static const int MIN_FEET_AND_HIPS = 3; @@ -114,22 +109,6 @@ static QString deviceTrackingResultToString(vr::ETrackingResult trackingResult) return result; } -static glm::mat4 calculateResetMat() { - auto chaperone = vr::VRChaperone(); - if (chaperone) { - float const UI_RADIUS = 1.0f; - float const UI_HEIGHT = 1.6f; - float const UI_Z_OFFSET = 0.5; - - float xSize, zSize; - chaperone->GetPlayAreaSize(&xSize, &zSize); - glm::vec3 uiPos(0.0f, UI_HEIGHT, UI_RADIUS - (0.5f * zSize) - UI_Z_OFFSET); - - return glm::inverse(createMatFromQuatAndPos(glm::quat(), uiPos)); - } - return glm::mat4(); -} - static QString outOfRangeDataStrategyToString(ViveControllerManager::OutOfRangeDataStrategy strategy) { switch (strategy) { default: @@ -708,8 +687,6 @@ bool ViveControllerManager::InputDevice::configureHead(const glm::mat4& defaultT bool ViveControllerManager::InputDevice::configureBody(const glm::mat4& defaultToReferenceMat, const controller::InputCalibrationData& inputCalibration) { std::sort(_validTrackedObjects.begin(), _validTrackedObjects.end(), sortPucksYPosition); int puckCount = (int)_validTrackedObjects.size(); - glm::vec3 headXAxis = getReferenceHeadXAxis(defaultToReferenceMat, inputCalibration.defaultHeadMat); - glm::vec3 headPosition = getReferenceHeadPosition(defaultToReferenceMat, inputCalibration.defaultHeadMat); if (_config == Config::None) { return true; } else if (_config == Config::Feet && puckCount >= MIN_PUCK_COUNT) { @@ -807,8 +784,6 @@ controller::Pose ViveControllerManager::InputDevice::addOffsetToPuckPose(const c } void ViveControllerManager::InputDevice::handleHmd(uint32_t deviceIndex, const controller::InputCalibrationData& inputCalibrationData) { - uint32_t poseIndex = controller::TRACKED_OBJECT_00 + deviceIndex; - if (_system->IsTrackedDeviceConnected(deviceIndex) && _system->GetTrackedDeviceClass(deviceIndex) == vr::TrackedDeviceClass_HMD && _nextSimPoseData.vrPoses[deviceIndex].bPoseIsValid) { From ae8879a5581121bc264f37f2c65e1f727671ce93 Mon Sep 17 00:00:00 2001 From: HifiExperiments Date: Mon, 8 Jun 2020 16:58:21 -0700 Subject: [PATCH 09/74] possible fix for entity server crash --- assignment-client/src/entities/EntityServer.cpp | 4 +--- libraries/entities/src/EntityTree.cpp | 8 ++++++-- libraries/entities/src/EntityTree.h | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/assignment-client/src/entities/EntityServer.cpp b/assignment-client/src/entities/EntityServer.cpp index a6ab382781..e56adfd16a 100644 --- a/assignment-client/src/entities/EntityServer.cpp +++ b/assignment-client/src/entities/EntityServer.cpp @@ -376,9 +376,7 @@ void EntityServer::nodeAdded(SharedNodePointer node) { void EntityServer::nodeKilled(SharedNodePointer node) { EntityTreePointer tree = std::static_pointer_cast(_tree); - tree->withWriteLock([&] { - tree->deleteDescendantsOfAvatar(node->getUUID()); - }); + tree->deleteDescendantsOfAvatar(node->getUUID()); tree->forgetAvatarID(node->getUUID()); OctreeServer::nodeKilled(node); } diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index fedda7a42e..a22f34a874 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -2213,6 +2213,7 @@ void EntityTree::fixupNeedsParentFixups() { entity->postParentFixup(); } else if (getIsServer() || _avatarIDs.contains(entity->getParentID())) { + std::lock_guard lock(_childrenOfAvatarsLock); // this is a child of an avatar, which the entity server will never have // a SpatiallyNestable object for. Add it to a list for cleanup when the avatar leaves. if (!_childrenOfAvatars.contains(entity->getParentID())) { @@ -2241,6 +2242,7 @@ void EntityTree::fixupNeedsParentFixups() { } void EntityTree::deleteDescendantsOfAvatar(QUuid avatarID) { + std::lock_guard lock(_childrenOfAvatarsLock); QHash>::const_iterator itr = _childrenOfAvatars.constFind(avatarID); if (itr != _childrenOfAvatars.end()) { if (!itr.value().empty()) { @@ -2259,8 +2261,10 @@ void EntityTree::deleteDescendantsOfAvatar(QUuid avatarID) { void EntityTree::removeFromChildrenOfAvatars(EntityItemPointer entity) { QUuid avatarID = entity->getParentID(); - if (_childrenOfAvatars.contains(avatarID)) { - _childrenOfAvatars[avatarID].remove(entity->getID()); + std::lock_guard lock(_childrenOfAvatarsLock); + auto itr = _childrenOfAvatars.find(avatarID); + if (itr != _childrenOfAvatars.end()) { + itr.value().remove(entity->getID()); } } diff --git a/libraries/entities/src/EntityTree.h b/libraries/entities/src/EntityTree.h index 2d5119d626..85f2310edb 100644 --- a/libraries/entities/src/EntityTree.h +++ b/libraries/entities/src/EntityTree.h @@ -366,6 +366,7 @@ protected: // we maintain a list of avatarIDs to notice when an entity is a child of one. QSet _avatarIDs; // IDs of avatars connected to entity server + std::mutex _childrenOfAvatarsLock; QHash> _childrenOfAvatars; // which entities are children of which avatars float _maxTmpEntityLifetime { DEFAULT_MAX_TMP_ENTITY_LIFETIME }; From ef105e7de01bbf38833746b210fced708cc82638 Mon Sep 17 00:00:00 2001 From: HifiExperiments Date: Wed, 10 Jun 2020 15:56:02 -0700 Subject: [PATCH 10/74] how about this --- .../src/entities/EntityServer.cpp | 10 +++-- libraries/entities/src/EntityTree.cpp | 40 ++++++++++++++----- libraries/entities/src/EntityTree.h | 7 ++-- 3 files changed, 40 insertions(+), 17 deletions(-) diff --git a/assignment-client/src/entities/EntityServer.cpp b/assignment-client/src/entities/EntityServer.cpp index e56adfd16a..4c4fcbf2dd 100644 --- a/assignment-client/src/entities/EntityServer.cpp +++ b/assignment-client/src/entities/EntityServer.cpp @@ -370,14 +370,18 @@ void EntityServer::entityFilterAdded(EntityItemID id, bool success) { void EntityServer::nodeAdded(SharedNodePointer node) { EntityTreePointer tree = std::static_pointer_cast(_tree); - tree->knowAvatarID(node->getUUID()); + if (tree) { + tree->knowAvatarID(node->getUUID()); + } OctreeServer::nodeAdded(node); } void EntityServer::nodeKilled(SharedNodePointer node) { EntityTreePointer tree = std::static_pointer_cast(_tree); - tree->deleteDescendantsOfAvatar(node->getUUID()); - tree->forgetAvatarID(node->getUUID()); + if (tree) { + tree->deleteDescendantsOfAvatar(node->getUUID()); + tree->forgetAvatarID(node->getUUID()); + } OctreeServer::nodeKilled(node); } diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index a22f34a874..419f039e8c 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -2212,16 +2212,24 @@ void EntityTree::fixupNeedsParentFixups() { } entity->postParentFixup(); - } else if (getIsServer() || _avatarIDs.contains(entity->getParentID())) { - std::lock_guard lock(_childrenOfAvatarsLock); - // this is a child of an avatar, which the entity server will never have - // a SpatiallyNestable object for. Add it to a list for cleanup when the avatar leaves. - if (!_childrenOfAvatars.contains(entity->getParentID())) { - _childrenOfAvatars[entity->getParentID()] = QSet(); + } else { + bool needsUpdate = getIsServer(); + if (!needsUpdate) { + std::lock_guard lock(_avatarIDsLock); + needsUpdate = _avatarIDs.contains(entity->getParentID()); + } + + if (needsUpdate) { + std::lock_guard lock(_childrenOfAvatarsLock); + // this is a child of an avatar, which the entity server will never have + // a SpatiallyNestable object for. Add it to a list for cleanup when the avatar leaves. + if (!_childrenOfAvatars.contains(entity->getParentID())) { + _childrenOfAvatars[entity->getParentID()] = QSet(); + } + _childrenOfAvatars[entity->getParentID()] += entity->getEntityItemID(); + doMove = true; + iter.remove(); // and pull it out of the list } - _childrenOfAvatars[entity->getParentID()] += entity->getEntityItemID(); - doMove = true; - iter.remove(); // and pull it out of the list } if (queryAACubeSuccess && doMove) { @@ -2241,9 +2249,19 @@ void EntityTree::fixupNeedsParentFixups() { } } -void EntityTree::deleteDescendantsOfAvatar(QUuid avatarID) { +void EntityTree::knowAvatarID(const QUuid& avatarID) { + std::lock_guard lock(_avatarIDsLock); + _avatarIDs += avatarID; +} + +void EntityTree::forgetAvatarID(const QUuid& avatarID) { + std::lock_guard lock(_avatarIDsLock); + _avatarIDs -= avatarID; +} + +void EntityTree::deleteDescendantsOfAvatar(const QUuid& avatarID) { std::lock_guard lock(_childrenOfAvatarsLock); - QHash>::const_iterator itr = _childrenOfAvatars.constFind(avatarID); + auto itr = _childrenOfAvatars.find(avatarID); if (itr != _childrenOfAvatars.end()) { if (!itr.value().empty()) { std::vector ids; diff --git a/libraries/entities/src/EntityTree.h b/libraries/entities/src/EntityTree.h index 85f2310edb..4ee0a7dca4 100644 --- a/libraries/entities/src/EntityTree.h +++ b/libraries/entities/src/EntityTree.h @@ -239,9 +239,9 @@ public: Q_INVOKABLE int getJointIndex(const QUuid& entityID, const QString& name) const; Q_INVOKABLE QStringList getJointNames(const QUuid& entityID) const; - void knowAvatarID(QUuid avatarID) { _avatarIDs += avatarID; } - void forgetAvatarID(QUuid avatarID) { _avatarIDs -= avatarID; } - void deleteDescendantsOfAvatar(QUuid avatarID); + void knowAvatarID(const QUuid& avatarID); + void forgetAvatarID(const QUuid& avatarID); + void deleteDescendantsOfAvatar(const QUuid& avatarID); void removeFromChildrenOfAvatars(EntityItemPointer entity); void addToNeedsParentFixupList(EntityItemPointer entity); @@ -364,6 +364,7 @@ protected: QVector _needsParentFixup; // entites with a parentID but no (yet) known parent instance mutable QReadWriteLock _needsParentFixupLock; + std::mutex _avatarIDsLock; // we maintain a list of avatarIDs to notice when an entity is a child of one. QSet _avatarIDs; // IDs of avatars connected to entity server std::mutex _childrenOfAvatarsLock; From 34f1616581a49c2f5f4dae485d9f284cec0b1a10 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 16 Jun 2020 09:17:21 +1200 Subject: [PATCH 11/74] Update build doc --- BUILD.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD.md b/BUILD.md index b30160e7e4..d6be0b61fb 100644 --- a/BUILD.md +++ b/BUILD.md @@ -21,8 +21,8 @@ These dependencies need not be installed manually. They are automatically downloaded on the platforms where they are required. - [Bullet Physics Engine](https://github.com/bulletphysics/bullet3/releases): 2.83 - [glm](https://glm.g-truc.net/0.9.8/index.html): 0.9.8 -- [Oculus SDK](https://developer.oculus.com/downloads/): 1.11 (Win32) / 0.5 (Mac) -- [OpenVR](https://github.com/ValveSoftware/openvr): 1.11.11 (Win32 only) +- [Oculus SDK](https://developer.oculus.com/downloads/): 1.11 (Windows) / 0.5 (Mac) +- [OpenVR](https://github.com/ValveSoftware/openvr): 1.11.11 (Windows, Linux) - [Polyvox](http://www.volumesoffun.com/): 0.2.1 - [QuaZip](https://sourceforge.net/projects/quazip/files/quazip/): 0.7.3 - [SDL2](https://www.libsdl.org/download-2.0.php): 2.0.3 From 350b5f217eddf498c57431b05f4a7f968a1db194 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 16 Jun 2020 10:02:19 +1200 Subject: [PATCH 12/74] Try removing Linux-specific argc, argv code --- plugins/openvr/src/OpenVrHelpers.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/openvr/src/OpenVrHelpers.cpp b/plugins/openvr/src/OpenVrHelpers.cpp index 0f915e972c..eeda288c8b 100644 --- a/plugins/openvr/src/OpenVrHelpers.cpp +++ b/plugins/openvr/src/OpenVrHelpers.cpp @@ -410,12 +410,12 @@ void showMinSpecWarning() { // Needed here for PathUtils #ifdef Q_OS_LINUX - char cmdline[4096]; - FILE* fp = fopen("/proc/self/cmdline", "r"); - fgets(cmdline, sizeof cmdline, fp); - fclose(fp); - int __argc = 1; - char* __argv[1] = { cmdline }; + //char cmdline[4096]; + //FILE* fp = fopen("/proc/self/cmdline", "r"); + //fgets(cmdline, sizeof cmdline, fp); + //fclose(fp); + //int __argc = 1; + //char* __argv[1] = { cmdline }; #endif QCoreApplication miniApp(__argc, __argv); From f11091cab470086d9f1309d0c5a747e654aaefa5 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 16 Jun 2020 12:25:28 +1200 Subject: [PATCH 13/74] Add Help > Tutorial menu item that goest to serverless tutorial --- interface/src/Application.cpp | 5 +++++ interface/src/Application.h | 1 + interface/src/Menu.cpp | 2 ++ 3 files changed, 8 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 85c2d4abe0..dd8ad75c06 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3858,6 +3858,11 @@ void Application::showHelp() { //InfoView::show(INFO_HELP_PATH, false, queryString.toString()); } +void Application::gotoTutorial() { + const QString TUTORIAL_ADDRESS = "file:///~/serverless/tutorial.json"; + DependencyManager::get()->handleLookupString(TUTORIAL_ADDRESS); +} + void Application::resizeEvent(QResizeEvent* event) { resizeGL(); } diff --git a/interface/src/Application.h b/interface/src/Application.h index 198f5ef7cf..e85fccf1f6 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -427,6 +427,7 @@ public slots: #endif static void showHelp(); + static void gotoTutorial(); void cycleCamera(); void cameraModeChanged(); diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index a3ef39f1e9..5ca2be510b 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -816,6 +816,8 @@ Menu::Menu() { addActionToQMenuAndActionHash(helpMenu, "Controls Reference", 0, qApp, SLOT(showHelp())); + addActionToQMenuAndActionHash(helpMenu, "Tutorial", 0, qApp, SLOT(gotoTutorial())); + helpMenu->addSeparator(); // Help > Release Notes From 9367ea9e7f64186ee33341c55bd4486f48cac524 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 16 Jun 2020 12:25:59 +1200 Subject: [PATCH 14/74] "file:///" is valid address in AddressManager.handleLookupString() JSDoc --- libraries/networking/src/AddressManager.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/networking/src/AddressManager.h b/libraries/networking/src/AddressManager.h index 8bdb777f96..148c4f8580 100644 --- a/libraries/networking/src/AddressManager.h +++ b/libraries/networking/src/AddressManager.h @@ -249,8 +249,9 @@ public slots: * Takes you to a specified metaverse address. * @function location.handleLookupString * @param {string} address - The address to go to: a "hifi://" address, an IP address (e.g., - * "127.0.0.1" or "localhost"), a domain name, a named path on a domain (starts with - * "/"), a position or position and orientation, or a user (starts with "@"). + * "127.0.0.1" or "localhost"), a file:/// address, a domain name, a named path + * on a domain (starts with "/"), a position or position and orientation, or a user (starts with + * "@"). * @param {boolean} [fromSuggestions=false] - Set to true if the address is obtained from the "Goto" dialog. * Helps ensure that user's location history is correctly maintained. */ From ab4ff1e7aa99a73ee680074f3cb7a2a86e04690c Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 17 Jun 2020 08:55:54 +1200 Subject: [PATCH 15/74] Proper Linux command line parsing --- plugins/openvr/src/OpenVrHelpers.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/plugins/openvr/src/OpenVrHelpers.cpp b/plugins/openvr/src/OpenVrHelpers.cpp index eeda288c8b..3173441155 100644 --- a/plugins/openvr/src/OpenVrHelpers.cpp +++ b/plugins/openvr/src/OpenVrHelpers.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include #include @@ -408,14 +407,22 @@ void showMinSpecWarning() { qFatal("Unable to create overlay"); } - // Needed here for PathUtils #ifdef Q_OS_LINUX - //char cmdline[4096]; - //FILE* fp = fopen("/proc/self/cmdline", "r"); - //fgets(cmdline, sizeof cmdline, fp); - //fclose(fp); - //int __argc = 1; - //char* __argv[1] = { cmdline }; + QFile cmdlineFile("/proc/self/cmdline"); + if (!cmdlineFile.open(QIODevice::ReadOnly)) { + qFatal("Unable to open /proc/self/cmdline"); + } + + auto contents = cmdlineFile.readAll(); + auto arguments = contents.split('\0'); + arguments.pop_back(); // Last element is empty. + cmdlineFile.close(); + + int __argc = arguments.count(); + char** __argv = new char* [__argc]; + for (int i = 0; i < __argc; i++) { + __argv[i] = arguments[i].data(); + } #endif QCoreApplication miniApp(__argc, __argv); From aaf9abdaef2560781dcffa5b16d701170365de4e Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 18 Jun 2020 10:23:22 +1200 Subject: [PATCH 16/74] Add missing delete --- plugins/openvr/src/OpenVrHelpers.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/openvr/src/OpenVrHelpers.cpp b/plugins/openvr/src/OpenVrHelpers.cpp index 3173441155..2f7bf3ddfd 100644 --- a/plugins/openvr/src/OpenVrHelpers.cpp +++ b/plugins/openvr/src/OpenVrHelpers.cpp @@ -424,8 +424,15 @@ void showMinSpecWarning() { __argv[i] = arguments[i].data(); } #endif + QCoreApplication miniApp(__argc, __argv); +#ifdef Q_OS_LINUX + QObject::connect(&miniApp, &QCoreApplication::destroyed, [=] { + delete[] __argv; + }); +#endif + vrSystem->ResetSeatedZeroPose(); QString imagePath = PathUtils::resourcesPath() + "/images/steam-min-spec-failed.png"; vrOverlay->SetOverlayFromFile(minSpecFailedOverlay, imagePath.toLocal8Bit().toStdString().c_str()); From d66c8cc2bcc73843ae66fabe74ebd2813f15473a Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Thu, 18 Jun 2020 20:33:24 +0200 Subject: [PATCH 17/74] Change URLs to Linode bucket, old HiFi one is gone --- hifi_android.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/hifi_android.py b/hifi_android.py index 0c2ea07cc7..e544ce3c12 100644 --- a/hifi_android.py +++ b/hifi_android.py @@ -10,87 +10,74 @@ import zipfile print = functools.partial(print, flush=True) -ANDROID_PACKAGE_URL = 'https://hifi-public.s3.amazonaws.com/dependencies/android/' +ANDROID_PACKAGE_URL = 'https://eu-central-1.linodeobjects.com/vircadia-public/dependencies/android/' ANDROID_PACKAGES = { 'qt' : { 'file': 'qt-5.11.1_linux_armv8-libcpp_openssl_patched.tgz', - 'versionId': '3S97HBM5G5Xw9EfE52sikmgdN3t6C2MN', 'checksum': 'aa449d4bfa963f3bc9a9dfe558ba29df', }, 'bullet': { 'file': 'bullet-2.88_armv8-libcpp.tgz', - 'versionId': 'S8YaoED0Cl8sSb8fSV7Q2G1lQJSNDxqg', 'checksum': '81642779ccb110f8c7338e8739ac38a0', }, 'draco': { 'file': 'draco_armv8-libcpp.tgz', - 'versionId': '3.B.uBj31kWlgND3_R2xwQzT_TP6Dz_8', 'checksum': '617a80d213a5ec69fbfa21a1f2f738cd', }, 'glad': { 'file': 'glad_armv8-libcpp.zip', - 'versionId': 'r5Zran.JSCtvrrB6Q4KaqfIoALPw3lYY', 'checksum': 'a8ee8584cf1ccd34766c7ddd9d5e5449', }, 'gvr': { 'file': 'gvrsdk_v1.101.0.tgz', - 'versionId': 'nqBV_j81Uc31rC7bKIrlya_Hah4v3y5r', 'checksum': '57fd02baa069176ba18597a29b6b4fc7', }, 'nvtt': { 'file': 'nvtt_armv8-libcpp.zip', - 'versionId': 'lmkBVR5t4UF1UUwMwEirnk9H_8Nt90IO', 'checksum': 'eb46d0b683e66987190ed124aabf8910', 'sharedLibFolder': 'lib', 'includeLibs': ['libnvtt.so', 'libnvmath.so', 'libnvimage.so', 'libnvcore.so'] }, 'oculus_1.22': { 'file': 'ovr_sdk_mobile_1.22.zip', - 'versionId': 'InhomR5gwkzyiLAelH3X9k4nvV3iIpA_', 'checksum': '1ac3c5b0521e5406f287f351015daff8', 'sharedLibFolder': 'VrApi/Libs/Android/arm64-v8a/Release', 'includeLibs': ['libvrapi.so'] }, 'oculusPlatform': { 'file': 'OVRPlatformSDK_v1.34.0.zip', - 'versionId': 'vbRUkkyzUAXfTGSEtuiUr_7.Fm5h5BZk', 'checksum': '16e4c5f39520f122bc49cb6d5bb88289', 'sharedLibFolder': 'Android/libs/arm64-v8a', 'includeLibs': ['libovrplatformloader.so'] }, 'openssl': { 'file': 'openssl-1.1.0g_armv8.tgz', - 'versionId': 'AiiPjmgUZTgNj7YV1EEx2lL47aDvvvAW', 'checksum': 'cabb681fbccd79594f65fcc266e02f32' }, 'polyvox': { 'file': 'polyvox_armv8-libcpp.tgz', - 'versionId': 'A2kbKiNhpIenGq23bKRRzg7IMAI5BI92', 'checksum': 'dba88b3a098747af4bb169e9eb9af57e', 'sharedLibFolder': 'lib', 'includeLibs': ['Release/libPolyVoxCore.so', 'libPolyVoxUtil.so'], }, 'tbb': { 'file': 'tbb-2018_U1_armv8_libcpp.tgz', - 'versionId': 'mrRbWnv4O4evcM1quRH43RJqimlRtaKB', 'checksum': '20768f298f53b195e71b414b0ae240c4', 'sharedLibFolder': 'lib/release', 'includeLibs': ['libtbb.so', 'libtbbmalloc.so'], }, 'hifiAC': { - 'baseUrl': 'http://s3.amazonaws.com/hifi-public/dependencies/', + 'baseUrl': 'https://eu-central-1.linodeobjects.com/vircadia-public/dependencies/', 'file': 'codecSDK-android_armv8-2.0.zip', 'checksum': '1cbef929675818fc64c4101b72f84a6a' }, 'etc2comp': { 'file': 'etc2comp-patched-armv8-libcpp.tgz', - 'versionId': 'bHhGECRAQR1vkpshBcK6ByNc1BQIM8gU', 'checksum': '14b02795d774457a33bbc60e00a786bc' }, 'breakpad': { 'file': 'breakpad.tgz', - 'versionId': '8VrYXz7oyc.QBxNia0BVJOUBvrFO61jI', 'checksum': 'ddcb23df336b08017042ba4786db1d9e', 'sharedLibFolder': 'lib', 'includeLibs': {'libbreakpad_client.a'} @@ -105,14 +92,12 @@ ANDROID_PLATFORM_PACKAGES = { 'Darwin' : { 'qt': { 'file': 'qt-5.11.1_osx_armv8-libcpp_openssl_patched.tgz', - 'versionId': 'OxBD7iKINv1HbyOXmAmDrBb8AF3N.Kup', 'checksum': 'c83cc477c08a892e00c71764dca051a0' }, }, 'Windows' : { 'qt': { 'file': 'qt-5.11.1_win_armv8-libcpp_openssl_patched.tgz', - 'versionId': 'JfWM0P_Mz5Qp0LwpzhrsRwN3fqlLSFeT', 'checksum': '0582191cc55431aa4f660848a542883e' }, } From 37bded0a9b0c13a102f35ee6ad747624e0656263 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 18:48:43 +0200 Subject: [PATCH 18/74] Move volume control up from bottom --- interface/resources/qml/hifi/audio/Audio.qml | 330 +++++++++---------- 1 file changed, 165 insertions(+), 165 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 963a3246fc..78be1d2d06 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -328,171 +328,7 @@ Rectangle { qsTr("Press and hold grip triggers on both of your controllers to talk."); } } - - Separator { - id: secondSeparator; - anchors.top: pttTextContainer.visible ? pttTextContainer.bottom : switchesContainer.bottom; - anchors.topMargin: 10; - } - - Item { - id: inputDeviceHeader - x: margins.paddings; - width: parent.width - margins.paddings*2; - height: 36; - anchors.top: secondSeparator.bottom; - anchors.topMargin: 10; - - HiFiGlyphs { - width: margins.sizeCheckBox; - text: hifi.glyphs.mic; - color: hifi.colors.white; - anchors.left: parent.left; - anchors.leftMargin: -size/4; //the glyph has empty space at left about 25% - anchors.verticalCenter: parent.verticalCenter; - size: 30; - } - RalewayRegular { - anchors.verticalCenter: parent.verticalCenter; - width: margins.sizeText + margins.sizeLevel; - anchors.left: parent.left; - anchors.leftMargin: margins.sizeCheckBox; - size: 22; - color: hifi.colors.white; - text: qsTr("Choose input device"); - } - } - - ListView { - id: inputView; - width: rightMostInputLevelPos; - anchors.top: inputDeviceHeader.bottom; - anchors.topMargin: 10; - x: margins.paddings - interactive: false; - height: contentHeight; - - clip: true; - model: AudioScriptingInterface.devices.input; - delegate: Item { - width: rightMostInputLevelPos - margins.paddings*2 - height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? - (margins.sizeCheckBox > checkBoxInput.implicitHeight ? margins.sizeCheckBox + 4 : checkBoxInput.implicitHeight + 4) : 0 - visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) - AudioControls.CheckBox { - id: checkBoxInput - anchors.left: parent.left - spacing: margins.sizeCheckBox - boxSize - anchors.verticalCenter: parent.verticalCenter - width: parent.width - inputLevel.width - clip: true - checkable: !checked - checked: bar.currentIndex === 0 ? selectedDesktop : selectedHMD; - boxSize: margins.sizeCheckBox / 2 - isRound: true - text: devicename - fontSize: 16; - onPressed: { - if (!checked) { - stereoInput.checked = false; - AudioScriptingInterface.setStereoInput(false); // the next selected audio device might not support stereo - AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1); - } - } - } - AudioControls.InputPeak { - id: inputLevel - anchors.right: parent.right - peak: model.peak; - anchors.verticalCenter: parent.verticalCenter - visible: ((bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR)) && - AudioScriptingInterface.devices.input.peakValuesAvailable; - } - } - } - - AudioControls.LoopbackAudio { - id: loopbackAudio - x: margins.paddings - anchors.top: inputView.bottom; - anchors.topMargin: 10; - - visible: (bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR); - anchors { left: parent.left; leftMargin: margins.paddings } - } - - Separator { - id: thirdSeparator; - anchors.top: loopbackAudio.visible ? loopbackAudio.bottom : inputView.bottom; - anchors.topMargin: 10; - } - - Item { - id: outputDeviceHeader; - anchors.topMargin: 10; - anchors.top: thirdSeparator.bottom; - x: margins.paddings; - width: parent.width - margins.paddings*2 - height: 36 - - HiFiGlyphs { - anchors.left: parent.left - anchors.leftMargin: -size/4 //the glyph has empty space at left about 25% - anchors.verticalCenter: parent.verticalCenter; - width: margins.sizeCheckBox - text: hifi.glyphs.unmuted; - color: hifi.colors.white; - size: 36; - } - - RalewayRegular { - width: margins.sizeText + margins.sizeLevel - anchors.left: parent.left - anchors.leftMargin: margins.sizeCheckBox - anchors.verticalCenter: parent.verticalCenter; - size: 22; - color: hifi.colors.white; - text: qsTr("Choose output device"); - } - } - - ListView { - id: outputView - width: parent.width - margins.paddings*2 - x: margins.paddings; - interactive: false; - height: contentHeight; - anchors.top: outputDeviceHeader.bottom; - anchors.topMargin: 10; - clip: true; - model: AudioScriptingInterface.devices.output; - delegate: Item { - width: rightMostInputLevelPos - height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? - (margins.sizeCheckBox > checkBoxOutput.implicitHeight ? margins.sizeCheckBox + 4 : checkBoxOutput.implicitHeight + 4) : 0 - visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) - - AudioControls.CheckBox { - id: checkBoxOutput - width: parent.width - spacing: margins.sizeCheckBox - boxSize - boxSize: margins.sizeCheckBox / 2 - isRound: true - checked: bar.currentIndex === 0 ? selectedDesktop : selectedHMD; - checkable: !checked - text: devicename - fontSize: 16 - onPressed: { - if (!checked) { - AudioScriptingInterface.setOutputDevice(info, bar.currentIndex === 1); - } - } - } - } - } - + Item { id: avatarGainContainer x: margins.paddings; @@ -677,6 +513,170 @@ Rectangle { } } + Separator { + id: secondSeparator; + anchors.top: pttTextContainer.visible ? pttTextContainer.bottom : switchesContainer.bottom; + anchors.topMargin: 10; + } + + Item { + id: inputDeviceHeader + x: margins.paddings; + width: parent.width - margins.paddings*2; + height: 36; + anchors.top: secondSeparator.bottom; + anchors.topMargin: 10; + + HiFiGlyphs { + width: margins.sizeCheckBox; + text: hifi.glyphs.mic; + color: hifi.colors.white; + anchors.left: parent.left; + anchors.leftMargin: -size/4; //the glyph has empty space at left about 25% + anchors.verticalCenter: parent.verticalCenter; + size: 30; + } + RalewayRegular { + anchors.verticalCenter: parent.verticalCenter; + width: margins.sizeText + margins.sizeLevel; + anchors.left: parent.left; + anchors.leftMargin: margins.sizeCheckBox; + size: 22; + color: hifi.colors.white; + text: qsTr("Choose input device"); + } + } + + ListView { + id: inputView; + width: rightMostInputLevelPos; + anchors.top: inputDeviceHeader.bottom; + anchors.topMargin: 10; + x: margins.paddings + interactive: false; + height: contentHeight; + + clip: true; + model: AudioScriptingInterface.devices.input; + delegate: Item { + width: rightMostInputLevelPos - margins.paddings*2 + height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? + (margins.sizeCheckBox > checkBoxInput.implicitHeight ? margins.sizeCheckBox + 4 : checkBoxInput.implicitHeight + 4) : 0 + visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) + AudioControls.CheckBox { + id: checkBoxInput + anchors.left: parent.left + spacing: margins.sizeCheckBox - boxSize + anchors.verticalCenter: parent.verticalCenter + width: parent.width - inputLevel.width + clip: true + checkable: !checked + checked: bar.currentIndex === 0 ? selectedDesktop : selectedHMD; + boxSize: margins.sizeCheckBox / 2 + isRound: true + text: devicename + fontSize: 16; + onPressed: { + if (!checked) { + stereoInput.checked = false; + AudioScriptingInterface.setStereoInput(false); // the next selected audio device might not support stereo + AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1); + } + } + } + AudioControls.InputPeak { + id: inputLevel + anchors.right: parent.right + peak: model.peak; + anchors.verticalCenter: parent.verticalCenter + visible: ((bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR)) && + AudioScriptingInterface.devices.input.peakValuesAvailable; + } + } + } + + AudioControls.LoopbackAudio { + id: loopbackAudio + x: margins.paddings + anchors.top: inputView.bottom; + anchors.topMargin: 10; + + visible: (bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR); + anchors { left: parent.left; leftMargin: margins.paddings } + } + + Separator { + id: thirdSeparator; + anchors.top: loopbackAudio.visible ? loopbackAudio.bottom : inputView.bottom; + anchors.topMargin: 10; + } + + Item { + id: outputDeviceHeader; + anchors.topMargin: 10; + anchors.top: thirdSeparator.bottom; + x: margins.paddings; + width: parent.width - margins.paddings*2 + height: 36 + + HiFiGlyphs { + anchors.left: parent.left + anchors.leftMargin: -size/4 //the glyph has empty space at left about 25% + anchors.verticalCenter: parent.verticalCenter; + width: margins.sizeCheckBox + text: hifi.glyphs.unmuted; + color: hifi.colors.white; + size: 36; + } + + RalewayRegular { + width: margins.sizeText + margins.sizeLevel + anchors.left: parent.left + anchors.leftMargin: margins.sizeCheckBox + anchors.verticalCenter: parent.verticalCenter; + size: 22; + color: hifi.colors.white; + text: qsTr("Choose output device"); + } + } + + ListView { + id: outputView + width: parent.width - margins.paddings*2 + x: margins.paddings; + interactive: false; + height: contentHeight; + anchors.top: outputDeviceHeader.bottom; + anchors.topMargin: 10; + clip: true; + model: AudioScriptingInterface.devices.output; + delegate: Item { + width: rightMostInputLevelPos + height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? + (margins.sizeCheckBox > checkBoxOutput.implicitHeight ? margins.sizeCheckBox + 4 : checkBoxOutput.implicitHeight + 4) : 0 + visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) + + AudioControls.CheckBox { + id: checkBoxOutput + width: parent.width + spacing: margins.sizeCheckBox - boxSize + boxSize: margins.sizeCheckBox / 2 + isRound: true + checked: bar.currentIndex === 0 ? selectedDesktop : selectedHMD; + checkable: !checked + text: devicename + fontSize: 16 + onPressed: { + if (!checked) { + AudioScriptingInterface.setOutputDevice(info, bar.currentIndex === 1); + } + } + } + } + } + AudioControls.PlaySampleSound { id: playSampleSound x: margins.paddings From eaf2ce89e06a208610e6624f1889b2271e7da352 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 19:23:51 +0200 Subject: [PATCH 19/74] Actually move it up this time --- interface/resources/qml/hifi/audio/Audio.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 78be1d2d06..a9a5d55c69 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -332,7 +332,7 @@ Rectangle { Item { id: avatarGainContainer x: margins.paddings; - anchors.top: outputView.bottom; + anchors.top: pttTextContainer.bottom; anchors.topMargin: 10; width: parent.width - margins.paddings*2 height: avatarGainSliderTextMetrics.height @@ -515,7 +515,7 @@ Rectangle { Separator { id: secondSeparator; - anchors.top: pttTextContainer.visible ? pttTextContainer.bottom : switchesContainer.bottom; + anchors.top: systemInjectorGainContainer.visible ? systemInjectorGainContainer.bottom : switchesContainer.bottom; anchors.topMargin: 10; } From 6b8519c7ff40a12c9a39610c5f150fd76c3c9592 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 19:38:03 +0200 Subject: [PATCH 20/74] Fix "Test your sound" --- interface/resources/qml/hifi/audio/Audio.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index a9a5d55c69..550ebcf037 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -680,7 +680,7 @@ Rectangle { AudioControls.PlaySampleSound { id: playSampleSound x: margins.paddings - anchors.top: systemInjectorGainContainer.bottom; + anchors.top: outputView.bottom; anchors.topMargin: 10; } } From b0eb08c03fadd9715daa517722b0c1dc9d753e02 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 19:54:49 +0200 Subject: [PATCH 21/74] Try to add bottom margin --- interface/resources/qml/hifi/audio/Audio.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 550ebcf037..d8f2d2a74e 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -682,6 +682,7 @@ Rectangle { x: margins.paddings anchors.top: outputView.bottom; anchors.topMargin: 10; + bottomMargin: 5; } } From 8284dd16cf135e38d7f0d5f8f74367bd08765b8d Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 20:19:03 +0200 Subject: [PATCH 22/74] Revert last commit and add spacer item to bottom. --- interface/resources/qml/hifi/audio/Audio.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index d8f2d2a74e..e1599206ff 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -682,7 +682,12 @@ Rectangle { x: margins.paddings anchors.top: outputView.bottom; anchors.topMargin: 10; - bottomMargin: 5; + } + + // Spacer item + Item { + anchors.top: playSampleSound.bottom; + anchors.topMargin: 5; } } From ee6de9e868cffb456c6521f9d1ee445cd32bbfb4 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 21:10:48 +0200 Subject: [PATCH 23/74] Move "Test your voice" and "Test your sound" to top of their category --- interface/resources/qml/hifi/audio/Audio.qml | 48 ++++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index e1599206ff..cfa5ca6d96 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -546,11 +546,22 @@ Rectangle { text: qsTr("Choose input device"); } } + + AudioControls.LoopbackAudio { + id: loopbackAudio + x: margins.paddings + anchors.top: inputDeviceHeader.bottom; + anchors.topMargin: 10; + visible: (bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR); + anchors { left: parent.left; leftMargin: margins.paddings } + } + ListView { id: inputView; width: rightMostInputLevelPos; - anchors.top: inputDeviceHeader.bottom; + anchors.top: loopbackAudio.bottom; anchors.topMargin: 10; x: margins.paddings interactive: false; @@ -596,17 +607,6 @@ Rectangle { } } - AudioControls.LoopbackAudio { - id: loopbackAudio - x: margins.paddings - anchors.top: inputView.bottom; - anchors.topMargin: 10; - - visible: (bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR); - anchors { left: parent.left; leftMargin: margins.paddings } - } - Separator { id: thirdSeparator; anchors.top: loopbackAudio.visible ? loopbackAudio.bottom : inputView.bottom; @@ -641,14 +641,21 @@ Rectangle { text: qsTr("Choose output device"); } } - + + AudioControls.PlaySampleSound { + id: playSampleSound + x: margins.paddings + anchors.top: outputDeviceHeader.bottom; + anchors.topMargin: 10; + } + ListView { id: outputView width: parent.width - margins.paddings*2 x: margins.paddings; interactive: false; height: contentHeight; - anchors.top: outputDeviceHeader.bottom; + anchors.top: playSampleSound.bottom; anchors.topMargin: 10; clip: true; model: AudioScriptingInterface.devices.output; @@ -676,19 +683,12 @@ Rectangle { } } } - - AudioControls.PlaySampleSound { - id: playSampleSound - x: margins.paddings - anchors.top: outputView.bottom; - anchors.topMargin: 10; - } // Spacer item Item { - anchors.top: playSampleSound.bottom; - anchors.topMargin: 5; + anchors.top: outputView.bottom; + anchors.topMargin: 10; } } -} +} \ No newline at end of file From d4f79413eb4232c2217fb310fef27948600b4553 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 21:27:41 +0200 Subject: [PATCH 24/74] Fix seperator and move up inputLevel --- interface/resources/qml/hifi/audio/Audio.qml | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index cfa5ca6d96..e30a4bfe93 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -558,6 +558,16 @@ Rectangle { anchors { left: parent.left; leftMargin: margins.paddings } } + AudioControls.InputPeak { + id: inputLevel + anchors.right: parent.right + peak: model.peak; + anchors.verticalCenter: parent.verticalCenter + visible: ((bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR)) && + AudioScriptingInterface.devices.input.peakValuesAvailable; + } + ListView { id: inputView; width: rightMostInputLevelPos; @@ -594,22 +604,13 @@ Rectangle { AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1); } } - } - AudioControls.InputPeak { - id: inputLevel - anchors.right: parent.right - peak: model.peak; - anchors.verticalCenter: parent.verticalCenter - visible: ((bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR)) && - AudioScriptingInterface.devices.input.peakValuesAvailable; - } + } } } Separator { id: thirdSeparator; - anchors.top: loopbackAudio.visible ? loopbackAudio.bottom : inputView.bottom; + anchors.top: inputView.visible ? inputView.bottom : outputDeviceHeader.bottom; anchors.topMargin: 10; } From 4a0d011b5338f6a259332c32d4d61602803d4bbd Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 21:39:53 +0200 Subject: [PATCH 25/74] Shorten PushToTalk text on vr, since it didn't fit into the window --- interface/resources/qml/hifi/audio/Audio.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index e30a4bfe93..6b23b0a1ca 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -325,7 +325,7 @@ Rectangle { size: 16; text: (bar.currentIndex === 0) ? qsTr("Press and hold the button \"T\" to talk.") : - qsTr("Press and hold grip triggers on both of your controllers to talk."); + qsTr("Press and hold triggers on both of your controllers to talk."); } } From 845cc4454c3121b6abc034b4bdd06df98819a3dc Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 21:47:09 +0200 Subject: [PATCH 26/74] Add Vircadia contributors line --- interface/resources/qml/hifi/audio/Audio.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 6b23b0a1ca..44cf288049 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -6,6 +6,7 @@ // // Created by Vlad Stelmahovsky on 03/22/2017 // Copyright 2017 High Fidelity, Inc. +// Copyright 2020 Vircadia contributors. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html From 0c8cc0a8065984f25aef43c3f3086bf8170d495c Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 23:32:52 +0200 Subject: [PATCH 27/74] Try to remove empty space when "Test your voice" button is not visible --- interface/resources/qml/hifi/audio/Audio.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 44cf288049..b3ac3f620e 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -572,7 +572,7 @@ Rectangle { ListView { id: inputView; width: rightMostInputLevelPos; - anchors.top: loopbackAudio.bottom; + anchors.top: (loopbackAudio.visible === 1) ? loopbackAudio.bottom : inputDeviceHeader.bottom; anchors.topMargin: 10; x: margins.paddings interactive: false; From 3aefa6ad9c60a7e03ecbc1201e7db326a263e582 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 23:37:26 +0200 Subject: [PATCH 28/74] Remove if statements that are not needed anymore --- interface/resources/qml/hifi/audio/Audio.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index b3ac3f620e..054d709c4a 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -516,7 +516,7 @@ Rectangle { Separator { id: secondSeparator; - anchors.top: systemInjectorGainContainer.visible ? systemInjectorGainContainer.bottom : switchesContainer.bottom; + anchors.top: systemInjectorGainContainer.bottom; anchors.topMargin: 10; } @@ -611,7 +611,7 @@ Rectangle { Separator { id: thirdSeparator; - anchors.top: inputView.visible ? inputView.bottom : outputDeviceHeader.bottom; + anchors.top: inputView.bottom; anchors.topMargin: 10; } From 878c6c68c829b3f7b128bfc9b8b52c9d2c4380a2 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 23:46:04 +0200 Subject: [PATCH 29/74] Fix inputView if statement --- interface/resources/qml/hifi/audio/Audio.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 054d709c4a..a3bd3c6fff 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -572,7 +572,7 @@ Rectangle { ListView { id: inputView; width: rightMostInputLevelPos; - anchors.top: (loopbackAudio.visible === 1) ? loopbackAudio.bottom : inputDeviceHeader.bottom; + anchors.top: loopbackAudio.visible ? loopbackAudio.bottom : inputDeviceHeader.bottom; anchors.topMargin: 10; x: margins.paddings interactive: false; From aaf19db286b0cc075e593a2868fd1c8af7c168bc Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Tue, 23 Jun 2020 00:42:05 -0400 Subject: [PATCH 30/74] Debounce missing joint log spam to 30s intervals --- libraries/animation/src/AnimInverseKinematics.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp index 621323575f..2eeec827ef 100644 --- a/libraries/animation/src/AnimInverseKinematics.cpp +++ b/libraries/animation/src/AnimInverseKinematics.cpp @@ -25,6 +25,7 @@ static const int MAX_TARGET_MARKERS = 30; static const float JOINT_CHAIN_INTERP_TIME = 0.5f; +static const int WARNING_DEBOUNCE_TIME = 30000; // 30 seconds static void lookupJointInfo(const AnimInverseKinematics::JointChainInfo& jointChainInfo, int indexA, int indexB, @@ -158,6 +159,16 @@ void AnimInverseKinematics::setTargetVars(const QString& jointName, const QStrin } } +bool debounceJointWarnings() { + static QTime last_call; + + if (last_call.elapsed() >= WARNING_DEBOUNCE_TIME || !last_call.isValid()) { + last_call.restart(); + return true; + } + return false; +} + void AnimInverseKinematics::computeTargets(const AnimVariantMap& animVars, std::vector& targets, const AnimPoseVec& underPoses) { _hipsTargetIndex = -1; @@ -172,7 +183,7 @@ void AnimInverseKinematics::computeTargets(const AnimVariantMap& animVars, std:: if (jointIndex >= 0) { // this targetVar has a valid joint --> cache the indices targetVar.jointIndex = jointIndex; - } else { + } else if (debounceJointWarnings()) { qCWarning(animation) << "AnimInverseKinematics could not find jointName" << targetVar.jointName << "in skeleton"; } } From 71fec167ec25ccdf3f1f3b3683f50353e337c9f0 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Tue, 23 Jun 2020 20:52:48 -0400 Subject: [PATCH 31/74] Prevent a crash for corrupted GLTF models. Co-Authored-By: hifiexperiments --- libraries/fbx/src/GLTFSerializer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/fbx/src/GLTFSerializer.cpp b/libraries/fbx/src/GLTFSerializer.cpp index a7af5518a9..c58d526ef1 100755 --- a/libraries/fbx/src/GLTFSerializer.cpp +++ b/libraries/fbx/src/GLTFSerializer.cpp @@ -1239,6 +1239,11 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash& int v2_index = (indices[n + 1] * 3); int v3_index = (indices[n + 2] * 3); + if (v1_index + 2 >= vertices.size() || v2_index + 2 >= vertices.size() || v3_index + 2 >= vertices.size()) { + qWarning(modelformat) << "Indices out of range for model " << _url; + break; + } + glm::vec3 v1 = glm::vec3(vertices[v1_index], vertices[v1_index + 1], vertices[v1_index + 2]); glm::vec3 v2 = glm::vec3(vertices[v2_index], vertices[v2_index + 1], vertices[v2_index + 2]); glm::vec3 v3 = glm::vec3(vertices[v3_index], vertices[v3_index + 1], vertices[v3_index + 2]); @@ -1333,7 +1338,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash& } if (validatedIndices.size() == 0) { - qWarning(modelformat) << "Indices out of range for model " << _url; + qWarning(modelformat) << "No valid indices for model " << _url; continue; } From bc2c6a280ddb2bf4b46a2541baef6e83bfc03e72 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Thu, 25 Jun 2020 19:31:46 +0200 Subject: [PATCH 32/74] Fix illegal instruction in libaudio.dylib on OSX This file gets included by AudioHRTF_avx512.cpp, which contains code that should only be getting executed on CPUs with the appropriate support. Unfortunately, when that file is compiled with -mavx512f, GCC also generates AVX instructions in the code that initializes the value of SQUARE_ROOT_OF_2, and this crashes on CPUs without AVX because it runs unconditionally. Avoid the issue entirely by just making it a constant so no code needs to be run. --- libraries/shared/src/NumericalConstants.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/shared/src/NumericalConstants.h b/libraries/shared/src/NumericalConstants.h index 8377c48960..b7fecfa1e4 100644 --- a/libraries/shared/src/NumericalConstants.h +++ b/libraries/shared/src/NumericalConstants.h @@ -28,8 +28,8 @@ const float ARCSECONDS_PER_ARCMINUTE = 60.0f; const float ARCSECONDS_PER_DEGREE = ARCMINUTES_PER_DEGREE * ARCSECONDS_PER_ARCMINUTE; const float EPSILON = 0.000001f; //smallish positive number - used as margin of error for some computations -const float SQUARE_ROOT_OF_2 = (float)sqrt(2.0f); -const float SQUARE_ROOT_OF_3 = (float)sqrt(3.0f); +const float SQUARE_ROOT_OF_2 = 1.414214f; +const float SQUARE_ROOT_OF_3 = 1.732051f; const float METERS_PER_DECIMETER = 0.1f; const float METERS_PER_CENTIMETER = 0.01f; const float METERS_PER_MILLIMETER = 0.001f; From 968fd2b72da7685061f93c3bedb6977cdb254ab9 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Fri, 26 Jun 2020 18:46:30 -0400 Subject: [PATCH 33/74] Move chat to correct folder. --- .../chat/FloofChat.html | 0 .../chat/FloofChat.js | 2 +- .../chat/FloofChat.qml | 0 .../chat/chat.png | Bin .../chat/css/FloofChat.css | 0 .../chat/css/materialize.css | 0 .../chat/js/materialize.min.js | 0 .../notificationCore/notificationCore.js | 0 scripts/defaultScripts.js | 4 ++-- 9 files changed, 3 insertions(+), 3 deletions(-) rename scripts/{communityModules => communityScripts}/chat/FloofChat.html (100%) rename scripts/{communityModules => communityScripts}/chat/FloofChat.js (99%) rename scripts/{communityModules => communityScripts}/chat/FloofChat.qml (100%) rename scripts/{communityModules => communityScripts}/chat/chat.png (100%) rename scripts/{communityModules => communityScripts}/chat/css/FloofChat.css (100%) rename scripts/{communityModules => communityScripts}/chat/css/materialize.css (100%) rename scripts/{communityModules => communityScripts}/chat/js/materialize.min.js (100%) rename scripts/{communityModules => communityScripts}/notificationCore/notificationCore.js (100%) diff --git a/scripts/communityModules/chat/FloofChat.html b/scripts/communityScripts/chat/FloofChat.html similarity index 100% rename from scripts/communityModules/chat/FloofChat.html rename to scripts/communityScripts/chat/FloofChat.html diff --git a/scripts/communityModules/chat/FloofChat.js b/scripts/communityScripts/chat/FloofChat.js similarity index 99% rename from scripts/communityModules/chat/FloofChat.js rename to scripts/communityScripts/chat/FloofChat.js index 92382c3199..f8afc67603 100644 --- a/scripts/communityModules/chat/FloofChat.js +++ b/scripts/communityScripts/chat/FloofChat.js @@ -80,7 +80,7 @@ function init() { setupHistoryWindow(false); chatBar = new OverlayWindow({ - source: Paths.defaultScripts + '/communityModules/chat/FloofChat.qml?' + Date.now(), + source: Paths.defaultScripts + '/communityScripts/chat/FloofChat.qml?' + Date.now(), width: 360, height: 180 }); diff --git a/scripts/communityModules/chat/FloofChat.qml b/scripts/communityScripts/chat/FloofChat.qml similarity index 100% rename from scripts/communityModules/chat/FloofChat.qml rename to scripts/communityScripts/chat/FloofChat.qml diff --git a/scripts/communityModules/chat/chat.png b/scripts/communityScripts/chat/chat.png similarity index 100% rename from scripts/communityModules/chat/chat.png rename to scripts/communityScripts/chat/chat.png diff --git a/scripts/communityModules/chat/css/FloofChat.css b/scripts/communityScripts/chat/css/FloofChat.css similarity index 100% rename from scripts/communityModules/chat/css/FloofChat.css rename to scripts/communityScripts/chat/css/FloofChat.css diff --git a/scripts/communityModules/chat/css/materialize.css b/scripts/communityScripts/chat/css/materialize.css similarity index 100% rename from scripts/communityModules/chat/css/materialize.css rename to scripts/communityScripts/chat/css/materialize.css diff --git a/scripts/communityModules/chat/js/materialize.min.js b/scripts/communityScripts/chat/js/materialize.min.js similarity index 100% rename from scripts/communityModules/chat/js/materialize.min.js rename to scripts/communityScripts/chat/js/materialize.min.js diff --git a/scripts/communityModules/notificationCore/notificationCore.js b/scripts/communityScripts/notificationCore/notificationCore.js similarity index 100% rename from scripts/communityModules/notificationCore/notificationCore.js rename to scripts/communityScripts/notificationCore/notificationCore.js diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 5e7e120bf3..4f0f8c7a0e 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -38,11 +38,11 @@ var DEFAULT_SCRIPTS_COMBINED = [ ]; var DEFAULT_SCRIPTS_SEPARATE = [ "system/controllers/controllerScripts.js", - "communityModules/notificationCore/notificationCore.js", + "communityScripts/notificationCore/notificationCore.js", "simplifiedUI/ui/simplifiedNametag/simplifiedNametag.js", {"stable": "system/more/app-more.js", "beta": "https://cdn.vircadia.com/community-apps/more/app-more.js"}, {"stable": "communityScripts/explore/explore.js", "beta": "https://metaverse.vircadia.com/interim/d-goto/app/explore.js"}, - {"stable": "communityModules/chat/FloofChat.js", "beta": "https://content.fluffy.ws/scripts/chat/FloofChat.js"} + {"stable": "communityScripts/chat/FloofChat.js", "beta": "https://content.fluffy.ws/scripts/chat/FloofChat.js"} //"system/chat.js" ]; From 394c9e2175f36af12395376fe11c7205043599fd Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Fri, 26 Jun 2020 21:48:58 -0400 Subject: [PATCH 34/74] Chat window resize, shrink text size and boxes, add date to timestamp. --- scripts/communityScripts/chat/FloofChat.html | 3 ++- scripts/communityScripts/chat/FloofChat.js | 23 +++++++++++-------- .../communityScripts/chat/css/FloofChat.css | 21 +++++++++-------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/scripts/communityScripts/chat/FloofChat.html b/scripts/communityScripts/chat/FloofChat.html index a1e84e132f..3f4e19685b 100644 --- a/scripts/communityScripts/chat/FloofChat.html +++ b/scripts/communityScripts/chat/FloofChat.html @@ -12,6 +12,7 @@ + @@ -191,7 +192,7 @@ } // else fall through to default default: - elContent = elContent.replace(this, "
" + this + ""); + elContent = elContent.replace(this, "
" + this + ""); break; } diff --git a/scripts/communityScripts/chat/FloofChat.js b/scripts/communityScripts/chat/FloofChat.js index f8afc67603..e492b04b1b 100644 --- a/scripts/communityScripts/chat/FloofChat.js +++ b/scripts/communityScripts/chat/FloofChat.js @@ -23,6 +23,9 @@ var SHIFT_KEY = 33554432; var FLOOF_CHAT_CHANNEL = "Chat"; var FLOOF_NOTIFICATION_CHANNEL = "Floof-Notif"; +var MAIN_CHAT_WINDOW_HEIGHT = 450; +var MAIN_CHAT_WINDOW_WIDTH = 750; + Script.scriptEnding.connect(function () { shutdown(); }); @@ -50,14 +53,14 @@ var visible = false; var historyVisible = false; var settingsRoot = "FloofChat"; -var athenaGotoUrl = "https://metaverse.projectathena.io/interim/d-goto/app/goto.json"; -var gotoJSONUrl = Settings.getValue(settingsRoot + "/gotoJSONUrl", athenaGotoUrl); +var vircadiaGotoUrl = "https://metaverse.vircadia.com/interim/d-goto/app/goto.json"; +var gotoJSONUrl = Settings.getValue(settingsRoot + "/gotoJSONUrl", vircadiaGotoUrl); var muted = Settings.getValue(settingsRoot + "/muted", {"Local": false, "Domain": false, "Grid": true}); var ws; var wsReady = false; -var WEB_SOCKET_URL = "ws://chat.projectathena.io:8880"; // WebSocket for Grid chat. +var WEB_SOCKET_URL = "ws://chat.vircadia.com:8880"; // WebSocket for Grid chat. var shutdownBool = false; var defaultColour = {red: 255, green: 255, blue: 255}; @@ -166,11 +169,11 @@ function setupHistoryWindow() { chatHistory = new OverlayWebWindow({ title: 'Chat', source: ROOT + "FloofChat.html?appUUID=" + appUUID + "&" + Date.now(), - width: 900, - height: 700, + width: MAIN_CHAT_WINDOW_WIDTH, + height: MAIN_CHAT_WINDOW_HEIGHT, visible: false }); - chatHistory.setPosition({x: 0, y: Window.innerHeight - 700}); + chatHistory.setPosition({x: 0, y: Window.innerHeight - MAIN_CHAT_WINDOW_HEIGHT}); chatHistory.webEventReceived.connect(onWebEventReceived); chatHistory.closed.connect(toggleChatHistory); } @@ -293,7 +296,7 @@ function onWebEventReceived(event) { colours[event.colourType] = event.colour; } if (event.cmd === "REDOCK") { - chatHistory.setPosition({x: 0, y: Window.innerHeight - 700}); + chatHistory.setPosition({x: 0, y: Window.innerHeight - MAIN_CHAT_WINDOW_HEIGHT}); } if (event.cmd === "GOTO") { gotoConfirm(event.url); @@ -464,14 +467,16 @@ function messageReceived(channel, message) { function time() { var d = new Date(); + var month = (d.getMonth()).toString(); + var day = (d.getDate()).toString(); var h = (d.getHours()).toString(); var m = (d.getMinutes()).toString(); var s = (d.getSeconds()).toString(); var h2 = ("0" + h).slice(-2); var m2 = ("0" + m).slice(-2); var s2 = ("0" + s).slice(-2); - s2 += (d.getMilliseconds() / 1000).toFixed(2).slice(1); - return h2 + ":" + m2 + ":" + s2; + // s2 += (d.getMilliseconds() / 1000).toFixed(2).slice(1); + return month + "/" + day + "-" + h2 + ":" + m2 + ":" + s2; } function addToLog(msg, dp, colour, tab) { diff --git a/scripts/communityScripts/chat/css/FloofChat.css b/scripts/communityScripts/chat/css/FloofChat.css index 476712ffbb..f9d4bb1187 100644 --- a/scripts/communityScripts/chat/css/FloofChat.css +++ b/scripts/communityScripts/chat/css/FloofChat.css @@ -69,9 +69,10 @@ body { } .ChatLog { - height: calc(100vh - 137px); - padding: 20px !important; - font-size: 20px; + height: calc(100vh - 127px); + padding: 10px !important; + font-size: 18px; + font-family: 'Roboto', sans-serif; color: white; background-color: black; overflow-x: hidden; @@ -80,7 +81,7 @@ body { } .ChatLogLine { - margin-bottom: 15px; + margin-bottom: 7px; } .ChatLogLineDisplayName { @@ -91,8 +92,8 @@ body { } .LogLogLine { - margin-bottom: 15px; - padding: 10px !important; + margin-bottom: 7px; + padding: 6px !important; } .LogLogLineMessage { @@ -102,14 +103,14 @@ body { .ChatInput { color: #252525; background: #252525; - height: 60px !important; + height: 45px !important; } .ChatInputText { - padding: 5px !important; - height: 50px !important; + padding: 5px 5px 5px 10px !important; + height: 35px !important; width: calc(100vw - 20px) !important; - font-size: 20px !important; + font-size: 18px !important; background-color: white !important; border-style: solid !important; border-color: #232323 !important; From dc5418748db1e372791d49a2be7f63d0770fb94c Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Sat, 27 Jun 2020 00:43:39 -0400 Subject: [PATCH 35/74] Fix time and date formatting. --- scripts/communityScripts/chat/FloofChat.html | 10 +++++++--- scripts/communityScripts/chat/FloofChat.js | 7 ++++--- scripts/communityScripts/chat/css/FloofChat.css | 5 +++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/scripts/communityScripts/chat/FloofChat.html b/scripts/communityScripts/chat/FloofChat.html index 3f4e19685b..b4a3f79978 100644 --- a/scripts/communityScripts/chat/FloofChat.html +++ b/scripts/communityScripts/chat/FloofChat.html @@ -323,7 +323,7 @@ location.reload(); } - function logMessage(userName, message, logScreen, colour) { + function logMessage(timestamp, userName, message, logScreen, colour) { var LogScreen = $("#" + logScreen); var $logLine = $('
') @@ -334,6 +334,10 @@ .addClass('z-depth-2') .data('chat-message', message).css("color", rgbToHex(colour)) .appendTo(LogScreen); + $('') + .addClass('LogLogLineTimestamp') + .text(timestamp).css("color", rgbToHex(colour)) + .appendTo($logLine); $('') .addClass('LogLogLineMessage') .text(userName + ": ").css("color", rgbToHex(colour)) @@ -431,11 +435,11 @@ var temp = cmd.data; if (temp.length === 1) { var temp2 = temp[0]; - logMessage("[" + temp2[0] + "] " + temp2[2], temp2[1], temp2[4], temp2[3]); + logMessage("[" + temp2[0] + "] ", temp2[2], temp2[1], temp2[4], temp2[3]); scrollChatLog(temp2[4]); } else if (temp.length > 1) { temp.forEach(function (msg) { - logMessage("[" + msg[0] + "] " + msg[2], msg[1], msg[4], msg[3]); + logMessage("[" + msg[0] + "] ", msg[2], msg[1], msg[4], msg[3]); scrollChatLog(msg[4]); }); } diff --git a/scripts/communityScripts/chat/FloofChat.js b/scripts/communityScripts/chat/FloofChat.js index e492b04b1b..5d7892e2dd 100644 --- a/scripts/communityScripts/chat/FloofChat.js +++ b/scripts/communityScripts/chat/FloofChat.js @@ -476,12 +476,13 @@ function time() { var m2 = ("0" + m).slice(-2); var s2 = ("0" + s).slice(-2); // s2 += (d.getMilliseconds() / 1000).toFixed(2).slice(1); - return month + "/" + day + "-" + h2 + ":" + m2 + ":" + s2; + return month + "/" + day + " - " + h2 + ":" + m2 + ":" + s2; } function addToLog(msg, dp, colour, tab) { - historyLog.push([time(), msg, dp, colour, tab]); - chatHistory.emitScriptEvent(JSON.stringify({type: "MSG", data: [[time(), msg, dp, colour, tab]]})); + var currentTimestamp = time(); + historyLog.push([currentTimestamp, msg, dp, colour, tab]); + chatHistory.emitScriptEvent(JSON.stringify({type: "MSG", data: [[currentTimestamp, msg, dp, colour, tab]]})); while (historyLog.length > chatHistoryLimit) { historyLog.shift(); } diff --git a/scripts/communityScripts/chat/css/FloofChat.css b/scripts/communityScripts/chat/css/FloofChat.css index f9d4bb1187..251d4834cf 100644 --- a/scripts/communityScripts/chat/css/FloofChat.css +++ b/scripts/communityScripts/chat/css/FloofChat.css @@ -100,6 +100,11 @@ body { /*font-style: italic;*/ } +.LogLogLineTimestamp { + font-weight: 300; + font-size: 16px; +} + .ChatInput { color: #252525; background: #252525; From 6c3340051eec480233da9c214fc4e32f7515285b Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Sat, 27 Jun 2020 01:08:55 -0400 Subject: [PATCH 36/74] Add external URL launching. --- scripts/communityScripts/chat/FloofChat.html | 13 +++++++++---- scripts/communityScripts/chat/FloofChat.js | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/communityScripts/chat/FloofChat.html b/scripts/communityScripts/chat/FloofChat.html index b4a3f79978..3f45651581 100644 --- a/scripts/communityScripts/chat/FloofChat.html +++ b/scripts/communityScripts/chat/FloofChat.html @@ -172,13 +172,13 @@ case ext == "JPG": case ext == "GIF": case ext == "JPEG": - elContent = elContent.replace(this, "

" + this + ""); + elContent = elContent.replace(this, "

" + this + "📲"); break; case ext == "iframe": elContent = elContent.replace(this, "
"); break; case ext == "webm": - elContent = elContent.replace(this, "

" + this + ""); + elContent = elContent.replace(this, "

" + this + "📲"); break; case protocol === "HIFI": case protocol === "hifi": @@ -187,13 +187,14 @@ case !!this.match(/(https?:\/\/)?(www\.)?(youtube\.com\/watch\?v=|youtu\.be\/)([^& \n<]+)(?:[^ \n<]+)?/g): var youtubeMatch = this.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/); if (youtubeMatch && youtubeMatch[2].length == 11) { - elContent = "

" + this + ""; + elContent = "

" + this + "📲"; break; } // else fall through to default default: - elContent = elContent.replace(this, "
" + this + ""); + elContent = elContent.replace(this, "
" + this + "📲"); break; + } }); @@ -285,6 +286,10 @@ function gotoURL(url) { emitWebEvent({type: "CMD", cmd: "URL", url: url}); } + + function gotoExternalURL(url) { + emitWebEvent({type: "CMD", cmd: "EXTERNALURL", url: url}); + } function gotoClipboard(url) { M.toast({html: 'Copied URL to Clipboard', classes: 'rounded pink white-text'}); diff --git a/scripts/communityScripts/chat/FloofChat.js b/scripts/communityScripts/chat/FloofChat.js index 5d7892e2dd..6dcbda8df2 100644 --- a/scripts/communityScripts/chat/FloofChat.js +++ b/scripts/communityScripts/chat/FloofChat.js @@ -310,6 +310,9 @@ function onWebEventReceived(event) { visible: true }); } + if (event.cmd === "EXTERNALURL") { + Window.openUrl(event.url); + } if (event.cmd === "COPY") { Window.copyToClipboard(event.url); } From 580d4826e935514c997a6feb0cc87a9ccb71fe2a Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Sat, 27 Jun 2020 14:25:15 -0400 Subject: [PATCH 37/74] Fix line lengths. --- scripts/communityScripts/chat/FloofChat.html | 30 ++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/scripts/communityScripts/chat/FloofChat.html b/scripts/communityScripts/chat/FloofChat.html index 3f45651581..7ca04491cb 100644 --- a/scripts/communityScripts/chat/FloofChat.html +++ b/scripts/communityScripts/chat/FloofChat.html @@ -172,13 +172,23 @@ case ext == "JPG": case ext == "GIF": case ext == "JPEG": - elContent = elContent.replace(this, "

" + this + "📲"); + elContent = elContent.replace(this, "

" + this + + "📲"); break; case ext == "iframe": - elContent = elContent.replace(this, "
"); + elContent = elContent.replace(this, "
"); break; case ext == "webm": - elContent = elContent.replace(this, "

" + this + "📲"); + elContent = elContent.replace(this, "

" + this + + "📲"); break; case protocol === "HIFI": case protocol === "hifi": @@ -187,12 +197,22 @@ case !!this.match(/(https?:\/\/)?(www\.)?(youtube\.com\/watch\?v=|youtu\.be\/)([^& \n<]+)(?:[^ \n<]+)?/g): var youtubeMatch = this.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/); if (youtubeMatch && youtubeMatch[2].length == 11) { - elContent = "

" + this + "📲"; + elContent = "

" + this + + "📲"; break; } // else fall through to default default: - elContent = elContent.replace(this, "
" + this + "📲"); + elContent = elContent.replace(this, "
" + this + + "📲"); break; } From a78bd7025f5bb41f9ce13f85141380bf9da5ae91 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sun, 28 Jun 2020 11:04:59 +1200 Subject: [PATCH 38/74] Improve wording of get/set privateUserData description --- .../resources/describe-settings.json | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json index 284dd344e7..3ae92651b8 100644 --- a/domain-server/resources/describe-settings.json +++ b/domain-server/resources/describe-settings.json @@ -247,7 +247,7 @@ "name": "standard_permissions", "type": "table", "label": "Domain-Wide User Permissions", - "help": "Indicate which types of users can have which domain-wide permissions.", + "help": "Indicate which types of users can have which domain-wide permissions.", "caption": "Standard Permissions", "can_add_new_rows": false, "groups": [ @@ -256,7 +256,7 @@ "span": 1 }, { - "label": "Permissions ?", + "label": "Permissions ?", "span": 11 } ], @@ -337,7 +337,7 @@ }, { "name": "id_can_get_and_set_private_user_data", - "label": "Can Get and Set Private User Data", + "label": "Get and Set Private User Data", "type": "checkbox", "editable": true, "default": false @@ -392,7 +392,7 @@ "span": 1 }, { - "label": "Permissions ?", + "label": "Permissions ?", "span": 11 } ], @@ -498,7 +498,7 @@ }, { "name": "id_can_get_and_set_private_user_data", - "label": "Can Get and Set Private User Data", + "label": "Get and Set Private User Data", "type": "checkbox", "editable": true, "default": false @@ -520,7 +520,7 @@ "span": 1 }, { - "label": "Permissions ?", + "label": "Permissions ?", "span": 11 } ], @@ -623,7 +623,7 @@ }, { "name": "id_can_get_and_set_private_user_data", - "label": "Can Get and Set Private User Data", + "label": "Get and Set Private User Data", "type": "checkbox", "editable": true, "default": false @@ -641,7 +641,7 @@ "span": 1 }, { - "label": "Permissions ?", + "label": "Permissions ?", "span": 11 } ], @@ -722,7 +722,7 @@ }, { "name": "id_can_get_and_set_private_user_data", - "label": "Can Get and Set Private User Data", + "label": "Get and Set Private User Data", "type": "checkbox", "editable": true, "default": false @@ -740,7 +740,7 @@ "span": 1 }, { - "label": "Permissions ?", + "label": "Permissions ?", "span": 11 } ], @@ -821,7 +821,7 @@ }, { "name": "id_can_get_and_set_private_user_data", - "label": "Can Get and Set Private User Data", + "label": "Get and Set Private User Data", "type": "checkbox", "editable": true, "default": false @@ -839,7 +839,7 @@ "span": 1 }, { - "label": "Permissions ?", + "label": "Permissions ?", "span": 11 } ], @@ -920,7 +920,7 @@ }, { "name": "id_can_get_and_set_private_user_data", - "label": "Can Get and Set Private User Data", + "label": "Get and Set Private User Data", "type": "checkbox", "editable": true, "default": false @@ -938,7 +938,7 @@ "span": 1 }, { - "label": "Permissions ?", + "label": "Permissions ?", "span": 11 } ], @@ -1019,7 +1019,7 @@ }, { "name": "id_can_get_and_set_private_user_data", - "label": "Can Get and Set Private User Data", + "label": "Get and Set Private User Data", "type": "checkbox", "editable": true, "default": false From cc73528d0b7948fc52f7128d2a0729459e84d339 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 29 Jun 2020 11:12:22 +1200 Subject: [PATCH 39/74] Make Vive PRO Eye code Windows-only --- plugins/openvr/CMakeLists.txt | 4 ++-- plugins/openvr/src/ViveControllerManager.cpp | 19 +++++++++++++++++-- plugins/openvr/src/ViveControllerManager.h | 14 +++++++++++++- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/plugins/openvr/CMakeLists.txt b/plugins/openvr/CMakeLists.txt index fe46fbc209..4573715899 100644 --- a/plugins/openvr/CMakeLists.txt +++ b/plugins/openvr/CMakeLists.txt @@ -15,9 +15,9 @@ if ((WIN32 OR UNIX AND NOT APPLE) AND NOT USE_GLES) include_hifi_library_headers(octree) target_openvr() - target_sranipal() - target_aristo() if (WIN32) + target_sranipal() + target_aristo() target_link_libraries(${TARGET_NAME} Winmm.lib) endif() endif() diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 53452807e6..bf8f9db45d 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -19,10 +19,12 @@ #pragma warning( disable : 4334 ) #endif +#ifdef VIVE_PRO_EYE #include #include #include #include +#endif #ifdef _WIN32 #pragma warning( pop ) @@ -74,6 +76,7 @@ static const int SECOND_FOOT = 1; static const int HIP = 2; static const int CHEST = 3; +#ifdef VIVE_PRO_EYE enum ViveHandJointIndex { HAND = 0, THUMB_1, @@ -99,6 +102,7 @@ enum ViveHandJointIndex { Size }; +#endif const char* ViveControllerManager::NAME { "OpenVR" }; @@ -168,6 +172,7 @@ static glm::mat4 calculateResetMat() { return glm::mat4(); } +#ifdef VIVE_PRO_EYE class ViveProEyeReadThread : public QThread { public: ViveProEyeReadThread() { @@ -211,6 +216,7 @@ public: QMutex eyeDataMutex; EyeDataBuffer eyeDataBuffer; }; +#endif static QString outOfRangeDataStrategyToString(ViveControllerManager::OutOfRangeDataStrategy strategy) { @@ -323,7 +329,7 @@ bool areBothHandControllersActive(vr::IVRSystem*& system) { isHandControllerActive(system, vr::TrackedControllerRole_RightHand); } - +#ifdef VIVE_PRO_EYE void ViveControllerManager::enableGestureDetection() { if (_viveCameraHandTracker) { return; @@ -368,6 +374,7 @@ void ViveControllerManager::disableGestureDetection() { StopGestureDetection(); _viveCameraHandTracker = false; } +#endif bool ViveControllerManager::activate() { InputPlugin::activate(); @@ -389,6 +396,7 @@ bool ViveControllerManager::activate() { userInputMapper->registerDevice(_inputDevice); _registeredWithInputMapper = true; +#ifdef VIVE_PRO_EYE if (ViveSR::anipal::Eye::IsViveProEye()) { qDebug() << "Vive Pro eye-tracking detected"; @@ -409,6 +417,7 @@ bool ViveControllerManager::activate() { _viveProEyeReadThread->start(QThread::HighPriority); } } +#endif return true; } @@ -431,12 +440,14 @@ void ViveControllerManager::deactivate() { userInputMapper->removeDevice(_inputDevice->_deviceID); _registeredWithInputMapper = false; +#ifdef VIVE_PRO_EYE if (_viveProEyeReadThread) { _viveProEyeReadThread->quit = true; _viveProEyeReadThread->wait(); _viveProEyeReadThread = nullptr; ViveSR::anipal::Release(ViveSR::anipal::Eye::ANIPAL_TYPE_EYE); } +#endif saveSettings(); } @@ -449,6 +460,7 @@ bool ViveControllerManager::isHeadControllerMounted() const { return activityLevel == vr::k_EDeviceActivityLevel_UserInteraction; } +#ifdef VIVE_PRO_EYE void ViveControllerManager::invalidateEyeInputs() { _inputDevice->_poseStateMap[controller::LEFT_EYE].valid = false; _inputDevice->_poseStateMap[controller::RIGHT_EYE].valid = false; @@ -456,7 +468,6 @@ void ViveControllerManager::invalidateEyeInputs() { _inputDevice->_axisStateMap[controller::EYEBLINK_R].valid = false; } - void ViveControllerManager::updateEyeTracker(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) { if (!isHeadControllerMounted()) { invalidateEyeInputs(); @@ -758,6 +769,7 @@ void ViveControllerManager::updateCameraHandTracker(float deltaTime, } _lastHandTrackerFrameIndex = handTrackerFrameIndex; } +#endif void ViveControllerManager::pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) { @@ -796,11 +808,14 @@ void ViveControllerManager::pluginUpdate(float deltaTime, const controller::Inpu _registeredWithInputMapper = true; } +#ifdef VIVE_PRO_EYE if (_viveProEye) { updateEyeTracker(deltaTime, inputCalibrationData); } updateCameraHandTracker(deltaTime, inputCalibrationData); +#endif + } void ViveControllerManager::loadSettings() { diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index 053e4bec54..06c58e2d97 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -25,12 +25,18 @@ #include #include "OpenVrHelpers.h" +#ifdef Q_OS_WIN +#define VIVE_PRO_EYE +#endif + using PuckPosePair = std::pair; namespace vr { class IVRSystem; } + +#ifdef VIVE_PRO_EYE class ViveProEyeReadThread; class EyeDataBuffer { @@ -45,7 +51,7 @@ public: float leftEyeOpenness { 0.0f }; float rightEyeOpenness { 0.0f }; }; - +#endif class ViveControllerManager : public InputPlugin { @@ -66,8 +72,10 @@ public: bool isHeadController() const override { return true; } bool isHeadControllerMounted() const; +#ifdef VIVE_PRO_EYE void enableGestureDetection(); void disableGestureDetection(); +#endif bool activate() override; void deactivate() override; @@ -75,9 +83,11 @@ public: QString getDeviceName() override { return QString::fromStdString(_inputDevice->_headsetName); } void pluginFocusOutEvent() override { _inputDevice->focusOutEvent(); } +#ifdef VIVE_PRO_EYE void invalidateEyeInputs(); void updateEyeTracker(float deltaTime, const controller::InputCalibrationData& inputCalibrationData); void updateCameraHandTracker(float deltaTime, const controller::InputCalibrationData& inputCalibrationData); +#endif void pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override; virtual void saveSettings() const override; @@ -252,6 +262,7 @@ private: vr::IVRSystem* _system { nullptr }; std::shared_ptr _inputDevice { std::make_shared(_system) }; +#ifdef VIVE_PRO_EYE bool _viveProEye { false }; std::shared_ptr _viveProEyeReadThread; EyeDataBuffer _prevEyeData; @@ -268,6 +279,7 @@ private: void trackFinger(int hand, int jointIndex1, int jointIndex2, int jointIndex3, int jointIndex4, controller::StandardPoseChannel joint1, controller::StandardPoseChannel joint2, controller::StandardPoseChannel joint3, controller::StandardPoseChannel joint4); +#endif static const char* NAME; }; From e2a7abe8a2afb885536ab73cb730414f1a817353 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 29 Jun 2020 11:12:46 +1200 Subject: [PATCH 40/74] Remove unused code --- plugins/openvr/src/ViveControllerManager.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index bf8f9db45d..ad021701a3 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -156,22 +156,6 @@ static QString deviceTrackingResultToString(vr::ETrackingResult trackingResult) return result; } -static glm::mat4 calculateResetMat() { - auto chaperone = vr::VRChaperone(); - if (chaperone) { - float const UI_RADIUS = 1.0f; - float const UI_HEIGHT = 1.6f; - float const UI_Z_OFFSET = 0.5; - - float xSize, zSize; - chaperone->GetPlayAreaSize(&xSize, &zSize); - glm::vec3 uiPos(0.0f, UI_HEIGHT, UI_RADIUS - (0.5f * zSize) - UI_Z_OFFSET); - - return glm::inverse(createMatFromQuatAndPos(glm::quat(), uiPos)); - } - return glm::mat4(); -} - #ifdef VIVE_PRO_EYE class ViveProEyeReadThread : public QThread { public: From 24352a718940f9c768355da5702dd20863af7124 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 29 Jun 2020 11:32:05 +1200 Subject: [PATCH 41/74] Add JSDoc for Vive eyes and fingers controller properties --- plugins/openvr/src/ViveControllerManager.cpp | 64 ++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index ad021701a3..c39b6b1892 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -1836,10 +1836,74 @@ void ViveControllerManager::InputDevice::setConfigFromString(const QString& valu * Hipsnumber{@link Pose}Hips pose. * Spine2number{@link Pose}Spine2 pose. * Headnumber{@link Pose}Head pose. + * LeftEyenumber{@link Pose}Left eye pose. + * RightEyenumber{@link Pose}Right eye pose. + * EyeBlink_LnumbernumberLeft eyelid blink. + * EyeBlink_RnumbernumberRight eyelid blink. * LeftArmnumber{@link Pose}Left arm pose. * RightArmnumber{@link Pose}Right arm pose * LeftHandnumber{@link Pose}Left hand pose. + * LeftHandThumb1number{@link Pose}Left thumb 1 finger joint pose. + * LeftHandThumb2number{@link Pose}Left thumb 2 finger joint pose. + * LeftHandThumb3number{@link Pose}Left thumb 3 finger joint pose. + * LeftHandThumb4number{@link Pose}Left thumb 4 finger joint pose. + * LeftHandIndex1number{@link Pose}Left index 1 finger joint pose. + * LeftHandIndex2number{@link Pose}Left index 2 finger joint pose. + * LeftHandIndex3number{@link Pose}Left index 3 finger joint pose. + * LeftHandIndex4number{@link Pose}Left index 4 finger joint pose. + * LeftHandMiddle1number{@link Pose}Left middle 1 finger joint pose. + * + * LeftHandMiddle2number{@link Pose}Left middle 2 finger joint pose. + * + * LeftHandMiddle3number{@link Pose}Left middle 3 finger joint pose. + * + * LeftHandMiddle4number{@link Pose}Left middle 4 finger joint pose. + * + * LeftHandRing1number{@link Pose}Left ring 1 finger joint pose. + * LeftHandRing2number{@link Pose}Left ring 2 finger joint pose. + * LeftHandRing3number{@link Pose}Left ring 3 finger joint pose. + * LeftHandRing4number{@link Pose}Left ring 4 finger joint pose. + * LeftHandPinky1number{@link Pose}Left pinky 1 finger joint pose. + * LeftHandPinky2number{@link Pose}Left pinky 2 finger joint pose. + * LeftHandPinky3number{@link Pose}Left pinky 3 finger joint pose. + * LeftHandPinky4number{@link Pose}Left pinky 4 finger joint pose. * RightHandnumber{@link Pose}Right hand pose. + * RightHandThumb1number{@link Pose}Right thumb 1 finger joint pose. + * + * RightHandThumb2number{@link Pose}Right thumb 2 finger joint pose. + * + * RightHandThumb3number{@link Pose}Right thumb 3 finger joint pose. + * + * RightHandThumb4number{@link Pose}Right thumb 4 finger joint pose. + * + * RightHandIndex1number{@link Pose}Right index 1 finger joint pose. + * + * RightHandIndex2number{@link Pose}Right index 2 finger joint pose. + * + * RightHandIndex3number{@link Pose}Right index 3 finger joint pose. + * + * RightHandIndex4number{@link Pose}Right index 4 finger joint pose. + * + * RightHandMiddle1number{@link Pose}Right middle 1 finger joint pose. + * + * RightHandMiddle2number{@link Pose}Right middle 2 finger joint pose. + * + * RightHandMiddle3number{@link Pose}Right middle 3 finger joint pose. + * + * RightHandMiddle4number{@link Pose}Right middle 4 finger joint pose. + * + * RightHandRing1number{@link Pose}Right ring 1 finger joint pose. + * RightHandRing2number{@link Pose}Right ring 2 finger joint pose. + * RightHandRing3number{@link Pose}Right ring 3 finger joint pose. + * RightHandRing4number{@link Pose}Right ring 4 finger joint pose. + * RightHandPinky1number{@link Pose}Right pinky 1 finger joint pose. + * + * RightHandPinky2number{@link Pose}Right pinky 2 finger joint pose. + * + * RightHandPinky3number{@link Pose}Right pinky 3 finger joint pose. + * + * RightHandPinky4number{@link Pose}Right pinky 4 finger joint pose. + * * Trackers * TrackedObject00number{@link Pose}Tracker 0 pose. * TrackedObject01number{@link Pose}Tracker 1 pose. From c2bb26e519806bd9f38aeaee839dc2ec899b1718 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 29 Jun 2020 12:40:39 +1200 Subject: [PATCH 42/74] Typos etc. --- plugins/openvr/src/OpenVrDisplayPlugin.cpp | 2 +- plugins/openvr/src/OpenVrHelpers.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/openvr/src/OpenVrDisplayPlugin.cpp b/plugins/openvr/src/OpenVrDisplayPlugin.cpp index 126bdb352e..e56ea09534 100644 --- a/plugins/openvr/src/OpenVrDisplayPlugin.cpp +++ b/plugins/openvr/src/OpenVrDisplayPlugin.cpp @@ -739,7 +739,7 @@ int OpenVrDisplayPlugin::getRequiredThreadCount() const { QString OpenVrDisplayPlugin::getPreferredAudioInDevice() const { QString device = getVrSettingString(vr::k_pch_audio_Section, vr::k_pch_audio_RecordingDeviceOverride_String); -// FIXME: Address Linux. + // FIXME: Address Linux. #ifdef Q_OS_WIN if (!device.isEmpty()) { static const WCHAR INIT = 0; diff --git a/plugins/openvr/src/OpenVrHelpers.cpp b/plugins/openvr/src/OpenVrHelpers.cpp index 2f7bf3ddfd..af0d426180 100644 --- a/plugins/openvr/src/OpenVrHelpers.cpp +++ b/plugins/openvr/src/OpenVrHelpers.cpp @@ -49,7 +49,7 @@ static const uint32_t RELEASE_OPENVR_HMD_DELAY_MS = 5000; bool isOculusPresent() { bool result = false; -#if defined(Q_OS_WIN32) +#ifdef Q_OS_WIN HANDLE oculusServiceEvent = ::OpenEventW(SYNCHRONIZE, FALSE, L"OculusHMDConnected"); // The existence of the service indicates a running Oculus runtime if (oculusServiceEvent) { From baa24c311e45a40179d66f660d6d82bd412b2b3b Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Mon, 29 Jun 2020 21:52:58 -0400 Subject: [PATCH 43/74] Add notification sound + muting system. --- scripts/communityScripts/chat/FloofChat.html | 41 ++++++++++++++++-- scripts/communityScripts/chat/FloofChat.js | 35 +++++++++++++++ .../communityScripts/chat/css/FloofChat.css | 14 ++++++ .../chat/resources/bubblepop.wav | Bin 0 -> 50220 bytes 4 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 scripts/communityScripts/chat/resources/bubblepop.wav diff --git a/scripts/communityScripts/chat/FloofChat.html b/scripts/communityScripts/chat/FloofChat.html index 7ca04491cb..316e79d3e6 100644 --- a/scripts/communityScripts/chat/FloofChat.html +++ b/scripts/communityScripts/chat/FloofChat.html @@ -29,11 +29,19 @@
+ +
+ +
@@ -47,6 +55,7 @@