Including webEntities, webOverlays and the system tablet. We might want to add this to enable spatial sound effects for the web keyboard.
Showing the changes to libraries/script-engine/src/TabletScriptingInterface.cpp (1 of 6 files). Show all
Unified · Split
| @@ -12,6 +12,7 @@ · 11 unmodified lines | |||
| 12 | 12 | ||
| 13 | #include <AudioInjector.h> | 13 | #include <AudioInjector.h> |
| 14 | #include <PathUtils.h> | 14 | #include <PathUtils.h> |
| 15 | #include <RegisteredMetaTypes.h> | ||
| 15 | #include "ScriptEngineLogging.h" | 16 | #include "ScriptEngineLogging.h" |
| 16 | 17 | ||
| 17 | TabletScriptingInterface::TabletScriptingInterface() { | 18 | TabletScriptingInterface::TabletScriptingInterface() { |
| @@ -165,10 +166,6 @@ void TabletProxy::updateAudioBar(const double micLevel) { · 147 unmodified lines | |||
| 165 | } | 166 | } |
| 166 | } | 167 | } |
| 167 | 168 | ||
| 168 | void TabletProxy::updateTabletPosition(glm::vec3 tabletPosition) { | ||
| 169 | _position.set(tabletPosition); | ||
| 170 | } | ||
| 171 | |||
| 172 | void TabletProxy::emitScriptEvent(QVariant msg) { | 169 | void TabletProxy::emitScriptEvent(QVariant msg) { |
| 173 | if (_qmlOffscreenSurface) { | 170 | if (_qmlOffscreenSurface) { |
| 174 | QMetaObject::invokeMethod(_qmlOffscreenSurface, "emitScriptEvent", Qt::AutoConnection, Q_ARG(QVariant, msg)); | 171 | QMetaObject::invokeMethod(_qmlOffscreenSurface, "emitScriptEvent", Qt::AutoConnection, Q_ARG(QVariant, msg)); |
| @@ -269,13 +266,13 @@ void SoundEffect::setSource(QUrl url) { · 94 unmodified lines | |||
| 269 | _sound = DependencyManager::get<SoundCache>()->getSound(_url); | 266 | _sound = DependencyManager::get<SoundCache>()->getSound(_url); |
| 270 | } | 267 | } |
| 271 | 268 | ||
| 272 | void SoundEffect::play() { | 269 | void SoundEffect::play(QVariant position) { |
| 273 | auto tsi = DependencyManager::get<TabletScriptingInterface>(); | 270 | auto tsi = DependencyManager::get<TabletScriptingInterface>(); |
| 274 | if (tsi) { | 271 | if (tsi) { |
| 275 | TabletProxy* tablet = qobject_cast<TabletProxy*>(tsi->getTablet("com.highfidelity.interface.tablet.system")); | 272 | TabletProxy* tablet = qobject_cast<TabletProxy*>(tsi->getTablet("com.highfidelity.interface.tablet.system")); |
| 276 | if (tablet) { | 273 | if (tablet) { |
| 277 | AudioInjectorOptions options; | 274 | AudioInjectorOptions options; |
| 278 | options.position = tablet->getPosition(); | 275 | options.position = vec3FromVariant(position); |
| 279 | options.localOnly = true; | 276 | options.localOnly = true; |
| 280 | if (_injector) { | 277 | if (_injector) { |
| 281 | _injector->setOptions(options); | 278 | _injector->setOptions(options); |