Showing the changes to libraries/script-engine/src/AudioScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -11,6 +11,8 @@ · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | #include "AudioScriptingInterface.h" |
| 13 | 13 | |
| 14 | +#include <QVector3D> | |
| 15 | + | |
| 14 | 16 | #include "ScriptAudioInjector.h" |
| 15 | 17 | #include "ScriptEngineLogging.h" |
| 16 | 18 | |
| @@ -19,6 +21,13 @@ void registerAudioMetaTypes(QScriptEngine* engine) { · 2 unmodified lines | ||
| 19 | 21 | qScriptRegisterMetaType(engine, soundSharedPointerToScriptValue, soundSharedPointerFromScriptValue); |
| 20 | 22 | } |
| 21 | 23 | |
| 24 | +ScriptAudioInjector* AudioScriptingInterface::playSystemSound(SharedSoundPointer sound, const QVector3D& position) { | |
| 25 | + AudioInjectorOptions options; | |
| 26 | + options.position = glm::vec3(position.x(), position.y(), position.z()); | |
| 27 | + options.localOnly = true; | |
| 28 | + return playSound(sound, options); | |
| 29 | +} | |
| 30 | + | |
| 22 | 31 | ScriptAudioInjector* AudioScriptingInterface::playSound(SharedSoundPointer sound, const AudioInjectorOptions& injectorOptions) { |
| 23 | 32 | if (QThread::currentThread() != thread()) { |
| 24 | 33 | ScriptAudioInjector* injector = NULL; |