|
@@ -1,5 +1,5 @@
|
|
// three.js - http://github.com/mrdoob/three.js
|
|
// three.js - http://github.com/mrdoob/three.js
|
|
-'use strict';var THREE=THREE||{REVISION:"61dev"};self.console=self.console||{info:function(){},log:function(){},debug:function(){},warn:function(){},error:function(){}};String.prototype.trim=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")};THREE.extend=function(a,b){if(Object.keys)for(var c=Object.keys(b),d=0,e=c.length;d<e;d++){var f=c[d];Object.defineProperty(a,f,Object.getOwnPropertyDescriptor(b,f))}else for(f in c={}.hasOwnProperty,b)c.call(b,f)&&(a[f]=b[f]);return a};
|
|
|
|
|
|
+'use strict';var THREE=THREE||{REVISION:"61"};self.console=self.console||{info:function(){},log:function(){},debug:function(){},warn:function(){},error:function(){}};String.prototype.trim=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")};THREE.extend=function(a,b){if(Object.keys)for(var c=Object.keys(b),d=0,e=c.length;d<e;d++){var f=c[d];Object.defineProperty(a,f,Object.getOwnPropertyDescriptor(b,f))}else for(f in c={}.hasOwnProperty,b)c.call(b,f)&&(a[f]=b[f]);return a};
|
|
(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!self.requestAnimationFrame;++c)self.requestAnimationFrame=self[b[c]+"RequestAnimationFrame"],self.cancelAnimationFrame=self[b[c]+"CancelAnimationFrame"]||self[b[c]+"CancelRequestAnimationFrame"];void 0===self.requestAnimationFrame&&void 0!==self.setTimeout&&(self.requestAnimationFrame=function(b){var c=Date.now(),f=Math.max(0,16-(c-a)),h=self.setTimeout(function(){b(c+f)},f);a=c+f;return h});void 0===self.cancelAnimationFrame&&void 0!==
|
|
(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!self.requestAnimationFrame;++c)self.requestAnimationFrame=self[b[c]+"RequestAnimationFrame"],self.cancelAnimationFrame=self[b[c]+"CancelAnimationFrame"]||self[b[c]+"CancelRequestAnimationFrame"];void 0===self.requestAnimationFrame&&void 0!==self.setTimeout&&(self.requestAnimationFrame=function(b){var c=Date.now(),f=Math.max(0,16-(c-a)),h=self.setTimeout(function(){b(c+f)},f);a=c+f;return h});void 0===self.cancelAnimationFrame&&void 0!==
|
|
self.clearTimeout&&(self.cancelAnimationFrame=function(a){self.clearTimeout(a)})})();THREE.CullFaceNone=0;THREE.CullFaceBack=1;THREE.CullFaceFront=2;THREE.CullFaceFrontBack=3;THREE.FrontFaceDirectionCW=0;THREE.FrontFaceDirectionCCW=1;THREE.BasicShadowMap=0;THREE.PCFShadowMap=1;THREE.PCFSoftShadowMap=2;THREE.FrontSide=0;THREE.BackSide=1;THREE.DoubleSide=2;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0;
|
|
self.clearTimeout&&(self.cancelAnimationFrame=function(a){self.clearTimeout(a)})})();THREE.CullFaceNone=0;THREE.CullFaceBack=1;THREE.CullFaceFront=2;THREE.CullFaceFrontBack=3;THREE.FrontFaceDirectionCW=0;THREE.FrontFaceDirectionCCW=1;THREE.BasicShadowMap=0;THREE.PCFShadowMap=1;THREE.PCFSoftShadowMap=2;THREE.FrontSide=0;THREE.BackSide=1;THREE.DoubleSide=2;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0;
|
|
THREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.CustomBlending=5;THREE.AddEquation=100;THREE.SubtractEquation=101;THREE.ReverseSubtractEquation=102;THREE.ZeroFactor=200;THREE.OneFactor=201;THREE.SrcColorFactor=202;THREE.OneMinusSrcColorFactor=203;THREE.SrcAlphaFactor=204;THREE.OneMinusSrcAlphaFactor=205;THREE.DstAlphaFactor=206;THREE.OneMinusDstAlphaFactor=207;THREE.DstColorFactor=208;THREE.OneMinusDstColorFactor=209;
|
|
THREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.CustomBlending=5;THREE.AddEquation=100;THREE.SubtractEquation=101;THREE.ReverseSubtractEquation=102;THREE.ZeroFactor=200;THREE.OneFactor=201;THREE.SrcColorFactor=202;THREE.OneMinusSrcColorFactor=203;THREE.SrcAlphaFactor=204;THREE.OneMinusSrcAlphaFactor=205;THREE.DstAlphaFactor=206;THREE.OneMinusDstAlphaFactor=207;THREE.DstColorFactor=208;THREE.OneMinusDstColorFactor=209;
|
|
@@ -90,7 +90,7 @@ f*d,b[1]=f*e,b[5]=f*g,b[9]=-c,b[2]=i*c-k,b[6]=m+a*c,b[10]=f*h):"ZXY"===a.order?(
|
|
h*g,b[4]=-e,b[8]=d*g,b[1]=a*e+m,b[5]=f*g,b[9]=i*e-k,b[2]=k*e-i,b[6]=c*g,b[10]=m*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("DEPRECATED: Matrix4's .setRotationFromQuaternion() has been deprecated in favor of makeRotationFromQuaternion. Please update your code.");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,h=c+c,g=d+d,i=e+e,a=c*h,k=c*g,c=
|
|
h*g,b[4]=-e,b[8]=d*g,b[1]=a*e+m,b[5]=f*g,b[9]=i*e-k,b[2]=k*e-i,b[6]=c*g,b[10]=m*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("DEPRECATED: Matrix4's .setRotationFromQuaternion() has been deprecated in favor of makeRotationFromQuaternion. Please update your code.");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,h=c+c,g=d+d,i=e+e,a=c*h,k=c*g,c=
|
|
c*i,m=d*g,d=d*i,e=e*i,h=f*h,g=f*g,f=f*i;b[0]=1-(m+e);b[4]=k-f;b[8]=c+g;b[1]=k+f;b[5]=1-(a+e);b[9]=d-h;b[2]=c-g;b[6]=d+h;b[10]=1-(a+m);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=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var h=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);h[0]=a.x;
|
|
c*i,m=d*g,d=d*i,e=e*i,h=f*h,g=f*g,f=f*i;b[0]=1-(m+e);b[4]=k-f;b[8]=c+g;b[1]=k+f;b[5]=1-(a+e);b[9]=d-h;b[2]=c-g;b[6]=d+h;b[10]=1-(a+m);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=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var h=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);h[0]=a.x;
|
|
h[4]=b.x;h[8]=c.x;h[1]=a.y;h[5]=b.y;h[9]=c.y;h[2]=a.z;h[6]=b.z;h[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Matrix4's .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,f=c[0],h=c[4],g=c[8],i=c[12],k=c[1],m=c[5],l=c[9],p=c[13],r=c[2],t=c[6],n=c[10],s=c[14],q=c[3],u=c[7],w=c[11],c=c[15],
|
|
h[4]=b.x;h[8]=c.x;h[1]=a.y;h[5]=b.y;h[9]=c.y;h[2]=a.z;h[6]=b.z;h[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Matrix4's .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,f=c[0],h=c[4],g=c[8],i=c[12],k=c[1],m=c[5],l=c[9],p=c[13],r=c[2],t=c[6],n=c[10],s=c[14],q=c[3],u=c[7],w=c[11],c=c[15],
|
|
-E=d[0],C=d[4],F=d[8],y=d[12],A=d[1],z=d[5],O=d[9],B=d[13],D=d[2],I=d[6],v=d[10],x=d[14],G=d[3],R=d[7],J=d[11],d=d[15];e[0]=f*E+h*A+g*D+i*G;e[4]=f*C+h*z+g*I+i*R;e[8]=f*F+h*O+g*v+i*J;e[12]=f*y+h*B+g*x+i*d;e[1]=k*E+m*A+l*D+p*G;e[5]=k*C+m*z+l*I+p*R;e[9]=k*F+m*O+l*v+p*J;e[13]=k*y+m*B+l*x+p*d;e[2]=r*E+t*A+n*D+s*G;e[6]=r*C+t*z+n*I+s*R;e[10]=r*F+t*O+n*v+s*J;e[14]=r*y+t*B+n*x+s*d;e[3]=q*E+u*A+w*D+c*G;e[7]=q*C+u*z+w*I+c*R;e[11]=q*F+u*O+w*v+c*J;e[15]=q*y+u*B+w*x+c*d;return this},multiplyToArray:function(a,b,
|
|
|
|
|
|
+E=d[0],C=d[4],F=d[8],y=d[12],A=d[1],z=d[5],O=d[9],B=d[13],D=d[2],I=d[6],v=d[10],x=d[14],G=d[3],Q=d[7],J=d[11],d=d[15];e[0]=f*E+h*A+g*D+i*G;e[4]=f*C+h*z+g*I+i*Q;e[8]=f*F+h*O+g*v+i*J;e[12]=f*y+h*B+g*x+i*d;e[1]=k*E+m*A+l*D+p*G;e[5]=k*C+m*z+l*I+p*Q;e[9]=k*F+m*O+l*v+p*J;e[13]=k*y+m*B+l*x+p*d;e[2]=r*E+t*A+n*D+s*G;e[6]=r*C+t*z+n*I+s*Q;e[10]=r*F+t*O+n*v+s*J;e[14]=r*y+t*B+n*x+s*d;e[3]=q*E+u*A+w*D+c*G;e[7]=q*C+u*z+w*I+c*Q;e[11]=q*F+u*O+w*v+c*J;e[15]=q*y+u*B+w*x+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("DEPRECATED: Matrix4's .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
|
|
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("DEPRECATED: Matrix4's .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
|
|
return a.applyProjection(this)},multiplyVector4:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(){var a=new THREE.Vector3;return function(b){for(var c=0,d=b.length;c<d;c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyProjection(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("DEPRECATED: Matrix4's .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");
|
|
return a.applyProjection(this)},multiplyVector4:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(){var a=new THREE.Vector3;return function(b){for(var c=0,d=b.length;c<d;c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyProjection(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("DEPRECATED: Matrix4's .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");
|
|
a.transformDirection(this)},crossVector:function(a){console.warn("DEPRECATED: Matrix4's .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],f=a[1],h=a[5],g=a[9],i=a[13],k=a[2],m=a[6],l=a[10],p=a[14];return a[3]*(+e*g*m-d*i*m-e*h*l+c*i*l+d*h*p-c*g*p)+a[7]*(+b*g*p-b*i*l+e*f*l-d*f*p+d*i*k-e*g*k)+a[11]*(+b*i*m-b*h*p-e*f*m+c*f*p+e*h*k-c*i*k)+a[15]*(-d*h*k-b*g*m+b*h*l+d*f*m-c*f*
|
|
a.transformDirection(this)},crossVector:function(a){console.warn("DEPRECATED: Matrix4's .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],f=a[1],h=a[5],g=a[9],i=a[13],k=a[2],m=a[6],l=a[10],p=a[14];return a[3]*(+e*g*m-d*i*m-e*h*l+c*i*l+d*h*p-c*g*p)+a[7]*(+b*g*p-b*i*l+e*f*l-d*f*p+d*i*k-e*g*k)+a[11]*(+b*i*m-b*h*p-e*f*m+c*f*p+e*h*k-c*i*k)+a[15]*(-d*h*k-b*g*m+b*h*l+d*f*m-c*f*
|
|
@@ -158,17 +158,17 @@ e))return e}},getChildByName:function(a,b){console.warn("DEPRECATED: Object3D's
|
|
this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);
|
|
this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);
|
|
a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());
|
|
a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());
|
|
return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(i===m){var a=new THREE.RenderableVertex;k.push(a);m++;i++;return a}return k[i++]}function b(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,h=-a.z+a.w,g=-b.z+b.w;if(0<=e&&0<=f&&0<=h&&0<=g)return!0;if(0>e&&0>f||0>h&&0>g)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>h?c=Math.max(c,h/(h-g)):0>g&&(d=Math.min(d,h/(h-g)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var d,e,f=[],h=
|
|
return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(i===m){var a=new THREE.RenderableVertex;k.push(a);m++;i++;return a}return k[i++]}function b(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,h=-a.z+a.w,g=-b.z+b.w;if(0<=e&&0<=f&&0<=h&&0<=g)return!0;if(0>e&&0>f||0>h&&0>g)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>h?c=Math.max(c,h/(h-g)):0>g&&(d=Math.min(d,h/(h-g)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var d,e,f=[],h=
|
|
-0,g,i,k=[],m=0,l,p,r=[],t=0,n,s,q=[],u=0,w,E,C=[],F=0,y={objects:[],sprites:[],lights:[],elements:[]},A=new THREE.Vector3,z=new THREE.Vector4,O=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),B=new THREE.Box3,D=Array(3),I=new THREE.Matrix4,v=new THREE.Matrix4,x,G=new THREE.Matrix4,R=new THREE.Matrix3,J=new THREE.Matrix3,ca=new THREE.Vector3,oa=new THREE.Frustum,pa=new THREE.Vector4,N=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);
|
|
|
|
|
|
+0,g,i,k=[],m=0,l,p,r=[],t=0,n,s,q=[],u=0,w,E,C=[],F=0,y={objects:[],sprites:[],lights:[],elements:[]},A=new THREE.Vector3,z=new THREE.Vector4,O=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),B=new THREE.Box3,D=Array(3),I=new THREE.Matrix4,v=new THREE.Matrix4,x,G=new THREE.Matrix4,Q=new THREE.Matrix3,J=new THREE.Matrix3,ca=new THREE.Vector3,oa=new THREE.Frustum,pa=new THREE.Vector4,N=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);
|
|
v.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(v)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);v.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyProjection(v)};this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var M=function(a){if(e===h){var b=new THREE.RenderableObject;
|
|
v.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(v)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);v.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyProjection(v)};this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var M=function(a){if(e===h){var b=new THREE.RenderableObject;
|
|
-f.push(b);h++;e++;d=b}else d=f[e++];d.id=a.id;d.object=a;null!==a.renderDepth?d.z=a.renderDepth:(A.getPositionFromMatrix(a.matrixWorld),A.applyProjection(v),d.z=A.z);return d},Q=function(a){if(!1!==a.visible){a instanceof THREE.Light?y.lights.push(a):a instanceof THREE.Mesh||a instanceof THREE.Line?(!1===a.frustumCulled||!0===oa.intersectsObject(a))&&y.objects.push(M(a)):(a instanceof THREE.Sprite||a instanceof THREE.Particle)&&y.sprites.push(M(a));for(var b=0,c=a.children.length;b<c;b++)Q(a.children[b])}};
|
|
|
|
-this.projectScene=function(d,f,h,m){var A=!1,M,$,ea,V,P,Y,T,ka,ta,ia,La,Ga;E=s=p=0;y.elements.length=0;!0===d.autoUpdate&&d.updateMatrixWorld();void 0===f.parent&&f.updateMatrixWorld();I.copy(f.matrixWorldInverse.getInverse(f.matrixWorld));v.multiplyMatrices(f.projectionMatrix,I);J.getNormalMatrix(I);oa.setFromMatrix(v);e=0;y.objects.length=0;y.sprites.length=0;y.lights.length=0;Q(d);!0===h&&y.objects.sort(b);d=0;for(h=y.objects.length;d<h;d++)if(T=y.objects[d].object,x=T.matrixWorld,i=0,T instanceof
|
|
|
|
-THREE.Mesh){ka=T.geometry;ea=ka.vertices;ta=ka.faces;ka=ka.faceVertexUvs;R.getNormalMatrix(x);La=T.material instanceof THREE.MeshFaceMaterial;Ga=!0===La?T.material:null;M=0;for($=ea.length;M<$;M++){g=a();g.positionWorld.copy(ea[M]).applyMatrix4(x);g.positionScreen.copy(g.positionWorld).applyMatrix4(v);var fa=1/g.positionScreen.w;g.positionScreen.x*=fa;g.positionScreen.y*=fa;g.positionScreen.z*=fa;g.visible=!(-1>g.positionScreen.x||1<g.positionScreen.x||-1>g.positionScreen.y||1<g.positionScreen.y||
|
|
|
|
--1>g.positionScreen.z||1<g.positionScreen.z)}ea=0;for(M=ta.length;ea<M;ea++)if($=ta[ea],fa=!0===La?Ga.materials[$.materialIndex]:T.material,void 0!==fa&&(Y=fa.side,V=k[$.a],P=k[$.b],ia=k[$.c],D[0]=V.positionScreen,D[1]=P.positionScreen,D[2]=ia.positionScreen,!0===V.visible||!0===P.visible||!0===ia.visible||O.isIntersectionBox(B.setFromPoints(D))))if(A=0>(ia.positionScreen.x-V.positionScreen.x)*(P.positionScreen.y-V.positionScreen.y)-(ia.positionScreen.y-V.positionScreen.y)*(P.positionScreen.x-V.positionScreen.x),
|
|
|
|
-Y===THREE.DoubleSide||A===(Y===THREE.FrontSide)){if(p===t){var Ea=new THREE.RenderableFace3;r.push(Ea);t++;p++;l=Ea}else l=r[p++];l.id=T.id;l.v1.copy(V);l.v2.copy(P);l.v3.copy(ia);l.normalModel.copy($.normal);!1===A&&(Y===THREE.BackSide||Y===THREE.DoubleSide)&&l.normalModel.negate();l.normalModel.applyMatrix3(R).normalize();l.normalModelView.copy(l.normalModel).applyMatrix3(J);l.centroidModel.copy($.centroid).applyMatrix4(x);ia=$.vertexNormals;V=0;for(P=Math.min(ia.length,3);V<P;V++)Ea=l.vertexNormalsModel[V],
|
|
|
|
-Ea.copy(ia[V]),!1===A&&(Y===THREE.BackSide||Y===THREE.DoubleSide)&&Ea.negate(),Ea.applyMatrix3(R).normalize(),l.vertexNormalsModelView[V].copy(Ea).applyMatrix3(J);l.vertexNormalsLength=ia.length;A=0;for(V=Math.min(ka.length,3);A<V;A++)if(ia=ka[A][ea],void 0!==ia){P=0;for(Y=ia.length;P<Y;P++)l.uvs[A][P]=ia[P]}l.color=$.color;l.material=fa;ca.copy(l.centroidModel).applyProjection(v);l.z=ca.z;y.elements.push(l)}}else if(T instanceof THREE.Line){G.multiplyMatrices(v,x);ea=T.geometry.vertices;V=a();V.positionScreen.copy(ea[0]).applyMatrix4(G);
|
|
|
|
-ta=T.type===THREE.LinePieces?2:1;M=1;for($=ea.length;M<$;M++)V=a(),V.positionScreen.copy(ea[M]).applyMatrix4(G),0<(M+1)%ta||(P=k[i-2],pa.copy(V.positionScreen),N.copy(P.positionScreen),!0===c(pa,N)&&(pa.multiplyScalar(1/pa.w),N.multiplyScalar(1/N.w),s===u?(ka=new THREE.RenderableLine,q.push(ka),u++,s++,n=ka):n=q[s++],n.id=T.id,n.v1.positionScreen.copy(pa),n.v2.positionScreen.copy(N),n.z=Math.max(pa.z,N.z),n.material=T.material,T.material.vertexColors===THREE.VertexColors&&(n.vertexColors[0].copy(T.geometry.colors[M]),
|
|
|
|
-n.vertexColors[1].copy(T.geometry.colors[M-1])),y.elements.push(n)))}d=0;for(h=y.sprites.length;d<h;d++)T=y.sprites[d].object,x=T.matrixWorld,T instanceof THREE.Particle&&(z.set(x.elements[12],x.elements[13],x.elements[14],1),z.applyMatrix4(v),fa=1/z.w,z.z*=fa,0<z.z&&1>z.z&&(E===F?(ta=new THREE.RenderableParticle,C.push(ta),F++,E++,w=ta):w=C[E++],w.id=T.id,w.x=z.x*fa,w.y=z.y*fa,w.z=z.z,w.object=T,w.rotation=T.rotation.z,w.scale.x=T.scale.x*Math.abs(w.x-(z.x+f.projectionMatrix.elements[0])/(z.w+f.projectionMatrix.elements[12])),
|
|
|
|
-w.scale.y=T.scale.y*Math.abs(w.y-(z.y+f.projectionMatrix.elements[5])/(z.w+f.projectionMatrix.elements[13])),w.material=T.material,y.elements.push(w)));!0===m&&y.elements.sort(b);return y}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
|
|
|
|
|
|
+f.push(b);h++;e++;d=b}else d=f[e++];d.id=a.id;d.object=a;null!==a.renderDepth?d.z=a.renderDepth:(A.getPositionFromMatrix(a.matrixWorld),A.applyProjection(v),d.z=A.z);return d},R=function(a){if(!1!==a.visible){a instanceof THREE.Light?y.lights.push(a):a instanceof THREE.Mesh||a instanceof THREE.Line?(!1===a.frustumCulled||!0===oa.intersectsObject(a))&&y.objects.push(M(a)):(a instanceof THREE.Sprite||a instanceof THREE.Particle)&&y.sprites.push(M(a));for(var b=0,c=a.children.length;b<c;b++)R(a.children[b])}};
|
|
|
|
+this.projectScene=function(d,f,h,m){var A=!1,M,$,ea,V,P,Y,U,ka,ta,ia,La,Ga;E=s=p=0;y.elements.length=0;!0===d.autoUpdate&&d.updateMatrixWorld();void 0===f.parent&&f.updateMatrixWorld();I.copy(f.matrixWorldInverse.getInverse(f.matrixWorld));v.multiplyMatrices(f.projectionMatrix,I);J.getNormalMatrix(I);oa.setFromMatrix(v);e=0;y.objects.length=0;y.sprites.length=0;y.lights.length=0;R(d);!0===h&&y.objects.sort(b);d=0;for(h=y.objects.length;d<h;d++)if(U=y.objects[d].object,x=U.matrixWorld,i=0,U instanceof
|
|
|
|
+THREE.Mesh){ka=U.geometry;ea=ka.vertices;ta=ka.faces;ka=ka.faceVertexUvs;Q.getNormalMatrix(x);La=U.material instanceof THREE.MeshFaceMaterial;Ga=!0===La?U.material:null;M=0;for($=ea.length;M<$;M++){g=a();g.positionWorld.copy(ea[M]).applyMatrix4(x);g.positionScreen.copy(g.positionWorld).applyMatrix4(v);var fa=1/g.positionScreen.w;g.positionScreen.x*=fa;g.positionScreen.y*=fa;g.positionScreen.z*=fa;g.visible=!(-1>g.positionScreen.x||1<g.positionScreen.x||-1>g.positionScreen.y||1<g.positionScreen.y||
|
|
|
|
+-1>g.positionScreen.z||1<g.positionScreen.z)}ea=0;for(M=ta.length;ea<M;ea++)if($=ta[ea],fa=!0===La?Ga.materials[$.materialIndex]:U.material,void 0!==fa&&(Y=fa.side,V=k[$.a],P=k[$.b],ia=k[$.c],D[0]=V.positionScreen,D[1]=P.positionScreen,D[2]=ia.positionScreen,!0===V.visible||!0===P.visible||!0===ia.visible||O.isIntersectionBox(B.setFromPoints(D))))if(A=0>(ia.positionScreen.x-V.positionScreen.x)*(P.positionScreen.y-V.positionScreen.y)-(ia.positionScreen.y-V.positionScreen.y)*(P.positionScreen.x-V.positionScreen.x),
|
|
|
|
+Y===THREE.DoubleSide||A===(Y===THREE.FrontSide)){if(p===t){var Ea=new THREE.RenderableFace3;r.push(Ea);t++;p++;l=Ea}else l=r[p++];l.id=U.id;l.v1.copy(V);l.v2.copy(P);l.v3.copy(ia);l.normalModel.copy($.normal);!1===A&&(Y===THREE.BackSide||Y===THREE.DoubleSide)&&l.normalModel.negate();l.normalModel.applyMatrix3(Q).normalize();l.normalModelView.copy(l.normalModel).applyMatrix3(J);l.centroidModel.copy($.centroid).applyMatrix4(x);ia=$.vertexNormals;V=0;for(P=Math.min(ia.length,3);V<P;V++)Ea=l.vertexNormalsModel[V],
|
|
|
|
+Ea.copy(ia[V]),!1===A&&(Y===THREE.BackSide||Y===THREE.DoubleSide)&&Ea.negate(),Ea.applyMatrix3(Q).normalize(),l.vertexNormalsModelView[V].copy(Ea).applyMatrix3(J);l.vertexNormalsLength=ia.length;A=0;for(V=Math.min(ka.length,3);A<V;A++)if(ia=ka[A][ea],void 0!==ia){P=0;for(Y=ia.length;P<Y;P++)l.uvs[A][P]=ia[P]}l.color=$.color;l.material=fa;ca.copy(l.centroidModel).applyProjection(v);l.z=ca.z;y.elements.push(l)}}else if(U instanceof THREE.Line){G.multiplyMatrices(v,x);ea=U.geometry.vertices;V=a();V.positionScreen.copy(ea[0]).applyMatrix4(G);
|
|
|
|
+ta=U.type===THREE.LinePieces?2:1;M=1;for($=ea.length;M<$;M++)V=a(),V.positionScreen.copy(ea[M]).applyMatrix4(G),0<(M+1)%ta||(P=k[i-2],pa.copy(V.positionScreen),N.copy(P.positionScreen),!0===c(pa,N)&&(pa.multiplyScalar(1/pa.w),N.multiplyScalar(1/N.w),s===u?(ka=new THREE.RenderableLine,q.push(ka),u++,s++,n=ka):n=q[s++],n.id=U.id,n.v1.positionScreen.copy(pa),n.v2.positionScreen.copy(N),n.z=Math.max(pa.z,N.z),n.material=U.material,U.material.vertexColors===THREE.VertexColors&&(n.vertexColors[0].copy(U.geometry.colors[M]),
|
|
|
|
+n.vertexColors[1].copy(U.geometry.colors[M-1])),y.elements.push(n)))}d=0;for(h=y.sprites.length;d<h;d++)U=y.sprites[d].object,x=U.matrixWorld,U instanceof THREE.Particle&&(z.set(x.elements[12],x.elements[13],x.elements[14],1),z.applyMatrix4(v),fa=1/z.w,z.z*=fa,0<z.z&&1>z.z&&(E===F?(ta=new THREE.RenderableParticle,C.push(ta),F++,E++,w=ta):w=C[E++],w.id=U.id,w.x=z.x*fa,w.y=z.y*fa,w.z=z.z,w.object=U,w.rotation=U.rotation.z,w.scale.x=U.scale.x*Math.abs(w.x-(z.x+f.projectionMatrix.elements[0])/(z.w+f.projectionMatrix.elements[12])),
|
|
|
|
+w.scale.y=U.scale.y*Math.abs(w.y-(z.y+f.projectionMatrix.elements[5])/(z.w+f.projectionMatrix.elements[13])),w.material=U.material,y.elements.push(w)));!0===m&&y.elements.sort(b);return y}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
|
|
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
|
|
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
|
|
return a}};THREE.Face4=function(a,b,c,d,e,f,h){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,h)};THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=
|
|
return a}};THREE.Face4=function(a,b,c,d,e,f,h){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,h)};THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=
|
|
this.elementsNeedUpdate=this.verticesNeedUpdate=!1};
|
|
this.elementsNeedUpdate=this.verticesNeedUpdate=!1};
|
|
@@ -190,10 +190,11 @@ this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attribute
|
|
{itemSize:3,array:new Float32Array(a)};else{a=0;for(b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0}var e=this.attributes.position.array,f=this.attributes.normal.array,h,g,i,k,m,l,p=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3,s=new THREE.Vector3;if(this.attributes.index){var q=this.attributes.index.array,u=this.offsets;c=0;for(d=u.length;c<d;++c){b=u[c].start;h=u[c].count;var w=u[c].index;a=b;for(b+=h;a<b;a+=3)h=w+q[a],g=w+q[a+1],i=
|
|
{itemSize:3,array:new Float32Array(a)};else{a=0;for(b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0}var e=this.attributes.position.array,f=this.attributes.normal.array,h,g,i,k,m,l,p=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3,s=new THREE.Vector3;if(this.attributes.index){var q=this.attributes.index.array,u=this.offsets;c=0;for(d=u.length;c<d;++c){b=u[c].start;h=u[c].count;var w=u[c].index;a=b;for(b+=h;a<b;a+=3)h=w+q[a],g=w+q[a+1],i=
|
|
w+q[a+2],k=e[3*h],m=e[3*h+1],l=e[3*h+2],p.set(k,m,l),k=e[3*g],m=e[3*g+1],l=e[3*g+2],r.set(k,m,l),k=e[3*i],m=e[3*i+1],l=e[3*i+2],t.set(k,m,l),n.subVectors(t,r),s.subVectors(p,r),n.cross(s),f[3*h]+=n.x,f[3*h+1]+=n.y,f[3*h+2]+=n.z,f[3*g]+=n.x,f[3*g+1]+=n.y,f[3*g+2]+=n.z,f[3*i]+=n.x,f[3*i+1]+=n.y,f[3*i+2]+=n.z}}else{a=0;for(b=e.length;a<b;a+=9)k=e[a],m=e[a+1],l=e[a+2],p.set(k,m,l),k=e[a+3],m=e[a+4],l=e[a+5],r.set(k,m,l),k=e[a+6],m=e[a+7],l=e[a+8],t.set(k,m,l),n.subVectors(t,r),s.subVectors(p,r),n.cross(s),
|
|
w+q[a+2],k=e[3*h],m=e[3*h+1],l=e[3*h+2],p.set(k,m,l),k=e[3*g],m=e[3*g+1],l=e[3*g+2],r.set(k,m,l),k=e[3*i],m=e[3*i+1],l=e[3*i+2],t.set(k,m,l),n.subVectors(t,r),s.subVectors(p,r),n.cross(s),f[3*h]+=n.x,f[3*h+1]+=n.y,f[3*h+2]+=n.z,f[3*g]+=n.x,f[3*g+1]+=n.y,f[3*g+2]+=n.z,f[3*i]+=n.x,f[3*i+1]+=n.y,f[3*i+2]+=n.z}}else{a=0;for(b=e.length;a<b;a+=9)k=e[a],m=e[a+1],l=e[a+2],p.set(k,m,l),k=e[a+3],m=e[a+4],l=e[a+5],r.set(k,m,l),k=e[a+6],m=e[a+7],l=e[a+8],t.set(k,m,l),n.subVectors(t,r),s.subVectors(p,r),n.cross(s),
|
|
f[a]=n.x,f[a+1]=n.y,f[a+2]=n.z,f[a+3]=n.x,f[a+4]=n.y,f[a+5]=n.z,f[a+6]=n.x,f[a+7]=n.y,f[a+8]=n.z}this.normalizeNormals();this.normalsNeedUpdate=!0}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},computeTangents:function(){function a(a){oa.x=d[3*a];oa.y=d[3*a+1];oa.z=d[3*a+2];pa.copy(oa);M=g[a];J.copy(M);J.sub(oa.multiplyScalar(oa.dot(M))).normalize();ca.crossVectors(pa,
|
|
f[a]=n.x,f[a+1]=n.y,f[a+2]=n.z,f[a+3]=n.x,f[a+4]=n.y,f[a+5]=n.z,f[a+6]=n.x,f[a+7]=n.y,f[a+8]=n.z}this.normalizeNormals();this.normalsNeedUpdate=!0}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},computeTangents:function(){function a(a){oa.x=d[3*a];oa.y=d[3*a+1];oa.z=d[3*a+2];pa.copy(oa);M=g[a];J.copy(M);J.sub(oa.multiplyScalar(oa.dot(M))).normalize();ca.crossVectors(pa,
|
|
-M);Q=ca.dot(i[a]);N=0>Q?-1:1;h[4*a]=J.x;h[4*a+1]=J.y;h[4*a+2]=J.z;h[4*a+3]=N}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var b=this.attributes.index.array,c=this.attributes.position.array,d=this.attributes.normal.array,e=this.attributes.uv.array,f=c.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent=
|
|
|
|
-{itemSize:4,array:new Float32Array(4*f)});for(var h=this.attributes.tangent.array,g=[],i=[],k=0;k<f;k++)g[k]=new THREE.Vector3,i[k]=new THREE.Vector3;var m,l,p,r,t,n,s,q,u,w,E,C,F,y,A,f=new THREE.Vector3,k=new THREE.Vector3,z,O,B,D,I,v,x,G=this.offsets;B=0;for(D=G.length;B<D;++B){O=G[B].start;I=G[B].count;var R=G[B].index;z=O;for(O+=I;z<O;z+=3)I=R+b[z],v=R+b[z+1],x=R+b[z+2],m=c[3*I],l=c[3*I+1],p=c[3*I+2],r=c[3*v],t=c[3*v+1],n=c[3*v+2],s=c[3*x],q=c[3*x+1],u=c[3*x+2],w=e[2*I],E=e[2*I+1],C=e[2*v],F=
|
|
|
|
-e[2*v+1],y=e[2*x],A=e[2*x+1],r-=m,m=s-m,t-=l,l=q-l,n-=p,p=u-p,C-=w,w=y-w,F-=E,E=A-E,A=1/(C*E-w*F),f.set((E*r-F*m)*A,(E*t-F*l)*A,(E*n-F*p)*A),k.set((C*m-w*r)*A,(C*l-w*t)*A,(C*p-w*n)*A),g[I].add(f),g[v].add(f),g[x].add(f),i[I].add(k),i[v].add(k),i[x].add(k)}var J=new THREE.Vector3,ca=new THREE.Vector3,oa=new THREE.Vector3,pa=new THREE.Vector3,N,M,Q;B=0;for(D=G.length;B<D;++B){O=G[B].start;I=G[B].count;R=G[B].index;z=O;for(O+=I;z<O;z+=3)I=R+b[z],v=R+b[z+1],x=R+b[z+2],a(I),a(v),a(x)}this.tangentsNeedUpdate=
|
|
|
|
-this.hasTangents=!0}},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
|
|
|
|
|
|
+M);R=ca.dot(i[a]);N=0>R?-1:1;h[4*a]=J.x;h[4*a+1]=J.y;h[4*a+2]=J.z;h[4*a+3]=N}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var b=this.attributes.index.array,c=this.attributes.position.array,d=this.attributes.normal.array,e=this.attributes.uv.array,f=c.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent=
|
|
|
|
+{itemSize:4,array:new Float32Array(4*f)});for(var h=this.attributes.tangent.array,g=[],i=[],k=0;k<f;k++)g[k]=new THREE.Vector3,i[k]=new THREE.Vector3;var m,l,p,r,t,n,s,q,u,w,E,C,F,y,A,f=new THREE.Vector3,k=new THREE.Vector3,z,O,B,D,I,v,x,G=this.offsets;B=0;for(D=G.length;B<D;++B){O=G[B].start;I=G[B].count;var Q=G[B].index;z=O;for(O+=I;z<O;z+=3)I=Q+b[z],v=Q+b[z+1],x=Q+b[z+2],m=c[3*I],l=c[3*I+1],p=c[3*I+2],r=c[3*v],t=c[3*v+1],n=c[3*v+2],s=c[3*x],q=c[3*x+1],u=c[3*x+2],w=e[2*I],E=e[2*I+1],C=e[2*v],F=
|
|
|
|
+e[2*v+1],y=e[2*x],A=e[2*x+1],r-=m,m=s-m,t-=l,l=q-l,n-=p,p=u-p,C-=w,w=y-w,F-=E,E=A-E,A=1/(C*E-w*F),f.set((E*r-F*m)*A,(E*t-F*l)*A,(E*n-F*p)*A),k.set((C*m-w*r)*A,(C*l-w*t)*A,(C*p-w*n)*A),g[I].add(f),g[v].add(f),g[x].add(f),i[I].add(k),i[v].add(k),i[x].add(k)}var J=new THREE.Vector3,ca=new THREE.Vector3,oa=new THREE.Vector3,pa=new THREE.Vector3,N,M,R;B=0;for(D=G.length;B<D;++B){O=G[B].start;I=G[B].count;Q=G[B].index;z=O;for(O+=I;z<O;z+=3)I=Q+b[z],v=Q+b[z+1],x=Q+b[z+2],a(I),a(v),a(x)}this.tangentsNeedUpdate=
|
|
|
|
+this.hasTangents=!0}},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,numItems:d.numItems,array:null},d=0,h=b.length;d<h;d++){var g=b[d];if(e instanceof g){f.array=new g(e);break}}a.attributes[c]=f}d=0;for(h=this.offsets.length;d<h;d++)b=this.offsets[d],a.offsets.push({start:b.start,index:b.index,
|
|
|
|
+count:b.count});return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
|
|
THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);a.projectionMatrixInverse.copy(this.projectionMatrixInverse);return a};THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};
|
|
THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);a.projectionMatrixInverse.copy(this.projectionMatrixInverse);return a};THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};
|
|
THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;return a};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
|
|
THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;return a};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
|
|
THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
|
|
THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
|
|
@@ -248,11 +249,11 @@ s.height,s.widthSegments,s.heightSegments),r.name=v,z.geometries[v]=r;else if("s
|
|
s.subdivisions),r.name=v,z.geometries[v]=r;else if(s.type in this.geometryHandlers){x={};for(q in s)"type"!==q&&"url"!==q&&(x[q]=s[q]);this.geometryHandlers[s.type].loaderObject.load(d(s.url,B.urlBaseType),h(v),x)}else"embedded"===s.type&&(x=B.embeds[s.id],x.metadata=B.metadata,x&&(x=this.geometryHandlers.ascii.loaderObject.parse(x,""),i(v)(x.geometry,x.materials)));for(var G in B.textures)if(v=B.textures[G],v.url instanceof Array){F+=v.url.length;for(q=0;q<v.url.length;q++)l.onLoadStart()}else F+=
|
|
s.subdivisions),r.name=v,z.geometries[v]=r;else if(s.type in this.geometryHandlers){x={};for(q in s)"type"!==q&&"url"!==q&&(x[q]=s[q]);this.geometryHandlers[s.type].loaderObject.load(d(s.url,B.urlBaseType),h(v),x)}else"embedded"===s.type&&(x=B.embeds[s.id],x.metadata=B.metadata,x&&(x=this.geometryHandlers.ascii.loaderObject.parse(x,""),i(v)(x.geometry,x.materials)));for(var G in B.textures)if(v=B.textures[G],v.url instanceof Array){F+=v.url.length;for(q=0;q<v.url.length;q++)l.onLoadStart()}else F+=
|
|
1,l.onLoadStart();A=F;for(G in B.textures){v=B.textures[G];void 0!==v.mapping&&void 0!==THREE[v.mapping]&&(v.mapping=new THREE[v.mapping]);if(v.url instanceof Array){x=v.url.length;s=[];for(q=0;q<x;q++)s[q]=d(v.url[q],B.urlBaseType);q=(q=/\.dds$/i.test(s[0]))?THREE.ImageUtils.loadCompressedTextureCube(s,v.mapping,D(x)):THREE.ImageUtils.loadTextureCube(s,v.mapping,D(x))}else q=/\.dds$/i.test(v.url),x=d(v.url,B.urlBaseType),s=D(1),q=q?THREE.ImageUtils.loadCompressedTexture(x,v.mapping,s):THREE.ImageUtils.loadTexture(x,
|
|
1,l.onLoadStart();A=F;for(G in B.textures){v=B.textures[G];void 0!==v.mapping&&void 0!==THREE[v.mapping]&&(v.mapping=new THREE[v.mapping]);if(v.url instanceof Array){x=v.url.length;s=[];for(q=0;q<x;q++)s[q]=d(v.url[q],B.urlBaseType);q=(q=/\.dds$/i.test(s[0]))?THREE.ImageUtils.loadCompressedTextureCube(s,v.mapping,D(x)):THREE.ImageUtils.loadTextureCube(s,v.mapping,D(x))}else q=/\.dds$/i.test(v.url),x=d(v.url,B.urlBaseType),s=D(1),q=q?THREE.ImageUtils.loadCompressedTexture(x,v.mapping,s):THREE.ImageUtils.loadTexture(x,
|
|
v.mapping,s),void 0!==THREE[v.minFilter]&&(q.minFilter=THREE[v.minFilter]),void 0!==THREE[v.magFilter]&&(q.magFilter=THREE[v.magFilter]),v.anisotropy&&(q.anisotropy=v.anisotropy),v.repeat&&(q.repeat.set(v.repeat[0],v.repeat[1]),1!==v.repeat[0]&&(q.wrapS=THREE.RepeatWrapping),1!==v.repeat[1]&&(q.wrapT=THREE.RepeatWrapping)),v.offset&&q.offset.set(v.offset[0],v.offset[1]),v.wrap&&(x={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==x[v.wrap[0]]&&(q.wrapS=x[v.wrap[0]]),void 0!==
|
|
v.mapping,s),void 0!==THREE[v.minFilter]&&(q.minFilter=THREE[v.minFilter]),void 0!==THREE[v.magFilter]&&(q.magFilter=THREE[v.magFilter]),v.anisotropy&&(q.anisotropy=v.anisotropy),v.repeat&&(q.repeat.set(v.repeat[0],v.repeat[1]),1!==v.repeat[0]&&(q.wrapS=THREE.RepeatWrapping),1!==v.repeat[1]&&(q.wrapT=THREE.RepeatWrapping)),v.offset&&q.offset.set(v.offset[0],v.offset[1]),v.wrap&&(x={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==x[v.wrap[0]]&&(q.wrapS=x[v.wrap[0]]),void 0!==
|
|
-x[v.wrap[1]]&&(q.wrapT=x[v.wrap[1]]));z.textures[G]=q}var R,J;for(R in B.materials){G=B.materials[R];for(J in G.parameters)"envMap"===J||"map"===J||"lightMap"===J||"bumpMap"===J?G.parameters[J]=z.textures[G.parameters[J]]:"shading"===J?G.parameters[J]="flat"===G.parameters[J]?THREE.FlatShading:THREE.SmoothShading:"side"===J?G.parameters[J]="double"==G.parameters[J]?THREE.DoubleSide:"back"==G.parameters[J]?THREE.BackSide:THREE.FrontSide:"blending"===J?G.parameters[J]=G.parameters[J]in THREE?THREE[G.parameters[J]]:
|
|
|
|
|
|
+x[v.wrap[1]]&&(q.wrapT=x[v.wrap[1]]));z.textures[G]=q}var Q,J;for(Q in B.materials){G=B.materials[Q];for(J in G.parameters)"envMap"===J||"map"===J||"lightMap"===J||"bumpMap"===J?G.parameters[J]=z.textures[G.parameters[J]]:"shading"===J?G.parameters[J]="flat"===G.parameters[J]?THREE.FlatShading:THREE.SmoothShading:"side"===J?G.parameters[J]="double"==G.parameters[J]?THREE.DoubleSide:"back"==G.parameters[J]?THREE.BackSide:THREE.FrontSide:"blending"===J?G.parameters[J]=G.parameters[J]in THREE?THREE[G.parameters[J]]:
|
|
THREE.NormalBlending:"combine"===J?G.parameters[J]=G.parameters[J]in THREE?THREE[G.parameters[J]]:THREE.MultiplyOperation:"vertexColors"===J?"face"==G.parameters[J]?G.parameters[J]=THREE.FaceColors:G.parameters[J]&&(G.parameters[J]=THREE.VertexColors):"wrapRGB"===J&&(D=G.parameters[J],G.parameters[J]=new THREE.Vector3(D[0],D[1],D[2]));void 0!==G.parameters.opacity&&1>G.parameters.opacity&&(G.parameters.transparent=!0);G.parameters.normalMap?(D=THREE.ShaderLib.normalmap,v=THREE.UniformsUtils.clone(D.uniforms),
|
|
THREE.NormalBlending:"combine"===J?G.parameters[J]=G.parameters[J]in THREE?THREE[G.parameters[J]]:THREE.MultiplyOperation:"vertexColors"===J?"face"==G.parameters[J]?G.parameters[J]=THREE.FaceColors:G.parameters[J]&&(G.parameters[J]=THREE.VertexColors):"wrapRGB"===J&&(D=G.parameters[J],G.parameters[J]=new THREE.Vector3(D[0],D[1],D[2]));void 0!==G.parameters.opacity&&1>G.parameters.opacity&&(G.parameters.transparent=!0);G.parameters.normalMap?(D=THREE.ShaderLib.normalmap,v=THREE.UniformsUtils.clone(D.uniforms),
|
|
q=G.parameters.color,x=G.parameters.specular,s=G.parameters.ambient,I=G.parameters.shininess,v.tNormal.value=z.textures[G.parameters.normalMap],G.parameters.normalScale&&v.uNormalScale.value.set(G.parameters.normalScale[0],G.parameters.normalScale[1]),G.parameters.map&&(v.tDiffuse.value=G.parameters.map,v.enableDiffuse.value=!0),G.parameters.envMap&&(v.tCube.value=G.parameters.envMap,v.enableReflection.value=!0,v.uReflectivity.value=G.parameters.reflectivity),G.parameters.lightMap&&(v.tAO.value=G.parameters.lightMap,
|
|
q=G.parameters.color,x=G.parameters.specular,s=G.parameters.ambient,I=G.parameters.shininess,v.tNormal.value=z.textures[G.parameters.normalMap],G.parameters.normalScale&&v.uNormalScale.value.set(G.parameters.normalScale[0],G.parameters.normalScale[1]),G.parameters.map&&(v.tDiffuse.value=G.parameters.map,v.enableDiffuse.value=!0),G.parameters.envMap&&(v.tCube.value=G.parameters.envMap,v.enableReflection.value=!0,v.uReflectivity.value=G.parameters.reflectivity),G.parameters.lightMap&&(v.tAO.value=G.parameters.lightMap,
|
|
v.enableAO.value=!0),G.parameters.specularMap&&(v.tSpecular.value=z.textures[G.parameters.specularMap],v.enableSpecular.value=!0),G.parameters.displacementMap&&(v.tDisplacement.value=z.textures[G.parameters.displacementMap],v.enableDisplacement.value=!0,v.uDisplacementBias.value=G.parameters.displacementBias,v.uDisplacementScale.value=G.parameters.displacementScale),v.uDiffuseColor.value.setHex(q),v.uSpecularColor.value.setHex(x),v.uAmbientColor.value.setHex(s),v.uShininess.value=I,G.parameters.opacity&&
|
|
v.enableAO.value=!0),G.parameters.specularMap&&(v.tSpecular.value=z.textures[G.parameters.specularMap],v.enableSpecular.value=!0),G.parameters.displacementMap&&(v.tDisplacement.value=z.textures[G.parameters.displacementMap],v.enableDisplacement.value=!0,v.uDisplacementBias.value=G.parameters.displacementBias,v.uDisplacementScale.value=G.parameters.displacementScale),v.uDiffuseColor.value.setHex(q),v.uSpecularColor.value.setHex(x),v.uAmbientColor.value.setHex(s),v.uShininess.value=I,G.parameters.opacity&&
|
|
-(v.uOpacity.value=G.parameters.opacity),t=new THREE.ShaderMaterial({fragmentShader:D.fragmentShader,vertexShader:D.vertexShader,uniforms:v,lights:!0,fog:!0})):t=new THREE[G.type](G.parameters);t.name=R;z.materials[R]=t}for(R in B.materials)if(G=B.materials[R],G.parameters.materials){J=[];for(q=0;q<G.parameters.materials.length;q++)J.push(z.materials[G.parameters.materials[q]]);z.materials[R].materials=J}e();z.cameras&&B.defaults.camera&&(z.currentCamera=z.cameras[B.defaults.camera]);z.fogs&&B.defaults.fog&&
|
|
|
|
|
|
+(v.uOpacity.value=G.parameters.opacity),t=new THREE.ShaderMaterial({fragmentShader:D.fragmentShader,vertexShader:D.vertexShader,uniforms:v,lights:!0,fog:!0})):t=new THREE[G.type](G.parameters);t.name=Q;z.materials[Q]=t}for(Q in B.materials)if(G=B.materials[Q],G.parameters.materials){J=[];for(q=0;q<G.parameters.materials.length;q++)J.push(z.materials[G.parameters.materials[q]]);z.materials[Q].materials=J}e();z.cameras&&B.defaults.camera&&(z.currentCamera=z.cameras[B.defaults.camera]);z.fogs&&B.defaults.fog&&
|
|
(z.scene.fog=z.fogs[B.defaults.fog]);l.callbackSync(z);k()}};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b){var c=new THREE.ImageLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)})},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};
|
|
(z.scene.fog=z.fogs[B.defaults.fog]);l.callbackSync(z);k()}};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b){var c=new THREE.ImageLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)})},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};
|
|
THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;
|
|
THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;
|
|
a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);
|
|
a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);
|
|
@@ -301,24 +302,24 @@ function c(a,b,c,d){m(b);l(c);p(d);r(a.getStyle());B.stroke();ra.expandByScalar(
|
|
t(Ga[p.id]);var n=p.offset.x/p.repeat.x,s=p.offset.y/p.repeat.y,r=p.image.width*p.repeat.x,q=p.image.height*p.repeat.y,g=(g+n)*r,j=(1-j+s)*q,c=c-a,e=e-b,f=f-a,h=h-b,i=(i+n)*r-g,k=(1-k+s)*q-j,m=(m+n)*r-g,l=(1-l+s)*q-j,n=i*l-m*k;0===n?(void 0===fa[p.id]&&(b=document.createElement("canvas"),b.width=p.image.width,b.height=p.image.height,b=b.getContext("2d"),b.drawImage(p.image,0,0),fa[p.id]=b.getImageData(0,0,p.image.width,p.image.height).data),b=fa[p.id],g=4*(Math.floor(g)+Math.floor(j)*p.image.width),
|
|
t(Ga[p.id]);var n=p.offset.x/p.repeat.x,s=p.offset.y/p.repeat.y,r=p.image.width*p.repeat.x,q=p.image.height*p.repeat.y,g=(g+n)*r,j=(1-j+s)*q,c=c-a,e=e-b,f=f-a,h=h-b,i=(i+n)*r-g,k=(1-k+s)*q-j,m=(m+n)*r-g,l=(1-l+s)*q-j,n=i*l-m*k;0===n?(void 0===fa[p.id]&&(b=document.createElement("canvas"),b.width=p.image.width,b.height=p.image.height,b=b.getContext("2d"),b.drawImage(p.image,0,0),fa[p.id]=b.getImageData(0,0,p.image.width,p.image.height).data),b=fa[p.id],g=4*(Math.floor(g)+Math.floor(j)*p.image.width),
|
|
V.setRGB(b[g]/255,b[g+1]/255,b[g+2]/255),d(V)):(n=1/n,p=(l*c-k*f)*n,k=(l*e-k*h)*n,c=(i*f-m*c)*n,e=(i*h-m*e)*n,a=a-p*g-c*j,g=b-k*g-e*j,B.save(),B.transform(p,k,c,e,a,g),B.fill(),B.restore())}}function f(a,b,c,d,e,f,h,g,j,i,k,m,l){var p,n;p=l.width-1;n=l.height-1;h*=p;g*=n;c-=a;d-=b;e-=a;f-=b;j=j*p-h;i=i*n-g;k=k*p-h;m=m*n-g;n=1/(j*m-k*i);p=(m*c-i*e)*n;i=(m*d-i*f)*n;c=(j*e-k*c)*n;d=(j*f-k*d)*n;a=a-p*h-c*g;b=b-i*h-d*g;B.save();B.transform(p,i,c,d,a,b);B.clip();B.drawImage(l,0,0);B.restore()}function h(a,
|
|
V.setRGB(b[g]/255,b[g+1]/255,b[g+2]/255),d(V)):(n=1/n,p=(l*c-k*f)*n,k=(l*e-k*h)*n,c=(i*f-m*c)*n,e=(i*h-m*e)*n,a=a-p*g-c*j,g=b-k*g-e*j,B.save(),B.transform(p,k,c,e,a,g),B.fill(),B.restore())}}function f(a,b,c,d,e,f,h,g,j,i,k,m,l){var p,n;p=l.width-1;n=l.height-1;h*=p;g*=n;c-=a;d-=b;e-=a;f-=b;j=j*p-h;i=i*n-g;k=k*p-h;m=m*n-g;n=1/(j*m-k*i);p=(m*c-i*e)*n;i=(m*d-i*f)*n;c=(j*e-k*c)*n;d=(j*f-k*d)*n;a=a-p*h-c*g;b=b-i*h-d*g;B.save();B.transform(p,i,c,d,a,b);B.clip();B.drawImage(l,0,0);B.restore()}function h(a,
|
|
b,c,d){va[0]=255*a.r|0;va[1]=255*a.g|0;va[2]=255*a.b|0;va[4]=255*b.r|0;va[5]=255*b.g|0;va[6]=255*b.b|0;va[8]=255*c.r|0;va[9]=255*c.g|0;va[10]=255*c.b|0;va[12]=255*d.r|0;va[13]=255*d.g|0;va[14]=255*d.b|0;j.putImageData(Na,0,0);Fa.drawImage(Oa,0,0);return wa}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function i(a){v!==a&&(v=B.globalAlpha=a)}function k(a){x!==a&&(a===THREE.NormalBlending?B.globalCompositeOperation="source-over":
|
|
b,c,d){va[0]=255*a.r|0;va[1]=255*a.g|0;va[2]=255*a.b|0;va[4]=255*b.r|0;va[5]=255*b.g|0;va[6]=255*b.b|0;va[8]=255*c.r|0;va[9]=255*c.g|0;va[10]=255*c.b|0;va[12]=255*d.r|0;va[13]=255*d.g|0;va[14]=255*d.b|0;j.putImageData(Na,0,0);Fa.drawImage(Oa,0,0);return wa}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function i(a){v!==a&&(v=B.globalAlpha=a)}function k(a){x!==a&&(a===THREE.NormalBlending?B.globalCompositeOperation="source-over":
|
|
-a===THREE.AdditiveBlending?B.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(B.globalCompositeOperation="darker"),x=a)}function m(a){J!==a&&(J=B.lineWidth=a)}function l(a){ca!==a&&(ca=B.lineCap=a)}function p(a){oa!==a&&(oa=B.lineJoin=a)}function r(a){G!==a&&(G=B.strokeStyle=a)}function t(a){R!==a&&(R=B.fillStyle=a)}function n(a,b){if(pa!==a||N!==b)B.setLineDash([a,b]),pa=a,N=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var s=THREE.Math.smoothstep,a=a||{},q=this,u,w,E,C=
|
|
|
|
-new THREE.Projector,F=void 0!==a.canvas?a.canvas:document.createElement("canvas"),y,A,z,O,B=F.getContext("2d"),D=new THREE.Color(0),I=0,v=1,x=0,G=null,R=null,J=null,ca=null,oa=null,pa=null,N=0,M,Q,K,da;new THREE.RenderableVertex;new THREE.RenderableVertex;var Aa,Ca,ba,Ba,$,ea,V=new THREE.Color,P=new THREE.Color,Y=new THREE.Color,T=new THREE.Color,ka=new THREE.Color,ta=new THREE.Color,ia=new THREE.Color,La=new THREE.Color,Ga={},fa={},Ea,Ta,Pa,xa,cb,db,ob,pb,qb,eb,Ha=new THREE.Box2,la=new THREE.Box2,
|
|
|
|
|
|
+a===THREE.AdditiveBlending?B.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(B.globalCompositeOperation="darker"),x=a)}function m(a){J!==a&&(J=B.lineWidth=a)}function l(a){ca!==a&&(ca=B.lineCap=a)}function p(a){oa!==a&&(oa=B.lineJoin=a)}function r(a){G!==a&&(G=B.strokeStyle=a)}function t(a){Q!==a&&(Q=B.fillStyle=a)}function n(a,b){if(pa!==a||N!==b)B.setLineDash([a,b]),pa=a,N=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var s=THREE.Math.smoothstep,a=a||{},q=this,u,w,E,C=
|
|
|
|
+new THREE.Projector,F=void 0!==a.canvas?a.canvas:document.createElement("canvas"),y,A,z,O,B=F.getContext("2d"),D=new THREE.Color(0),I=0,v=1,x=0,G=null,Q=null,J=null,ca=null,oa=null,pa=null,N=0,M,R,K,da;new THREE.RenderableVertex;new THREE.RenderableVertex;var Aa,Ca,ba,Ba,$,ea,V=new THREE.Color,P=new THREE.Color,Y=new THREE.Color,U=new THREE.Color,ka=new THREE.Color,ta=new THREE.Color,ia=new THREE.Color,La=new THREE.Color,Ga={},fa={},Ea,Ta,Pa,xa,cb,db,ob,pb,qb,eb,Ha=new THREE.Box2,la=new THREE.Box2,
|
|
ra=new THREE.Box2,fb=new THREE.Color,sa=new THREE.Color,ga=new THREE.Color,ua=new THREE.Vector3,Oa,j,Na,va,wa,Fa,Qa=16;Oa=document.createElement("canvas");Oa.width=Oa.height=2;j=Oa.getContext("2d");j.fillStyle="rgba(0,0,0,1)";j.fillRect(0,0,2,2);Na=j.getImageData(0,0,2,2);va=Na.data;wa=document.createElement("canvas");wa.width=wa.height=Qa;Fa=wa.getContext("2d");Fa.translate(-Qa/2,-Qa/2);Fa.scale(Qa,Qa);Qa--;void 0===B.setLineDash&&(B.setLineDash=void 0!==B.mozDash?function(a){B.mozDash=null!==a[0]?
|
|
ra=new THREE.Box2,fb=new THREE.Color,sa=new THREE.Color,ga=new THREE.Color,ua=new THREE.Vector3,Oa,j,Na,va,wa,Fa,Qa=16;Oa=document.createElement("canvas");Oa.width=Oa.height=2;j=Oa.getContext("2d");j.fillStyle="rgba(0,0,0,1)";j.fillRect(0,0,2,2);Na=j.getImageData(0,0,2,2);va=Na.data;wa=document.createElement("canvas");wa.width=wa.height=Qa;Fa=wa.getContext("2d");Fa.translate(-Qa/2,-Qa/2);Fa.scale(Qa,Qa);Qa--;void 0===B.setLineDash&&(B.setLineDash=void 0!==B.mozDash?function(a){B.mozDash=null!==a[0]?
|
|
-a:null}:function(){});this.domElement=F;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){y=a*this.devicePixelRatio;A=b*this.devicePixelRatio;z=Math.floor(y/2);O=Math.floor(A/2);F.width=y;F.height=A;1!==this.devicePixelRatio&&!1!==
|
|
|
|
-c&&(F.style.width=a+"px",F.style.height=b+"px");Ha.set(new THREE.Vector2(-z,-O),new THREE.Vector2(z,O));la.set(new THREE.Vector2(-z,-O),new THREE.Vector2(z,O));v=1;x=0;oa=ca=J=R=G=null};this.setClearColor=function(a,b){D.set(a);I=void 0!==b?b:1;la.set(new THREE.Vector2(-z,-O),new THREE.Vector2(z,O))};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};
|
|
|
|
|
|
+a:null}:function(){});this.domElement=F;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){y=a*this.devicePixelRatio;A=b*this.devicePixelRatio;z=Math.floor(y/2);O=Math.floor(A/2);F.width=y;F.height=A;1!==this.devicePixelRatio&&!1!==
|
|
|
|
+c&&(F.style.width=a+"px",F.style.height=b+"px");Ha.set(new THREE.Vector2(-z,-O),new THREE.Vector2(z,O));la.set(new THREE.Vector2(-z,-O),new THREE.Vector2(z,O));v=1;x=0;oa=ca=J=Q=G=null};this.setClearColor=function(a,b){D.set(a);I=void 0!==b?b:1;la.set(new THREE.Vector2(-z,-O),new THREE.Vector2(z,O))};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};
|
|
this.clear=function(){B.setTransform(1,0,0,-1,z,O);!1===la.empty()&&(la.intersect(Ha),la.expandByScalar(2),1>I&&B.clearRect(la.min.x|0,la.min.y|0,la.max.x-la.min.x|0,la.max.y-la.min.y|0),0<I&&(k(THREE.NormalBlending),i(1),t("rgba("+Math.floor(255*D.r)+","+Math.floor(255*D.g)+","+Math.floor(255*D.b)+","+I+")"),B.fillRect(la.min.x|0,la.min.y|0,la.max.x-la.min.x|0,la.max.y-la.min.y|0)),la.makeEmpty())};this.render=function(a,j){if(!1===j instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
|
|
this.clear=function(){B.setTransform(1,0,0,-1,z,O);!1===la.empty()&&(la.intersect(Ha),la.expandByScalar(2),1>I&&B.clearRect(la.min.x|0,la.min.y|0,la.max.x-la.min.x|0,la.max.y-la.min.y|0),0<I&&(k(THREE.NormalBlending),i(1),t("rgba("+Math.floor(255*D.r)+","+Math.floor(255*D.g)+","+Math.floor(255*D.b)+","+I+")"),B.fillRect(la.min.x|0,la.min.y|0,la.max.x-la.min.x|0,la.max.y-la.min.y|0)),la.makeEmpty())};this.render=function(a,j){if(!1===j instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
|
|
else{!0===this.autoClear&&this.clear();B.setTransform(1,0,0,-1,z,O);q.info.render.vertices=0;q.info.render.faces=0;u=C.projectScene(a,j,this.sortObjects,this.sortElements);w=u.elements;E=u.lights;M=j;fb.setRGB(0,0,0);sa.setRGB(0,0,0);ga.setRGB(0,0,0);for(var A=0,G=E.length;A<G;A++){var y=E[A],F=y.color;y instanceof THREE.AmbientLight?fb.add(F):y instanceof THREE.DirectionalLight?sa.add(F):y instanceof THREE.PointLight&&ga.add(F)}A=0;for(G=w.length;A<G;A++){var v=w[A],x=v.material;if(!(void 0===x||
|
|
else{!0===this.autoClear&&this.clear();B.setTransform(1,0,0,-1,z,O);q.info.render.vertices=0;q.info.render.faces=0;u=C.projectScene(a,j,this.sortObjects,this.sortElements);w=u.elements;E=u.lights;M=j;fb.setRGB(0,0,0);sa.setRGB(0,0,0);ga.setRGB(0,0,0);for(var A=0,G=E.length;A<G;A++){var y=E[A],F=y.color;y instanceof THREE.AmbientLight?fb.add(F):y instanceof THREE.DirectionalLight?sa.add(F):y instanceof THREE.PointLight&&ga.add(F)}A=0;for(G=w.length;A<G;A++){var v=w[A],x=v.material;if(!(void 0===x||
|
|
-!1===x.visible)){ra.makeEmpty();if(v instanceof THREE.RenderableParticle){Q=v;Q.x*=z;Q.y*=O;var y=Q,F=v,J=x;i(J.opacity);k(J.blending);var N=x=v=void 0,D=void 0,I=void 0,R=void 0,ca=void 0;J instanceof THREE.ParticleBasicMaterial?null===J.map?(N=F.object.scale.x,D=F.object.scale.y,N*=F.scale.x*z,D*=F.scale.y*O,ra.min.set(y.x-N,y.y-D),ra.max.set(y.x+N,y.y+D),!1===Ha.isIntersectionBox(ra)?ra.makeEmpty():(t(J.color.getStyle()),B.save(),B.translate(y.x,y.y),B.rotate(-F.rotation),B.scale(N,D),B.fillRect(-1,
|
|
|
|
--1,2,2),B.restore())):(I=J.map.image,R=I.width>>1,ca=I.height>>1,N=F.scale.x*z,D=F.scale.y*O,v=N*R,x=D*ca,ra.min.set(y.x-v,y.y-x),ra.max.set(y.x+v,y.y+x),!1===Ha.isIntersectionBox(ra)?ra.makeEmpty():(B.save(),B.translate(y.x,y.y),B.rotate(-F.rotation),B.scale(N,-D),B.translate(-R,-ca),B.drawImage(I,0,0),B.restore())):J instanceof THREE.ParticleCanvasMaterial&&(v=F.scale.x*z,x=F.scale.y*O,ra.min.set(y.x-v,y.y-x),ra.max.set(y.x+v,y.y+x),!1===Ha.isIntersectionBox(ra)?ra.makeEmpty():(r(J.color.getStyle()),
|
|
|
|
-t(J.color.getStyle()),B.save(),B.translate(y.x,y.y),B.rotate(-F.rotation),B.scale(v,x),J.program(B),B.restore()))}else if(v instanceof THREE.RenderableLine){if(Q=v.v1,K=v.v2,Q.positionScreen.x*=z,Q.positionScreen.y*=O,K.positionScreen.x*=z,K.positionScreen.y*=O,ra.setFromPoints([Q.positionScreen,K.positionScreen]),!0===Ha.isIntersectionBox(ra))if(y=Q,F=K,J=v,v=x,i(v.opacity),k(v.blending),B.beginPath(),B.moveTo(y.positionScreen.x,y.positionScreen.y),B.lineTo(F.positionScreen.x,F.positionScreen.y),
|
|
|
|
|
|
+!1===x.visible)){ra.makeEmpty();if(v instanceof THREE.RenderableParticle){R=v;R.x*=z;R.y*=O;var y=R,F=v,J=x;i(J.opacity);k(J.blending);var N=x=v=void 0,D=void 0,I=void 0,Q=void 0,ca=void 0;J instanceof THREE.ParticleBasicMaterial?null===J.map?(N=F.object.scale.x,D=F.object.scale.y,N*=F.scale.x*z,D*=F.scale.y*O,ra.min.set(y.x-N,y.y-D),ra.max.set(y.x+N,y.y+D),!1===Ha.isIntersectionBox(ra)?ra.makeEmpty():(t(J.color.getStyle()),B.save(),B.translate(y.x,y.y),B.rotate(-F.rotation),B.scale(N,D),B.fillRect(-1,
|
|
|
|
+-1,2,2),B.restore())):(I=J.map.image,Q=I.width>>1,ca=I.height>>1,N=F.scale.x*z,D=F.scale.y*O,v=N*Q,x=D*ca,ra.min.set(y.x-v,y.y-x),ra.max.set(y.x+v,y.y+x),!1===Ha.isIntersectionBox(ra)?ra.makeEmpty():(B.save(),B.translate(y.x,y.y),B.rotate(-F.rotation),B.scale(N,-D),B.translate(-Q,-ca),B.drawImage(I,0,0),B.restore())):J instanceof THREE.ParticleCanvasMaterial&&(v=F.scale.x*z,x=F.scale.y*O,ra.min.set(y.x-v,y.y-x),ra.max.set(y.x+v,y.y+x),!1===Ha.isIntersectionBox(ra)?ra.makeEmpty():(r(J.color.getStyle()),
|
|
|
|
+t(J.color.getStyle()),B.save(),B.translate(y.x,y.y),B.rotate(-F.rotation),B.scale(v,x),J.program(B),B.restore()))}else if(v instanceof THREE.RenderableLine){if(R=v.v1,K=v.v2,R.positionScreen.x*=z,R.positionScreen.y*=O,K.positionScreen.x*=z,K.positionScreen.y*=O,ra.setFromPoints([R.positionScreen,K.positionScreen]),!0===Ha.isIntersectionBox(ra))if(y=R,F=K,J=v,v=x,i(v.opacity),k(v.blending),B.beginPath(),B.moveTo(y.positionScreen.x,y.positionScreen.y),B.lineTo(F.positionScreen.x,F.positionScreen.y),
|
|
v instanceof THREE.LineBasicMaterial){m(v.linewidth);l(v.linecap);p(v.linejoin);if(v.vertexColors!==THREE.VertexColors)r(v.color.getStyle());else if(x=J.vertexColors[0].getStyle(),J=J.vertexColors[1].getStyle(),x===J)r(x);else{try{var fa=B.createLinearGradient(y.positionScreen.x,y.positionScreen.y,F.positionScreen.x,F.positionScreen.y);fa.addColorStop(0,x);fa.addColorStop(1,J)}catch(oa){fa=x}r(fa)}B.stroke();ra.expandByScalar(2*v.linewidth)}else v instanceof THREE.LineDashedMaterial&&(m(v.linewidth),
|
|
v instanceof THREE.LineBasicMaterial){m(v.linewidth);l(v.linecap);p(v.linejoin);if(v.vertexColors!==THREE.VertexColors)r(v.color.getStyle());else if(x=J.vertexColors[0].getStyle(),J=J.vertexColors[1].getStyle(),x===J)r(x);else{try{var fa=B.createLinearGradient(y.positionScreen.x,y.positionScreen.y,F.positionScreen.x,F.positionScreen.y);fa.addColorStop(0,x);fa.addColorStop(1,J)}catch(oa){fa=x}r(fa)}B.stroke();ra.expandByScalar(2*v.linewidth)}else v instanceof THREE.LineDashedMaterial&&(m(v.linewidth),
|
|
-l(v.linecap),p(v.linejoin),r(v.color.getStyle()),n(v.dashSize,v.gapSize),B.stroke(),ra.expandByScalar(2*v.linewidth),n(null,null))}else if(v instanceof THREE.RenderableFace3){Q=v.v1;K=v.v2;da=v.v3;if(-1>Q.positionScreen.z||1<Q.positionScreen.z)continue;if(-1>K.positionScreen.z||1<K.positionScreen.z)continue;if(-1>da.positionScreen.z||1<da.positionScreen.z)continue;Q.positionScreen.x*=z;Q.positionScreen.y*=O;K.positionScreen.x*=z;K.positionScreen.y*=O;da.positionScreen.x*=z;da.positionScreen.y*=O;
|
|
|
|
-0<x.overdraw&&(g(Q.positionScreen,K.positionScreen,x.overdraw),g(K.positionScreen,da.positionScreen,x.overdraw),g(da.positionScreen,Q.positionScreen,x.overdraw));ra.setFromPoints([Q.positionScreen,K.positionScreen,da.positionScreen]);if(!0===Ha.isIntersectionBox(ra)){y=Q;F=K;J=da;q.info.render.vertices+=3;q.info.render.faces++;i(x.opacity);k(x.blending);Aa=y.positionScreen.x;Ca=y.positionScreen.y;ba=F.positionScreen.x;Ba=F.positionScreen.y;$=J.positionScreen.x;ea=J.positionScreen.y;var N=Aa,D=Ca,
|
|
|
|
-I=ba,R=Ba,ca=$,pa=ea;B.beginPath();B.moveTo(N,D);B.lineTo(I,R);B.lineTo(ca,pa);B.closePath();(x instanceof THREE.MeshLambertMaterial||x instanceof THREE.MeshPhongMaterial)&&null===x.map?(ta.copy(x.color),ia.copy(x.emissive),x.vertexColors===THREE.FaceColors&&ta.multiply(v.color),!1===x.wireframe&&x.shading==THREE.SmoothShading&&3==v.vertexNormalsLength?(P.copy(fb),Y.copy(fb),T.copy(fb),b(v.v1.positionWorld,v.vertexNormalsModel[0],P),b(v.v2.positionWorld,v.vertexNormalsModel[1],Y),b(v.v3.positionWorld,
|
|
|
|
-v.vertexNormalsModel[2],T),P.multiply(ta).add(ia),Y.multiply(ta).add(ia),T.multiply(ta).add(ia),ka.addColors(Y,T).multiplyScalar(0.5),Pa=h(P,Y,T,ka),f(Aa,Ca,ba,Ba,$,ea,0,0,1,0,0,1,Pa)):(V.copy(fb),b(v.centroidModel,v.normalModel,V),V.multiply(ta).add(ia),!0===x.wireframe?c(V,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):d(V))):x instanceof THREE.MeshBasicMaterial||x instanceof THREE.MeshLambertMaterial||x instanceof THREE.MeshPhongMaterial?null!==x.map?x.map.mapping instanceof THREE.UVMapping&&
|
|
|
|
|
|
+l(v.linecap),p(v.linejoin),r(v.color.getStyle()),n(v.dashSize,v.gapSize),B.stroke(),ra.expandByScalar(2*v.linewidth),n(null,null))}else if(v instanceof THREE.RenderableFace3){R=v.v1;K=v.v2;da=v.v3;if(-1>R.positionScreen.z||1<R.positionScreen.z)continue;if(-1>K.positionScreen.z||1<K.positionScreen.z)continue;if(-1>da.positionScreen.z||1<da.positionScreen.z)continue;R.positionScreen.x*=z;R.positionScreen.y*=O;K.positionScreen.x*=z;K.positionScreen.y*=O;da.positionScreen.x*=z;da.positionScreen.y*=O;
|
|
|
|
+0<x.overdraw&&(g(R.positionScreen,K.positionScreen,x.overdraw),g(K.positionScreen,da.positionScreen,x.overdraw),g(da.positionScreen,R.positionScreen,x.overdraw));ra.setFromPoints([R.positionScreen,K.positionScreen,da.positionScreen]);if(!0===Ha.isIntersectionBox(ra)){y=R;F=K;J=da;q.info.render.vertices+=3;q.info.render.faces++;i(x.opacity);k(x.blending);Aa=y.positionScreen.x;Ca=y.positionScreen.y;ba=F.positionScreen.x;Ba=F.positionScreen.y;$=J.positionScreen.x;ea=J.positionScreen.y;var N=Aa,D=Ca,
|
|
|
|
+I=ba,Q=Ba,ca=$,pa=ea;B.beginPath();B.moveTo(N,D);B.lineTo(I,Q);B.lineTo(ca,pa);B.closePath();(x instanceof THREE.MeshLambertMaterial||x instanceof THREE.MeshPhongMaterial)&&null===x.map?(ta.copy(x.color),ia.copy(x.emissive),x.vertexColors===THREE.FaceColors&&ta.multiply(v.color),!1===x.wireframe&&x.shading==THREE.SmoothShading&&3==v.vertexNormalsLength?(P.copy(fb),Y.copy(fb),U.copy(fb),b(v.v1.positionWorld,v.vertexNormalsModel[0],P),b(v.v2.positionWorld,v.vertexNormalsModel[1],Y),b(v.v3.positionWorld,
|
|
|
|
+v.vertexNormalsModel[2],U),P.multiply(ta).add(ia),Y.multiply(ta).add(ia),U.multiply(ta).add(ia),ka.addColors(Y,U).multiplyScalar(0.5),Pa=h(P,Y,U,ka),f(Aa,Ca,ba,Ba,$,ea,0,0,1,0,0,1,Pa)):(V.copy(fb),b(v.centroidModel,v.normalModel,V),V.multiply(ta).add(ia),!0===x.wireframe?c(V,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):d(V))):x instanceof THREE.MeshBasicMaterial||x instanceof THREE.MeshLambertMaterial||x instanceof THREE.MeshPhongMaterial?null!==x.map?x.map.mapping instanceof THREE.UVMapping&&
|
|
(xa=v.uvs[0],e(Aa,Ca,ba,Ba,$,ea,xa[0].x,xa[0].y,xa[1].x,xa[1].y,xa[2].x,xa[2].y,x.map)):null!==x.envMap?x.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(ua.copy(v.vertexNormalsModelView[0]),cb=0.5*ua.x+0.5,db=0.5*ua.y+0.5,ua.copy(v.vertexNormalsModelView[1]),ob=0.5*ua.x+0.5,pb=0.5*ua.y+0.5,ua.copy(v.vertexNormalsModelView[2]),qb=0.5*ua.x+0.5,eb=0.5*ua.y+0.5,e(Aa,Ca,ba,Ba,$,ea,cb,db,ob,pb,qb,eb,x.envMap)):(V.copy(x.color),x.vertexColors===THREE.FaceColors&&V.multiply(v.color),!0===x.wireframe?
|
|
(xa=v.uvs[0],e(Aa,Ca,ba,Ba,$,ea,xa[0].x,xa[0].y,xa[1].x,xa[1].y,xa[2].x,xa[2].y,x.map)):null!==x.envMap?x.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(ua.copy(v.vertexNormalsModelView[0]),cb=0.5*ua.x+0.5,db=0.5*ua.y+0.5,ua.copy(v.vertexNormalsModelView[1]),ob=0.5*ua.x+0.5,pb=0.5*ua.y+0.5,ua.copy(v.vertexNormalsModelView[2]),qb=0.5*ua.x+0.5,eb=0.5*ua.y+0.5,e(Aa,Ca,ba,Ba,$,ea,cb,db,ob,pb,qb,eb,x.envMap)):(V.copy(x.color),x.vertexColors===THREE.FaceColors&&V.multiply(v.color),!0===x.wireframe?
|
|
-c(V,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):d(V)):x instanceof THREE.MeshDepthMaterial?(Ea=M.near,Ta=M.far,P.r=P.g=P.b=1-s(y.positionScreen.z*y.positionScreen.w,Ea,Ta),Y.r=Y.g=Y.b=1-s(F.positionScreen.z*F.positionScreen.w,Ea,Ta),T.r=T.g=T.b=1-s(J.positionScreen.z*J.positionScreen.w,Ea,Ta),ka.addColors(Y,T).multiplyScalar(0.5),Pa=h(P,Y,T,ka),f(Aa,Ca,ba,Ba,$,ea,0,0,1,0,0,1,Pa)):x instanceof THREE.MeshNormalMaterial&&(y=void 0,x.shading==THREE.FlatShading?(y=v.normalModelView,V.setRGB(y.x,
|
|
|
|
-y.y,y.z).multiplyScalar(0.5).addScalar(0.5),!0===x.wireframe?c(V,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):d(V)):x.shading==THREE.SmoothShading&&(y=v.vertexNormalsModelView[0],P.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),y=v.vertexNormalsModelView[1],Y.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),y=v.vertexNormalsModelView[2],T.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),ka.addColors(Y,T).multiplyScalar(0.5),Pa=h(P,Y,T,ka),f(Aa,Ca,ba,Ba,$,ea,0,0,
|
|
|
|
|
|
+c(V,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):d(V)):x instanceof THREE.MeshDepthMaterial?(Ea=M.near,Ta=M.far,P.r=P.g=P.b=1-s(y.positionScreen.z*y.positionScreen.w,Ea,Ta),Y.r=Y.g=Y.b=1-s(F.positionScreen.z*F.positionScreen.w,Ea,Ta),U.r=U.g=U.b=1-s(J.positionScreen.z*J.positionScreen.w,Ea,Ta),ka.addColors(Y,U).multiplyScalar(0.5),Pa=h(P,Y,U,ka),f(Aa,Ca,ba,Ba,$,ea,0,0,1,0,0,1,Pa)):x instanceof THREE.MeshNormalMaterial&&(y=void 0,x.shading==THREE.FlatShading?(y=v.normalModelView,V.setRGB(y.x,
|
|
|
|
+y.y,y.z).multiplyScalar(0.5).addScalar(0.5),!0===x.wireframe?c(V,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):d(V)):x.shading==THREE.SmoothShading&&(y=v.vertexNormalsModelView[0],P.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),y=v.vertexNormalsModelView[1],Y.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),y=v.vertexNormalsModelView[2],U.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),ka.addColors(Y,U).multiplyScalar(0.5),Pa=h(P,Y,U,ka),f(Aa,Ca,ba,Ba,$,ea,0,0,
|
|
1,0,0,1,Pa)))}}la.union(ra)}}B.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
|
|
1,0,0,1,Pa)))}}la.union(ra)}}B.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
|
|
envmap_pars_fragment:"#ifdef USE_ENVMAP\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nuniform bool useRefract;\nuniform float refractionRatio;\n#else\nvarying vec3 vReflect;\n#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec3 reflectVec;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\nif ( useRefract ) {\nreflectVec = refract( cameraToVertex, normal, refractionRatio );\n} else { \nreflectVec = reflect( cameraToVertex, normal );\n}\n#else\nreflectVec = vReflect;\n#endif\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n} else if ( combine == 2 ) {\ngl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n} else {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n}\n#endif",
|
|
envmap_pars_fragment:"#ifdef USE_ENVMAP\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nuniform bool useRefract;\nuniform float refractionRatio;\n#else\nvarying vec3 vReflect;\n#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec3 reflectVec;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\nif ( useRefract ) {\nreflectVec = refract( cameraToVertex, normal, refractionRatio );\n} else { \nreflectVec = reflect( cameraToVertex, normal );\n}\n#else\nreflectVec = vReflect;\n#endif\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n} else if ( combine == 2 ) {\ngl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n} else {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n}\n#endif",
|
|
envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
|
|
envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
|
|
@@ -374,7 +375,7 @@ function c(a,b){var c=b.geometry,h=a.faces3,g=3*h.length,i=1*h.length,k=3*h.leng
|
|
(a.__skinIndexArray=new Float32Array(4*g),a.__skinWeightArray=new Float32Array(4*g));a.__faceArray=new Uint16Array(3*i);a.__lineArray=new Uint16Array(2*k);if(a.numMorphTargets){a.__morphTargetsArrays=[];c=0;for(m=a.numMorphTargets;c<m;c++)a.__morphTargetsArrays.push(new Float32Array(3*g))}if(a.numMorphNormals){a.__morphNormalsArrays=[];c=0;for(m=a.numMorphNormals;c<m;c++)a.__morphNormalsArrays.push(new Float32Array(3*g))}a.__webglFaceCount=3*i;a.__webglLineCount=2*k;if(h.attributes){void 0===a.__webglCustomAttributesList&&
|
|
(a.__skinIndexArray=new Float32Array(4*g),a.__skinWeightArray=new Float32Array(4*g));a.__faceArray=new Uint16Array(3*i);a.__lineArray=new Uint16Array(2*k);if(a.numMorphTargets){a.__morphTargetsArrays=[];c=0;for(m=a.numMorphTargets;c<m;c++)a.__morphTargetsArrays.push(new Float32Array(3*g))}if(a.numMorphNormals){a.__morphNormalsArrays=[];c=0;for(m=a.numMorphNormals;c<m;c++)a.__morphNormalsArrays.push(new Float32Array(3*g))}a.__webglFaceCount=3*i;a.__webglLineCount=2*k;if(h.attributes){void 0===a.__webglCustomAttributesList&&
|
|
(a.__webglCustomAttributesList=[]);for(var n in h.attributes){var i=h.attributes[n],k={},s;for(s in i)k[s]=i[s];if(!k.__webglInitialized||k.createUniqueBuffers)k.__webglInitialized=!0,c=1,"v2"===k.type?c=2:"v3"===k.type?c=3:"v4"===k.type?c=4:"c"===k.type&&(c=3),k.size=c,k.array=new Float32Array(g*c),k.buffer=j.createBuffer(),k.buffer.belongsToAttribute=n,i.needsUpdate=!0,k.__original=i;a.__webglCustomAttributesList.push(k)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?
|
|
(a.__webglCustomAttributesList=[]);for(var n in h.attributes){var i=h.attributes[n],k={},s;for(s in i)k[s]=i[s];if(!k.__webglInitialized||k.createUniqueBuffers)k.__webglInitialized=!0,c=1,"v2"===k.type?c=2:"v3"===k.type?c=3:"v4"===k.type?c=4:"c"===k.type&&(c=3),k.size=c,k.array=new Float32Array(g*c),k.buffer=j.createBuffer(),k.buffer.belongsToAttribute=n,i.needsUpdate=!0,k.__original=i;a.__webglCustomAttributesList.push(k)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?
|
|
a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function h(a){Ha[a]||(j.enableVertexAttribArray(a),Ha[a]=!0)}function g(){for(var a in Ha)Ha[a]&&(j.disableVertexAttribArray(a),Ha[a]=
|
|
a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function h(a){Ha[a]||(j.enableVertexAttribArray(a),Ha[a]=!0)}function g(){for(var a in Ha)Ha[a]&&(j.disableVertexAttribArray(a),Ha[a]=
|
|
-!1)}function i(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function k(a,b){return b[0]-a[0]}function m(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)ea=Ca=null,Ba=$=T=Y=fa=Ga=ka=-1,ua=!0,a[d].render(b,c,qb,eb),ea=Ca=null,Ba=$=T=Y=fa=Ga=ka=-1,ua=!0}function l(a,b,c,d,e,f,h,g){var j,i,k,m;b?(i=a.length-1,m=b=-1):(i=0,b=a.length,m=1);for(var l=i;l!==b;l+=m)if(j=a[l],j.render){i=j.object;k=j.buffer;if(g)j=g;else{j=j[c];if(!j)continue;h&&K.setBlending(j.blending,j.blendEquation,j.blendSrc,j.blendDst);
|
|
|
|
|
|
+!1)}function i(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function k(a,b){return b[0]-a[0]}function m(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)ea=Ca=null,Ba=$=U=Y=fa=Ga=ka=-1,ua=!0,a[d].render(b,c,qb,eb),ea=Ca=null,Ba=$=U=Y=fa=Ga=ka=-1,ua=!0}function l(a,b,c,d,e,f,h,g){var j,i,k,m;b?(i=a.length-1,m=b=-1):(i=0,b=a.length,m=1);for(var l=i;l!==b;l+=m)if(j=a[l],j.render){i=j.object;k=j.buffer;if(g)j=g;else{j=j[c];if(!j)continue;h&&K.setBlending(j.blending,j.blendEquation,j.blendSrc,j.blendDst);
|
|
K.setDepthTest(j.depthTest);K.setDepthWrite(j.depthWrite);z(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits)}K.setMaterialFaces(j);k instanceof THREE.BufferGeometry?K.renderBufferDirect(d,e,f,j,k,i):K.renderBuffer(d,e,f,j,k,i)}}function p(a,b,c,d,e,f,h){for(var g,j,i=0,k=a.length;i<k;i++)if(g=a[i],j=g.object,j.visible){if(h)g=h;else{g=g[b];if(!g)continue;f&&K.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);K.setDepthTest(g.depthTest);K.setDepthWrite(g.depthWrite);z(g.polygonOffset,
|
|
K.setDepthTest(j.depthTest);K.setDepthWrite(j.depthWrite);z(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits)}K.setMaterialFaces(j);k instanceof THREE.BufferGeometry?K.renderBufferDirect(d,e,f,j,k,i):K.renderBuffer(d,e,f,j,k,i)}}function p(a,b,c,d,e,f,h){for(var g,j,i=0,k=a.length;i<k;i++)if(g=a[i],j=g.object,j.visible){if(h)g=h;else{g=g[b];if(!g)continue;f&&K.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);K.setDepthTest(g.depthTest);K.setDepthWrite(g.depthWrite);z(g.polygonOffset,
|
|
g.polygonOffsetFactor,g.polygonOffsetUnits)}K.renderImmediateObject(c,d,e,g,j)}}function r(a,d){var e,f,h,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,void 0!==a.geometry&&void 0===a.geometry.__webglInit&&(a.geometry.__webglInit=!0,a.geometry.addEventListener("dispose",Db)),f=a.geometry,void 0!==f))if(f instanceof THREE.BufferGeometry){var i,k;for(i in f.attributes)k="index"===i?j.ELEMENT_ARRAY_BUFFER:j.ARRAY_BUFFER,g=f.attributes[i],
|
|
g.polygonOffsetFactor,g.polygonOffsetUnits)}K.renderImmediateObject(c,d,e,g,j)}}function r(a,d){var e,f,h,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,void 0!==a.geometry&&void 0===a.geometry.__webglInit&&(a.geometry.__webglInit=!0,a.geometry.addEventListener("dispose",Db)),f=a.geometry,void 0!==f))if(f instanceof THREE.BufferGeometry){var i,k;for(i in f.attributes)k="index"===i?j.ELEMENT_ARRAY_BUFFER:j.ARRAY_BUFFER,g=f.attributes[i],
|
|
void 0===g.numItems&&(g.numItems=g.array.length),g.buffer=j.createBuffer(),j.bindBuffer(k,g.buffer),j.bufferData(k,g.array,j.STATIC_DRAW)}else if(a instanceof THREE.Mesh){h=a.material;if(void 0===f.geometryGroups){i=f;var m,l,p;k={};var n=i.morphTargets.length,s=i.morphNormals.length,r=h instanceof THREE.MeshFaceMaterial;i.geometryGroups={};h=0;for(m=i.faces.length;h<m;h++)l=i.faces[h],l=r?l.materialIndex:0,void 0===k[l]&&(k[l]={hash:l,counter:0}),p=k[l].hash+"_"+k[l].counter,void 0===i.geometryGroups[p]&&
|
|
void 0===g.numItems&&(g.numItems=g.array.length),g.buffer=j.createBuffer(),j.bindBuffer(k,g.buffer),j.bufferData(k,g.array,j.STATIC_DRAW)}else if(a instanceof THREE.Mesh){h=a.material;if(void 0===f.geometryGroups){i=f;var m,l,p;k={};var n=i.morphTargets.length,s=i.morphNormals.length,r=h instanceof THREE.MeshFaceMaterial;i.geometryGroups={};h=0;for(m=i.faces.length;h<m;h++)l=i.faces[h],l=r?l.materialIndex:0,void 0===k[l]&&(k[l]={hash:l,counter:0}),p=k[l].hash+"_"+k[l].counter,void 0===i.geometryGroups[p]&&
|
|
@@ -387,11 +388,11 @@ THREE.ParticleSystem?(f=a.geometry,t(d.__webglObjects,f,a)):a instanceof THREE.I
|
|
return!1}function s(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function q(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Line?u(b.__webglObjects,a):a instanceof THREE.Sprite?w(b.__webglSprites,a):a instanceof THREE.LensFlare?w(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&u(b.__webglObjectsImmediate,a);delete a.__webglActive}function u(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}
|
|
return!1}function s(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function q(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Line?u(b.__webglObjects,a):a instanceof THREE.Sprite?w(b.__webglSprites,a):a instanceof THREE.LensFlare?w(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&u(b.__webglObjectsImmediate,a);delete a.__webglActive}function u(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}
|
|
function w(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function E(a,b,c,d,e){P=0;d.needsUpdate&&(d.program&&Hb(d),K.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(K.maxMorphTargets));var f=!1,g=d.program,h=g.uniforms,i=d.uniforms;g!==Ca&&(j.useProgram(g),Ca=g,f=!0);d.id!==Ba&&(Ba=d.id,f=!0);if(f||a!==ea)j.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),a!==ea&&(ea=a);if(d.skinning)if(zb&&
|
|
function w(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function E(a,b,c,d,e){P=0;d.needsUpdate&&(d.program&&Hb(d),K.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(K.maxMorphTargets));var f=!1,g=d.program,h=g.uniforms,i=d.uniforms;g!==Ca&&(j.useProgram(g),Ca=g,f=!0);d.id!==Ba&&(Ba=d.id,f=!0);if(f||a!==ea)j.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),a!==ea&&(ea=a);if(d.skinning)if(zb&&
|
|
e.useVertexTexture){if(null!==h.boneTexture){var k=C();j.uniform1i(h.boneTexture,k);K.setTexture(e.boneTexture,k)}null!==h.boneTextureWidth&&j.uniform1i(h.boneTextureWidth,e.boneTextureWidth);null!==h.boneTextureHeight&&j.uniform1i(h.boneTextureHeight,e.boneTextureHeight)}else null!==h.boneGlobalMatrices&&j.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(i.fogColor.value=c.color,c instanceof THREE.Fog?(i.fogNear.value=c.near,i.fogFar.value=c.far):c instanceof THREE.FogExp2&&
|
|
e.useVertexTexture){if(null!==h.boneTexture){var k=C();j.uniform1i(h.boneTexture,k);K.setTexture(e.boneTexture,k)}null!==h.boneTextureWidth&&j.uniform1i(h.boneTextureWidth,e.boneTextureWidth);null!==h.boneTextureHeight&&j.uniform1i(h.boneTextureHeight,e.boneTextureHeight)}else null!==h.boneGlobalMatrices&&j.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(i.fogColor.value=c.color,c instanceof THREE.Fog?(i.fogNear.value=c.near,i.fogFar.value=c.far):c instanceof THREE.FogExp2&&
|
|
-(i.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(ua){for(var m,l=k=0,p=0,n,s,r,q=Oa,t=q.directional.colors,u=q.directional.positions,w=q.point.colors,v=q.point.positions,z=q.point.distances,E=q.spot.colors,A=q.spot.positions,B=q.spot.distances,J=q.spot.directions,N=q.spot.anglesCos,O=q.spot.exponents,I=q.hemi.skyColors,V=q.hemi.groundColors,R=q.hemi.positions,M=0,T=0,Y=0,Aa=0,$=0,dc=0,X=0,W=0,Q=m=0,c=r=Q=0,f=b.length;c<f;c++)m=
|
|
|
|
|
|
+(i.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(ua){for(var m,l=k=0,p=0,n,s,r,q=Oa,t=q.directional.colors,u=q.directional.positions,w=q.point.colors,v=q.point.positions,z=q.point.distances,E=q.spot.colors,A=q.spot.positions,B=q.spot.distances,J=q.spot.directions,N=q.spot.anglesCos,O=q.spot.exponents,I=q.hemi.skyColors,V=q.hemi.groundColors,Q=q.hemi.positions,M=0,U=0,Y=0,Aa=0,$=0,dc=0,X=0,W=0,R=m=0,c=r=R=0,f=b.length;c<f;c++)m=
|
|
b[c],m.onlyShadow||(n=m.color,s=m.intensity,r=m.distance,m instanceof THREE.AmbientLight?m.visible&&(K.gammaInput?(k+=n.r*n.r,l+=n.g*n.g,p+=n.b*n.b):(k+=n.r,l+=n.g,p+=n.b)):m instanceof THREE.DirectionalLight?($+=1,m.visible&&(ga.getPositionFromMatrix(m.matrixWorld),sa.getPositionFromMatrix(m.target.matrixWorld),ga.sub(sa),ga.normalize(),0===ga.x&&0===ga.y&&0===ga.z||(m=3*M,u[m]=ga.x,u[m+1]=ga.y,u[m+2]=ga.z,K.gammaInput?F(t,m,n,s*s):y(t,m,n,s),M+=1))):m instanceof THREE.PointLight?(dc+=1,m.visible&&
|
|
b[c],m.onlyShadow||(n=m.color,s=m.intensity,r=m.distance,m instanceof THREE.AmbientLight?m.visible&&(K.gammaInput?(k+=n.r*n.r,l+=n.g*n.g,p+=n.b*n.b):(k+=n.r,l+=n.g,p+=n.b)):m instanceof THREE.DirectionalLight?($+=1,m.visible&&(ga.getPositionFromMatrix(m.matrixWorld),sa.getPositionFromMatrix(m.target.matrixWorld),ga.sub(sa),ga.normalize(),0===ga.x&&0===ga.y&&0===ga.z||(m=3*M,u[m]=ga.x,u[m+1]=ga.y,u[m+2]=ga.z,K.gammaInput?F(t,m,n,s*s):y(t,m,n,s),M+=1))):m instanceof THREE.PointLight?(dc+=1,m.visible&&
|
|
-(Q=3*T,K.gammaInput?F(w,Q,n,s*s):y(w,Q,n,s),sa.getPositionFromMatrix(m.matrixWorld),v[Q]=sa.x,v[Q+1]=sa.y,v[Q+2]=sa.z,z[T]=r,T+=1)):m instanceof THREE.SpotLight?(X+=1,m.visible&&(Q=3*Y,K.gammaInput?F(E,Q,n,s*s):y(E,Q,n,s),sa.getPositionFromMatrix(m.matrixWorld),A[Q]=sa.x,A[Q+1]=sa.y,A[Q+2]=sa.z,B[Y]=r,ga.copy(sa),sa.getPositionFromMatrix(m.target.matrixWorld),ga.sub(sa),ga.normalize(),J[Q]=ga.x,J[Q+1]=ga.y,J[Q+2]=ga.z,N[Y]=Math.cos(m.angle),O[Y]=m.exponent,Y+=1)):m instanceof THREE.HemisphereLight&&
|
|
|
|
-(W+=1,m.visible&&(ga.getPositionFromMatrix(m.matrixWorld),ga.normalize(),0===ga.x&&0===ga.y&&0===ga.z||(r=3*Aa,R[r]=ga.x,R[r+1]=ga.y,R[r+2]=ga.z,n=m.color,m=m.groundColor,K.gammaInput?(s*=s,F(I,r,n,s),F(V,r,m,s)):(y(I,r,n,s),y(V,r,m,s)),Aa+=1))));c=3*M;for(f=Math.max(t.length,3*$);c<f;c++)t[c]=0;c=3*T;for(f=Math.max(w.length,3*dc);c<f;c++)w[c]=0;c=3*Y;for(f=Math.max(E.length,3*X);c<f;c++)E[c]=0;c=3*Aa;for(f=Math.max(I.length,3*W);c<f;c++)I[c]=0;c=3*Aa;for(f=Math.max(V.length,3*W);c<f;c++)V[c]=0;q.directional.length=
|
|
|
|
-M;q.point.length=T;q.spot.length=Y;q.hemi.length=Aa;q.ambient[0]=k;q.ambient[1]=l;q.ambient[2]=p;ua=!1}c=Oa;i.ambientLightColor.value=c.ambient;i.directionalLightColor.value=c.directional.colors;i.directionalLightDirection.value=c.directional.positions;i.pointLightColor.value=c.point.colors;i.pointLightPosition.value=c.point.positions;i.pointLightDistance.value=c.point.distances;i.spotLightColor.value=c.spot.colors;i.spotLightPosition.value=c.spot.positions;i.spotLightDistance.value=c.spot.distances;
|
|
|
|
|
|
+(R=3*U,K.gammaInput?F(w,R,n,s*s):y(w,R,n,s),sa.getPositionFromMatrix(m.matrixWorld),v[R]=sa.x,v[R+1]=sa.y,v[R+2]=sa.z,z[U]=r,U+=1)):m instanceof THREE.SpotLight?(X+=1,m.visible&&(R=3*Y,K.gammaInput?F(E,R,n,s*s):y(E,R,n,s),sa.getPositionFromMatrix(m.matrixWorld),A[R]=sa.x,A[R+1]=sa.y,A[R+2]=sa.z,B[Y]=r,ga.copy(sa),sa.getPositionFromMatrix(m.target.matrixWorld),ga.sub(sa),ga.normalize(),J[R]=ga.x,J[R+1]=ga.y,J[R+2]=ga.z,N[Y]=Math.cos(m.angle),O[Y]=m.exponent,Y+=1)):m instanceof THREE.HemisphereLight&&
|
|
|
|
+(W+=1,m.visible&&(ga.getPositionFromMatrix(m.matrixWorld),ga.normalize(),0===ga.x&&0===ga.y&&0===ga.z||(r=3*Aa,Q[r]=ga.x,Q[r+1]=ga.y,Q[r+2]=ga.z,n=m.color,m=m.groundColor,K.gammaInput?(s*=s,F(I,r,n,s),F(V,r,m,s)):(y(I,r,n,s),y(V,r,m,s)),Aa+=1))));c=3*M;for(f=Math.max(t.length,3*$);c<f;c++)t[c]=0;c=3*U;for(f=Math.max(w.length,3*dc);c<f;c++)w[c]=0;c=3*Y;for(f=Math.max(E.length,3*X);c<f;c++)E[c]=0;c=3*Aa;for(f=Math.max(I.length,3*W);c<f;c++)I[c]=0;c=3*Aa;for(f=Math.max(V.length,3*W);c<f;c++)V[c]=0;q.directional.length=
|
|
|
|
+M;q.point.length=U;q.spot.length=Y;q.hemi.length=Aa;q.ambient[0]=k;q.ambient[1]=l;q.ambient[2]=p;ua=!1}c=Oa;i.ambientLightColor.value=c.ambient;i.directionalLightColor.value=c.directional.colors;i.directionalLightDirection.value=c.directional.positions;i.pointLightColor.value=c.point.colors;i.pointLightPosition.value=c.point.positions;i.pointLightDistance.value=c.point.distances;i.spotLightColor.value=c.spot.colors;i.spotLightPosition.value=c.spot.positions;i.spotLightDistance.value=c.spot.distances;
|
|
i.spotLightDirection.value=c.spot.directions;i.spotLightAngleCos.value=c.spot.anglesCos;i.spotLightExponent.value=c.spot.exponents;i.hemisphereLightSkyColor.value=c.hemi.skyColors;i.hemisphereLightGroundColor.value=c.hemi.groundColors;i.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){i.opacity.value=d.opacity;K.gammaInput?i.diffuse.value.copyGammaToLinear(d.color):i.diffuse.value=
|
|
i.spotLightDirection.value=c.spot.directions;i.spotLightAngleCos.value=c.spot.anglesCos;i.spotLightExponent.value=c.spot.exponents;i.hemisphereLightSkyColor.value=c.hemi.skyColors;i.hemisphereLightGroundColor.value=c.hemi.groundColors;i.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){i.opacity.value=d.opacity;K.gammaInput?i.diffuse.value.copyGammaToLinear(d.color):i.diffuse.value=
|
|
d.color;i.map.value=d.map;i.lightMap.value=d.lightMap;i.specularMap.value=d.specularMap;d.bumpMap&&(i.bumpMap.value=d.bumpMap,i.bumpScale.value=d.bumpScale);d.normalMap&&(i.normalMap.value=d.normalMap,i.normalScale.value.copy(d.normalScale));var ba;d.map?ba=d.map:d.specularMap?ba=d.specularMap:d.normalMap?ba=d.normalMap:d.bumpMap&&(ba=d.bumpMap);void 0!==ba&&(c=ba.offset,ba=ba.repeat,i.offsetRepeat.value.set(c.x,c.y,ba.x,ba.y));i.envMap.value=d.envMap;i.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?
|
|
d.color;i.map.value=d.map;i.lightMap.value=d.lightMap;i.specularMap.value=d.specularMap;d.bumpMap&&(i.bumpMap.value=d.bumpMap,i.bumpScale.value=d.bumpScale);d.normalMap&&(i.normalMap.value=d.normalMap,i.normalScale.value.copy(d.normalScale));var ba;d.map?ba=d.map:d.specularMap?ba=d.specularMap:d.normalMap?ba=d.normalMap:d.bumpMap&&(ba=d.bumpMap);void 0!==ba&&(c=ba.offset,ba=ba.repeat,i.offsetRepeat.value.set(c.x,c.y,ba.x,ba.y));i.envMap.value=d.envMap;i.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?
|
|
1:-1;i.reflectivity.value=d.reflectivity;i.refractionRatio.value=d.refractionRatio;i.combine.value=d.combine;i.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity,i.dashSize.value=d.dashSize,i.totalSize.value=d.dashSize+d.gapSize,i.scale.value=d.scale):d instanceof THREE.ParticleBasicMaterial?
|
|
1:-1;i.reflectivity.value=d.reflectivity;i.refractionRatio.value=d.refractionRatio;i.combine.value=d.combine;i.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity,i.dashSize.value=d.dashSize,i.totalSize.value=d.dashSize+d.gapSize,i.scale.value=d.scale):d instanceof THREE.ParticleBasicMaterial?
|
|
@@ -414,89 +415,88 @@ THREE.LinearFilter)return j.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return
|
|
THREE.UnsignedShortType)return j.UNSIGNED_SHORT;if(a===THREE.IntType)return j.INT;if(a===THREE.UnsignedIntType)return j.UNSIGNED_INT;if(a===THREE.FloatType)return j.FLOAT;if(a===THREE.AlphaFormat)return j.ALPHA;if(a===THREE.RGBFormat)return j.RGB;if(a===THREE.RGBAFormat)return j.RGBA;if(a===THREE.LuminanceFormat)return j.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return j.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return j.FUNC_ADD;if(a===THREE.SubtractEquation)return j.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return j.FUNC_REVERSE_SUBTRACT;
|
|
THREE.UnsignedShortType)return j.UNSIGNED_SHORT;if(a===THREE.IntType)return j.INT;if(a===THREE.UnsignedIntType)return j.UNSIGNED_INT;if(a===THREE.FloatType)return j.FLOAT;if(a===THREE.AlphaFormat)return j.ALPHA;if(a===THREE.RGBFormat)return j.RGB;if(a===THREE.RGBAFormat)return j.RGBA;if(a===THREE.LuminanceFormat)return j.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return j.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return j.FUNC_ADD;if(a===THREE.SubtractEquation)return j.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return j.FUNC_REVERSE_SUBTRACT;
|
|
if(a===THREE.ZeroFactor)return j.ZERO;if(a===THREE.OneFactor)return j.ONE;if(a===THREE.SrcColorFactor)return j.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return j.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return j.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return j.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return j.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return j.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return j.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return j.ONE_MINUS_DST_COLOR;
|
|
if(a===THREE.ZeroFactor)return j.ZERO;if(a===THREE.OneFactor)return j.ONE;if(a===THREE.SrcColorFactor)return j.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return j.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return j.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return j.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return j.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return j.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return j.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return j.ONE_MINUS_DST_COLOR;
|
|
if(a===THREE.SrcAlphaSaturateFactor)return j.SRC_ALPHA_SATURATE;if(void 0!==Fa){if(a===THREE.RGB_S3TC_DXT1_Format)return Fa.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Fa.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Fa.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Fa.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var a=a||{},G=void 0!==a.canvas?a.canvas:document.createElement("canvas"),
|
|
if(a===THREE.SrcAlphaSaturateFactor)return j.SRC_ALPHA_SATURATE;if(void 0!==Fa){if(a===THREE.RGB_S3TC_DXT1_Format)return Fa.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Fa.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Fa.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Fa.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var a=a||{},G=void 0!==a.canvas?a.canvas:document.createElement("canvas"),
|
|
-R=void 0!==a.precision?a.precision:"highp",J=void 0!==a.alpha?a.alpha:!0,ca=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,oa=void 0!==a.antialias?a.antialias:!1,pa=void 0!==a.stencil?a.stencil:!0,N=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,M=new THREE.Color(0),Q=0;void 0!==a.clearColor&&(console.warn("DEPRECATED: clearColor in WebGLRenderer constructor parameters is being removed. Use .setClearColor() instead."),M.setHex(a.clearColor));void 0!==a.clearAlpha&&(console.warn("DEPRECATED: clearAlpha in WebGLRenderer constructor parameters is being removed. Use .setClearColor() instead."),
|
|
|
|
-Q=a.clearAlpha);this.domElement=G;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=
|
|
|
|
-this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var K=this,da=[],Aa=0,Ca=null,ba=null,Ba=-1,$=null,ea=null,V=0,P=0,Y=-1,T=-1,ka=-1,ta=-1,ia=-1,La=-1,Ga=-1,fa=-1,Ea=null,Ta=null,Pa=null,xa=null,cb=0,db=0,ob=0,pb=0,qb=0,eb=0,Ha={},la=new THREE.Frustum,ra=new THREE.Matrix4,fb=new THREE.Matrix4,sa=new THREE.Vector3,
|
|
|
|
-ga=new THREE.Vector3,ua=!0,Oa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},j,Na,va,wa,Fa;try{var Qa={alpha:J,premultipliedAlpha:ca,antialias:oa,stencil:pa,preserveDrawingBuffer:N};j=G.getContext("webgl",Qa)||G.getContext("experimental-webgl",Qa);if(null===j)throw"Error creating WebGL context.";
|
|
|
|
-}catch(Zb){console.error(Zb)}Na=j.getExtension("OES_texture_float");j.getExtension("OES_texture_float_linear");va=j.getExtension("OES_standard_derivatives");wa=j.getExtension("EXT_texture_filter_anisotropic")||j.getExtension("MOZ_EXT_texture_filter_anisotropic")||j.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Fa=j.getExtension("WEBGL_compressed_texture_s3tc")||j.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||j.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");Na||console.log("THREE.WebGLRenderer: Float textures not supported.");
|
|
|
|
-va||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");wa||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");Fa||console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");void 0===j.getShaderPrecisionFormat&&(j.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);
|
|
|
|
-j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA);j.clearColor(M.r,M.g,M.b,Q);this.context=j;var Nb=j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS),$b=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);var ac=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE),Ob=wa?j.getParameter(wa.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Cb=0<$b,zb=Cb&&Na;Fa&&j.getParameter(j.COMPRESSED_TEXTURE_FORMATS);var bc=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_FLOAT),
|
|
|
|
-cc=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_FLOAT);var qc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_FLOAT),rc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,
|
|
|
|
-j.HIGH_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_INT);var sc=0<bc.precision&&0<qc.precision,Pb=0<cc.precision&&0<rc.precision;"highp"===R&&!sc&&(Pb?(R="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(R="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));"mediump"===R&&!Pb&&(R="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};
|
|
|
|
-this.supportsVertexTextures=function(){return Cb};this.supportsFloatTextures=function(){return Na};this.supportsStandardDerivatives=function(){return va};this.supportsCompressedTextureS3TC=function(){return Fa};this.getMaxAnisotropy=function(){return Ob};this.getPrecision=function(){return R};this.setSize=function(a,b,c){G.width=a*this.devicePixelRatio;G.height=b*this.devicePixelRatio;1!==this.devicePixelRatio&&!1!==c&&(G.style.width=a+"px",G.style.height=b+"px");this.setViewport(0,0,G.width,G.height)};
|
|
|
|
-this.setViewport=function(a,b,c,d){cb=void 0!==a?a:0;db=void 0!==b?b:0;ob=void 0!==c?c:G.width;pb=void 0!==d?d:G.height;j.viewport(cb,db,ob,pb)};this.setScissor=function(a,b,c,d){j.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};this.setClearColor=function(a,b){M.set(a);Q=void 0!==b?b:1;j.clearColor(M.r,M.g,M.b,Q)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");
|
|
|
|
-this.setClearColor(a,b)};this.getClearColor=function(){return M};this.getClearAlpha=function(){return Q};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=
|
|
|
|
-function(a,b){Ca=null;Ba=$=fa=Ga=ka=-1;ua=!0;T=Y=-1;this.shadowMapPlugin.update(a,b)};var Db=function(a){a=a.target;a.removeEventListener("dispose",Db);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&j.deleteBuffer(b[c].buffer);K.info.memory.geometries--}else if(void 0!==a.geometryGroups)for(b in a.geometryGroups){c=a.geometryGroups[b];if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)j.deleteBuffer(c.__webglMorphTargetsBuffers[d]);
|
|
|
|
-if(void 0!==c.numMorphNormals){d=0;for(e=c.numMorphNormals;d<e;d++)j.deleteBuffer(c.__webglMorphNormalsBuffers[d])}Ib(c)}else Ib(a)},Eb=function(a){a=a.target;a.removeEventListener("dispose",Eb);a.image&&a.image.__webglTextureCube?j.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,j.deleteTexture(a.__webglTexture));K.info.memory.textures--},Fb=function(a){a=a.target;a.removeEventListener("dispose",Fb);if(a&&a.__webglTexture)if(j.deleteTexture(a.__webglTexture),a instanceof
|
|
|
|
-THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)j.deleteFramebuffer(a.__webglFramebuffer[b]),j.deleteRenderbuffer(a.__webglRenderbuffer[b]);else j.deleteFramebuffer(a.__webglFramebuffer),j.deleteRenderbuffer(a.__webglRenderbuffer);K.info.memory.textures--},Gb=function(a){a=a.target;a.removeEventListener("dispose",Gb);Hb(a)},Ib=function(a){void 0!==a.__webglVertexBuffer&&j.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&j.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&
|
|
|
|
-j.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&j.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&j.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&j.deleteBuffer(a.__webglUV2Buffer);void 0!==a.__webglSkinIndicesBuffer&&j.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&j.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&j.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&j.deleteBuffer(a.__webglLineBuffer);
|
|
|
|
-void 0!==a.__webglLineDistanceBuffer&&j.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)j.deleteBuffer(a.__webglCustomAttributesList[b].buffer);K.info.memory.geometries--},Hb=function(a){var b=a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1,a=0;for(c=da.length;a<c;a++)if(d=da[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=da.length;a<c;a++)d=da[a],d.program!==b&&e.push(d);
|
|
|
|
-da=e;j.deleteProgram(b);K.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=j.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=j.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=j.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=j.createBuffer());a.hasPositions&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,a.positionArray,
|
|
|
|
-j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.position),j.vertexAttribPointer(b.attributes.position,3,j.FLOAT,!1,0,0));if(a.hasNormals){j.bindBuffer(j.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,f,h,g,i,k,l,m,p,n,q=3*a.count;for(n=0;n<q;n+=9)p=a.normalArray,d=p[n],e=p[n+1],f=p[n+2],h=p[n+3],i=p[n+4],l=p[n+5],g=p[n+6],k=p[n+7],m=p[n+8],d=(d+h+g)/3,e=(e+i+k)/3,f=(f+l+m)/3,p[n]=d,p[n+1]=e,p[n+2]=f,p[n+3]=d,p[n+4]=e,p[n+5]=f,p[n+6]=d,p[n+7]=e,p[n+8]=f}j.bufferData(j.ARRAY_BUFFER,
|
|
|
|
-a.normalArray,j.DYNAMIC_DRAW);j.enableVertexAttribArray(b.attributes.normal);j.vertexAttribPointer(b.attributes.normal,3,j.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglUvBuffer),j.bufferData(j.ARRAY_BUFFER,a.uvArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.uv),j.vertexAttribPointer(b.attributes.uv,2,j.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,a.colorArray,j.DYNAMIC_DRAW),
|
|
|
|
-j.enableVertexAttribArray(b.attributes.color),j.vertexAttribPointer(b.attributes.color,3,j.FLOAT,!1,0,0));j.drawArrays(j.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var i,k,l,m;i=E(a,b,c,d,f);b=i.attributes;a=e.attributes;c=!1;i=16777215*e.id+2*i.id+(d.wireframe?1:0);i!==$&&($=i,c=!0);c&&g();if(f instanceof THREE.Mesh)if(f=a.index){e=e.offsets;1<e.length&&(c=!0);for(var p=0,n=e.length;p<n;p++){var q=e[p].index;if(c){for(k in b)l=b[k],i=a[k],0<=
|
|
|
|
-l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,4*q*m)):d.defaultAttributeValues&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,f.buffer)}j.drawElements(j.TRIANGLES,e[p].count,j.UNSIGNED_SHORT,2*e[p].start);K.info.render.calls++;K.info.render.vertices+=e[p].count;K.info.render.faces+=
|
|
|
|
-e[p].count/3}}else{if(c)for(k in b)"index"!==k&&(l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k]))));d=e.attributes.position;j.drawArrays(j.TRIANGLES,0,d.numItems/3);K.info.render.calls++;K.info.render.vertices+=
|
|
|
|
-d.numItems/3;K.info.render.faces+=d.numItems/3/3}else if(f instanceof THREE.ParticleSystem){if(c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));d=a.position;j.drawArrays(j.POINTS,
|
|
|
|
-0,d.numItems/3);K.info.render.calls++;K.info.render.points+=d.numItems/3}}else if(f instanceof THREE.Line&&c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));k=f.type===THREE.LineStrip?
|
|
|
|
-j.LINE_STRIP:j.LINES;A(d.linewidth);d=a.position;j.drawArrays(k,0,d.numItems/3);K.info.render.calls++;K.info.render.points+=d.numItems}}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var i,l,c=E(a,b,c,d,f),a=c.attributes,b=!1,c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==$&&($=c,b=!0);b&&g();if(!d.morphTargets&&0<=a.position)b&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(a.position),j.vertexAttribPointer(a.position,3,j.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;
|
|
|
|
--1!==f.morphTargetBase&&0<=c.position?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0)):0<=c.position&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var m=0;l=f.morphTargetForcedOrder;for(i=f.morphTargetInfluences;m<d.numSupportedMorphTargets&&m<l.length;)0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,
|
|
|
|
-e.__webglMorphTargetsBuffers[l[m]]),h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l[m]]),h(c["morphNormal"+m]),j.vertexAttribPointer(c["morphNormal"+m],3,j.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[m]=i[l[m]],m++}else{l=[];i=f.morphTargetInfluences;var p,n=i.length;for(p=0;p<n;p++)m=i[p],0<m&&l.push([m,p]);l.length>d.numSupportedMorphTargets?(l.sort(k),l.length=
|
|
|
|
-d.numSupportedMorphTargets):l.length>d.numSupportedMorphNormals?l.sort(k):0===l.length&&l.push([0,0]);for(m=0;m<d.numSupportedMorphTargets;)l[m]?(p=l[m][1],0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[p]),h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[p]),h(c["morphNormal"+m]),j.vertexAttribPointer(c["morphNormal"+m],3,j.FLOAT,!1,0,
|
|
|
|
-0)),f.__webglMorphTargetInfluences[m]=i[p]):f.__webglMorphTargetInfluences[m]=0,m++}null!==d.program.uniforms.morphTargetInfluences&&j.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(b){if(e.__webglCustomAttributesList){i=0;for(l=e.__webglCustomAttributesList.length;i<l;i++)c=e.__webglCustomAttributesList[i],0<=a[c.buffer.belongsToAttribute]&&(j.bindBuffer(j.ARRAY_BUFFER,c.buffer),h(a[c.buffer.belongsToAttribute]),j.vertexAttribPointer(a[c.buffer.belongsToAttribute],
|
|
|
|
-c.size,j.FLOAT,!1,0,0))}0<=a.color&&(0<f.geometry.colors.length||0<f.geometry.faces.length?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglColorBuffer),h(a.color),j.vertexAttribPointer(a.color,3,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&j.vertexAttrib3fv(a.color,d.defaultAttributeValues.color));0<=a.normal&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglNormalBuffer),h(a.normal),j.vertexAttribPointer(a.normal,3,j.FLOAT,!1,0,0));0<=a.tangent&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglTangentBuffer),h(a.tangent),j.vertexAttribPointer(a.tangent,
|
|
|
|
-4,j.FLOAT,!1,0,0));0<=a.uv&&(f.geometry.faceVertexUvs[0]?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUVBuffer),h(a.uv),j.vertexAttribPointer(a.uv,2,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&j.vertexAttrib2fv(a.uv,d.defaultAttributeValues.uv));0<=a.uv2&&(f.geometry.faceVertexUvs[1]?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUV2Buffer),h(a.uv2),j.vertexAttribPointer(a.uv2,2,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&j.vertexAttrib2fv(a.uv2,d.defaultAttributeValues.uv2));d.skinning&&(0<=a.skinIndex&&0<=a.skinWeight)&&
|
|
|
|
-(j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),h(a.skinIndex),j.vertexAttribPointer(a.skinIndex,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),h(a.skinWeight),j.vertexAttribPointer(a.skinWeight,4,j.FLOAT,!1,0,0));0<=a.lineDistance&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglLineDistanceBuffer),h(a.lineDistance),j.vertexAttribPointer(a.lineDistance,1,j.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(d.wireframe?(A(d.wireframeLinewidth),b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,
|
|
|
|
-e.__webglLineBuffer),j.drawElements(j.LINES,e.__webglLineCount,j.UNSIGNED_SHORT,0)):(b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),j.drawElements(j.TRIANGLES,e.__webglFaceCount,j.UNSIGNED_SHORT,0)),K.info.render.calls++,K.info.render.vertices+=e.__webglFaceCount,K.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES,A(d.linewidth),j.drawArrays(f,0,e.__webglLineCount),K.info.render.calls++):f instanceof THREE.ParticleSystem&&
|
|
|
|
-(j.drawArrays(j.POINTS,0,e.__webglParticleCount),K.info.render.calls++,K.info.render.points+=e.__webglParticleCount)}};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,f,h,g,k=a.__lights,n=a.fog;Ba=-1;ua=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);ra.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);
|
|
|
|
-la.setFromMatrix(ra);this.autoUpdateObjects&&this.initWebGLObjects(a);m(this.renderPluginsPre,a,b);K.info.render.calls=0;K.info.render.vertices=0;K.info.render.faces=0;K.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);g=a.__webglObjects;d=0;for(e=g.length;d<e;d++)if(f=g[d],h=f.object,f.id=d,f.render=!1,h.visible&&(!(h instanceof THREE.Mesh||h instanceof THREE.ParticleSystem)||!h.frustumCulled||la.intersectsObject(h))){var q=
|
|
|
|
-h;q._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,q.matrixWorld);q._normalMatrix.getNormalMatrix(q._modelViewMatrix);var q=f,s=q.buffer,r=void 0,t=r=void 0,t=q.object.material;if(t instanceof THREE.MeshFaceMaterial)r=s.materialIndex,r=t.materials[r],r.transparent?(q.transparent=r,q.opaque=null):(q.opaque=r,q.transparent=null);else if(r=t)r.transparent?(q.transparent=r,q.opaque=null):(q.opaque=r,q.transparent=null);f.render=!0;!0===this.sortObjects&&(null!==h.renderDepth?f.z=h.renderDepth:
|
|
|
|
-(sa.getPositionFromMatrix(h.matrixWorld),sa.applyProjection(ra),f.z=sa.z))}this.sortObjects&&g.sort(i);g=a.__webglObjectsImmediate;d=0;for(e=g.length;d<e;d++)f=g[d],h=f.object,h.visible&&(h._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,h.matrixWorld),h._normalMatrix.getNormalMatrix(h._modelViewMatrix),h=f.object.material,h.transparent?(f.transparent=h,f.opaque=null):(f.opaque=h,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,
|
|
|
|
-d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),z(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),l(a.__webglObjects,!1,"",b,k,n,!0,d),p(a.__webglObjectsImmediate,"",b,k,n,!1,d)):(d=null,this.setBlending(THREE.NoBlending),l(a.__webglObjects,!0,"opaque",b,k,n,!1,d),p(a.__webglObjectsImmediate,"opaque",b,k,n,!1,d),l(a.__webglObjects,!1,"transparent",b,k,n,!0,d),p(a.__webglObjectsImmediate,"transparent",b,k,n,!0,d));m(this.renderPluginsPost,a,b);c&&(c.generateMipmaps&&
|
|
|
|
-c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter)&&(c instanceof THREE.WebGLRenderTargetCube?(j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture),j.generateMipmap(j.TEXTURE_CUBE_MAP),j.bindTexture(j.TEXTURE_CUBE_MAP,null)):(j.bindTexture(j.TEXTURE_2D,c.__webglTexture),j.generateMipmap(j.TEXTURE_2D),j.bindTexture(j.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=E(a,b,c,d,e);$=-1;K.setMaterialFaces(d);e.immediateRenderCallback?
|
|
|
|
-e.immediateRenderCallback(f,j,la):e.render(function(a){K.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)r(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)q(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,h=a.__webglObjects.length;b<h;b++){var g=a.__webglObjects[b].object;void 0===g.__webglInit&&
|
|
|
|
-(void 0!==g.__webglActive&&q(g,a),r(g,a));var i=g,l=i.geometry,m=void 0,p=void 0,t=void 0;if(l instanceof THREE.BufferGeometry){var u=j.DYNAMIC_DRAW,w=!l.dynamic,v=l.attributes,z=void 0,y=void 0;for(z in v)y=v[z],y.needsUpdate&&("index"===z?(j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,y.buffer),j.bufferData(j.ELEMENT_ARRAY_BUFFER,y.array,u)):(j.bindBuffer(j.ARRAY_BUFFER,y.buffer),j.bufferData(j.ARRAY_BUFFER,y.array,u)),y.needsUpdate=!1),w&&!y.dynamic&&(y.array=null)}else if(i instanceof THREE.Mesh){for(var E=
|
|
|
|
-0,A=l.geometryGroupsList.length;E<A;E++)if(m=l.geometryGroupsList[E],t=d(i,m),l.buffersNeedUpdate&&c(m,i),p=t.attributes&&n(t),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||p){var x=m,B=i,C=j.DYNAMIC_DRAW,F=!l.dynamic,G=t;if(x.__inittedArrays){var J=e(G),K=G.vertexColors?G.vertexColors:!1,N=f(G),O=J===THREE.SmoothShading,D=void 0,I=void 0,V=void 0,M=void 0,R=void 0,Q=void 0,T=void 0,ba=void 0,Y=
|
|
|
|
-void 0,Aa=void 0,$=void 0,P=void 0,X=void 0,W=void 0,Ca=void 0,ea=void 0,Ba=void 0,ca=void 0,da=void 0,ia=void 0,fa=void 0,ga=void 0,ka=void 0,la=void 0,oa=void 0,pa=void 0,ta=void 0,ua=void 0,va=void 0,Da=void 0,Ea=void 0,Ga=void 0,Fa=void 0,La=void 0,Ra=void 0,Ha=void 0,wa=void 0,xa=void 0,Pa=void 0,Qa=void 0,ab=0,bb=0,Na=0,Oa=0,Ta=0,gb=0,Sa=0,tb=0,Ya=0,qa=0,ya=0,L=0,Ma=void 0,hb=x.__vertexArray,cb=x.__uvArray,db=x.__uv2Array,vb=x.__normalArray,Ua=x.__tangentArray,ib=x.__colorArray,Va=x.__skinIndexArray,
|
|
|
|
-Wa=x.__skinWeightArray,ob=x.__morphTargetsArrays,pb=x.__morphNormalsArrays,qb=x.__webglCustomAttributesList,H=void 0,eb=x.__faceArray,wb=x.__lineArray,Ia=B.geometry,Cb=Ia.elementsNeedUpdate,zb=Ia.uvsNeedUpdate,Eb=Ia.normalsNeedUpdate,Nb=Ia.tangentsNeedUpdate,Ob=Ia.colorsNeedUpdate,Pb=Ia.morphTargetsNeedUpdate,ec=Ia.vertices,aa=x.faces3,jb=Ia.faces,Db=Ia.faceVertexUvs[0],Fb=Ia.faceVertexUvs[1],fc=Ia.skinIndices,Qb=Ia.skinWeights,Rb=Ia.morphTargets,Gb=Ia.morphNormals;if(Ia.verticesNeedUpdate){D=0;for(I=
|
|
|
|
-aa.length;D<I;D++)M=jb[aa[D]],P=ec[M.a],X=ec[M.b],W=ec[M.c],hb[bb]=P.x,hb[bb+1]=P.y,hb[bb+2]=P.z,hb[bb+3]=X.x,hb[bb+4]=X.y,hb[bb+5]=X.z,hb[bb+6]=W.x,hb[bb+7]=W.y,hb[bb+8]=W.z,bb+=9;j.bindBuffer(j.ARRAY_BUFFER,x.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,hb,C)}if(Pb){Ra=0;for(Ha=Rb.length;Ra<Ha;Ra++){D=ya=0;for(I=aa.length;D<I;D++)Pa=aa[D],M=jb[Pa],P=Rb[Ra].vertices[M.a],X=Rb[Ra].vertices[M.b],W=Rb[Ra].vertices[M.c],wa=ob[Ra],wa[ya]=P.x,wa[ya+1]=P.y,wa[ya+2]=P.z,wa[ya+3]=X.x,wa[ya+4]=X.y,wa[ya+
|
|
|
|
-5]=X.z,wa[ya+6]=W.x,wa[ya+7]=W.y,wa[ya+8]=W.z,G.morphNormals&&(O?(Qa=Gb[Ra].vertexNormals[Pa],ca=Qa.a,da=Qa.b,ia=Qa.c):ia=da=ca=Gb[Ra].faceNormals[Pa],xa=pb[Ra],xa[ya]=ca.x,xa[ya+1]=ca.y,xa[ya+2]=ca.z,xa[ya+3]=da.x,xa[ya+4]=da.y,xa[ya+5]=da.z,xa[ya+6]=ia.x,xa[ya+7]=ia.y,xa[ya+8]=ia.z),ya+=9;j.bindBuffer(j.ARRAY_BUFFER,x.__webglMorphTargetsBuffers[Ra]);j.bufferData(j.ARRAY_BUFFER,ob[Ra],C);G.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglMorphNormalsBuffers[Ra]),j.bufferData(j.ARRAY_BUFFER,pb[Ra],
|
|
|
|
-C))}}if(Qb.length){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],la=Qb[M.a],oa=Qb[M.b],pa=Qb[M.c],Wa[qa]=la.x,Wa[qa+1]=la.y,Wa[qa+2]=la.z,Wa[qa+3]=la.w,Wa[qa+4]=oa.x,Wa[qa+5]=oa.y,Wa[qa+6]=oa.z,Wa[qa+7]=oa.w,Wa[qa+8]=pa.x,Wa[qa+9]=pa.y,Wa[qa+10]=pa.z,Wa[qa+11]=pa.w,ta=fc[M.a],ua=fc[M.b],va=fc[M.c],Va[qa]=ta.x,Va[qa+1]=ta.y,Va[qa+2]=ta.z,Va[qa+3]=ta.w,Va[qa+4]=ua.x,Va[qa+5]=ua.y,Va[qa+6]=ua.z,Va[qa+7]=ua.w,Va[qa+8]=va.x,Va[qa+9]=va.y,Va[qa+10]=va.z,Va[qa+11]=va.w,qa+=12;0<qa&&(j.bindBuffer(j.ARRAY_BUFFER,
|
|
|
|
-x.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,Va,C),j.bindBuffer(j.ARRAY_BUFFER,x.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,Wa,C))}if(Ob&&K){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],T=M.vertexColors,ba=M.color,3===T.length&&K===THREE.VertexColors?(fa=T[0],ga=T[1],ka=T[2]):ka=ga=fa=ba,ib[Ya]=fa.r,ib[Ya+1]=fa.g,ib[Ya+2]=fa.b,ib[Ya+3]=ga.r,ib[Ya+4]=ga.g,ib[Ya+5]=ga.b,ib[Ya+6]=ka.r,ib[Ya+7]=ka.g,ib[Ya+8]=ka.b,Ya+=9;0<Ya&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,
|
|
|
|
-ib,C))}if(Nb&&Ia.hasTangents){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],Y=M.vertexTangents,Ca=Y[0],ea=Y[1],Ba=Y[2],Ua[Sa]=Ca.x,Ua[Sa+1]=Ca.y,Ua[Sa+2]=Ca.z,Ua[Sa+3]=Ca.w,Ua[Sa+4]=ea.x,Ua[Sa+5]=ea.y,Ua[Sa+6]=ea.z,Ua[Sa+7]=ea.w,Ua[Sa+8]=Ba.x,Ua[Sa+9]=Ba.y,Ua[Sa+10]=Ba.z,Ua[Sa+11]=Ba.w,Sa+=12;j.bindBuffer(j.ARRAY_BUFFER,x.__webglTangentBuffer);j.bufferData(j.ARRAY_BUFFER,Ua,C)}if(Eb&&J){D=0;for(I=aa.length;D<I;D++)if(M=jb[aa[D]],R=M.vertexNormals,Q=M.normal,3===R.length&&O)for(Da=0;3>Da;Da++)Ga=R[Da],vb[gb]=
|
|
|
|
-Ga.x,vb[gb+1]=Ga.y,vb[gb+2]=Ga.z,gb+=3;else for(Da=0;3>Da;Da++)vb[gb]=Q.x,vb[gb+1]=Q.y,vb[gb+2]=Q.z,gb+=3;j.bindBuffer(j.ARRAY_BUFFER,x.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,vb,C)}if(zb&&Db&&N){D=0;for(I=aa.length;D<I;D++)if(V=aa[D],Aa=Db[V],void 0!==Aa)for(Da=0;3>Da;Da++)Fa=Aa[Da],cb[Na]=Fa.x,cb[Na+1]=Fa.y,Na+=2;0<Na&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,cb,C))}if(zb&&Fb&&N){D=0;for(I=aa.length;D<I;D++)if(V=aa[D],$=Fb[V],void 0!==$)for(Da=0;3>Da;Da++)La=
|
|
|
|
-$[Da],db[Oa]=La.x,db[Oa+1]=La.y,Oa+=2;0<Oa&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,db,C))}if(Cb){D=0;for(I=aa.length;D<I;D++)eb[Ta]=ab,eb[Ta+1]=ab+1,eb[Ta+2]=ab+2,Ta+=3,wb[tb]=ab,wb[tb+1]=ab+1,wb[tb+2]=ab,wb[tb+3]=ab+2,wb[tb+4]=ab+1,wb[tb+5]=ab+2,tb+=6,ab+=3;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,x.__webglFaceBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,eb,C);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,x.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,wb,C)}if(qb){Da=
|
|
|
|
-0;for(Ea=qb.length;Da<Ea;Da++)if(H=qb[Da],H.__original.needsUpdate){L=0;if(1===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],H.array[L]=H.value[M.a],H.array[L+1]=H.value[M.b],H.array[L+2]=H.value[M.c],L+=3}else{if("faces"===H.boundTo){D=0;for(I=aa.length;D<I;D++)Ma=H.value[aa[D]],H.array[L]=Ma,H.array[L+1]=Ma,H.array[L+2]=Ma,L+=3}}else if(2===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],P=H.value[M.a],
|
|
|
|
-X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}else{if("faces"===H.boundTo){D=0;for(I=aa.length;D<I;D++)W=X=P=Ma=H.value[aa[D]],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}}else if(3===H.size){var na;na="c"===H.type?["r","g","b"]:["x","y","z"];if(void 0===H.boundTo||"vertices"===H.boundTo){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],P=H.value[M.a],X=H.value[M.b],
|
|
|
|
-W=H.value[M.c],H.array[L]=P[na[0]],H.array[L+1]=P[na[1]],H.array[L+2]=P[na[2]],H.array[L+3]=X[na[0]],H.array[L+4]=X[na[1]],H.array[L+5]=X[na[2]],H.array[L+6]=W[na[0]],H.array[L+7]=W[na[1]],H.array[L+8]=W[na[2]],L+=9}else if("faces"===H.boundTo){D=0;for(I=aa.length;D<I;D++)W=X=P=Ma=H.value[aa[D]],H.array[L]=P[na[0]],H.array[L+1]=P[na[1]],H.array[L+2]=P[na[2]],H.array[L+3]=X[na[0]],H.array[L+4]=X[na[1]],H.array[L+5]=X[na[2]],H.array[L+6]=W[na[0]],H.array[L+7]=W[na[1]],H.array[L+8]=W[na[2]],L+=9}else if("faceVertices"===
|
|
|
|
-H.boundTo){D=0;for(I=aa.length;D<I;D++)Ma=H.value[aa[D]],P=Ma[0],X=Ma[1],W=Ma[2],H.array[L]=P[na[0]],H.array[L+1]=P[na[1]],H.array[L+2]=P[na[2]],H.array[L+3]=X[na[0]],H.array[L+4]=X[na[1]],H.array[L+5]=X[na[2]],H.array[L+6]=W[na[0]],H.array[L+7]=W[na[1]],H.array[L+8]=W[na[2]],L+=9}}else if(4===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+
|
|
|
|
-4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faces"===H.boundTo){D=0;for(I=aa.length;D<I;D++)W=X=P=Ma=H.value[aa[D]],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faceVertices"===H.boundTo){D=0;for(I=aa.length;D<I;D++)Ma=H.value[aa[D]],
|
|
|
|
-P=Ma[0],X=Ma[1],W=Ma[2],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}j.bindBuffer(j.ARRAY_BUFFER,H.buffer);j.bufferData(j.ARRAY_BUFFER,H.array,C)}}F&&(delete x.__inittedArrays,delete x.__colorArray,delete x.__normalArray,delete x.__tangentArray,delete x.__uvArray,delete x.__uv2Array,delete x.__faceArray,delete x.__vertexArray,delete x.__lineArray,
|
|
|
|
-delete x.__skinIndexArray,delete x.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.Line){t=d(i,l);p=t.attributes&&n(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||p){var Xa=l,Sb=j.DYNAMIC_DRAW,Jb=void 0,Kb=void 0,Lb=void 0,Tb=void 0,ma=void 0,Ub=void 0,Hb=Xa.vertices,
|
|
|
|
-Ib=Xa.colors,kc=Xa.lineDistances,Zb=Hb.length,$b=Ib.length,ac=kc.length,Vb=Xa.__vertexArray,Wb=Xa.__colorArray,lc=Xa.__lineDistanceArray,bc=Xa.colorsNeedUpdate,cc=Xa.lineDistancesNeedUpdate,gc=Xa.__webglCustomAttributesList,Xb=void 0,mc=void 0,za=void 0,Ab=void 0,Ja=void 0,ja=void 0;if(Xa.verticesNeedUpdate){for(Jb=0;Jb<Zb;Jb++)Tb=Hb[Jb],ma=3*Jb,Vb[ma]=Tb.x,Vb[ma+1]=Tb.y,Vb[ma+2]=Tb.z;j.bindBuffer(j.ARRAY_BUFFER,Xa.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Vb,Sb)}if(bc){for(Kb=0;Kb<$b;Kb++)Ub=
|
|
|
|
-Ib[Kb],ma=3*Kb,Wb[ma]=Ub.r,Wb[ma+1]=Ub.g,Wb[ma+2]=Ub.b;j.bindBuffer(j.ARRAY_BUFFER,Xa.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Wb,Sb)}if(cc){for(Lb=0;Lb<ac;Lb++)lc[Lb]=kc[Lb];j.bindBuffer(j.ARRAY_BUFFER,Xa.__webglLineDistanceBuffer);j.bufferData(j.ARRAY_BUFFER,lc,Sb)}if(gc){Xb=0;for(mc=gc.length;Xb<mc;Xb++)if(ja=gc[Xb],ja.needsUpdate&&(void 0===ja.boundTo||"vertices"===ja.boundTo)){ma=0;Ab=ja.value.length;if(1===ja.size)for(za=0;za<Ab;za++)ja.array[za]=ja.value[za];else if(2===ja.size)for(za=
|
|
|
|
-0;za<Ab;za++)Ja=ja.value[za],ja.array[ma]=Ja.x,ja.array[ma+1]=Ja.y,ma+=2;else if(3===ja.size)if("c"===ja.type)for(za=0;za<Ab;za++)Ja=ja.value[za],ja.array[ma]=Ja.r,ja.array[ma+1]=Ja.g,ja.array[ma+2]=Ja.b,ma+=3;else for(za=0;za<Ab;za++)Ja=ja.value[za],ja.array[ma]=Ja.x,ja.array[ma+1]=Ja.y,ja.array[ma+2]=Ja.z,ma+=3;else if(4===ja.size)for(za=0;za<Ab;za++)Ja=ja.value[za],ja.array[ma]=Ja.x,ja.array[ma+1]=Ja.y,ja.array[ma+2]=Ja.z,ja.array[ma+3]=Ja.w,ma+=4;j.bindBuffer(j.ARRAY_BUFFER,ja.buffer);j.bufferData(j.ARRAY_BUFFER,
|
|
|
|
-ja.array,Sb)}}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.ParticleSystem){t=d(i,l);p=t.attributes&&n(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||i.sortParticles||p){var kb=l,hc=j.DYNAMIC_DRAW,Mb=i,Ka=void 0,lb=void 0,mb=void 0,U=void 0,nb=void 0,ub=void 0,Yb=kb.vertices,ic=Yb.length,jc=kb.colors,nc=jc.length,xb=kb.__vertexArray,yb=kb.__colorArray,rb=kb.__sortArray,oc=kb.verticesNeedUpdate,pc=kb.colorsNeedUpdate,sb=kb.__webglCustomAttributesList,
|
|
|
|
-Za=void 0,Bb=void 0,Z=void 0,$a=void 0,ha=void 0,S=void 0;if(Mb.sortParticles){fb.copy(ra);fb.multiply(Mb.matrixWorld);for(Ka=0;Ka<ic;Ka++)mb=Yb[Ka],sa.copy(mb),sa.applyProjection(fb),rb[Ka]=[sa.z,Ka];rb.sort(k);for(Ka=0;Ka<ic;Ka++)mb=Yb[rb[Ka][1]],U=3*Ka,xb[U]=mb.x,xb[U+1]=mb.y,xb[U+2]=mb.z;for(lb=0;lb<nc;lb++)U=3*lb,ub=jc[rb[lb][1]],yb[U]=ub.r,yb[U+1]=ub.g,yb[U+2]=ub.b;if(sb){Za=0;for(Bb=sb.length;Za<Bb;Za++)if(S=sb[Za],void 0===S.boundTo||"vertices"===S.boundTo)if(U=0,$a=S.value.length,1===S.size)for(Z=
|
|
|
|
-0;Z<$a;Z++)nb=rb[Z][1],S.array[Z]=S.value[nb];else if(2===S.size)for(Z=0;Z<$a;Z++)nb=rb[Z][1],ha=S.value[nb],S.array[U]=ha.x,S.array[U+1]=ha.y,U+=2;else if(3===S.size)if("c"===S.type)for(Z=0;Z<$a;Z++)nb=rb[Z][1],ha=S.value[nb],S.array[U]=ha.r,S.array[U+1]=ha.g,S.array[U+2]=ha.b,U+=3;else for(Z=0;Z<$a;Z++)nb=rb[Z][1],ha=S.value[nb],S.array[U]=ha.x,S.array[U+1]=ha.y,S.array[U+2]=ha.z,U+=3;else if(4===S.size)for(Z=0;Z<$a;Z++)nb=rb[Z][1],ha=S.value[nb],S.array[U]=ha.x,S.array[U+1]=ha.y,S.array[U+2]=ha.z,
|
|
|
|
-S.array[U+3]=ha.w,U+=4}}else{if(oc)for(Ka=0;Ka<ic;Ka++)mb=Yb[Ka],U=3*Ka,xb[U]=mb.x,xb[U+1]=mb.y,xb[U+2]=mb.z;if(pc)for(lb=0;lb<nc;lb++)ub=jc[lb],U=3*lb,yb[U]=ub.r,yb[U+1]=ub.g,yb[U+2]=ub.b;if(sb){Za=0;for(Bb=sb.length;Za<Bb;Za++)if(S=sb[Za],S.needsUpdate&&(void 0===S.boundTo||"vertices"===S.boundTo))if($a=S.value.length,U=0,1===S.size)for(Z=0;Z<$a;Z++)S.array[Z]=S.value[Z];else if(2===S.size)for(Z=0;Z<$a;Z++)ha=S.value[Z],S.array[U]=ha.x,S.array[U+1]=ha.y,U+=2;else if(3===S.size)if("c"===S.type)for(Z=
|
|
|
|
-0;Z<$a;Z++)ha=S.value[Z],S.array[U]=ha.r,S.array[U+1]=ha.g,S.array[U+2]=ha.b,U+=3;else for(Z=0;Z<$a;Z++)ha=S.value[Z],S.array[U]=ha.x,S.array[U+1]=ha.y,S.array[U+2]=ha.z,U+=3;else if(4===S.size)for(Z=0;Z<$a;Z++)ha=S.value[Z],S.array[U]=ha.x,S.array[U+1]=ha.y,S.array[U+2]=ha.z,S.array[U+3]=ha.w,U+=4}}if(oc||Mb.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,kb.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,xb,hc);if(pc||Mb.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,kb.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,
|
|
|
|
-yb,hc);if(sb){Za=0;for(Bb=sb.length;Za<Bb;Za++)if(S=sb[Za],S.needsUpdate||Mb.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,S.buffer),j.bufferData(j.ARRAY_BUFFER,S.array,hc)}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;t.attributes&&s(t)}}};this.initMaterial=function(a,b,c,d){var e,f,h,g;a.addEventListener("dispose",Gb);var i,k,l,m,p;a instanceof THREE.MeshDepthMaterial?p="depth":a instanceof THREE.MeshNormalMaterial?p="normal":a instanceof THREE.MeshBasicMaterial?p="basic":a instanceof THREE.MeshLambertMaterial?
|
|
|
|
-p="lambert":a instanceof THREE.MeshPhongMaterial?p="phong":a instanceof THREE.LineBasicMaterial?p="basic":a instanceof THREE.LineDashedMaterial?p="dashed":a instanceof THREE.ParticleBasicMaterial&&(p="particle_basic");if(p){var n=THREE.ShaderLib[p];a.uniforms=THREE.UniformsUtils.clone(n.uniforms);a.vertexShader=n.vertexShader;a.fragmentShader=n.fragmentShader}var q=e=0,s=0,t=n=0;for(f=b.length;t<f;t++)h=b[t],h.onlyShadow||(h instanceof THREE.DirectionalLight&&e++,h instanceof THREE.PointLight&&q++,
|
|
|
|
-h instanceof THREE.SpotLight&&s++,h instanceof THREE.HemisphereLight&&n++);f=q;h=s;g=n;s=n=0;for(q=b.length;s<q;s++)t=b[s],t.castShadow&&(t instanceof THREE.SpotLight&&n++,t instanceof THREE.DirectionalLight&&!t.shadowCascade&&n++);m=n;zb&&d&&d.useVertexTexture?l=1024:(b=j.getParameter(j.MAX_VERTEX_UNIFORM_VECTORS),b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(b=Math.min(d.bones.length,b),b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+d.bones.length+", this GPU supports just "+
|
|
|
|
-b+" (try OpenGL instead of ANGLE)")),l=b);a:{var s=a.fragmentShader,q=a.vertexShader,n=a.uniforms,b=a.attributes,t=a.defines,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,maxBones:l,useVertexTexture:zb&&d&&d.useVertexTexture,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,
|
|
|
|
-maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLights:h,maxHemiLights:g,maxShadows:m,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide},d=a.index0AttributeName,r,u,w;e=[];p?e.push(p):(e.push(s),e.push(q));for(u in t)e.push(u),
|
|
|
|
-e.push(t[u]);for(r in c)e.push(r),e.push(c[r]);p=e.join();r=0;for(u=da.length;r<u;r++)if(e=da[r],e.code===p){e.usedTimes++;k=e.program;break a}r="SHADOWMAP_TYPE_BASIC";c.shadowMapType===THREE.PCFShadowMap?r="SHADOWMAP_TYPE_PCF":c.shadowMapType===THREE.PCFSoftShadowMap&&(r="SHADOWMAP_TYPE_PCF_SOFT");u=[];for(w in t)e=t[w],!1!==e&&(e="#define "+w+" "+e,u.push(e));e=u.join("\n");w=j.createProgram();u=["precision "+R+" float;","precision "+R+" int;",e,Cb?"#define VERTEX_TEXTURES":"",K.gammaInput?"#define GAMMA_INPUT":
|
|
|
|
-"",K.gammaOutput?"#define GAMMA_OUTPUT":"",K.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":
|
|
|
|
-"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+r:"",c.shadowMapDebug?
|
|
|
|
-"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
|
|
|
|
-r=["precision "+R+" float;","precision "+R+" int;",c.bumpMap||c.normalMap?"#extension GL_OES_standard_derivatives : enable":"",e,"#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",K.gammaInput?"#define GAMMA_INPUT":"",K.gammaOutput?"#define GAMMA_OUTPUT":"",K.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":
|
|
|
|
|
|
+Q=void 0!==a.precision?a.precision:"highp",J=void 0!==a.alpha?a.alpha:!0,ca=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,oa=void 0!==a.antialias?a.antialias:!1,pa=void 0!==a.stencil?a.stencil:!0,N=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,M=new THREE.Color(0),R=0;this.domElement=G;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=
|
|
|
|
+this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,
|
|
|
|
+faces:0,points:0}};var K=this,da=[],Aa=0,Ca=null,ba=null,Ba=-1,$=null,ea=null,V=0,P=0,Y=-1,U=-1,ka=-1,ta=-1,ia=-1,La=-1,Ga=-1,fa=-1,Ea=null,Ta=null,Pa=null,xa=null,cb=0,db=0,ob=0,pb=0,qb=0,eb=0,Ha={},la=new THREE.Frustum,ra=new THREE.Matrix4,fb=new THREE.Matrix4,sa=new THREE.Vector3,ga=new THREE.Vector3,ua=!0,Oa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],
|
|
|
|
+exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},j,Na,va,wa,Fa;try{var Qa={alpha:J,premultipliedAlpha:ca,antialias:oa,stencil:pa,preserveDrawingBuffer:N};j=G.getContext("webgl",Qa)||G.getContext("experimental-webgl",Qa);if(null===j)throw"Error creating WebGL context.";}catch(Zb){console.error(Zb)}Na=j.getExtension("OES_texture_float");j.getExtension("OES_texture_float_linear");va=j.getExtension("OES_standard_derivatives");wa=j.getExtension("EXT_texture_filter_anisotropic")||
|
|
|
|
+j.getExtension("MOZ_EXT_texture_filter_anisotropic")||j.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Fa=j.getExtension("WEBGL_compressed_texture_s3tc")||j.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||j.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");Na||console.log("THREE.WebGLRenderer: Float textures not supported.");va||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");wa||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");
|
|
|
|
+Fa||console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");void 0===j.getShaderPrecisionFormat&&(j.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA);j.clearColor(M.r,M.g,M.b,R);this.context=j;var Nb=
|
|
|
|
+j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS),$b=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);var ac=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE),Ob=wa?j.getParameter(wa.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Cb=0<$b,zb=Cb&&Na;Fa&&j.getParameter(j.COMPRESSED_TEXTURE_FORMATS);var bc=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_FLOAT),cc=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_FLOAT);var qc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,
|
|
|
|
+j.HIGH_FLOAT),rc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_INT);var sc=0<bc.precision&&0<qc.precision,
|
|
|
|
+Pb=0<cc.precision&&0<rc.precision;"highp"===Q&&!sc&&(Pb?(Q="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(Q="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));"mediump"===Q&&!Pb&&(Q="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};this.supportsVertexTextures=function(){return Cb};this.supportsFloatTextures=function(){return Na};this.supportsStandardDerivatives=function(){return va};
|
|
|
|
+this.supportsCompressedTextureS3TC=function(){return Fa};this.getMaxAnisotropy=function(){return Ob};this.getPrecision=function(){return Q};this.setSize=function(a,b,c){G.width=a*this.devicePixelRatio;G.height=b*this.devicePixelRatio;1!==this.devicePixelRatio&&!1!==c&&(G.style.width=a+"px",G.style.height=b+"px");this.setViewport(0,0,G.width,G.height)};this.setViewport=function(a,b,c,d){cb=void 0!==a?a:0;db=void 0!==b?b:0;ob=void 0!==c?c:G.width;pb=void 0!==d?d:G.height;j.viewport(cb,db,ob,pb)};this.setScissor=
|
|
|
|
+function(a,b,c,d){j.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};this.setClearColor=function(a,b){M.set(a);R=void 0!==b?b:1;j.clearColor(M.r,M.g,M.b,R)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return M};this.getClearAlpha=function(){return R};this.clear=function(a,b,c){var d=0;if(void 0===a||
|
|
|
|
+a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){Ca=null;Ba=$=fa=Ga=ka=-1;ua=!0;U=Y=-1;this.shadowMapPlugin.update(a,b)};var Db=function(a){a=a.target;a.removeEventListener("dispose",
|
|
|
|
+Db);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&j.deleteBuffer(b[c].buffer);K.info.memory.geometries--}else if(void 0!==a.geometryGroups)for(b in a.geometryGroups){c=a.geometryGroups[b];if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)j.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(void 0!==c.numMorphNormals){d=0;for(e=c.numMorphNormals;d<e;d++)j.deleteBuffer(c.__webglMorphNormalsBuffers[d])}Ib(c)}else Ib(a)},
|
|
|
|
+Eb=function(a){a=a.target;a.removeEventListener("dispose",Eb);a.image&&a.image.__webglTextureCube?j.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,j.deleteTexture(a.__webglTexture));K.info.memory.textures--},Fb=function(a){a=a.target;a.removeEventListener("dispose",Fb);if(a&&a.__webglTexture)if(j.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)j.deleteFramebuffer(a.__webglFramebuffer[b]),j.deleteRenderbuffer(a.__webglRenderbuffer[b]);
|
|
|
|
+else j.deleteFramebuffer(a.__webglFramebuffer),j.deleteRenderbuffer(a.__webglRenderbuffer);K.info.memory.textures--},Gb=function(a){a=a.target;a.removeEventListener("dispose",Gb);Hb(a)},Ib=function(a){void 0!==a.__webglVertexBuffer&&j.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&j.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&j.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&j.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&
|
|
|
|
+j.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&j.deleteBuffer(a.__webglUV2Buffer);void 0!==a.__webglSkinIndicesBuffer&&j.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&j.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&j.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&j.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&j.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)j.deleteBuffer(a.__webglCustomAttributesList[b].buffer);
|
|
|
|
+K.info.memory.geometries--},Hb=function(a){var b=a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1,a=0;for(c=da.length;a<c;a++)if(d=da[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=da.length;a<c;a++)d=da[a],d.program!==b&&e.push(d);da=e;j.deleteProgram(b);K.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=j.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=
|
|
|
|
+j.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=j.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=j.createBuffer());a.hasPositions&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,a.positionArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.position),j.vertexAttribPointer(b.attributes.position,3,j.FLOAT,!1,0,0));if(a.hasNormals){j.bindBuffer(j.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,
|
|
|
|
+e,f,h,g,i,k,l,m,p,n,q=3*a.count;for(n=0;n<q;n+=9)p=a.normalArray,d=p[n],e=p[n+1],f=p[n+2],h=p[n+3],i=p[n+4],l=p[n+5],g=p[n+6],k=p[n+7],m=p[n+8],d=(d+h+g)/3,e=(e+i+k)/3,f=(f+l+m)/3,p[n]=d,p[n+1]=e,p[n+2]=f,p[n+3]=d,p[n+4]=e,p[n+5]=f,p[n+6]=d,p[n+7]=e,p[n+8]=f}j.bufferData(j.ARRAY_BUFFER,a.normalArray,j.DYNAMIC_DRAW);j.enableVertexAttribArray(b.attributes.normal);j.vertexAttribPointer(b.attributes.normal,3,j.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglUvBuffer),j.bufferData(j.ARRAY_BUFFER,
|
|
|
|
+a.uvArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.uv),j.vertexAttribPointer(b.attributes.uv,2,j.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,a.colorArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.color),j.vertexAttribPointer(b.attributes.color,3,j.FLOAT,!1,0,0));j.drawArrays(j.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var i,
|
|
|
|
+k,l,m;i=E(a,b,c,d,f);b=i.attributes;a=e.attributes;c=!1;i=16777215*e.id+2*i.id+(d.wireframe?1:0);i!==$&&($=i,c=!0);c&&g();if(f instanceof THREE.Mesh)if(f=a.index){e=e.offsets;1<e.length&&(c=!0);for(var p=0,n=e.length;p<n;p++){var q=e[p].index;if(c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,4*q*m)):d.defaultAttributeValues&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):
|
|
|
|
+3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,f.buffer)}j.drawElements(j.TRIANGLES,e[p].count,j.UNSIGNED_SHORT,2*e[p].start);K.info.render.calls++;K.info.render.vertices+=e[p].count;K.info.render.faces+=e[p].count/3}}else{if(c)for(k in b)"index"!==k&&(l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&
|
|
|
|
+(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k]))));d=e.attributes.position;j.drawArrays(j.TRIANGLES,0,d.numItems/3);K.info.render.calls++;K.info.render.vertices+=d.numItems/3;K.info.render.faces+=d.numItems/3/3}else if(f instanceof THREE.ParticleSystem){if(c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,
|
|
|
|
+m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));d=a.position;j.drawArrays(j.POINTS,0,d.numItems/3);K.info.render.calls++;K.info.render.points+=d.numItems/3}}else if(f instanceof THREE.Line&&c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,
|
|
|
|
+m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));k=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES;A(d.linewidth);d=a.position;j.drawArrays(k,0,d.numItems/3);K.info.render.calls++;K.info.render.points+=d.numItems}}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var i,l,c=E(a,b,c,d,f),
|
|
|
|
+a=c.attributes,b=!1,c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==$&&($=c,b=!0);b&&g();if(!d.morphTargets&&0<=a.position)b&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(a.position),j.vertexAttribPointer(a.position,3,j.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0)):0<=c.position&&(j.bindBuffer(j.ARRAY_BUFFER,
|
|
|
|
+e.__webglVertexBuffer),h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var m=0;l=f.morphTargetForcedOrder;for(i=f.morphTargetInfluences;m<d.numSupportedMorphTargets&&m<l.length;)0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l[m]]),h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l[m]]),
|
|
|
|
+h(c["morphNormal"+m]),j.vertexAttribPointer(c["morphNormal"+m],3,j.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[m]=i[l[m]],m++}else{l=[];i=f.morphTargetInfluences;var p,n=i.length;for(p=0;p<n;p++)m=i[p],0<m&&l.push([m,p]);l.length>d.numSupportedMorphTargets?(l.sort(k),l.length=d.numSupportedMorphTargets):l.length>d.numSupportedMorphNormals?l.sort(k):0===l.length&&l.push([0,0]);for(m=0;m<d.numSupportedMorphTargets;)l[m]?(p=l[m][1],0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[p]),
|
|
|
|
+h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[p]),h(c["morphNormal"+m]),j.vertexAttribPointer(c["morphNormal"+m],3,j.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[m]=i[p]):f.__webglMorphTargetInfluences[m]=0,m++}null!==d.program.uniforms.morphTargetInfluences&&j.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(b){if(e.__webglCustomAttributesList){i=
|
|
|
|
+0;for(l=e.__webglCustomAttributesList.length;i<l;i++)c=e.__webglCustomAttributesList[i],0<=a[c.buffer.belongsToAttribute]&&(j.bindBuffer(j.ARRAY_BUFFER,c.buffer),h(a[c.buffer.belongsToAttribute]),j.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,j.FLOAT,!1,0,0))}0<=a.color&&(0<f.geometry.colors.length||0<f.geometry.faces.length?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglColorBuffer),h(a.color),j.vertexAttribPointer(a.color,3,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&j.vertexAttrib3fv(a.color,
|
|
|
|
+d.defaultAttributeValues.color));0<=a.normal&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglNormalBuffer),h(a.normal),j.vertexAttribPointer(a.normal,3,j.FLOAT,!1,0,0));0<=a.tangent&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglTangentBuffer),h(a.tangent),j.vertexAttribPointer(a.tangent,4,j.FLOAT,!1,0,0));0<=a.uv&&(f.geometry.faceVertexUvs[0]?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUVBuffer),h(a.uv),j.vertexAttribPointer(a.uv,2,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&j.vertexAttrib2fv(a.uv,d.defaultAttributeValues.uv));
|
|
|
|
+0<=a.uv2&&(f.geometry.faceVertexUvs[1]?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUV2Buffer),h(a.uv2),j.vertexAttribPointer(a.uv2,2,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&j.vertexAttrib2fv(a.uv2,d.defaultAttributeValues.uv2));d.skinning&&(0<=a.skinIndex&&0<=a.skinWeight)&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),h(a.skinIndex),j.vertexAttribPointer(a.skinIndex,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),h(a.skinWeight),j.vertexAttribPointer(a.skinWeight,
|
|
|
|
+4,j.FLOAT,!1,0,0));0<=a.lineDistance&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglLineDistanceBuffer),h(a.lineDistance),j.vertexAttribPointer(a.lineDistance,1,j.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(d.wireframe?(A(d.wireframeLinewidth),b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),j.drawElements(j.LINES,e.__webglLineCount,j.UNSIGNED_SHORT,0)):(b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),j.drawElements(j.TRIANGLES,e.__webglFaceCount,j.UNSIGNED_SHORT,0)),K.info.render.calls++,
|
|
|
|
+K.info.render.vertices+=e.__webglFaceCount,K.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES,A(d.linewidth),j.drawArrays(f,0,e.__webglLineCount),K.info.render.calls++):f instanceof THREE.ParticleSystem&&(j.drawArrays(j.POINTS,0,e.__webglParticleCount),K.info.render.calls++,K.info.render.points+=e.__webglParticleCount)}};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,f,h,g,k=a.__lights,n=a.fog;Ba=-1;ua=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);ra.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);la.setFromMatrix(ra);this.autoUpdateObjects&&this.initWebGLObjects(a);m(this.renderPluginsPre,a,b);K.info.render.calls=0;K.info.render.vertices=0;K.info.render.faces=0;K.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,
|
|
|
|
+this.autoClearDepth,this.autoClearStencil);g=a.__webglObjects;d=0;for(e=g.length;d<e;d++)if(f=g[d],h=f.object,f.id=d,f.render=!1,h.visible&&(!(h instanceof THREE.Mesh||h instanceof THREE.ParticleSystem)||!h.frustumCulled||la.intersectsObject(h))){var q=h;q._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,q.matrixWorld);q._normalMatrix.getNormalMatrix(q._modelViewMatrix);var q=f,s=q.buffer,r=void 0,t=r=void 0,t=q.object.material;if(t instanceof THREE.MeshFaceMaterial)r=s.materialIndex,r=t.materials[r],
|
|
|
|
+r.transparent?(q.transparent=r,q.opaque=null):(q.opaque=r,q.transparent=null);else if(r=t)r.transparent?(q.transparent=r,q.opaque=null):(q.opaque=r,q.transparent=null);f.render=!0;!0===this.sortObjects&&(null!==h.renderDepth?f.z=h.renderDepth:(sa.getPositionFromMatrix(h.matrixWorld),sa.applyProjection(ra),f.z=sa.z))}this.sortObjects&&g.sort(i);g=a.__webglObjectsImmediate;d=0;for(e=g.length;d<e;d++)f=g[d],h=f.object,h.visible&&(h._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,h.matrixWorld),
|
|
|
|
+h._normalMatrix.getNormalMatrix(h._modelViewMatrix),h=f.object.material,h.transparent?(f.transparent=h,f.opaque=null):(f.opaque=h,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),z(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),l(a.__webglObjects,!1,"",b,k,n,!0,d),p(a.__webglObjectsImmediate,"",b,k,n,!1,d)):(d=null,this.setBlending(THREE.NoBlending),
|
|
|
|
+l(a.__webglObjects,!0,"opaque",b,k,n,!1,d),p(a.__webglObjectsImmediate,"opaque",b,k,n,!1,d),l(a.__webglObjects,!1,"transparent",b,k,n,!0,d),p(a.__webglObjectsImmediate,"transparent",b,k,n,!0,d));m(this.renderPluginsPost,a,b);c&&(c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter)&&(c instanceof THREE.WebGLRenderTargetCube?(j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture),j.generateMipmap(j.TEXTURE_CUBE_MAP),j.bindTexture(j.TEXTURE_CUBE_MAP,null)):(j.bindTexture(j.TEXTURE_2D,
|
|
|
|
+c.__webglTexture),j.generateMipmap(j.TEXTURE_2D),j.bindTexture(j.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=E(a,b,c,d,e);$=-1;K.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,j,la):e.render(function(a){K.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)r(a.__objectsAdded[0],
|
|
|
|
+a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)q(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,h=a.__webglObjects.length;b<h;b++){var g=a.__webglObjects[b].object;void 0===g.__webglInit&&(void 0!==g.__webglActive&&q(g,a),r(g,a));var i=g,l=i.geometry,m=void 0,p=void 0,t=void 0;if(l instanceof THREE.BufferGeometry){var u=j.DYNAMIC_DRAW,w=!l.dynamic,v=l.attributes,z=void 0,y=void 0;for(z in v)y=v[z],y.needsUpdate&&("index"===z?(j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,
|
|
|
|
+y.buffer),j.bufferData(j.ELEMENT_ARRAY_BUFFER,y.array,u)):(j.bindBuffer(j.ARRAY_BUFFER,y.buffer),j.bufferData(j.ARRAY_BUFFER,y.array,u)),y.needsUpdate=!1),w&&!y.dynamic&&(y.array=null)}else if(i instanceof THREE.Mesh){for(var E=0,A=l.geometryGroupsList.length;E<A;E++)if(m=l.geometryGroupsList[E],t=d(i,m),l.buffersNeedUpdate&&c(m,i),p=t.attributes&&n(t),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||
|
|
|
|
+p){var x=m,B=i,C=j.DYNAMIC_DRAW,F=!l.dynamic,G=t;if(x.__inittedArrays){var J=e(G),K=G.vertexColors?G.vertexColors:!1,N=f(G),O=J===THREE.SmoothShading,D=void 0,I=void 0,V=void 0,M=void 0,Q=void 0,U=void 0,ba=void 0,R=void 0,Y=void 0,Aa=void 0,$=void 0,P=void 0,X=void 0,W=void 0,Ca=void 0,ea=void 0,Ba=void 0,ca=void 0,da=void 0,ia=void 0,fa=void 0,ga=void 0,ka=void 0,la=void 0,oa=void 0,pa=void 0,ta=void 0,ua=void 0,va=void 0,Da=void 0,Ea=void 0,Ga=void 0,Fa=void 0,La=void 0,Ra=void 0,Ha=void 0,wa=
|
|
|
|
+void 0,xa=void 0,Pa=void 0,Qa=void 0,ab=0,bb=0,Na=0,Oa=0,Ta=0,gb=0,Sa=0,tb=0,Ya=0,qa=0,ya=0,L=0,Ma=void 0,hb=x.__vertexArray,cb=x.__uvArray,db=x.__uv2Array,vb=x.__normalArray,Ua=x.__tangentArray,ib=x.__colorArray,Va=x.__skinIndexArray,Wa=x.__skinWeightArray,ob=x.__morphTargetsArrays,pb=x.__morphNormalsArrays,qb=x.__webglCustomAttributesList,H=void 0,eb=x.__faceArray,wb=x.__lineArray,Ia=B.geometry,Cb=Ia.elementsNeedUpdate,zb=Ia.uvsNeedUpdate,Eb=Ia.normalsNeedUpdate,Nb=Ia.tangentsNeedUpdate,Ob=Ia.colorsNeedUpdate,
|
|
|
|
+Pb=Ia.morphTargetsNeedUpdate,ec=Ia.vertices,aa=x.faces3,jb=Ia.faces,Db=Ia.faceVertexUvs[0],Fb=Ia.faceVertexUvs[1],fc=Ia.skinIndices,Qb=Ia.skinWeights,Rb=Ia.morphTargets,Gb=Ia.morphNormals;if(Ia.verticesNeedUpdate){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],P=ec[M.a],X=ec[M.b],W=ec[M.c],hb[bb]=P.x,hb[bb+1]=P.y,hb[bb+2]=P.z,hb[bb+3]=X.x,hb[bb+4]=X.y,hb[bb+5]=X.z,hb[bb+6]=W.x,hb[bb+7]=W.y,hb[bb+8]=W.z,bb+=9;j.bindBuffer(j.ARRAY_BUFFER,x.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,hb,C)}if(Pb){Ra=0;
|
|
|
|
+for(Ha=Rb.length;Ra<Ha;Ra++){D=ya=0;for(I=aa.length;D<I;D++)Pa=aa[D],M=jb[Pa],P=Rb[Ra].vertices[M.a],X=Rb[Ra].vertices[M.b],W=Rb[Ra].vertices[M.c],wa=ob[Ra],wa[ya]=P.x,wa[ya+1]=P.y,wa[ya+2]=P.z,wa[ya+3]=X.x,wa[ya+4]=X.y,wa[ya+5]=X.z,wa[ya+6]=W.x,wa[ya+7]=W.y,wa[ya+8]=W.z,G.morphNormals&&(O?(Qa=Gb[Ra].vertexNormals[Pa],ca=Qa.a,da=Qa.b,ia=Qa.c):ia=da=ca=Gb[Ra].faceNormals[Pa],xa=pb[Ra],xa[ya]=ca.x,xa[ya+1]=ca.y,xa[ya+2]=ca.z,xa[ya+3]=da.x,xa[ya+4]=da.y,xa[ya+5]=da.z,xa[ya+6]=ia.x,xa[ya+7]=ia.y,xa[ya+
|
|
|
|
+8]=ia.z),ya+=9;j.bindBuffer(j.ARRAY_BUFFER,x.__webglMorphTargetsBuffers[Ra]);j.bufferData(j.ARRAY_BUFFER,ob[Ra],C);G.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglMorphNormalsBuffers[Ra]),j.bufferData(j.ARRAY_BUFFER,pb[Ra],C))}}if(Qb.length){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],la=Qb[M.a],oa=Qb[M.b],pa=Qb[M.c],Wa[qa]=la.x,Wa[qa+1]=la.y,Wa[qa+2]=la.z,Wa[qa+3]=la.w,Wa[qa+4]=oa.x,Wa[qa+5]=oa.y,Wa[qa+6]=oa.z,Wa[qa+7]=oa.w,Wa[qa+8]=pa.x,Wa[qa+9]=pa.y,Wa[qa+10]=pa.z,Wa[qa+11]=pa.w,ta=fc[M.a],ua=
|
|
|
|
+fc[M.b],va=fc[M.c],Va[qa]=ta.x,Va[qa+1]=ta.y,Va[qa+2]=ta.z,Va[qa+3]=ta.w,Va[qa+4]=ua.x,Va[qa+5]=ua.y,Va[qa+6]=ua.z,Va[qa+7]=ua.w,Va[qa+8]=va.x,Va[qa+9]=va.y,Va[qa+10]=va.z,Va[qa+11]=va.w,qa+=12;0<qa&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,Va,C),j.bindBuffer(j.ARRAY_BUFFER,x.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,Wa,C))}if(Ob&&K){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],ba=M.vertexColors,R=M.color,3===ba.length&&K===THREE.VertexColors?(fa=
|
|
|
|
+ba[0],ga=ba[1],ka=ba[2]):ka=ga=fa=R,ib[Ya]=fa.r,ib[Ya+1]=fa.g,ib[Ya+2]=fa.b,ib[Ya+3]=ga.r,ib[Ya+4]=ga.g,ib[Ya+5]=ga.b,ib[Ya+6]=ka.r,ib[Ya+7]=ka.g,ib[Ya+8]=ka.b,Ya+=9;0<Ya&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,ib,C))}if(Nb&&Ia.hasTangents){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],Y=M.vertexTangents,Ca=Y[0],ea=Y[1],Ba=Y[2],Ua[Sa]=Ca.x,Ua[Sa+1]=Ca.y,Ua[Sa+2]=Ca.z,Ua[Sa+3]=Ca.w,Ua[Sa+4]=ea.x,Ua[Sa+5]=ea.y,Ua[Sa+6]=ea.z,Ua[Sa+7]=ea.w,Ua[Sa+8]=Ba.x,Ua[Sa+9]=Ba.y,
|
|
|
|
+Ua[Sa+10]=Ba.z,Ua[Sa+11]=Ba.w,Sa+=12;j.bindBuffer(j.ARRAY_BUFFER,x.__webglTangentBuffer);j.bufferData(j.ARRAY_BUFFER,Ua,C)}if(Eb&&J){D=0;for(I=aa.length;D<I;D++)if(M=jb[aa[D]],Q=M.vertexNormals,U=M.normal,3===Q.length&&O)for(Da=0;3>Da;Da++)Ga=Q[Da],vb[gb]=Ga.x,vb[gb+1]=Ga.y,vb[gb+2]=Ga.z,gb+=3;else for(Da=0;3>Da;Da++)vb[gb]=U.x,vb[gb+1]=U.y,vb[gb+2]=U.z,gb+=3;j.bindBuffer(j.ARRAY_BUFFER,x.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,vb,C)}if(zb&&Db&&N){D=0;for(I=aa.length;D<I;D++)if(V=aa[D],Aa=
|
|
|
|
+Db[V],void 0!==Aa)for(Da=0;3>Da;Da++)Fa=Aa[Da],cb[Na]=Fa.x,cb[Na+1]=Fa.y,Na+=2;0<Na&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,cb,C))}if(zb&&Fb&&N){D=0;for(I=aa.length;D<I;D++)if(V=aa[D],$=Fb[V],void 0!==$)for(Da=0;3>Da;Da++)La=$[Da],db[Oa]=La.x,db[Oa+1]=La.y,Oa+=2;0<Oa&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,db,C))}if(Cb){D=0;for(I=aa.length;D<I;D++)eb[Ta]=ab,eb[Ta+1]=ab+1,eb[Ta+2]=ab+2,Ta+=3,wb[tb]=ab,wb[tb+1]=ab+1,wb[tb+2]=
|
|
|
|
+ab,wb[tb+3]=ab+2,wb[tb+4]=ab+1,wb[tb+5]=ab+2,tb+=6,ab+=3;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,x.__webglFaceBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,eb,C);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,x.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,wb,C)}if(qb){Da=0;for(Ea=qb.length;Da<Ea;Da++)if(H=qb[Da],H.__original.needsUpdate){L=0;if(1===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],H.array[L]=H.value[M.a],H.array[L+1]=H.value[M.b],H.array[L+2]=
|
|
|
|
+H.value[M.c],L+=3}else{if("faces"===H.boundTo){D=0;for(I=aa.length;D<I;D++)Ma=H.value[aa[D]],H.array[L]=Ma,H.array[L+1]=Ma,H.array[L+2]=Ma,L+=3}}else if(2===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}else{if("faces"===H.boundTo){D=0;for(I=aa.length;D<I;D++)W=X=P=Ma=H.value[aa[D]],H.array[L]=P.x,H.array[L+
|
|
|
|
+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}}else if(3===H.size){var na;na="c"===H.type?["r","g","b"]:["x","y","z"];if(void 0===H.boundTo||"vertices"===H.boundTo){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P[na[0]],H.array[L+1]=P[na[1]],H.array[L+2]=P[na[2]],H.array[L+3]=X[na[0]],H.array[L+4]=X[na[1]],H.array[L+5]=X[na[2]],H.array[L+6]=W[na[0]],H.array[L+7]=W[na[1]],H.array[L+8]=W[na[2]],L+=9}else if("faces"===
|
|
|
|
+H.boundTo){D=0;for(I=aa.length;D<I;D++)W=X=P=Ma=H.value[aa[D]],H.array[L]=P[na[0]],H.array[L+1]=P[na[1]],H.array[L+2]=P[na[2]],H.array[L+3]=X[na[0]],H.array[L+4]=X[na[1]],H.array[L+5]=X[na[2]],H.array[L+6]=W[na[0]],H.array[L+7]=W[na[1]],H.array[L+8]=W[na[2]],L+=9}else if("faceVertices"===H.boundTo){D=0;for(I=aa.length;D<I;D++)Ma=H.value[aa[D]],P=Ma[0],X=Ma[1],W=Ma[2],H.array[L]=P[na[0]],H.array[L+1]=P[na[1]],H.array[L+2]=P[na[2]],H.array[L+3]=X[na[0]],H.array[L+4]=X[na[1]],H.array[L+5]=X[na[2]],H.array[L+
|
|
|
|
+6]=W[na[0]],H.array[L+7]=W[na[1]],H.array[L+8]=W[na[2]],L+=9}}else if(4===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){D=0;for(I=aa.length;D<I;D++)M=jb[aa[D]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faces"===H.boundTo){D=0;for(I=aa.length;D<I;D++)W=X=P=Ma=H.value[aa[D]],
|
|
|
|
+H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faceVertices"===H.boundTo){D=0;for(I=aa.length;D<I;D++)Ma=H.value[aa[D]],P=Ma[0],X=Ma[1],W=Ma[2],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,
|
|
|
|
+H.array[L+11]=W.w,L+=12}j.bindBuffer(j.ARRAY_BUFFER,H.buffer);j.bufferData(j.ARRAY_BUFFER,H.array,C)}}F&&(delete x.__inittedArrays,delete x.__colorArray,delete x.__normalArray,delete x.__tangentArray,delete x.__uvArray,delete x.__uv2Array,delete x.__faceArray,delete x.__vertexArray,delete x.__lineArray,delete x.__skinIndexArray,delete x.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=
|
|
|
|
+!1;l.buffersNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.Line){t=d(i,l);p=t.attributes&&n(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||p){var Xa=l,Sb=j.DYNAMIC_DRAW,Jb=void 0,Kb=void 0,Lb=void 0,Tb=void 0,ma=void 0,Ub=void 0,Hb=Xa.vertices,Ib=Xa.colors,kc=Xa.lineDistances,Zb=Hb.length,$b=Ib.length,ac=kc.length,Vb=Xa.__vertexArray,Wb=Xa.__colorArray,lc=Xa.__lineDistanceArray,bc=Xa.colorsNeedUpdate,cc=Xa.lineDistancesNeedUpdate,gc=Xa.__webglCustomAttributesList,
|
|
|
|
+Xb=void 0,mc=void 0,za=void 0,Ab=void 0,Ja=void 0,ja=void 0;if(Xa.verticesNeedUpdate){for(Jb=0;Jb<Zb;Jb++)Tb=Hb[Jb],ma=3*Jb,Vb[ma]=Tb.x,Vb[ma+1]=Tb.y,Vb[ma+2]=Tb.z;j.bindBuffer(j.ARRAY_BUFFER,Xa.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Vb,Sb)}if(bc){for(Kb=0;Kb<$b;Kb++)Ub=Ib[Kb],ma=3*Kb,Wb[ma]=Ub.r,Wb[ma+1]=Ub.g,Wb[ma+2]=Ub.b;j.bindBuffer(j.ARRAY_BUFFER,Xa.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Wb,Sb)}if(cc){for(Lb=0;Lb<ac;Lb++)lc[Lb]=kc[Lb];j.bindBuffer(j.ARRAY_BUFFER,Xa.__webglLineDistanceBuffer);
|
|
|
|
+j.bufferData(j.ARRAY_BUFFER,lc,Sb)}if(gc){Xb=0;for(mc=gc.length;Xb<mc;Xb++)if(ja=gc[Xb],ja.needsUpdate&&(void 0===ja.boundTo||"vertices"===ja.boundTo)){ma=0;Ab=ja.value.length;if(1===ja.size)for(za=0;za<Ab;za++)ja.array[za]=ja.value[za];else if(2===ja.size)for(za=0;za<Ab;za++)Ja=ja.value[za],ja.array[ma]=Ja.x,ja.array[ma+1]=Ja.y,ma+=2;else if(3===ja.size)if("c"===ja.type)for(za=0;za<Ab;za++)Ja=ja.value[za],ja.array[ma]=Ja.r,ja.array[ma+1]=Ja.g,ja.array[ma+2]=Ja.b,ma+=3;else for(za=0;za<Ab;za++)Ja=
|
|
|
|
+ja.value[za],ja.array[ma]=Ja.x,ja.array[ma+1]=Ja.y,ja.array[ma+2]=Ja.z,ma+=3;else if(4===ja.size)for(za=0;za<Ab;za++)Ja=ja.value[za],ja.array[ma]=Ja.x,ja.array[ma+1]=Ja.y,ja.array[ma+2]=Ja.z,ja.array[ma+3]=Ja.w,ma+=4;j.bindBuffer(j.ARRAY_BUFFER,ja.buffer);j.bufferData(j.ARRAY_BUFFER,ja.array,Sb)}}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.ParticleSystem){t=d(i,l);p=t.attributes&&n(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||
|
|
|
|
+i.sortParticles||p){var kb=l,hc=j.DYNAMIC_DRAW,Mb=i,Ka=void 0,lb=void 0,mb=void 0,T=void 0,nb=void 0,ub=void 0,Yb=kb.vertices,ic=Yb.length,jc=kb.colors,nc=jc.length,xb=kb.__vertexArray,yb=kb.__colorArray,rb=kb.__sortArray,oc=kb.verticesNeedUpdate,pc=kb.colorsNeedUpdate,sb=kb.__webglCustomAttributesList,Za=void 0,Bb=void 0,Z=void 0,$a=void 0,ha=void 0,S=void 0;if(Mb.sortParticles){fb.copy(ra);fb.multiply(Mb.matrixWorld);for(Ka=0;Ka<ic;Ka++)mb=Yb[Ka],sa.copy(mb),sa.applyProjection(fb),rb[Ka]=[sa.z,
|
|
|
|
+Ka];rb.sort(k);for(Ka=0;Ka<ic;Ka++)mb=Yb[rb[Ka][1]],T=3*Ka,xb[T]=mb.x,xb[T+1]=mb.y,xb[T+2]=mb.z;for(lb=0;lb<nc;lb++)T=3*lb,ub=jc[rb[lb][1]],yb[T]=ub.r,yb[T+1]=ub.g,yb[T+2]=ub.b;if(sb){Za=0;for(Bb=sb.length;Za<Bb;Za++)if(S=sb[Za],void 0===S.boundTo||"vertices"===S.boundTo)if(T=0,$a=S.value.length,1===S.size)for(Z=0;Z<$a;Z++)nb=rb[Z][1],S.array[Z]=S.value[nb];else if(2===S.size)for(Z=0;Z<$a;Z++)nb=rb[Z][1],ha=S.value[nb],S.array[T]=ha.x,S.array[T+1]=ha.y,T+=2;else if(3===S.size)if("c"===S.type)for(Z=
|
|
|
|
+0;Z<$a;Z++)nb=rb[Z][1],ha=S.value[nb],S.array[T]=ha.r,S.array[T+1]=ha.g,S.array[T+2]=ha.b,T+=3;else for(Z=0;Z<$a;Z++)nb=rb[Z][1],ha=S.value[nb],S.array[T]=ha.x,S.array[T+1]=ha.y,S.array[T+2]=ha.z,T+=3;else if(4===S.size)for(Z=0;Z<$a;Z++)nb=rb[Z][1],ha=S.value[nb],S.array[T]=ha.x,S.array[T+1]=ha.y,S.array[T+2]=ha.z,S.array[T+3]=ha.w,T+=4}}else{if(oc)for(Ka=0;Ka<ic;Ka++)mb=Yb[Ka],T=3*Ka,xb[T]=mb.x,xb[T+1]=mb.y,xb[T+2]=mb.z;if(pc)for(lb=0;lb<nc;lb++)ub=jc[lb],T=3*lb,yb[T]=ub.r,yb[T+1]=ub.g,yb[T+2]=ub.b;
|
|
|
|
+if(sb){Za=0;for(Bb=sb.length;Za<Bb;Za++)if(S=sb[Za],S.needsUpdate&&(void 0===S.boundTo||"vertices"===S.boundTo))if($a=S.value.length,T=0,1===S.size)for(Z=0;Z<$a;Z++)S.array[Z]=S.value[Z];else if(2===S.size)for(Z=0;Z<$a;Z++)ha=S.value[Z],S.array[T]=ha.x,S.array[T+1]=ha.y,T+=2;else if(3===S.size)if("c"===S.type)for(Z=0;Z<$a;Z++)ha=S.value[Z],S.array[T]=ha.r,S.array[T+1]=ha.g,S.array[T+2]=ha.b,T+=3;else for(Z=0;Z<$a;Z++)ha=S.value[Z],S.array[T]=ha.x,S.array[T+1]=ha.y,S.array[T+2]=ha.z,T+=3;else if(4===
|
|
|
|
+S.size)for(Z=0;Z<$a;Z++)ha=S.value[Z],S.array[T]=ha.x,S.array[T+1]=ha.y,S.array[T+2]=ha.z,S.array[T+3]=ha.w,T+=4}}if(oc||Mb.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,kb.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,xb,hc);if(pc||Mb.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,kb.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,yb,hc);if(sb){Za=0;for(Bb=sb.length;Za<Bb;Za++)if(S=sb[Za],S.needsUpdate||Mb.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,S.buffer),j.bufferData(j.ARRAY_BUFFER,S.array,hc)}}l.verticesNeedUpdate=
|
|
|
|
+!1;l.colorsNeedUpdate=!1;t.attributes&&s(t)}}};this.initMaterial=function(a,b,c,d){var e,f,h,g;a.addEventListener("dispose",Gb);var i,k,l,m,p;a instanceof THREE.MeshDepthMaterial?p="depth":a instanceof THREE.MeshNormalMaterial?p="normal":a instanceof THREE.MeshBasicMaterial?p="basic":a instanceof THREE.MeshLambertMaterial?p="lambert":a instanceof THREE.MeshPhongMaterial?p="phong":a instanceof THREE.LineBasicMaterial?p="basic":a instanceof THREE.LineDashedMaterial?p="dashed":a instanceof THREE.ParticleBasicMaterial&&
|
|
|
|
+(p="particle_basic");if(p){var n=THREE.ShaderLib[p];a.uniforms=THREE.UniformsUtils.clone(n.uniforms);a.vertexShader=n.vertexShader;a.fragmentShader=n.fragmentShader}var q=e=0,s=0,t=n=0;for(f=b.length;t<f;t++)h=b[t],h.onlyShadow||(h instanceof THREE.DirectionalLight&&e++,h instanceof THREE.PointLight&&q++,h instanceof THREE.SpotLight&&s++,h instanceof THREE.HemisphereLight&&n++);f=q;h=s;g=n;s=n=0;for(q=b.length;s<q;s++)t=b[s],t.castShadow&&(t instanceof THREE.SpotLight&&n++,t instanceof THREE.DirectionalLight&&
|
|
|
|
+!t.shadowCascade&&n++);m=n;zb&&d&&d.useVertexTexture?l=1024:(b=j.getParameter(j.MAX_VERTEX_UNIFORM_VECTORS),b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(b=Math.min(d.bones.length,b),b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+d.bones.length+", this GPU supports just "+b+" (try OpenGL instead of ANGLE)")),l=b);a:{var s=a.fragmentShader,q=a.vertexShader,n=a.uniforms,b=a.attributes,t=a.defines,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,
|
|
|
|
+normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,maxBones:l,useVertexTexture:zb&&d&&d.useVertexTexture,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLights:h,maxHemiLights:g,maxShadows:m,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,
|
|
|
|
+shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide},d=a.index0AttributeName,r,u,w;e=[];p?e.push(p):(e.push(s),e.push(q));for(u in t)e.push(u),e.push(t[u]);for(r in c)e.push(r),e.push(c[r]);p=e.join();r=0;for(u=da.length;r<u;r++)if(e=da[r],e.code===p){e.usedTimes++;k=e.program;break a}r="SHADOWMAP_TYPE_BASIC";
|
|
|
|
+c.shadowMapType===THREE.PCFShadowMap?r="SHADOWMAP_TYPE_PCF":c.shadowMapType===THREE.PCFSoftShadowMap&&(r="SHADOWMAP_TYPE_PCF_SOFT");u=[];for(w in t)e=t[w],!1!==e&&(e="#define "+w+" "+e,u.push(e));e=u.join("\n");w=j.createProgram();u=["precision "+Q+" float;","precision "+Q+" int;",e,Cb?"#define VERTEX_TEXTURES":"",K.gammaInput?"#define GAMMA_INPUT":"",K.gammaOutput?"#define GAMMA_OUTPUT":"",K.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+
|
|
|
|
+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":
|
|
|
|
+"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+r:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
|
|
|
|
+r=["precision "+Q+" float;","precision "+Q+" int;",c.bumpMap||c.normalMap?"#extension GL_OES_standard_derivatives : enable":"",e,"#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",K.gammaInput?"#define GAMMA_INPUT":"",K.gammaOutput?"#define GAMMA_OUTPUT":"",K.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":
|
|
"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":
|
|
"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":
|
|
"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+r:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");u=B("vertex",u+q);r=B("fragment",r+s);j.attachShader(w,u);j.attachShader(w,r);d&&j.bindAttribLocation(w,0,d);j.linkProgram(w);j.getProgramParameter(w,j.LINK_STATUS)||(console.error("Could not initialise shader\nVALIDATE_STATUS: "+j.getProgramParameter(w,
|
|
"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+r:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");u=B("vertex",u+q);r=B("fragment",r+s);j.attachShader(w,u);j.attachShader(w,r);d&&j.bindAttribLocation(w,0,d);j.linkProgram(w);j.getProgramParameter(w,j.LINK_STATUS)||(console.error("Could not initialise shader\nVALIDATE_STATUS: "+j.getProgramParameter(w,
|
|
j.VALIDATE_STATUS)+", gl error ["+j.getError()+"]"),console.error("Program Info Log: "+j.getProgramInfoLog(w)));j.deleteShader(r);j.deleteShader(u);w.uniforms={};w.attributes={};var v;r="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?(r.push("boneTexture"),r.push("boneTextureWidth"),r.push("boneTextureHeight")):r.push("boneGlobalMatrices");for(v in n)r.push(v);v=r;r=0;for(u=v.length;r<u;r++)n=v[r],w.uniforms[n]=
|
|
j.VALIDATE_STATUS)+", gl error ["+j.getError()+"]"),console.error("Program Info Log: "+j.getProgramInfoLog(w)));j.deleteShader(r);j.deleteShader(u);w.uniforms={};w.attributes={};var v;r="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?(r.push("boneTexture"),r.push("boneTextureWidth"),r.push("boneTextureHeight")):r.push("boneGlobalMatrices");for(v in n)r.push(v);v=r;r=0;for(u=v.length;r<u;r++)n=v[r],w.uniforms[n]=
|
|
j.getUniformLocation(w,n);r="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(v=0;v<c.maxMorphTargets;v++)r.push("morphTarget"+v);for(v=0;v<c.maxMorphNormals;v++)r.push("morphNormal"+v);for(k in b)r.push(k);k=r;v=0;for(b=k.length;v<b;v++)r=k[v],w.attributes[r]=j.getAttribLocation(w,r);w.id=Aa++;da.push({program:w,code:p,usedTimes:1});K.info.memory.programs=da.length;k=w}a.program=k;v=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";
|
|
j.getUniformLocation(w,n);r="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(v=0;v<c.maxMorphTargets;v++)r.push("morphTarget"+v);for(v=0;v<c.maxMorphNormals;v++)r.push("morphNormal"+v);for(k in b)r.push(k);k=r;v=0;for(b=k.length;v<b;v++)r=k[v],w.attributes[r]=j.getAttribLocation(w,r);w.id=Aa++;da.push({program:w,code:p,usedTimes:1});K.info.memory.programs=da.length;k=w}a.program=k;v=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";
|
|
for(k=0;k<this.maxMorphTargets;k++)w=b+k,0<=v[w]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=0;b="morphNormal";for(k=0;k<this.maxMorphNormals;k++)w=b+k,0<=v[w]&&a.numSupportedMorphNormals++}a.uniformsList=[];for(i in a.uniforms)a.uniformsList.push([a.uniforms[i],i])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?j.disable(j.CULL_FACE):(b===THREE.FrontFaceDirectionCW?j.frontFace(j.CW):j.frontFace(j.CCW),a===THREE.CullFaceBack?j.cullFace(j.BACK):a===THREE.CullFaceFront?
|
|
for(k=0;k<this.maxMorphTargets;k++)w=b+k,0<=v[w]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=0;b="morphNormal";for(k=0;k<this.maxMorphNormals;k++)w=b+k,0<=v[w]&&a.numSupportedMorphNormals++}a.uniformsList=[];for(i in a.uniforms)a.uniformsList.push([a.uniforms[i],i])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?j.disable(j.CULL_FACE):(b===THREE.FrontFaceDirectionCW?j.frontFace(j.CW):j.frontFace(j.CCW),a===THREE.CullFaceBack?j.cullFace(j.BACK):a===THREE.CullFaceFront?
|
|
-j.cullFace(j.FRONT):j.cullFace(j.FRONT_AND_BACK),j.enable(j.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide,a=a.side===THREE.BackSide;Y!==b&&(b?j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),Y=b);T!==a&&(a?j.frontFace(j.CW):j.frontFace(j.CCW),T=a)};this.setDepthTest=function(a){Ga!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),Ga=a)};this.setDepthWrite=function(a){fa!==a&&(j.depthMask(a),fa=a)};this.setBlending=function(a,b,c,d){a!==ka&&(a===THREE.NoBlending?j.disable(j.BLEND):
|
|
|
|
|
|
+j.cullFace(j.FRONT):j.cullFace(j.FRONT_AND_BACK),j.enable(j.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide,a=a.side===THREE.BackSide;Y!==b&&(b?j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),Y=b);U!==a&&(a?j.frontFace(j.CW):j.frontFace(j.CCW),U=a)};this.setDepthTest=function(a){Ga!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),Ga=a)};this.setDepthWrite=function(a){fa!==a&&(j.depthMask(a),fa=a)};this.setBlending=function(a,b,c,d){a!==ka&&(a===THREE.NoBlending?j.disable(j.BLEND):
|
|
a===THREE.AdditiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.SRC_ALPHA,j.ONE)):a===THREE.SubtractiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.SRC_COLOR)):a===THREE.CustomBlending?j.enable(j.BLEND):(j.enable(j.BLEND),j.blendEquationSeparate(j.FUNC_ADD,j.FUNC_ADD),j.blendFuncSeparate(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA,j.ONE,
|
|
a===THREE.AdditiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.SRC_ALPHA,j.ONE)):a===THREE.SubtractiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.SRC_COLOR)):a===THREE.CustomBlending?j.enable(j.BLEND):(j.enable(j.BLEND),j.blendEquationSeparate(j.FUNC_ADD,j.FUNC_ADD),j.blendFuncSeparate(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA,j.ONE,
|
|
j.ONE_MINUS_SRC_ALPHA)),ka=a);if(a===THREE.CustomBlending){if(b!==ta&&(j.blendEquation(x(b)),ta=b),c!==ia||d!==La)j.blendFunc(x(c),x(d)),ia=c,La=d}else La=ia=ta=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",Eb),a.__webglTexture=j.createTexture(),K.info.memory.textures++);j.activeTexture(j.TEXTURE0+b);j.bindTexture(j.TEXTURE_2D,a.__webglTexture);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,a.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
|
|
j.ONE_MINUS_SRC_ALPHA)),ka=a);if(a===THREE.CustomBlending){if(b!==ta&&(j.blendEquation(x(b)),ta=b),c!==ia||d!==La)j.blendFunc(x(c),x(d)),ia=c,La=d}else La=ia=ta=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",Eb),a.__webglTexture=j.createTexture(),K.info.memory.textures++);j.activeTexture(j.TEXTURE0+b);j.bindTexture(j.TEXTURE_2D,a.__webglTexture);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,a.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
|
|
a.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=0===(c.width&c.width-1)&&0===(c.height&c.height-1),e=x(a.format),f=x(a.type);D(j.TEXTURE_2D,a,d);var h=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<h.length&&d){for(var g=0,i=h.length;g<i;g++)c=h[g],j.texImage2D(j.TEXTURE_2D,g,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else j.texImage2D(j.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture){g=0;for(i=h.length;g<
|
|
a.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=0===(c.width&c.width-1)&&0===(c.height&c.height-1),e=x(a.format),f=x(a.type);D(j.TEXTURE_2D,a,d);var h=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<h.length&&d){for(var g=0,i=h.length;g<i;g++)c=h[g],j.texImage2D(j.TEXTURE_2D,g,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else j.texImage2D(j.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture){g=0;for(i=h.length;g<
|
|
@@ -610,9 +610,9 @@ h.copy(b).add(f);i.copy(c).add(g);f=d.dot(g);g=i.sub(h).dot(g);0===f&&(console.l
|
|
g=0;g<h;g++){var i=ca*g,k=ca*(g+1),l=d+e+i,i=d+f+i,p=d+f+k,k=d+e+k,n=c,q=g,s=h,t=e,v=f,l=l+D,i=i+D,p=p+D,k=k+D;B.faces.push(new THREE.Face3(l,i,k,null,null,u));B.faces.push(new THREE.Face3(i,p,k,null,null,u));l=w.generateSideWallUV(B,a,n,b,l,i,p,k,q,s,t,v);B.faceVertexUvs[0].push([l[0],l[1],l[3]]);B.faceVertexUvs[0].push([l[1],l[2],l[3]])}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=D;d+=D;e+=D;B.faces.push(new THREE.Face3(c,d,e,null,null,q));c=f?w.generateBottomUV(B,
|
|
g=0;g<h;g++){var i=ca*g,k=ca*(g+1),l=d+e+i,i=d+f+i,p=d+f+k,k=d+e+k,n=c,q=g,s=h,t=e,v=f,l=l+D,i=i+D,p=p+D,k=k+D;B.faces.push(new THREE.Face3(l,i,k,null,null,u));B.faces.push(new THREE.Face3(i,p,k,null,null,u));l=w.generateSideWallUV(B,a,n,b,l,i,p,k,q,s,t,v);B.faceVertexUvs[0].push([l[0],l[1],l[3]]);B.faceVertexUvs[0].push([l[1],l[2],l[3]])}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=D;d+=D;e+=D;B.faces.push(new THREE.Face3(c,d,e,null,null,q));c=f?w.generateBottomUV(B,
|
|
a,b,c,d,e):w.generateTopUV(B,a,b,c,d,e);B.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,l=void 0!==b.bevelEnabled?b.bevelEnabled:!0,p=void 0!==b.curveSegments?b.curveSegments:12,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,n,s=!1,q=b.material,u=b.extrudeMaterial,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,E,C,F,y;t&&(n=
|
|
a,b,c,d,e):w.generateTopUV(B,a,b,c,d,e);B.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,l=void 0!==b.bevelEnabled?b.bevelEnabled:!0,p=void 0!==b.curveSegments?b.curveSegments:12,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,n,s=!1,q=b.material,u=b.extrudeMaterial,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,E,C,F,y;t&&(n=
|
|
t.getSpacedPoints(r),s=!0,l=!1,E=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,!1),C=new THREE.Vector3,F=new THREE.Vector3,y=new THREE.Vector3);l||(k=i=m=0);var A,z,O,B=this,D=this.vertices.length,p=a.extractPoints(p),I=p.shape,p=p.holes;if(t=!THREE.Shape.Utils.isClockWise(I)){I=I.reverse();z=0;for(O=p.length;z<O;z++)A=p[z],THREE.Shape.Utils.isClockWise(A)&&(p[z]=A.reverse());t=!1}var v=THREE.Shape.Utils.triangulateShape(I,p),t=I;z=0;for(O=p.length;z<O;z++)A=p[z],I=I.concat(A);
|
|
t.getSpacedPoints(r),s=!0,l=!1,E=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,!1),C=new THREE.Vector3,F=new THREE.Vector3,y=new THREE.Vector3);l||(k=i=m=0);var A,z,O,B=this,D=this.vertices.length,p=a.extractPoints(p),I=p.shape,p=p.holes;if(t=!THREE.Shape.Utils.isClockWise(I)){I=I.reverse();z=0;for(O=p.length;z<O;z++)A=p[z],THREE.Shape.Utils.isClockWise(A)&&(p[z]=A.reverse());t=!1}var v=THREE.Shape.Utils.triangulateShape(I,p),t=I;z=0;for(O=p.length;z<O;z++)A=p[z],I=I.concat(A);
|
|
-var x,G,R,J,ca=I.length,oa=v.length,pa=[],N=0,M=t.length;x=M-1;for(G=N+1;N<M;N++,x++,G++)x===M&&(x=0),G===M&&(G=0),pa[N]=d(t[N],t[x],t[G]);var Q=[],K,da=pa.concat();z=0;for(O=p.length;z<O;z++){A=p[z];K=[];N=0;M=A.length;x=M-1;for(G=N+1;N<M;N++,x++,G++)x===M&&(x=0),G===M&&(G=0),K[N]=d(A[N],A[x],A[G]);Q.push(K);da=da.concat(K)}for(x=0;x<m;x++){A=x/m;R=i*(1-A);G=k*Math.sin(A*Math.PI/2);N=0;for(M=t.length;N<M;N++)J=c(t[N],pa[N],G),f(J.x,J.y,-R);z=0;for(O=p.length;z<O;z++){A=p[z];K=Q[z];N=0;for(M=A.length;N<
|
|
|
|
-M;N++)J=c(A[N],K[N],G),f(J.x,J.y,-R)}}G=k;for(N=0;N<ca;N++)J=l?c(I[N],da[N],G):I[N],s?(F.copy(E.normals[0]).multiplyScalar(J.x),C.copy(E.binormals[0]).multiplyScalar(J.y),y.copy(n[0]).add(F).add(C),f(y.x,y.y,y.z)):f(J.x,J.y,0);for(A=1;A<=r;A++)for(N=0;N<ca;N++)J=l?c(I[N],da[N],G):I[N],s?(F.copy(E.normals[A]).multiplyScalar(J.x),C.copy(E.binormals[A]).multiplyScalar(J.y),y.copy(n[A]).add(F).add(C),f(y.x,y.y,y.z)):f(J.x,J.y,g/r*A);for(x=m-1;0<=x;x--){A=x/m;R=i*(1-A);G=k*Math.sin(A*Math.PI/2);N=0;for(M=
|
|
|
|
-t.length;N<M;N++)J=c(t[N],pa[N],G),f(J.x,J.y,g+R);z=0;for(O=p.length;z<O;z++){A=p[z];K=Q[z];N=0;for(M=A.length;N<M;N++)J=c(A[N],K[N],G),s?f(J.x,J.y+n[r-1].y,n[r-1].x+R):f(J.x,J.y,g+R)}}if(l){i=0*ca;for(N=0;N<oa;N++)g=v[N],h(g[2]+i,g[1]+i,g[0]+i,!0);i=ca*(r+2*m);for(N=0;N<oa;N++)g=v[N],h(g[0]+i,g[1]+i,g[2]+i,!1)}else{for(N=0;N<oa;N++)g=v[N],h(g[2],g[1],g[0],!0);for(N=0;N<oa;N++)g=v[N],h(g[0]+ca*r,g[1]+ca*r,g[2]+ca*r,!1)}g=0;e(t,g);g+=t.length;z=0;for(O=p.length;z<O;z++)A=p[z],e(A,g),g+=A.length};
|
|
|
|
|
|
+var x,G,Q,J,ca=I.length,oa=v.length,pa=[],N=0,M=t.length;x=M-1;for(G=N+1;N<M;N++,x++,G++)x===M&&(x=0),G===M&&(G=0),pa[N]=d(t[N],t[x],t[G]);var R=[],K,da=pa.concat();z=0;for(O=p.length;z<O;z++){A=p[z];K=[];N=0;M=A.length;x=M-1;for(G=N+1;N<M;N++,x++,G++)x===M&&(x=0),G===M&&(G=0),K[N]=d(A[N],A[x],A[G]);R.push(K);da=da.concat(K)}for(x=0;x<m;x++){A=x/m;Q=i*(1-A);G=k*Math.sin(A*Math.PI/2);N=0;for(M=t.length;N<M;N++)J=c(t[N],pa[N],G),f(J.x,J.y,-Q);z=0;for(O=p.length;z<O;z++){A=p[z];K=R[z];N=0;for(M=A.length;N<
|
|
|
|
+M;N++)J=c(A[N],K[N],G),f(J.x,J.y,-Q)}}G=k;for(N=0;N<ca;N++)J=l?c(I[N],da[N],G):I[N],s?(F.copy(E.normals[0]).multiplyScalar(J.x),C.copy(E.binormals[0]).multiplyScalar(J.y),y.copy(n[0]).add(F).add(C),f(y.x,y.y,y.z)):f(J.x,J.y,0);for(A=1;A<=r;A++)for(N=0;N<ca;N++)J=l?c(I[N],da[N],G):I[N],s?(F.copy(E.normals[A]).multiplyScalar(J.x),C.copy(E.binormals[A]).multiplyScalar(J.y),y.copy(n[A]).add(F).add(C),f(y.x,y.y,y.z)):f(J.x,J.y,g/r*A);for(x=m-1;0<=x;x--){A=x/m;Q=i*(1-A);G=k*Math.sin(A*Math.PI/2);N=0;for(M=
|
|
|
|
+t.length;N<M;N++)J=c(t[N],pa[N],G),f(J.x,J.y,g+Q);z=0;for(O=p.length;z<O;z++){A=p[z];K=R[z];N=0;for(M=A.length;N<M;N++)J=c(A[N],K[N],G),s?f(J.x,J.y+n[r-1].y,n[r-1].x+Q):f(J.x,J.y,g+Q)}}if(l){i=0*ca;for(N=0;N<oa;N++)g=v[N],h(g[2]+i,g[1]+i,g[0]+i,!0);i=ca*(r+2*m);for(N=0;N<oa;N++)g=v[N],h(g[0]+i,g[1]+i,g[2]+i,!1)}else{for(N=0;N<oa;N++)g=v[N],h(g[2],g[1],g[0],!0);for(N=0;N<oa;N++)g=v[N],h(g[0]+ca*r,g[1]+ca*r,g[2]+ca*r,!1)}g=0;e(t,g);g+=t.length;z=0;for(O=p.length;z<O;z++)A=p[z],e(A,g),g+=A.length};
|
|
THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,h,g){var b=a.vertices[e].x,c=a.vertices[e].y,e=a.vertices[e].z,d=a.vertices[f].x,i=a.vertices[f].y,f=a.vertices[f].z,k=a.vertices[h].x,
|
|
THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,h,g){var b=a.vertices[e].x,c=a.vertices[e].y,e=a.vertices[e].z,d=a.vertices[f].x,i=a.vertices[f].y,f=a.vertices[f].z,k=a.vertices[h].x,
|
|
m=a.vertices[h].y,h=a.vertices[h].z,l=a.vertices[g].x,p=a.vertices[g].y,a=a.vertices[g].z;return 0.01>Math.abs(c-i)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(k,1-h),new THREE.Vector2(l,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(i,1-f),new THREE.Vector2(m,1-h),new THREE.Vector2(p,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;
|
|
m=a.vertices[h].y,h=a.vertices[h].z,l=a.vertices[g].x,p=a.vertices[g].y,a=a.vertices[g].z;return 0.01>Math.abs(c-i)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(k,1-h),new THREE.Vector2(l,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(i,1-f),new THREE.Vector2(m,1-h),new THREE.Vector2(p,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;
|
|
THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();this.addShapeList(a,b);this.computeCentroids();this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);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.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();this.addShapeList(a,b);this.computeCentroids();this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
|