|
@@ -31,10 +31,10 @@ THREE.EventTarget=function(){var a={};this.addEventListener=function(b,c){a[b]==
|
|
|
THREE.Frustum.prototype.setFromMatrix=function(a){var b=this.planes,c=a.elements,a=c[0],d=c[1],f=c[2],e=c[3],g=c[4],j=c[5],m=c[6],k=c[7],h=c[8],n=c[9],i=c[10],o=c[11],q=c[12],l=c[13],p=c[14],c=c[15];b[0].set(e-a,k-g,o-h,c-q);b[1].set(e+a,k+g,o+h,c+q);b[2].set(e+d,k+j,o+n,c+l);b[3].set(e-d,k-j,o-n,c-l);b[4].set(e-f,k-m,o-i,c-p);b[5].set(e+f,k+m,o+i,c+p);for(d=0;d<6;d++){a=b[d];a.divideScalar(Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z))}};
|
|
|
THREE.Frustum.prototype.contains=function(a){for(var b=0,c=this.planes,b=a.matrixWorld,d=b.elements,a=-a.geometry.boundingSphere.radius*b.getMaxScaleOnAxis(),f=0;f<6;f++){b=c[f].x*d[12]+c[f].y*d[13]+c[f].z*d[14]+c[f].w;if(b<=a)return false}return true};THREE.Frustum.__v1=new THREE.Vector3;
|
|
|
THREE.Ray=function(a,b,c,d){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;this.near=c||0;this.far=d||Infinity;var f=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3,j=new THREE.Vector3,m=new THREE.Vector3,k=new THREE.Vector3,h=new THREE.Vector3,n=new THREE.Vector3,i=new THREE.Vector3,o=function(a,b){return a.distance-b.distance},q=new THREE.Vector3,l=new THREE.Vector3,p=new THREE.Vector3,r,u,v,B=function(a,b,c){q.sub(c,a);r=q.dot(b);u=l.add(a,p.copy(b).multiplyScalar(r));
|
|
|
-return v=c.distanceTo(u)},x,A,y,E,s,w,C,J,L=function(a,b,c,d){q.sub(d,b);l.sub(c,b);p.sub(a,b);x=q.dot(q);A=q.dot(l);y=q.dot(p);E=l.dot(l);s=l.dot(p);w=1/(x*E-A*A);C=(E*y-A*s)*w;J=(x*s-A*y)*w;return C>=0&&J>=0&&C+J<1},M=1.0E-4;this.setPrecision=function(a){M=a};this.intersectObject=function(a,b){var c,d=[];if(b===true)for(var l=0,q=a.children.length;l<q;l++)Array.prototype.push.apply(d,this.intersectObject(a.children[l],b));if(a instanceof THREE.Particle){v=B(this.origin,this.direction,a.matrixWorld.getPosition());
|
|
|
-if(v>a.scale.x)return[];c={distance:v,point:a.position,face:null,object:a};d.push(c)}else if(a instanceof THREE.Mesh){l=THREE.Frustum.__v1.set(a.matrixWorld.getColumnX().length(),a.matrixWorld.getColumnY().length(),a.matrixWorld.getColumnZ().length());l=a.geometry.boundingSphere.radius*Math.max(l.x,Math.max(l.y,l.z));v=B(this.origin,this.direction,a.matrixWorld.getPosition());if(v>l)return d;var z,P,p=a.geometry,r=p.vertices,s;a.matrixRotationWorld.extractRotation(a.matrixWorld);l=0;for(q=p.faces.length;l<
|
|
|
-q;l++){c=p.faces[l];m.copy(this.origin);k.copy(this.direction);s=a.matrixWorld;h=s.multiplyVector3(h.copy(c.centroid)).subSelf(m);n=a.matrixRotationWorld.multiplyVector3(n.copy(c.normal));z=k.dot(n);if(!(Math.abs(z)<M)){P=n.dot(h)/z;if(!(P<0)&&(a.doubleSided||(a.flipSided?z>0:z<0))){i.add(m,k.multiplyScalar(P));v=m.distanceTo(i);if(!(v<this.near)&&!(v>this.far))if(c instanceof THREE.Face3){f=s.multiplyVector3(f.copy(r[c.a]));e=s.multiplyVector3(e.copy(r[c.b]));g=s.multiplyVector3(g.copy(r[c.c]));
|
|
|
-if(L(i,f,e,g)){c={distance:v,point:i.clone(),face:c,object:a};d.push(c)}}else if(c instanceof THREE.Face4){f=s.multiplyVector3(f.copy(r[c.a]));e=s.multiplyVector3(e.copy(r[c.b]));g=s.multiplyVector3(g.copy(r[c.c]));j=s.multiplyVector3(j.copy(r[c.d]));if(L(i,f,e,j)||L(i,e,g,j)){c={distance:v,point:i.clone(),face:c,object:a};d.push(c)}}}}}}d.sort(o);return d};this.intersectObjects=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)Array.prototype.push.apply(c,this.intersectObject(a[d],b));c.sort(o);
|
|
|
+return v=c.distanceTo(u)},x,A,y,E,s,w,C,K,M=function(a,b,c,d){q.sub(d,b);l.sub(c,b);p.sub(a,b);x=q.dot(q);A=q.dot(l);y=q.dot(p);E=l.dot(l);s=l.dot(p);w=1/(x*E-A*A);C=(E*y-A*s)*w;K=(x*s-A*y)*w;return C>=0&&K>=0&&C+K<1},N=1.0E-4;this.setPrecision=function(a){N=a};this.intersectObject=function(a,b){var c,d=[];if(b===true)for(var l=0,q=a.children.length;l<q;l++)Array.prototype.push.apply(d,this.intersectObject(a.children[l],b));if(a instanceof THREE.Particle){v=B(this.origin,this.direction,a.matrixWorld.getPosition());
|
|
|
+if(v>a.scale.x)return[];c={distance:v,point:a.position,face:null,object:a};d.push(c)}else if(a instanceof THREE.Mesh){l=THREE.Frustum.__v1.set(a.matrixWorld.getColumnX().length(),a.matrixWorld.getColumnY().length(),a.matrixWorld.getColumnZ().length());l=a.geometry.boundingSphere.radius*Math.max(l.x,Math.max(l.y,l.z));v=B(this.origin,this.direction,a.matrixWorld.getPosition());if(v>l)return d;var z,p,r=a.geometry,J=r.vertices,s;a.matrixRotationWorld.extractRotation(a.matrixWorld);l=0;for(q=r.faces.length;l<
|
|
|
+q;l++){c=r.faces[l];m.copy(this.origin);k.copy(this.direction);s=a.matrixWorld;h=s.multiplyVector3(h.copy(c.centroid)).subSelf(m);n=a.matrixRotationWorld.multiplyVector3(n.copy(c.normal));z=k.dot(n);if(!(Math.abs(z)<N)){p=n.dot(h)/z;if(!(p<0)&&(a.doubleSided||(a.flipSided?z>0:z<0))){i.add(m,k.multiplyScalar(p));v=m.distanceTo(i);if(!(v<this.near)&&!(v>this.far))if(c instanceof THREE.Face3){f=s.multiplyVector3(f.copy(J[c.a]));e=s.multiplyVector3(e.copy(J[c.b]));g=s.multiplyVector3(g.copy(J[c.c]));
|
|
|
+if(M(i,f,e,g)){c={distance:v,point:i.clone(),face:c,object:a};d.push(c)}}else if(c instanceof THREE.Face4){f=s.multiplyVector3(f.copy(J[c.a]));e=s.multiplyVector3(e.copy(J[c.b]));g=s.multiplyVector3(g.copy(J[c.c]));j=s.multiplyVector3(j.copy(J[c.d]));if(M(i,f,e,j)||M(i,e,g,j)){c={distance:v,point:i.clone(),face:c,object:a};d.push(c)}}}}}}d.sort(o);return d};this.intersectObjects=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)Array.prototype.push.apply(c,this.intersectObject(a[d],b));c.sort(o);
|
|
|
return c}};
|
|
|
THREE.Rectangle=function(){function a(){e=d-b;g=f-c}var b=0,c=0,d=0,f=0,e=0,g=0,j=true;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return e};this.getHeight=function(){return g};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return f};this.set=function(e,g,h,n){j=false;b=e;c=g;d=h;f=n;a()};this.addPoint=function(e,g){if(j===true){j=false;b=e;c=g;d=e;f=g}else{b=b<e?b:e;c=c<g?c:
|
|
|
g;d=d>e?d:e;f=f>g?f:g}a()};this.add3Points=function(e,g,h,n,i,o){if(j===true){j=false;b=e<h?e<i?e:i:h<i?h:i;c=g<n?g<o?g:o:n<o?n:o;d=e>h?e>i?e:i:h>i?h:i;f=g>n?g>o?g:o:n>o?n:o}else{b=e<h?e<i?e<b?e:b:i<b?i:b:h<i?h<b?h:b:i<b?i:b;c=g<n?g<o?g<c?g:c:o<c?o:c:n<o?n<c?n:c:o<c?o:c;d=e>h?e>i?e>d?e:d:i>d?i:d:h>i?h>d?h:d:i>d?i:d;f=g>n?g>o?g>f?g:f:o>f?o:f:n>o?n>f?n:f:o>f?o:f}a()};this.addRectangle=function(e){if(j===true){j=false;b=e.getLeft();c=e.getTop();d=e.getRight();f=e.getBottom()}else{b=b<e.getLeft()?b:e.getLeft();
|
|
@@ -44,7 +44,7 @@ THREE.Matrix3.prototype={constructor:THREE.Matrix3,getInverse:function(a){var b=
|
|
|
transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};THREE.Matrix4=function(a,b,c,d,f,e,g,j,m,k,h,n,i,o,q,l){this.elements=new Float32Array(16);this.set(a!==void 0?a:1,b||0,c||0,d||0,f||0,e!==void 0?e:1,g||0,j||0,m||0,k||0,h!==void 0?h:1,n||0,i||0,o||0,q||0,l!==void 0?l:1)};
|
|
|
THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,f,e,g,j,m,k,h,n,i,o,q,l){var p=this.elements;p[0]=a;p[4]=b;p[8]=c;p[12]=d;p[1]=f;p[5]=e;p[9]=g;p[13]=j;p[2]=m;p[6]=k;p[10]=h;p[14]=n;p[3]=i;p[7]=o;p[11]=q;p[15]=l;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15]);return this},lookAt:function(a,b,c){var d=this.elements,
|
|
|
f=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;f.cross(c,g).normalize();if(f.length()===0){g.x=g.x+1.0E-4;f.cross(c,g).normalize()}e.cross(g,f);d[0]=f.x;d[4]=e.x;d[8]=g.x;d[1]=f.y;d[5]=e.y;d[9]=g.y;d[2]=f.z;d[6]=e.z;d[10]=g.z;return this},multiply:function(a,b){var c=a.elements,d=b.elements,f=this.elements,e=c[0],g=c[4],j=c[8],m=c[12],k=c[1],h=c[5],n=c[9],i=c[13],o=c[2],q=c[6],l=c[10],p=c[14],r=c[3],u=c[7],v=c[11],c=c[15],B=d[0],x=d[4],
|
|
|
-A=d[8],y=d[12],E=d[1],s=d[5],w=d[9],C=d[13],J=d[2],L=d[6],M=d[10],t=d[14],G=d[3],I=d[7],N=d[11],d=d[15];f[0]=e*B+g*E+j*J+m*G;f[4]=e*x+g*s+j*L+m*I;f[8]=e*A+g*w+j*M+m*N;f[12]=e*y+g*C+j*t+m*d;f[1]=k*B+h*E+n*J+i*G;f[5]=k*x+h*s+n*L+i*I;f[9]=k*A+h*w+n*M+i*N;f[13]=k*y+h*C+n*t+i*d;f[2]=o*B+q*E+l*J+p*G;f[6]=o*x+q*s+l*L+p*I;f[10]=o*A+q*w+l*M+p*N;f[14]=o*y+q*C+l*t+p*d;f[3]=r*B+u*E+v*J+c*G;f[7]=r*x+u*s+v*L+c*I;f[11]=r*A+u*w+v*M+c*N;f[15]=r*y+u*C+v*t+c*d;return this},multiplySelf:function(a){return this.multiply(this,
|
|
|
+A=d[8],y=d[12],E=d[1],s=d[5],w=d[9],C=d[13],K=d[2],M=d[6],N=d[10],t=d[14],G=d[3],I=d[7],O=d[11],d=d[15];f[0]=e*B+g*E+j*K+m*G;f[4]=e*x+g*s+j*M+m*I;f[8]=e*A+g*w+j*N+m*O;f[12]=e*y+g*C+j*t+m*d;f[1]=k*B+h*E+n*K+i*G;f[5]=k*x+h*s+n*M+i*I;f[9]=k*A+h*w+n*N+i*O;f[13]=k*y+h*C+n*t+i*d;f[2]=o*B+q*E+l*K+p*G;f[6]=o*x+q*s+l*M+p*I;f[10]=o*A+q*w+l*N+p*O;f[14]=o*y+q*C+l*t+p*d;f[3]=r*B+u*E+v*K+c*G;f[7]=r*x+u*s+v*M+c*I;f[11]=r*A+u*w+v*N+c*O;f[15]=r*y+u*C+v*t+c*d;return this},multiplySelf:function(a){return this.multiply(this,
|
|
|
a)},multiplyToArray:function(a,b,c){var d=this.elements;this.multiply(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]=b[0]*a;b[4]=b[4]*a;b[8]=b[8]*a;b[12]=b[12]*a;b[1]=b[1]*a;b[5]=b[5]*a;b[9]=b[9]*a;b[13]=b[13]*a;b[2]=b[2]*a;b[6]=b[6]*a;b[10]=b[10]*a;b[14]=b[14]*a;b[3]=b[3]*a;b[7]=b[7]*a;b[11]=b[11]*a;b[15]=
|
|
|
b[15]*a;return this},multiplyVector3:function(a){var b=this.elements,c=a.x,d=a.y,f=a.z,e=1/(b[3]*c+b[7]*d+b[11]*f+b[15]);a.x=(b[0]*c+b[4]*d+b[8]*f+b[12])*e;a.y=(b[1]*c+b[5]*d+b[9]*f+b[13])*e;a.z=(b[2]*c+b[6]*d+b[10]*f+b[14])*e;return a},multiplyVector4:function(a){var b=this.elements,c=a.x,d=a.y,f=a.z,e=a.w;a.x=b[0]*c+b[4]*d+b[8]*f+b[12]*e;a.y=b[1]*c+b[5]*d+b[9]*f+b[13]*e;a.z=b[2]*c+b[6]*d+b[10]*f+b[14]*e;a.w=b[3]*c+b[7]*d+b[11]*f+b[15]*e;return a},multiplyVector3Array:function(a){for(var b=THREE.Matrix4.__v1,
|
|
|
c=0,d=a.length;c<d;c=c+3){b.x=a[c];b.y=a[c+1];b.z=a[c+2];this.multiplyVector3(b);a[c]=b.x;a[c+1]=b.y;a[c+2]=b.z}return a},rotateAxis:function(a){var b=this.elements,c=a.x,d=a.y,f=a.z;a.x=c*b[0]+d*b[4]+f*b[8];a.y=c*b[1]+d*b[5]+f*b[9];a.z=c*b[2]+d*b[6]+f*b[10];a.normalize();return a},crossVector:function(a){var b=this.elements,c=new THREE.Vector4;c.x=b[0]*a.x+b[4]*a.y+b[8]*a.z+b[12]*a.w;c.y=b[1]*a.x+b[5]*a.y+b[9]*a.z+b[13]*a.w;c.z=b[2]*a.x+b[6]*a.y+b[10]*a.z+b[14]*a.w;c.w=a.w?b[3]*a.x+b[7]*a.y+b[11]*
|
|
@@ -75,15 +75,15 @@ this.useQuaternion===true?this.matrix.setRotationFromQuaternion(this.quaternion)
|
|
|
this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false;a=true}for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},worldToLocal:function(a){return THREE.Object3D.__m1.getInverse(this.matrixWorld).multiplyVector3(a)},localToWorld:function(a){return this.matrixWorld.multiplyVector3(a)}};THREE.Object3D.__m1=new THREE.Matrix4;THREE.Object3DCount=0;
|
|
|
THREE.Projector=function(){function a(a,c){g=0;A.objects.length=0;A.sprites.length=0;A.lights.length=0;var f=function(a){if(a.visible!==false){if((a instanceof THREE.Mesh||a instanceof THREE.Line)&&(a.frustumCulled===false||C.contains(a)===true)){y.copy(a.matrixWorld.getPosition());s.multiplyVector3(y);e=b();e.object=a;e.z=y.z;A.objects.push(e)}else if(a instanceof THREE.Sprite||a instanceof THREE.Particle){y.copy(a.matrixWorld.getPosition());s.multiplyVector3(y);e=b();e.object=a;e.z=y.z;A.sprites.push(e)}else a instanceof
|
|
|
THREE.Light&&A.lights.push(a);for(var c=0,d=a.children.length;c<d;c++)f(a.children[c])}};f(a);c===true&&A.objects.sort(d);return A}function b(){var a;if(g===j.length){a=new THREE.RenderableObject;j.push(a)}else a=j[g];g++;return a}function c(){var a;if(k===h.length){a=new THREE.RenderableVertex;h.push(a)}else a=h[k];k++;return a}function d(a,b){return b.z-a.z}function f(a,b){var c=0,d=1,e=a.z+a.w,g=b.z+b.w,f=-a.z+a.w,h=-b.z+b.w;if(e>=0&&g>=0&&f>=0&&h>=0)return true;if(e<0&&g<0||f<0&&h<0)return false;
|
|
|
-e<0?c=Math.max(c,e/(e-g)):g<0&&(d=Math.min(d,e/(e-g)));f<0?c=Math.max(c,f/(f-h)):h<0&&(d=Math.min(d,f/(f-h)));if(d<c)return false;a.lerpSelf(b,c);b.lerpSelf(a,1-d);return true}var e,g,j=[],m,k,h=[],n,i,o=[],q,l=[],p,r,u=[],v,B,x=[],A={objects:[],sprites:[],lights:[],elements:[]},y=new THREE.Vector3,E=new THREE.Vector4,s=new THREE.Matrix4,w=new THREE.Matrix4,C=new THREE.Frustum,J=new THREE.Vector4,L=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);s.multiply(b.projectionMatrix,
|
|
|
-b.matrixWorldInverse);s.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);s.multiply(b.matrixWorld,b.projectionMatrixInverse);s.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectScene=function(b,e,g){var j=e.near,y=e.far,Q=false,S,z,P,$,O,U,T,D,F,H,K,R,ja,ka,Y,
|
|
|
-ca,aa;B=r=q=i=0;A.elements.length=0;b.updateMatrixWorld();e.parent===void 0&&e.updateMatrixWorld();e.matrixWorldInverse.getInverse(e.matrixWorld);s.multiply(e.projectionMatrix,e.matrixWorldInverse);C.setFromMatrix(s);A=a(b,false);b=0;for(S=A.objects.length;b<S;b++){F=A.objects[b].object;H=F.matrixWorld;k=0;if(F instanceof THREE.Mesh){K=F.geometry;R=F.geometry.materials;$=K.vertices;ja=K.faces;ka=K.faceVertexUvs;K=F.matrixRotationWorld.extractRotation(H);ca=F.material.flipSided;aa=F.material.doubleSided;
|
|
|
-z=0;for(P=$.length;z<P;z++){m=c();m.positionWorld.copy($[z]);H.multiplyVector3(m.positionWorld);m.positionScreen.copy(m.positionWorld);s.multiplyVector4(m.positionScreen);m.positionScreen.x=m.positionScreen.x/m.positionScreen.w;m.positionScreen.y=m.positionScreen.y/m.positionScreen.w;m.visible=m.positionScreen.z>j&&m.positionScreen.z<y}$=0;for(z=ja.length;$<z;$++){P=ja[$];if(P instanceof THREE.Face3){O=h[P.a];U=h[P.b];T=h[P.c];if(O.visible===true&&U.visible===true&&T.visible===true){Q=(T.positionScreen.x-
|
|
|
-O.positionScreen.x)*(U.positionScreen.y-O.positionScreen.y)-(T.positionScreen.y-O.positionScreen.y)*(U.positionScreen.x-O.positionScreen.x)<0;if(aa===true||Q!==ca){D=void 0;if(i===o.length){D=new THREE.RenderableFace3;o.push(D)}else D=o[i];i++;n=D;n.v1.copy(O);n.v2.copy(U);n.v3.copy(T)}else continue}else continue}else if(P instanceof THREE.Face4){O=h[P.a];U=h[P.b];T=h[P.c];D=h[P.d];if(O.visible===true&&U.visible===true&&T.visible===true&&D.visible===true){Q=(D.positionScreen.x-O.positionScreen.x)*
|
|
|
-(U.positionScreen.y-O.positionScreen.y)-(D.positionScreen.y-O.positionScreen.y)*(U.positionScreen.x-O.positionScreen.x)<0||(U.positionScreen.x-T.positionScreen.x)*(D.positionScreen.y-T.positionScreen.y)-(U.positionScreen.y-T.positionScreen.y)*(D.positionScreen.x-T.positionScreen.x)<0;if(aa===true||Q!==ca){Y=void 0;if(q===l.length){Y=new THREE.RenderableFace4;l.push(Y)}else Y=l[q];q++;n=Y;n.v1.copy(O);n.v2.copy(U);n.v3.copy(T);n.v4.copy(D)}else continue}else continue}n.normalWorld.copy(P.normal);Q===
|
|
|
-false&&(ca===true||aa===true)&&n.normalWorld.negate();K.multiplyVector3(n.normalWorld);n.centroidWorld.copy(P.centroid);H.multiplyVector3(n.centroidWorld);n.centroidScreen.copy(n.centroidWorld);s.multiplyVector3(n.centroidScreen);T=P.vertexNormals;O=0;for(U=T.length;O<U;O++){D=n.vertexNormalsWorld[O];D.copy(T[O]);Q===false&&(ca===true||aa===true)&&D.negate();K.multiplyVector3(D)}O=0;for(U=ka.length;O<U;O++){Y=ka[O][$];if(Y!==void 0){T=0;for(D=Y.length;T<D;T++)n.uvs[O][T]=Y[T]}}n.material=F.material;
|
|
|
-n.faceMaterial=P.materialIndex!==null?R[P.materialIndex]:null;n.z=n.centroidScreen.z;A.elements.push(n)}}else if(F instanceof THREE.Line){w.multiply(s,H);$=F.geometry.vertices;O=c();O.positionScreen.copy($[0]);w.multiplyVector4(O.positionScreen);H=F.type===THREE.LinePieces?2:1;z=1;for(P=$.length;z<P;z++){O=c();O.positionScreen.copy($[z]);w.multiplyVector4(O.positionScreen);if(!((z+1)%H>0)){U=h[k-2];J.copy(O.positionScreen);L.copy(U.positionScreen);if(f(J,L)===true){J.multiplyScalar(1/J.w);L.multiplyScalar(1/
|
|
|
-L.w);R=void 0;if(r===u.length){R=new THREE.RenderableLine;u.push(R)}else R=u[r];r++;p=R;p.v1.positionScreen.copy(J);p.v2.positionScreen.copy(L);p.z=Math.max(J.z,L.z);p.material=F.material;A.elements.push(p)}}}}}b=0;for(S=A.sprites.length;b<S;b++){F=A.sprites[b].object;H=F.matrixWorld;if(F instanceof THREE.Particle){E.set(H.elements[12],H.elements[13],H.elements[14],1);s.multiplyVector4(E);E.z=E.z/E.w;if(E.z>0&&E.z<1){j=void 0;if(B===x.length){j=new THREE.RenderableParticle;x.push(j)}else j=x[B];B++;
|
|
|
+e<0?c=Math.max(c,e/(e-g)):g<0&&(d=Math.min(d,e/(e-g)));f<0?c=Math.max(c,f/(f-h)):h<0&&(d=Math.min(d,f/(f-h)));if(d<c)return false;a.lerpSelf(b,c);b.lerpSelf(a,1-d);return true}var e,g,j=[],m,k,h=[],n,i,o=[],q,l=[],p,r,u=[],v,B,x=[],A={objects:[],sprites:[],lights:[],elements:[]},y=new THREE.Vector3,E=new THREE.Vector4,s=new THREE.Matrix4,w=new THREE.Matrix4,C=new THREE.Frustum,K=new THREE.Vector4,M=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);s.multiply(b.projectionMatrix,
|
|
|
+b.matrixWorldInverse);s.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);s.multiply(b.matrixWorld,b.projectionMatrixInverse);s.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectScene=function(b,e,g){var j=e.near,y=e.far,P=false,R,z,S,$,J,U,T,D,F,H,L,Q,ja,ka,Y,
|
|
|
+ca,aa;B=r=q=i=0;A.elements.length=0;b.updateMatrixWorld();e.parent===void 0&&e.updateMatrixWorld();e.matrixWorldInverse.getInverse(e.matrixWorld);s.multiply(e.projectionMatrix,e.matrixWorldInverse);C.setFromMatrix(s);A=a(b,false);b=0;for(R=A.objects.length;b<R;b++){F=A.objects[b].object;H=F.matrixWorld;k=0;if(F instanceof THREE.Mesh){L=F.geometry;Q=F.geometry.materials;$=L.vertices;ja=L.faces;ka=L.faceVertexUvs;L=F.matrixRotationWorld.extractRotation(H);ca=F.material.flipSided;aa=F.material.doubleSided;
|
|
|
+z=0;for(S=$.length;z<S;z++){m=c();m.positionWorld.copy($[z]);H.multiplyVector3(m.positionWorld);m.positionScreen.copy(m.positionWorld);s.multiplyVector4(m.positionScreen);m.positionScreen.x=m.positionScreen.x/m.positionScreen.w;m.positionScreen.y=m.positionScreen.y/m.positionScreen.w;m.visible=m.positionScreen.z>j&&m.positionScreen.z<y}$=0;for(z=ja.length;$<z;$++){S=ja[$];if(S instanceof THREE.Face3){J=h[S.a];U=h[S.b];T=h[S.c];if(J.visible===true&&U.visible===true&&T.visible===true){P=(T.positionScreen.x-
|
|
|
+J.positionScreen.x)*(U.positionScreen.y-J.positionScreen.y)-(T.positionScreen.y-J.positionScreen.y)*(U.positionScreen.x-J.positionScreen.x)<0;if(aa===true||P!==ca){D=void 0;if(i===o.length){D=new THREE.RenderableFace3;o.push(D)}else D=o[i];i++;n=D;n.v1.copy(J);n.v2.copy(U);n.v3.copy(T)}else continue}else continue}else if(S instanceof THREE.Face4){J=h[S.a];U=h[S.b];T=h[S.c];D=h[S.d];if(J.visible===true&&U.visible===true&&T.visible===true&&D.visible===true){P=(D.positionScreen.x-J.positionScreen.x)*
|
|
|
+(U.positionScreen.y-J.positionScreen.y)-(D.positionScreen.y-J.positionScreen.y)*(U.positionScreen.x-J.positionScreen.x)<0||(U.positionScreen.x-T.positionScreen.x)*(D.positionScreen.y-T.positionScreen.y)-(U.positionScreen.y-T.positionScreen.y)*(D.positionScreen.x-T.positionScreen.x)<0;if(aa===true||P!==ca){Y=void 0;if(q===l.length){Y=new THREE.RenderableFace4;l.push(Y)}else Y=l[q];q++;n=Y;n.v1.copy(J);n.v2.copy(U);n.v3.copy(T);n.v4.copy(D)}else continue}else continue}n.normalWorld.copy(S.normal);P===
|
|
|
+false&&(ca===true||aa===true)&&n.normalWorld.negate();L.multiplyVector3(n.normalWorld);n.centroidWorld.copy(S.centroid);H.multiplyVector3(n.centroidWorld);n.centroidScreen.copy(n.centroidWorld);s.multiplyVector3(n.centroidScreen);T=S.vertexNormals;J=0;for(U=T.length;J<U;J++){D=n.vertexNormalsWorld[J];D.copy(T[J]);P===false&&(ca===true||aa===true)&&D.negate();L.multiplyVector3(D)}J=0;for(U=ka.length;J<U;J++){Y=ka[J][$];if(Y!==void 0){T=0;for(D=Y.length;T<D;T++)n.uvs[J][T]=Y[T]}}n.material=F.material;
|
|
|
+n.faceMaterial=S.materialIndex!==null?Q[S.materialIndex]:null;n.z=n.centroidScreen.z;A.elements.push(n)}}else if(F instanceof THREE.Line){w.multiply(s,H);$=F.geometry.vertices;J=c();J.positionScreen.copy($[0]);w.multiplyVector4(J.positionScreen);H=F.type===THREE.LinePieces?2:1;z=1;for(S=$.length;z<S;z++){J=c();J.positionScreen.copy($[z]);w.multiplyVector4(J.positionScreen);if(!((z+1)%H>0)){U=h[k-2];K.copy(J.positionScreen);M.copy(U.positionScreen);if(f(K,M)===true){K.multiplyScalar(1/K.w);M.multiplyScalar(1/
|
|
|
+M.w);Q=void 0;if(r===u.length){Q=new THREE.RenderableLine;u.push(Q)}else Q=u[r];r++;p=Q;p.v1.positionScreen.copy(K);p.v2.positionScreen.copy(M);p.z=Math.max(K.z,M.z);p.material=F.material;A.elements.push(p)}}}}}b=0;for(R=A.sprites.length;b<R;b++){F=A.sprites[b].object;H=F.matrixWorld;if(F instanceof THREE.Particle){E.set(H.elements[12],H.elements[13],H.elements[14],1);s.multiplyVector4(E);E.z=E.z/E.w;if(E.z>0&&E.z<1){j=void 0;if(B===x.length){j=new THREE.RenderableParticle;x.push(j)}else j=x[B];B++;
|
|
|
v=j;v.object=F;v.x=E.x/E.w;v.y=E.y/E.w;v.z=E.z;v.rotation=F.rotation.z;v.scale.x=F.scale.x*Math.abs(v.x-(E.x+e.projectionMatrix.elements[0])/(E.w+e.projectionMatrix.elements[12]));v.scale.y=F.scale.y*Math.abs(v.y-(E.y+e.projectionMatrix.elements[5])/(E.w+e.projectionMatrix.elements[13]));v.material=F.material;A.elements.push(v)}}}g&&A.elements.sort(d);return A}};THREE.Quaternion=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?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,b){var c=Math.cos(a.x/2),d=Math.cos(a.y/2),f=Math.cos(a.z/2),e=Math.sin(a.x/2),g=Math.sin(a.y/2),j=Math.sin(a.z/2);if(b===void 0||b==="XYZ"){this.x=e*d*f+c*g*j;this.y=c*g*f-e*d*j;this.z=c*d*j+e*g*f;this.w=c*d*f-e*g*j}else if(b==="YXZ"){this.x=e*d*f+c*g*j;this.y=c*g*f-e*d*j;this.z=
|
|
|
c*d*j-e*g*f;this.w=c*d*f+e*g*j}else if(b==="ZXY"){this.x=e*d*f-c*g*j;this.y=c*g*f+e*d*j;this.z=c*d*j+e*g*f;this.w=c*d*f-e*g*j}else if(b==="ZYX"){this.x=e*d*f-c*g*j;this.y=c*g*f+e*d*j;this.z=c*d*j-e*g*f;this.w=c*d*f+e*g*j}else if(b==="YZX"){this.x=e*d*f+c*g*j;this.y=c*g*f+e*d*j;this.z=c*d*j-e*g*f;this.w=c*d*f-e*g*j}else if(b==="XZY"){this.x=e*d*f-c*g*j;this.y=c*g*f-e*d*j;this.z=c*d*j+e*g*f;this.w=c*d*f+e*g*j}return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this.x=a.x*d;this.y=a.y*
|
|
@@ -107,9 +107,9 @@ for(b=this.vertices.length;a<b;a++)d[a].normalize();a=0;for(b=this.faces.length;
|
|
|
f.__originalFaceNormal.copy(f.normal):f.__originalFaceNormal=f.normal.clone();if(!f.__originalVertexNormals)f.__originalVertexNormals=[];a=0;for(b=f.vertexNormals.length;a<b;a++)f.__originalVertexNormals[a]?f.__originalVertexNormals[a].copy(f.vertexNormals[a]):f.__originalVertexNormals[a]=f.vertexNormals[a].clone()}var e=new THREE.Geometry;e.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=
|
|
|
[];var g=this.morphNormals[a].faceNormals,j=this.morphNormals[a].vertexNormals,m,k;c=0;for(d=this.faces.length;c<d;c++){f=this.faces[c];m=new THREE.Vector3;k=f instanceof THREE.Face3?{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3}:{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3,d:new THREE.Vector3};g.push(m);j.push(k)}}g=this.morphNormals[a];e.vertices=this.morphTargets[a].vertices;e.computeFaceNormals();e.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++){f=this.faces[c];
|
|
|
m=g.faceNormals[c];k=g.vertexNormals[c];m.copy(f.normal);if(f instanceof THREE.Face3){k.a.copy(f.vertexNormals[0]);k.b.copy(f.vertexNormals[1]);k.c.copy(f.vertexNormals[2])}else{k.a.copy(f.vertexNormals[0]);k.b.copy(f.vertexNormals[1]);k.c.copy(f.vertexNormals[2]);k.d.copy(f.vertexNormals[3])}}}c=0;for(d=this.faces.length;c<d;c++){f=this.faces[c];f.normal=f.__originalFaceNormal;f.vertexNormals=f.__originalVertexNormals}},computeTangents:function(){function a(a,b,c,d,e,f,t){j=a.vertices[b];m=a.vertices[c];
|
|
|
-k=a.vertices[d];h=g[e];n=g[f];i=g[t];o=m.x-j.x;q=k.x-j.x;l=m.y-j.y;p=k.y-j.y;r=m.z-j.z;u=k.z-j.z;v=n.u-h.u;B=i.u-h.u;x=n.v-h.v;A=i.v-h.v;y=1/(v*A-B*x);C.set((A*o-x*q)*y,(A*l-x*p)*y,(A*r-x*u)*y);J.set((v*q-B*o)*y,(v*p-B*l)*y,(v*u-B*r)*y);s[b].addSelf(C);s[c].addSelf(C);s[d].addSelf(C);w[b].addSelf(J);w[c].addSelf(J);w[d].addSelf(J)}var b,c,d,f,e,g,j,m,k,h,n,i,o,q,l,p,r,u,v,B,x,A,y,E,s=[],w=[],C=new THREE.Vector3,J=new THREE.Vector3,L=new THREE.Vector3,M=new THREE.Vector3,t=new THREE.Vector3;b=0;for(c=
|
|
|
-this.vertices.length;b<c;b++){s[b]=new THREE.Vector3;w[b]=new THREE.Vector3}b=0;for(c=this.faces.length;b<c;b++){e=this.faces[b];g=this.faceVertexUvs[0][b];if(e instanceof THREE.Face3)a(this,e.a,e.b,e.c,0,1,2);else if(e instanceof THREE.Face4){a(this,e.a,e.b,e.d,0,1,3);a(this,e.b,e.c,e.d,1,2,3)}}var G=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){e=this.faces[b];for(d=0;d<e.vertexNormals.length;d++){t.copy(e.vertexNormals[d]);f=e[G[d]];E=s[f];L.copy(E);L.subSelf(t.multiplyScalar(t.dot(E))).normalize();
|
|
|
-M.cross(e.vertexNormals[d],E);f=M.dot(w[f]);f=f<0?-1:1;e.vertexTangents[d]=new THREE.Vector4(L.x,L.y,L.z,f)}}this.hasTangents=true},computeBoundingBox:function(){if(!this.boundingBox)this.boundingBox={min:new THREE.Vector3,max:new THREE.Vector3};if(this.vertices.length>0){var a;a=this.vertices[0];this.boundingBox.min.copy(a);this.boundingBox.max.copy(a);for(var b=this.boundingBox.min,c=this.boundingBox.max,d=1,f=this.vertices.length;d<f;d++){a=this.vertices[d];if(a.x<b.x)b.x=a.x;else if(a.x>c.x)c.x=
|
|
|
+k=a.vertices[d];h=g[e];n=g[f];i=g[t];o=m.x-j.x;q=k.x-j.x;l=m.y-j.y;p=k.y-j.y;r=m.z-j.z;u=k.z-j.z;v=n.u-h.u;B=i.u-h.u;x=n.v-h.v;A=i.v-h.v;y=1/(v*A-B*x);C.set((A*o-x*q)*y,(A*l-x*p)*y,(A*r-x*u)*y);K.set((v*q-B*o)*y,(v*p-B*l)*y,(v*u-B*r)*y);s[b].addSelf(C);s[c].addSelf(C);s[d].addSelf(C);w[b].addSelf(K);w[c].addSelf(K);w[d].addSelf(K)}var b,c,d,f,e,g,j,m,k,h,n,i,o,q,l,p,r,u,v,B,x,A,y,E,s=[],w=[],C=new THREE.Vector3,K=new THREE.Vector3,M=new THREE.Vector3,N=new THREE.Vector3,t=new THREE.Vector3;b=0;for(c=
|
|
|
+this.vertices.length;b<c;b++){s[b]=new THREE.Vector3;w[b]=new THREE.Vector3}b=0;for(c=this.faces.length;b<c;b++){e=this.faces[b];g=this.faceVertexUvs[0][b];if(e instanceof THREE.Face3)a(this,e.a,e.b,e.c,0,1,2);else if(e instanceof THREE.Face4){a(this,e.a,e.b,e.d,0,1,3);a(this,e.b,e.c,e.d,1,2,3)}}var G=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){e=this.faces[b];for(d=0;d<e.vertexNormals.length;d++){t.copy(e.vertexNormals[d]);f=e[G[d]];E=s[f];M.copy(E);M.subSelf(t.multiplyScalar(t.dot(E))).normalize();
|
|
|
+N.cross(e.vertexNormals[d],E);f=N.dot(w[f]);f=f<0?-1:1;e.vertexTangents[d]=new THREE.Vector4(M.x,M.y,M.z,f)}}this.hasTangents=true},computeBoundingBox:function(){if(!this.boundingBox)this.boundingBox={min:new THREE.Vector3,max:new THREE.Vector3};if(this.vertices.length>0){var a;a=this.vertices[0];this.boundingBox.min.copy(a);this.boundingBox.max.copy(a);for(var b=this.boundingBox.min,c=this.boundingBox.max,d=1,f=this.vertices.length;d<f;d++){a=this.vertices[d];if(a.x<b.x)b.x=a.x;else if(a.x>c.x)c.x=
|
|
|
a.x;if(a.y<b.y)b.y=a.y;else if(a.y>c.y)c.y=a.y;if(a.z<b.z)b.z=a.z;else if(a.z>c.z)c.z=a.z}}else{this.boundingBox.min.set(0,0,0);this.boundingBox.max.set(0,0,0)}},computeBoundingSphere:function(){if(!this.boundingSphere)this.boundingSphere={radius:0};for(var a,b=0,c=0,d=this.vertices.length;c<d;c++){a=this.vertices[c].length();a>b&&(b=a)}this.boundingSphere.radius=b},mergeVertices:function(){var a={},b=[],c=[],d,f=Math.pow(10,4),e,g,j,m;e=0;for(g=this.vertices.length;e<g;e++){d=this.vertices[e];d=
|
|
|
[Math.round(d.x*f),Math.round(d.y*f),Math.round(d.z*f)].join("_");if(a[d]===void 0){a[d]=e;b.push(this.vertices[e]);c[e]=b.length-1}else c[e]=c[a[d]]}e=0;for(g=this.faces.length;e<g;e++){a=this.faces[e];if(a instanceof THREE.Face3){a.a=c[a.a];a.b=c[a.b];a.c=c[a.c]}else if(a instanceof THREE.Face4){a.a=c[a.a];a.b=c[a.b];a.c=c[a.c];a.d=c[a.d];d=[a.a,a.b,a.c,a.d];for(f=3;f>0;f--)if(d.indexOf(a["abcd"[f]])!==f){d.splice(f,1);this.faces[e]=new THREE.Face3(d[0],d[1],d[2],a.normal,a.color,a.materialIndex);
|
|
|
d=0;for(j=this.faceVertexUvs.length;d<j;d++)(m=this.faceVertexUvs[d][e])&&m.splice(f,1);this.faces[e].vertexColors=a.vertexColors;break}}}c=this.vertices.length-b.length;this.vertices=b;return c}};THREE.GeometryCount=0;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);
|
|
@@ -133,15 +133,15 @@ new THREE[m](k);if(a.DbgName!==void 0)k.name=a.DbgName;return k}};THREE.BinaryLo
|
|
|
THREE.BinaryLoader.prototype.loadAjaxJSON=function(a,b,c,d,f,e){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(g.readyState==4)if(g.status==200||g.status==0){var j=JSON.parse(g.responseText);a.loadAjaxBuffers(j,c,f,d,e)}else console.error("THREE.BinaryLoader: Couldn't load ["+b+"] ["+g.status+"]")};g.open("GET",b,true);g.overrideMimeType&&g.overrideMimeType("text/plain; charset=x-user-defined");g.setRequestHeader("Content-Type","text/plain");g.send(null)};
|
|
|
THREE.BinaryLoader.prototype.loadAjaxBuffers=function(a,b,c,d,f){var e=new XMLHttpRequest,g=c+"/"+a.buffers,j=0;e.onreadystatechange=function(){if(e.readyState==4)e.status==200||e.status==0?THREE.BinaryLoader.prototype.createBinModel(e.response,b,d,a.materials):console.error("THREE.BinaryLoader: Couldn't load ["+g+"] ["+e.status+"]");else if(e.readyState==3){if(f){j==0&&(j=e.getResponseHeader("Content-Length"));f({total:j,loaded:e.responseText.length})}}else e.readyState==2&&(j=e.getResponseHeader("Content-Length"))};
|
|
|
e.open("GET",g,true);e.responseType="arraybuffer";e.send(null)};
|
|
|
-THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,d){var f=function(b){var c,f,m,k,h,n,i,o,q,l,p,r,u,v,B;function x(a){return a%4?4-a%4:0}function A(a,b){return(new Uint8Array(a,b,1))[0]}function y(a,b){return(new Uint32Array(a,b,1))[0]}function E(b,c){var d,e,g,f,h,j,k,m,l=new Uint32Array(a,c,3*b);for(d=0;d<b;d++){e=l[d*3];g=l[d*3+1];f=l[d*3+2];h=I[e*2];e=I[e*2+1];j=I[g*2];k=I[g*2+1];g=I[f*2];m=I[f*2+1];f=M.faceVertexUvs[0];var i=[];i.push(new THREE.UV(h,e));i.push(new THREE.UV(j,k));i.push(new THREE.UV(g,
|
|
|
-m));f.push(i)}}function s(b,c){var d,e,g,f,h,j,k,m,l,i,n=new Uint32Array(a,c,4*b);for(d=0;d<b;d++){e=n[d*4];g=n[d*4+1];f=n[d*4+2];h=n[d*4+3];j=I[e*2];e=I[e*2+1];k=I[g*2];l=I[g*2+1];m=I[f*2];i=I[f*2+1];f=I[h*2];g=I[h*2+1];h=M.faceVertexUvs[0];var o=[];o.push(new THREE.UV(j,e));o.push(new THREE.UV(k,l));o.push(new THREE.UV(m,i));o.push(new THREE.UV(f,g));h.push(o)}}function w(b,c,d){for(var e,g,f,h,c=new Uint32Array(a,c,3*b),j=new Uint16Array(a,d,b),d=0;d<b;d++){e=c[d*3];g=c[d*3+1];f=c[d*3+2];h=j[d];
|
|
|
-M.faces.push(new THREE.Face3(e,g,f,null,null,h))}}function C(b,c,d){for(var e,g,f,h,j,c=new Uint32Array(a,c,4*b),k=new Uint16Array(a,d,b),d=0;d<b;d++){e=c[d*4];g=c[d*4+1];f=c[d*4+2];h=c[d*4+3];j=k[d];M.faces.push(new THREE.Face4(e,g,f,h,null,null,j))}}function J(b,c,d,e){for(var g,f,h,j,k,m,l,c=new Uint32Array(a,c,3*b),d=new Uint32Array(a,d,3*b),i=new Uint16Array(a,e,b),e=0;e<b;e++){g=c[e*3];f=c[e*3+1];h=c[e*3+2];k=d[e*3];m=d[e*3+1];l=d[e*3+2];j=i[e];var n=G[m*3],o=G[m*3+1];m=G[m*3+2];var p=G[l*3],
|
|
|
-q=G[l*3+1];l=G[l*3+2];M.faces.push(new THREE.Face3(g,f,h,[new THREE.Vector3(G[k*3],G[k*3+1],G[k*3+2]),new THREE.Vector3(n,o,m),new THREE.Vector3(p,q,l)],null,j))}}function L(b,c,d,e){for(var g,f,h,j,k,m,l,i,n,c=new Uint32Array(a,c,4*b),d=new Uint32Array(a,d,4*b),o=new Uint16Array(a,e,b),e=0;e<b;e++){g=c[e*4];f=c[e*4+1];h=c[e*4+2];j=c[e*4+3];m=d[e*4];l=d[e*4+1];i=d[e*4+2];n=d[e*4+3];k=o[e];var p=G[l*3],q=G[l*3+1];l=G[l*3+2];var r=G[i*3],s=G[i*3+1];i=G[i*3+2];var t=G[n*3],w=G[n*3+1];n=G[n*3+2];M.faces.push(new THREE.Face4(g,
|
|
|
-f,h,j,[new THREE.Vector3(G[m*3],G[m*3+1],G[m*3+2]),new THREE.Vector3(p,q,l),new THREE.Vector3(r,s,i),new THREE.Vector3(t,w,n)],null,k))}}var M=this,t=0,G=[],I=[],N,Q,S;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(M,d,b);(function(a,b,c){for(var a=new Uint8Array(a,b,c),d="",e=0;e<c;e++)d=d+String.fromCharCode(a[b+e]);return d})(a,t,12);c=A(a,t+12);A(a,t+13);A(a,t+14);A(a,t+15);f=A(a,t+16);m=A(a,t+17);k=A(a,t+18);h=A(a,t+19);n=y(a,t+20);i=y(a,t+20+4);o=y(a,t+20+8);b=y(a,t+20+12);q=
|
|
|
-y(a,t+20+16);l=y(a,t+20+20);p=y(a,t+20+24);r=y(a,t+20+28);u=y(a,t+20+32);v=y(a,t+20+36);B=y(a,t+20+40);t=t+c;c=f*3+h;S=f*4+h;N=b*c;Q=q*(c+m*3);f=l*(c+k*3);h=p*(c+m*3+k*3);c=r*S;m=u*(S+m*4);k=v*(S+k*4);t=t+function(b){var b=new Float32Array(a,b,n*3),c,d,e,g;for(c=0;c<n;c++){d=b[c*3];e=b[c*3+1];g=b[c*3+2];M.vertices.push(new THREE.Vector3(d,e,g))}return n*3*Float32Array.BYTES_PER_ELEMENT}(t);t=t+function(b){if(i){var b=new Int8Array(a,b,i*3),c,d,e,g;for(c=0;c<i;c++){d=b[c*3];e=b[c*3+1];g=b[c*3+2];G.push(d/
|
|
|
-127,e/127,g/127)}}return i*3*Int8Array.BYTES_PER_ELEMENT}(t);t=t+x(i*3);t=t+function(b){if(o){var b=new Float32Array(a,b,o*2),c,d,e;for(c=0;c<o;c++){d=b[c*2];e=b[c*2+1];I.push(d,e)}}return o*2*Float32Array.BYTES_PER_ELEMENT}(t);N=t+N+x(b*2);Q=N+Q+x(q*2);f=Q+f+x(l*2);h=f+h+x(p*2);c=h+c+x(r*2);m=c+m+x(u*2);k=m+k+x(v*2);(function(a){if(l){var b=a+l*Uint32Array.BYTES_PER_ELEMENT*3;w(l,a,b+l*Uint32Array.BYTES_PER_ELEMENT*3);E(l,b)}})(Q);(function(a){if(p){var b=a+p*Uint32Array.BYTES_PER_ELEMENT*3,c=b+
|
|
|
-p*Uint32Array.BYTES_PER_ELEMENT*3;J(p,a,b,c+p*Uint32Array.BYTES_PER_ELEMENT*3);E(p,c)}})(f);(function(a){if(v){var b=a+v*Uint32Array.BYTES_PER_ELEMENT*4;C(v,a,b+v*Uint32Array.BYTES_PER_ELEMENT*4);s(v,b)}})(m);(function(a){if(B){var b=a+B*Uint32Array.BYTES_PER_ELEMENT*4,c=b+B*Uint32Array.BYTES_PER_ELEMENT*4;L(B,a,b,c+B*Uint32Array.BYTES_PER_ELEMENT*4);s(B,c)}})(k);b&&w(b,t,t+b*Uint32Array.BYTES_PER_ELEMENT*3);(function(a){if(q){var b=a+q*Uint32Array.BYTES_PER_ELEMENT*3;J(q,a,b,b+q*Uint32Array.BYTES_PER_ELEMENT*
|
|
|
-3)}})(N);r&&C(r,h,h+r*Uint32Array.BYTES_PER_ELEMENT*4);(function(a){if(u){var b=a+u*Uint32Array.BYTES_PER_ELEMENT*4;L(u,a,b,b+u*Uint32Array.BYTES_PER_ELEMENT*4)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};f.prototype=Object.create(THREE.Geometry.prototype);b(new f(c))};THREE.ImageLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
|
|
|
+THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,d){var f=function(b){var c,f,m,k,h,n,i,o,q,l,p,r,u,v,B;function x(a){return a%4?4-a%4:0}function A(a,b){return(new Uint8Array(a,b,1))[0]}function y(a,b){return(new Uint32Array(a,b,1))[0]}function E(b,c){var d,e,g,f,h,j,k,m,l=new Uint32Array(a,c,3*b);for(d=0;d<b;d++){e=l[d*3];g=l[d*3+1];f=l[d*3+2];h=I[e*2];e=I[e*2+1];j=I[g*2];k=I[g*2+1];g=I[f*2];m=I[f*2+1];f=N.faceVertexUvs[0];var i=[];i.push(new THREE.UV(h,e));i.push(new THREE.UV(j,k));i.push(new THREE.UV(g,
|
|
|
+m));f.push(i)}}function s(b,c){var d,e,g,f,h,j,k,m,l,i,n=new Uint32Array(a,c,4*b);for(d=0;d<b;d++){e=n[d*4];g=n[d*4+1];f=n[d*4+2];h=n[d*4+3];j=I[e*2];e=I[e*2+1];k=I[g*2];l=I[g*2+1];m=I[f*2];i=I[f*2+1];f=I[h*2];g=I[h*2+1];h=N.faceVertexUvs[0];var o=[];o.push(new THREE.UV(j,e));o.push(new THREE.UV(k,l));o.push(new THREE.UV(m,i));o.push(new THREE.UV(f,g));h.push(o)}}function w(b,c,d){for(var e,g,f,h,c=new Uint32Array(a,c,3*b),j=new Uint16Array(a,d,b),d=0;d<b;d++){e=c[d*3];g=c[d*3+1];f=c[d*3+2];h=j[d];
|
|
|
+N.faces.push(new THREE.Face3(e,g,f,null,null,h))}}function C(b,c,d){for(var e,g,f,h,j,c=new Uint32Array(a,c,4*b),k=new Uint16Array(a,d,b),d=0;d<b;d++){e=c[d*4];g=c[d*4+1];f=c[d*4+2];h=c[d*4+3];j=k[d];N.faces.push(new THREE.Face4(e,g,f,h,null,null,j))}}function K(b,c,d,e){for(var g,f,h,j,k,m,l,c=new Uint32Array(a,c,3*b),d=new Uint32Array(a,d,3*b),i=new Uint16Array(a,e,b),e=0;e<b;e++){g=c[e*3];f=c[e*3+1];h=c[e*3+2];k=d[e*3];m=d[e*3+1];l=d[e*3+2];j=i[e];var n=G[m*3],o=G[m*3+1];m=G[m*3+2];var p=G[l*3],
|
|
|
+q=G[l*3+1];l=G[l*3+2];N.faces.push(new THREE.Face3(g,f,h,[new THREE.Vector3(G[k*3],G[k*3+1],G[k*3+2]),new THREE.Vector3(n,o,m),new THREE.Vector3(p,q,l)],null,j))}}function M(b,c,d,e){for(var g,f,h,j,k,m,l,i,n,c=new Uint32Array(a,c,4*b),d=new Uint32Array(a,d,4*b),o=new Uint16Array(a,e,b),e=0;e<b;e++){g=c[e*4];f=c[e*4+1];h=c[e*4+2];j=c[e*4+3];m=d[e*4];l=d[e*4+1];i=d[e*4+2];n=d[e*4+3];k=o[e];var p=G[l*3],q=G[l*3+1];l=G[l*3+2];var r=G[i*3],s=G[i*3+1];i=G[i*3+2];var t=G[n*3],w=G[n*3+1];n=G[n*3+2];N.faces.push(new THREE.Face4(g,
|
|
|
+f,h,j,[new THREE.Vector3(G[m*3],G[m*3+1],G[m*3+2]),new THREE.Vector3(p,q,l),new THREE.Vector3(r,s,i),new THREE.Vector3(t,w,n)],null,k))}}var N=this,t=0,G=[],I=[],O,P,R;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(N,d,b);(function(a,b,c){for(var a=new Uint8Array(a,b,c),d="",e=0;e<c;e++)d=d+String.fromCharCode(a[b+e]);return d})(a,t,12);c=A(a,t+12);A(a,t+13);A(a,t+14);A(a,t+15);f=A(a,t+16);m=A(a,t+17);k=A(a,t+18);h=A(a,t+19);n=y(a,t+20);i=y(a,t+20+4);o=y(a,t+20+8);b=y(a,t+20+12);q=
|
|
|
+y(a,t+20+16);l=y(a,t+20+20);p=y(a,t+20+24);r=y(a,t+20+28);u=y(a,t+20+32);v=y(a,t+20+36);B=y(a,t+20+40);t=t+c;c=f*3+h;R=f*4+h;O=b*c;P=q*(c+m*3);f=l*(c+k*3);h=p*(c+m*3+k*3);c=r*R;m=u*(R+m*4);k=v*(R+k*4);t=t+function(b){var b=new Float32Array(a,b,n*3),c,d,e,g;for(c=0;c<n;c++){d=b[c*3];e=b[c*3+1];g=b[c*3+2];N.vertices.push(new THREE.Vector3(d,e,g))}return n*3*Float32Array.BYTES_PER_ELEMENT}(t);t=t+function(b){if(i){var b=new Int8Array(a,b,i*3),c,d,e,g;for(c=0;c<i;c++){d=b[c*3];e=b[c*3+1];g=b[c*3+2];G.push(d/
|
|
|
+127,e/127,g/127)}}return i*3*Int8Array.BYTES_PER_ELEMENT}(t);t=t+x(i*3);t=t+function(b){if(o){var b=new Float32Array(a,b,o*2),c,d,e;for(c=0;c<o;c++){d=b[c*2];e=b[c*2+1];I.push(d,e)}}return o*2*Float32Array.BYTES_PER_ELEMENT}(t);O=t+O+x(b*2);P=O+P+x(q*2);f=P+f+x(l*2);h=f+h+x(p*2);c=h+c+x(r*2);m=c+m+x(u*2);k=m+k+x(v*2);(function(a){if(l){var b=a+l*Uint32Array.BYTES_PER_ELEMENT*3;w(l,a,b+l*Uint32Array.BYTES_PER_ELEMENT*3);E(l,b)}})(P);(function(a){if(p){var b=a+p*Uint32Array.BYTES_PER_ELEMENT*3,c=b+
|
|
|
+p*Uint32Array.BYTES_PER_ELEMENT*3;K(p,a,b,c+p*Uint32Array.BYTES_PER_ELEMENT*3);E(p,c)}})(f);(function(a){if(v){var b=a+v*Uint32Array.BYTES_PER_ELEMENT*4;C(v,a,b+v*Uint32Array.BYTES_PER_ELEMENT*4);s(v,b)}})(m);(function(a){if(B){var b=a+B*Uint32Array.BYTES_PER_ELEMENT*4,c=b+B*Uint32Array.BYTES_PER_ELEMENT*4;M(B,a,b,c+B*Uint32Array.BYTES_PER_ELEMENT*4);s(B,c)}})(k);b&&w(b,t,t+b*Uint32Array.BYTES_PER_ELEMENT*3);(function(a){if(q){var b=a+q*Uint32Array.BYTES_PER_ELEMENT*3;K(q,a,b,b+q*Uint32Array.BYTES_PER_ELEMENT*
|
|
|
+3)}})(O);r&&C(r,h,h+r*Uint32Array.BYTES_PER_ELEMENT*4);(function(a){if(u){var b=a+u*Uint32Array.BYTES_PER_ELEMENT*4;M(u,a,b,b+u*Uint32Array.BYTES_PER_ELEMENT*4)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};f.prototype=Object.create(THREE.Geometry.prototype);b(new f(c))};THREE.ImageLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
|
|
|
THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a){var b=this,c=new Image;c.addEventListener("load",function(){b.dispatchEvent({type:"load",content:c})},false);c.addEventListener("error",function(){b.dispatchEvent({type:"error",message:"Couldn't load URL ["+a+"]"})},false);if(b.crossOrigin)c.crossOrigin=b.crossOrigin;c.src=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);
|
|
|
THREE.JSONLoader.prototype.load=function(a,b,c){c=c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
|
|
|
THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,f){var e=new XMLHttpRequest,g=0;e.onreadystatechange=function(){if(e.readyState===e.DONE)if(e.status===200||e.status===0){if(e.responseText){var j=JSON.parse(e.responseText);a.createModel(j,c,d)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+e.status+"]");else if(e.readyState===e.LOADING){if(f){g===0&&(g=e.getResponseHeader("Content-Length"));
|
|
@@ -165,21 +165,21 @@ o;){var p=g[n++],r=p&2,e=p&4,u=p&8,v=p&16,q=p&32,B=p&64,l=p&128;if(p&1){p=new TH
|
|
|
{};d.morphColors[e].name=a.morphColors[e].name;d.morphColors[e].colors=[];f=d.morphColors[e].colors;k=a.morphColors[e].colors;i=0;for(h=k.length;i<h;i=i+3){n=new THREE.Color(16755200);n.setRGB(k[i],k[i+1],k[i+2]);f.push(n)}}}d.computeCentroids();d.computeFaceNormals();return d}};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
|
|
|
THREE.SceneLoader.prototype.constructor=THREE.SceneLoader;
|
|
|
THREE.SceneLoader.prototype.load=function(a,b){var c=this,d=new XMLHttpRequest;d.onreadystatechange=function(){if(d.readyState===4)if(d.status===200||d.status===0){var f=JSON.parse(d.responseText);c.createScene(f,b,a)}else console.error("THREE.SceneLoader: Couldn't load ["+a+"] ["+d.status+"]")};d.open("GET",a,true);d.overrideMimeType&&d.overrideMimeType("text/plain; charset=x-user-defined");d.setRequestHeader("Content-Type","text/plain");d.send(null)};
|
|
|
-THREE.SceneLoader.prototype.createScene=function(a,b,c){function d(a,b){return b=="relativeToHTML"?a:k+"/"+a}function f(){var a;for(i in t.objects)if(!z.objects[i]){r=t.objects[i];if(r.geometry!==void 0){if(C=z.geometries[r.geometry]){a=false;J=z.materials[r.materials[0]];(a=J instanceof THREE.ShaderMaterial)&&C.computeTangents();x=r.position;A=r.rotation;y=r.quaternion;E=r.scale;u=r.matrix;y=0;r.materials.length==0&&(J=new THREE.MeshFaceMaterial);r.materials.length>1&&(J=new THREE.MeshFaceMaterial);
|
|
|
-a=new THREE.Mesh(C,J);a.name=i;if(u){a.matrixAutoUpdate=false;a.matrix.set(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15])}else{a.position.set(x[0],x[1],x[2]);if(y){a.quaternion.set(y[0],y[1],y[2],y[3]);a.useQuaternion=true}else a.rotation.set(A[0],A[1],A[2]);a.scale.set(E[0],E[1],E[2])}a.visible=r.visible;a.castShadow=r.castShadow;a.receiveShadow=r.receiveShadow;z.scene.add(a);z.objects[i]=a}}else{x=r.position;A=r.rotation;y=r.quaternion;E=r.scale;y=0;a=new THREE.Object3D;
|
|
|
-a.name=i;a.position.set(x[0],x[1],x[2]);if(y){a.quaternion.set(y[0],y[1],y[2],y[3]);a.useQuaternion=true}else a.rotation.set(A[0],A[1],A[2]);a.scale.set(E[0],E[1],E[2]);a.visible=r.visible!==void 0?r.visible:false;z.scene.add(a);z.objects[i]=a;z.empties[i]=a}}}function e(a){return function(b){z.geometries[a]=b;f();I=I-1;m.onLoadComplete();j()}}function g(a){return function(b){z.geometries[a]=b}}function j(){m.callbackProgress({totalModels:Q,totalTextures:S,loadedModels:Q-I,loadedTextures:S-N},z);
|
|
|
-m.onLoadProgress();I===0&&N===0&&b(z)}var m=this,k=THREE.Loader.prototype.extractUrlBase(c),h,n,i,o,q,l,p,r,u,v,B,x,A,y,E,s,w,C,J,L,M,t,G,I,N,Q,S,z;t=a;c=new THREE.BinaryLoader;G=new THREE.JSONLoader;N=I=0;z={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{}};if(t.transform){a=t.transform.position;v=t.transform.rotation;s=t.transform.scale;a&&z.scene.position.set(a[0],a[1],a[2]);v&&z.scene.rotation.set(v[0],v[1],v[2]);s&&z.scene.scale.set(s[0],
|
|
|
-s[1],s[2]);if(a||v||s){z.scene.updateMatrix();z.scene.updateMatrixWorld()}}a=function(a){return function(){N=N-a;j();m.onLoadComplete()}};for(q in t.cameras){s=t.cameras[q];s.type==="perspective"?L=new THREE.PerspectiveCamera(s.fov,s.aspect,s.near,s.far):s.type==="ortho"&&(L=new THREE.OrthographicCamera(s.left,s.right,s.top,s.bottom,s.near,s.far));x=s.position;v=s.target;s=s.up;L.position.set(x[0],x[1],x[2]);L.target=new THREE.Vector3(v[0],v[1],v[2]);s&&L.up.set(s[0],s[1],s[2]);z.cameras[q]=L}for(o in t.lights){v=
|
|
|
-t.lights[o];q=v.color!==void 0?v.color:16777215;L=v.intensity!==void 0?v.intensity:1;if(v.type==="directional"){x=v.direction;B=new THREE.DirectionalLight(q,L);B.position.set(x[0],x[1],x[2]);B.position.normalize()}else if(v.type==="point"){x=v.position;B=v.distance;B=new THREE.PointLight(q,L,B);B.position.set(x[0],x[1],x[2])}else v.type==="ambient"&&(B=new THREE.AmbientLight(q));z.scene.add(B);z.lights[o]=B}for(l in t.fogs){o=t.fogs[l];o.type==="linear"?M=new THREE.Fog(0,o.near,o.far):o.type==="exp2"&&
|
|
|
-(M=new THREE.FogExp2(0,o.density));s=o.color;M.color.setRGB(s[0],s[1],s[2]);z.fogs[l]=M}if(z.cameras&&t.defaults.camera)z.currentCamera=z.cameras[t.defaults.camera];if(z.fogs&&t.defaults.fog)z.scene.fog=z.fogs[t.defaults.fog];s=t.defaults.bgcolor;z.bgColor=new THREE.Color;z.bgColor.setRGB(s[0],s[1],s[2]);z.bgColorAlpha=t.defaults.bgalpha;for(h in t.geometries){l=t.geometries[h];if(l.type=="bin_mesh"||l.type=="ascii_mesh"){I=I+1;m.onLoadStart()}}Q=I;for(h in t.geometries){l=t.geometries[h];if(l.type===
|
|
|
-"cube"){C=new THREE.CubeGeometry(l.width,l.height,l.depth,l.segmentsWidth,l.segmentsHeight,l.segmentsDepth,null,l.flipped,l.sides);z.geometries[h]=C}else if(l.type==="plane"){C=new THREE.PlaneGeometry(l.width,l.height,l.segmentsWidth,l.segmentsHeight);z.geometries[h]=C}else if(l.type==="sphere"){C=new THREE.SphereGeometry(l.radius,l.segmentsWidth,l.segmentsHeight);z.geometries[h]=C}else if(l.type==="cylinder"){C=new THREE.CylinderGeometry(l.topRad,l.botRad,l.height,l.radSegs,l.heightSegs);z.geometries[h]=
|
|
|
-C}else if(l.type==="torus"){C=new THREE.TorusGeometry(l.radius,l.tube,l.segmentsR,l.segmentsT);z.geometries[h]=C}else if(l.type==="icosahedron"){C=new THREE.IcosahedronGeometry(l.radius,l.subdivisions);z.geometries[h]=C}else if(l.type==="bin_mesh")c.load(d(l.url,t.urlBaseType),e(h));else if(l.type==="ascii_mesh")G.load(d(l.url,t.urlBaseType),e(h));else if(l.type==="embedded_mesh"){l=t.embeds[l.id];l.metadata=t.metadata;l&&G.createModel(l,g(h),"")}}for(p in t.textures){h=t.textures[p];if(h.url instanceof
|
|
|
-Array){N=N+h.url.length;for(l=0;l<h.url.length;l++)m.onLoadStart()}else{N=N+1;m.onLoadStart()}}S=N;for(p in t.textures){h=t.textures[p];if(h.mapping!==void 0&&THREE[h.mapping]!==void 0)h.mapping=new THREE[h.mapping];if(h.url instanceof Array){l=h.url.length;M=[];for(c=0;c<l;c++)M[c]=d(h.url[c],t.urlBaseType);l=THREE.ImageUtils.loadTextureCube(M,h.mapping,a(l))}else{l=THREE.ImageUtils.loadTexture(d(h.url,t.urlBaseType),h.mapping,a(1));if(THREE[h.minFilter]!==void 0)l.minFilter=THREE[h.minFilter];if(THREE[h.magFilter]!==
|
|
|
-void 0)l.magFilter=THREE[h.magFilter];if(h.repeat){l.repeat.set(h.repeat[0],h.repeat[1]);if(h.repeat[0]!==1)l.wrapS=THREE.RepeatWrapping;if(h.repeat[1]!==1)l.wrapT=THREE.RepeatWrapping}h.offset&&l.offset.set(h.offset[0],h.offset[1]);if(h.wrap){M={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(M[h.wrap[0]]!==void 0)l.wrapS=M[h.wrap[0]];if(M[h.wrap[1]]!==void 0)l.wrapT=M[h.wrap[1]]}}z.textures[p]=l}for(n in t.materials){u=t.materials[n];for(w in u.parameters)if(w==="envMap"||w===
|
|
|
-"map"||w==="lightMap")u.parameters[w]=z.textures[u.parameters[w]];else if(w==="shading")u.parameters[w]=u.parameters[w]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(w==="blending")u.parameters[w]=u.parameters[w]in THREE?THREE[u.parameters[w]]:THREE.NormalBlending;else if(w==="combine")u.parameters[w]=u.parameters[w]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(w==="vertexColors")if(u.parameters[w]=="face")u.parameters[w]=THREE.FaceColors;else if(u.parameters[w])u.parameters[w]=
|
|
|
-THREE.VertexColors;if(u.parameters.opacity!==void 0&&u.parameters.opacity<1)u.parameters.transparent=true;if(u.parameters.normalMap){p=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(p.uniforms);h=u.parameters.color;l=u.parameters.specular;M=u.parameters.ambient;c=u.parameters.shininess;a.tNormal.texture=z.textures[u.parameters.normalMap];if(u.parameters.normalMapFactor)a.uNormalScale.value=u.parameters.normalMapFactor;if(u.parameters.map){a.tDiffuse.texture=u.parameters.map;a.enableDiffuse.value=
|
|
|
-true}if(u.parameters.lightMap){a.tAO.texture=u.parameters.lightMap;a.enableAO.value=true}if(u.parameters.specularMap){a.tSpecular.texture=z.textures[u.parameters.specularMap];a.enableSpecular.value=true}a.uDiffuseColor.value.setHex(h);a.uSpecularColor.value.setHex(l);a.uAmbientColor.value.setHex(M);a.uShininess.value=c;if(u.parameters.opacity)a.uOpacity.value=u.parameters.opacity;J=new THREE.ShaderMaterial({fragmentShader:p.fragmentShader,vertexShader:p.vertexShader,uniforms:a,lights:true,fog:true})}else J=
|
|
|
-new THREE[u.type](u.parameters);z.materials[n]=J}f();m.callbackSync(z);j()};THREE.TextureLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
|
|
|
+THREE.SceneLoader.prototype.createScene=function(a,b,c){function d(a,b){return b=="relativeToHTML"?a:k+"/"+a}function f(a,b){var c;for(i in b)if(z.objects[i]===void 0){r=b[i];if(r.geometry!==void 0){if(C=z.geometries[r.geometry]){c=false;K=z.materials[r.materials[0]];(c=K instanceof THREE.ShaderMaterial)&&C.computeTangents();x=r.position;A=r.rotation;y=r.quaternion;E=r.scale;u=r.matrix;y=0;r.materials.length==0&&(K=new THREE.MeshFaceMaterial);r.materials.length>1&&(K=new THREE.MeshFaceMaterial);c=
|
|
|
+new THREE.Mesh(C,K);c.name=i;if(u){c.matrixAutoUpdate=false;c.matrix.set(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15])}else{c.position.set(x[0],x[1],x[2]);if(y){c.quaternion.set(y[0],y[1],y[2],y[3]);c.useQuaternion=true}else c.rotation.set(A[0],A[1],A[2]);c.scale.set(E[0],E[1],E[2])}c.visible=r.visible;c.castShadow=r.castShadow;c.receiveShadow=r.receiveShadow;a.add(c);z.objects[i]=c}}else{x=r.position;A=r.rotation;y=r.quaternion;E=r.scale;y=0;c=new THREE.Object3D;
|
|
|
+c.name=i;c.position.set(x[0],x[1],x[2]);if(y){c.quaternion.set(y[0],y[1],y[2],y[3]);c.useQuaternion=true}else c.rotation.set(A[0],A[1],A[2]);c.scale.set(E[0],E[1],E[2]);c.visible=r.visible!==void 0?r.visible:false;a.add(c);z.objects[i]=c;z.empties[i]=c}r.children!==void 0&&f(c,r.children)}}function e(a){return function(b){z.geometries[a]=b;f(z.scene,t.objects);I=I-1;m.onLoadComplete();j()}}function g(a){return function(b){z.geometries[a]=b}}function j(){m.callbackProgress({totalModels:P,totalTextures:R,
|
|
|
+loadedModels:P-I,loadedTextures:R-O},z);m.onLoadProgress();I===0&&O===0&&b(z)}var m=this,k=THREE.Loader.prototype.extractUrlBase(c),h,n,i,o,q,l,p,r,u,v,B,x,A,y,E,s,w,C,K,M,N,t,G,I,O,P,R,z;t=a;c=new THREE.BinaryLoader;G=new THREE.JSONLoader;O=I=0;z={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{}};if(t.transform){a=t.transform.position;v=t.transform.rotation;s=t.transform.scale;a&&z.scene.position.set(a[0],a[1],a[2]);v&&z.scene.rotation.set(v[0],
|
|
|
+v[1],v[2]);s&&z.scene.scale.set(s[0],s[1],s[2]);if(a||v||s){z.scene.updateMatrix();z.scene.updateMatrixWorld()}}a=function(a){return function(){O=O-a;j();m.onLoadComplete()}};for(q in t.cameras){s=t.cameras[q];s.type==="perspective"?M=new THREE.PerspectiveCamera(s.fov,s.aspect,s.near,s.far):s.type==="ortho"&&(M=new THREE.OrthographicCamera(s.left,s.right,s.top,s.bottom,s.near,s.far));x=s.position;v=s.target;s=s.up;M.position.set(x[0],x[1],x[2]);M.target=new THREE.Vector3(v[0],v[1],v[2]);s&&M.up.set(s[0],
|
|
|
+s[1],s[2]);z.cameras[q]=M}for(o in t.lights){v=t.lights[o];q=v.color!==void 0?v.color:16777215;M=v.intensity!==void 0?v.intensity:1;if(v.type==="directional"){x=v.direction;B=new THREE.DirectionalLight(q,M);B.position.set(x[0],x[1],x[2]);B.position.normalize()}else if(v.type==="point"){x=v.position;B=v.distance;B=new THREE.PointLight(q,M,B);B.position.set(x[0],x[1],x[2])}else v.type==="ambient"&&(B=new THREE.AmbientLight(q));z.scene.add(B);z.lights[o]=B}for(l in t.fogs){o=t.fogs[l];o.type==="linear"?
|
|
|
+N=new THREE.Fog(0,o.near,o.far):o.type==="exp2"&&(N=new THREE.FogExp2(0,o.density));s=o.color;N.color.setRGB(s[0],s[1],s[2]);z.fogs[l]=N}if(z.cameras&&t.defaults.camera)z.currentCamera=z.cameras[t.defaults.camera];if(z.fogs&&t.defaults.fog)z.scene.fog=z.fogs[t.defaults.fog];s=t.defaults.bgcolor;z.bgColor=new THREE.Color;z.bgColor.setRGB(s[0],s[1],s[2]);z.bgColorAlpha=t.defaults.bgalpha;for(h in t.geometries){l=t.geometries[h];if(l.type=="bin_mesh"||l.type=="ascii_mesh"){I=I+1;m.onLoadStart()}}P=I;
|
|
|
+for(h in t.geometries){l=t.geometries[h];if(l.type==="cube"){C=new THREE.CubeGeometry(l.width,l.height,l.depth,l.segmentsWidth,l.segmentsHeight,l.segmentsDepth,null,l.flipped,l.sides);z.geometries[h]=C}else if(l.type==="plane"){C=new THREE.PlaneGeometry(l.width,l.height,l.segmentsWidth,l.segmentsHeight);z.geometries[h]=C}else if(l.type==="sphere"){C=new THREE.SphereGeometry(l.radius,l.segmentsWidth,l.segmentsHeight);z.geometries[h]=C}else if(l.type==="cylinder"){C=new THREE.CylinderGeometry(l.topRad,
|
|
|
+l.botRad,l.height,l.radSegs,l.heightSegs);z.geometries[h]=C}else if(l.type==="torus"){C=new THREE.TorusGeometry(l.radius,l.tube,l.segmentsR,l.segmentsT);z.geometries[h]=C}else if(l.type==="icosahedron"){C=new THREE.IcosahedronGeometry(l.radius,l.subdivisions);z.geometries[h]=C}else if(l.type==="bin_mesh")c.load(d(l.url,t.urlBaseType),e(h));else if(l.type==="ascii_mesh")G.load(d(l.url,t.urlBaseType),e(h));else if(l.type==="embedded_mesh"){l=t.embeds[l.id];l.metadata=t.metadata;l&&G.createModel(l,g(h),
|
|
|
+"")}}for(p in t.textures){h=t.textures[p];if(h.url instanceof Array){O=O+h.url.length;for(l=0;l<h.url.length;l++)m.onLoadStart()}else{O=O+1;m.onLoadStart()}}R=O;for(p in t.textures){h=t.textures[p];if(h.mapping!==void 0&&THREE[h.mapping]!==void 0)h.mapping=new THREE[h.mapping];if(h.url instanceof Array){l=h.url.length;N=[];for(c=0;c<l;c++)N[c]=d(h.url[c],t.urlBaseType);l=THREE.ImageUtils.loadTextureCube(N,h.mapping,a(l))}else{l=THREE.ImageUtils.loadTexture(d(h.url,t.urlBaseType),h.mapping,a(1));if(THREE[h.minFilter]!==
|
|
|
+void 0)l.minFilter=THREE[h.minFilter];if(THREE[h.magFilter]!==void 0)l.magFilter=THREE[h.magFilter];if(h.repeat){l.repeat.set(h.repeat[0],h.repeat[1]);if(h.repeat[0]!==1)l.wrapS=THREE.RepeatWrapping;if(h.repeat[1]!==1)l.wrapT=THREE.RepeatWrapping}h.offset&&l.offset.set(h.offset[0],h.offset[1]);if(h.wrap){N={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(N[h.wrap[0]]!==void 0)l.wrapS=N[h.wrap[0]];if(N[h.wrap[1]]!==void 0)l.wrapT=N[h.wrap[1]]}}z.textures[p]=l}for(n in t.materials){u=
|
|
|
+t.materials[n];for(w in u.parameters)if(w==="envMap"||w==="map"||w==="lightMap")u.parameters[w]=z.textures[u.parameters[w]];else if(w==="shading")u.parameters[w]=u.parameters[w]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(w==="blending")u.parameters[w]=u.parameters[w]in THREE?THREE[u.parameters[w]]:THREE.NormalBlending;else if(w==="combine")u.parameters[w]=u.parameters[w]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(w==="vertexColors")if(u.parameters[w]=="face")u.parameters[w]=
|
|
|
+THREE.FaceColors;else if(u.parameters[w])u.parameters[w]=THREE.VertexColors;if(u.parameters.opacity!==void 0&&u.parameters.opacity<1)u.parameters.transparent=true;if(u.parameters.normalMap){p=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(p.uniforms);h=u.parameters.color;l=u.parameters.specular;N=u.parameters.ambient;c=u.parameters.shininess;a.tNormal.texture=z.textures[u.parameters.normalMap];if(u.parameters.normalMapFactor)a.uNormalScale.value=u.parameters.normalMapFactor;if(u.parameters.map){a.tDiffuse.texture=
|
|
|
+u.parameters.map;a.enableDiffuse.value=true}if(u.parameters.lightMap){a.tAO.texture=u.parameters.lightMap;a.enableAO.value=true}if(u.parameters.specularMap){a.tSpecular.texture=z.textures[u.parameters.specularMap];a.enableSpecular.value=true}a.uDiffuseColor.value.setHex(h);a.uSpecularColor.value.setHex(l);a.uAmbientColor.value.setHex(N);a.uShininess.value=c;if(u.parameters.opacity)a.uOpacity.value=u.parameters.opacity;K=new THREE.ShaderMaterial({fragmentShader:p.fragmentShader,vertexShader:p.vertexShader,
|
|
|
+uniforms:a,lights:true,fog:true})}else K=new THREE[u.type](u.parameters);z.materials[n]=K}f(z.scene,t.objects);m.callbackSync(z);j()};THREE.TextureLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
|
|
|
THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a){var b=this,c=new Image;c.addEventListener("load",function(){var a=new THREE.Texture(c);a.needsUpdate=true;b.dispatchEvent({type:"load",content:a})},false);c.addEventListener("error",function(){b.dispatchEvent({type:"error",message:"Couldn't load URL ["+a+"]"})},false);if(b.crossOrigin)c.crossOrigin=b.crossOrigin;c.src=a}};
|
|
|
THREE.Material=function(a){a=a||{};this.id=THREE.MaterialCount++;this.name="";this.opacity=a.opacity!==void 0?a.opacity:1;this.transparent=a.transparent!==void 0?a.transparent:false;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.blendSrc=a.blendSrc!==void 0?a.blendSrc:THREE.SrcAlphaFactor;this.blendDst=a.blendDst!==void 0?a.blendDst:THREE.OneMinusSrcAlphaFactor;this.blendEquation=a.blendEquation!==void 0?a.blendEquation:THREE.AddEquation;this.depthTest=a.depthTest!==void 0?
|
|
|
a.depthTest:true;this.depthWrite=a.depthWrite!==void 0?a.depthWrite:true;this.polygonOffset=a.polygonOffset!==void 0?a.polygonOffset:false;this.polygonOffsetFactor=a.polygonOffsetFactor!==void 0?a.polygonOffsetFactor:0;this.polygonOffsetUnits=a.polygonOffsetUnits!==void 0?a.polygonOffsetUnits:0;this.alphaTest=a.alphaTest!==void 0?a.alphaTest:0;this.overdraw=a.overdraw!==void 0?a.overdraw:false;this.visible=a.visible!==void 0?a.visible:true;this.doubleSided=a.doubleSided!==void 0?a.doubleSided:false;
|
|
@@ -213,7 +213,7 @@ THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=
|
|
|
THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light){this.__lights.indexOf(a)===-1&&this.__lights.push(a);a.target&&a.target.parent===void 0&&this.add(a.target)}else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.__objects.indexOf(a)===-1){this.__objects.push(a);this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);b!==-1&&this.__objectsRemoved.splice(b,1)}for(b=0;b<a.children.length;b++)this.__addObject(a.children[b])};
|
|
|
THREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){var b=this.__lights.indexOf(a);b!==-1&&this.__lights.splice(b,1)}else if(!(a instanceof THREE.Camera)){b=this.__objects.indexOf(a);if(b!==-1){this.__objects.splice(b,1);this.__objectsRemoved.push(a);b=this.__objectsAdded.indexOf(a);b!==-1&&this.__objectsAdded.splice(b,1)}}for(b=0;b<a.children.length;b++)this.__removeObject(a.children[b])};
|
|
|
THREE.CanvasRenderer=function(a){function b(a){if(u!==a)u=l.globalAlpha=a}function c(a){if(v!==a){if(a===THREE.NormalBlending)l.globalCompositeOperation="source-over";else if(a===THREE.AdditiveBlending)l.globalCompositeOperation="lighter";else if(a===THREE.SubtractiveBlending)l.globalCompositeOperation="darker";v=a}}function d(a){if(B!==a)B=l.strokeStyle=a}function f(a){if(x!==a)x=l.fillStyle=a}console.log("THREE.CanvasRenderer",THREE.REVISION);var a=a||{},e=this,g,j,m,k=new THREE.Projector,h=a.canvas!==
|
|
|
-void 0?a.canvas:document.createElement("canvas"),n,i,o,q,l=h.getContext("2d"),p=new THREE.Color(0),r=0,u=1,v=0,B=null,x=null,A=null,y=null,E=null,s,w,C,J,L=new THREE.RenderableVertex,M=new THREE.RenderableVertex,t,G,I,N,Q,S,z,P,$,O,U,T,D=new THREE.Color,F=new THREE.Color,H=new THREE.Color,K=new THREE.Color,R=new THREE.Color,ja=[],ka=[],Y,ca,aa,la,za,Aa,Ba,Ca,Da,Ea,ga=new THREE.Rectangle,ba=new THREE.Rectangle,X=new THREE.Rectangle,ua=false,Z=new THREE.Color,ma=new THREE.Color,na=new THREE.Color,V=
|
|
|
+void 0?a.canvas:document.createElement("canvas"),n,i,o,q,l=h.getContext("2d"),p=new THREE.Color(0),r=0,u=1,v=0,B=null,x=null,A=null,y=null,E=null,s,w,C,K,M=new THREE.RenderableVertex,N=new THREE.RenderableVertex,t,G,I,O,P,R,z,S,$,J,U,T,D=new THREE.Color,F=new THREE.Color,H=new THREE.Color,L=new THREE.Color,Q=new THREE.Color,ja=[],ka=[],Y,ca,aa,la,za,Aa,Ba,Ca,Da,Ea,ga=new THREE.Rectangle,ba=new THREE.Rectangle,X=new THREE.Rectangle,ua=false,Z=new THREE.Color,ma=new THREE.Color,na=new THREE.Color,V=
|
|
|
new THREE.Vector3,ra,sa,ya,da,ta,va,a=16;ra=document.createElement("canvas");ra.width=ra.height=2;sa=ra.getContext("2d");sa.fillStyle="rgba(0,0,0,1)";sa.fillRect(0,0,2,2);ya=sa.getImageData(0,0,2,2);da=ya.data;ta=document.createElement("canvas");ta.width=ta.height=a;va=ta.getContext("2d");va.translate(-a/2,-a/2);va.scale(a,a);a--;this.domElement=h;this.sortElements=this.sortObjects=this.autoClear=true;this.info={render:{vertices:0,faces:0}};this.setSize=function(a,b){n=a;i=b;o=Math.floor(n/2);q=Math.floor(i/
|
|
|
2);h.width=n;h.height=i;ga.set(-o,-q,o,q);ba.set(-o,-q,o,q);u=1;v=0;E=y=A=x=B=null};this.setClearColor=function(a,b){p.copy(a);r=b!==void 0?b:1;ba.set(-o,-q,o,q)};this.setClearColorHex=function(a,b){p.setHex(a);r=b!==void 0?b:1;ba.set(-o,-q,o,q)};this.clear=function(){l.setTransform(1,0,0,-1,o,q);if(ba.isEmpty()===false){ba.minSelf(ga);ba.inflate(2);r<1&&l.clearRect(Math.floor(ba.getX()),Math.floor(ba.getY()),Math.floor(ba.getWidth()),Math.floor(ba.getHeight()));if(r>0){c(THREE.NormalBlending);b(1);
|
|
|
f("rgba("+Math.floor(p.r*255)+","+Math.floor(p.g*255)+","+Math.floor(p.b*255)+","+r+")");l.fillRect(Math.floor(ba.getX()),Math.floor(ba.getY()),Math.floor(ba.getWidth()),Math.floor(ba.getHeight()))}ba.empty()}};this.render=function(a,h){function i(a){var b,c,d,e;Z.setRGB(0,0,0);ma.setRGB(0,0,0);na.setRGB(0,0,0);b=0;for(c=a.length;b<c;b++){d=a[b];e=d.color;if(d instanceof THREE.AmbientLight){Z.r=Z.r+e.r;Z.g=Z.g+e.g;Z.b=Z.b+e.b}else if(d instanceof THREE.DirectionalLight){ma.r=ma.r+e.r;ma.g=ma.g+e.g;
|
|
@@ -221,17 +221,17 @@ ma.b=ma.b+e.b}else if(d instanceof THREE.PointLight){na.r=na.r+e.r;na.g=na.g+e.g
|
|
|
1));if(j!=0){j=j*g.intensity;d.r=d.r+h.r*j;d.g=d.g+h.g*j;d.b=d.b+h.b*j}}}}}function p(a,e,g){b(g.opacity);c(g.blending);var h,j,k,m,n,i;if(g instanceof THREE.ParticleBasicMaterial){if(g.map===null){k=e.object.scale.x;m=e.object.scale.y;k=k*e.scale.x*o;m=m*e.scale.y*q;X.set(a.x-k,a.y-m,a.x+k,a.y+m);if(ga.intersects(X)===false)return;f(g.color.getContextStyle());l.save();l.translate(a.x,a.y);l.rotate(-e.rotation);l.scale(k,m);l.fillRect(-1,-1,2,2)}else{g=g.map.image;n=g.width>>1;i=g.height>>1;k=e.scale.x*
|
|
|
o;m=e.scale.y*q;h=k*n;j=m*i;X.set(a.x-h,a.y-j,a.x+h,a.y+j);if(ga.intersects(X)===false)return;l.save();l.translate(a.x,a.y);l.rotate(-e.rotation);l.scale(k,-m);l.translate(-n,-i);l.drawImage(g,0,0)}l.restore()}else if(g instanceof THREE.ParticleCanvasMaterial){h=e.scale.x*o;j=e.scale.y*q;X.set(a.x-h,a.y-j,a.x+h,a.y+j);if(ga.intersects(X)!==false){d(g.color.getContextStyle());f(g.color.getContextStyle());l.save();l.translate(a.x,a.y);l.rotate(-e.rotation);l.scale(h,j);g.program(l);l.restore()}}}function r(a,
|
|
|
e,f,g){b(g.opacity);c(g.blending);l.beginPath();l.moveTo(a.positionScreen.x,a.positionScreen.y);l.lineTo(e.positionScreen.x,e.positionScreen.y);l.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(A!==a)A=l.lineWidth=a;a=g.linecap;if(y!==a)y=l.lineCap=a;a=g.linejoin;if(E!==a)E=l.lineJoin=a;d(g.color.getContextStyle());l.stroke();X.inflate(g.linewidth*2)}}function u(a,d,f,g,k,j,l,i){e.info.render.vertices=e.info.render.vertices+3;e.info.render.faces++;b(i.opacity);c(i.blending);
|
|
|
-t=a.positionScreen.x;G=a.positionScreen.y;I=d.positionScreen.x;N=d.positionScreen.y;Q=f.positionScreen.x;S=f.positionScreen.y;x(t,G,I,N,Q,S);if(i instanceof THREE.MeshBasicMaterial)if(i.map!==null){if(i.map.mapping instanceof THREE.UVMapping){la=l.uvs[0];Fa(t,G,I,N,Q,S,la[g].u,la[g].v,la[k].u,la[k].v,la[j].u,la[j].v,i.map)}}else if(i.envMap!==null){if(i.envMap.mapping instanceof THREE.SphericalReflectionMapping){a=h.matrixWorldInverse;V.copy(l.vertexNormalsWorld[g]);za=(V.x*a.elements[0]+V.y*a.elements[4]+
|
|
|
-V.z*a.elements[8])*0.5+0.5;Aa=(V.x*a.elements[1]+V.y*a.elements[5]+V.z*a.elements[9])*0.5+0.5;V.copy(l.vertexNormalsWorld[k]);Ba=(V.x*a.elements[0]+V.y*a.elements[4]+V.z*a.elements[8])*0.5+0.5;Ca=(V.x*a.elements[1]+V.y*a.elements[5]+V.z*a.elements[9])*0.5+0.5;V.copy(l.vertexNormalsWorld[j]);Da=(V.x*a.elements[0]+V.y*a.elements[4]+V.z*a.elements[8])*0.5+0.5;Ea=(V.x*a.elements[1]+V.y*a.elements[5]+V.z*a.elements[9])*0.5+0.5;Fa(t,G,I,N,Q,S,za,Aa,Ba,Ca,Da,Ea,i.envMap)}}else i.wireframe===true?ha(i.color,
|
|
|
-i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(i.color);else if(i instanceof THREE.MeshLambertMaterial)if(ua===true)if(i.wireframe===false&&i.shading==THREE.SmoothShading&&l.vertexNormalsWorld.length==3){F.r=H.r=K.r=Z.r;F.g=H.g=K.g=Z.g;F.b=H.b=K.b=Z.b;n(m,l.v1.positionWorld,l.vertexNormalsWorld[0],F);n(m,l.v2.positionWorld,l.vertexNormalsWorld[1],H);n(m,l.v3.positionWorld,l.vertexNormalsWorld[2],K);F.r=Math.max(0,Math.min(i.color.r*F.r,1));F.g=Math.max(0,Math.min(i.color.g*F.g,1));
|
|
|
-F.b=Math.max(0,Math.min(i.color.b*F.b,1));H.r=Math.max(0,Math.min(i.color.r*H.r,1));H.g=Math.max(0,Math.min(i.color.g*H.g,1));H.b=Math.max(0,Math.min(i.color.b*H.b,1));K.r=Math.max(0,Math.min(i.color.r*K.r,1));K.g=Math.max(0,Math.min(i.color.g*K.g,1));K.b=Math.max(0,Math.min(i.color.b*K.b,1));R.r=(H.r+K.r)*0.5;R.g=(H.g+K.g)*0.5;R.b=(H.b+K.b)*0.5;aa=wa(F,H,K,R);pa(t,G,I,N,Q,S,0,0,1,0,0,1,aa)}else{D.r=Z.r;D.g=Z.g;D.b=Z.b;n(m,l.centroidWorld,l.normalWorld,D);D.r=Math.max(0,Math.min(i.color.r*D.r,1));
|
|
|
-D.g=Math.max(0,Math.min(i.color.g*D.g,1));D.b=Math.max(0,Math.min(i.color.b*D.b,1));i.wireframe===true?ha(D,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(D)}else i.wireframe===true?ha(i.color,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(i.color);else if(i instanceof THREE.MeshDepthMaterial){Y=h.near;ca=h.far;F.r=F.g=F.b=1-oa(a.positionScreen.z,Y,ca);H.r=H.g=H.b=1-oa(d.positionScreen.z,Y,ca);K.r=K.g=K.b=1-oa(f.positionScreen.z,Y,ca);R.r=(H.r+K.r)*0.5;R.g=(H.g+K.g)*
|
|
|
-0.5;R.b=(H.b+K.b)*0.5;aa=wa(F,H,K,R);pa(t,G,I,N,Q,S,0,0,1,0,0,1,aa)}else if(i instanceof THREE.MeshNormalMaterial){D.r=qa(l.normalWorld.x);D.g=qa(l.normalWorld.y);D.b=qa(l.normalWorld.z);i.wireframe===true?ha(D,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(D)}}function v(a,d,f,g,k,j,l,i,o){e.info.render.vertices=e.info.render.vertices+4;e.info.render.faces++;b(i.opacity);c(i.blending);if(i.map!==void 0&&i.map!==null||i.envMap!==void 0&&i.envMap!==null){u(a,d,g,0,1,3,l,i,o);u(k,f,
|
|
|
-j,1,2,3,l,i,o)}else{t=a.positionScreen.x;G=a.positionScreen.y;I=d.positionScreen.x;N=d.positionScreen.y;Q=f.positionScreen.x;S=f.positionScreen.y;z=g.positionScreen.x;P=g.positionScreen.y;$=k.positionScreen.x;O=k.positionScreen.y;U=j.positionScreen.x;T=j.positionScreen.y;if(i instanceof THREE.MeshBasicMaterial){B(t,G,I,N,Q,S,z,P);i.wireframe===true?ha(i.color,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(i.color)}else if(i instanceof THREE.MeshLambertMaterial)if(ua===true)if(!i.wireframe&&
|
|
|
-i.shading==THREE.SmoothShading&&l.vertexNormalsWorld.length==4){F.r=H.r=K.r=R.r=Z.r;F.g=H.g=K.g=R.g=Z.g;F.b=H.b=K.b=R.b=Z.b;n(m,l.v1.positionWorld,l.vertexNormalsWorld[0],F);n(m,l.v2.positionWorld,l.vertexNormalsWorld[1],H);n(m,l.v4.positionWorld,l.vertexNormalsWorld[3],K);n(m,l.v3.positionWorld,l.vertexNormalsWorld[2],R);F.r=Math.max(0,Math.min(i.color.r*F.r,1));F.g=Math.max(0,Math.min(i.color.g*F.g,1));F.b=Math.max(0,Math.min(i.color.b*F.b,1));H.r=Math.max(0,Math.min(i.color.r*H.r,1));H.g=Math.max(0,
|
|
|
-Math.min(i.color.g*H.g,1));H.b=Math.max(0,Math.min(i.color.b*H.b,1));K.r=Math.max(0,Math.min(i.color.r*K.r,1));K.g=Math.max(0,Math.min(i.color.g*K.g,1));K.b=Math.max(0,Math.min(i.color.b*K.b,1));R.r=Math.max(0,Math.min(i.color.r*R.r,1));R.g=Math.max(0,Math.min(i.color.g*R.g,1));R.b=Math.max(0,Math.min(i.color.b*R.b,1));aa=wa(F,H,K,R);x(t,G,I,N,z,P);pa(t,G,I,N,z,P,0,0,1,0,0,1,aa);x($,O,Q,S,U,T);pa($,O,Q,S,U,T,1,0,1,1,0,1,aa)}else{D.r=Z.r;D.g=Z.g;D.b=Z.b;n(m,l.centroidWorld,l.normalWorld,D);D.r=Math.max(0,
|
|
|
-Math.min(i.color.r*D.r,1));D.g=Math.max(0,Math.min(i.color.g*D.g,1));D.b=Math.max(0,Math.min(i.color.b*D.b,1));B(t,G,I,N,Q,S,z,P);i.wireframe===true?ha(D,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(D)}else{B(t,G,I,N,Q,S,z,P);i.wireframe===true?ha(i.color,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(i.color)}else if(i instanceof THREE.MeshNormalMaterial){D.r=qa(l.normalWorld.x);D.g=qa(l.normalWorld.y);D.b=qa(l.normalWorld.z);B(t,G,I,N,Q,S,z,P);i.wireframe===true?
|
|
|
-ha(D,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(D)}else if(i instanceof THREE.MeshDepthMaterial){Y=h.near;ca=h.far;F.r=F.g=F.b=1-oa(a.positionScreen.z,Y,ca);H.r=H.g=H.b=1-oa(d.positionScreen.z,Y,ca);K.r=K.g=K.b=1-oa(g.positionScreen.z,Y,ca);R.r=R.g=R.b=1-oa(f.positionScreen.z,Y,ca);aa=wa(F,H,K,R);x(t,G,I,N,z,P);pa(t,G,I,N,z,P,0,0,1,0,0,1,aa);x($,O,Q,S,U,T);pa($,O,Q,S,U,T,1,0,1,1,0,1,aa)}}}function x(a,b,c,d,e,f){l.beginPath();l.moveTo(a,b);l.lineTo(c,d);l.lineTo(e,f);l.lineTo(a,
|
|
|
+t=a.positionScreen.x;G=a.positionScreen.y;I=d.positionScreen.x;O=d.positionScreen.y;P=f.positionScreen.x;R=f.positionScreen.y;x(t,G,I,O,P,R);if(i instanceof THREE.MeshBasicMaterial)if(i.map!==null){if(i.map.mapping instanceof THREE.UVMapping){la=l.uvs[0];Fa(t,G,I,O,P,R,la[g].u,la[g].v,la[k].u,la[k].v,la[j].u,la[j].v,i.map)}}else if(i.envMap!==null){if(i.envMap.mapping instanceof THREE.SphericalReflectionMapping){a=h.matrixWorldInverse;V.copy(l.vertexNormalsWorld[g]);za=(V.x*a.elements[0]+V.y*a.elements[4]+
|
|
|
+V.z*a.elements[8])*0.5+0.5;Aa=(V.x*a.elements[1]+V.y*a.elements[5]+V.z*a.elements[9])*0.5+0.5;V.copy(l.vertexNormalsWorld[k]);Ba=(V.x*a.elements[0]+V.y*a.elements[4]+V.z*a.elements[8])*0.5+0.5;Ca=(V.x*a.elements[1]+V.y*a.elements[5]+V.z*a.elements[9])*0.5+0.5;V.copy(l.vertexNormalsWorld[j]);Da=(V.x*a.elements[0]+V.y*a.elements[4]+V.z*a.elements[8])*0.5+0.5;Ea=(V.x*a.elements[1]+V.y*a.elements[5]+V.z*a.elements[9])*0.5+0.5;Fa(t,G,I,O,P,R,za,Aa,Ba,Ca,Da,Ea,i.envMap)}}else i.wireframe===true?ha(i.color,
|
|
|
+i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(i.color);else if(i instanceof THREE.MeshLambertMaterial)if(ua===true)if(i.wireframe===false&&i.shading==THREE.SmoothShading&&l.vertexNormalsWorld.length==3){F.r=H.r=L.r=Z.r;F.g=H.g=L.g=Z.g;F.b=H.b=L.b=Z.b;n(m,l.v1.positionWorld,l.vertexNormalsWorld[0],F);n(m,l.v2.positionWorld,l.vertexNormalsWorld[1],H);n(m,l.v3.positionWorld,l.vertexNormalsWorld[2],L);F.r=Math.max(0,Math.min(i.color.r*F.r,1));F.g=Math.max(0,Math.min(i.color.g*F.g,1));
|
|
|
+F.b=Math.max(0,Math.min(i.color.b*F.b,1));H.r=Math.max(0,Math.min(i.color.r*H.r,1));H.g=Math.max(0,Math.min(i.color.g*H.g,1));H.b=Math.max(0,Math.min(i.color.b*H.b,1));L.r=Math.max(0,Math.min(i.color.r*L.r,1));L.g=Math.max(0,Math.min(i.color.g*L.g,1));L.b=Math.max(0,Math.min(i.color.b*L.b,1));Q.r=(H.r+L.r)*0.5;Q.g=(H.g+L.g)*0.5;Q.b=(H.b+L.b)*0.5;aa=wa(F,H,L,Q);pa(t,G,I,O,P,R,0,0,1,0,0,1,aa)}else{D.r=Z.r;D.g=Z.g;D.b=Z.b;n(m,l.centroidWorld,l.normalWorld,D);D.r=Math.max(0,Math.min(i.color.r*D.r,1));
|
|
|
+D.g=Math.max(0,Math.min(i.color.g*D.g,1));D.b=Math.max(0,Math.min(i.color.b*D.b,1));i.wireframe===true?ha(D,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(D)}else i.wireframe===true?ha(i.color,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(i.color);else if(i instanceof THREE.MeshDepthMaterial){Y=h.near;ca=h.far;F.r=F.g=F.b=1-oa(a.positionScreen.z,Y,ca);H.r=H.g=H.b=1-oa(d.positionScreen.z,Y,ca);L.r=L.g=L.b=1-oa(f.positionScreen.z,Y,ca);Q.r=(H.r+L.r)*0.5;Q.g=(H.g+L.g)*
|
|
|
+0.5;Q.b=(H.b+L.b)*0.5;aa=wa(F,H,L,Q);pa(t,G,I,O,P,R,0,0,1,0,0,1,aa)}else if(i instanceof THREE.MeshNormalMaterial){D.r=qa(l.normalWorld.x);D.g=qa(l.normalWorld.y);D.b=qa(l.normalWorld.z);i.wireframe===true?ha(D,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(D)}}function v(a,d,f,g,k,j,l,i,o){e.info.render.vertices=e.info.render.vertices+4;e.info.render.faces++;b(i.opacity);c(i.blending);if(i.map!==void 0&&i.map!==null||i.envMap!==void 0&&i.envMap!==null){u(a,d,g,0,1,3,l,i,o);u(k,f,
|
|
|
+j,1,2,3,l,i,o)}else{t=a.positionScreen.x;G=a.positionScreen.y;I=d.positionScreen.x;O=d.positionScreen.y;P=f.positionScreen.x;R=f.positionScreen.y;z=g.positionScreen.x;S=g.positionScreen.y;$=k.positionScreen.x;J=k.positionScreen.y;U=j.positionScreen.x;T=j.positionScreen.y;if(i instanceof THREE.MeshBasicMaterial){B(t,G,I,O,P,R,z,S);i.wireframe===true?ha(i.color,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(i.color)}else if(i instanceof THREE.MeshLambertMaterial)if(ua===true)if(!i.wireframe&&
|
|
|
+i.shading==THREE.SmoothShading&&l.vertexNormalsWorld.length==4){F.r=H.r=L.r=Q.r=Z.r;F.g=H.g=L.g=Q.g=Z.g;F.b=H.b=L.b=Q.b=Z.b;n(m,l.v1.positionWorld,l.vertexNormalsWorld[0],F);n(m,l.v2.positionWorld,l.vertexNormalsWorld[1],H);n(m,l.v4.positionWorld,l.vertexNormalsWorld[3],L);n(m,l.v3.positionWorld,l.vertexNormalsWorld[2],Q);F.r=Math.max(0,Math.min(i.color.r*F.r,1));F.g=Math.max(0,Math.min(i.color.g*F.g,1));F.b=Math.max(0,Math.min(i.color.b*F.b,1));H.r=Math.max(0,Math.min(i.color.r*H.r,1));H.g=Math.max(0,
|
|
|
+Math.min(i.color.g*H.g,1));H.b=Math.max(0,Math.min(i.color.b*H.b,1));L.r=Math.max(0,Math.min(i.color.r*L.r,1));L.g=Math.max(0,Math.min(i.color.g*L.g,1));L.b=Math.max(0,Math.min(i.color.b*L.b,1));Q.r=Math.max(0,Math.min(i.color.r*Q.r,1));Q.g=Math.max(0,Math.min(i.color.g*Q.g,1));Q.b=Math.max(0,Math.min(i.color.b*Q.b,1));aa=wa(F,H,L,Q);x(t,G,I,O,z,S);pa(t,G,I,O,z,S,0,0,1,0,0,1,aa);x($,J,P,R,U,T);pa($,J,P,R,U,T,1,0,1,1,0,1,aa)}else{D.r=Z.r;D.g=Z.g;D.b=Z.b;n(m,l.centroidWorld,l.normalWorld,D);D.r=Math.max(0,
|
|
|
+Math.min(i.color.r*D.r,1));D.g=Math.max(0,Math.min(i.color.g*D.g,1));D.b=Math.max(0,Math.min(i.color.b*D.b,1));B(t,G,I,O,P,R,z,S);i.wireframe===true?ha(D,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(D)}else{B(t,G,I,O,P,R,z,S);i.wireframe===true?ha(i.color,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(i.color)}else if(i instanceof THREE.MeshNormalMaterial){D.r=qa(l.normalWorld.x);D.g=qa(l.normalWorld.y);D.b=qa(l.normalWorld.z);B(t,G,I,O,P,R,z,S);i.wireframe===true?
|
|
|
+ha(D,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):fa(D)}else if(i instanceof THREE.MeshDepthMaterial){Y=h.near;ca=h.far;F.r=F.g=F.b=1-oa(a.positionScreen.z,Y,ca);H.r=H.g=H.b=1-oa(d.positionScreen.z,Y,ca);L.r=L.g=L.b=1-oa(g.positionScreen.z,Y,ca);Q.r=Q.g=Q.b=1-oa(f.positionScreen.z,Y,ca);aa=wa(F,H,L,Q);x(t,G,I,O,z,S);pa(t,G,I,O,z,S,0,0,1,0,0,1,aa);x($,J,P,R,U,T);pa($,J,P,R,U,T,1,0,1,1,0,1,aa)}}}function x(a,b,c,d,e,f){l.beginPath();l.moveTo(a,b);l.lineTo(c,d);l.lineTo(e,f);l.lineTo(a,
|
|
|
b)}function B(a,b,c,d,e,f,g,h){l.beginPath();l.moveTo(a,b);l.lineTo(c,d);l.lineTo(e,f);l.lineTo(g,h);l.lineTo(a,b)}function ha(a,b,c,e){if(A!==b)A=l.lineWidth=b;if(y!==c)y=l.lineCap=c;if(E!==e)E=l.lineJoin=e;d(a.getContextStyle());l.stroke();X.inflate(b*2)}function fa(a){f(a.getContextStyle());l.fill()}function Fa(a,b,c,d,e,g,h,i,k,j,m,n,o){if(!(o.image===void 0||o.image.width===0)){if(o.needsUpdate===true||ja[o.id]===void 0){var p=o.wrapS==THREE.RepeatWrapping,q=o.wrapT==THREE.RepeatWrapping;ja[o.id]=
|
|
|
l.createPattern(o.image,p===true&&q===true?"repeat":p===true&&q===false?"repeat-x":p===false&&q===true?"repeat-y":"no-repeat");o.needsUpdate=false}f(ja[o.id]);var p=o.offset.x/o.repeat.x,q=o.offset.y/o.repeat.y,r=o.image.width*o.repeat.x,s=o.image.height*o.repeat.y,h=(h+p)*r,i=(1-i+q)*s,c=c-a,d=d-b,e=e-a,g=g-b,k=(k+p)*r-h,j=(1-j+q)*s-i,m=(m+p)*r-h,n=(1-n+q)*s-i,p=k*n-m*j;if(p===0){if(ka[o.id]===void 0){b=document.createElement("canvas");b.width=o.image.width;b.height=o.image.height;b=b.getContext("2d");
|
|
|
b.drawImage(o.image,0,0);ka[o.id]=b.getImageData(0,0,o.image.width,o.image.height).data}b=ka[o.id];h=(Math.floor(h)+Math.floor(i)*o.image.width)*4;D.setRGB(b[h]/255,b[h+1]/255,b[h+2]/255);fa(D)}else{p=1/p;o=(n*c-j*e)*p;j=(n*d-j*g)*p;c=(k*e-m*c)*p;d=(k*g-m*d)*p;a=a-o*h-c*i;h=b-j*h-d*i;l.save();l.transform(o,j,c,d,a,h);l.fill();l.restore()}}}function pa(a,b,c,d,e,f,g,h,i,j,k,m,n){var o,p;o=n.width-1;p=n.height-1;g=g*o;h=h*p;c=c-a;d=d-b;e=e-a;f=f-b;i=i*o-g;j=j*p-h;k=k*o-g;m=m*p-h;p=1/(i*m-k*j);o=(m*
|
|
@@ -239,9 +239,9 @@ c-j*e)*p;j=(m*d-j*f)*p;c=(i*e-k*c)*p;d=(i*f-k*d)*p;a=a-o*g-c*h;b=b-j*g-d*h;l.sav
|
|
|
255:i;da[9]=j<0?0:j>255?255:j;da[10]=c<0?0:c>255?255:c;da[12]=k<0?0:k>255?255:k;da[13]=l<0?0:l>255?255:l;da[14]=d<0?0:d>255?255:d;sa.putImageData(ya,0,0);va.drawImage(ra,0,0);return ta}function oa(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function qa(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function ia(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!==0){e=1/Math.sqrt(e);c=c*e;d=d*e;b.x=b.x+c;b.y=b.y+d;a.x=a.x-c;a.y=a.y-d}}var xa,Ga,W,ea;this.autoClear===true?this.clear():l.setTransform(1,0,0,-1,o,q);e.info.render.vertices=
|
|
|
0;e.info.render.faces=0;g=k.projectScene(a,h,this.sortElements);j=g.elements;m=g.lights;ua=m.length>0;ua===true&&i(m);xa=0;for(Ga=j.length;xa<Ga;xa++){W=j[xa];ea=W.material;ea=ea instanceof THREE.MeshFaceMaterial?W.faceMaterial:ea;if(!(ea===void 0||ea.visible===false)){X.empty();if(W instanceof THREE.RenderableParticle){s=W;s.x=s.x*o;s.y=s.y*q;p(s,W,ea,a)}else if(W instanceof THREE.RenderableLine){s=W.v1;w=W.v2;s.positionScreen.x=s.positionScreen.x*o;s.positionScreen.y=s.positionScreen.y*q;w.positionScreen.x=
|
|
|
w.positionScreen.x*o;w.positionScreen.y=w.positionScreen.y*q;X.addPoint(s.positionScreen.x,s.positionScreen.y);X.addPoint(w.positionScreen.x,w.positionScreen.y);ga.intersects(X)===true&&r(s,w,W,ea,a)}else if(W instanceof THREE.RenderableFace3){s=W.v1;w=W.v2;C=W.v3;s.positionScreen.x=s.positionScreen.x*o;s.positionScreen.y=s.positionScreen.y*q;w.positionScreen.x=w.positionScreen.x*o;w.positionScreen.y=w.positionScreen.y*q;C.positionScreen.x=C.positionScreen.x*o;C.positionScreen.y=C.positionScreen.y*
|
|
|
-q;if(ea.overdraw===true){ia(s.positionScreen,w.positionScreen);ia(w.positionScreen,C.positionScreen);ia(C.positionScreen,s.positionScreen)}X.add3Points(s.positionScreen.x,s.positionScreen.y,w.positionScreen.x,w.positionScreen.y,C.positionScreen.x,C.positionScreen.y);ga.intersects(X)===true&&u(s,w,C,0,1,2,W,ea,a)}else if(W instanceof THREE.RenderableFace4){s=W.v1;w=W.v2;C=W.v3;J=W.v4;s.positionScreen.x=s.positionScreen.x*o;s.positionScreen.y=s.positionScreen.y*q;w.positionScreen.x=w.positionScreen.x*
|
|
|
-o;w.positionScreen.y=w.positionScreen.y*q;C.positionScreen.x=C.positionScreen.x*o;C.positionScreen.y=C.positionScreen.y*q;J.positionScreen.x=J.positionScreen.x*o;J.positionScreen.y=J.positionScreen.y*q;L.positionScreen.copy(w.positionScreen);M.positionScreen.copy(J.positionScreen);if(ea.overdraw===true){ia(s.positionScreen,w.positionScreen);ia(w.positionScreen,J.positionScreen);ia(J.positionScreen,s.positionScreen);ia(C.positionScreen,L.positionScreen);ia(C.positionScreen,M.positionScreen)}X.addPoint(s.positionScreen.x,
|
|
|
-s.positionScreen.y);X.addPoint(w.positionScreen.x,w.positionScreen.y);X.addPoint(C.positionScreen.x,C.positionScreen.y);X.addPoint(J.positionScreen.x,J.positionScreen.y);ga.intersects(X)===true&&v(s,w,C,J,L,M,W,ea,a)}ba.addRectangle(X)}}l.setTransform(1,0,0,1,0,0)}};THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=true};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
|
|
|
+q;if(ea.overdraw===true){ia(s.positionScreen,w.positionScreen);ia(w.positionScreen,C.positionScreen);ia(C.positionScreen,s.positionScreen)}X.add3Points(s.positionScreen.x,s.positionScreen.y,w.positionScreen.x,w.positionScreen.y,C.positionScreen.x,C.positionScreen.y);ga.intersects(X)===true&&u(s,w,C,0,1,2,W,ea,a)}else if(W instanceof THREE.RenderableFace4){s=W.v1;w=W.v2;C=W.v3;K=W.v4;s.positionScreen.x=s.positionScreen.x*o;s.positionScreen.y=s.positionScreen.y*q;w.positionScreen.x=w.positionScreen.x*
|
|
|
+o;w.positionScreen.y=w.positionScreen.y*q;C.positionScreen.x=C.positionScreen.x*o;C.positionScreen.y=C.positionScreen.y*q;K.positionScreen.x=K.positionScreen.x*o;K.positionScreen.y=K.positionScreen.y*q;M.positionScreen.copy(w.positionScreen);N.positionScreen.copy(K.positionScreen);if(ea.overdraw===true){ia(s.positionScreen,w.positionScreen);ia(w.positionScreen,K.positionScreen);ia(K.positionScreen,s.positionScreen);ia(C.positionScreen,M.positionScreen);ia(C.positionScreen,N.positionScreen)}X.addPoint(s.positionScreen.x,
|
|
|
+s.positionScreen.y);X.addPoint(w.positionScreen.x,w.positionScreen.y);X.addPoint(C.positionScreen.x,C.positionScreen.y);X.addPoint(K.positionScreen.x,K.positionScreen.y);ga.intersects(X)===true&&v(s,w,C,K,M,N,W,ea,a)}ba.addRectangle(X)}}l.setTransform(1,0,0,1,0,0)}};THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=true};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
|
|
|
THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterial=this.material=null;this.uvs=[[]];this.z=null};
|
|
|
THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterial=this.material=null;this.uvs=[[]];this.z=null};THREE.RenderableObject=function(){this.z=this.object=null};
|
|
|
THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=this.object=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.material=null};
|