|
@@ -2,7 +2,7 @@
|
|
'use strict';var THREE=THREE||{REVISION:"49dev"};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;
|
|
'use strict';var THREE=THREE||{REVISION:"49dev"};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;
|
|
(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];if(!window.requestAnimationFrame)window.requestAnimationFrame=function(b){var c=(new Date).getTime(),f=Math.max(0,16-(c-a)),g=window.setTimeout(function(){b(c+f)},f);a=c+f;return g};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
|
|
(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];if(!window.requestAnimationFrame)window.requestAnimationFrame=function(b){var c=(new Date).getTime(),f=Math.max(0,16-(c-a)),g=window.setTimeout(function(){b(c+f)},f);a=c+f;return g};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
|
|
function(a){clearTimeout(a)}})();THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1};THREE.Clock.prototype.start=function(){this.oldTime=this.startTime=Date.now();this.running=!0};THREE.Clock.prototype.stop=function(){this.getElapsedTime();this.running=!1};THREE.Clock.prototype.getElapsedTime=function(){return this.elapsedTime+=this.getDelta()};
|
|
function(a){clearTimeout(a)}})();THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1};THREE.Clock.prototype.start=function(){this.oldTime=this.startTime=Date.now();this.running=!0};THREE.Clock.prototype.stop=function(){this.getElapsedTime();this.running=!1};THREE.Clock.prototype.getElapsedTime=function(){return this.elapsedTime+=this.getDelta()};
|
|
-THREE.Clock.prototype.getDelta=function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=Date.now(),a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a};THREE.Color=function(a){void 0!==a&&this.setHex(a);return this};
|
|
|
|
|
|
+THREE.Clock.prototype.getDelta=function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=Date.now(),a=0.0010*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a};THREE.Color=function(a){void 0!==a&&this.setHex(a);return this};
|
|
THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);
|
|
THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);
|
|
this.b=Math.sqrt(this.b);return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,f;if(0===c)this.r=this.g=this.b=0;else switch(d=Math.floor(6*a),e=6*a-d,a=c*(1-b),f=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=f;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=f;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=c;this.g=a;this.b=f;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=
|
|
this.b=Math.sqrt(this.b);return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,f;if(0===c)this.r=this.g=this.b=0;else switch(d=Math.floor(6*a),e=6*a-d,a=c*(1-b),f=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=f;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=f;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=c;this.g=a;this.b=f;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=
|
|
Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},lerpSelf:function(a,b){this.r+=(a.r-this.r)*b;this.g+=(a.g-this.g)*b;this.b+=(a.b-this.b)*b;return this},getHex:function(){return Math.floor(255*this.r)<<16^Math.floor(255*this.g)<<8^Math.floor(255*this.b)},getContextStyle:function(){return"rgb("+Math.floor(255*this.r)+","+Math.floor(255*this.g)+","+Math.floor(255*this.b)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
|
|
Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},lerpSelf:function(a,b){this.r+=(a.r-this.r)*b;this.g+=(a.g-this.g)*b;this.b+=(a.b-this.b)*b;return this},getHex:function(){return Math.floor(255*this.r)<<16^Math.floor(255*this.g)<<8^Math.floor(255*this.b)},getContextStyle:function(){return"rgb("+Math.floor(255*this.r)+","+Math.floor(255*this.g)+","+Math.floor(255*this.b)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
|
|
@@ -73,15 +73,15 @@ h.positionScreen.copy(h.positionWorld),C.multiplyVector4(h.positionScreen),h.pos
|
|
R.doubleSided||i!=R.flipSided)ia=m[p]=m[p]||new THREE.RenderableFace3,p++,k=ia,k.v1.copy(E),k.v2.copy(aa),k.v3.copy(ea);else continue;else continue;else if(A instanceof THREE.Face4)if(E=j[A.a],aa=j[A.b],ea=j[A.c],ia=j[A.d],E.visible&&aa.visible&&ea.visible&&ia.visible)if(i=0>(ia.positionScreen.x-E.positionScreen.x)*(aa.positionScreen.y-E.positionScreen.y)-(ia.positionScreen.y-E.positionScreen.y)*(aa.positionScreen.x-E.positionScreen.x)||0>(aa.positionScreen.x-ea.positionScreen.x)*(ia.positionScreen.y-
|
|
R.doubleSided||i!=R.flipSided)ia=m[p]=m[p]||new THREE.RenderableFace3,p++,k=ia,k.v1.copy(E),k.v2.copy(aa),k.v3.copy(ea);else continue;else continue;else if(A instanceof THREE.Face4)if(E=j[A.a],aa=j[A.b],ea=j[A.c],ia=j[A.d],E.visible&&aa.visible&&ea.visible&&ia.visible)if(i=0>(ia.positionScreen.x-E.positionScreen.x)*(aa.positionScreen.y-E.positionScreen.y)-(ia.positionScreen.y-E.positionScreen.y)*(aa.positionScreen.x-E.positionScreen.x)||0>(aa.positionScreen.x-ea.positionScreen.x)*(ia.positionScreen.y-
|
|
ea.positionScreen.y)-(aa.positionScreen.y-ea.positionScreen.y)*(ia.positionScreen.x-ea.positionScreen.x),R.doubleSided||i!=R.flipSided)oa=r[o]=r[o]||new THREE.RenderableFace4,o++,k=oa,k.v1.copy(E),k.v2.copy(aa),k.v3.copy(ea),k.v4.copy(ia);else continue;else continue;k.normalWorld.copy(A.normal);!i&&(R.flipSided||R.doubleSided)&&k.normalWorld.negate();ba.multiplyVector3(k.normalWorld);k.centroidWorld.copy(A.centroid);$.multiplyVector3(k.centroidWorld);k.centroidScreen.copy(k.centroidWorld);C.multiplyVector3(k.centroidScreen);
|
|
ea.positionScreen.y)-(aa.positionScreen.y-ea.positionScreen.y)*(ia.positionScreen.x-ea.positionScreen.x),R.doubleSided||i!=R.flipSided)oa=r[o]=r[o]||new THREE.RenderableFace4,o++,k=oa,k.v1.copy(E),k.v2.copy(aa),k.v3.copy(ea),k.v4.copy(ia);else continue;else continue;k.normalWorld.copy(A.normal);!i&&(R.flipSided||R.doubleSided)&&k.normalWorld.negate();ba.multiplyVector3(k.normalWorld);k.centroidWorld.copy(A.centroid);$.multiplyVector3(k.centroidWorld);k.centroidScreen.copy(k.centroidWorld);C.multiplyVector3(k.centroidScreen);
|
|
ea=A.vertexNormals;for(E=0,aa=ea.length;E<aa;E++)ia=k.vertexNormalsWorld[E],ia.copy(ea[E]),!i&&(R.flipSided||R.doubleSided)&&ia.negate(),ba.multiplyVector3(ia);for(E=0,aa=Ga.length;E<aa;E++)if(oa=Ga[E][V])for(ea=0,ia=oa.length;ea<ia;ea++)k.uvs[E][ea]=oa[ea];k.material=R.material;k.faceMaterial=null!==A.materialIndex?Z[A.materialIndex]:null;k.z=k.centroidScreen.z;w.elements.push(k)}}else if(R instanceof THREE.Line){G.multiply(C,$);V=R.geometry.vertices;E=b();E.positionScreen.copy(V[0].position);G.multiplyVector4(E.positionScreen);
|
|
ea=A.vertexNormals;for(E=0,aa=ea.length;E<aa;E++)ia=k.vertexNormalsWorld[E],ia.copy(ea[E]),!i&&(R.flipSided||R.doubleSided)&&ia.negate(),ba.multiplyVector3(ia);for(E=0,aa=Ga.length;E<aa;E++)if(oa=Ga[E][V])for(ea=0,ia=oa.length;ea<ia;ea++)k.uvs[E][ea]=oa[ea];k.material=R.material;k.faceMaterial=null!==A.materialIndex?Z[A.materialIndex]:null;k.z=k.centroidScreen.z;w.elements.push(k)}}else if(R instanceof THREE.Line){G.multiply(C,$);V=R.geometry.vertices;E=b();E.positionScreen.copy(V[0].position);G.multiplyVector4(E.positionScreen);
|
|
-$=R.type===THREE.LinePieces?2:1;for(B=1,A=V.length;B<A;B++)if(E=b(),E.positionScreen.copy(V[B].position),G.multiplyVector4(E.positionScreen),!(0<(B+1)%$)&&(aa=j[l-2],N.copy(E.positionScreen),P.copy(aa.positionScreen),d(N,P)))N.multiplyScalar(1/N.w),P.multiplyScalar(1/P.w),Z=s[q]=s[q]||new THREE.RenderableLine,q++,n=Z,n.v1.positionScreen.copy(N),n.v2.positionScreen.copy(P),n.z=Math.max(N.z,P.z),n.material=R.material,w.elements.push(n)}for(a=0,z=w.sprites.length;a<z;a++)if(R=w.sprites[a].object,$=R.matrixWorld,
|
|
|
|
-R instanceof THREE.Particle&&(F.set($.n14,$.n24,$.n34,1),C.multiplyVector4(F),F.z/=F.w,0<F.z&&1>F.z))g=t[v]=t[v]||new THREE.RenderableParticle,v++,u=g,u.x=F.x/F.w,u.y=F.y/F.w,u.z=F.z,u.rotation=R.rotation.z,u.scale.x=R.scale.x*Math.abs(u.x-(F.x+e.projectionMatrix.n11)/(F.w+e.projectionMatrix.n14)),u.scale.y=R.scale.y*Math.abs(u.y-(F.y+e.projectionMatrix.n22)/(F.w+e.projectionMatrix.n24)),u.material=R.material,w.elements.push(u);f&&w.elements.sort(c);return w}};
|
|
|
|
|
|
+for(B=1,A=V.length;B<A;B++)if(E=b(),E.positionScreen.copy(V[B].position),G.multiplyVector4(E.positionScreen),aa=j[l-2],N.copy(E.positionScreen),P.copy(aa.positionScreen),d(N,P))N.multiplyScalar(1/N.w),P.multiplyScalar(1/P.w),$=s[q]=s[q]||new THREE.RenderableLine,q++,n=$,n.v1.positionScreen.copy(N),n.v2.positionScreen.copy(P),n.z=Math.max(N.z,P.z),n.material=R.material,w.elements.push(n)}for(a=0,z=w.sprites.length;a<z;a++)if(R=w.sprites[a].object,$=R.matrixWorld,R instanceof THREE.Particle&&(F.set($.n14,
|
|
|
|
+$.n24,$.n34,1),C.multiplyVector4(F),F.z/=F.w,0<F.z&&1>F.z))g=t[v]=t[v]||new THREE.RenderableParticle,v++,u=g,u.x=F.x/F.w,u.y=F.y/F.w,u.z=F.z,u.rotation=R.rotation.z,u.scale.x=R.scale.x*Math.abs(u.x-(F.x+e.projectionMatrix.n11)/(F.w+e.projectionMatrix.n14)),u.scale.y=R.scale.y*Math.abs(u.y-(F.y+e.projectionMatrix.n22)/(F.w+e.projectionMatrix.n24)),u.material=R.material,w.elements.push(u);f&&w.elements.sort(c);return w}};
|
|
THREE.Quaternion=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1};
|
|
THREE.Quaternion=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1};
|
|
THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),f=Math.cos(c),c=Math.sin(c),g=a*b,h=d*e;this.w=g*f-h*c;this.x=g*c+h*f;this.y=d*b*f+a*e*c;this.z=a*e*f-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);
|
|
THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),f=Math.cos(c),c=Math.sin(c),g=a*b,h=d*e;this.w=g*f-h*c;this.x=g*c+h*f;this.y=d*b*f+a*e*c;this.z=a*e*f-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);
|
|
this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=0>a.n32-a.n23?-Math.abs(this.x):Math.abs(this.x);this.y=0>a.n13-a.n31?-Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);
|
|
this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=0>a.n32-a.n23?-Math.abs(this.x):Math.abs(this.x);this.y=0>a.n13-a.n31?-Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);
|
|
this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiply:function(a,
|
|
this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiply:function(a,
|
|
b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y=c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-d*h;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,l=this.w,j=l*c+g*e-h*d,k=l*d+h*c-f*e,p=l*e+f*
|
|
b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y=c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-d*h;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,l=this.w,j=l*c+g*e-h*d,k=l*d+h*c-f*e,p=l*e+f*
|
|
d-g*c,c=-f*c-g*d-h*e;b.x=j*l+c*-f+k*-h-p*-g;b.y=k*l+c*-g+p*-f-j*-h;b.z=p*l+c*-h+j*-g-k*-f;return b},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}};
|
|
d-g*c,c=-f*c-g*d-h*e;b.x=j*l+c*-f+k*-h-p*-g;b.y=k*l+c*-g+p*-f-j*-h;b.z=p*l+c*-h+j*-g-k*-f;return b},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}};
|
|
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var f=Math.acos(e),e=Math.sqrt(1-e*e);if(0.001>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
|
|
|
|
|
|
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var f=Math.acos(e),e=Math.sqrt(1-e*e);if(0.0010>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
|
|
THREE.Vertex.prototype={constructor:THREE.Vertex,clone:function(){return new THREE.Vertex(this.position.clone())}};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=f;this.centroid=new THREE.Vector3};
|
|
THREE.Vertex.prototype={constructor:THREE.Vertex,clone:function(){return new THREE.Vertex(this.position.clone())}};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=f;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;for(b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();for(b=0,c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();for(b=0,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;for(b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();for(b=0,c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();for(b=0,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,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
|
|
return a}};THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
|
|
@@ -308,7 +308,7 @@ g._normalMatrixArray=new Float32Array(9),g._modelViewMatrixArray=new Float32Arra
|
|
-1,void 0===B[E]&&(B[E]={hash:E,counter:0}),w=B[E].hash+"_"+B[E].counter,void 0===q.geometryGroups[w]&&(q.geometryGroups[w]={faces3:[],faces4:[],materialIndex:u,vertices:0,numMorphTargets:C,numMorphNormals:G}),v=A instanceof THREE.Face3?3:4,65535<q.geometryGroups[w].vertices+v&&(B[E].counter+=1,w=B[E].hash+"_"+B[E].counter,void 0===q.geometryGroups[w]&&(q.geometryGroups[w]={faces3:[],faces4:[],materialIndex:u,vertices:0,numMorphTargets:C,numMorphNormals:G})),A instanceof THREE.Face3?q.geometryGroups[w].faces3.push(s):
|
|
-1,void 0===B[E]&&(B[E]={hash:E,counter:0}),w=B[E].hash+"_"+B[E].counter,void 0===q.geometryGroups[w]&&(q.geometryGroups[w]={faces3:[],faces4:[],materialIndex:u,vertices:0,numMorphTargets:C,numMorphNormals:G}),v=A instanceof THREE.Face3?3:4,65535<q.geometryGroups[w].vertices+v&&(B[E].counter+=1,w=B[E].hash+"_"+B[E].counter,void 0===q.geometryGroups[w]&&(q.geometryGroups[w]={faces3:[],faces4:[],materialIndex:u,vertices:0,numMorphTargets:C,numMorphNormals:G})),A instanceof THREE.Face3?q.geometryGroups[w].faces3.push(s):
|
|
q.geometryGroups[w].faces4.push(s),q.geometryGroups[w].vertices+=v;q.geometryGroupsList=[];var V=void 0;for(V in q.geometryGroups)q.geometryGroups[V].id=ea++,q.geometryGroupsList.push(q.geometryGroups[V])}for(j in l.geometryGroups)if(n=l.geometryGroups[j],!n.__webglVertexBuffer){var z=n;z.__webglVertexBuffer=i.createBuffer();z.__webglNormalBuffer=i.createBuffer();z.__webglTangentBuffer=i.createBuffer();z.__webglColorBuffer=i.createBuffer();z.__webglUVBuffer=i.createBuffer();z.__webglUV2Buffer=i.createBuffer();
|
|
q.geometryGroups[w].faces4.push(s),q.geometryGroups[w].vertices+=v;q.geometryGroupsList=[];var V=void 0;for(V in q.geometryGroups)q.geometryGroups[V].id=ea++,q.geometryGroupsList.push(q.geometryGroups[V])}for(j in l.geometryGroups)if(n=l.geometryGroups[j],!n.__webglVertexBuffer){var z=n;z.__webglVertexBuffer=i.createBuffer();z.__webglNormalBuffer=i.createBuffer();z.__webglTangentBuffer=i.createBuffer();z.__webglColorBuffer=i.createBuffer();z.__webglUVBuffer=i.createBuffer();z.__webglUV2Buffer=i.createBuffer();
|
|
z.__webglSkinVertexABuffer=i.createBuffer();z.__webglSkinVertexBBuffer=i.createBuffer();z.__webglSkinIndicesBuffer=i.createBuffer();z.__webglSkinWeightsBuffer=i.createBuffer();z.__webglFaceBuffer=i.createBuffer();z.__webglLineBuffer=i.createBuffer();var F=void 0,J=void 0;if(z.numMorphTargets){z.__webglMorphTargetsBuffers=[];for(F=0,J=z.numMorphTargets;F<J;F++)z.__webglMorphTargetsBuffers.push(i.createBuffer())}if(z.numMorphNormals){z.__webglMorphNormalsBuffers=[];for(F=0,J=z.numMorphNormals;F<J;F++)z.__webglMorphNormalsBuffers.push(i.createBuffer())}D.info.memory.geometries++;
|
|
z.__webglSkinVertexABuffer=i.createBuffer();z.__webglSkinVertexBBuffer=i.createBuffer();z.__webglSkinIndicesBuffer=i.createBuffer();z.__webglSkinWeightsBuffer=i.createBuffer();z.__webglFaceBuffer=i.createBuffer();z.__webglLineBuffer=i.createBuffer();var F=void 0,J=void 0;if(z.numMorphTargets){z.__webglMorphTargetsBuffers=[];for(F=0,J=z.numMorphTargets;F<J;F++)z.__webglMorphTargetsBuffers.push(i.createBuffer())}if(z.numMorphNormals){z.__webglMorphNormalsBuffers=[];for(F=0,J=z.numMorphNormals;F<J;F++)z.__webglMorphNormalsBuffers.push(i.createBuffer())}D.info.memory.geometries++;
|
|
-var I=n,$=g,K=$.geometry,R=I.faces3,O=I.faces4,aa=3*R.length+4*O.length,N=1*R.length+2*O.length,Z=3*R.length+4*O.length,P=c($,I),ba=e(P),S=d(P),ja=P.vertexColors?P.vertexColors:!1;I.__vertexArray=new Float32Array(3*aa);if(S)I.__normalArray=new Float32Array(3*aa);if(K.hasTangents)I.__tangentArray=new Float32Array(4*aa);if(ja)I.__colorArray=new Float32Array(3*aa);if(ba){if(0<K.faceUvs.length||0<K.faceVertexUvs.length)I.__uvArray=new Float32Array(2*aa);if(1<K.faceUvs.length||1<K.faceVertexUvs.length)I.__uv2Array=
|
|
|
|
|
|
+var I=n,$=g,K=$.geometry,O=I.faces3,R=I.faces4,aa=3*O.length+4*R.length,N=1*O.length+2*R.length,Z=3*O.length+4*R.length,P=c($,I),ba=e(P),S=d(P),ja=P.vertexColors?P.vertexColors:!1;I.__vertexArray=new Float32Array(3*aa);if(S)I.__normalArray=new Float32Array(3*aa);if(K.hasTangents)I.__tangentArray=new Float32Array(4*aa);if(ja)I.__colorArray=new Float32Array(3*aa);if(ba){if(0<K.faceUvs.length||0<K.faceVertexUvs.length)I.__uvArray=new Float32Array(2*aa);if(1<K.faceUvs.length||1<K.faceVertexUvs.length)I.__uv2Array=
|
|
new Float32Array(2*aa)}if($.geometry.skinWeights.length&&$.geometry.skinIndices.length)I.__skinVertexAArray=new Float32Array(4*aa),I.__skinVertexBArray=new Float32Array(4*aa),I.__skinIndexArray=new Float32Array(4*aa),I.__skinWeightArray=new Float32Array(4*aa);I.__faceArray=new Uint16Array(3*N);I.__lineArray=new Uint16Array(2*Z);var T=void 0,ia=void 0;if(I.numMorphTargets){I.__morphTargetsArrays=[];for(T=0,ia=I.numMorphTargets;T<ia;T++)I.__morphTargetsArrays.push(new Float32Array(3*aa))}if(I.numMorphNormals){I.__morphNormalsArrays=
|
|
new Float32Array(2*aa)}if($.geometry.skinWeights.length&&$.geometry.skinIndices.length)I.__skinVertexAArray=new Float32Array(4*aa),I.__skinVertexBArray=new Float32Array(4*aa),I.__skinIndexArray=new Float32Array(4*aa),I.__skinWeightArray=new Float32Array(4*aa);I.__faceArray=new Uint16Array(3*N);I.__lineArray=new Uint16Array(2*Z);var T=void 0,ia=void 0;if(I.numMorphTargets){I.__morphTargetsArrays=[];for(T=0,ia=I.numMorphTargets;T<ia;T++)I.__morphTargetsArrays.push(new Float32Array(3*aa))}if(I.numMorphNormals){I.__morphNormalsArrays=
|
|
[];for(T=0,ia=I.numMorphNormals;T<ia;T++)I.__morphNormalsArrays.push(new Float32Array(3*aa))}I.__webglFaceCount=3*N;I.__webglLineCount=2*Z;if(P.attributes){if(void 0===I.__webglCustomAttributesList)I.__webglCustomAttributesList=[];var Ga=void 0;for(Ga in P.attributes){var Ka=P.attributes[Ga],oa={},ga;for(ga in Ka)oa[ga]=Ka[ga];if(!oa.__webglInitialized||oa.createUniqueBuffers){oa.__webglInitialized=!0;var Da=1;"v2"===oa.type?Da=2:"v3"===oa.type?Da=3:"v4"===oa.type?Da=4:"c"===oa.type&&(Da=3);oa.size=
|
|
[];for(T=0,ia=I.numMorphNormals;T<ia;T++)I.__morphNormalsArrays.push(new Float32Array(3*aa))}I.__webglFaceCount=3*N;I.__webglLineCount=2*Z;if(P.attributes){if(void 0===I.__webglCustomAttributesList)I.__webglCustomAttributesList=[];var Ga=void 0;for(Ga in P.attributes){var Ka=P.attributes[Ga],oa={},ga;for(ga in Ka)oa[ga]=Ka[ga];if(!oa.__webglInitialized||oa.createUniqueBuffers){oa.__webglInitialized=!0;var Da=1;"v2"===oa.type?Da=2:"v3"===oa.type?Da=3:"v4"===oa.type?Da=4:"c"===oa.type&&(Da=3);oa.size=
|
|
Da;oa.array=new Float32Array(aa*Da);oa.buffer=i.createBuffer();oa.buffer.belongsToAttribute=Ga;Ka.needsUpdate=!0;oa.__original=Ka}I.__webglCustomAttributesList.push(oa)}}I.__inittedArrays=!0;l.__dirtyVertices=!0;l.__dirtyMorphTargets=!0;l.__dirtyElements=!0;l.__dirtyUvs=!0;l.__dirtyNormals=!0;l.__dirtyTangents=!0;l.__dirtyColors=!0}}}else if(g instanceof THREE.Ribbon){if(l=g.geometry,!l.__webglVertexBuffer){var Ua=l;Ua.__webglVertexBuffer=i.createBuffer();Ua.__webglColorBuffer=i.createBuffer();D.info.memory.geometries++;
|
|
Da;oa.array=new Float32Array(aa*Da);oa.buffer=i.createBuffer();oa.buffer.belongsToAttribute=Ga;Ka.needsUpdate=!0;oa.__original=Ka}I.__webglCustomAttributesList.push(oa)}}I.__inittedArrays=!0;l.__dirtyVertices=!0;l.__dirtyMorphTargets=!0;l.__dirtyElements=!0;l.__dirtyUvs=!0;l.__dirtyNormals=!0;l.__dirtyTangents=!0;l.__dirtyColors=!0}}}else if(g instanceof THREE.Ribbon){if(l=g.geometry,!l.__webglVertexBuffer){var Ua=l;Ua.__webglVertexBuffer=i.createBuffer();Ua.__webglColorBuffer=i.createBuffer();D.info.memory.geometries++;
|
|
@@ -395,11 +395,11 @@ o=j.position.distanceTo(k.position),r=k.position.distanceTo(p.position),m=j.posi
|
|
v.vertexColors[1].copy(f),t.vertexColors[0].copy(f)),e=0):r>=o&&r>=m?(j=k.clone(),j.position.lerpSelf(p.position,0.5),v.a=f,v.b=g,v.c=l,t.a=l,t.b=h,t.c=f,3===e.vertexNormals.length&&(f=e.vertexNormals[1].clone(),f.lerpSelf(e.vertexNormals[2],0.5),v.vertexNormals[2].copy(f),t.vertexNormals[0].copy(f),t.vertexNormals[1].copy(e.vertexNormals[2]),t.vertexNormals[2].copy(e.vertexNormals[0])),3===e.vertexColors.length&&(f=e.vertexColors[1].clone(),f.lerpSelf(e.vertexColors[2],0.5),v.vertexColors[2].copy(f),
|
|
v.vertexColors[1].copy(f),t.vertexColors[0].copy(f)),e=0):r>=o&&r>=m?(j=k.clone(),j.position.lerpSelf(p.position,0.5),v.a=f,v.b=g,v.c=l,t.a=l,t.b=h,t.c=f,3===e.vertexNormals.length&&(f=e.vertexNormals[1].clone(),f.lerpSelf(e.vertexNormals[2],0.5),v.vertexNormals[2].copy(f),t.vertexNormals[0].copy(f),t.vertexNormals[1].copy(e.vertexNormals[2]),t.vertexNormals[2].copy(e.vertexNormals[0])),3===e.vertexColors.length&&(f=e.vertexColors[1].clone(),f.lerpSelf(e.vertexColors[2],0.5),v.vertexColors[2].copy(f),
|
|
t.vertexColors[0].copy(f),t.vertexColors[1].copy(e.vertexColors[2]),t.vertexColors[2].copy(e.vertexColors[0])),e=1):(j=j.clone(),j.position.lerpSelf(p.position,0.5),v.a=f,v.b=g,v.c=l,t.a=l,t.b=g,t.c=h,3===e.vertexNormals.length&&(f=e.vertexNormals[0].clone(),f.lerpSelf(e.vertexNormals[2],0.5),v.vertexNormals[2].copy(f),t.vertexNormals[0].copy(f)),3===e.vertexColors.length&&(f=e.vertexColors[0].clone(),f.lerpSelf(e.vertexColors[2],0.5),v.vertexColors[2].copy(f),t.vertexColors[0].copy(f)),e=2);w.push(v,
|
|
t.vertexColors[0].copy(f),t.vertexColors[1].copy(e.vertexColors[2]),t.vertexColors[2].copy(e.vertexColors[0])),e=1):(j=j.clone(),j.position.lerpSelf(p.position,0.5),v.a=f,v.b=g,v.c=l,t.a=l,t.b=g,t.c=h,3===e.vertexNormals.length&&(f=e.vertexNormals[0].clone(),f.lerpSelf(e.vertexNormals[2],0.5),v.vertexNormals[2].copy(f),t.vertexNormals[0].copy(f)),3===e.vertexColors.length&&(f=e.vertexColors[0].clone(),f.lerpSelf(e.vertexColors[2],0.5),v.vertexColors[2].copy(f),t.vertexColors[0].copy(f)),e=2);w.push(v,
|
|
t);a.vertices.push(j);for(f=0,g=a.faceVertexUvs.length;f<g;f++)a.faceVertexUvs[f].length&&(j=a.faceVertexUvs[f][c],t=j[0],h=j[1],v=j[2],0===e?(k=t.clone(),k.lerpSelf(h,0.5),j=[t.clone(),k.clone(),v.clone()],h=[k.clone(),h.clone(),v.clone()]):1===e?(k=h.clone(),k.lerpSelf(v,0.5),j=[t.clone(),h.clone(),k.clone()],h=[k.clone(),v.clone(),t.clone()]):(k=t.clone(),k.lerpSelf(v,0.5),j=[t.clone(),h.clone(),k.clone()],h=[k.clone(),h.clone(),v.clone()]),z[f].push(j,h))}else{w.push(e);for(f=0,g=a.faceVertexUvs.length;f<
|
|
t);a.vertices.push(j);for(f=0,g=a.faceVertexUvs.length;f<g;f++)a.faceVertexUvs[f].length&&(j=a.faceVertexUvs[f][c],t=j[0],h=j[1],v=j[2],0===e?(k=t.clone(),k.lerpSelf(h,0.5),j=[t.clone(),k.clone(),v.clone()],h=[k.clone(),h.clone(),v.clone()]):1===e?(k=h.clone(),k.lerpSelf(v,0.5),j=[t.clone(),h.clone(),k.clone()],h=[k.clone(),v.clone(),t.clone()]):(k=t.clone(),k.lerpSelf(v,0.5),j=[t.clone(),h.clone(),k.clone()],h=[k.clone(),h.clone(),v.clone()]),z[f].push(j,h))}else{w.push(e);for(f=0,g=a.faceVertexUvs.length;f<
|
|
-g;f++)z[f].push(a.faceVertexUvs[f])}else if(f=e.a,g=e.b,h=e.c,l=e.d,j=a.vertices[f],k=a.vertices[g],p=a.vertices[h],m=a.vertices[l],o=j.position.distanceTo(k.position),r=k.position.distanceTo(p.position),n=p.position.distanceTo(m.position),q=j.position.distanceTo(m.position),o>b||r>b||n>b||q>b){s=a.vertices.length;u=a.vertices.length+1;v=e.clone();t=e.clone();o>=r&&o>=n&&o>=q||n>=r&&n>=o&&n>=q?(o=j.clone(),o.position.lerpSelf(k.position,0.5),k=p.clone(),k.position.lerpSelf(m.position,0.5),v.a=f,v.b=
|
|
|
|
-s,v.c=u,v.d=l,t.a=s,t.b=g,t.c=h,t.d=u,4===e.vertexNormals.length&&(f=e.vertexNormals[0].clone(),f.lerpSelf(e.vertexNormals[1],0.5),g=e.vertexNormals[2].clone(),g.lerpSelf(e.vertexNormals[3],0.5),v.vertexNormals[1].copy(f),v.vertexNormals[2].copy(g),t.vertexNormals[0].copy(f),t.vertexNormals[3].copy(g)),4===e.vertexColors.length&&(f=e.vertexColors[0].clone(),f.lerpSelf(e.vertexColors[1],0.5),g=e.vertexColors[2].clone(),g.lerpSelf(e.vertexColors[3],0.5),v.vertexColors[1].copy(f),v.vertexColors[2].copy(g),
|
|
|
|
|
|
+g;f++)z[f].push(a.faceVertexUvs[f][c])}else if(f=e.a,g=e.b,h=e.c,l=e.d,j=a.vertices[f],k=a.vertices[g],p=a.vertices[h],m=a.vertices[l],o=j.position.distanceTo(k.position),r=k.position.distanceTo(p.position),n=p.position.distanceTo(m.position),q=j.position.distanceTo(m.position),o>b||r>b||n>b||q>b){s=a.vertices.length;u=a.vertices.length+1;v=e.clone();t=e.clone();o>=r&&o>=n&&o>=q||n>=r&&n>=o&&n>=q?(o=j.clone(),o.position.lerpSelf(k.position,0.5),k=p.clone(),k.position.lerpSelf(m.position,0.5),v.a=
|
|
|
|
+f,v.b=s,v.c=u,v.d=l,t.a=s,t.b=g,t.c=h,t.d=u,4===e.vertexNormals.length&&(f=e.vertexNormals[0].clone(),f.lerpSelf(e.vertexNormals[1],0.5),g=e.vertexNormals[2].clone(),g.lerpSelf(e.vertexNormals[3],0.5),v.vertexNormals[1].copy(f),v.vertexNormals[2].copy(g),t.vertexNormals[0].copy(f),t.vertexNormals[3].copy(g)),4===e.vertexColors.length&&(f=e.vertexColors[0].clone(),f.lerpSelf(e.vertexColors[1],0.5),g=e.vertexColors[2].clone(),g.lerpSelf(e.vertexColors[3],0.5),v.vertexColors[1].copy(f),v.vertexColors[2].copy(g),
|
|
t.vertexColors[0].copy(f),t.vertexColors[3].copy(g)),e=0):(o=k.clone(),o.position.lerpSelf(p.position,0.5),k=m.clone(),k.position.lerpSelf(j.position,0.5),v.a=f,v.b=g,v.c=s,v.d=u,t.a=u,t.b=s,t.c=h,t.d=l,4===e.vertexNormals.length&&(f=e.vertexNormals[1].clone(),f.lerpSelf(e.vertexNormals[2],0.5),g=e.vertexNormals[3].clone(),g.lerpSelf(e.vertexNormals[0],0.5),v.vertexNormals[2].copy(f),v.vertexNormals[3].copy(g),t.vertexNormals[0].copy(g),t.vertexNormals[1].copy(f)),4===e.vertexColors.length&&(f=e.vertexColors[1].clone(),
|
|
t.vertexColors[0].copy(f),t.vertexColors[3].copy(g)),e=0):(o=k.clone(),o.position.lerpSelf(p.position,0.5),k=m.clone(),k.position.lerpSelf(j.position,0.5),v.a=f,v.b=g,v.c=s,v.d=u,t.a=u,t.b=s,t.c=h,t.d=l,4===e.vertexNormals.length&&(f=e.vertexNormals[1].clone(),f.lerpSelf(e.vertexNormals[2],0.5),g=e.vertexNormals[3].clone(),g.lerpSelf(e.vertexNormals[0],0.5),v.vertexNormals[2].copy(f),v.vertexNormals[3].copy(g),t.vertexNormals[0].copy(g),t.vertexNormals[1].copy(f)),4===e.vertexColors.length&&(f=e.vertexColors[1].clone(),
|
|
f.lerpSelf(e.vertexColors[2],0.5),g=e.vertexColors[3].clone(),g.lerpSelf(e.vertexColors[0],0.5),v.vertexColors[2].copy(f),v.vertexColors[3].copy(g),t.vertexColors[0].copy(g),t.vertexColors[1].copy(f)),e=1);w.push(v,t);a.vertices.push(o,k);for(f=0,g=a.faceVertexUvs.length;f<g;f++)a.faceVertexUvs[f].length&&(j=a.faceVertexUvs[f][c],t=j[0],h=j[1],v=j[2],j=j[3],0===e?(k=t.clone(),k.lerpSelf(h,0.5),p=v.clone(),p.lerpSelf(j,0.5),t=[t.clone(),k.clone(),p.clone(),j.clone()],h=[k.clone(),h.clone(),v.clone(),
|
|
f.lerpSelf(e.vertexColors[2],0.5),g=e.vertexColors[3].clone(),g.lerpSelf(e.vertexColors[0],0.5),v.vertexColors[2].copy(f),v.vertexColors[3].copy(g),t.vertexColors[0].copy(g),t.vertexColors[1].copy(f)),e=1);w.push(v,t);a.vertices.push(o,k);for(f=0,g=a.faceVertexUvs.length;f<g;f++)a.faceVertexUvs[f].length&&(j=a.faceVertexUvs[f][c],t=j[0],h=j[1],v=j[2],j=j[3],0===e?(k=t.clone(),k.lerpSelf(h,0.5),p=v.clone(),p.lerpSelf(j,0.5),t=[t.clone(),k.clone(),p.clone(),j.clone()],h=[k.clone(),h.clone(),v.clone(),
|
|
-p.clone()]):(k=h.clone(),k.lerpSelf(v,0.5),p=j.clone(),p.lerpSelf(t,0.5),t=[t.clone(),h.clone(),k.clone(),p.clone()],h=[p.clone(),k.clone(),v.clone(),j.clone()]),z[f].push(t,h))}else{w.push(e);for(f=0,g=a.faceVertexUvs.length;f<g;f++)z[f].push(a.faceVertexUvs[f])}a.faces=w;a.faceVertexUvs=z}};THREE.GeometryUtils.random=THREE.Math.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;
|
|
|
|
|
|
+p.clone()]):(k=h.clone(),k.lerpSelf(v,0.5),p=j.clone(),p.lerpSelf(t,0.5),t=[t.clone(),h.clone(),k.clone(),p.clone()],h=[p.clone(),k.clone(),v.clone(),j.clone()]),z[f].push(t,h))}else{w.push(e);for(f=0,g=a.faceVertexUvs.length;f<g;f++)z[f].push(a.faceVertexUvs[f][c])}a.faces=w;a.faceVertexUvs=z}};THREE.GeometryUtils.random=THREE.Math.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;
|
|
THREE.ImageUtils={crossOrigin:"anonymous",loadTexture:function(a,b,c){var d=new Image,e=new THREE.Texture(d,b);d.onload=function(){e.needsUpdate=!0;c&&c(this)};d.crossOrigin=this.crossOrigin;d.src=a;return e},loadTextureCube:function(a,b,c){var d,e=[],f=new THREE.Texture(e,b);e.loadCount=0;for(b=0,d=a.length;b<d;++b)e[b]=new Image,e[b].onload=function(){e.loadCount+=1;if(6===e.loadCount)f.needsUpdate=!0;c&&c(this)},e[b].crossOrigin=this.crossOrigin,e[b].src=a[b];return f},getNormalMap:function(a,
|
|
THREE.ImageUtils={crossOrigin:"anonymous",loadTexture:function(a,b,c){var d=new Image,e=new THREE.Texture(d,b);d.onload=function(){e.needsUpdate=!0;c&&c(this)};d.crossOrigin=this.crossOrigin;d.src=a;return e},loadTextureCube:function(a,b,c){var d,e=[],f=new THREE.Texture(e,b);e.loadCount=0;for(b=0,d=a.length;b<d;++b)e[b]=new Image,e[b].onload=function(){e.loadCount+=1;if(6===e.loadCount)f.needsUpdate=!0;c&&c(this)},e[b].crossOrigin=this.crossOrigin,e[b].src=a[b];return f},getNormalMap:function(a,
|
|
b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]},b=b|1,d=a.width,e=a.height,f=document.createElement("canvas");f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,l=g.createImageData(d,e),j=l.data,k=0;k<d;k++)for(var p=1;p<e;p++){var m=0>p-1?e-1:p-1,o=(p+1)%e,r=0>k-1?d-1:k-1,n=(k+1)%d,q=[],s=[0,0,h[4*(p*d+k)]/255*b];q.push([-1,0,h[4*(p*d+r)]/255*b]);q.push([-1,-1,h[4*(m*d+r)]/255*b]);q.push([0,-1,
|
|
b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]},b=b|1,d=a.width,e=a.height,f=document.createElement("canvas");f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,l=g.createImageData(d,e),j=l.data,k=0;k<d;k++)for(var p=1;p<e;p++){var m=0>p-1?e-1:p-1,o=(p+1)%e,r=0>k-1?d-1:k-1,n=(k+1)%d,q=[],s=[0,0,h[4*(p*d+k)]/255*b];q.push([-1,0,h[4*(p*d+r)]/255*b]);q.push([-1,-1,h[4*(m*d+r)]/255*b]);q.push([0,-1,
|
|
h[4*(m*d+k)]/255*b]);q.push([1,-1,h[4*(m*d+n)]/255*b]);q.push([1,0,h[4*(p*d+n)]/255*b]);q.push([1,1,h[4*(o*d+n)]/255*b]);q.push([0,1,h[4*(o*d+k)]/255*b]);q.push([-1,1,h[4*(o*d+r)]/255*b]);m=[];r=q.length;for(o=0;o<r;o++){var n=q[o],u=q[(o+1)%r],n=[n[0]-s[0],n[1]-s[1],n[2]-s[2]],u=[u[0]-s[0],u[1]-s[1],u[2]-s[2]];m.push(c([n[1]*u[2]-n[2]*u[1],n[2]*u[0]-n[0]*u[2],n[0]*u[1]-n[1]*u[0]]))}q=[0,0,0];for(o=0;o<m.length;o++)q[0]+=m[o][0],q[1]+=m[o][1],q[2]+=m[o][2];q[0]/=m.length;q[1]/=m.length;q[2]/=m.length;
|
|
h[4*(m*d+k)]/255*b]);q.push([1,-1,h[4*(m*d+n)]/255*b]);q.push([1,0,h[4*(p*d+n)]/255*b]);q.push([1,1,h[4*(o*d+n)]/255*b]);q.push([0,1,h[4*(o*d+k)]/255*b]);q.push([-1,1,h[4*(o*d+r)]/255*b]);m=[];r=q.length;for(o=0;o<r;o++){var n=q[o],u=q[(o+1)%r],n=[n[0]-s[0],n[1]-s[1],n[2]-s[2]],u=[u[0]-s[0],u[1]-s[1],u[2]-s[2]];m.push(c([n[1]*u[2]-n[2]*u[1],n[2]*u[0]-n[0]*u[2],n[0]*u[1]-n[1]*u[0]]))}q=[0,0,0];for(o=0;o<m.length;o++)q[0]+=m[o][0],q[1]+=m[o][1],q[2]+=m[o][2];q[0]/=m.length;q[1]/=m.length;q[2]/=m.length;
|
|
@@ -488,7 +488,7 @@ c)THREE.Quaternion.slerp(e,f,a.quaternion,d);else if("scl"===c)c=a.scale,c.x=e[0
|
|
THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],e,f,g,h,l,j;e=(a.length-1)*b;f=Math.floor(e);e-=f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>a.length-2?f:f+1;c[3]=f>a.length-3?f:f+2;f=a[c[0]];h=a[c[1]];l=a[c[2]];j=a[c[3]];c=e*e;g=e*c;d[0]=this.interpolate(f[0],h[0],l[0],j[0],e,c,g);d[1]=this.interpolate(f[1],h[1],l[1],j[1],e,c,g);d[2]=this.interpolate(f[2],h[2],l[2],j[2],e,c,g);return d};
|
|
THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],e,f,g,h,l,j;e=(a.length-1)*b;f=Math.floor(e);e-=f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>a.length-2?f:f+1;c[3]=f>a.length-3?f:f+2;f=a[c[0]];h=a[c[1]];l=a[c[2]];j=a[c[3]];c=e*e;g=e*c;d[0]=this.interpolate(f[0],h[0],l[0],j[0],e,c,g);d[1]=this.interpolate(f[1],h[1],l[1],j[1],e,c,g);d[2]=this.interpolate(f[2],h[2],l[2],j[2],e,c,g);return d};
|
|
THREE.Animation.prototype.interpolate=function(a,b,c,d,e,f,g){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
|
|
THREE.Animation.prototype.interpolate=function(a,b,c,d,e,f,g){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
|
|
THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};
|
|
THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};
|
|
-THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.001;this.isPlaying=!1;this.loop=this.isPaused=!0;this.JITCompile=void 0!==c?c:!0;a=0;for(b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
|
|
|
|
|
|
+THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.0010;this.isPlaying=!1;this.loop=this.isPaused=!0;this.JITCompile=void 0!==c?c:!0;a=0;for(b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
|
|
d.matrixWorldNeedsUpdate=!0}}};
|
|
d.matrixWorldNeedsUpdate=!0}}};
|
|
THREE.KeyFrameAnimation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;this.startTimeMs=b;this.startTime=1E7;this.endTime=-this.startTime;var c,d=this.hierarchy.length,e,f;for(c=0;c<d;c++){e=this.hierarchy[c];f=this.data.hierarchy[c];e.useQuaternion=!0;if(void 0===f.animationCache)f.animationCache={},f.animationCache.prevKey=null,f.animationCache.nextKey=null,f.animationCache.originalMatrix=e instanceof THREE.Bone?e.skinMatrix:
|
|
THREE.KeyFrameAnimation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;this.startTimeMs=b;this.startTime=1E7;this.endTime=-this.startTime;var c,d=this.hierarchy.length,e,f;for(c=0;c<d;c++){e=this.hierarchy[c];f=this.data.hierarchy[c];e.useQuaternion=!0;if(void 0===f.animationCache)f.animationCache={},f.animationCache.prevKey=null,f.animationCache.nextKey=null,f.animationCache.originalMatrix=e instanceof THREE.Bone?e.skinMatrix:
|
|
e.matrix;e=this.data.hierarchy[c].keys;if(e.length)f.animationCache.prevKey=e[0],f.animationCache.nextKey=e[1],this.startTime=Math.min(e[0].time,this.startTime),this.endTime=Math.max(e[e.length-1].time,this.endTime)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};THREE.KeyFrameAnimation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
|
|
e.matrix;e=this.data.hierarchy[c].keys;if(e.length)f.animationCache.prevKey=e[0],f.animationCache.nextKey=e[1],this.startTime=Math.min(e[0].time,this.startTime),this.endTime=Math.max(e[e.length-1].time,this.endTime)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};THREE.KeyFrameAnimation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
|
|
@@ -506,7 +506,7 @@ THREE.CombinedCamera.prototype.toOrthographic=function(){var a=this.cameraP.aspe
|
|
THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.setLens=function(a,b){var c=2*Math.atan((void 0!==b?b:24)/(2*a))*(180/Math.PI);this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};
|
|
THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.setLens=function(a,b){var c=2*Math.atan((void 0!==b?b:24)/(2*a))*(180/Math.PI);this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};
|
|
THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
|
|
THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
|
|
THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
|
|
THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
|
|
-THREE.FirstPersonControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.target=new THREE.Vector3(0,0,0);this.domElement=void 0!==b?b:document;this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=
|
|
|
|
|
|
+THREE.FirstPersonControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.target=new THREE.Vector3(0,0,0);this.domElement=void 0!==b?b:document;this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=
|
|
0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=
|
|
0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=
|
|
!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown=
|
|
!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown=
|
|
function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=
|
|
function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=
|
|
@@ -516,14 +516,14 @@ this.moveUp&&this.object.translateY(b);this.moveDown&&this.object.translateY(-b)
|
|
this.object.lookAt(b)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};
|
|
this.object.lookAt(b)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};
|
|
THREE.PathControls=function(a,b){function c(a){return 1>(a*=2)?0.5*a*a:-0.5*(--a*(a-2)-1)}function d(a,b){return function(){b.apply(a,arguments)}}function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.getControlPointsArray(),h=b.getLength(),q=g.length,s=0;f=q-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[f]={time:d,pos:g[f],rot:[0,0,0,1],scl:[1,1,1]};for(f=1;f<q-1;f++)s=d*h.chunks[f]/h.total,b.keys[f]={time:s,pos:g[f]};e.hierarchy[0]=b;THREE.AnimationHandler.add(e);
|
|
THREE.PathControls=function(a,b){function c(a){return 1>(a*=2)?0.5*a*a:-0.5*(--a*(a-2)-1)}function d(a,b){return function(){b.apply(a,arguments)}}function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.getControlPointsArray(),h=b.getLength(),q=g.length,s=0;f=q-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[f]={time:d,pos:g[f],rot:[0,0,0,1],scl:[1,1,1]};for(f=1;f<q-1;f++)s=d*h.chunks[f]/h.total,b.keys[f]={time:s,pos:g[f]};e.hierarchy[0]=b;THREE.AnimationHandler.add(e);
|
|
return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b;c++)d=c/(a.points.length*b),d=a.getPoint(d),e.vertices[c]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return e}this.object=a;this.domElement=void 0!==b?b:document;this.id="PathControls"+THREE.PathControlsIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=
|
|
return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b;c++)d=c/(a.points.length*b),d=a.getPoint(d),e.vertices[c]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return e}this.object=a;this.domElement=void 0!==b?b:document;this.id="PathControls"+THREE.PathControlsIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=
|
|
-new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/
|
|
|
|
|
|
+new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookHorizontal=this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/
|
|
2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var g=2*Math.PI,h=Math.PI/180;this.update=function(a){var b;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed*a);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed*a);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*h;this.theta=this.lon*h;a=this.phi%g;this.phi=0<=a?a:a+g;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange;
|
|
2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var g=2*Math.PI,h=Math.PI/180;this.update=function(a){var b;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed*a);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed*a);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*h;this.theta=this.lon*h;a=this.phi%g;this.phi=0<=a?a:a+g;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange;
|
|
b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var d=a[1]-a[0];this.phi=c((b-a[0])/d)*d+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);d=a[1]-a[0];this.theta=c((b-a[0])/d)*d+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(a){this.domElement===
|
|
b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var d=a[1]-a[0];this.phi=c((b-a[0])/d)*d+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);d=a[1]-a[0];this.theta=c((b-a[0])/d)*d+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(a){this.domElement===
|
|
document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),b=new THREE.MeshLambertMaterial({color:65280}),
|
|
document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),b=new THREE.MeshLambertMaterial({color:65280}),
|
|
c=new THREE.CubeGeometry(10,10,20),g=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,a);a=new THREE.Mesh(g,b);a.position.set(0,10,0);this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=e(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a=
|
|
c=new THREE.CubeGeometry(10,10,20),g=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,a);a=new THREE.Mesh(g,b);a.position.set(0,10,0);this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=e(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a=
|
|
this.debugPath,b=this.spline,g=f(b,10),c=f(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3}),g=new THREE.Line(g,h),c=new THREE.ParticleSystem(c,new THREE.ParticleBasicMaterial({color:16755200,size:3}));g.scale.set(1,1,1);a.add(g);c.scale.set(1,1,1);a.add(c);for(var g=new THREE.SphereGeometry(1,16,8),h=new THREE.MeshBasicMaterial({color:65280}),o=0;o<b.points.length;o++)c=new THREE.Mesh(g,h),c.position.copy(b.points[o]),a.add(c)}this.domElement.addEventListener("mousemove",d(this,this.onMouseMove),
|
|
this.debugPath,b=this.spline,g=f(b,10),c=f(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3}),g=new THREE.Line(g,h),c=new THREE.ParticleSystem(c,new THREE.ParticleBasicMaterial({color:16755200,size:3}));g.scale.set(1,1,1);a.add(g);c.scale.set(1,1,1);a.add(c);for(var g=new THREE.SphereGeometry(1,16,8),h=new THREE.MeshBasicMaterial({color:65280}),o=0;o<b.points.length;o++)c=new THREE.Mesh(g,h),c.position.copy(b.points[o]),a.add(c)}this.domElement.addEventListener("mousemove",d(this,this.onMouseMove),
|
|
!1)}};THREE.PathControlsIdCounter=0;
|
|
!1)}};THREE.PathControlsIdCounter=0;
|
|
-THREE.FlyControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.domElement=void 0!==b?b:document;b&&this.domElement.setAttribute("tabindex",-1);this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.object.useQuaternion=!0;this.tmpQuaternion=new THREE.Quaternion;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,
|
|
|
|
|
|
+THREE.FlyControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.domElement=void 0!==b?b:document;b&&this.domElement.setAttribute("tabindex",-1);this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.object.useQuaternion=!0;this.tmpQuaternion=new THREE.Quaternion;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,
|
|
0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.handleEvent=function(a){if("function"==typeof this[a.type])this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=
|
|
0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.handleEvent=function(a){if("function"==typeof this[a.type])this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=
|
|
1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=
|
|
1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=
|
|
0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(a.button){case 0:this.object.moveForward=
|
|
0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(a.button){case 0:this.object.moveForward=
|
|
@@ -567,7 +567,7 @@ THREE.ExtrudeGeometry.WorldUVGenerator;(function(){if(p){var a;a=0*B;for(E=0;E<V
|
|
THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].position.x;e=a.vertices[e].position.y;c=a.vertices[f].position.x;f=a.vertices[f].position.y;return[new THREE.UV(a.vertices[d].position.x,1-a.vertices[d].position.y),new THREE.UV(b,1-e),new THREE.UV(c,1-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,g,h){var b=a.vertices[e].position.x,c=a.vertices[e].position.y,e=a.vertices[e].position.z,
|
|
THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].position.x;e=a.vertices[e].position.y;c=a.vertices[f].position.x;f=a.vertices[f].position.y;return[new THREE.UV(a.vertices[d].position.x,1-a.vertices[d].position.y),new THREE.UV(b,1-e),new THREE.UV(c,1-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,g,h){var b=a.vertices[e].position.x,c=a.vertices[e].position.y,e=a.vertices[e].position.z,
|
|
d=a.vertices[f].position.x,l=a.vertices[f].position.y,f=a.vertices[f].position.z,j=a.vertices[g].position.x,k=a.vertices[g].position.y,g=a.vertices[g].position.z,p=a.vertices[h].position.x,m=a.vertices[h].position.y,a=a.vertices[h].position.z;return 0.01>Math.abs(c-l)?[new THREE.UV(b,e),new THREE.UV(d,f),new THREE.UV(j,g),new THREE.UV(p,a)]:[new THREE.UV(c,e),new THREE.UV(l,f),new THREE.UV(k,g),new THREE.UV(m,a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;
|
|
d=a.vertices[f].position.x,l=a.vertices[f].position.y,f=a.vertices[f].position.z,j=a.vertices[g].position.x,k=a.vertices[g].position.y,g=a.vertices[g].position.z,p=a.vertices[h].position.x,m=a.vertices[h].position.y,a=a.vertices[h].position.z;return 0.01>Math.abs(c-l)?[new THREE.UV(b,e),new THREE.UV(d,f),new THREE.UV(j,g),new THREE.UV(p,a)]:[new THREE.UV(c,e),new THREE.UV(l,f),new THREE.UV(k,g),new THREE.UV(m,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.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
|
|
-THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],e=[],f=[],g=(new THREE.Matrix4).makeRotationZ(b),h=0;h<a.length;h++)this.vertices.push(new THREE.Vertex(a[h])),c[h]=a[h].clone(),d[h]=this.vertices.length-1;for(var l=0;l<=this.angle+0.001;l+=b){for(h=0;h<c.length;h++)l<this.angle?(c[h]=g.multiplyVector3(c[h].clone()),this.vertices.push(new THREE.Vertex(c[h])),e[h]=this.vertices.length-1):e=f;0==l&&(f=d);
|
|
|
|
|
|
+THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],e=[],f=[],g=(new THREE.Matrix4).makeRotationZ(b),h=0;h<a.length;h++)this.vertices.push(new THREE.Vertex(a[h])),c[h]=a[h].clone(),d[h]=this.vertices.length-1;for(var l=0;l<=this.angle+0.0010;l+=b){for(h=0;h<c.length;h++)l<this.angle?(c[h]=g.multiplyVector3(c[h].clone()),this.vertices.push(new THREE.Vertex(c[h])),e[h]=this.vertices.length-1):e=f;0==l&&(f=d);
|
|
for(h=0;h<d.length-1;h++)this.faces.push(new THREE.Face4(e[h],e[h+1],d[h+1],d[h])),this.faceVertexUvs[0].push([new THREE.UV(1-l/this.angle,h/a.length),new THREE.UV(1-l/this.angle,(h+1)/a.length),new THREE.UV(1-(l-b)/this.angle,(h+1)/a.length),new THREE.UV(1-(l-b)/this.angle,h/a.length)]);d=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
|
|
for(h=0;h<d.length-1;h++)this.faces.push(new THREE.Face4(e[h],e[h+1],d[h+1],d[h])),this.faceVertexUvs[0].push([new THREE.UV(1-l/this.angle,h/a.length),new THREE.UV(1-l/this.angle,(h+1)/a.length),new THREE.UV(1-(l-b)/this.angle,(h+1)/a.length),new THREE.UV(1-(l-b)/this.angle,h/a.length)]);d=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
|
|
THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var e=a/2,f=b/2,c=c||1,d=d||1,g=c+1,h=d+1,l=a/c,j=b/d,k=new THREE.Vector3(0,1,0),a=0;a<h;a++)for(b=0;b<g;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*l-e,0,a*j-f)));for(a=0;a<d;a++)for(b=0;b<c;b++)e=new THREE.Face4(b+g*a,b+g*(a+1),b+1+g*(a+1),b+1+g*a),e.normal.copy(k),e.vertexNormals.push(k.clone(),k.clone(),k.clone(),k.clone()),this.faces.push(e),this.faceVertexUvs[0].push([new THREE.UV(b/c,a/d),new THREE.UV(b/c,(a+
|
|
THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var e=a/2,f=b/2,c=c||1,d=d||1,g=c+1,h=d+1,l=a/c,j=b/d,k=new THREE.Vector3(0,1,0),a=0;a<h;a++)for(b=0;b<g;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*l-e,0,a*j-f)));for(a=0;a<d;a++)for(b=0;b<c;b++)e=new THREE.Face4(b+g*a,b+g*(a+1),b+1+g*(a+1),b+1+g*a),e.normal.copy(k),e.vertexNormals.push(k.clone(),k.clone(),k.clone(),k.clone()),this.faces.push(e),this.faceVertexUvs[0].push([new THREE.UV(b/c,a/d),new THREE.UV(b/c,(a+
|
|
1)/d),new THREE.UV((b+1)/c,(a+1)/d),new THREE.UV((b+1)/c,a/d)]);this.computeCentroids()};THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
|
|
1)/d),new THREE.UV((b+1)/c,(a+1)/d),new THREE.UV((b+1)/c,a/d)]);this.computeCentroids()};THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
|
|
@@ -758,8 +758,8 @@ b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b
|
|
"color");m.scale=b.getUniformLocation(k,"scale");m.rotation=b.getUniformLocation(k,"rotation");m.screenPosition=b.getUniformLocation(k,"screenPosition");o=!1};this.render=function(a,d,e,s){var a=a.__webglFlares,u=a.length;if(u){var v=new THREE.Vector3,t=s/e,w=0.5*e,z=0.5*s,F=16/s,C=new THREE.Vector2(F*t,F),G=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1),N=m,F=p;b.useProgram(k);o||(b.enableVertexAttribArray(p.vertex),b.enableVertexAttribArray(p.uv),o=!0);b.uniform1i(N.occlusionMap,0);b.uniform1i(N.map,
|
|
"color");m.scale=b.getUniformLocation(k,"scale");m.rotation=b.getUniformLocation(k,"rotation");m.screenPosition=b.getUniformLocation(k,"screenPosition");o=!1};this.render=function(a,d,e,s){var a=a.__webglFlares,u=a.length;if(u){var v=new THREE.Vector3,t=s/e,w=0.5*e,z=0.5*s,F=16/s,C=new THREE.Vector2(F*t,F),G=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1),N=m,F=p;b.useProgram(k);o||(b.enableVertexAttribArray(p.vertex),b.enableVertexAttribArray(p.uv),o=!0);b.uniform1i(N.occlusionMap,0);b.uniform1i(N.map,
|
|
1);b.bindBuffer(b.ARRAY_BUFFER,f);b.vertexAttribPointer(F.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(F.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.disable(b.CULL_FACE);b.depthMask(!1);var P,T,O,J,I;for(P=0;P<u;P++)if(F=16/s,C.set(F*t,F),J=a[P],v.set(J.matrixWorld.n14,J.matrixWorld.n24,J.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(v),d.projectionMatrix.multiplyVector3(v),G.copy(v),K.x=G.x*w+w,K.y=G.y*z+z,j||0<K.x&&K.x<e&&0<K.y&&K.y<s){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,
|
|
1);b.bindBuffer(b.ARRAY_BUFFER,f);b.vertexAttribPointer(F.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(F.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.disable(b.CULL_FACE);b.depthMask(!1);var P,T,O,J,I;for(P=0;P<u;P++)if(F=16/s,C.set(F*t,F),J=a[P],v.set(J.matrixWorld.n14,J.matrixWorld.n24,J.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(v),d.projectionMatrix.multiplyVector3(v),G.copy(v),K.x=G.x*w+w,K.y=G.y*z+z,j||0<K.x&&K.x<e&&0<K.y&&K.y<s){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,
|
|
h);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,K.x-8,K.y-8,16,16,0);b.uniform1i(N.renderType,0);b.uniform2f(N.scale,C.x,C.y);b.uniform3f(N.screenPosition,G.x,G.y,G.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,l);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,K.x-8,K.y-8,16,16,0);b.uniform1i(N.renderType,1);b.disable(b.DEPTH_TEST);b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,h);b.drawElements(b.TRIANGLES,
|
|
h);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,K.x-8,K.y-8,16,16,0);b.uniform1i(N.renderType,0);b.uniform2f(N.scale,C.x,C.y);b.uniform3f(N.screenPosition,G.x,G.y,G.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,l);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,K.x-8,K.y-8,16,16,0);b.uniform1i(N.renderType,1);b.disable(b.DEPTH_TEST);b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,h);b.drawElements(b.TRIANGLES,
|
|
-6,b.UNSIGNED_SHORT,0);J.positionScreen.copy(G);J.customUpdateCallback?J.customUpdateCallback(J):J.updateLensFlares();b.uniform1i(N.renderType,2);b.enable(b.BLEND);for(T=0,O=J.lensFlares.length;T<O;T++)if(I=J.lensFlares[T],0.001<I.opacity&&0.001<I.scale)G.x=I.x,G.y=I.y,G.z=I.z,F=I.size*I.scale/s,C.x=F*t,C.y=F,b.uniform3f(N.screenPosition,G.x,G.y,G.z),b.uniform2f(N.scale,C.x,C.y),b.uniform1f(N.rotation,I.rotation),b.uniform1f(N.opacity,I.opacity),b.uniform3f(N.color,I.color.r,I.color.g,I.color.b),c.setBlending(I.blending,
|
|
|
|
-I.blendEquation,I.blendSrc,I.blendDst),c.setTexture(I.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
|
|
|
|
|
|
+6,b.UNSIGNED_SHORT,0);J.positionScreen.copy(G);J.customUpdateCallback?J.customUpdateCallback(J):J.updateLensFlares();b.uniform1i(N.renderType,2);b.enable(b.BLEND);for(T=0,O=J.lensFlares.length;T<O;T++)if(I=J.lensFlares[T],0.0010<I.opacity&&0.0010<I.scale)G.x=I.x,G.y=I.y,G.z=I.z,F=I.size*I.scale/s,C.x=F*t,C.y=F,b.uniform3f(N.screenPosition,G.x,G.y,G.z),b.uniform2f(N.scale,C.x,C.y),b.uniform1f(N.rotation,I.rotation),b.uniform1f(N.opacity,I.opacity),b.uniform3f(N.color,I.color.r,I.color.g,I.color.b),
|
|
|
|
+c.setBlending(I.blending,I.blendEquation,I.blendSrc,I.blendDst),c.setTexture(I.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
|
|
THREE.ShadowMapPlugin=function(){var a,b,c,d,e=new THREE.Frustum,f=new THREE.Matrix4,g=new THREE.Vector3,h=new THREE.Vector3;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:!0});c._shadowPass=!0;d._shadowPass=!0};this.render=function(a,
|
|
THREE.ShadowMapPlugin=function(){var a,b,c,d,e=new THREE.Frustum,f=new THREE.Matrix4,g=new THREE.Vector3,h=new THREE.Vector3;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:!0});c._shadowPass=!0;d._shadowPass=!0};this.render=function(a,
|
|
c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(l,j){var k,p,m,o,r,n,q,s,u,v=[];o=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.shadowMapCullFrontFaces&&a.cullFace(a.FRONT);b.setDepthTest(!0);for(k=0,p=l.__lights.length;k<p;k++)if(m=l.__lights[k],m.castShadow)if(m instanceof THREE.DirectionalLight&&m.shadowCascade)for(r=0;r<m.shadowCascadeCount;r++){var t;if(m.shadowCascadeArray[r])t=m.shadowCascadeArray[r];else{u=m;q=r;t=new THREE.DirectionalLight;t.isVirtual=
|
|
c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(l,j){var k,p,m,o,r,n,q,s,u,v=[];o=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.shadowMapCullFrontFaces&&a.cullFace(a.FRONT);b.setDepthTest(!0);for(k=0,p=l.__lights.length;k<p;k++)if(m=l.__lights[k],m.castShadow)if(m instanceof THREE.DirectionalLight&&m.shadowCascade)for(r=0;r<m.shadowCascadeCount;r++){var t;if(m.shadowCascadeArray[r])t=m.shadowCascadeArray[r];else{u=m;q=r;t=new THREE.DirectionalLight;t.isVirtual=
|
|
!0;t.onlyShadow=!0;t.castShadow=!0;t.shadowCameraNear=u.shadowCameraNear;t.shadowCameraFar=u.shadowCameraFar;t.shadowCameraLeft=u.shadowCameraLeft;t.shadowCameraRight=u.shadowCameraRight;t.shadowCameraBottom=u.shadowCameraBottom;t.shadowCameraTop=u.shadowCameraTop;t.shadowCameraVisible=u.shadowCameraVisible;t.shadowDarkness=u.shadowDarkness;t.shadowBias=u.shadowCascadeBias[q];t.shadowMapWidth=u.shadowCascadeWidth[q];t.shadowMapHeight=u.shadowCascadeHeight[q];t.pointsWorld=[];t.pointsFrustum=[];s=
|
|
!0;t.onlyShadow=!0;t.castShadow=!0;t.shadowCameraNear=u.shadowCameraNear;t.shadowCameraFar=u.shadowCameraFar;t.shadowCameraLeft=u.shadowCameraLeft;t.shadowCameraRight=u.shadowCameraRight;t.shadowCameraBottom=u.shadowCameraBottom;t.shadowCameraTop=u.shadowCameraTop;t.shadowCameraVisible=u.shadowCameraVisible;t.shadowDarkness=u.shadowDarkness;t.shadowBias=u.shadowCascadeBias[q];t.shadowMapWidth=u.shadowCascadeWidth[q];t.shadowMapHeight=u.shadowCascadeHeight[q];t.pointsWorld=[];t.pointsFrustum=[];s=
|