提交 45c90146 编写于 作者: M Mr.doob

Updated builds.

上级 00b6a878
......@@ -23,7 +23,7 @@ if ( Math.sign === undefined ) {
return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : 0;
};
}
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
......@@ -25033,7 +25033,7 @@ THREE.Audio.prototype.load = function ( file ) {
scope.source.buffer = buffer;
scope.source.connect( scope.panner );
scope.source.start();
scope.source.start( 0 );
} );
......@@ -25044,6 +25044,12 @@ THREE.Audio.prototype.load = function ( file ) {
};
THREE.Audio.prototype.setLoop = function ( value ) {
this.source.loop = value;
};
THREE.Audio.prototype.setRefDistance = function ( value ) {
this.panner.refDistance = value;
......@@ -25057,7 +25063,7 @@ THREE.Audio.prototype.setRolloffFactor = function ( value ) {
};
THREE.Audio.prototype.updateMatrixWorld = ( function () {
var position = new THREE.Vector3();
return function ( force ) {
......@@ -25084,7 +25090,7 @@ THREE.AudioListener = function () {
this.type = 'AudioListener';
this.context = new AudioContext();
this.context = new ( window.AudioContext || window.webkitAudioContext )();
};
......@@ -25102,7 +25108,7 @@ THREE.AudioListener.prototype.updateMatrixWorld = ( function () {
var positionPrev = new THREE.Vector3();
return function ( force ) {
THREE.Object3D.prototype.updateMatrixWorld.call( this, force );
var listener = this.context.listener;
......
......@@ -587,8 +587,8 @@ THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegme
void 0,t=a[f[k]].x,s=a[f[k]].y,p=a[f[m]].x,v=a[f[m]].y,w=a[f[n]].x,u=a[f[n]].y;if(1E-10>(p-t)*(u-s)-(v-s)*(w-t))r=!1;else{var G=void 0,C=void 0,B=void 0,y=void 0,D=void 0,J=void 0,N=void 0,Q=void 0,E=void 0,da=void 0,E=Q=N=x=A=void 0,G=w-p,C=u-v,B=t-w,y=s-u,D=p-t,J=v-s;for(r=0;r<e;r++)if(A=a[f[r]].x,x=a[f[r]].y,!(A===t&&x===s||A===p&&x===v||A===w&&x===u)&&(N=A-t,Q=x-s,E=A-p,da=x-v,A-=w,x-=u,E=G*da-C*E,N=D*Q-J*N,Q=B*x-y*A,-1E-10<=E&&-1E-10<=Q&&-1E-10<=N)){r=!1;break a}r=!0}}if(r){g.push([a[f[k]],a[f[m]],
a[f[n]]]);h.push([f[k],f[m],f[n]]);k=m;for(n=m+1;n<e;k++,n++)f[k]=f[n];e--;q=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;
THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain)};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);
THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.source.connect(b.panner);b.source.start()})};c.send();return this};THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a};THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a};
THREE.Audio.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3;return function(b){THREE.Object3D.prototype.updateMatrixWorld.call(this,b);a.setFromMatrixPosition(this.matrixWorld);this.panner.setPosition(a.x,a.y,a.z)}}();THREE.AudioListener=function(){THREE.Object3D.call(this);this.type="AudioListener";this.context=new AudioContext};THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype);
THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.source.connect(b.panner);b.source.start(0)})};c.send();return this};THREE.Audio.prototype.setLoop=function(a){this.source.loop=a};THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a};THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a};
THREE.Audio.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3;return function(b){THREE.Object3D.prototype.updateMatrixWorld.call(this,b);a.setFromMatrixPosition(this.matrixWorld);this.panner.setPosition(a.x,a.y,a.z)}}();THREE.AudioListener=function(){THREE.Object3D.call(this);this.type="AudioListener";this.context=new (window.AudioContext||window.webkitAudioContext)};THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype);
THREE.AudioListener.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3;return function(f){THREE.Object3D.prototype.updateMatrixWorld.call(this,f);f=this.context.listener;this.matrixWorld.decompose(a,b,c);d.set(0,0,-1).applyQuaternion(b);e.subVectors(a,g);f.setPosition(a.x,a.y,a.z);f.setOrientation(d.x,d.y,d.z,this.up.x,this.up.y,this.up.z);f.setVelocity(e.x,e.y,e.z);g.copy(a)}}();
THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(a){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};
THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,g=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),g+=c.distanceTo(d),b.push(g),d=c;return this.cacheArcLengths=b};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册