Showing the changes to interface/src/scripting/HMDScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -130,6 +130,22 @@ bool HMDScriptingInterface::setHandLasers(int hands, bool enabled, const glm::ve · 129 unmodified lines | ||
| 130 | 130 | color, direction); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | +bool HMDScriptingInterface::setExtraLaser(const vec3& worldStart, bool enabled, const vec4& color, const vec3& direction) const { | |
| 134 | + auto offscreenUi = DependencyManager::get<OffscreenUi>(); | |
| 135 | + offscreenUi->executeOnUiThread([offscreenUi, enabled] { | |
| 136 | + offscreenUi->getDesktop()->setProperty("hmdHandMouseActive", enabled); | |
| 137 | + }); | |
| 138 | + | |
| 139 | + mat4 extraLaserPose; | |
| 140 | + return qApp->getActiveDisplayPlugin()->setExtraLaser(extraLaserPose, | |
| 141 | + enabled ? DisplayPlugin::HandLaserMode::Overlay : DisplayPlugin::HandLaserMode::None, | |
| 142 | + color, direction); | |
| 143 | +} | |
| 144 | + | |
| 145 | +void HMDScriptingInterface::disableExtraLaser() const { | |
| 146 | + setExtraLaser(vec3(0), false, vec4(0), vec3(0)); | |
| 147 | +} | |
| 148 | + | |
| 133 | 149 | void HMDScriptingInterface::disableHandLasers(int hands) const { |
| 134 | 150 | setHandLasers(hands, false, vec4(0), vec3(0)); |
| 135 | 151 | } |