File size: 853 Bytes
85407a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/esp/sensor/AudioSensor.cpp b/src/esp/sensor/AudioSensor.cpp
index 91afe8c..1e2e350 100644
--- a/src/esp/sensor/AudioSensor.cpp
+++ b/src/esp/sensor/AudioSensor.cpp
@@ -144,8 +144,11 @@ void AudioSensor::runSimulation(sim::Simulator& sim) {
     newSource_ = false;
     ESP_DEBUG() << logHeader_
                 << "Adding source at position : " << lastSourcePos_;
+    // Magnum::Vector3 is zero-indexed.  Using [1], [2], [3] silently dropped
+    // the world-x coordinate and read one float out of bounds, corrupting all
+    // rendered source positions and therefore the FOA direction labels.
     audioSimulator_->AddSource(RLRAudioPropagation::Vector3f{
-        lastSourcePos_[1], lastSourcePos_[2], lastSourcePos_[3]});
+        lastSourcePos_[0], lastSourcePos_[1], lastSourcePos_[2]});
   }
 
   // Run the audio simulation