b=907986 part 3 fold-in 1 remove normalize of unit vector r=padenot a=webaudio
authorKarl Tomlinson <ktomlinsom@mozilla.com>
Tue, 03 Sep 2013 11:00:51 +0200
changeset 153939 0177db952fd3d74453eb92e31a2cef94432c462a
parent 153938 aeac941ac51768a4a0a790d7319108cfc9bc457c
child 153940 889ee00342d67fcfcb7f94c7f28b054f2bcb7c72
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, webaudio
bugs907986
milestone25.0a2
b=907986 part 3 fold-in 1 remove normalize of unit vector r=padenot a=webaudio
content/media/webaudio/PannerNode.cpp
--- a/content/media/webaudio/PannerNode.cpp
+++ b/content/media/webaudio/PannerNode.cpp
@@ -438,21 +438,18 @@ PannerNodeEngine::ComputeConeGain()
   if (mOrientation.IsZero() || ((mConeInnerAngle == 360) && (mConeOuterAngle == 360))) {
     return 1;
   }
 
   // Normalized source-listener vector
   ThreeDPoint sourceToListener = mListenerPosition - mPosition;
   sourceToListener.Normalize();
 
-  ThreeDPoint normalizedSourceOrientation = mOrientation;
-  normalizedSourceOrientation.Normalize();
-
   // Angle between the source orientation vector and the source-listener vector
-  double dotProduct = sourceToListener.DotProduct(normalizedSourceOrientation);
+  double dotProduct = sourceToListener.DotProduct(mOrientation);
   double angle = 180 * acos(dotProduct) / M_PI;
   double absAngle = fabs(angle);
 
   // Divide by 2 here since API is entire angle (not half-angle)
   double absInnerAngle = fabs(mConeInnerAngle) / 2;
   double absOuterAngle = fabs(mConeOuterAngle) / 2;
   double gain = 1;