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 | 16 | #include <display-plugins/DisplayPlugin.h> |
| 17 | 17 | #include <display-plugins/CompositorHelper.h> |
| 18 | +#include <OffscreenUi.h> | |
| 18 | 19 | #include <avatar/AvatarManager.h> |
| 19 | 20 | #include "Application.h" |
| 20 | 21 | |
| @@ -110,13 +111,17 @@ QString HMDScriptingInterface::preferredAudioOutput() const { · 89 unmodified lines | ||
| 110 | 111 | } |
| 111 | 112 | |
| 112 | 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 | 118 | return qApp->getActiveDisplayPlugin()->setHandLaser(hands, |
| 114 | 119 | enabled ? DisplayPlugin::HandLaserMode::Overlay : DisplayPlugin::HandLaserMode::None, |
| 115 | 120 | color, direction); |
| 116 | 121 | } |
| 117 | 122 | |
| 118 | 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 | 127 | bool HMDScriptingInterface::suppressKeyboard() { |