From 3afea37044859ae920bef767c85645f8c41234aa Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Mon, 27 Jul 2015 15:01:38 -0400 Subject: [PATCH] Updated builds. --- build/three.js | 99 +++++++++++++++++++++++++++++++++++++++++++++- build/three.min.js | 13 +++--- 2 files changed, 106 insertions(+), 6 deletions(-) diff --git a/build/three.js b/build/three.js index 66876cad57..2d84562b1a 100644 --- a/build/three.js +++ b/build/three.js @@ -27493,6 +27493,7 @@ THREE.Audio = function ( listener ) { this.autoplay = false; this.startTime = 0; + this.playbackRate = 1; this.isPlaying = false; }; @@ -27538,13 +27539,15 @@ THREE.Audio.prototype.play = function () { source.buffer = this.source.buffer; source.loop = this.source.loop; source.onended = this.source.onended; - source.connect( this.panner ); source.start( 0, this.startTime ); + source.playbackRate.value = this.playbackRate; this.isPlaying = true; this.source = source; + this.connect(); + }; THREE.Audio.prototype.pause = function () { @@ -27561,6 +27564,76 @@ THREE.Audio.prototype.stop = function () { }; +THREE.Audio.prototype.connect = function () { + + if ( this.filter !== undefined ) { + + this.source.connect( this.filter ); + this.filter.connect( this.panner ); + + } else { + + this.source.connect( this.panner ); + + } + +}; + +THREE.Audio.prototype.disconnect = function () { + + if ( this.filter !== undefined ) { + + this.source.disconnect( this.filter ); + this.filter.disconnect( this.panner ); + + } else { + + this.source.disconnect( this.panner ); + + } + +}; + +THREE.Audio.prototype.setFilter = function ( value ) { + + if ( this.isPlaying === true ) { + + this.disconnect(); + this.filter = value; + this.connect(); + + } else { + + this.filter = value; + + } + +}; + +THREE.Audio.prototype.getFilter = function () { + + return this.filter; + +}; + +THREE.Audio.prototype.setPlaybackRate = function ( value ) { + + this.playbackRate = value; + + if ( this.isPlaying === true ) { + + this.source.playbackRate.value = this.playbackRate; + + } + +}; + +THREE.Audio.prototype.getPlaybackRate = function () { + + return this.playbackRate; + +}; + THREE.Audio.prototype.onEnded = function() { this.isPlaying = false; @@ -27573,24 +27646,48 @@ THREE.Audio.prototype.setLoop = function ( value ) { }; +THREE.Audio.prototype.getLoop = function () { + + return this.source.loop; + +}; + THREE.Audio.prototype.setRefDistance = function ( value ) { this.panner.refDistance = value; }; +THREE.Audio.prototype.getRefDistance = function () { + + return this.panner.refDistance; + +}; + THREE.Audio.prototype.setRolloffFactor = function ( value ) { this.panner.rolloffFactor = value; }; +THREE.Audio.prototype.getRolloffFactor = function () { + + return this.panner.rolloffFactor; + +}; + THREE.Audio.prototype.setVolume = function ( value ) { this.gain.gain.value = value; }; +THREE.Audio.prototype.getVolume = function () { + + return this.gain.gain.value; + +}; + THREE.Audio.prototype.updateMatrixWorld = ( function () { var position = new THREE.Vector3(); diff --git a/build/three.min.js b/build/three.min.js index 7699ce451b..82e44504ac 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -666,11 +666,14 @@ THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegme (function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;fe)return null;var g=[],f=[],h=[],k,l,n;if(0=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var m;a:{var q=m=void 0,t=void 0,s=void 0, u=void 0,x=void 0,v=void 0,A=void 0,y=void 0,q=a[f[k]].x,t=a[f[k]].y,s=a[f[l]].x,u=a[f[l]].y,x=a[f[n]].x,v=a[f[n]].y;if(1E-10>(s-q)*(v-t)-(u-t)*(x-q))m=!1;else{var G=void 0,H=void 0,w=void 0,B=void 0,I=void 0,D=void 0,z=void 0,Q=void 0,F=void 0,E=void 0,F=Q=z=y=A=void 0,G=x-s,H=v-u,w=q-x,B=t-v,I=s-q,D=u-t;for(m=0;m