diff --git a/Source/main.cpp b/Source/main.cpp index 259895fe00..65f93260a3 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -257,11 +257,10 @@ void display_stats(void) #endif char adc[200]; - sprintf(adc, "location = %3.1f,%3.1f,%3.1f, angle_to 0,0,0 = %3.1f, head yaw = %3.1f, render_yaw = %3.1f, together = %3.1f", + sprintf(adc, "location = %3.1f,%3.1f,%3.1f, angle_to(origin) = %3.1f, head yaw = %3.1f, render_yaw = %3.1f", -location[0], -location[1], -location[2], - azimuth_to(myHead.getPos()*-1.f, glm::vec3(0,0,0)), - myHead.getYaw(), render_yaw, - angle_to(myHead.getPos()*-1.f, glm::vec3(0,0,0), render_yaw, myHead.getYaw()) + angle_to(myHead.getPos()*-1.f, glm::vec3(0,0,0), render_yaw, myHead.getYaw()), + myHead.getYaw(), render_yaw ); drawtext(10, 50, 0.10, 0, 1.0, 0, adc); diff --git a/Source/util.cpp b/Source/util.cpp index 2460c38477..d33ac70c66 100644 --- a/Source/util.cpp +++ b/Source/util.cpp @@ -19,12 +19,12 @@ float randFloat () { return (rand()%10000)/10000.f; } -// Return the azimuth angle in degrees between a head position and a sound source, -// given the two positions. +// Return the azimuth angle in degrees between two points. float azimuth_to(glm::vec3 head_pos, glm::vec3 source_pos) { return atan2(head_pos.x - source_pos.x, head_pos.z - source_pos.z) * 180 / PI; } +// Return the angle in degrees between the head and an object in the scene. The value is zero if you are looking right at it. The angle is negative if the object is to your right. float angle_to(glm::vec3 head_pos, glm::vec3 source_pos, float render_yaw, float head_yaw) { return atan2(head_pos.x - source_pos.x, head_pos.z - source_pos.z) * 180 / PI + render_yaw + head_yaw; } diff --git a/interface.xcodeproj/project.xcworkspace/xcuserdata/philip.xcuserdatad/UserInterfaceState.xcuserstate b/interface.xcodeproj/project.xcworkspace/xcuserdata/philip.xcuserdatad/UserInterfaceState.xcuserstate index 6bafe1889d..0cd3691198 100644 Binary files a/interface.xcodeproj/project.xcworkspace/xcuserdata/philip.xcuserdatad/UserInterfaceState.xcuserstate and b/interface.xcodeproj/project.xcworkspace/xcuserdata/philip.xcuserdatad/UserInterfaceState.xcuserstate differ