From 5ce60a9ab7c66f63efde0f577f2c49f9a0af63e6 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 27 Jun 2020 07:24:38 +1200 Subject: [PATCH 1/8] Include deveoper guidelines doc in Vive PRO Eye's SRanipal package --- cmake/ports/sranipal/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/ports/sranipal/portfile.cmake b/cmake/ports/sranipal/portfile.cmake index 2e6acea361..4c4d88e567 100644 --- a/cmake/ports/sranipal/portfile.cmake +++ b/cmake/ports/sranipal/portfile.cmake @@ -7,9 +7,9 @@ file(READ "${VCPKG_ROOT_DIR}/_env/EXTERNAL_BUILD_ASSETS.txt" EXTERNAL_BUILD_ASSE if (WIN32) vcpkg_download_distfile( SRANIPAL_SOURCE_ARCHIVE - URLS "${EXTERNAL_BUILD_ASSETS}/seth/sranipal-1.1.0.1-windows.zip" - SHA512 b09ce012abe4e3c71e8e69626bdd7823ff6576601a821ab365275f2764406a3e5f7b65fcf2eb1d0962eff31eb5958a148b00901f67c229dc6ace56eb5e6c9e1b - FILENAME sranipal-1.1.0.1-windows.zip + URLS "${EXTERNAL_BUILD_ASSETS}/seth/sranipal-1.1.0.1-2-windows.zip" + SHA512 f1f68f6beef52ae5e034bc3f44932ae0800ee187b75d80e76ae7b17b8ddd7bc54c039ce5594d231035e3caf3a61fed36f38621a860b4fb20170cb0176d9c28f0 + FILENAME sranipal-1.1.0.1-2-windows.zip ) vcpkg_extract_source_archive(${SRANIPAL_SOURCE_ARCHIVE}) From e95dd3c2bd7585f6b588a395496953abd59e60c1 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 27 Jun 2020 12:32:57 +1200 Subject: [PATCH 2/8] Fix Settings > Calibration dialog not functioning when HIFI_DEBUG_OPENVR --- plugins/openvr/src/ViveControllerManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 2c9eb296ab..a2312b3247 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -863,6 +863,9 @@ void ViveControllerManager::InputDevice::update(float deltaTime, const controlle if (_headsetName == "HTC") { _headsetName += " Vive"; } + if (oculusViaOpenVR()) { + _headsetName = "OpenVR"; // Enables calibration dialog to function when debugging using Oculus. + } } // While the keyboard is open, we defer strictly to the keyboard values if (isOpenVrKeyboardShown()) { From 2e9a8e2b33689bf483c8bcb1d9ec63f0ca7abd2d Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 27 Jun 2020 15:14:21 +1200 Subject: [PATCH 3/8] Add option to enable Vive PRO Eye eye tracking --- .../qml/hifi/tablet/OpenVrConfiguration.qml | 77 ++++++++++++++++++- plugins/openvr/src/ViveControllerManager.cpp | 12 ++- plugins/openvr/src/ViveControllerManager.h | 1 + 3 files changed, 88 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml index a9d67fec35..3690dc3f4a 100644 --- a/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml +++ b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml @@ -71,6 +71,7 @@ Flickable { property int state: buttonState.disabled property var lastConfiguration: null + property bool isConfiguring: false HifiConstants { id: hifi } @@ -840,9 +841,72 @@ Flickable { } } + + HifiControls.CheckBox { + id: eyeTracking + width: 15 + height: 15 + boxRadius: 7 + + anchors.top: viveInDesktop.bottom + anchors.topMargin: 5 + anchors.left: openVrConfiguration.left + anchors.leftMargin: leftMargin + 10 + + onClicked: { + sendConfigurationSettings(); + } + } + + RalewayBold { + id: eyeTrackingLabel + size: 12 + text: "Use eye tracking (if available)." + color: hifi.colors.lightGrayText + anchors { + left: eyeTracking.right + leftMargin: 5 + verticalCenter: eyeTracking.verticalCenter + } + } + + RalewayRegular { + id: privacyStatement + text: "Privacy Statement" + color: hifi.colors.blueHighlight + size: 12 + anchors { + left: eyeTrackingLabel.right + leftMargin: 10 + verticalCenter: eyeTrackingLabel.verticalCenter + } + + Rectangle { + id: privacyStatementUnderline + color: hifi.colors.blueHighlight + width: privacyStatement.width + height: 1 + anchors { + top: privacyStatement.bottom + topMargin: 1 + left: privacyStatement.left + } + visible: false + } + + MouseArea { + anchors.fill: parent; + hoverEnabled: true + onEntered: privacyStatementUnderline.visible = true; + onExited: privacyStatementUnderline.visible = false; + onClicked: HiFiAbout.openUrl("https://vircadia.com/"); // FIXME: URL for privacy statement. + } + } + + Row { id: outOfRangeDataStrategyRow - anchors.top: viveInDesktop.bottom + anchors.top: eyeTracking.bottom anchors.topMargin: 5 anchors.left: openVrConfiguration.left anchors.leftMargin: leftMargin + 10 @@ -966,6 +1030,8 @@ Flickable { } function displayConfiguration() { + isConfiguring = true; + var settings = InputConfiguration.configurationSettings(openVrConfiguration.pluginName); var configurationType = settings["trackerConfiguration"]; displayTrackerConfiguration(configurationType); @@ -982,6 +1048,7 @@ Flickable { var viveController = settings["handController"]; var desktopMode = settings["desktopMode"]; var hmdDesktopPosition = settings["hmdDesktopTracking"]; + var eyeTrackingEnabled = settings["eyeTrackingEnabled"]; armCircumference.realValue = settings.armCircumference; shoulderWidth.realValue = settings.shoulderWidth; @@ -1004,6 +1071,7 @@ Flickable { viveInDesktop.checked = desktopMode; hmdInDesktop.checked = hmdDesktopPosition; + eyeTracking.checked = eyeTrackingEnabled; outOfRangeDataStrategyComboBox.currentIndex = outOfRangeDataStrategyComboBox.model.indexOf(settings.outOfRangeDataStrategy); initializeButtonState(); @@ -1014,6 +1082,8 @@ Flickable { }; UserActivityLogger.logAction("mocap_ui_open_dialog", data); + + isConfiguring = false; } function displayTrackerConfiguration(type) { @@ -1170,6 +1240,7 @@ Flickable { "shoulderWidth": shoulderWidth.realValue, "desktopMode": viveInDesktop.checked, "hmdDesktopTracking": hmdInDesktop.checked, + "eyeTrackingEnabled": eyeTracking.checked, "outOfRangeDataStrategy": outOfRangeDataStrategyComboBox.model[outOfRangeDataStrategyComboBox.currentIndex] } @@ -1177,6 +1248,10 @@ Flickable { } function sendConfigurationSettings() { + if (isConfiguring) { + // Ignore control value changes during dialog initialization. + return; + } var settings = composeConfigurationSettings(); InputConfiguration.setConfigurationSettings(settings, openVrConfiguration.pluginName); updateCalibrationButton(); diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index a2312b3247..a47d7218e2 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -279,6 +279,10 @@ void ViveControllerManager::setConfigurationSettings(const QJsonObject configura _hmdDesktopTracking = configurationSettings["hmdDesktopTracking"].toBool(); } + if (configurationSettings.contains("eyeTrackingEnabled")) { + _eyeTrackingEnabled = configurationSettings["eyeTrackingEnabled"].toBool(); + } + _inputDevice->configureCalibrationSettings(configurationSettings); saveSettings(); } @@ -289,6 +293,7 @@ QJsonObject ViveControllerManager::configurationSettings() { QJsonObject configurationSettings = _inputDevice->configurationSettings(); configurationSettings["desktopMode"] = _desktopMode; configurationSettings["hmdDesktopTracking"] = _hmdDesktopTracking; + configurationSettings["eyeTrackingEnabled"] = _eyeTrackingEnabled; return configurationSettings; } @@ -801,7 +806,7 @@ void ViveControllerManager::pluginUpdate(float deltaTime, const controller::Inpu _registeredWithInputMapper = true; } - if (_viveProEye) { + if (_viveProEye && _eyeTrackingEnabled) { updateEyeTracker(deltaTime, inputCalibrationData); } @@ -821,6 +826,9 @@ void ViveControllerManager::loadSettings() { _inputDevice->_shoulderWidth = settings.value("shoulderWidth", QVariant(DEFAULT_SHOULDER_WIDTH)).toDouble(); _inputDevice->_outOfRangeDataStrategy = stringToOutOfRangeDataStrategy(settings.value("outOfRangeDataStrategy", QVariant(DEFAULT_OUT_OF_RANGE_STRATEGY)).toString()); } + + const bool DEFAULT_EYE_TRACKING_ENABLED = false; + _eyeTrackingEnabled = settings.value("eyeTrackingEnabled", QVariant(DEFAULT_EYE_TRACKING_ENABLED)).toBool(); } settings.endGroup(); } @@ -835,6 +843,8 @@ void ViveControllerManager::saveSettings() const { settings.setValue(QString("shoulderWidth"), _inputDevice->_shoulderWidth); settings.setValue(QString("outOfRangeDataStrategy"), outOfRangeDataStrategyToString(_inputDevice->_outOfRangeDataStrategy)); } + + settings.setValue(QString("eyeTrackingEnabled"), _eyeTrackingEnabled); } settings.endGroup(); } diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index 714be87842..f2eaa3fbff 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -253,6 +253,7 @@ private: std::shared_ptr _inputDevice { std::make_shared(_system) }; bool _viveProEye { false }; + bool _eyeTrackingEnabled { false }; std::shared_ptr _viveProEyeReadThread; EyeDataBuffer _prevEyeData; From 258fc8a2f4778cd6ae18d0247ee635a1a720060f Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 27 Jun 2020 15:54:15 +1200 Subject: [PATCH 4/8] Improve some text and make checkboxes square --- .../resources/qml/hifi/tablet/ControllerSettings.qml | 2 +- .../resources/qml/hifi/tablet/OpenVrConfiguration.qml | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/ControllerSettings.qml b/interface/resources/qml/hifi/tablet/ControllerSettings.qml index 5db784789e..fd3e60784b 100644 --- a/interface/resources/qml/hifi/tablet/ControllerSettings.qml +++ b/interface/resources/qml/hifi/tablet/ControllerSettings.qml @@ -179,7 +179,7 @@ Item { HifiControls.CheckBox { id: checkBox colorScheme: hifi.colorSchemes.dark - text: "show all input devices" + text: "Show all input devices" onClicked: { box.model = inputPlugins(); diff --git a/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml index 3690dc3f4a..249f820adc 100644 --- a/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml +++ b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml @@ -361,9 +361,9 @@ Flickable { RalewayRegular { id: info - text: "See Recommended Tracker Placement" + text: "See Recommended Placement" color: hifi.colors.blueHighlight - size: 10 + size: 12 anchors { left: additional.right leftMargin: 10 @@ -416,7 +416,6 @@ Flickable { id: feetBox width: 15 height: 15 - boxRadius: 7 onClicked: { if (!checked) { @@ -447,7 +446,6 @@ Flickable { id: hipBox width: 15 height: 15 - boxRadius: 7 onClicked: { if (checked) { @@ -487,7 +485,6 @@ Flickable { id: chestBox width: 15 height: 15 - boxRadius: 7 onClicked: { if (checked) { @@ -525,7 +522,6 @@ Flickable { id: shoulderBox width: 15 height: 15 - boxRadius: 7 onClicked: { if (checked) { @@ -824,7 +820,6 @@ Flickable { id: viveInDesktop width: 15 height: 15 - boxRadius: 7 anchors.top: advanceSettings.bottom anchors.topMargin: 5 @@ -846,7 +841,6 @@ Flickable { id: eyeTracking width: 15 height: 15 - boxRadius: 7 anchors.top: viveInDesktop.bottom anchors.topMargin: 5 From 06010dbcaee623691f5dc4355715538c867fb988 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 27 Jun 2020 15:54:28 +1200 Subject: [PATCH 5/8] Fix position of recommended puck placement dialog --- interface/resources/qml/hifi/tablet/ControllerSettings.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/tablet/ControllerSettings.qml b/interface/resources/qml/hifi/tablet/ControllerSettings.qml index fd3e60784b..338c8b7384 100644 --- a/interface/resources/qml/hifi/tablet/ControllerSettings.qml +++ b/interface/resources/qml/hifi/tablet/ControllerSettings.qml @@ -96,7 +96,8 @@ Item { HifiControls.ImageMessageBox { id: imageMessageBox - anchors.fill: parent + anchors.top: parent.top + anchors.topMargin: 444 z: 2000 imageWidth: 442 imageHeight: 670 From 52389e58048368cfa63f781364746302e3526353 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sun, 5 Jul 2020 11:17:56 +1200 Subject: [PATCH 6/8] Add correct privacy policy URL --- .../qml/hifi/tablet/OpenVrConfiguration.qml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml index 249f820adc..c884f6ab2f 100644 --- a/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml +++ b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml @@ -865,8 +865,8 @@ Flickable { } RalewayRegular { - id: privacyStatement - text: "Privacy Statement" + id: privacyPolicy + text: "Privacy Policy" color: hifi.colors.blueHighlight size: 12 anchors { @@ -876,14 +876,14 @@ Flickable { } Rectangle { - id: privacyStatementUnderline + id: privacyPolicyUnderline color: hifi.colors.blueHighlight - width: privacyStatement.width + width: privacyPolicy.width height: 1 anchors { - top: privacyStatement.bottom + top: privacyPolicy.bottom topMargin: 1 - left: privacyStatement.left + left: privacyPolicy.left } visible: false } @@ -891,9 +891,9 @@ Flickable { MouseArea { anchors.fill: parent; hoverEnabled: true - onEntered: privacyStatementUnderline.visible = true; - onExited: privacyStatementUnderline.visible = false; - onClicked: HiFiAbout.openUrl("https://vircadia.com/"); // FIXME: URL for privacy statement. + onEntered: privacyPolicyUnderline.visible = true; + onExited: privacyPolicyUnderline.visible = false; + onClicked: HiFiAbout.openUrl("https://vircadia.com/privacy-policy"); } } From 6e1af6df738255722de9a8d8d18a58b85026c7b3 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 10 Jul 2020 07:18:29 +1200 Subject: [PATCH 7/8] Update copyright notices --- interface/resources/qml/hifi/tablet/ControllerSettings.qml | 1 + interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml | 1 + plugins/openvr/src/ViveControllerManager.cpp | 1 + plugins/openvr/src/ViveControllerManager.h | 1 + 4 files changed, 4 insertions(+) diff --git a/interface/resources/qml/hifi/tablet/ControllerSettings.qml b/interface/resources/qml/hifi/tablet/ControllerSettings.qml index 338c8b7384..ea694ae2d7 100644 --- a/interface/resources/qml/hifi/tablet/ControllerSettings.qml +++ b/interface/resources/qml/hifi/tablet/ControllerSettings.qml @@ -1,6 +1,7 @@ // // Created by Dante Ruiz on 6/1/17. // 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 diff --git a/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml index c884f6ab2f..f1275a39fb 100644 --- a/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml +++ b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml @@ -1,6 +1,7 @@ // // Created by Dante Ruiz on 6/5/17. // 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 diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index a47d7218e2..2afdd10403 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -4,6 +4,7 @@ // // Created by Sam Gondelman on 6/29/15. // Copyright 2013 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 diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index f2eaa3fbff..687d1f25d9 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -4,6 +4,7 @@ // // Created by Sam Gondelman on 6/29/15. // Copyright 2013 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 989cd2d1699c2f5a1c6b03317680530b779cf3d4 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 11 Jul 2020 15:59:16 +1200 Subject: [PATCH 8/8] Fix Linux build error --- plugins/openvr/src/ViveControllerManager.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index 83de8176cc..956b2b5eaf 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -262,9 +262,10 @@ private: vr::IVRSystem* _system { nullptr }; std::shared_ptr _inputDevice { std::make_shared(_system) }; + bool _eyeTrackingEnabled{ false }; + #ifdef VIVE_PRO_EYE bool _viveProEye { false }; - bool _eyeTrackingEnabled { false }; std::shared_ptr _viveProEyeReadThread; EyeDataBuffer _prevEyeData;