提交 438c7b19 编写于 作者: M Mr.doob

Audio: Backwards compatibility.

上级 87738cb6
......@@ -2,6 +2,19 @@
* @author mrdoob / http://mrdoob.com/
*/
Object.defineProperties( THREE.Audio.prototype, {
setRefDistance: {
value: function () {
console.warn( 'THREE.Audio: .setRefDistance() has been moved to THREE.PositionalAudio.' );
}
},
setRolloffFactor: {
value: function () {
console.warn( 'THREE.Audio: .setRolloffFactor() has been moved to THREE.PositionalAudio.' );
}
}
} );
Object.defineProperties( THREE.Box2.prototype, {
isIntersectionBox: {
value: function ( box ) {
......
......@@ -22,6 +22,7 @@ THREE.Audio = function ( listener ) {
this.isPlaying = false;
this.hasPlaybackControl = true;
this.sourceType = 'empty';
this.filter = null;
};
......@@ -161,8 +162,16 @@ THREE.Audio.prototype.disconnect = function () {
};
THREE.Audio.prototype.getFilter = function () {
return this.filter;
};
THREE.Audio.prototype.setFilter = function ( value ) {
if ( value === undefined ) value = null;
if ( this.isPlaying === true ) {
this.disconnect();
......@@ -177,12 +186,6 @@ THREE.Audio.prototype.setFilter = function ( value ) {
};
THREE.Audio.prototype.getFilter = function () {
return this.filter;
};
THREE.Audio.prototype.setPlaybackRate = function ( value ) {
if ( this.hasPlaybackControl === false ) {
......
......@@ -10,7 +10,8 @@ THREE.AudioListener = function () {
this.context = new ( window.AudioContext || window.webkitAudioContext )();
this.masterGain = this.context.createGain();
this.masterGain.connect(this.context.destination);
this.masterGain.connect( this.context.destination );
this.filter = null;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册