Skip to content

Commit

Permalink
Fix TRACE logging in AudioEngine.cpp when no heading is available
Browse files Browse the repository at this point in the history
  • Loading branch information
davecraig committed Feb 20, 2025
1 parent a93ec02 commit 8e01e4e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/src/main/cpp/AudioEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,14 @@ const BeaconDescriptor AudioEngine::msc_BeaconDescriptors[] =
m_LastHeading = listenerHeading;

// Set listener direction
auto rads = static_cast<float>((listenerHeading * M_PI) / 180.0);
FMOD_VECTOR forward = {sin(rads), 0.0f, cos(rads)};

FMOD_VECTOR forward = {0.0f, 0.0f, 1.0f};
if(!isnan(listenerHeading))
{
auto rads = static_cast<float>((listenerHeading * M_PI) / 180.0);
forward = {sin(rads), 0.0f, cos(rads)};
}
//TRACE("heading: %d %f, %f %f", heading, rads, forward.x, forward.z)

{
// Each time through we need to:
//
Expand Down

0 comments on commit 8e01e4e

Please # to comment.