summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/audio
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/audio')
-rw-r--r--WebCore/platform/audio/Cone.cpp8
-rw-r--r--WebCore/platform/audio/Cone.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/WebCore/platform/audio/Cone.cpp b/WebCore/platform/audio/Cone.cpp
index 843b3cc..91813ab 100644
--- a/WebCore/platform/audio/Cone.cpp
+++ b/WebCore/platform/audio/Cone.cpp
@@ -41,20 +41,20 @@ ConeEffect::ConeEffect()
{
}
-double ConeEffect::gain(FloatPoint3D sourcePosition, FloatPoint3D sourceOrientation, FloatPoint3D listenerPosition)
+double ConeEffect::gain(Vector3 sourcePosition, Vector3 sourceOrientation, Vector3 listenerPosition)
{
if (sourceOrientation.isZero() || ((m_innerAngle == 360.0) && (m_outerAngle == 360.0)))
return 1.0; // no cone specified - unity gain
// Normalized source-listener vector
- FloatPoint3D sourceToListener = listenerPosition - sourcePosition;
+ Vector3 sourceToListener = listenerPosition - sourcePosition;
sourceToListener.normalize();
- FloatPoint3D normalizedSourceOrientation = sourceOrientation;
+ Vector3 normalizedSourceOrientation = sourceOrientation;
normalizedSourceOrientation.normalize();
// Angle between the source orientation vector and the source-listener vector
- double dotProduct = sourceToListener.dot(normalizedSourceOrientation);
+ double dotProduct = dot(sourceToListener, normalizedSourceOrientation);
double angle = 180.0 * acos(dotProduct) / M_PI;
double absAngle = fabs(angle);
diff --git a/WebCore/platform/audio/Cone.h b/WebCore/platform/audio/Cone.h
index f566018..9936f28 100644
--- a/WebCore/platform/audio/Cone.h
+++ b/WebCore/platform/audio/Cone.h
@@ -29,7 +29,7 @@
#ifndef Cone_h
#define Cone_h
-#include "FloatPoint3D.h"
+#include <wtf/Vector3.h>
namespace WebCore {
@@ -40,7 +40,7 @@ public:
ConeEffect();
// Returns scalar gain for the given source/listener positions/orientations
- double gain(FloatPoint3D sourcePosition, FloatPoint3D sourceOrientation, FloatPoint3D listenerPosition);
+ double gain(Vector3 sourcePosition, Vector3 sourceOrientation, Vector3 listenerPosition);
// Angles in degrees
void setInnerAngle(double innerAngle) { m_innerAngle = innerAngle; }