diff --git a/docs/api/audio/PositionalAudio.html b/docs/api/audio/PositionalAudio.html
index cf6a0d4578f863709e35942e5c8b14ee0808e5dd..7d6fcbb461835346a05faa985005467c584fd52e 100644
--- a/docs/api/audio/PositionalAudio.html
+++ b/docs/api/audio/PositionalAudio.html
@@ -88,7 +88,7 @@
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance].
- [method:PositionalAudio setRefDistance]( [param:Number value] )
+ [method:PositionalAudio setRefDistance]( [param:Float value] )
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance].
@@ -98,7 +98,7 @@
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor].
- [method:PositionalAudio setRolloffFactor]( [param:Number value] )
+ [method:PositionalAudio setRolloffFactor]( [param:Float value] )
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor].
@@ -118,11 +118,16 @@
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.maxDistance].
- [method:PositionalAudio setMaxDistance]( [param:Number value] )
+ [method:PositionalAudio setMaxDistance]( [param:Float value] )
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.maxDistance].
+ [method:PositionalAudio setDirectionalCone]( [param:Float coneInnerAngle], [param:Float coneOuterAngle], [param:Float coneOuterGain] )
+
+ This method can be used in order to transform an omnidirectional sound into a [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode directional sound].
+
+
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
diff --git a/examples/webaudio_orientation.html b/examples/webaudio_orientation.html
index 8b3c14ffa52b73d330e742bfbbb23aa13b77ac98..de7426104eb0cfca8c1358c20bb64e68982618e2 100644
--- a/examples/webaudio_orientation.html
+++ b/examples/webaudio_orientation.html
@@ -158,12 +158,7 @@
var positionalAudio = new THREE.PositionalAudio( listener );
positionalAudio.setMediaElementSource( audioElement );
positionalAudio.setRefDistance( 1 );
-
- // configure directionality cone, see https://developer.mozilla.org/en-US/docs/Web/API/PannerNode
-
- positionalAudio.panner.coneInnerAngle = 210;
- positionalAudio.panner.coneOuterAngle = 230;
- positionalAudio.panner.coneOuterGain = 0.1;
+ positionalAudio.setDirectionalCone( 210, 230, 0.1 );
//
diff --git a/src/audio/PositionalAudio.js b/src/audio/PositionalAudio.js
index 21b721f9e2d09a9c7e4877fa1cbe866acc603b20..c37c75fc2a900b569931c2725575887fc2445deb 100644
--- a/src/audio/PositionalAudio.js
+++ b/src/audio/PositionalAudio.js
@@ -82,6 +82,16 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), {
},
+ setDirectionalCone: function ( coneInnerAngle, coneOuterAngle, coneOuterGain ) {
+
+ this.panner.coneInnerAngle = coneInnerAngle;
+ this.panner.coneOuterAngle = coneOuterAngle;
+ this.panner.coneOuterGain = coneOuterGain;
+
+ return this;
+
+ },
+
updateMatrixWorld: ( function () {
var position = new Vector3();