Showing the changes to interface/src/Application.cpp (1 of 18 files). Show all
Unified · Split
| @@ -1674,6 +1674,15 @@ void Application::init() { · 1673 unmodified lines | ||
| 1674 | 1674 | connect(_rearMirrorTools, SIGNAL(restoreView()), SLOT(restoreMirrorView())); |
| 1675 | 1675 | connect(_rearMirrorTools, SIGNAL(shrinkView()), SLOT(shrinkMirrorView())); |
| 1676 | 1676 | connect(_rearMirrorTools, SIGNAL(resetView()), SLOT(resetSensors())); |
| 1677 | + | |
| 1678 | + // set up our audio reflector | |
| 1679 | + _audioReflector.setMyAvatar(getAvatar()); | |
| 1680 | + _audioReflector.setVoxels(_voxels.getTree()); | |
| 1681 | + _audioReflector.setAudio(getAudio()); | |
| 1682 | + connect(getAudio(), &Audio::processInboundAudio, &_audioReflector, &AudioReflector::processInboundAudio,Qt::DirectConnection); | |
| 1683 | + connect(getAudio(), &Audio::processLocalAudio, &_audioReflector, &AudioReflector::processLocalAudio,Qt::DirectConnection); | |
| 1684 | + | |
| 1685 | + // save settings when avatar changes | |
| 1677 | 1686 | connect(_myAvatar, &MyAvatar::transformChanged, this, &Application::bumpSettings); |
| 1678 | 1687 | } |
| 1679 | 1688 | |
| @@ -2446,6 +2455,9 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 766 unmodified lines | ||
| 2446 | 2455 | |
| 2447 | 2456 | // disable specular lighting for ground and voxels |
| 2448 | 2457 | glMaterialfv(GL_FRONT, GL_SPECULAR, NO_SPECULAR_COLOR); |
| 2458 | + | |
| 2459 | + // draw the audio reflector overlay | |
| 2460 | + _audioReflector.render(); | |
| 2449 | 2461 | |
| 2450 | 2462 | // Draw voxels |
| 2451 | 2463 | if (Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { |
| @@ -3385,6 +3397,7 @@ void Application::loadScript(const QString& scriptName) { · 933 unmodified lines | ||
| 3385 | 3397 | scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance()); |
| 3386 | 3398 | scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance()); |
| 3387 | 3399 | scriptEngine->registerGlobalObject("AudioDevice", AudioDeviceScriptingInterface::getInstance()); |
| 3400 | + scriptEngine->registerGlobalObject("AudioReflector", &_audioReflector); | |
| 3388 | 3401 | |
| 3389 | 3402 | QThread* workerThread = new QThread(this); |
| 3390 | 3403 | |