Showing the changes to interface/src/scripting/HMDScriptingInterface.cpp (1 of 6 files). Show all
Unified · Split
| @@ -15,6 +15,7 @@ · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | #include <display-plugins/DisplayPlugin.h> | 16 | #include <display-plugins/DisplayPlugin.h> |
| 17 | #include <display-plugins/CompositorHelper.h> | 17 | #include <display-plugins/CompositorHelper.h> |
| 18 | #include <OffscreenUi.h> | ||
| 18 | #include <avatar/AvatarManager.h> | 19 | #include <avatar/AvatarManager.h> |
| 19 | #include "Application.h" | 20 | #include "Application.h" |
| 20 | 21 | ||
| @@ -110,13 +111,17 @@ QString HMDScriptingInterface::preferredAudioOutput() const { · 89 unmodified lines | |||
| 110 | } | 111 | } |
| 111 | 112 | ||
| 112 | bool HMDScriptingInterface::setHandLasers(int hands, bool enabled, const glm::vec4& color, const glm::vec3& direction) const { | 113 | bool HMDScriptingInterface::setHandLasers(int hands, bool enabled, const glm::vec4& color, const glm::vec3& direction) const { |
| 114 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); | ||
| 115 | offscreenUi->executeOnUiThread([offscreenUi, enabled] { | ||
| 116 | offscreenUi->getDesktop()->setProperty("hmdHandMouseActive", enabled); | ||
| 117 | }); | ||
| 113 | return qApp->getActiveDisplayPlugin()->setHandLaser(hands, | 118 | return qApp->getActiveDisplayPlugin()->setHandLaser(hands, |
| 114 | enabled ? DisplayPlugin::HandLaserMode::Overlay : DisplayPlugin::HandLaserMode::None, | 119 | enabled ? DisplayPlugin::HandLaserMode::Overlay : DisplayPlugin::HandLaserMode::None, |
| 115 | color, direction); | 120 | color, direction); |
| 116 | } | 121 | } |
| 117 | 122 | ||
| 118 | void HMDScriptingInterface::disableHandLasers(int hands) const { | 123 | void HMDScriptingInterface::disableHandLasers(int hands) const { |
| 119 | qApp->getActiveDisplayPlugin()->setHandLaser(hands, DisplayPlugin::HandLaserMode::None); | 124 | setHandLasers(hands, false, vec4(0), vec3(0)); |
| 120 | } | 125 | } |
| 121 | 126 | ||
| 122 | bool HMDScriptingInterface::suppressKeyboard() { | 127 | bool HMDScriptingInterface::suppressKeyboard() { |