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 | 13 | #include <AudioInjector.h> |
| 14 | 14 | #include <PathUtils.h> |
| 15 | +#include <RegisteredMetaTypes.h> | |
| 15 | 16 | #include "ScriptEngineLogging.h" |
| 16 | 17 | |
| 17 | 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 | 169 | void TabletProxy::emitScriptEvent(QVariant msg) { |
| 173 | 170 | if (_qmlOffscreenSurface) { |
| 174 | 171 | QMetaObject::invokeMethod(_qmlOffscreenSurface, "emitScriptEvent", Qt::AutoConnection, Q_ARG(QVariant, msg)); |
| @@ -269,13 +266,13 @@ void SoundEffect::setSource(QUrl url) { · 94 unmodified lines | ||
| 269 | 266 | _sound = DependencyManager::get<SoundCache>()->getSound(_url); |
| 270 | 267 | } |
| 271 | 268 | |
| 272 | −void SoundEffect::play() { | |
| 269 | +void SoundEffect::play(QVariant position) { | |
| 273 | 270 | auto tsi = DependencyManager::get<TabletScriptingInterface>(); |
| 274 | 271 | if (tsi) { |
| 275 | 272 | TabletProxy* tablet = qobject_cast<TabletProxy*>(tsi->getTablet("com.highfidelity.interface.tablet.system")); |
| 276 | 273 | if (tablet) { |
| 277 | 274 | AudioInjectorOptions options; |
| 278 | − options.position = tablet->getPosition(); | |
| 275 | + options.position = vec3FromVariant(position); | |
| 279 | 276 | options.localOnly = true; |
| 280 | 277 | if (_injector) { |
| 281 | 278 | _injector->setOptions(options); |