|
@@ -35,13 +35,14 @@ multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multi
|
|
|
return a.applyQuaternion(this)},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,g=this._w,f=g*a._w+c*a._x+d*a._y+e*a._z;0>f?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,f=-f):this.copy(a);if(1<=f)return this._w=g,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(f),l=Math.sqrt(1-f*f);if(.001>Math.abs(l))return this._w=.5*(g+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;f=Math.sin((1-b)*h)/l;h=
|
|
|
Math.sin(b*h)/l;this._w=g*f+this._w*h;this._x=c*f+this._x*h;this._y=d*f+this._y*h;this._z=e*f+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3];this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onChange:function(a){this.onChangeCallback=
|
|
|
a;return this},onChangeCallback:function(){}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
|
|
|
-THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y)},
|
|
|
-copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
|
|
|
-this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=
|
|
|
-a.y);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);return this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2);a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);
|
|
|
-this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+
|
|
|
-Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},lerpVectors:function(a,b,c){this.subVectors(b,a).multiplyScalar(c).add(a);return this},equals:function(a){return a.x===
|
|
|
-this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];return this}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0};
|
|
|
+THREE.Vector2.prototype={constructor:THREE.Vector2,get width(){return this.x},set width(a){this.x=a},get height(){return this.y},set height(a){this.y=a},set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+
|
|
|
+a);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;return this},
|
|
|
+sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){0!==
|
|
|
+a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);return this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2);a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),floor:function(){this.x=
|
|
|
+Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*
|
|
|
+this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=
|
|
|
+(a.y-this.y)*b;return this},lerpVectors:function(a,b,c){this.subVectors(b,a).multiplyScalar(c).add(a);return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];return this}};
|
|
|
+THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0};
|
|
|
THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+
|
|
|
a);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addScaledVector:function(a,
|
|
|
b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
|
|
@@ -106,8 +107,8 @@ e=Math.sin(e);if("XYZ"===a.order){a=g*h;var l=g*e,k=c*h,n=c*e;b[0]=f*h;b[4]=-f*e
|
|
|
n*d+a,b[9]=l*d-k,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,l=g*d,k=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=k*e+l,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+k,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,l=g*d,k=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=l*e-k,b[2]=k*e-l,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");
|
|
|
return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,l=e+e;a=c*f;var k=c*h,c=c*l,n=d*h,d=d*l,e=e*l,f=g*f,h=g*h,g=g*l;b[0]=1-(n+e);b[4]=k-g;b[8]=c+h;b[1]=k+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);
|
|
|
var f=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,
|
|
|
-b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],l=c[12],k=c[1],n=c[5],p=c[9],m=c[13],q=c[2],t=c[6],s=c[10],u=c[14],x=c[3],v=c[7],D=c[11],c=c[15],w=d[0],A=d[4],E=d[8],z=d[12],B=d[1],O=d[5],G=d[9],C=d[13],M=d[2],K=d[6],L=d[10],J=d[14],y=d[3],H=d[7],P=d[11],d=d[15];e[0]=g*w+f*B+h*M+l*y;e[4]=g*A+f*O+h*K+l*H;e[8]=g*E+f*G+h*L+l*P;e[12]=g*z+f*C+h*J+l*d;e[1]=k*w+n*B+p*M+m*y;e[5]=k*A+n*O+p*K+m*H;e[9]=k*E+n*G+p*L+m*P;e[13]=k*z+n*C+p*J+m*d;e[2]=q*w+t*B+s*M+u*y;e[6]=q*A+t*O+s*K+u*H;e[10]=
|
|
|
-q*E+t*G+s*L+u*P;e[14]=q*z+t*C+s*J+u*d;e[3]=x*w+v*B+D*M+c*y;e[7]=x*A+v*O+D*K+c*H;e[11]=x*E+v*G+D*L+c*P;e[15]=x*z+v*C+D*J+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=
|
|
|
+b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],l=c[12],k=c[1],n=c[5],p=c[9],m=c[13],q=c[2],t=c[6],s=c[10],u=c[14],x=c[3],v=c[7],D=c[11],c=c[15],w=d[0],A=d[4],B=d[8],z=d[12],y=d[1],L=d[5],G=d[9],C=d[13],N=d[2],M=d[6],O=d[10],K=d[14],E=d[3],J=d[7],Q=d[11],d=d[15];e[0]=g*w+f*y+h*N+l*E;e[4]=g*A+f*L+h*M+l*J;e[8]=g*B+f*G+h*O+l*Q;e[12]=g*z+f*C+h*K+l*d;e[1]=k*w+n*y+p*N+m*E;e[5]=k*A+n*L+p*M+m*J;e[9]=k*B+n*G+p*O+m*Q;e[13]=k*z+n*C+p*K+m*d;e[2]=q*w+t*y+s*N+u*E;e[6]=q*A+t*L+s*M+u*J;e[10]=
|
|
|
+q*B+t*G+s*O+u*Q;e[14]=q*z+t*C+s*K+u*d;e[3]=x*w+v*y+D*N+c*E;e[7]=x*A+v*L+D*M+c*J;e[11]=x*B+v*G+D*O+c*Q;e[15]=x*z+v*C+D*K+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=
|
|
|
a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
|
|
|
return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
|
|
|
a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],l=a[13],k=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*l*
|
|
@@ -308,10 +309,9 @@ THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.Pe
|
|
|
THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var a=THREE.Math.radToDeg(2*Math.atan(Math.tan(.5*THREE.Math.degToRad(this.fov))/this.zoom));if(this.fullWidth){var b=this.fullWidth/this.fullHeight,a=Math.tan(THREE.Math.degToRad(.5*a))*this.near,c=-a,d=b*c,b=Math.abs(b*a-d),c=Math.abs(a-c);this.projectionMatrix.makeFrustum(d+this.x*b/this.fullWidth,d+(this.x+this.width)*b/this.fullWidth,a-(this.y+this.height)*c/this.fullHeight,a-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(a,
|
|
|
this.aspect,this.near,this.far)};THREE.PerspectiveCamera.prototype.copy=function(a){THREE.Camera.prototype.copy.call(this,a);this.fov=a.fov;this.aspect=a.aspect;this.near=a.near;this.far=a.far;this.zoom=a.zoom;return this};THREE.PerspectiveCamera.prototype.toJSON=function(a){a=THREE.Object3D.prototype.toJSON.call(this,a);a.object.zoom=this.zoom;a.object.fov=this.fov;a.object.aspect=this.aspect;a.object.near=this.near;a.object.far=this.far;return a};
|
|
|
THREE.Light=function(a){THREE.Object3D.call(this);this.type="Light";this.color=new THREE.Color(a);this.receiveShadow=void 0};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.Light.prototype.constructor=THREE.Light;
|
|
|
-Object.defineProperties(THREE.Light.prototype,{onlyShadow:{set:function(a){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCamera:{get:function(){return this.shadow.camera}},shadowCameraFov:{get:function(){return this.shadow.camera.fov},set:function(a){this.shadow.camera.fov=a}},shadowCameraLeft:{get:function(){return this.shadow.camera.left},set:function(a){this.shadow.camera.left=a}},shadowCameraRight:{get:function(){return this.shadow.camera.right},set:function(a){this.shadow.camera.right=
|
|
|
-a}},shadowCameraTop:{get:function(){return this.shadow.camera.top},set:function(a){this.shadow.camera.top=a}},shadowCameraBottom:{get:function(){return this.shadow.camera.bottom},set:function(a){this.shadow.camera.bottom=a}},shadowCameraNear:{get:function(){return this.shadow.camera.near},set:function(a){this.shadow.camera.near=a}},shadowCameraFar:{get:function(){return this.shadow.camera.far},set:function(a){this.shadow.camera.far=a}},shadowCameraVisible:{set:function(a){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow ) instead.")}},
|
|
|
-shadowBias:{get:function(){return this.shadow.bias},set:function(a){this.shadow.bias=a}},shadowDarkness:{get:function(){return this.shadow.darkness},set:function(a){this.shadow.darkness=a}},shadowMap:{get:function(){return this.shadow.map},set:function(a){this.shadow.map=a}},shadowMapWidth:{get:function(){return this.shadow.mapSize.x},set:function(a){this.shadow.mapSize.x=a}},shadowMapHeight:{get:function(){return this.shadow.mapSize.y},set:function(a){this.shadow.mapSize.y=a}},shadowMatrix:{get:function(){return this.shadow.matrix},
|
|
|
-set:function(a){this.shadow.matrix=a}}});THREE.Light.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.color.copy(a.color);return this};
|
|
|
+Object.defineProperties(THREE.Light.prototype,{onlyShadow:{set:function(a){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(a){this.shadow.camera.fov=a}},shadowCameraLeft:{set:function(a){this.shadow.camera.left=a}},shadowCameraRight:{set:function(a){this.shadow.camera.right=a}},shadowCameraTop:{set:function(a){this.shadow.camera.top=a}},shadowCameraBottom:{set:function(a){this.shadow.camera.bottom=a}},shadowCameraNear:{set:function(a){this.shadow.camera.near=
|
|
|
+a}},shadowCameraFar:{set:function(a){this.shadow.camera.far=a}},shadowCameraVisible:{set:function(a){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow ) instead.")}},shadowBias:{set:function(a){this.shadow.bias=a}},shadowDarkness:{set:function(a){this.shadow.darkness=a}},shadowMapWidth:{set:function(a){this.shadow.mapSize.width=a}},shadowMapHeight:{set:function(a){this.shadow.mapSize.height=a}}});
|
|
|
+THREE.Light.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.color.copy(a.color);return this};
|
|
|
THREE.Light.prototype.toJSON=function(a){a=THREE.Object3D.prototype.toJSON.call(this,a);a.object.color=this.color.getHex();void 0!==this.groundColor&&(a.object.groundColor=this.groundColor.getHex());void 0!==this.intensity&&(a.object.intensity=this.intensity);void 0!==this.distance&&(a.object.distance=this.distance);void 0!==this.angle&&(a.object.angle=this.angle);void 0!==this.decay&&(a.object.decay=this.decay);void 0!==this.exponent&&(a.object.exponent=this.exponent);return a};
|
|
|
THREE.LightShadow=function(a){this.camera=a;this.bias=0;this.darkness=.5;this.mapSize=new THREE.Vector2(512,512);this.matrix=this.map=null};THREE.LightShadow.prototype={constructor:THREE.LightShadow,copy:function(a){this.camera=a.camera.clone();this.bias=a.bias;this.darkness=a.darkness;this.mapSize.copy(a.mapSize)},clone:function(){return(new this.constructor).copy(this)}};THREE.AmbientLight=function(a){THREE.Light.call(this,a);this.type="AmbientLight"};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);
|
|
|
THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.type="DirectionalLight";this.position.set(0,1,0);this.updateMatrix();this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.shadow=new THREE.LightShadow(new THREE.OrthographicCamera(-500,500,500,-500,50,5E3))};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
|
|
@@ -437,10 +437,10 @@ THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.mor
|
|
|
THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
|
|
|
THREE.Mesh.prototype.raycast=function(){function a(a,b,c,d,e,f,g){THREE.Triangle.barycoordFromPoint(a,b,c,d,s);e.multiplyScalar(s.x);f.multiplyScalar(s.y);g.multiplyScalar(s.z);e.add(f).add(g);return e.clone()}function b(a,b,c,d,e,f,g){var h=a.material;if(null===(h.side===THREE.BackSide?c.intersectTriangle(f,e,d,!0,g):c.intersectTriangle(d,e,f,h.side!==THREE.DoubleSide,g)))return null;x.copy(g);x.applyMatrix4(a.matrixWorld);c=b.ray.origin.distanceTo(x);return c<b.near||c>b.far?null:{distance:c,point:x.clone(),
|
|
|
object:a}}function c(c,d,e,g,k,n,p,s){f.fromArray(g,3*n);h.fromArray(g,3*p);l.fromArray(g,3*s);if(c=b(c,d,e,f,h,l,u))k&&(m.fromArray(k,2*n),q.fromArray(k,2*p),t.fromArray(k,2*s),c.uv=a(u,f,h,l,m,q,t)),c.face=new THREE.Face3(n,p,s,THREE.Triangle.normal(f,h,l)),c.faceIndex=n;return c}var d=new THREE.Matrix4,e=new THREE.Ray,g=new THREE.Sphere,f=new THREE.Vector3,h=new THREE.Vector3,l=new THREE.Vector3,k=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector2,q=new THREE.Vector2,
|
|
|
-t=new THREE.Vector2,s=new THREE.Vector3,u=new THREE.Vector3,x=new THREE.Vector3;return function(s,x){var w=this.geometry,A=this.material;if(void 0!==A){null===w.boundingSphere&&w.computeBoundingSphere();var E=this.matrixWorld;g.copy(w.boundingSphere);g.applyMatrix4(E);if(!1!==s.ray.isIntersectionSphere(g)&&(d.getInverse(E),e.copy(s.ray).applyMatrix4(d),null===w.boundingBox||!1!==e.isIntersectionBox(w.boundingBox))){var z,B;if(w instanceof THREE.BufferGeometry){var O,G,A=w.index,E=w.attributes,w=E.position.array;
|
|
|
-void 0!==E.uv&&(z=E.uv.array);if(null!==A)for(var E=A.array,C=0,M=E.length;C<M;C+=3){if(A=E[C],O=E[C+1],G=E[C+2],B=c(this,s,e,w,z,A,O,G))B.faceIndex=Math.floor(C/3),x.push(B)}else for(C=0,M=w.length;C<M;C+=9)if(A=C/3,O=A+1,G=A+2,B=c(this,s,e,w,z,A,O,G))B.index=A,x.push(B)}else if(w instanceof THREE.Geometry){var K,L,E=A instanceof THREE.MeshFaceMaterial,C=!0===E?A.materials:null,M=w.vertices;O=w.faces;G=w.faceVertexUvs[0];0<G.length&&(z=G);for(var J=0,y=O.length;J<y;J++){var H=O[J];B=!0===E?C[H.materialIndex]:
|
|
|
-A;if(void 0!==B){G=M[H.a];K=M[H.b];L=M[H.c];if(!0===B.morphTargets){B=w.morphTargets;var P=this.morphTargetInfluences;f.set(0,0,0);h.set(0,0,0);l.set(0,0,0);for(var T=0,Q=B.length;T<Q;T++){var R=P[T];if(0!==R){var F=B[T].vertices;f.addScaledVector(k.subVectors(F[H.a],G),R);h.addScaledVector(n.subVectors(F[H.b],K),R);l.addScaledVector(p.subVectors(F[H.c],L),R)}}f.add(G);h.add(K);l.add(L);G=f;K=h;L=l}if(B=b(this,s,e,G,K,L,u))z&&(P=z[J],m.copy(P[0]),q.copy(P[1]),t.copy(P[2]),B.uv=a(u,G,K,L,m,q,t)),B.face=
|
|
|
-H,B.faceIndex=J,x.push(B)}}}}}}}();THREE.Mesh.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
|
|
|
+t=new THREE.Vector2,s=new THREE.Vector3,u=new THREE.Vector3,x=new THREE.Vector3;return function(s,x){var w=this.geometry,A=this.material;if(void 0!==A){null===w.boundingSphere&&w.computeBoundingSphere();var B=this.matrixWorld;g.copy(w.boundingSphere);g.applyMatrix4(B);if(!1!==s.ray.isIntersectionSphere(g)&&(d.getInverse(B),e.copy(s.ray).applyMatrix4(d),null===w.boundingBox||!1!==e.isIntersectionBox(w.boundingBox))){var z,y;if(w instanceof THREE.BufferGeometry){var L,G,A=w.index,B=w.attributes,w=B.position.array;
|
|
|
+void 0!==B.uv&&(z=B.uv.array);if(null!==A)for(var B=A.array,C=0,N=B.length;C<N;C+=3){if(A=B[C],L=B[C+1],G=B[C+2],y=c(this,s,e,w,z,A,L,G))y.faceIndex=Math.floor(C/3),x.push(y)}else for(C=0,N=w.length;C<N;C+=9)if(A=C/3,L=A+1,G=A+2,y=c(this,s,e,w,z,A,L,G))y.index=A,x.push(y)}else if(w instanceof THREE.Geometry){var M,O,B=A instanceof THREE.MeshFaceMaterial,C=!0===B?A.materials:null,N=w.vertices;L=w.faces;G=w.faceVertexUvs[0];0<G.length&&(z=G);for(var K=0,E=L.length;K<E;K++){var J=L[K];y=!0===B?C[J.materialIndex]:
|
|
|
+A;if(void 0!==y){G=N[J.a];M=N[J.b];O=N[J.c];if(!0===y.morphTargets){y=w.morphTargets;var Q=this.morphTargetInfluences;f.set(0,0,0);h.set(0,0,0);l.set(0,0,0);for(var T=0,H=y.length;T<H;T++){var R=Q[T];if(0!==R){var F=y[T].vertices;f.addScaledVector(k.subVectors(F[J.a],G),R);h.addScaledVector(n.subVectors(F[J.b],M),R);l.addScaledVector(p.subVectors(F[J.c],O),R)}}f.add(G);h.add(M);l.add(O);G=f;M=h;O=l}if(y=b(this,s,e,G,M,O,u))z&&(Q=z[K],m.copy(Q[0]),q.copy(Q[1]),t.copy(Q[2]),y.uv=a(u,G,M,O,m,q,t)),y.face=
|
|
|
+J,y.faceIndex=K,x.push(y)}}}}}}}();THREE.Mesh.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
|
|
|
THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(a=Math.sqrt(4*this.bones.length),a=THREE.Math.nextPowerOfTwo(Math.ceil(a)),this.boneTextureHeight=this.boneTextureWidth=a=Math.max(a,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType)):
|
|
|
this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};
|
|
|
THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}};
|
|
@@ -531,7 +531,7 @@ THREE.ShaderChunk.common,"vec4 pack1K ( float depth ) {\n depth /= 1000.0;\n
|
|
|
THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===R&&(a*=d,b*=d,c*=d);r.clearColor(a,b,c,d)}function c(){I.init();r.viewport(na,oa,pa,qa);b(W.r,W.g,W.b,U)}function d(){ra=za=null;sa="";ta=-1;wa=!0;I.reset()}function e(a){a.preventDefault();d();c();X.clear()}function g(a){a=a.target;a.removeEventListener("dispose",g);a:{var b=X.get(a);if(a.image&&b.__image__webglTextureCube)r.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;r.deleteTexture(b.__webglTexture)}X.remove(a)}la.textures--}
|
|
|
function f(a){a=a.target;a.removeEventListener("dispose",f);var b=X.get(a),c=X.get(a.texture);if(a&&void 0!==c.__webglTexture){r.deleteTexture(c.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(c=0;6>c;c++)r.deleteFramebuffer(b.__webglFramebuffer[c]),r.deleteRenderbuffer(b.__webglRenderbuffer[c]);else r.deleteFramebuffer(b.__webglFramebuffer),r.deleteRenderbuffer(b.__webglRenderbuffer);X.remove(a.texture);X.remove(a)}la.textures--}function h(a){a=a.target;a.removeEventListener("dispose",
|
|
|
h);l(a);X.remove(a)}function l(a){var b=X.get(a).program;a.program=void 0;void 0!==b&&ua.releaseProgram(b)}function k(a,b){return b[0]-a[0]}function n(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a,b,c,d,e){var f;c.transparent?
|
|
|
-(d=ea,f=++$):(d=ca,f=++fa);f=d[f];void 0!==f?(f.id=a.id,f.object=a,f.geometry=b,f.material=c,f.z=V.z,f.group=e):(f={id:a.id,object:a,geometry:b,material:c,z:V.z,group:e},d.push(f))}function q(a){if(!1!==a.visible){if(a instanceof THREE.Light)Y.push(a);else if(a instanceof THREE.Sprite)ja.push(a);else if(a instanceof THREE.LensFlare)da.push(a);else if(a instanceof THREE.ImmediateRenderObject)!0===aa.sortObjects&&(V.setFromMatrixPosition(a.matrixWorld),V.applyProjection(xa)),m(a,null,a.material,V.z,
|
|
|
+(d=da,f=++$):(d=ea,f=++fa);f=d[f];void 0!==f?(f.id=a.id,f.object=a,f.geometry=b,f.material=c,f.z=V.z,f.group=e):(f={id:a.id,object:a,geometry:b,material:c,z:V.z,group:e},d.push(f))}function q(a){if(!1!==a.visible){if(a instanceof THREE.Light)Y.push(a);else if(a instanceof THREE.Sprite)ja.push(a);else if(a instanceof THREE.LensFlare)ca.push(a);else if(a instanceof THREE.ImmediateRenderObject)!0===aa.sortObjects&&(V.setFromMatrixPosition(a.matrixWorld),V.applyProjection(xa)),m(a,null,a.material,V.z,
|
|
|
null);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Points)if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),!1===a.frustumCulled||!0===Aa.intersectsObject(a)){var b=a.material;if(!0===b.visible){!0===aa.sortObjects&&(V.setFromMatrixPosition(a.matrixWorld),V.applyProjection(xa));var c=va.update(a);if(b instanceof THREE.MeshFaceMaterial)for(var d=c.groups,e=b.materials,b=0,f=d.length;b<f;b++){var g=d[b],h=e[g.materialIndex];!0===h.visible&&m(a,c,h,V.z,g)}else m(a,
|
|
|
c,b,V.z,null)}}a=a.children;b=0;for(f=a.length;b<f;b++)q(a[b])}}function t(a,b,c,d,e){for(var f=0,g=a.length;f<g;f++){var h=a[f],l=h.object,k=h.geometry,m=void 0===e?h.material:e,h=h.group;l.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l.normalMatrix.getNormalMatrix(l.modelViewMatrix);if(l instanceof THREE.ImmediateRenderObject){s(m);var n=u(b,c,d,m,l);sa="";l.render(function(a){aa.renderBufferImmediate(a,n,m)})}else aa.renderBufferDirect(b,c,d,k,m,l,h)}}function s(a){a.side!==
|
|
|
THREE.DoubleSide?I.enable(r.CULL_FACE):I.disable(r.CULL_FACE);I.setFlipSided(a.side===THREE.BackSide);!0===a.transparent?I.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):I.setBlending(THREE.NoBlending);I.setDepthFunc(a.depthFunc);I.setDepthTest(a.depthTest);I.setDepthWrite(a.depthWrite);I.setColorWrite(a.colorWrite);I.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function u(a,b,c,d,e){ya=0;var f=X.get(d);
|
|
@@ -540,70 +540,70 @@ d.__webglShader=g.__webglShader,n=ua.acquireProgram(d,k,m),g.program=n,d.program
|
|
|
m])}d.needsUpdate=!1}m=n=q=!1;g=f.program;p=g.getUniforms();k=f.__webglShader.uniforms;g.id!==za&&(r.useProgram(g.program),za=g.id,m=n=q=!0);d.id!==ta&&(-1===ta&&(m=!0),ta=d.id,n=!0);if(q||a!==ra)r.uniformMatrix4fv(p.projectionMatrix,!1,a.projectionMatrix.elements),ga.logarithmicDepthBuffer&&r.uniform1f(p.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==ra&&(ra=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&void 0!==p.cameraPosition&&(V.setFromMatrixPosition(a.matrixWorld),
|
|
|
r.uniform3f(p.cameraPosition,V.x,V.y,V.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&void 0!==p.viewMatrix&&r.uniformMatrix4fv(p.viewMatrix,!1,a.matrixWorldInverse.elements);d.skinning&&(e.bindMatrix&&void 0!==p.bindMatrix&&r.uniformMatrix4fv(p.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&void 0!==p.bindMatrixInverse&&r.uniformMatrix4fv(p.bindMatrixInverse,!1,e.bindMatrixInverse.elements),
|
|
|
ga.floatVertexTextures&&e.skeleton&&e.skeleton.useVertexTexture?(void 0!==p.boneTexture&&(q=v(),r.uniform1i(p.boneTexture,q),aa.setTexture(e.skeleton.boneTexture,q)),void 0!==p.boneTextureWidth&&r.uniform1i(p.boneTextureWidth,e.skeleton.boneTextureWidth),void 0!==p.boneTextureHeight&&r.uniform1i(p.boneTextureHeight,e.skeleton.boneTextureHeight)):e.skeleton&&e.skeleton.boneMatrices&&void 0!==p.boneGlobalMatrices&&r.uniformMatrix4fv(p.boneGlobalMatrices,!1,e.skeleton.boneMatrices));if(n){c&&d.fog&&
|
|
|
-(k.fogColor.value=c.color,c instanceof THREE.Fog?(k.fogNear.value=c.near,k.fogFar.value=c.far):c instanceof THREE.FogExp2&&(k.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(wa){var m=!0,s,t=q=0,u=0,w,G,C,y=Ba,A=a.matrixWorldInverse,B=y.directional.colors,H=y.directional.positions,P=y.point.colors,K=y.point.positions,J=y.point.distances,F=y.point.decays,O=y.spot.colors,L=y.spot.positions,I=y.spot.distances,ca=y.spot.directions,
|
|
|
-Q=y.spot.anglesCos,T=y.spot.exponents,R=y.spot.decays,$=y.hemi.skyColors,ea=y.hemi.groundColors,S=y.hemi.positions,fa=0,U=0,da=0,W=0,ma=0,ja=0,Y=0,ia=0,ba=s=0;c=C=ba=0;for(n=b.length;c<n;c++)s=b[c],w=s.color,G=s.intensity,C=s.distance,s instanceof THREE.AmbientLight?s.visible&&(q+=w.r,t+=w.g,u+=w.b):s instanceof THREE.DirectionalLight?(ma+=1,s.visible&&(Z.setFromMatrixPosition(s.matrixWorld),V.setFromMatrixPosition(s.target.matrixWorld),Z.sub(V),Z.transformDirection(A),s=3*fa,H[s+0]=Z.x,H[s+1]=Z.y,
|
|
|
-H[s+2]=Z.z,D(B,s,w,G),fa+=1)):s instanceof THREE.PointLight?(ja+=1,s.visible&&(ba=3*U,D(P,ba,w,G),V.setFromMatrixPosition(s.matrixWorld),V.applyMatrix4(A),K[ba+0]=V.x,K[ba+1]=V.y,K[ba+2]=V.z,J[U]=C,F[U]=0===s.distance?0:s.decay,U+=1)):s instanceof THREE.SpotLight?(Y+=1,s.visible&&(ba=3*da,D(O,ba,w,G),Z.setFromMatrixPosition(s.matrixWorld),V.copy(Z).applyMatrix4(A),L[ba+0]=V.x,L[ba+1]=V.y,L[ba+2]=V.z,I[da]=C,V.setFromMatrixPosition(s.target.matrixWorld),Z.sub(V),Z.transformDirection(A),ca[ba+0]=Z.x,
|
|
|
-ca[ba+1]=Z.y,ca[ba+2]=Z.z,Q[da]=Math.cos(s.angle),T[da]=s.exponent,R[da]=0===s.distance?0:s.decay,da+=1)):s instanceof THREE.HemisphereLight&&(ia+=1,s.visible&&(Z.setFromMatrixPosition(s.matrixWorld),Z.transformDirection(A),C=3*W,S[C+0]=Z.x,S[C+1]=Z.y,S[C+2]=Z.z,w=s.color,s=s.groundColor,D($,C,w,G),D(ea,C,s,G),W+=1));c=3*fa;for(n=Math.max(B.length,3*ma);c<n;c++)B[c]=0;c=3*U;for(n=Math.max(P.length,3*ja);c<n;c++)P[c]=0;c=3*da;for(n=Math.max(O.length,3*Y);c<n;c++)O[c]=0;c=3*W;for(n=Math.max($.length,
|
|
|
-3*ia);c<n;c++)$[c]=0;c=3*W;for(n=Math.max(ea.length,3*ia);c<n;c++)ea[c]=0;y.directional.length=fa;y.point.length=U;y.spot.length=da;y.hemi.length=W;y.ambient[0]=q;y.ambient[1]=t;y.ambient[2]=u;wa=!1}m?(m=Ba,k.ambientLightColor.value=m.ambient,k.directionalLightColor.value=m.directional.colors,k.directionalLightDirection.value=m.directional.positions,k.pointLightColor.value=m.point.colors,k.pointLightPosition.value=m.point.positions,k.pointLightDistance.value=m.point.distances,k.pointLightDecay.value=
|
|
|
+(k.fogColor.value=c.color,c instanceof THREE.Fog?(k.fogNear.value=c.near,k.fogFar.value=c.far):c instanceof THREE.FogExp2&&(k.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(wa){var m=!0,s,t=q=0,u=0,w,G,C,A=Ba,y=a.matrixWorldInverse,E=A.directional.colors,J=A.directional.positions,M=A.point.colors,Q=A.point.positions,K=A.point.distances,F=A.point.decays,H=A.spot.colors,L=A.spot.positions,O=A.spot.distances,I=A.spot.directions,
|
|
|
+T=A.spot.anglesCos,ea=A.spot.exponents,R=A.spot.decays,$=A.hemi.skyColors,da=A.hemi.groundColors,S=A.hemi.positions,fa=0,U=0,ca=0,W=0,ma=0,ja=0,Y=0,ia=0,ba=s=0;c=C=ba=0;for(n=b.length;c<n;c++)s=b[c],w=s.color,G=s.intensity,C=s.distance,s instanceof THREE.AmbientLight?s.visible&&(q+=w.r,t+=w.g,u+=w.b):s instanceof THREE.DirectionalLight?(ma+=1,s.visible&&(Z.setFromMatrixPosition(s.matrixWorld),V.setFromMatrixPosition(s.target.matrixWorld),Z.sub(V),Z.transformDirection(y),s=3*fa,J[s+0]=Z.x,J[s+1]=Z.y,
|
|
|
+J[s+2]=Z.z,D(E,s,w,G),fa+=1)):s instanceof THREE.PointLight?(ja+=1,s.visible&&(ba=3*U,D(M,ba,w,G),V.setFromMatrixPosition(s.matrixWorld),V.applyMatrix4(y),Q[ba+0]=V.x,Q[ba+1]=V.y,Q[ba+2]=V.z,K[U]=C,F[U]=0===s.distance?0:s.decay,U+=1)):s instanceof THREE.SpotLight?(Y+=1,s.visible&&(ba=3*ca,D(H,ba,w,G),Z.setFromMatrixPosition(s.matrixWorld),V.copy(Z).applyMatrix4(y),L[ba+0]=V.x,L[ba+1]=V.y,L[ba+2]=V.z,O[ca]=C,V.setFromMatrixPosition(s.target.matrixWorld),Z.sub(V),Z.transformDirection(y),I[ba+0]=Z.x,
|
|
|
+I[ba+1]=Z.y,I[ba+2]=Z.z,T[ca]=Math.cos(s.angle),ea[ca]=s.exponent,R[ca]=0===s.distance?0:s.decay,ca+=1)):s instanceof THREE.HemisphereLight&&(ia+=1,s.visible&&(Z.setFromMatrixPosition(s.matrixWorld),Z.transformDirection(y),C=3*W,S[C+0]=Z.x,S[C+1]=Z.y,S[C+2]=Z.z,w=s.color,s=s.groundColor,D($,C,w,G),D(da,C,s,G),W+=1));c=3*fa;for(n=Math.max(E.length,3*ma);c<n;c++)E[c]=0;c=3*U;for(n=Math.max(M.length,3*ja);c<n;c++)M[c]=0;c=3*ca;for(n=Math.max(H.length,3*Y);c<n;c++)H[c]=0;c=3*W;for(n=Math.max($.length,
|
|
|
+3*ia);c<n;c++)$[c]=0;c=3*W;for(n=Math.max(da.length,3*ia);c<n;c++)da[c]=0;A.directional.length=fa;A.point.length=U;A.spot.length=ca;A.hemi.length=W;A.ambient[0]=q;A.ambient[1]=t;A.ambient[2]=u;wa=!1}m?(m=Ba,k.ambientLightColor.value=m.ambient,k.directionalLightColor.value=m.directional.colors,k.directionalLightDirection.value=m.directional.positions,k.pointLightColor.value=m.point.colors,k.pointLightPosition.value=m.point.positions,k.pointLightDistance.value=m.point.distances,k.pointLightDecay.value=
|
|
|
m.point.decays,k.spotLightColor.value=m.spot.colors,k.spotLightPosition.value=m.spot.positions,k.spotLightDistance.value=m.spot.distances,k.spotLightDirection.value=m.spot.directions,k.spotLightAngleCos.value=m.spot.anglesCos,k.spotLightExponent.value=m.spot.exponents,k.spotLightDecay.value=m.spot.decays,k.hemisphereLightSkyColor.value=m.hemi.skyColors,k.hemisphereLightGroundColor.value=m.hemi.groundColors,k.hemisphereLightDirection.value=m.hemi.positions,x(k,!0)):x(k,!1)}if(d instanceof THREE.MeshBasicMaterial||
|
|
|
-d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=d.opacity;k.diffuse.value=d.color;d.emissive&&(k.emissive.value=d.emissive);k.map.value=d.map;k.specularMap.value=d.specularMap;k.alphaMap.value=d.alphaMap;d.aoMap&&(k.aoMap.value=d.aoMap,k.aoMapIntensity.value=d.aoMapIntensity);var N;d.map?N=d.map:d.specularMap?N=d.specularMap:d.displacementMap?N=d.displacementMap:d.normalMap?N=d.normalMap:d.bumpMap?N=d.bumpMap:d.alphaMap?N=d.alphaMap:d.emissiveMap&&(N=
|
|
|
-d.emissiveMap);void 0!==N&&(N instanceof THREE.WebGLRenderTarget&&(N=N.texture),m=N.offset,N=N.repeat,k.offsetRepeat.value.set(m.x,m.y,N.x,N.y));k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value=
|
|
|
-d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointsMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=M.height/2,k.map.value=d.map,null!==d.map&&(a=d.map.offset,N=d.map.repeat,k.offsetRepeat.value.set(a.x,a.y,N.x,N.y))):d instanceof THREE.MeshPhongMaterial?(k.specular.value=d.specular,k.shininess.value=Math.max(d.shininess,1E-4),d.lightMap&&(k.lightMap.value=d.lightMap,k.lightMapIntensity.value=d.lightMapIntensity),
|
|
|
+d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=d.opacity;k.diffuse.value=d.color;d.emissive&&(k.emissive.value=d.emissive);k.map.value=d.map;k.specularMap.value=d.specularMap;k.alphaMap.value=d.alphaMap;d.aoMap&&(k.aoMap.value=d.aoMap,k.aoMapIntensity.value=d.aoMapIntensity);var P;d.map?P=d.map:d.specularMap?P=d.specularMap:d.displacementMap?P=d.displacementMap:d.normalMap?P=d.normalMap:d.bumpMap?P=d.bumpMap:d.alphaMap?P=d.alphaMap:d.emissiveMap&&(P=
|
|
|
+d.emissiveMap);void 0!==P&&(P instanceof THREE.WebGLRenderTarget&&(P=P.texture),m=P.offset,P=P.repeat,k.offsetRepeat.value.set(m.x,m.y,P.x,P.y));k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value=
|
|
|
+d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointsMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=N.height/2,k.map.value=d.map,null!==d.map&&(a=d.map.offset,P=d.map.repeat,k.offsetRepeat.value.set(a.x,a.y,P.x,P.y))):d instanceof THREE.MeshPhongMaterial?(k.specular.value=d.specular,k.shininess.value=Math.max(d.shininess,1E-4),d.lightMap&&(k.lightMap.value=d.lightMap,k.lightMapIntensity.value=d.lightMapIntensity),
|
|
|
d.emissiveMap&&(k.emissiveMap.value=d.emissiveMap),d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale),d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale)),d.displacementMap&&(k.displacementMap.value=d.displacementMap,k.displacementScale.value=d.displacementScale,k.displacementBias.value=d.displacementBias)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&
|
|
|
-(k.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(a=d=0,N=b.length;a<N;a++)m=b[a],m.castShadow&&(m instanceof THREE.PointLight||m instanceof THREE.SpotLight||m instanceof THREE.DirectionalLight)&&(m instanceof THREE.PointLight?(V.setFromMatrixPosition(m.matrixWorld).negate(),m.shadowMatrix.identity().setPosition(V),k.shadowDarkness.value[d]=-m.shadowDarkness):k.shadowDarkness.value[d]=m.shadowDarkness,k.shadowMatrix.value[d]=m.shadowMatrix,k.shadowMap.value[d]=m.shadowMap,
|
|
|
-k.shadowMapSize.value[d]=m.shadow.mapSize,k.shadowBias.value[d]=m.shadowBias,d++);b=f.uniformsList;f=0;for(d=b.length;f<d;f++)if(a=b[f][0],!1!==a.needsUpdate)switch(k=a.type,c=a.value,N=b[f][1],k){case "1i":r.uniform1i(N,c);break;case "1f":r.uniform1f(N,c);break;case "2f":r.uniform2f(N,c[0],c[1]);break;case "3f":r.uniform3f(N,c[0],c[1],c[2]);break;case "4f":r.uniform4f(N,c[0],c[1],c[2],c[3]);break;case "1iv":r.uniform1iv(N,c);break;case "3iv":r.uniform3iv(N,c);break;case "1fv":r.uniform1fv(N,c);break;
|
|
|
-case "2fv":r.uniform2fv(N,c);break;case "3fv":r.uniform3fv(N,c);break;case "4fv":r.uniform4fv(N,c);break;case "Matrix3fv":r.uniformMatrix3fv(N,!1,c);break;case "Matrix4fv":r.uniformMatrix4fv(N,!1,c);break;case "i":r.uniform1i(N,c);break;case "f":r.uniform1f(N,c);break;case "v2":r.uniform2f(N,c.x,c.y);break;case "v3":r.uniform3f(N,c.x,c.y,c.z);break;case "v4":r.uniform4f(N,c.x,c.y,c.z,c.w);break;case "c":r.uniform3f(N,c.r,c.g,c.b);break;case "iv1":r.uniform1iv(N,c);break;case "iv":r.uniform3iv(N,c);
|
|
|
-break;case "fv1":r.uniform1fv(N,c);break;case "fv":r.uniform3fv(N,c);break;case "v2v":void 0===a._array&&(a._array=new Float32Array(2*c.length));n=k=0;for(m=c.length;k<m;k++,n+=2)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y;r.uniform2fv(N,a._array);break;case "v3v":void 0===a._array&&(a._array=new Float32Array(3*c.length));n=k=0;for(m=c.length;k<m;k++,n+=3)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y,a._array[n+2]=c[k].z;r.uniform3fv(N,a._array);break;case "v4v":void 0===a._array&&(a._array=new Float32Array(4*
|
|
|
-c.length));n=k=0;for(m=c.length;k<m;k++,n+=4)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y,a._array[n+2]=c[k].z,a._array[n+3]=c[k].w;r.uniform4fv(N,a._array);break;case "m3":r.uniformMatrix3fv(N,!1,c.elements);break;case "m3v":void 0===a._array&&(a._array=new Float32Array(9*c.length));k=0;for(m=c.length;k<m;k++)c[k].flattenToArrayOffset(a._array,9*k);r.uniformMatrix3fv(N,!1,a._array);break;case "m4":r.uniformMatrix4fv(N,!1,c.elements);break;case "m4v":void 0===a._array&&(a._array=new Float32Array(16*
|
|
|
-c.length));k=0;for(m=c.length;k<m;k++)c[k].flattenToArrayOffset(a._array,16*k);r.uniformMatrix4fv(N,!1,a._array);break;case "t":n=v();r.uniform1i(N,n);if(!c)continue;c instanceof THREE.CubeTexture||Array.isArray(c.image)&&6===c.image.length?E(c,n):c instanceof THREE.WebGLRenderTargetCube?z(c.texture,n):c instanceof THREE.WebGLRenderTarget?aa.setTexture(c.texture,n):aa.setTexture(c,n);break;case "tv":void 0===a._array&&(a._array=[]);k=0;for(m=a.value.length;k<m;k++)a._array[k]=v();r.uniform1iv(N,a._array);
|
|
|
-k=0;for(m=a.value.length;k<m;k++)c=a.value[k],n=a._array[k],c&&(c instanceof THREE.CubeTexture||c.image instanceof Array&&6===c.image.length?E(c,n):c instanceof THREE.WebGLRenderTarget?aa.setTexture(c.texture,n):c instanceof THREE.WebGLRenderTargetCube?z(c.texture,n):aa.setTexture(c,n));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+k)}}r.uniformMatrix4fv(p.modelViewMatrix,!1,e.modelViewMatrix.elements);p.normalMatrix&&r.uniformMatrix3fv(p.normalMatrix,!1,e.normalMatrix.elements);
|
|
|
-void 0!==p.modelMatrix&&r.uniformMatrix4fv(p.modelMatrix,!1,e.matrixWorld.elements);return g}function x(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=
|
|
|
-b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function v(){var a=ya;a>=ga.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ga.maxTextures);ya+=1;return a}function D(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function w(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,C(b.wrapS)),r.texParameteri(a,
|
|
|
-r.TEXTURE_WRAP_T,C(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,C(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,C(b.minFilter))):(r.texParameteri(a,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,
|
|
|
-G(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,G(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));!(c=S.get("EXT_texture_filter_anisotropic"))||b.type===THREE.FloatType&&null===S.get("OES_texture_float_linear")||b.type===THREE.HalfFloatType&&null===S.get("OES_texture_half_float_linear")||!(1<
|
|
|
-b.anisotropy||X.get(b).__currentAnisotropy)||(r.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,aa.getMaxAnisotropy())),X.get(b).__currentAnisotropy=b.anisotropy)}function A(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+
|
|
|
-"). Resized to "+d.width+"x"+d.height,a);return d}return a}function E(a,b){var c=X.get(a);if(6===a.image.length)if(0<a.version&&c.__version!==a.version){c.__image__webglTextureCube||(a.addEventListener("dispose",g),c.__image__webglTextureCube=r.createTexture(),la.textures++);I.activeTexture(r.TEXTURE0+b);I.bindTexture(r.TEXTURE_CUBE_MAP,c.__image__webglTextureCube);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);for(var d=a instanceof THREE.CompressedTexture,e=a.image[0]instanceof THREE.DataTexture,
|
|
|
-f=[],h=0;6>h;h++)f[h]=!aa.autoScaleCubemaps||d||e?e?a.image[h].image:a.image[h]:A(a.image[h],ga.maxCubemapSize);var h=f[0],k=THREE.Math.isPowerOfTwo(h.width)&&THREE.Math.isPowerOfTwo(h.height),l=C(a.format),m=C(a.type);w(r.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var n,q=f[h].mipmaps,p=0,s=q.length;p<s;p++)n=q[p],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<I.getCompressedTextureFormats().indexOf(l)?I.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,n.width,n.height,0,
|
|
|
-n.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,n.width,n.height,0,l,m,n.data);else e?I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,f[h].width,f[h].height,0,l,m,f[h].data):I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,l,m,f[h]);a.generateMipmaps&&k&&r.generateMipmap(r.TEXTURE_CUBE_MAP);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}else I.activeTexture(r.TEXTURE0+b),I.bindTexture(r.TEXTURE_CUBE_MAP,
|
|
|
-c.__image__webglTextureCube)}function z(a,b){I.activeTexture(r.TEXTURE0+b);I.bindTexture(r.TEXTURE_CUBE_MAP,X.get(a).__webglTexture)}function B(a,b,c){r.bindFramebuffer(r.FRAMEBUFFER,a);r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,c,X.get(b.texture).__webglTexture,0)}function O(a,b){r.bindRenderbuffer(r.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,
|
|
|
-a)):b.depthBuffer&&b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,b.width,b.height)}function G(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function C(a){var b;if(a===THREE.RepeatWrapping)return r.REPEAT;if(a===THREE.ClampToEdgeWrapping)return r.CLAMP_TO_EDGE;
|
|
|
-if(a===THREE.MirroredRepeatWrapping)return r.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return r.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return r.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return r.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return r.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return r.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return r.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return r.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return r.UNSIGNED_SHORT_4_4_4_4;
|
|
|
-if(a===THREE.UnsignedShort5551Type)return r.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return r.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return r.BYTE;if(a===THREE.ShortType)return r.SHORT;if(a===THREE.UnsignedShortType)return r.UNSIGNED_SHORT;if(a===THREE.IntType)return r.INT;if(a===THREE.UnsignedIntType)return r.UNSIGNED_INT;if(a===THREE.FloatType)return r.FLOAT;b=S.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return r.ALPHA;
|
|
|
-if(a===THREE.RGBFormat)return r.RGB;if(a===THREE.RGBAFormat)return r.RGBA;if(a===THREE.LuminanceFormat)return r.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return r.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return r.FUNC_ADD;if(a===THREE.SubtractEquation)return r.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return r.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return r.ZERO;if(a===THREE.OneFactor)return r.ONE;if(a===THREE.SrcColorFactor)return r.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return r.ONE_MINUS_SRC_COLOR;
|
|
|
-if(a===THREE.SrcAlphaFactor)return r.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return r.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return r.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return r.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return r.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return r.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return r.SRC_ALPHA_SATURATE;b=S.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;
|
|
|
-if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=S.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
|
|
|
-if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=S.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var M=void 0!==a.canvas?a.canvas:document.createElement("canvas"),K=void 0!==a.context?a.context:null,L=M.width,J=M.height,y=1,H=void 0!==a.alpha?a.alpha:!1,P=void 0!==a.depth?a.depth:!0,T=void 0!==a.stencil?a.stencil:!0,Q=void 0!==
|
|
|
-a.antialias?a.antialias:!1,R=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,W=new THREE.Color(0),U=0,Y=[],ca=[],fa=-1,ea=[],$=-1,ma=new Float32Array(8),ja=[],da=[];this.domElement=M;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;var aa=this,
|
|
|
-za=null,ia=null,ta=-1,sa="",ra=null,ya=0,na=0,oa=0,pa=M.width,qa=M.height,Ca=0,Da=0,Aa=new THREE.Frustum,xa=new THREE.Matrix4,V=new THREE.Vector3,Z=new THREE.Vector3,wa=!0,Ba={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},la={geometries:0,textures:0},ka={calls:0,
|
|
|
-vertices:0,faces:0,points:0};this.info={render:ka,memory:la,programs:null};var r;try{H={alpha:H,depth:P,stencil:T,antialias:Q,premultipliedAlpha:R,preserveDrawingBuffer:F};r=K||M.getContext("webgl",H)||M.getContext("experimental-webgl",H);if(null===r){if(null!==M.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}M.addEventListener("webglcontextlost",e,!1)}catch(Ea){console.error("THREE.WebGLRenderer: "+Ea)}var S=new THREE.WebGLExtensions(r);
|
|
|
-S.get("OES_texture_float");S.get("OES_texture_float_linear");S.get("OES_texture_half_float");S.get("OES_texture_half_float_linear");S.get("OES_standard_derivatives");S.get("ANGLE_instanced_arrays");S.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);var ga=new THREE.WebGLCapabilities(r,S,a),I=new THREE.WebGLState(r,S,C),X=new THREE.WebGLProperties,va=new THREE.WebGLObjects(r,X,this.info),ua=new THREE.WebGLPrograms(this,ga);this.info.programs=ua.programs;var Fa=new THREE.WebGLBufferRenderer(r,
|
|
|
-S,ka),Ga=new THREE.WebGLIndexedBufferRenderer(r,S,ka);c();this.context=r;this.capabilities=ga;this.extensions=S;this.state=I;var ha=new THREE.WebGLShadowMap(this,Y,va);this.shadowMap=ha;var Ha=new THREE.SpritePlugin(this,ja),Ia=new THREE.LensFlarePlugin(this,da);this.getContext=function(){return r};this.getContextAttributes=function(){return r.getContextAttributes()};this.forceContextLoss=function(){S.get("WEBGL_lose_context").loseContext()};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==
|
|
|
-a)return a;var b=S.get("EXT_texture_filter_anisotropic");return a=null!==b?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return ga.precision};this.getPixelRatio=function(){return y};this.setPixelRatio=function(a){void 0!==a&&(y=a)};this.getSize=function(){return{width:L,height:J}};this.setSize=function(a,b,c){L=a;J=b;M.width=a*y;M.height=b*y;!1!==c&&(M.style.width=a+"px",M.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){na=a*
|
|
|
-y;oa=b*y;pa=c*y;qa=d*y;r.viewport(na,oa,pa,qa)};this.getViewport=function(a){a.x=na/y;a.y=oa/y;a.z=pa/y;a.w=qa/y};this.setScissor=function(a,b,c,d){r.scissor(a*y,b*y,c*y,d*y)};this.enableScissorTest=function(a){I.setScissorTest(a)};this.getClearColor=function(){return W};this.setClearColor=function(a,c){W.set(a);U=void 0!==c?c:1;b(W.r,W.g,W.b,U)};this.getClearAlpha=function(){return U};this.setClearAlpha=function(a){U=a;b(W.r,W.g,W.b,U)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=r.COLOR_BUFFER_BIT;
|
|
|
-if(void 0===b||b)d|=r.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=r.STENCIL_BUFFER_BIT;r.clear(d)};this.clearColor=function(){r.clear(r.COLOR_BUFFER_BIT)};this.clearDepth=function(){r.clear(r.DEPTH_BUFFER_BIT)};this.clearStencil=function(){r.clear(r.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){M.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){I.initAttributes();var d=
|
|
|
-X.get(a);a.hasPositions&&!d.position&&(d.position=r.createBuffer());a.hasNormals&&!d.normal&&(d.normal=r.createBuffer());a.hasUvs&&!d.uv&&(d.uv=r.createBuffer());a.hasColors&&!d.color&&(d.color=r.createBuffer());b=b.getAttributes();a.hasPositions&&(r.bindBuffer(r.ARRAY_BUFFER,d.position),r.bufferData(r.ARRAY_BUFFER,a.positionArray,r.DYNAMIC_DRAW),I.enableAttribute(b.position),r.vertexAttribPointer(b.position,3,r.FLOAT,!1,0,0));if(a.hasNormals){r.bindBuffer(r.ARRAY_BUFFER,d.normal);if("MeshPhongMaterial"!==
|
|
|
-c.type&&c.shading===THREE.FlatShading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,k=(g[e+1]+g[e+4]+g[e+7])/3,l=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=k;g[e+2]=l;g[e+3]=h;g[e+4]=k;g[e+5]=l;g[e+6]=h;g[e+7]=k;g[e+8]=l}r.bufferData(r.ARRAY_BUFFER,a.normalArray,r.DYNAMIC_DRAW);I.enableAttribute(b.normal);r.vertexAttribPointer(b.normal,3,r.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(r.bindBuffer(r.ARRAY_BUFFER,d.uv),r.bufferData(r.ARRAY_BUFFER,a.uvArray,r.DYNAMIC_DRAW),I.enableAttribute(b.uv),
|
|
|
-r.vertexAttribPointer(b.uv,2,r.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(r.bindBuffer(r.ARRAY_BUFFER,d.color),r.bufferData(r.ARRAY_BUFFER,a.colorArray,r.DYNAMIC_DRAW),I.enableAttribute(b.color),r.vertexAttribPointer(b.color,3,r.FLOAT,!1,0,0));I.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f,g){s(e);var h=u(a,b,c,e,f),l=!1;a=d.id+"_"+h.id+"_"+e.wireframe;a!==sa&&(sa=a,l=!0);b=f.morphTargetInfluences;if(void 0!==
|
|
|
-b){a=[];c=0;for(l=b.length;c<l;c++){var m=b[c];a.push([m,c])}a.sort(k);8<a.length&&(a.length=8);var n=d.morphAttributes;c=0;for(l=a.length;c<l;c++)m=a[c],ma[c]=m[0],0!==m[0]?(b=m[1],!0===e.morphTargets&&n.position&&d.addAttribute("morphTarget"+c,n.position[b]),!0===e.morphNormals&&n.normal&&d.addAttribute("morphNormal"+c,n.normal[b])):(!0===e.morphTargets&&d.removeAttribute("morphTarget"+c),!0===e.morphNormals&&d.removeAttribute("morphNormal"+c));a=h.getUniforms();null!==a.morphTargetInfluences&&
|
|
|
-r.uniform1fv(a.morphTargetInfluences,ma);l=!0}b=d.index;c=d.attributes.position;!0===e.wireframe&&(b=va.getWireframeAttribute(d));null!==b?(a=Ga,a.setIndex(b)):a=Fa;if(l){a:{var l=void 0,q;if(d instanceof THREE.InstancedBufferGeometry&&(q=S.get("ANGLE_instanced_arrays"),null===q)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===l&&(l=0);I.initAttributes();var m=d.attributes,
|
|
|
-h=h.getAttributes(),n=e.defaultAttributeValues,p;for(p in h){var t=h[p];if(0<=t){var v=m[p];if(void 0!==v){var x=v.itemSize,w=va.getAttributeBuffer(v);if(v instanceof THREE.InterleavedBufferAttribute){var G=v.data,D=G.stride,v=v.offset;G instanceof THREE.InstancedInterleavedBuffer?(I.enableAttributeAndDivisor(t,G.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=G.meshPerAttribute*G.count)):I.enableAttribute(t);r.bindBuffer(r.ARRAY_BUFFER,w);r.vertexAttribPointer(t,x,r.FLOAT,
|
|
|
-!1,D*G.array.BYTES_PER_ELEMENT,(l*D+v)*G.array.BYTES_PER_ELEMENT)}else v instanceof THREE.InstancedBufferAttribute?(I.enableAttributeAndDivisor(t,v.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=v.meshPerAttribute*v.count)):I.enableAttribute(t),r.bindBuffer(r.ARRAY_BUFFER,w),r.vertexAttribPointer(t,x,r.FLOAT,!1,0,l*x*4)}else if(void 0!==n&&(x=n[p],void 0!==x))switch(x.length){case 2:r.vertexAttrib2fv(t,x);break;case 3:r.vertexAttrib3fv(t,x);break;case 4:r.vertexAttrib4fv(t,
|
|
|
-x);break;default:r.vertexAttrib1fv(t,x)}}}I.disableUnusedAttributes()}null!==b&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,va.getAttributeBuffer(b))}q=Infinity;null!==b?q=b.count:void 0!==c&&(q=c.count);p=d.drawRange.start;b=d.drawRange.count;c=null!==g?g.start:0;l=null!==g?g.count:Infinity;g=Math.max(0,p,c);q=Math.min(0+q,p+b,c+l)-1;q=Math.max(0,q-g+1);f instanceof THREE.Mesh?(!0===e.wireframe?(I.setLineWidth(e.wireframeLinewidth*y),a.setMode(r.LINES)):a.setMode(r.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&&
|
|
|
-0<d.maxInstancedCount?a.renderInstances(d):a.render(g,q)):f instanceof THREE.Line?(d=e.linewidth,void 0===d&&(d=1),I.setLineWidth(d*y),f instanceof THREE.LineSegments?a.setMode(r.LINES):a.setMode(r.LINE_STRIP),a.render(g,q)):f instanceof THREE.Points&&(a.setMode(r.POINTS),a.render(g,q))};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;sa="";ta=-1;ra=null;wa=!0;!0===a.autoUpdate&&
|
|
|
-a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);xa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Aa.setFromMatrix(xa);Y.length=0;$=fa=-1;ja.length=0;da.length=0;q(a);ca.length=fa+1;ea.length=$+1;!0===aa.sortObjects&&(ca.sort(n),ea.sort(p));ha.render(a);ka.calls=0;ka.vertices=0;ka.faces=0;ka.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?
|
|
|
-(d=a.overrideMaterial,t(ca,b,Y,e,d),t(ea,b,Y,e,d)):(I.setBlending(THREE.NoBlending),t(ca,b,Y,e),t(ea,b,Y,e));Ha.render(a,b);Ia.render(a,b,Ca,Da);c&&(a=c.texture,b=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),a.generateMipmaps&&b&&a.minFilter!==THREE.NearestFilter&&a.minFilter!==THREE.LinearFilter&&(a=c instanceof THREE.WebGLRenderTargetCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,c=X.get(c.texture).__webglTexture,I.bindTexture(a,c),r.generateMipmap(a),I.bindTexture(a,null)));I.setDepthTest(!0);
|
|
|
-I.setDepthWrite(!0);I.setColorWrite(!0)}};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?I.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):a===THREE.CullFaceFront?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),I.enable(r.CULL_FACE))};this.setTexture=function(a,b){var c=X.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",
|
|
|
-a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a);else{void 0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",g),c.__webglTexture=r.createTexture(),la.textures++);I.activeTexture(r.TEXTURE0+b);I.bindTexture(r.TEXTURE_2D,c.__webglTexture);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);r.pixelStorei(r.UNPACK_ALIGNMENT,a.unpackAlignment);
|
|
|
-a.image=A(a.image,ga.maxTextureSize);var e=a.image,d=THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height),f=C(a.format),h=C(a.type);w(r.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<k.length&&d){for(var l=0,m=k.length;l<m;l++)e=k[l],I.texImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);a.generateMipmaps=!1}else I.texImage2D(r.TEXTURE_2D,0,f,e.width,e.height,0,f,h,e.data);else if(a instanceof THREE.CompressedTexture)for(l=0,m=k.length;l<m;l++)e=k[l],a.format!==
|
|
|
-THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<I.getCompressedTextureFormats().indexOf(f)?I.compressedTexImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):I.texImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);else if(0<k.length&&d){l=0;for(m=k.length;l<m;l++)e=k[l],I.texImage2D(r.TEXTURE_2D,l,f,f,h,e);a.generateMipmaps=!1}else I.texImage2D(r.TEXTURE_2D,0,f,f,h,a.image);a.generateMipmaps&&
|
|
|
-d&&r.generateMipmap(r.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else I.activeTexture(r.TEXTURE0+b),I.bindTexture(r.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===X.get(a).__webglFramebuffer){var c=X.get(a),d=X.get(a.texture);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",f);d.__webglTexture=r.createTexture();la.textures++;var e=
|
|
|
-THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),g=C(a.texture.format),h=C(a.texture.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];I.bindTexture(r.TEXTURE_CUBE_MAP,d.__webglTexture);w(r.TEXTURE_CUBE_MAP,a.texture,e);for(d=0;6>d;d++)c.__webglFramebuffer[d]=r.createFramebuffer(),c.__webglRenderbuffer[d]=r.createRenderbuffer(),I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,g,a.width,a.height,0,g,h,null),B(c.__webglFramebuffer[d],a,r.TEXTURE_CUBE_MAP_POSITIVE_X+d),O(c.__webglRenderbuffer[d],
|
|
|
-a);a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=r.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:r.createRenderbuffer(),I.bindTexture(r.TEXTURE_2D,d.__webglTexture),w(r.TEXTURE_2D,a.texture,e),I.texImage2D(r.TEXTURE_2D,0,g,a.width,a.height,0,g,h,null),B(c.__webglFramebuffer,a,r.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,
|
|
|
-c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):O(c.__webglRenderbuffer,a),a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_2D);b?I.bindTexture(r.TEXTURE_CUBE_MAP,null):I.bindTexture(r.TEXTURE_2D,null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(c=X.get(a),d=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,e=a.height,h=
|
|
|
-g=0):(d=null,c=pa,e=qa,g=na,h=oa);d!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,d),r.viewport(g,h,c,e),ia=d);b&&(d=X.get(a.texture),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,d.__webglTexture,0));Ca=c;Da=e};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!1===a instanceof THREE.WebGLRenderTarget)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var g=X.get(a).__webglFramebuffer;
|
|
|
-if(g){var h=!1;g!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,g),h=!0);try{var k=a.texture;k.format!==THREE.RGBAFormat&&C(k.format)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):k.type===THREE.UnsignedByteType||C(k.type)===r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)||k.type===THREE.FloatType&&S.get("WEBGL_color_buffer_float")||k.type===THREE.HalfFloatType&&S.get("EXT_color_buffer_half_float")?
|
|
|
-r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,C(k.format),C(k.type),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&r.bindFramebuffer(r.FRAMEBUFFER,ia)}}}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");
|
|
|
-return S.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return S.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");return S.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");
|
|
|
+(k.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(a=d=0,P=b.length;a<P;a++)m=b[a],!1!==m.castShadow&&(m instanceof THREE.PointLight||m instanceof THREE.SpotLight||m instanceof THREE.DirectionalLight)&&(c=m.shadow,m instanceof THREE.PointLight?(V.setFromMatrixPosition(m.matrixWorld).negate(),c.matrix.identity().setPosition(V),k.shadowDarkness.value[d]=-c.darkness):k.shadowDarkness.value[d]=c.darkness,k.shadowMatrix.value[d]=c.matrix,k.shadowMap.value[d]=c.map,k.shadowMapSize.value[d]=
|
|
|
+c.mapSize,k.shadowBias.value[d]=c.bias,d++);b=f.uniformsList;f=0;for(d=b.length;f<d;f++)if(a=b[f][0],!1!==a.needsUpdate)switch(k=a.type,c=a.value,P=b[f][1],k){case "1i":r.uniform1i(P,c);break;case "1f":r.uniform1f(P,c);break;case "2f":r.uniform2f(P,c[0],c[1]);break;case "3f":r.uniform3f(P,c[0],c[1],c[2]);break;case "4f":r.uniform4f(P,c[0],c[1],c[2],c[3]);break;case "1iv":r.uniform1iv(P,c);break;case "3iv":r.uniform3iv(P,c);break;case "1fv":r.uniform1fv(P,c);break;case "2fv":r.uniform2fv(P,c);break;
|
|
|
+case "3fv":r.uniform3fv(P,c);break;case "4fv":r.uniform4fv(P,c);break;case "Matrix3fv":r.uniformMatrix3fv(P,!1,c);break;case "Matrix4fv":r.uniformMatrix4fv(P,!1,c);break;case "i":r.uniform1i(P,c);break;case "f":r.uniform1f(P,c);break;case "v2":r.uniform2f(P,c.x,c.y);break;case "v3":r.uniform3f(P,c.x,c.y,c.z);break;case "v4":r.uniform4f(P,c.x,c.y,c.z,c.w);break;case "c":r.uniform3f(P,c.r,c.g,c.b);break;case "iv1":r.uniform1iv(P,c);break;case "iv":r.uniform3iv(P,c);break;case "fv1":r.uniform1fv(P,c);
|
|
|
+break;case "fv":r.uniform3fv(P,c);break;case "v2v":void 0===a._array&&(a._array=new Float32Array(2*c.length));n=k=0;for(m=c.length;k<m;k++,n+=2)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y;r.uniform2fv(P,a._array);break;case "v3v":void 0===a._array&&(a._array=new Float32Array(3*c.length));n=k=0;for(m=c.length;k<m;k++,n+=3)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y,a._array[n+2]=c[k].z;r.uniform3fv(P,a._array);break;case "v4v":void 0===a._array&&(a._array=new Float32Array(4*c.length));n=k=0;for(m=c.length;k<
|
|
|
+m;k++,n+=4)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y,a._array[n+2]=c[k].z,a._array[n+3]=c[k].w;r.uniform4fv(P,a._array);break;case "m3":r.uniformMatrix3fv(P,!1,c.elements);break;case "m3v":void 0===a._array&&(a._array=new Float32Array(9*c.length));k=0;for(m=c.length;k<m;k++)c[k].flattenToArrayOffset(a._array,9*k);r.uniformMatrix3fv(P,!1,a._array);break;case "m4":r.uniformMatrix4fv(P,!1,c.elements);break;case "m4v":void 0===a._array&&(a._array=new Float32Array(16*c.length));k=0;for(m=c.length;k<m;k++)c[k].flattenToArrayOffset(a._array,
|
|
|
+16*k);r.uniformMatrix4fv(P,!1,a._array);break;case "t":n=v();r.uniform1i(P,n);if(!c)continue;c instanceof THREE.CubeTexture||Array.isArray(c.image)&&6===c.image.length?B(c,n):c instanceof THREE.WebGLRenderTargetCube?z(c.texture,n):c instanceof THREE.WebGLRenderTarget?aa.setTexture(c.texture,n):aa.setTexture(c,n);break;case "tv":void 0===a._array&&(a._array=[]);k=0;for(m=a.value.length;k<m;k++)a._array[k]=v();r.uniform1iv(P,a._array);k=0;for(m=a.value.length;k<m;k++)c=a.value[k],n=a._array[k],c&&(c instanceof
|
|
|
+THREE.CubeTexture||c.image instanceof Array&&6===c.image.length?B(c,n):c instanceof THREE.WebGLRenderTarget?aa.setTexture(c.texture,n):c instanceof THREE.WebGLRenderTargetCube?z(c.texture,n):aa.setTexture(c,n));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+k)}}r.uniformMatrix4fv(p.modelViewMatrix,!1,e.modelViewMatrix.elements);p.normalMatrix&&r.uniformMatrix3fv(p.normalMatrix,!1,e.normalMatrix.elements);void 0!==p.modelMatrix&&r.uniformMatrix4fv(p.modelMatrix,!1,e.matrixWorld.elements);
|
|
|
+return g}function x(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=
|
|
|
+b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function v(){var a=ya;a>=ga.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ga.maxTextures);ya+=1;return a}function D(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function w(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,C(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,C(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,
|
|
|
+C(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,C(b.minFilter))):(r.texParameteri(a,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,G(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,
|
|
|
+G(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));!(c=S.get("EXT_texture_filter_anisotropic"))||b.type===THREE.FloatType&&null===S.get("OES_texture_float_linear")||b.type===THREE.HalfFloatType&&null===S.get("OES_texture_half_float_linear")||!(1<b.anisotropy||X.get(b).__currentAnisotropy)||(r.texParameterf(a,
|
|
|
+c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,aa.getMaxAnisotropy())),X.get(b).__currentAnisotropy=b.anisotropy)}function A(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}
|
|
|
+function B(a,b){var c=X.get(a);if(6===a.image.length)if(0<a.version&&c.__version!==a.version){c.__image__webglTextureCube||(a.addEventListener("dispose",g),c.__image__webglTextureCube=r.createTexture(),la.textures++);I.activeTexture(r.TEXTURE0+b);I.bindTexture(r.TEXTURE_CUBE_MAP,c.__image__webglTextureCube);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);for(var d=a instanceof THREE.CompressedTexture,e=a.image[0]instanceof THREE.DataTexture,f=[],h=0;6>h;h++)f[h]=!aa.autoScaleCubemaps||d||e?e?a.image[h].image:
|
|
|
+a.image[h]:A(a.image[h],ga.maxCubemapSize);var h=f[0],k=THREE.Math.isPowerOfTwo(h.width)&&THREE.Math.isPowerOfTwo(h.height),l=C(a.format),m=C(a.type);w(r.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var n,q=f[h].mipmaps,p=0,s=q.length;p<s;p++)n=q[p],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<I.getCompressedTextureFormats().indexOf(l)?I.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,n.width,n.height,0,n.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):
|
|
|
+I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,n.width,n.height,0,l,m,n.data);else e?I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,f[h].width,f[h].height,0,l,m,f[h].data):I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,l,m,f[h]);a.generateMipmaps&&k&&r.generateMipmap(r.TEXTURE_CUBE_MAP);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}else I.activeTexture(r.TEXTURE0+b),I.bindTexture(r.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)}function z(a,b){I.activeTexture(r.TEXTURE0+b);I.bindTexture(r.TEXTURE_CUBE_MAP,
|
|
|
+X.get(a).__webglTexture)}function y(a,b,c){r.bindFramebuffer(r.FRAMEBUFFER,a);r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,c,X.get(b.texture).__webglTexture,0)}function L(a,b){r.bindRenderbuffer(r.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,
|
|
|
+b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,b.width,b.height)}function G(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function C(a){var b;if(a===THREE.RepeatWrapping)return r.REPEAT;if(a===THREE.ClampToEdgeWrapping)return r.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return r.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return r.NEAREST;
|
|
|
+if(a===THREE.NearestMipMapNearestFilter)return r.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return r.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return r.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return r.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return r.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return r.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return r.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return r.UNSIGNED_SHORT_5_5_5_1;
|
|
|
+if(a===THREE.UnsignedShort565Type)return r.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return r.BYTE;if(a===THREE.ShortType)return r.SHORT;if(a===THREE.UnsignedShortType)return r.UNSIGNED_SHORT;if(a===THREE.IntType)return r.INT;if(a===THREE.UnsignedIntType)return r.UNSIGNED_INT;if(a===THREE.FloatType)return r.FLOAT;b=S.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return r.ALPHA;if(a===THREE.RGBFormat)return r.RGB;if(a===THREE.RGBAFormat)return r.RGBA;
|
|
|
+if(a===THREE.LuminanceFormat)return r.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return r.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return r.FUNC_ADD;if(a===THREE.SubtractEquation)return r.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return r.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return r.ZERO;if(a===THREE.OneFactor)return r.ONE;if(a===THREE.SrcColorFactor)return r.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return r.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return r.SRC_ALPHA;
|
|
|
+if(a===THREE.OneMinusSrcAlphaFactor)return r.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return r.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return r.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return r.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return r.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return r.SRC_ALPHA_SATURATE;b=S.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;
|
|
|
+if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=S.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=
|
|
|
+S.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var N=void 0!==a.canvas?a.canvas:document.createElement("canvas"),M=void 0!==a.context?a.context:null,O=N.width,K=N.height,E=1,J=void 0!==a.alpha?a.alpha:!1,Q=void 0!==a.depth?a.depth:!0,T=void 0!==a.stencil?a.stencil:!0,H=void 0!==a.antialias?a.antialias:!1,R=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:
|
|
|
+!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,W=new THREE.Color(0),U=0,Y=[],ea=[],fa=-1,da=[],$=-1,ma=new Float32Array(8),ja=[],ca=[];this.domElement=N;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;var aa=this,za=null,ia=null,ta=-1,sa="",ra=null,ya=0,na=0,oa=0,pa=N.width,qa=N.height,Ca=
|
|
|
+0,Da=0,Aa=new THREE.Frustum,xa=new THREE.Matrix4,V=new THREE.Vector3,Z=new THREE.Vector3,wa=!0,Ba={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},la={geometries:0,textures:0},ka={calls:0,vertices:0,faces:0,points:0};this.info={render:ka,memory:la,programs:null};
|
|
|
+var r;try{J={alpha:J,depth:Q,stencil:T,antialias:H,premultipliedAlpha:R,preserveDrawingBuffer:F};r=M||N.getContext("webgl",J)||N.getContext("experimental-webgl",J);if(null===r){if(null!==N.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}N.addEventListener("webglcontextlost",e,!1)}catch(Ea){console.error("THREE.WebGLRenderer: "+Ea)}var S=new THREE.WebGLExtensions(r);S.get("OES_texture_float");S.get("OES_texture_float_linear");
|
|
|
+S.get("OES_texture_half_float");S.get("OES_texture_half_float_linear");S.get("OES_standard_derivatives");S.get("ANGLE_instanced_arrays");S.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);var ga=new THREE.WebGLCapabilities(r,S,a),I=new THREE.WebGLState(r,S,C),X=new THREE.WebGLProperties,va=new THREE.WebGLObjects(r,X,this.info),ua=new THREE.WebGLPrograms(this,ga);this.info.programs=ua.programs;var Fa=new THREE.WebGLBufferRenderer(r,S,ka),Ga=new THREE.WebGLIndexedBufferRenderer(r,
|
|
|
+S,ka);c();this.context=r;this.capabilities=ga;this.extensions=S;this.state=I;var ha=new THREE.WebGLShadowMap(this,Y,va);this.shadowMap=ha;var Ha=new THREE.SpritePlugin(this,ja),Ia=new THREE.LensFlarePlugin(this,ca);this.getContext=function(){return r};this.getContextAttributes=function(){return r.getContextAttributes()};this.forceContextLoss=function(){S.get("WEBGL_lose_context").loseContext()};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=S.get("EXT_texture_filter_anisotropic");
|
|
|
+return a=null!==b?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return ga.precision};this.getPixelRatio=function(){return E};this.setPixelRatio=function(a){void 0!==a&&(E=a)};this.getSize=function(){return{width:O,height:K}};this.setSize=function(a,b,c){O=a;K=b;N.width=a*E;N.height=b*E;!1!==c&&(N.style.width=a+"px",N.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){na=a*E;oa=b*E;pa=c*E;qa=d*E;r.viewport(na,oa,pa,qa)};this.getViewport=
|
|
|
+function(a){a.x=na/E;a.y=oa/E;a.z=pa/E;a.w=qa/E};this.setScissor=function(a,b,c,d){r.scissor(a*E,b*E,c*E,d*E)};this.enableScissorTest=function(a){I.setScissorTest(a)};this.getClearColor=function(){return W};this.setClearColor=function(a,c){W.set(a);U=void 0!==c?c:1;b(W.r,W.g,W.b,U)};this.getClearAlpha=function(){return U};this.setClearAlpha=function(a){U=a;b(W.r,W.g,W.b,U)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=r.COLOR_BUFFER_BIT;if(void 0===b||b)d|=r.DEPTH_BUFFER_BIT;if(void 0===
|
|
|
+c||c)d|=r.STENCIL_BUFFER_BIT;r.clear(d)};this.clearColor=function(){r.clear(r.COLOR_BUFFER_BIT)};this.clearDepth=function(){r.clear(r.DEPTH_BUFFER_BIT)};this.clearStencil=function(){r.clear(r.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){N.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){I.initAttributes();var d=X.get(a);a.hasPositions&&!d.position&&(d.position=
|
|
|
+r.createBuffer());a.hasNormals&&!d.normal&&(d.normal=r.createBuffer());a.hasUvs&&!d.uv&&(d.uv=r.createBuffer());a.hasColors&&!d.color&&(d.color=r.createBuffer());b=b.getAttributes();a.hasPositions&&(r.bindBuffer(r.ARRAY_BUFFER,d.position),r.bufferData(r.ARRAY_BUFFER,a.positionArray,r.DYNAMIC_DRAW),I.enableAttribute(b.position),r.vertexAttribPointer(b.position,3,r.FLOAT,!1,0,0));if(a.hasNormals){r.bindBuffer(r.ARRAY_BUFFER,d.normal);if("MeshPhongMaterial"!==c.type&&c.shading===THREE.FlatShading)for(var e=
|
|
|
+0,f=3*a.count;e<f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,k=(g[e+1]+g[e+4]+g[e+7])/3,l=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=k;g[e+2]=l;g[e+3]=h;g[e+4]=k;g[e+5]=l;g[e+6]=h;g[e+7]=k;g[e+8]=l}r.bufferData(r.ARRAY_BUFFER,a.normalArray,r.DYNAMIC_DRAW);I.enableAttribute(b.normal);r.vertexAttribPointer(b.normal,3,r.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(r.bindBuffer(r.ARRAY_BUFFER,d.uv),r.bufferData(r.ARRAY_BUFFER,a.uvArray,r.DYNAMIC_DRAW),I.enableAttribute(b.uv),r.vertexAttribPointer(b.uv,2,r.FLOAT,
|
|
|
+!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(r.bindBuffer(r.ARRAY_BUFFER,d.color),r.bufferData(r.ARRAY_BUFFER,a.colorArray,r.DYNAMIC_DRAW),I.enableAttribute(b.color),r.vertexAttribPointer(b.color,3,r.FLOAT,!1,0,0));I.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f,g){s(e);var h=u(a,b,c,e,f),l=!1;a=d.id+"_"+h.id+"_"+e.wireframe;a!==sa&&(sa=a,l=!0);b=f.morphTargetInfluences;if(void 0!==b){a=[];c=0;for(l=b.length;c<l;c++){var m=
|
|
|
+b[c];a.push([m,c])}a.sort(k);8<a.length&&(a.length=8);var n=d.morphAttributes;c=0;for(l=a.length;c<l;c++)m=a[c],ma[c]=m[0],0!==m[0]?(b=m[1],!0===e.morphTargets&&n.position&&d.addAttribute("morphTarget"+c,n.position[b]),!0===e.morphNormals&&n.normal&&d.addAttribute("morphNormal"+c,n.normal[b])):(!0===e.morphTargets&&d.removeAttribute("morphTarget"+c),!0===e.morphNormals&&d.removeAttribute("morphNormal"+c));a=h.getUniforms();null!==a.morphTargetInfluences&&r.uniform1fv(a.morphTargetInfluences,ma);l=
|
|
|
+!0}b=d.index;c=d.attributes.position;!0===e.wireframe&&(b=va.getWireframeAttribute(d));null!==b?(a=Ga,a.setIndex(b)):a=Fa;if(l){a:{var l=void 0,q;if(d instanceof THREE.InstancedBufferGeometry&&(q=S.get("ANGLE_instanced_arrays"),null===q)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===l&&(l=0);I.initAttributes();var m=d.attributes,h=h.getAttributes(),n=e.defaultAttributeValues,
|
|
|
+p;for(p in h){var t=h[p];if(0<=t){var v=m[p];if(void 0!==v){var x=v.itemSize,w=va.getAttributeBuffer(v);if(v instanceof THREE.InterleavedBufferAttribute){var G=v.data,D=G.stride,v=v.offset;G instanceof THREE.InstancedInterleavedBuffer?(I.enableAttributeAndDivisor(t,G.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=G.meshPerAttribute*G.count)):I.enableAttribute(t);r.bindBuffer(r.ARRAY_BUFFER,w);r.vertexAttribPointer(t,x,r.FLOAT,!1,D*G.array.BYTES_PER_ELEMENT,(l*D+v)*G.array.BYTES_PER_ELEMENT)}else v instanceof
|
|
|
+THREE.InstancedBufferAttribute?(I.enableAttributeAndDivisor(t,v.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=v.meshPerAttribute*v.count)):I.enableAttribute(t),r.bindBuffer(r.ARRAY_BUFFER,w),r.vertexAttribPointer(t,x,r.FLOAT,!1,0,l*x*4)}else if(void 0!==n&&(x=n[p],void 0!==x))switch(x.length){case 2:r.vertexAttrib2fv(t,x);break;case 3:r.vertexAttrib3fv(t,x);break;case 4:r.vertexAttrib4fv(t,x);break;default:r.vertexAttrib1fv(t,x)}}}I.disableUnusedAttributes()}null!==b&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,
|
|
|
+va.getAttributeBuffer(b))}q=Infinity;null!==b?q=b.count:void 0!==c&&(q=c.count);p=d.drawRange.start;b=d.drawRange.count;c=null!==g?g.start:0;l=null!==g?g.count:Infinity;g=Math.max(0,p,c);q=Math.min(0+q,p+b,c+l)-1;q=Math.max(0,q-g+1);f instanceof THREE.Mesh?(!0===e.wireframe?(I.setLineWidth(e.wireframeLinewidth*E),a.setMode(r.LINES)):a.setMode(r.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&&0<d.maxInstancedCount?a.renderInstances(d):a.render(g,q)):f instanceof THREE.Line?(d=e.linewidth,void 0===
|
|
|
+d&&(d=1),I.setLineWidth(d*E),f instanceof THREE.LineSegments?a.setMode(r.LINES):a.setMode(r.LINE_STRIP),a.render(g,q)):f instanceof THREE.Points&&(a.setMode(r.POINTS),a.render(g,q))};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;sa="";ta=-1;ra=null;wa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);
|
|
|
+xa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Aa.setFromMatrix(xa);Y.length=0;$=fa=-1;ja.length=0;ca.length=0;q(a);ea.length=fa+1;da.length=$+1;!0===aa.sortObjects&&(ea.sort(n),da.sort(p));ha.render(a);ka.calls=0;ka.vertices=0;ka.faces=0;ka.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,t(ea,b,Y,e,d),t(da,b,Y,e,d)):(I.setBlending(THREE.NoBlending),t(ea,b,Y,e),t(da,
|
|
|
+b,Y,e));Ha.render(a,b);Ia.render(a,b,Ca,Da);c&&(a=c.texture,b=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),a.generateMipmaps&&b&&a.minFilter!==THREE.NearestFilter&&a.minFilter!==THREE.LinearFilter&&(a=c instanceof THREE.WebGLRenderTargetCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,c=X.get(c.texture).__webglTexture,I.bindTexture(a,c),r.generateMipmap(a),I.bindTexture(a,null)));I.setDepthTest(!0);I.setDepthWrite(!0);I.setColorWrite(!0)}};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?
|
|
|
+I.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):a===THREE.CullFaceFront?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),I.enable(r.CULL_FACE))};this.setTexture=function(a,b){var c=X.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",
|
|
|
+a);else{void 0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",g),c.__webglTexture=r.createTexture(),la.textures++);I.activeTexture(r.TEXTURE0+b);I.bindTexture(r.TEXTURE_2D,c.__webglTexture);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);r.pixelStorei(r.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=A(a.image,ga.maxTextureSize);var e=a.image,d=THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height),
|
|
|
+f=C(a.format),h=C(a.type);w(r.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<k.length&&d){for(var l=0,m=k.length;l<m;l++)e=k[l],I.texImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);a.generateMipmaps=!1}else I.texImage2D(r.TEXTURE_2D,0,f,e.width,e.height,0,f,h,e.data);else if(a instanceof THREE.CompressedTexture)for(l=0,m=k.length;l<m;l++)e=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<I.getCompressedTextureFormats().indexOf(f)?I.compressedTexImage2D(r.TEXTURE_2D,
|
|
|
+l,f,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):I.texImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);else if(0<k.length&&d){l=0;for(m=k.length;l<m;l++)e=k[l],I.texImage2D(r.TEXTURE_2D,l,f,f,h,e);a.generateMipmaps=!1}else I.texImage2D(r.TEXTURE_2D,0,f,f,h,a.image);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else I.activeTexture(r.TEXTURE0+
|
|
|
+b),I.bindTexture(r.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===X.get(a).__webglFramebuffer){var c=X.get(a),d=X.get(a.texture);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",f);d.__webglTexture=r.createTexture();la.textures++;var e=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),g=C(a.texture.format),h=C(a.texture.type);if(b){c.__webglFramebuffer=
|
|
|
+[];c.__webglRenderbuffer=[];I.bindTexture(r.TEXTURE_CUBE_MAP,d.__webglTexture);w(r.TEXTURE_CUBE_MAP,a.texture,e);for(d=0;6>d;d++)c.__webglFramebuffer[d]=r.createFramebuffer(),c.__webglRenderbuffer[d]=r.createRenderbuffer(),I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,g,a.width,a.height,0,g,h,null),y(c.__webglFramebuffer[d],a,r.TEXTURE_CUBE_MAP_POSITIVE_X+d),L(c.__webglRenderbuffer[d],a);a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=r.createFramebuffer(),
|
|
|
+c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:r.createRenderbuffer(),I.bindTexture(r.TEXTURE_2D,d.__webglTexture),w(r.TEXTURE_2D,a.texture,e),I.texImage2D(r.TEXTURE_2D,0,g,a.width,a.height,0,g,h,null),y(c.__webglFramebuffer,a,r.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,
|
|
|
+r.RENDERBUFFER,c.__webglRenderbuffer):L(c.__webglRenderbuffer,a),a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_2D);b?I.bindTexture(r.TEXTURE_CUBE_MAP,null):I.bindTexture(r.TEXTURE_2D,null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(c=X.get(a),d=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,e=a.height,h=g=0):(d=null,c=pa,e=qa,g=na,h=oa);d!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,d),r.viewport(g,h,c,e),ia=d);b&&(d=X.get(a.texture),
|
|
|
+r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,d.__webglTexture,0));Ca=c;Da=e};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!1===a instanceof THREE.WebGLRenderTarget)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var g=X.get(a).__webglFramebuffer;if(g){var h=!1;g!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,g),h=!0);try{var k=a.texture;k.format!==THREE.RGBAFormat&&C(k.format)!==
|
|
|
+r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):k.type===THREE.UnsignedByteType||C(k.type)===r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)||k.type===THREE.FloatType&&S.get("WEBGL_color_buffer_float")||k.type===THREE.HalfFloatType&&S.get("EXT_color_buffer_half_float")?r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,C(k.format),C(k.type),
|
|
|
+f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&r.bindFramebuffer(r.FRAMEBUFFER,ia)}}}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");return S.get("OES_texture_float")};this.supportsHalfFloatTextures=
|
|
|
+function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return S.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");return S.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");
|
|
|
return S.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");return S.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");return S.get("EXT_blend_minmax")};this.supportsVertexTextures=function(){return ga.vertexTextures};
|
|
|
this.supportsInstancedArrays=function(){console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).");return S.get("ANGLE_instanced_arrays")};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};
|
|
|
this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return ha.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");ha.enabled=a}},shadowMapType:{get:function(){return ha.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");ha.type=a}},shadowMapCullFace:{get:function(){return ha.cullFace},
|
|
@@ -656,38 +656,37 @@ THREE.WebGLShader=function(){function a(a){a=a.split("\n");for(var c=0;c<a.lengt
|
|
|
THREE.WebGLShadowMap=function(a,b,c){function d(a,b,c,d){var e=a.geometry,f=null,f=m,g=a.customDepthMaterial;c&&(f=q,g=a.customDistanceMaterial);g?f=g:(a=a instanceof THREE.SkinnedMesh&&b.skinning,g=0,void 0!==e.morphTargets&&0<e.morphTargets.length&&b.morphTargets&&(g|=1),a&&(g|=2),f=f[g]);f.visible=b.visible;f.wireframe=b.wireframe;f.wireframeLinewidth=b.wireframeLinewidth;c&&void 0!==f.uniforms.lightPos&&f.uniforms.lightPos.value.copy(d);return f}function e(a,b){if(!1!==a.visible){(a instanceof
|
|
|
THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Points)&&a.castShadow&&(!1===a.frustumCulled||!0===h.intersectsObject(a))&&!0===a.material.visible&&(a.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),p.push(a));for(var c=a.children,d=0,f=c.length;d<f;d++)e(c[d],b)}}var g=a.context,f=a.state,h=new THREE.Frustum,l=new THREE.Matrix4;new THREE.Vector3;new THREE.Vector3;for(var k=new THREE.Vector3,n=new THREE.Vector3,p=[],m=Array(4),q=Array(4),t=[new THREE.Vector3(1,0,0),new THREE.Vector3(-1,
|
|
|
0,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1),new THREE.Vector3(0,1,0),new THREE.Vector3(0,-1,0)],s=[new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1)],u=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],x=new THREE.Vector4,v=THREE.ShaderLib.depthRGBA,D=THREE.UniformsUtils.clone(v.uniforms),w=THREE.ShaderLib.distanceRGBA,A=THREE.UniformsUtils.clone(w.uniforms),
|
|
|
-E=0;4!==E;++E){var z=0!==(E&1),B=0!==(E&2),O=new THREE.ShaderMaterial({uniforms:D,vertexShader:v.vertexShader,fragmentShader:v.fragmentShader,morphTargets:z,skinning:B});O._shadowPass=!0;m[E]=O;z=new THREE.ShaderMaterial({uniforms:A,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,morphTargets:z,skinning:B});z._shadowPass=!0;q[E]=z}var G=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.render=function(m){var q,
|
|
|
-v;if(!1!==G.enabled&&(!1!==G.autoUpdate||!1!==G.needsUpdate)){g.clearColor(1,1,1,1);f.disable(g.BLEND);f.enable(g.CULL_FACE);g.frontFace(g.CCW);g.cullFace(G.cullFace===THREE.CullFaceFront?g.FRONT:g.BACK);f.setDepthTest(!0);a.getViewport(x);for(var w=0,D=b.length;w<D;w++){var y=b[w];if(!1!==y.castShadow){if(y instanceof THREE.PointLight){q=6;v=!0;var z=y.shadowMapWidth/4,A=y.shadowMapHeight/2;u[0].set(2*z,A,z,A);u[1].set(0,A,z,A);u[2].set(3*z,A,z,A);u[3].set(z,A,z,A);u[4].set(3*z,0,z,A);u[5].set(z,
|
|
|
-0,z,A)}else q=1,v=!1;null===y.shadowMap&&(z=THREE.LinearFilter,G.type===THREE.PCFSoftShadowMap&&(z=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadow.mapSize.x,y.shadow.mapSize.y,{minFilter:z,magFilter:z,format:THREE.RGBAFormat}),y.shadowMatrix=new THREE.Matrix4,y instanceof THREE.SpotLight&&(y.shadowCamera.aspect=y.shadow.mapSize.x/y.shadow.mapSize.y),y.shadowCamera.updateProjectionMatrix());var B=y.shadowMap,z=y.shadowMatrix,A=y.shadowCamera;n.setFromMatrixPosition(y.matrixWorld);
|
|
|
-A.position.copy(n);a.setRenderTarget(B);a.clear();for(B=0;B<q;B++){if(v){k.copy(A.position);k.add(t[B]);A.up.copy(s[B]);A.lookAt(k);var E=u[B];a.setViewport(E.x,E.y,E.z,E.w)}else k.setFromMatrixPosition(y.target.matrixWorld),A.lookAt(k);A.updateMatrixWorld();A.matrixWorldInverse.getInverse(A.matrixWorld);z.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);z.multiply(A.projectionMatrix);z.multiply(A.matrixWorldInverse);l.multiplyMatrices(A.projectionMatrix,A.matrixWorldInverse);h.setFromMatrix(l);p.length=
|
|
|
-0;e(m,A);for(var E=0,O=p.length;E<O;E++){var F=p[E],W=c.update(F),U=F.material;if(U instanceof THREE.MeshFaceMaterial)for(var Y=W.groups,U=U.materials,ca=0,fa=Y.length;ca<fa;ca++){var ea=Y[ca],$=U[ea.materialIndex];!0===$.visible&&($=d(F,$,v,n),a.renderBufferDirect(A,b,null,W,$,F,ea))}else $=d(F,U,v,n),a.renderBufferDirect(A,b,null,W,$,F,null)}}a.resetGLState()}}a.setViewport(x.x,x.y,x.z,x.w);m=a.getClearColor();q=a.getClearAlpha();a.setClearColor(m,q);f.enable(g.BLEND);G.cullFace===THREE.CullFaceFront&&
|
|
|
-g.cullFace(g.BACK);a.resetGLState();G.needsUpdate=!1}}};
|
|
|
-THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),g=new Uint8Array(16),f=new Uint8Array(16),h={},l=null,k=null,n=null,p=null,m=null,q=null,t=null,s=null,u=null,x=null,v=null,D=null,w=null,A=null,E=null,z=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),B=void 0,O={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);
|
|
|
+B=0;4!==B;++B){var z=0!==(B&1),y=0!==(B&2),L=new THREE.ShaderMaterial({uniforms:D,vertexShader:v.vertexShader,fragmentShader:v.fragmentShader,morphTargets:z,skinning:y});L._shadowPass=!0;m[B]=L;z=new THREE.ShaderMaterial({uniforms:A,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,morphTargets:z,skinning:y});z._shadowPass=!0;q[B]=z}var G=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.render=function(m){var q,
|
|
|
+v;if(!1!==G.enabled&&(!1!==G.autoUpdate||!1!==G.needsUpdate)){g.clearColor(1,1,1,1);f.disable(g.BLEND);f.enable(g.CULL_FACE);g.frontFace(g.CCW);g.cullFace(G.cullFace===THREE.CullFaceFront?g.FRONT:g.BACK);f.setDepthTest(!0);a.getViewport(x);for(var w=0,D=b.length;w<D;w++){var A=b[w];if(!1!==A.castShadow){var z=A.shadow,y=z.camera,B=z.mapSize;if(A instanceof THREE.PointLight){q=6;v=!0;var H=B.x/4,L=B.y/2;u[0].set(2*H,L,H,L);u[1].set(0,L,H,L);u[2].set(3*H,L,H,L);u[3].set(H,L,H,L);u[4].set(3*H,0,H,L);
|
|
|
+u[5].set(H,0,H,L)}else q=1,v=!1;null===z.map&&(H=THREE.LinearFilter,G.type===THREE.PCFSoftShadowMap&&(H=THREE.NearestFilter),z.map=new THREE.WebGLRenderTarget(B.x,B.y,{minFilter:H,magFilter:H,format:THREE.RGBAFormat}),z.matrix=new THREE.Matrix4,A instanceof THREE.SpotLight&&(y.aspect=B.x/B.y),y.updateProjectionMatrix());B=z.map;z=z.matrix;n.setFromMatrixPosition(A.matrixWorld);y.position.copy(n);a.setRenderTarget(B);a.clear();for(B=0;B<q;B++)for(v?(k.copy(y.position),k.add(t[B]),y.up.copy(s[B]),y.lookAt(k),
|
|
|
+H=u[B],a.setViewport(H.x,H.y,H.z,H.w)):(k.setFromMatrixPosition(A.target.matrixWorld),y.lookAt(k)),y.updateMatrixWorld(),y.matrixWorldInverse.getInverse(y.matrixWorld),z.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),z.multiply(y.projectionMatrix),z.multiply(y.matrixWorldInverse),l.multiplyMatrices(y.projectionMatrix,y.matrixWorldInverse),h.setFromMatrix(l),p.length=0,e(m,y),H=0,L=p.length;H<L;H++){var F=p[H],W=c.update(F),U=F.material;if(U instanceof THREE.MeshFaceMaterial)for(var Y=W.groups,U=U.materials,
|
|
|
+ea=0,fa=Y.length;ea<fa;ea++){var da=Y[ea],$=U[da.materialIndex];!0===$.visible&&($=d(F,$,v,n),a.renderBufferDirect(y,b,null,W,$,F,da))}else $=d(F,U,v,n),a.renderBufferDirect(y,b,null,W,$,F,null)}a.resetGLState()}}a.setViewport(x.x,x.y,x.z,x.w);m=a.getClearColor();q=a.getClearAlpha();a.setClearColor(m,q);f.enable(g.BLEND);G.cullFace===THREE.CullFaceFront&&g.cullFace(g.BACK);a.resetGLState();G.needsUpdate=!1}}};
|
|
|
+THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),g=new Uint8Array(16),f=new Uint8Array(16),h={},l=null,k=null,n=null,p=null,m=null,q=null,t=null,s=null,u=null,x=null,v=null,D=null,w=null,A=null,B=null,z=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),y=void 0,L={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);
|
|
|
a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=e.length;a<b;a++)e[a]=0};this.enableAttribute=function(c){e[c]=1;0===g[c]&&(a.enableVertexAttribArray(c),g[c]=1);0!==f[c]&&(b.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c,0),f[c]=0)};this.enableAttributeAndDivisor=function(b,c,d){e[b]=1;0===g[b]&&(a.enableVertexAttribArray(b),g[b]=1);f[b]!==c&&(d.vertexAttribDivisorANGLE(b,c),f[b]=c)};this.disableUnusedAttributes=function(){for(var b=0,c=g.length;b<
|
|
|
c;b++)g[b]!==e[b]&&(a.disableVertexAttribArray(b),g[b]=0)};this.enable=function(b){!0!==h[b]&&(a.enable(b),h[b]=!0)};this.disable=function(b){!1!==h[b]&&(a.disable(b),h[b]=!1)};this.getCompressedTextureFormats=function(){if(null===l&&(l=[],b.get("WEBGL_compressed_texture_pvrtc")||b.get("WEBGL_compressed_texture_s3tc")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)l.push(c[d]);return l};this.setBlending=function(b,d,e,f,g,h,l){b!==k&&(b===THREE.NoBlending?this.disable(a.BLEND):
|
|
|
b===THREE.AdditiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):b===THREE.SubtractiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):b===THREE.MultiplyBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):b===THREE.CustomBlending?this.enable(a.BLEND):(this.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,
|
|
|
a.ONE,a.ONE_MINUS_SRC_ALPHA)),k=b);if(b===THREE.CustomBlending){g=g||d;h=h||e;l=l||f;if(d!==n||g!==q)a.blendEquationSeparate(c(d),c(g)),n=d,q=g;if(e!==p||f!==m||h!==t||l!==s)a.blendFuncSeparate(c(e),c(f),c(h),c(l)),p=e,m=f,t=h,s=l}else s=t=q=m=p=n=null};this.setDepthFunc=function(b){if(u!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);
|
|
|
break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);u=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){x!==b&&(a.depthMask(b),x=b)};this.setColorWrite=function(b){v!==b&&(a.colorMask(b,b,b,b),v=b)};this.setFlipSided=
|
|
|
-function(b){D!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),D=b)};this.setLineWidth=function(b){b!==w&&(a.lineWidth(b),w=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||A===c&&E===d||(a.polygonOffset(c,d),A=c,E=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+z-1);B!==b&&(a.activeTexture(b),B=b)};this.bindTexture=function(b,c){void 0===
|
|
|
-B&&d.activeTexture();var e=O[B];void 0===e&&(e={type:void 0,texture:void 0},O[B]=e);if(e.type!==b||e.texture!==c)a.bindTexture(b,c),e.type=b,e.texture=c};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<g.length;b++)1===g[b]&&(a.disableVertexAttribArray(b),g[b]=0);h={};D=v=x=k=l=null}};
|
|
|
-THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,l,k,n,p,m=a.context,q=a.state,t,s,u,x,v,D;this.render=function(w,A,E,z){if(0!==b.length){w=new THREE.Vector3;var B=z/E,O=.5*E,G=.5*z,C=16/z,M=new THREE.Vector2(C*B,C),K=new THREE.Vector3(1,1,0),L=new THREE.Vector2(1,1);if(void 0===u){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),J=new Uint16Array([0,1,2,0,2,3]);t=m.createBuffer();s=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,t);m.bufferData(m.ARRAY_BUFFER,C,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
|
|
|
-s);m.bufferData(m.ELEMENT_ARRAY_BUFFER,J,m.STATIC_DRAW);v=m.createTexture();D=m.createTexture();q.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);q.bindTexture(m.TEXTURE_2D,D);m.texImage2D(m.TEXTURE_2D,0,
|
|
|
+function(b){D!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),D=b)};this.setLineWidth=function(b){b!==w&&(a.lineWidth(b),w=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||A===c&&B===d||(a.polygonOffset(c,d),A=c,B=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+z-1);y!==b&&(a.activeTexture(b),y=b)};this.bindTexture=function(b,c){void 0===
|
|
|
+y&&d.activeTexture();var e=L[y];void 0===e&&(e={type:void 0,texture:void 0},L[y]=e);if(e.type!==b||e.texture!==c)a.bindTexture(b,c),e.type=b,e.texture=c};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<g.length;b++)1===g[b]&&(a.disableVertexAttribArray(b),g[b]=0);h={};D=v=x=k=l=null}};
|
|
|
+THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,l,k,n,p,m=a.context,q=a.state,t,s,u,x,v,D;this.render=function(w,A,B,z){if(0!==b.length){w=new THREE.Vector3;var y=z/B,L=.5*B,G=.5*z,C=16/z,N=new THREE.Vector2(C*y,C),M=new THREE.Vector3(1,1,0),O=new THREE.Vector2(1,1);if(void 0===u){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),K=new Uint16Array([0,1,2,0,2,3]);t=m.createBuffer();s=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,t);m.bufferData(m.ARRAY_BUFFER,C,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
|
|
|
+s);m.bufferData(m.ELEMENT_ARRAY_BUFFER,K,m.STATIC_DRAW);v=m.createTexture();D=m.createTexture();q.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);q.bindTexture(m.TEXTURE_2D,D);m.texImage2D(m.TEXTURE_2D,0,
|
|
|
m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var C=(x=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *= visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
|
|
|
fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
|
|
|
fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
|
|
|
-J=m.createProgram(),y=m.createShader(m.FRAGMENT_SHADER),H=m.createShader(m.VERTEX_SHADER),P="precision "+a.getPrecision()+" float;\n";m.shaderSource(y,P+C.fragmentShader);m.shaderSource(H,P+C.vertexShader);m.compileShader(y);m.compileShader(H);m.attachShader(J,y);m.attachShader(J,H);m.linkProgram(J);u=J;n=m.getAttribLocation(u,"position");p=m.getAttribLocation(u,"uv");c=m.getUniformLocation(u,"renderType");d=m.getUniformLocation(u,"map");e=m.getUniformLocation(u,"occlusionMap");g=m.getUniformLocation(u,
|
|
|
-"opacity");f=m.getUniformLocation(u,"color");h=m.getUniformLocation(u,"scale");l=m.getUniformLocation(u,"rotation");k=m.getUniformLocation(u,"screenPosition")}m.useProgram(u);q.initAttributes();q.enableAttribute(n);q.enableAttribute(p);q.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,t);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,s);q.disable(m.CULL_FACE);m.depthMask(!1);J=0;for(y=
|
|
|
-b.length;J<y;J++)if(C=16/z,M.set(C*B,C),H=b[J],w.set(H.matrixWorld.elements[12],H.matrixWorld.elements[13],H.matrixWorld.elements[14]),w.applyMatrix4(A.matrixWorldInverse),w.applyProjection(A.projectionMatrix),K.copy(w),L.x=K.x*O+O,L.y=K.y*G+G,x||0<L.x&&L.x<E&&0<L.y&&L.y<z){q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,null);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,L.x-8,L.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,M.x,M.y);m.uniform3f(k,
|
|
|
-K.x,K.y,K.z);q.disable(m.BLEND);q.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,D);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,L.x-8,L.y-8,16,16,0);m.uniform1i(c,1);q.disable(m.DEPTH_TEST);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);H.positionScreen.copy(K);H.customUpdateCallback?H.customUpdateCallback(H):H.updateLensFlares();m.uniform1i(c,2);q.enable(m.BLEND);for(var P=
|
|
|
-0,T=H.lensFlares.length;P<T;P++){var Q=H.lensFlares[P];.001<Q.opacity&&.001<Q.scale&&(K.x=Q.x,K.y=Q.y,K.z=Q.z,C=Q.size*Q.scale/z,M.x=C*B,M.y=C,m.uniform3f(k,K.x,K.y,K.z),m.uniform2f(h,M.x,M.y),m.uniform1f(l,Q.rotation),m.uniform1f(g,Q.opacity),m.uniform3f(f,Q.color.r,Q.color.g,Q.color.b),q.setBlending(Q.blending,Q.blendEquation,Q.blendSrc,Q.blendDst),a.setTexture(Q.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}q.enable(m.CULL_FACE);q.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
|
|
|
-THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,l,k,n,p,m,q,t,s,u,x,v;function D(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,A=a.state,E,z,B,O,G=new THREE.Vector3,C=new THREE.Quaternion,M=new THREE.Vector3;this.render=function(K,L){if(0!==b.length){if(void 0===B){var J=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),y=new Uint16Array([0,1,2,0,2,3]);E=w.createBuffer();z=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,E);w.bufferData(w.ARRAY_BUFFER,J,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
|
|
|
-z);w.bufferData(w.ELEMENT_ARRAY_BUFFER,y,w.STATIC_DRAW);var J=w.createProgram(),y=w.createShader(w.VERTEX_SHADER),H=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(y,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
|
|
|
-w.shaderSource(H,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
|
|
|
-w.compileShader(y);w.compileShader(H);w.attachShader(J,y);w.attachShader(J,H);w.linkProgram(J);B=J;x=w.getAttribLocation(B,"position");v=w.getAttribLocation(B,"uv");c=w.getUniformLocation(B,"uvOffset");d=w.getUniformLocation(B,"uvScale");e=w.getUniformLocation(B,"rotation");g=w.getUniformLocation(B,"scale");f=w.getUniformLocation(B,"color");h=w.getUniformLocation(B,"map");l=w.getUniformLocation(B,"opacity");k=w.getUniformLocation(B,"modelViewMatrix");n=w.getUniformLocation(B,"projectionMatrix");p=
|
|
|
-w.getUniformLocation(B,"fogType");m=w.getUniformLocation(B,"fogDensity");q=w.getUniformLocation(B,"fogNear");t=w.getUniformLocation(B,"fogFar");s=w.getUniformLocation(B,"fogColor");u=w.getUniformLocation(B,"alphaTest");J=document.createElement("canvas");J.width=8;J.height=8;y=J.getContext("2d");y.fillStyle="white";y.fillRect(0,0,8,8);O=new THREE.Texture(J);O.needsUpdate=!0}w.useProgram(B);A.initAttributes();A.enableAttribute(x);A.enableAttribute(v);A.disableUnusedAttributes();A.disable(w.CULL_FACE);
|
|
|
-A.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,E);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,z);w.uniformMatrix4fv(n,!1,L.projectionMatrix.elements);A.activeTexture(w.TEXTURE0);w.uniform1i(h,0);y=J=0;(H=K.fog)?(w.uniform3f(s,H.color.r,H.color.g,H.color.b),H instanceof THREE.Fog?(w.uniform1f(q,H.near),w.uniform1f(t,H.far),w.uniform1i(p,1),y=J=1):H instanceof THREE.FogExp2&&(w.uniform1f(m,H.density),w.uniform1i(p,2),y=J=2)):
|
|
|
-(w.uniform1i(p,0),y=J=0);for(var H=0,P=b.length;H<P;H++){var T=b[H];T.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,T.matrixWorld);T.z=-T.modelViewMatrix.elements[14]}b.sort(D);for(var Q=[],H=0,P=b.length;H<P;H++){var T=b[H],R=T.material;w.uniform1f(u,R.alphaTest);w.uniformMatrix4fv(k,!1,T.modelViewMatrix.elements);T.matrixWorld.decompose(G,C,M);Q[0]=M.x;Q[1]=M.y;T=0;K.fog&&R.fog&&(T=y);J!==T&&(w.uniform1i(p,T),J=T);null!==R.map?(w.uniform2f(c,R.map.offset.x,R.map.offset.y),w.uniform2f(d,
|
|
|
-R.map.repeat.x,R.map.repeat.y)):(w.uniform2f(c,0,0),w.uniform2f(d,1,1));w.uniform1f(l,R.opacity);w.uniform3f(f,R.color.r,R.color.g,R.color.b);w.uniform1f(e,R.rotation);w.uniform2fv(g,Q);A.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst);A.setDepthTest(R.depthTest);A.setDepthWrite(R.depthWrite);R.map&&R.map.image&&R.map.image.width?a.setTexture(R.map,0):a.setTexture(O,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}A.enable(w.CULL_FACE);a.resetGLState()}}};
|
|
|
+K=m.createProgram(),E=m.createShader(m.FRAGMENT_SHADER),J=m.createShader(m.VERTEX_SHADER),Q="precision "+a.getPrecision()+" float;\n";m.shaderSource(E,Q+C.fragmentShader);m.shaderSource(J,Q+C.vertexShader);m.compileShader(E);m.compileShader(J);m.attachShader(K,E);m.attachShader(K,J);m.linkProgram(K);u=K;n=m.getAttribLocation(u,"position");p=m.getAttribLocation(u,"uv");c=m.getUniformLocation(u,"renderType");d=m.getUniformLocation(u,"map");e=m.getUniformLocation(u,"occlusionMap");g=m.getUniformLocation(u,
|
|
|
+"opacity");f=m.getUniformLocation(u,"color");h=m.getUniformLocation(u,"scale");l=m.getUniformLocation(u,"rotation");k=m.getUniformLocation(u,"screenPosition")}m.useProgram(u);q.initAttributes();q.enableAttribute(n);q.enableAttribute(p);q.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,t);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,s);q.disable(m.CULL_FACE);m.depthMask(!1);K=0;for(E=
|
|
|
+b.length;K<E;K++)if(C=16/z,N.set(C*y,C),J=b[K],w.set(J.matrixWorld.elements[12],J.matrixWorld.elements[13],J.matrixWorld.elements[14]),w.applyMatrix4(A.matrixWorldInverse),w.applyProjection(A.projectionMatrix),M.copy(w),O.x=M.x*L+L,O.y=M.y*G+G,x||0<O.x&&O.x<B&&0<O.y&&O.y<z){q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,null);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,O.x-8,O.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,N.x,N.y);m.uniform3f(k,
|
|
|
+M.x,M.y,M.z);q.disable(m.BLEND);q.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,D);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,O.x-8,O.y-8,16,16,0);m.uniform1i(c,1);q.disable(m.DEPTH_TEST);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);J.positionScreen.copy(M);J.customUpdateCallback?J.customUpdateCallback(J):J.updateLensFlares();m.uniform1i(c,2);q.enable(m.BLEND);for(var Q=
|
|
|
+0,T=J.lensFlares.length;Q<T;Q++){var H=J.lensFlares[Q];.001<H.opacity&&.001<H.scale&&(M.x=H.x,M.y=H.y,M.z=H.z,C=H.size*H.scale/z,N.x=C*y,N.y=C,m.uniform3f(k,M.x,M.y,M.z),m.uniform2f(h,N.x,N.y),m.uniform1f(l,H.rotation),m.uniform1f(g,H.opacity),m.uniform3f(f,H.color.r,H.color.g,H.color.b),q.setBlending(H.blending,H.blendEquation,H.blendSrc,H.blendDst),a.setTexture(H.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}q.enable(m.CULL_FACE);q.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
|
|
|
+THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,l,k,n,p,m,q,t,s,u,x,v;function D(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,A=a.state,B,z,y,L,G=new THREE.Vector3,C=new THREE.Quaternion,N=new THREE.Vector3;this.render=function(M,O){if(0!==b.length){if(void 0===y){var K=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),E=new Uint16Array([0,1,2,0,2,3]);B=w.createBuffer();z=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,B);w.bufferData(w.ARRAY_BUFFER,K,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
|
|
|
+z);w.bufferData(w.ELEMENT_ARRAY_BUFFER,E,w.STATIC_DRAW);var K=w.createProgram(),E=w.createShader(w.VERTEX_SHADER),J=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(E,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
|
|
|
+w.shaderSource(J,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
|
|
|
+w.compileShader(E);w.compileShader(J);w.attachShader(K,E);w.attachShader(K,J);w.linkProgram(K);y=K;x=w.getAttribLocation(y,"position");v=w.getAttribLocation(y,"uv");c=w.getUniformLocation(y,"uvOffset");d=w.getUniformLocation(y,"uvScale");e=w.getUniformLocation(y,"rotation");g=w.getUniformLocation(y,"scale");f=w.getUniformLocation(y,"color");h=w.getUniformLocation(y,"map");l=w.getUniformLocation(y,"opacity");k=w.getUniformLocation(y,"modelViewMatrix");n=w.getUniformLocation(y,"projectionMatrix");p=
|
|
|
+w.getUniformLocation(y,"fogType");m=w.getUniformLocation(y,"fogDensity");q=w.getUniformLocation(y,"fogNear");t=w.getUniformLocation(y,"fogFar");s=w.getUniformLocation(y,"fogColor");u=w.getUniformLocation(y,"alphaTest");K=document.createElement("canvas");K.width=8;K.height=8;E=K.getContext("2d");E.fillStyle="white";E.fillRect(0,0,8,8);L=new THREE.Texture(K);L.needsUpdate=!0}w.useProgram(y);A.initAttributes();A.enableAttribute(x);A.enableAttribute(v);A.disableUnusedAttributes();A.disable(w.CULL_FACE);
|
|
|
+A.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,B);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,z);w.uniformMatrix4fv(n,!1,O.projectionMatrix.elements);A.activeTexture(w.TEXTURE0);w.uniform1i(h,0);E=K=0;(J=M.fog)?(w.uniform3f(s,J.color.r,J.color.g,J.color.b),J instanceof THREE.Fog?(w.uniform1f(q,J.near),w.uniform1f(t,J.far),w.uniform1i(p,1),E=K=1):J instanceof THREE.FogExp2&&(w.uniform1f(m,J.density),w.uniform1i(p,2),E=K=2)):
|
|
|
+(w.uniform1i(p,0),E=K=0);for(var J=0,Q=b.length;J<Q;J++){var T=b[J];T.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,T.matrixWorld);T.z=-T.modelViewMatrix.elements[14]}b.sort(D);for(var H=[],J=0,Q=b.length;J<Q;J++){var T=b[J],R=T.material;w.uniform1f(u,R.alphaTest);w.uniformMatrix4fv(k,!1,T.modelViewMatrix.elements);T.matrixWorld.decompose(G,C,N);H[0]=N.x;H[1]=N.y;T=0;M.fog&&R.fog&&(T=E);K!==T&&(w.uniform1i(p,T),K=T);null!==R.map?(w.uniform2f(c,R.map.offset.x,R.map.offset.y),w.uniform2f(d,
|
|
|
+R.map.repeat.x,R.map.repeat.y)):(w.uniform2f(c,0,0),w.uniform2f(d,1,1));w.uniform1f(l,R.opacity);w.uniform3f(f,R.color.r,R.color.g,R.color.b);w.uniform1f(e,R.rotation);w.uniform2fv(g,H);A.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst);A.setDepthTest(R.depthTest);A.setDepthWrite(R.depthWrite);R.map&&R.map.image&&R.map.image.width?a.setTexture(R.map,0):a.setTexture(L,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}A.enable(w.CULL_FACE);a.resetGLState()}}};
|
|
|
THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
|
|
|
THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){function e(b){g.load(a[b],function(a){f.images[b]=a;h+=1;6===h&&(f.needsUpdate=!0,c&&c(f))},void 0,d)}var g=new THREE.ImageLoader;g.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b),h=
|
|
|
0;b=0;for(var l=a.length;b<l;++b)e(b);return f},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){function c(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]}b|=1;var d=a.width,e=a.height,g=document.createElement("canvas");
|
|
@@ -701,7 +700,7 @@ break;case "l":l=b[a++]*c+d;n=b[a++]*c;e.lineTo(l,n);break;case "q":l=b[a++]*c+d
|
|
|
m,t,u,n)}return{offset:x.ha*c,path:e}}}};
|
|
|
THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
|
|
|
(function(a){function b(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e}a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],l,k,n;if(0<b(a))for(k=0;k<e;k++)f[k]=k;else for(k=0;k<e;k++)f[k]=e-1-k;var p=2*e;for(k=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}l=k;e<=l&&(l=0);k=l+1;e<=k&&(k=0);n=k+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,D=void 0,w=void 0,q=a[f[l]].x,t=a[f[l]].y,s=a[f[k]].x,u=a[f[k]].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 A=void 0,E=void 0,z=void 0,B=void 0,O=void 0,G=void 0,C=void 0,M=void 0,K=void 0,L=void 0,K=M=C=w=D=void 0,A=x-s,E=v-u,z=q-x,B=t-v,O=s-q,G=u-t;for(m=0;m<e;m++)if(D=a[f[m]].x,w=a[f[m]].y,!(D===q&&w===t||D===s&&w===u||D===x&&w===v)&&(C=D-q,M=w-t,K=D-s,L=w-u,D-=x,w-=v,K=A*L-E*K,C=O*M-G*C,M=z*w-B*D,-1E-10<=K&&-1E-10<=M&&-1E-10<=C)){m=!1;break a}m=
|
|
|
+void 0,x=void 0,v=void 0,D=void 0,w=void 0,q=a[f[l]].x,t=a[f[l]].y,s=a[f[k]].x,u=a[f[k]].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 A=void 0,B=void 0,z=void 0,y=void 0,L=void 0,G=void 0,C=void 0,N=void 0,M=void 0,O=void 0,M=N=C=w=D=void 0,A=x-s,B=v-u,z=q-x,y=t-v,L=s-q,G=u-t;for(m=0;m<e;m++)if(D=a[f[m]].x,w=a[f[m]].y,!(D===q&&w===t||D===s&&w===u||D===x&&w===v)&&(C=D-q,N=w-t,M=D-s,O=w-u,D-=x,w-=v,M=A*O-B*M,C=L*N-G*C,N=z*w-y*D,-1E-10<=M&&-1E-10<=N&&-1E-10<=C)){m=!1;break a}m=
|
|
|
!0}}if(m){g.push([a[f[l]],a[f[k]],a[f[n]]]);h.push([f[l],f[k],f[n]]);l=k;for(n=k+1;n<e;l++,n++)f[l]=f[n];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
|
|
|
THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.playbackRate=1;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.Audio.prototype.constructor=THREE.Audio;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.autoplay&&b.play()})};c.send();return this};
|
|
@@ -741,11 +740,11 @@ k=a?!k:k;h=[];var n=[],p=[],m=0,q;n[m]=void 0;p[m]=[];var t,s;t=0;for(s=e.length
|
|
|
tos:u,hole:k}),q?(q=!1,h[u].push(m)):t=!0);q&&h[f].push(m)}0<s.length&&(t||(p=h))}t=0;for(s=n.length;t<s;t++)for(h=n[t].s,l.push(h),f=p[t],e=0,g=f.length;e<g;e++)h.holes.push(f[e].h);return l};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
|
|
|
THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
|
|
|
THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
|
|
|
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,z=h*k-g*l,B=h*n-g*p;if(1E-10<Math.abs(z)){if(0<z){if(0>B||B>z)return[];k=l*n-k*p;if(0>k||k>z)return[]}else{if(0<B||B<z)return[];k=l*n-k*p;if(0<k||k<z)return[]}if(0===k)return!f||0!==B&&B!==z?[a]:[];if(k===z)return!f||0!==B&&B!==z?[b]:[];if(0===
|
|
|
-B)return[d];if(B===z)return[e];f=k/z;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==B||l*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,z=d.x,l=e,d=e.x):(b=e,z=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,z=d.y,l=e,d=e.y):(b=e,z=e.y,l=d,d=d.y));return k<=z?a<z?[]:a===z?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
|
|
|
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,z=h*k-g*l,y=h*n-g*p;if(1E-10<Math.abs(z)){if(0<z){if(0>y||y>z)return[];k=l*n-k*p;if(0>k||k>z)return[]}else{if(0<y||y<z)return[];k=l*n-k*p;if(0<k||k<z)return[]}if(0===k)return!f||0!==y&&y!==z?[a]:[];if(k===z)return!f||0!==y&&y!==z?[b]:[];if(0===
|
|
|
+y)return[d];if(y===z)return[e];f=k/z;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==y||l*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,z=d.x,l=e,d=e.x):(b=e,z=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,z=d.y,l=e,d=e.y):(b=e,z=e.y,l=d,d=d.y));return k<=z?a<z?[]:a===z?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
|
|
|
k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,l,k,n={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)k=h[g].x+":"+h[g].y,void 0!==n[k]&&console.warn("THREE.Shape: Duplicate point",k),n[k]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
|
|
|
-0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,E,z,B,O=[],G,C,M,K=0;for(n=b.length;K<n;K++)l.push(K);G=0;for(var L=2*
|
|
|
-l.length;0<l.length;){L--;if(0>L){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=G;p<h.length;p++){E=h[p];n=-1;for(K=0;K<l.length;K++)if(z=l[K],B=E.x+":"+E.y+":"+z,void 0===O[B]){k=b[z];for(C=0;C<k.length;C++)if(z=k[C],c(p,C)&&!f(E,z)&&!g(E,z)){n=C;l.splice(K,1);G=h.slice(0,p+1);z=h.slice(p);C=k.slice(n);M=k.slice(0,n+1);h=G.concat(C).concat(M).concat(z);G=p;break}if(0<=n)break;O[B]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g,
|
|
|
+0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,B,z,y,L=[],G,C,N,M=0;for(n=b.length;M<n;M++)l.push(M);G=0;for(var O=2*
|
|
|
+l.length;0<l.length;){O--;if(0>O){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=G;p<h.length;p++){B=h[p];n=-1;for(M=0;M<l.length;M++)if(z=l[M],y=B.x+":"+B.y+":"+z,void 0===L[y]){k=b[z];for(C=0;C<k.length;C++)if(z=k[C],c(p,C)&&!f(B,z)&&!g(B,z)){n=C;l.splice(M,1);G=h.slice(0,p+1);z=h.slice(p);C=k.slice(n);N=k.slice(0,n+1);h=G.concat(C).concat(N).concat(z);G=p;break}if(0<=n)break;L[y]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g,
|
|
|
!1);g=0;for(f=p.length;g<f;g++)for(l=p[g],h=0;3>h;h++)k=l[h].x+":"+l[h].y,k=n[k],void 0!==k&&(l[h]=k);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
|
|
|
a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};
|
|
|
THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
|
|
@@ -764,8 +763,8 @@ THREE.CatmullRomCurve3=function(){function a(){}var b=new THREE.Vector3,c=new a,
|
|
|
b*a};return THREE.Curve.create(function(a){this.points=a||[]},function(a){var f=this.points,h,l;l=f.length;2>l&&console.log("duh, you need at least 2 points");a*=l-1;h=Math.floor(a);a-=h;0===a&&h===l-1&&(h=l-2,a=1);var k,n,p;0===h?(b.subVectors(f[0],f[1]).add(f[0]),k=b):k=f[h-1];n=f[h];p=f[h+1];h+2<l?f=f[h+2]:(b.subVectors(f[l-1],f[l-2]).add(f[l-2]),f=b);if(void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var m="chordal"===this.type?.5:.25;l=Math.pow(k.distanceToSquared(n),m);
|
|
|
h=Math.pow(n.distanceToSquared(p),m);m=Math.pow(p.distanceToSquared(f),m);1E-4>h&&(h=1);1E-4>l&&(l=h);1E-4>m&&(m=h);c.initNonuniformCatmullRom(k.x,n.x,p.x,f.x,l,h,m);d.initNonuniformCatmullRom(k.y,n.y,p.y,f.y,l,h,m);e.initNonuniformCatmullRom(k.z,n.z,p.z,f.z,l,h,m)}else"catmullrom"===this.type&&(l=void 0!==this.tension?this.tension:.5,c.initCatmullRom(k.x,n.x,p.x,f.x,l),d.initCatmullRom(k.y,n.y,p.y,f.y,l),e.initCatmullRom(k.z,n.z,p.z,f.z,l));return new THREE.Vector3(c.calc(a),d.calc(a),e.calc(a))})}();
|
|
|
THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(0<c?0:(Math.floor(Math.abs(c)/b.length)+1)*b.length),d=b[(c-1)%b.length],e=b[c%b.length],g=b[(c+1)%b.length],b=b[(c+2)%b.length],c=new THREE.Vector3;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,g.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,g.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,g.z,b.z,a);return c});
|
|
|
-THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,s){var u,x=h.widthSegments,v=h.heightSegments,D=e/2,w=f/2,A=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",x=h.depthSegments;var E=x+1,z=v+1,B=e/x,O=f/v,G=new THREE.Vector3;G[u]=0<g?1:-1;for(e=0;e<z;e++)for(f=0;f<E;f++){var C=new THREE.Vector3;C[a]=(f*B-D)*c;C[b]=(e*O-w)*d;C[u]=g;h.vertices.push(C)}for(e=
|
|
|
-0;e<v;e++)for(f=0;f<x;f++)w=f+E*e,a=f+E*(e+1),b=f+1+E*(e+1),c=f+1+E*e,d=new THREE.Vector2(f/x,1-e/v),g=new THREE.Vector2(f/x,1-(e+1)/v),u=new THREE.Vector2((f+1)/x,1-(e+1)/v),D=new THREE.Vector2((f+1)/x,1-e/v),w=new THREE.Face3(w+A,a+A,c+A),w.normal.copy(G),w.vertexNormals.push(G.clone(),G.clone(),G.clone()),w.materialIndex=s,h.faces.push(w),h.faceVertexUvs[0].push([d,g,D]),w=new THREE.Face3(a+A,b+A,c+A),w.normal.copy(G),w.vertexNormals.push(G.clone(),G.clone(),G.clone()),w.materialIndex=s,h.faces.push(w),
|
|
|
+THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,s){var u,x=h.widthSegments,v=h.heightSegments,D=e/2,w=f/2,A=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",x=h.depthSegments;var B=x+1,z=v+1,y=e/x,L=f/v,G=new THREE.Vector3;G[u]=0<g?1:-1;for(e=0;e<z;e++)for(f=0;f<B;f++){var C=new THREE.Vector3;C[a]=(f*y-D)*c;C[b]=(e*L-w)*d;C[u]=g;h.vertices.push(C)}for(e=
|
|
|
+0;e<v;e++)for(f=0;f<x;f++)w=f+B*e,a=f+B*(e+1),b=f+1+B*(e+1),c=f+1+B*e,d=new THREE.Vector2(f/x,1-e/v),g=new THREE.Vector2(f/x,1-(e+1)/v),u=new THREE.Vector2((f+1)/x,1-(e+1)/v),D=new THREE.Vector2((f+1)/x,1-e/v),w=new THREE.Face3(w+A,a+A,c+A),w.normal.copy(G),w.vertexNormals.push(G.clone(),G.clone(),G.clone()),w.materialIndex=s,h.faces.push(w),h.faceVertexUvs[0].push([d,g,D]),w=new THREE.Face3(a+A,b+A,c+A),w.normal.copy(G),w.vertexNormals.push(G.clone(),G.clone(),G.clone()),w.materialIndex=s,h.faces.push(w),
|
|
|
h.faceVertexUvs[0].push([g.clone(),u,D.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d,0);f("z","y",1,-1,c,b,-d,1);f("x","z",1,1,a,c,e,2);f("x","z",1,-1,a,c,-e,3);f("x","y",1,-1,a,b,g,4);f("x","y",-1,-1,a,b,-g,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.BoxGeometry.prototype.clone=function(){return new THREE.BoxGeometry(this.parameters.width,this.parameters.height,this.parameters.depth,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.depthSegments)};THREE.CubeGeometry=THREE.BoxGeometry;
|
|
|
THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,g=[];e=new THREE.Vector3;var f=new THREE.Vector2(.5,.5);this.vertices.push(e);g.push(f);for(e=0;e<=b;e++){var h=new THREE.Vector3,l=c+e/b*d;h.x=a*Math.cos(l);h.y=a*Math.sin(l);this.vertices.push(h);g.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
|
|
@@ -776,20 +775,20 @@ THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);thi
|
|
|
THREE.CircleBufferGeometry.prototype.clone=function(){var a=new THREE.CircleBufferGeometry(this.parameters.radius,this.parameters.segments,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a};
|
|
|
THREE.CylinderGeometry=function(a,b,c,d,e,g,f,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g,thetaStart:f,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;f=void 0!==f?f:0;h=void 0!==h?h:2*Math.PI;var l=c/2,k,n,p=[],m=[];for(n=0;n<=e;n++){var q=[],t=[],s=n/e,u=s*(b-a)+a;for(k=0;k<=d;k++){var x=k/d,v=new THREE.Vector3;v.x=u*Math.sin(x*h+
|
|
|
f);v.y=-s*c+l;v.z=u*Math.cos(x*h+f);this.vertices.push(v);q.push(this.vertices.length-1);t.push(new THREE.Vector2(x,1-s))}p.push(q);m.push(t)}c=(b-a)/c;for(k=0;k<d;k++)for(0!==a?(f=this.vertices[p[0][k]].clone(),h=this.vertices[p[0][k+1]].clone()):(f=this.vertices[p[1][k]].clone(),h=this.vertices[p[1][k+1]].clone()),f.setY(Math.sqrt(f.x*f.x+f.z*f.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var q=p[n][k],t=p[n+1][k],s=p[n+1][k+1],u=p[n][k+1],x=f.clone(),v=f.clone(),
|
|
|
-D=h.clone(),w=h.clone(),A=m[n][k].clone(),E=m[n+1][k].clone(),z=m[n+1][k+1].clone(),B=m[n][k+1].clone();this.faces.push(new THREE.Face3(q,t,u,[x,v,w]));this.faceVertexUvs[0].push([A,E,B]);this.faces.push(new THREE.Face3(t,s,u,[v.clone(),D,w.clone()]));this.faceVertexUvs[0].push([E.clone(),z,B.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,l,0)),k=0;k<d;k++)q=p[0][k],t=p[0][k+1],s=this.vertices.length-1,x=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),D=new THREE.Vector3(0,
|
|
|
-1,0),A=m[0][k].clone(),E=m[0][k+1].clone(),z=new THREE.Vector2(E.x,0),this.faces.push(new THREE.Face3(q,t,s,[x,v,D],void 0,1)),this.faceVertexUvs[0].push([A,E,z]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-l,0)),k=0;k<d;k++)q=p[e][k+1],t=p[e][k],s=this.vertices.length-1,x=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),D=new THREE.Vector3(0,-1,0),A=m[e][k+1].clone(),E=m[e][k].clone(),z=new THREE.Vector2(E.x,1),this.faces.push(new THREE.Face3(q,t,s,[x,v,D],void 0,2)),this.faceVertexUvs[0].push([A,
|
|
|
-E,z]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.CylinderGeometry.prototype.clone=function(){return new THREE.CylinderGeometry(this.parameters.radiusTop,this.parameters.radiusBottom,this.parameters.height,this.parameters.radialSegments,this.parameters.heightSegments,this.parameters.openEnded,this.parameters.thetaStart,this.parameters.thetaLength)};
|
|
|
+D=h.clone(),w=h.clone(),A=m[n][k].clone(),B=m[n+1][k].clone(),z=m[n+1][k+1].clone(),y=m[n][k+1].clone();this.faces.push(new THREE.Face3(q,t,u,[x,v,w]));this.faceVertexUvs[0].push([A,B,y]);this.faces.push(new THREE.Face3(t,s,u,[v.clone(),D,w.clone()]));this.faceVertexUvs[0].push([B.clone(),z,y.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,l,0)),k=0;k<d;k++)q=p[0][k],t=p[0][k+1],s=this.vertices.length-1,x=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),D=new THREE.Vector3(0,
|
|
|
+1,0),A=m[0][k].clone(),B=m[0][k+1].clone(),z=new THREE.Vector2(B.x,0),this.faces.push(new THREE.Face3(q,t,s,[x,v,D],void 0,1)),this.faceVertexUvs[0].push([A,B,z]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-l,0)),k=0;k<d;k++)q=p[e][k+1],t=p[e][k],s=this.vertices.length-1,x=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),D=new THREE.Vector3(0,-1,0),A=m[e][k+1].clone(),B=m[e][k].clone(),z=new THREE.Vector2(B.x,1),this.faces.push(new THREE.Face3(q,t,s,[x,v,D],void 0,2)),this.faceVertexUvs[0].push([A,
|
|
|
+B,z]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.CylinderGeometry.prototype.clone=function(){return new THREE.CylinderGeometry(this.parameters.radiusTop,this.parameters.radiusBottom,this.parameters.height,this.parameters.radialSegments,this.parameters.heightSegments,this.parameters.openEnded,this.parameters.thetaStart,this.parameters.thetaLength)};
|
|
|
THREE.EdgesGeometry=function(a,b){function c(a,b){return a-b}THREE.BufferGeometry.call(this);var d=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),e=[0,0],g={},f=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var l=h.vertices;h=h.faces;for(var k=0,n=h.length;k<n;k++)for(var p=h[k],m=0;3>m;m++){e[0]=p[f[m]];e[1]=p[f[(m+1)%3]];e.sort(c);var q=e.toString();void 0===g[q]?g[q]={vert1:e[0],vert2:e[1],face1:k,
|
|
|
face2:void 0}:g[q].face2=k}e=[];for(q in g)if(f=g[q],void 0===f.face2||h[f.face1].normal.dot(h[f.face2].normal)<=d)k=l[f.vert1],e.push(k.x),e.push(k.y),e.push(k.z),k=l[f.vert2],e.push(k.x),e.push(k.y),e.push(k.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(e),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
|
|
|
THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
|
|
|
THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=
|
|
|
-!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(F=a.length;0<=--F;){c=F;d=F-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=T*e,h=T*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+G,g=g+G,l=l+G,h=h+G;O.faces.push(new THREE.Face3(k,g,h));O.faces.push(new THREE.Face3(g,l,h));k=x.generateSideWallUV(O,k,g,l,h);O.faceVertexUvs[0].push([k[0],k[1],k[3]]);O.faceVertexUvs[0].push([k[1],
|
|
|
-k[2],k[3]])}}}function g(a,b,c){O.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=G;b+=G;c+=G;O.faces.push(new THREE.Face3(a,b,c));a=x.generateTopUV(O,a,b,c);O.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,l=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:l-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,t=b.extrudePath,
|
|
|
-s,u=!1,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,D,w,A;t&&(s=t.getSpacedPoints(q),u=!0,p=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,q,!1),D=new THREE.Vector3,w=new THREE.Vector3,A=new THREE.Vector3);p||(k=l=n=0);var E,z,B,O=this,G=this.vertices.length,t=a.extractPoints(m),m=t.shape,C=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();z=0;for(B=C.length;z<B;z++)E=C[z],THREE.Shape.Utils.isClockWise(E)&&(C[z]=E.reverse());t=
|
|
|
-!1}var M=THREE.Shape.Utils.triangulateShape(m,C),K=m;z=0;for(B=C.length;z<B;z++)E=C[z],m=m.concat(E);var L,J,y,H,P,T=m.length,Q,R=M.length,t=[],F=0;y=K.length;L=y-1;for(J=F+1;F<y;F++,L++,J++)L===y&&(L=0),J===y&&(J=0),t[F]=d(K[F],K[L],K[J]);var W=[],U,Y=t.concat();z=0;for(B=C.length;z<B;z++){E=C[z];U=[];F=0;y=E.length;L=y-1;for(J=F+1;F<y;F++,L++,J++)L===y&&(L=0),J===y&&(J=0),U[F]=d(E[F],E[L],E[J]);W.push(U);Y=Y.concat(U)}for(L=0;L<n;L++){y=L/n;H=l*(1-y);J=k*Math.sin(y*Math.PI/2);F=0;for(y=K.length;F<
|
|
|
-y;F++)P=c(K[F],t[F],J),g(P.x,P.y,-H);z=0;for(B=C.length;z<B;z++)for(E=C[z],U=W[z],F=0,y=E.length;F<y;F++)P=c(E[F],U[F],J),g(P.x,P.y,-H)}J=k;for(F=0;F<T;F++)P=p?c(m[F],Y[F],J):m[F],u?(w.copy(v.normals[0]).multiplyScalar(P.x),D.copy(v.binormals[0]).multiplyScalar(P.y),A.copy(s[0]).add(w).add(D),g(A.x,A.y,A.z)):g(P.x,P.y,0);for(y=1;y<=q;y++)for(F=0;F<T;F++)P=p?c(m[F],Y[F],J):m[F],u?(w.copy(v.normals[y]).multiplyScalar(P.x),D.copy(v.binormals[y]).multiplyScalar(P.y),A.copy(s[y]).add(w).add(D),g(A.x,A.y,
|
|
|
-A.z)):g(P.x,P.y,h/q*y);for(L=n-1;0<=L;L--){y=L/n;H=l*(1-y);J=k*Math.sin(y*Math.PI/2);F=0;for(y=K.length;F<y;F++)P=c(K[F],t[F],J),g(P.x,P.y,h+H);z=0;for(B=C.length;z<B;z++)for(E=C[z],U=W[z],F=0,y=E.length;F<y;F++)P=c(E[F],U[F],J),u?g(P.x,P.y+s[q-1].y,s[q-1].x+H):g(P.x,P.y,h+H)}(function(){if(p){var a;a=0*T;for(F=0;F<R;F++)Q=M[F],f(Q[2]+a,Q[1]+a,Q[0]+a);a=q+2*n;a*=T;for(F=0;F<R;F++)Q=M[F],f(Q[0]+a,Q[1]+a,Q[2]+a)}else{for(F=0;F<R;F++)Q=M[F],f(Q[2],Q[1],Q[0]);for(F=0;F<R;F++)Q=M[F],f(Q[0]+T*q,Q[1]+T*
|
|
|
-q,Q[2]+T*q)}})();(function(){var a=0;e(K,a);a+=K.length;z=0;for(B=C.length;z<B;z++)E=C[z],e(E,a),a+=E.length})()};
|
|
|
+!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(F=a.length;0<=--F;){c=F;d=F-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=T*e,h=T*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+G,g=g+G,l=l+G,h=h+G;L.faces.push(new THREE.Face3(k,g,h));L.faces.push(new THREE.Face3(g,l,h));k=x.generateSideWallUV(L,k,g,l,h);L.faceVertexUvs[0].push([k[0],k[1],k[3]]);L.faceVertexUvs[0].push([k[1],
|
|
|
+k[2],k[3]])}}}function g(a,b,c){L.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=G;b+=G;c+=G;L.faces.push(new THREE.Face3(a,b,c));a=x.generateTopUV(L,a,b,c);L.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,l=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:l-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,t=b.extrudePath,
|
|
|
+s,u=!1,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,D,w,A;t&&(s=t.getSpacedPoints(q),u=!0,p=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,q,!1),D=new THREE.Vector3,w=new THREE.Vector3,A=new THREE.Vector3);p||(k=l=n=0);var B,z,y,L=this,G=this.vertices.length,t=a.extractPoints(m),m=t.shape,C=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();z=0;for(y=C.length;z<y;z++)B=C[z],THREE.Shape.Utils.isClockWise(B)&&(C[z]=B.reverse());t=
|
|
|
+!1}var N=THREE.Shape.Utils.triangulateShape(m,C),M=m;z=0;for(y=C.length;z<y;z++)B=C[z],m=m.concat(B);var O,K,E,J,Q,T=m.length,H,R=N.length,t=[],F=0;E=M.length;O=E-1;for(K=F+1;F<E;F++,O++,K++)O===E&&(O=0),K===E&&(K=0),t[F]=d(M[F],M[O],M[K]);var W=[],U,Y=t.concat();z=0;for(y=C.length;z<y;z++){B=C[z];U=[];F=0;E=B.length;O=E-1;for(K=F+1;F<E;F++,O++,K++)O===E&&(O=0),K===E&&(K=0),U[F]=d(B[F],B[O],B[K]);W.push(U);Y=Y.concat(U)}for(O=0;O<n;O++){E=O/n;J=l*(1-E);K=k*Math.sin(E*Math.PI/2);F=0;for(E=M.length;F<
|
|
|
+E;F++)Q=c(M[F],t[F],K),g(Q.x,Q.y,-J);z=0;for(y=C.length;z<y;z++)for(B=C[z],U=W[z],F=0,E=B.length;F<E;F++)Q=c(B[F],U[F],K),g(Q.x,Q.y,-J)}K=k;for(F=0;F<T;F++)Q=p?c(m[F],Y[F],K):m[F],u?(w.copy(v.normals[0]).multiplyScalar(Q.x),D.copy(v.binormals[0]).multiplyScalar(Q.y),A.copy(s[0]).add(w).add(D),g(A.x,A.y,A.z)):g(Q.x,Q.y,0);for(E=1;E<=q;E++)for(F=0;F<T;F++)Q=p?c(m[F],Y[F],K):m[F],u?(w.copy(v.normals[E]).multiplyScalar(Q.x),D.copy(v.binormals[E]).multiplyScalar(Q.y),A.copy(s[E]).add(w).add(D),g(A.x,A.y,
|
|
|
+A.z)):g(Q.x,Q.y,h/q*E);for(O=n-1;0<=O;O--){E=O/n;J=l*(1-E);K=k*Math.sin(E*Math.PI/2);F=0;for(E=M.length;F<E;F++)Q=c(M[F],t[F],K),g(Q.x,Q.y,h+J);z=0;for(y=C.length;z<y;z++)for(B=C[z],U=W[z],F=0,E=B.length;F<E;F++)Q=c(B[F],U[F],K),u?g(Q.x,Q.y+s[q-1].y,s[q-1].x+J):g(Q.x,Q.y,h+J)}(function(){if(p){var a;a=0*T;for(F=0;F<R;F++)H=N[F],f(H[2]+a,H[1]+a,H[0]+a);a=q+2*n;a*=T;for(F=0;F<R;F++)H=N[F],f(H[0]+a,H[1]+a,H[2]+a)}else{for(F=0;F<R;F++)H=N[F],f(H[2],H[1],H[0]);for(F=0;F<R;F++)H=N[F],f(H[0]+T*q,H[1]+T*
|
|
|
+q,H[2]+T*q)}})();(function(){var a=0;e(M,a);a+=M.length;z=0;for(y=C.length;z<y;z++)B=C[z],e(B,a),a+=B.length})()};
|
|
|
THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
|
|
|
1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
|
|
|
THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var l=e.shape,k=e.holes;if(!THREE.Shape.Utils.isClockWise(l))for(l=l.reverse(),e=0,g=k.length;e<g;e++)f=k[e],THREE.Shape.Utils.isClockWise(f)&&(k[e]=f.reverse());var n=THREE.Shape.Utils.triangulateShape(l,k);e=0;for(g=k.length;e<g;e++)f=k[e],
|
|
@@ -850,8 +849,8 @@ THREE.BoxHelper=function(a){var b=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7
|
|
|
THREE.BoxHelper.prototype.update=function(){var a=new THREE.Box3;return function(b){a.setFromObject(b);if(!a.empty()){b=a.min;var c=a.max,d=this.geometry.attributes.position,e=d.array;e[0]=c.x;e[1]=c.y;e[2]=c.z;e[3]=b.x;e[4]=c.y;e[5]=c.z;e[6]=b.x;e[7]=b.y;e[8]=c.z;e[9]=c.x;e[10]=b.y;e[11]=c.z;e[12]=c.x;e[13]=c.y;e[14]=b.z;e[15]=b.x;e[16]=c.y;e[17]=b.z;e[18]=b.x;e[19]=b.y;e[20]=b.z;e[21]=c.x;e[22]=b.y;e[23]=b.z;d.needsUpdate=!0;this.geometry.computeBoundingSphere()}}}();
|
|
|
THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper;THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)};
|
|
|
THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3);d.colors.push(new THREE.Color(b));void 0===g[a]&&(g[a]=[]);g[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),g={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);b("n1","f1",16755200);
|
|
|
-b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.LineSegments.call(this,d,e);this.camera=a;this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=g;this.update()};THREE.CameraHelper.prototype=Object.create(THREE.LineSegments.prototype);
|
|
|
-THREE.CameraHelper.prototype.constructor=THREE.CameraHelper;
|
|
|
+b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.LineSegments.call(this,d,e);this.camera=a;this.camera.updateProjectionMatrix();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=g;this.update()};
|
|
|
+THREE.CameraHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.CameraHelper.prototype.constructor=THREE.CameraHelper;
|
|
|
THREE.CameraHelper.prototype.update=function(){function a(a,f,h,l){d.set(f,h,l).unproject(e);a=c[a];if(void 0!==a)for(f=0,h=a.length;f<h;f++)b.vertices[a[f]].copy(d)}var b,c,d=new THREE.Vector3,e=new THREE.Camera;return function(){b=this.geometry;c=this.pointMap;e.projectionMatrix.copy(this.camera.projectionMatrix);a("c",0,0,-1);a("t",0,0,1);a("n1",-1,-1,-1);a("n2",1,-1,-1);a("n3",-1,1,-1);a("n4",1,1,-1);a("f1",-1,-1,1);a("f2",1,-1,1);a("f3",-1,1,1);a("f4",1,1,1);a("u1",.7,1.1,-1);a("u2",-.7,1.1,
|
|
|
-1);a("u3",0,2,-1);a("cf1",-1,0,1);a("cf2",1,0,1);a("cf3",0,-1,1);a("cf4",0,1,1);a("cn1",-1,0,-1);a("cn2",1,0,-1);a("cn3",0,-1,-1);a("cn4",0,1,-1);b.verticesNeedUpdate=!0}}();
|
|
|
THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;b=b||1;var c=new THREE.Geometry;c.vertices.push(new THREE.Vector3(-b,b,0),new THREE.Vector3(b,b,0),new THREE.Vector3(b,-b,0),new THREE.Vector3(-b,-b,0),new THREE.Vector3(-b,b,0));var d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightPlane=new THREE.Line(c,d);this.add(this.lightPlane);
|