|
@@ -49,26 +49,26 @@ THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){this.min.copy(a);
|
|
|
this.min.copy(a).subSelf(c);this.max.copy(a).addSelf(c);return this},copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=this.min.y=this.min.z=Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(a){return(a||new THREE.Vector3).add(this.min,this.max).multiplyScalar(0.5)},size:function(a){return(a||new THREE.Vector3).sub(this.max,
|
|
|
this.min)},expandByPoint:function(a){this.min.minSelf(a);this.max.maxSelf(a);return this},expandByVector:function(a){this.min.subSelf(a);this.max.addSelf(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},containsPoint:function(a){return this.min.x<=a.x&&a.x<=this.max.x&&this.min.y<=a.y&&a.y<=this.max.y&&this.min.z<=a.z&&a.z<=this.max.z?!0:!1},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&
|
|
|
this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a){return new THREE.Vector3((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>this.max.y||a.max.z<this.min.z||a.min.z>this.max.z?!1:!0},clampPoint:function(a,b){b||new THREE.Vector3;return(new THREE.Vector3).copy(a).clampSelf(this.min,this.max)},distanceToPoint:function(a){return THREE.Box3.__v1.copy(a).clampSelf(this.min,
|
|
|
-this.max).subSelf(a).length()},intersect:function(a){this.min.maxSelf(a.min);this.max.minSelf(a.max);return this},union:function(a){this.min.minSelf(a.min);this.max.maxSelf(a.max);return this},transform:function(a){a=[a.multiplyVector3(THREE.Box3.__v0.set(this.min.x,this.min.y,this.min.z)),a.multiplyVector3(THREE.Box3.__v1.set(this.min.x,this.min.y,this.max.z)),a.multiplyVector3(THREE.Box3.__v2.set(this.min.x,this.max.y,this.min.z)),a.multiplyVector3(THREE.Box3.__v3.set(this.min.x,this.max.y,this.max.z)),
|
|
|
-a.multiplyVector3(THREE.Box3.__v4.set(this.max.x,this.min.y,this.min.z)),a.multiplyVector3(THREE.Box3.__v5.set(this.max.x,this.min.y,this.max.z)),a.multiplyVector3(THREE.Box3.__v6.set(this.max.x,this.max.y,this.min.z)),a.multiplyVector3(THREE.Box3.__v7.set(this.max.x,this.max.y,this.max.z))];this.makeEmpty();this.setFromPoints(a);return this},translate:function(a){this.min.addSelf(a);this.max.addSelf(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}};
|
|
|
-THREE.Box3.__v0=new THREE.Vector3;THREE.Box3.__v1=new THREE.Vector3;THREE.Box3.__v2=new THREE.Vector3;THREE.Box3.__v3=new THREE.Vector3;THREE.Box3.__v4=new THREE.Vector3;THREE.Box3.__v5=new THREE.Vector3;THREE.Box3.__v6=new THREE.Vector3;THREE.Box3.__v7=new THREE.Vector3;THREE.Matrix3=function(){this.elements=new Float32Array(9)};
|
|
|
+this.max).subSelf(a).length()},getBoundingSphere:function(a){a=a||new THREE.Sphere;a.center=this.center();a.radius=0.5*this.size(THREE.Box3.__v0).length();return a},intersect:function(a){this.min.maxSelf(a.min);this.max.minSelf(a.max);return this},union:function(a){this.min.minSelf(a.min);this.max.maxSelf(a.max);return this},transform:function(a){a=[a.multiplyVector3(THREE.Box3.__v0.set(this.min.x,this.min.y,this.min.z)),a.multiplyVector3(THREE.Box3.__v1.set(this.min.x,this.min.y,this.max.z)),a.multiplyVector3(THREE.Box3.__v2.set(this.min.x,
|
|
|
+this.max.y,this.min.z)),a.multiplyVector3(THREE.Box3.__v3.set(this.min.x,this.max.y,this.max.z)),a.multiplyVector3(THREE.Box3.__v4.set(this.max.x,this.min.y,this.min.z)),a.multiplyVector3(THREE.Box3.__v5.set(this.max.x,this.min.y,this.max.z)),a.multiplyVector3(THREE.Box3.__v6.set(this.max.x,this.max.y,this.min.z)),a.multiplyVector3(THREE.Box3.__v7.set(this.max.x,this.max.y,this.max.z))];this.makeEmpty();this.setFromPoints(a);return this},translate:function(a){this.min.addSelf(a);this.max.addSelf(a);
|
|
|
+return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}};THREE.Box3.__v0=new THREE.Vector3;THREE.Box3.__v1=new THREE.Vector3;THREE.Box3.__v2=new THREE.Vector3;THREE.Box3.__v3=new THREE.Vector3;THREE.Box3.__v4=new THREE.Vector3;THREE.Box3.__v5=new THREE.Vector3;THREE.Box3.__v6=new THREE.Vector3;THREE.Box3.__v7=new THREE.Vector3;THREE.Matrix3=function(){this.elements=new Float32Array(9)};
|
|
|
THREE.Matrix3.prototype={constructor:THREE.Matrix3,multiplyVector3:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z;a.x=b[0]*c+b[3]*d+b[6]*e;a.y=b[1]*c+b[4]*d+b[7]*e;a.z=b[2]*c+b[5]*d+b[8]*e;return a},multiplyVector3Array:function(a){for(var b=THREE.Matrix3.__v1,c=0,d=a.length;c<d;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},getInverse:function(a){var b=a.elements,a=b[10]*b[5]-b[6]*b[9],c=-b[10]*b[1]+b[2]*b[9],d=b[6]*b[1]-b[2]*b[5],e=-b[10]*
|
|
|
b[4]+b[6]*b[8],f=b[10]*b[0]-b[2]*b[8],g=-b[6]*b[0]+b[2]*b[4],h=b[9]*b[4]-b[5]*b[8],i=-b[9]*b[0]+b[1]*b[8],k=b[5]*b[0]-b[1]*b[4],b=b[0]*a+b[1]*e+b[2]*h;0===b&&console.warn("Matrix3.getInverse(): determinant == 0");var b=1/b,n=this.elements;n[0]=b*a;n[1]=b*c;n[2]=b*d;n[3]=b*e;n[4]=b*f;n[5]=b*g;n[6]=b*h;n[7]=b*i;n[8]=b*k;return this},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.elements;
|
|
|
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.Matrix3.__v1=new THREE.Vector3;THREE.Matrix4=function(a,b,c,d,e,f,g,h,i,k,n,p,m,r,s,l){this.elements=new Float32Array(16);this.set(void 0!==a?a:1,b||0,c||0,d||0,e||0,void 0!==f?f:1,g||0,h||0,i||0,k||0,void 0!==n?n:1,p||0,m||0,r||0,s||0,void 0!==l?l:1)};
|
|
|
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,i,k,n,p,m,r,s,l){var q=this.elements;q[0]=a;q[4]=b;q[8]=c;q[12]=d;q[1]=e;q[5]=f;q[9]=g;q[13]=h;q[2]=i;q[6]=k;q[10]=n;q[14]=p;q[3]=m;q[7]=r;q[11]=s;q[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,
|
|
|
-e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();0===g.length()&&(g.z=1);e.cross(c,g).normalize();0===e.length()&&(g.x+=1E-4,e.cross(c,g).normalize());f.cross(g,e);d[0]=e.x;d[4]=f.x;d[8]=g.x;d[1]=e.y;d[5]=f.y;d[9]=g.y;d[2]=e.z;d[6]=f.z;d[10]=g.z;return this},multiply:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],i=c[12],k=c[1],n=c[5],p=c[9],m=c[13],r=c[2],s=c[6],l=c[10],q=c[14],u=c[3],B=c[7],x=c[11],c=c[15],t=d[0],F=d[4],C=d[8],
|
|
|
-z=d[12],A=d[1],H=d[5],G=d[9],I=d[13],$=d[2],D=d[6],L=d[10],y=d[14],K=d[3],J=d[7],R=d[11],d=d[15];e[0]=f*t+g*A+h*$+i*K;e[4]=f*F+g*H+h*D+i*J;e[8]=f*C+g*G+h*L+i*R;e[12]=f*z+g*I+h*y+i*d;e[1]=k*t+n*A+p*$+m*K;e[5]=k*F+n*H+p*D+m*J;e[9]=k*C+n*G+p*L+m*R;e[13]=k*z+n*I+p*y+m*d;e[2]=r*t+s*A+l*$+q*K;e[6]=r*F+s*H+l*D+q*J;e[10]=r*C+s*G+l*L+q*R;e[14]=r*z+s*I+l*y+q*d;e[3]=u*t+B*A+x*$+c*K;e[7]=u*F+B*H+x*D+c*J;e[11]=u*C+B*G+x*L+c*R;e[15]=u*z+B*I+x*y+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]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){var b=this.elements,
|
|
|
-c=a.x,d=a.y,e=a.z,f=1/(b[3]*c+b[7]*d+b[11]*e+b[15]);a.x=(b[0]*c+b[4]*d+b[8]*e+b[12])*f;a.y=(b[1]*c+b[5]*d+b[9]*e+b[13])*f;a.z=(b[2]*c+b[6]*d+b[10]*e+b[14])*f;return a},multiplyVector4:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w;a.x=b[0]*c+b[4]*d+b[8]*e+b[12]*f;a.y=b[1]*c+b[5]*d+b[9]*e+b[13]*f;a.z=b[2]*c+b[6]*d+b[10]*e+b[14]*f;a.w=b[3]*c+b[7]*d+b[11]*e+b[15]*f;return a},multiplyVector3Array:function(a){for(var b=THREE.Matrix4.__v1,c=0,d=a.length;c<d;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,e=a.z;a.x=c*b[0]+d*b[4]+e*b[8];a.y=c*b[1]+d*b[5]+e*b[9];a.z=c*b[2]+d*b[6]+e*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]*a.z+b[15]*a.w:1;return c},determinant:function(){var a=
|
|
|
-this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],i=a[13],k=a[2],n=a[6],p=a[10],m=a[14],r=a[3],s=a[7],l=a[11],a=a[15];return e*h*n*r-d*i*n*r-e*g*p*r+c*i*p*r+d*g*m*r-c*h*m*r-e*h*k*s+d*i*k*s+e*f*p*s-b*i*p*s-d*f*m*s+b*h*m*s+e*g*k*l-c*i*k*l-e*f*n*l+b*i*n*l+c*f*m*l-b*g*m*l-d*g*k*a+c*h*k*a+d*f*n*a-b*h*n*a-c*f*p*a+b*g*p*a},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=
|
|
|
-a[11];a[11]=a[14];a[14]=b;return this},flattenToArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+
|
|
|
-14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[12],a[13],a[14])},setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getColumnX:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[0],a[1],a[2])},getColumnY:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[4],a[5],a[6])},getColumnZ:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[8],a[9],a[10])},getInverse:function(a){var b=
|
|
|
-this.elements,c=a.elements,d=c[0],e=c[4],f=c[8],g=c[12],h=c[1],i=c[5],k=c[9],n=c[13],p=c[2],m=c[6],r=c[10],s=c[14],l=c[3],q=c[7],u=c[11],c=c[15];b[0]=k*s*q-n*r*q+n*m*u-i*s*u-k*m*c+i*r*c;b[4]=g*r*q-f*s*q-g*m*u+e*s*u+f*m*c-e*r*c;b[8]=f*n*q-g*k*q+g*i*u-e*n*u-f*i*c+e*k*c;b[12]=g*k*m-f*n*m-g*i*r+e*n*r+f*i*s-e*k*s;b[1]=n*r*l-k*s*l-n*p*u+h*s*u+k*p*c-h*r*c;b[5]=f*s*l-g*r*l+g*p*u-d*s*u-f*p*c+d*r*c;b[9]=g*k*l-f*n*l-g*h*u+d*n*u+f*h*c-d*k*c;b[13]=f*n*p-g*k*p+g*h*r-d*n*r-f*h*s+d*k*s;b[2]=i*s*l-n*m*l+n*p*q-h*s*
|
|
|
-q-i*p*c+h*m*c;b[6]=g*m*l-e*s*l-g*p*q+d*s*q+e*p*c-d*m*c;b[10]=e*n*l-g*i*l+g*h*q-d*n*q-e*h*c+d*i*c;b[14]=g*i*p-e*n*p-g*h*m+d*n*m+e*h*s-d*i*s;b[3]=k*m*l-i*r*l-k*p*q+h*r*q+i*p*u-h*m*u;b[7]=e*r*l-f*m*l+f*p*q-d*r*q-e*p*u+d*m*u;b[11]=f*i*l-e*k*l-f*h*q+d*k*q+e*h*u-d*i*u;b[15]=e*k*p-f*i*p+f*h*m-d*k*m-e*h*r+d*i*r;this.multiplyScalar(1/a.determinant());return this},setRotationFromEuler:function(a,b){var c=this.elements,d=a.x,e=a.y,f=a.z,g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e),i=Math.cos(f),f=
|
|
|
-Math.sin(f);if(void 0===b||"XYZ"===b){var k=g*i,n=g*f,p=d*i,m=d*f;c[0]=h*i;c[4]=-h*f;c[8]=e;c[1]=n+p*e;c[5]=k-m*e;c[9]=-d*h;c[2]=m-k*e;c[6]=p+n*e;c[10]=g*h}else"YXZ"===b?(k=h*i,n=h*f,p=e*i,m=e*f,c[0]=k+m*d,c[4]=p*d-n,c[8]=g*e,c[1]=g*f,c[5]=g*i,c[9]=-d,c[2]=n*d-p,c[6]=m+k*d,c[10]=g*h):"ZXY"===b?(k=h*i,n=h*f,p=e*i,m=e*f,c[0]=k-m*d,c[4]=-g*f,c[8]=p+n*d,c[1]=n+p*d,c[5]=g*i,c[9]=m-k*d,c[2]=-g*e,c[6]=d,c[10]=g*h):"ZYX"===b?(k=g*i,n=g*f,p=d*i,m=d*f,c[0]=h*i,c[4]=p*e-n,c[8]=k*e+m,c[1]=h*f,c[5]=m*e+k,c[9]=
|
|
|
-n*e-p,c[2]=-e,c[6]=d*h,c[10]=g*h):"YZX"===b?(k=g*h,n=g*e,p=d*h,m=d*e,c[0]=h*i,c[4]=m-k*f,c[8]=p*f+n,c[1]=f,c[5]=g*i,c[9]=-d*i,c[2]=-e*i,c[6]=n*f+p,c[10]=k-m*f):"XZY"===b&&(k=g*h,n=g*e,p=d*h,m=d*e,c[0]=h*i,c[4]=-f,c[8]=e*i,c[1]=k*f+m,c[5]=g*i,c[9]=n*f-p,c[2]=p*f-n,c[6]=d*i,c[10]=m*f+k);return this},setRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,i=e+e,a=c*g,k=c*h,c=c*i,n=d*h,d=d*i,e=e*i,g=f*g,h=f*h,f=f*i;b[0]=1-(n+e);b[4]=k-f;b[8]=c+h;b[1]=k+f;b[5]=1-(a+
|
|
|
-e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+n);return this},compose:function(a,b,c){var d=this.elements,e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2;e.identity();e.setRotationFromQuaternion(b);f.makeScale(c);this.multiply(e,f);d[12]=a.x;d[13]=a.y;d[14]=a.z;return this},decompose:function(a,b,c){var d=this.elements,e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;e.set(d[0],d[1],d[2]);f.set(d[4],d[5],d[6]);g.set(d[8],d[9],d[10]);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof
|
|
|
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,i,k,n,p,m,r,s,l){var q=this.elements;q[0]=a;q[4]=b;q[8]=c;q[12]=d;q[1]=e;q[5]=f;q[9]=g;q[13]=h;q[2]=i;q[6]=k;q[10]=n;q[14]=p;q[3]=m;q[7]=r;q[11]=s;q[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},setRotationFromEuler:function(a,b){var c=
|
|
|
+this.elements,d=a.x,e=a.y,f=a.z,g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e),i=Math.cos(f),f=Math.sin(f);if(void 0===b||"XYZ"===b){var k=g*i,n=g*f,p=d*i,m=d*f;c[0]=h*i;c[4]=-h*f;c[8]=e;c[1]=n+p*e;c[5]=k-m*e;c[9]=-d*h;c[2]=m-k*e;c[6]=p+n*e;c[10]=g*h}else"YXZ"===b?(k=h*i,n=h*f,p=e*i,m=e*f,c[0]=k+m*d,c[4]=p*d-n,c[8]=g*e,c[1]=g*f,c[5]=g*i,c[9]=-d,c[2]=n*d-p,c[6]=m+k*d,c[10]=g*h):"ZXY"===b?(k=h*i,n=h*f,p=e*i,m=e*f,c[0]=k-m*d,c[4]=-g*f,c[8]=p+n*d,c[1]=n+p*d,c[5]=g*i,c[9]=m-k*d,c[2]=-g*e,c[6]=
|
|
|
+d,c[10]=g*h):"ZYX"===b?(k=g*i,n=g*f,p=d*i,m=d*f,c[0]=h*i,c[4]=p*e-n,c[8]=k*e+m,c[1]=h*f,c[5]=m*e+k,c[9]=n*e-p,c[2]=-e,c[6]=d*h,c[10]=g*h):"YZX"===b?(k=g*h,n=g*e,p=d*h,m=d*e,c[0]=h*i,c[4]=m-k*f,c[8]=p*f+n,c[1]=f,c[5]=g*i,c[9]=-d*i,c[2]=-e*i,c[6]=n*f+p,c[10]=k-m*f):"XZY"===b&&(k=g*h,n=g*e,p=d*h,m=d*e,c[0]=h*i,c[4]=-f,c[8]=e*i,c[1]=k*f+m,c[5]=g*i,c[9]=n*f-p,c[2]=p*f-n,c[6]=d*i,c[10]=m*f+k);return this},setRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,i=e+
|
|
|
+e,a=c*g,k=c*h,c=c*i,n=d*h,d=d*i,e=e*i,g=f*g,h=f*h,f=f*i;b[0]=1-(n+e);b[4]=k-f;b[8]=c+h;b[1]=k+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+n);return this},lookAt:function(a,b,c){var d=this.elements,e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();0===g.length()&&(g.z=1);e.cross(c,g).normalize();0===e.length()&&(g.x+=1E-4,e.cross(c,g).normalize());f.cross(g,e);d[0]=e.x;d[4]=f.x;d[8]=g.x;d[1]=e.y;d[5]=f.y;d[9]=g.y;d[2]=e.z;d[6]=f.z;d[10]=g.z;return this},
|
|
|
+multiply:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],i=c[12],k=c[1],n=c[5],p=c[9],m=c[13],r=c[2],s=c[6],l=c[10],q=c[14],u=c[3],B=c[7],x=c[11],c=c[15],t=d[0],F=d[4],C=d[8],z=d[12],A=d[1],H=d[5],G=d[9],I=d[13],$=d[2],D=d[6],L=d[10],y=d[14],K=d[3],J=d[7],R=d[11],d=d[15];e[0]=f*t+g*A+h*$+i*K;e[4]=f*F+g*H+h*D+i*J;e[8]=f*C+g*G+h*L+i*R;e[12]=f*z+g*I+h*y+i*d;e[1]=k*t+n*A+p*$+m*K;e[5]=k*F+n*H+p*D+m*J;e[9]=k*C+n*G+p*L+m*R;e[13]=k*z+n*I+p*y+m*d;e[2]=r*t+s*A+l*$+q*K;e[6]=
|
|
|
+r*F+s*H+l*D+q*J;e[10]=r*C+s*G+l*L+q*R;e[14]=r*z+s*I+l*y+q*d;e[3]=u*t+B*A+x*$+c*K;e[7]=u*F+B*H+x*D+c*J;e[11]=u*C+B*G+x*L+c*R;e[15]=u*z+B*I+x*y+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]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=1/(b[3]*c+b[7]*d+b[11]*e+b[15]);a.x=(b[0]*c+b[4]*d+b[8]*e+b[12])*f;a.y=(b[1]*c+b[5]*d+b[9]*e+b[13])*f;a.z=(b[2]*c+b[6]*d+b[10]*e+b[14])*f;return a},multiplyVector4:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w;a.x=b[0]*c+b[4]*d+b[8]*e+b[12]*f;a.y=b[1]*c+b[5]*d+b[9]*
|
|
|
+e+b[13]*f;a.z=b[2]*c+b[6]*d+b[10]*e+b[14]*f;a.w=b[3]*c+b[7]*d+b[11]*e+b[15]*f;return a},multiplyVector3Array:function(a){for(var b=THREE.Matrix4.__v1,c=0,d=a.length;c<d;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,e=a.z;a.x=c*b[0]+d*b[4]+e*b[8];a.y=c*b[1]+d*b[5]+e*b[9];a.z=c*b[2]+d*b[6]+e*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]*a.z+b[15]*a.w:1;return c},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],i=a[13],k=a[2],n=a[6],p=a[10],m=a[14],r=a[3],s=a[7],l=a[11],a=a[15];return e*h*n*r-d*i*n*r-e*g*p*r+c*i*p*r+d*g*m*r-c*h*m*r-e*h*k*s+d*i*k*s+e*f*p*s-b*i*p*s-d*f*m*s+b*h*m*s+e*g*k*l-c*i*k*l-e*f*n*l+b*i*n*l+c*f*m*l-b*g*m*l-d*g*k*a+c*h*k*a+
|
|
|
+d*f*n*a-b*h*n*a-c*f*p*a+b*g*p*a},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a},flattenToArrayOffset:function(a,
|
|
|
+b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[12],a[13],a[14])},setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getColumnX:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[0],a[1],a[2])},
|
|
|
+getColumnY:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[4],a[5],a[6])},getColumnZ:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[8],a[9],a[10])},getInverse:function(a){var b=this.elements,c=a.elements,d=c[0],e=c[4],f=c[8],g=c[12],h=c[1],i=c[5],k=c[9],n=c[13],p=c[2],m=c[6],r=c[10],s=c[14],l=c[3],q=c[7],u=c[11],c=c[15];b[0]=k*s*q-n*r*q+n*m*u-i*s*u-k*m*c+i*r*c;b[4]=g*r*q-f*s*q-g*m*u+e*s*u+f*m*c-e*r*c;b[8]=f*n*q-g*k*q+g*i*u-e*n*u-f*i*c+e*k*c;b[12]=g*k*m-f*n*m-g*i*r+e*
|
|
|
+n*r+f*i*s-e*k*s;b[1]=n*r*l-k*s*l-n*p*u+h*s*u+k*p*c-h*r*c;b[5]=f*s*l-g*r*l+g*p*u-d*s*u-f*p*c+d*r*c;b[9]=g*k*l-f*n*l-g*h*u+d*n*u+f*h*c-d*k*c;b[13]=f*n*p-g*k*p+g*h*r-d*n*r-f*h*s+d*k*s;b[2]=i*s*l-n*m*l+n*p*q-h*s*q-i*p*c+h*m*c;b[6]=g*m*l-e*s*l-g*p*q+d*s*q+e*p*c-d*m*c;b[10]=e*n*l-g*i*l+g*h*q-d*n*q-e*h*c+d*i*c;b[14]=g*i*p-e*n*p-g*h*m+d*n*m+e*h*s-d*i*s;b[3]=k*m*l-i*r*l-k*p*q+h*r*q+i*p*u-h*m*u;b[7]=e*r*l-f*m*l+f*p*q-d*r*q-e*p*u+d*m*u;b[11]=f*i*l-e*k*l-f*h*q+d*k*q+e*h*u-d*i*u;b[15]=e*k*p-f*i*p+f*h*m-d*k*m-
|
|
|
+e*h*r+d*i*r;this.multiplyScalar(1/a.determinant());return this},compose:function(a,b,c){var d=this.elements,e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2;e.identity();e.setRotationFromQuaternion(b);f.makeScale(c);this.multiply(e,f);d[12]=a.x;d[13]=a.y;d[14]=a.z;return this},decompose:function(a,b,c){var d=this.elements,e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;e.set(d[0],d[1],d[2]);f.set(d[4],d[5],d[6]);g.set(d[8],d[9],d[10]);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof
|
|
|
THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=e.length();c.y=f.length();c.z=g.length();a.x=d[12];a.y=d[13];a.z=d[14];d=THREE.Matrix4.__m1;d.copy(this);d.elements[0]/=c.x;d.elements[1]/=c.x;d.elements[2]/=c.x;d.elements[4]/=c.y;d.elements[5]/=c.y;d.elements[6]/=c.y;d.elements[8]/=c.z;d.elements[9]/=c.z;d.elements[10]/=c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){var b=this.elements,a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=
|
|
|
a[14];return this},extractRotation:function(a){var b=this.elements,a=a.elements,c=THREE.Matrix4.__v1,d=1/c.set(a[0],a[1],a[2]).length(),e=1/c.set(a[4],a[5],a[6]).length(),c=1/c.set(a[8],a[9],a[10]).length();b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[8]=a[8]*c;b[9]=a[9]*c;b[10]=a[10]*c;return this},translate:function(a){var b=this.elements,c=a.x,d=a.y,a=a.z;b[12]=b[0]*c+b[4]*d+b[8]*a+b[12];b[13]=b[1]*c+b[5]*d+b[9]*a+b[13];b[14]=b[2]*c+b[6]*d+b[10]*a+b[14];b[15]=b[3]*
|
|
|
c+b[7]*d+b[11]*a+b[15];return this},rotateX:function(a){var b=this.elements,c=b[4],d=b[5],e=b[6],f=b[7],g=b[8],h=b[9],i=b[10],k=b[11],n=Math.cos(a),a=Math.sin(a);b[4]=n*c+a*g;b[5]=n*d+a*h;b[6]=n*e+a*i;b[7]=n*f+a*k;b[8]=n*g-a*c;b[9]=n*h-a*d;b[10]=n*i-a*e;b[11]=n*k-a*f;return this},rotateY:function(a){var b=this.elements,c=b[0],d=b[1],e=b[2],f=b[3],g=b[8],h=b[9],i=b[10],k=b[11],n=Math.cos(a),a=Math.sin(a);b[0]=n*c-a*g;b[1]=n*d-a*h;b[2]=n*e-a*i;b[3]=n*f-a*k;b[8]=n*g+a*c;b[9]=n*h+a*d;b[10]=n*i+a*e;b[11]=
|
|
@@ -76,8 +76,8 @@ n*k+a*f;return this},rotateZ:function(a){var b=this.elements,c=b[0],d=b[1],e=b[2
|
|
|
d+e*e+f*f),d=d/g,e=e/g,f=f/g,g=d*d,h=e*e,i=f*f,k=Math.cos(b),n=Math.sin(b),p=1-k,m=d*e*p,r=d*f*p,p=e*f*p,d=d*n,s=e*n,n=f*n,f=g+(1-g)*k,g=m+n,e=r-s,m=m-n,h=h+(1-h)*k,n=p+d,r=r+s,p=p-d,i=i+(1-i)*k,k=c[0],d=c[1],s=c[2],l=c[3],q=c[4],u=c[5],B=c[6],x=c[7],t=c[8],F=c[9],C=c[10],z=c[11];c[0]=f*k+g*q+e*t;c[1]=f*d+g*u+e*F;c[2]=f*s+g*B+e*C;c[3]=f*l+g*x+e*z;c[4]=m*k+h*q+n*t;c[5]=m*d+h*u+n*F;c[6]=m*s+h*B+n*C;c[7]=m*l+h*x+n*z;c[8]=r*k+p*q+i*t;c[9]=r*d+p*u+i*F;c[10]=r*s+p*B+i*C;c[11]=r*l+p*x+i*z;return this},scale:function(a){var b=
|
|
|
this.elements,c=a.x,d=a.y,a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a){this.set(1,0,0,a.x,0,1,0,a.y,0,0,1,a.z,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,
|
|
|
0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,i=e*f,k=e*g;this.set(i*f+c,i*g-d*h,i*h+d*g,0,i*g+d*h,k*g+c,k*h-d*f,0,i*h-d*g,k*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a){this.set(a.x,0,0,0,0,a.y,
|
|
|
-0,0,0,0,a.z,0,0,0,0,1);return this},makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){var a=c*Math.tan(a*Math.PI/360),e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,i=c-d,k=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+
|
|
|
-a)/h);g[1]=0;g[5]=2/i;g[9]=0;g[13]=-((c+d)/i);g[2]=0;g[6]=0;g[10]=-2/k;g[14]=-((f+e)/k);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},clone:function(){var a=this.elements;return new THREE.Matrix4(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])}};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;THREE.Ray=function(a,b){this.origin=void 0!==a?a.clone():new THREE.Vector3;this.direction=void 0!==b?b.clone():new THREE.Vector3};
|
|
|
+0,0,0,0,a.z,0,0,0,0,1);return this},makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){var a=c*Math.tan(THREE.Math.degToRad(0.5*a)),e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,i=c-d,k=f-e;g[0]=2/h;g[4]=0;g[8]=
|
|
|
+0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/i;g[9]=0;g[13]=-((c+d)/i);g[2]=0;g[6]=0;g[10]=-2/k;g[14]=-((f+e)/k);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},clone:function(){var a=this.elements;return new THREE.Matrix4(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])}};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;THREE.Ray=function(a,b){this.origin=void 0!==a?a.clone():new THREE.Vector3;this.direction=void 0!==b?b.clone():new THREE.Vector3};
|
|
|
THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).addSelf(this.origin)},recastSelf:function(a){this.origin.copy(this.at(a,THREE.Ray.__v1));return this},closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.sub(a,this.origin);var d=c.dot(this.direction);
|
|
|
return c.copy(this.direction).multiplyScalar(d).addSelf(this.origin)},distanceToPoint:function(a){var b=THREE.Ray.__v1.sub(a,this.origin).dot(this.direction);THREE.Ray.__v1.copy(this.direction).multiplyScalar(b).addSelf(this.origin);return THREE.Ray.__v1.distanceTo(a)},isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},isIntersectionPlane:function(a){return 0!=a.normal.dot(this.direction)||0==a.distanceToPoint(this.origin)?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);
|
|
|
if(0==b){if(0==a.distanceToPoint(this.origin))return 0}else return-(this.origin.dot(a.normal)+a.constant)/b},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return void 0===c?void 0:this.at(c,b)},transform:function(a){this.direction=a.multiplyVector3(this.direction.addSelf(this.origin));this.origin=a.multiplyVector3(this.origin);this.direction.subSelf(this.origin);return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}};
|
|
@@ -89,16 +89,16 @@ this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.l
|
|
|
b){var c=this.distanceToPoint(a),d=this.distanceToPoint(b);return 0>c&&0<d||0>d&&0<c},coplanarPoint:function(a){return(a||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},transform:function(a,b){var c=THREE.Plane.__v1,d=THREE.Plane.__v2,b=b||(new THREE.Matrix3).getInverse(a).transpose(),c=b.multiplyVector3(c.copy(this.normal)),d=this.coplanarPoint(d),d=a.multiplyVector3(d);this.setFromNormalAndCoplanarPoint(c,d);return this},translate:function(a){this.constant-=a.dot(this.normal);
|
|
|
return this},equals:function(a){return a.normal.equals(this.normal)&&a.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}};THREE.Plane.__vZero=new THREE.Vector3(0,0,0);THREE.Plane.__v1=new THREE.Vector3;THREE.Plane.__v2=new THREE.Vector3;THREE.Sphere=function(a,b){this.center=void 0===a?new THREE.Vector3:a.clone();this.radius=void 0===b?0:b};
|
|
|
THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromCenterAndPoints:function(a,b){for(var c=0,d=0,e=b.length;d<e;d++)var f=a.distanceToSquared(b[d]),c=Math.max(c,f);this.center=a;this.radius=Math.sqrt(c);return this},copy:function(a){this.center.copy(a.center);this.radius=a.radius;return this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-
|
|
|
-this.radius},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.subSelf(this.center).normalize(),d.multiplyScalar(this.radius).addSelf(this.center));return d},bounds:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);return a},transform:function(a){this.center=a.multiplyVector3(this.center);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.addSelf(a);
|
|
|
-return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};THREE.Math={clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(0.5-Math.random())},sign:function(a){return 0>a?-1:0<a?1:0},degreesToRadians:function(a){return a*THREE.Math.__d2r},
|
|
|
-radiansToDegrees:function(a){return a*THREE.Math.__r2d}};THREE.Math.__d2r=Math.PI/180;THREE.Math.__r2d=180/Math.PI;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};
|
|
|
+this.radius},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.subSelf(this.center).normalize(),d.multiplyScalar(this.radius).addSelf(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);return a},transform:function(a){this.center=a.multiplyVector3(this.center);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.addSelf(a);
|
|
|
+return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};THREE.Math={clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(0.5-Math.random())},sign:function(a){return 0>a?-1:0<a?1:0},degToRad:function(a){return a*THREE.Math.__d2r},radToDeg:function(a){return a*
|
|
|
+THREE.Math.__r2d}};THREE.Math.__d2r=Math.PI/180;THREE.Math.__r2d=180/Math.PI;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,b){var c=Math.cos(a.x/2),d=Math.cos(a.y/2),e=Math.cos(a.z/2),f=Math.sin(a.x/2),g=Math.sin(a.y/2),h=Math.sin(a.z/2);void 0===b||"XYZ"===b?(this.x=f*d*e+c*g*h,this.y=c*g*e-f*d*h,this.z=c*d*h+f*g*e,this.w=c*d*e-f*g*h):"YXZ"===b?(this.x=f*d*e+c*g*h,this.y=c*g*e-f*d*h,this.z=c*d*
|
|
|
h-f*g*e,this.w=c*d*e+f*g*h):"ZXY"===b?(this.x=f*d*e-c*g*h,this.y=c*g*e+f*d*h,this.z=c*d*h+f*g*e,this.w=c*d*e-f*g*h):"ZYX"===b?(this.x=f*d*e-c*g*h,this.y=c*g*e+f*d*h,this.z=c*d*h-f*g*e,this.w=c*d*e+f*g*h):"YZX"===b?(this.x=f*d*e+c*g*h,this.y=c*g*e+f*d*h,this.z=c*d*h-f*g*e,this.w=c*d*e-f*g*h):"XZY"===b&&(this.x=f*d*e-c*g*h,this.y=c*g*e-f*d*h,this.z=c*d*h+f*g*e,this.w=c*d*e+f*g*h);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=a.elements,c=b[0],a=b[4],d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],i=b[6],b=b[10],k=c+f+b;0<k?(c=0.5/Math.sqrt(k+1),this.w=0.25/c,this.x=(i-g)*c,this.y=(d-h)*c,this.z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this.w=(i-g)/c,this.x=0.25*c,this.y=(a+e)/c,this.z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this.w=(d-h)/c,this.x=(a+e)/c,this.y=0.25*c,this.z=(g+i)/c):(c=2*Math.sqrt(1+b-c-f),this.w=(e-a)/c,this.x=(d+h)/c,this.y=(g+i)/c,this.z=0.25*c);return this},inverse:function(){this.conjugate().normalize();
|
|
|
-return this},conjugate: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.z=this.y=this.x=0,this.w=1):(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiply:function(a,b){var c=a.x,d=a.y,e=a.z,f=a.w,g=b.x,h=b.y,i=b.z,k=b.w;this.x=c*k+d*i-e*h+f*g;this.y=-c*i+d*k+e*g+f*h;this.z=c*h-
|
|
|
-d*g+e*k+f*i;this.w=-c*g-d*h-e*i+f*k;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,i=this.w,k=i*c+g*e-h*d,n=i*d+h*c-f*e,p=i*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=k*i+c*-f+n*-h-p*-g;b.y=n*i+c*-g+p*-f-k*-h;b.z=p*i+c*-h+k*-g-n*-f;return b},slerpSelf:function(a,b){var c=
|
|
|
-this.x,d=this.y,e=this.z,f=this.w,g=f*a.w+c*a.x+d*a.y+e*a.z;0>g?(this.w=-a.w,this.x=-a.x,this.y=-a.y,this.z=-a.z,g=-g):this.copy(a);if(1<=g)return this.w=f,this.x=c,this.y=d,this.z=e,this;var h=Math.acos(g),i=Math.sqrt(1-g*g);if(0.001>Math.abs(i))return this.w=0.5*(f+this.w),this.x=0.5*(c+this.x),this.y=0.5*(d+this.y),this.z=0.5*(e+this.z),this;g=Math.sin((1-b)*h)/i;h=Math.sin(b*h)/i;this.w=f*g+this.w*h;this.x=c*g+this.x*h;this.y=d*g+this.y*h;this.z=e*g+this.z*h;return this},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 b=Math.acos(e),f=Math.sqrt(1-e*e);if(0.001>Math.abs(f))return c.w=0.5*(a.w+c.w),c.x=0.5*(a.x+c.x),c.y=0.5*(a.y+c.y),c.z=0.5*(a.z+c.z),c;e=Math.sin((1-d)*b)/f;d=Math.sin(d*b)/f;c.w=a.w*e+c.w*d;c.x=a.x*e+c.x*d;c.y=a.y*e+c.y*d;c.z=a.z*e+c.z*d;return c};THREE.Spline=function(a){function b(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}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,i,k,n,p,m;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:
|
|
|
+return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0],a=b[4],d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],i=b[6],b=b[10],k=c+f+b;0<k?(c=0.5/Math.sqrt(k+1),this.w=0.25/c,this.x=(i-g)*c,this.y=(d-h)*c,this.z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this.w=(i-g)/c,this.x=0.25*c,this.y=(a+e)/c,this.z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this.w=(d-h)/c,this.x=(a+e)/c,this.y=0.25*c,this.z=(g+i)/c):(c=2*Math.sqrt(1+b-c-f),this.w=(e-a)/c,this.x=(d+h)/c,this.y=(g+i)/c,this.z=0.25*c);return this},add:function(a,
|
|
|
+b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},lengthSq:function(){return this.x*this.x+this.y*
|
|
|
+this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){var a=this.length();0===a?(this.z=this.y=this.x=0,this.w=1):(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiply:function(a,b){this.copy(a);return this.multiplySelf(b)},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,i=this.w,k=i*c+g*e-h*d,n=i*d+h*c-f*e,p=i*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=k*i+c*-f+n*-h-p*-g;b.y=n*i+c*-g+p*-f-k*-h;b.z=p*i+c*-h+k*-g-n*-f;return b},slerpSelf:function(a,b){var c=this.x,d=this.y,e=this.z,f=this.w,g=f*a.w+c*a.x+d*a.y+e*a.z;0>g?(this.w=-a.w,this.x=-a.x,this.y=-a.y,this.z=-a.z,g=-g):this.copy(a);if(1<=g)return this.w=f,this.x=c,this.y=d,this.z=e,this;var h=Math.acos(g),i=Math.sqrt(1-g*g);if(0.001>Math.abs(i))return this.w=0.5*
|
|
|
+(f+this.w),this.x=0.5*(c+this.x),this.y=0.5*(d+this.y),this.z=0.5*(e+this.z),this;g=Math.sin((1-b)*h)/i;h=Math.sin(b*h)/i;this.w=f*g+this.w*h;this.x=c*g+this.x*h;this.y=d*g+this.y*h;this.z=e*g+this.z*h;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerpSelf(b,d)};THREE.Spline=function(a){function b(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}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,i,k,n,p,m;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:
|
|
|
f+2;k=this.points[c[0]];n=this.points[c[1]];p=this.points[c[2]];m=this.points[c[3]];h=g*g;i=g*h;d.x=b(k.x,n.x,p.x,m.x,g,h,i);d.y=b(k.y,n.y,p.y,m.y,g,h,i);d.z=b(k.z,n.z,p.z,m.z,g,h,i);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],i=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=
|
|
|
a/c,d=this.getPoint(b),g.copy(d),i+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=i,e=b);h[h.length]=i;return{chunks:h,total:i}};this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],i=new THREE.Vector3,k=this.getLength();h.push(i.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=k.chunks[b]-k.chunks[b-1];g=Math.ceil(a*c/k.total);e=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<g-1;c++)d=e+c*(1/g)*(f-e),d=this.getPoint(d),
|
|
|
h.push(i.copy(d).clone());h.push(i.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=new THREE.Vector3;this.b=new THREE.Vector3;this.c=new THREE.Vector3;void 0!==a&&(void 0!==b&&void 0!==c)&&(this.a.copy(a),this.b.copy(b),this.c.copy(c))};THREE.Triangle.normal=function(a,b,c,d){d=d||new THREE.Vector3;d.sub(c,b);THREE.Triangle.__v0.sub(a,b);d.crossSelf(THREE.Triangle.__v0);a=d.lengthSq();return 0<a?d.multiplyScalar(1/Math.sqrt(a)):d.set(0,0,0)};
|
|
@@ -160,9 +160,9 @@ n,p),l.sub(s,r),q.sub(m,r),l.crossSelf(q),f[3*g]+=l.x,f[3*g+1]+=l.y,f[3*g+2]+=l.
|
|
|
this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},computeTangents:function(){function a(a){ca.x=d[3*a];ca.y=d[3*a+1];ca.z=d[3*a+2];xa.copy(ca);pa=i[a];R.copy(pa);R.subSelf(ca.multiplyScalar(ca.dot(pa))).normalize();P.cross(xa,pa);ya=P.dot(k[a]);M=0>ya?-1:1;h[4*a]=R.x;h[4*a+1]=R.y;h[4*a+2]=R.z;h[4*a+3]=M}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===
|
|
|
this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var b=this.attributes.index.array,c=this.attributes.position.array,d=this.attributes.normal.array,e=this.attributes.uv.array,f=c.length/3;if(void 0===this.attributes.tangent){var g=4*f;this.attributes.tangent={itemSize:4,array:new Float32Array(g),numItems:g}}for(var h=this.attributes.tangent.array,i=[],k=[],g=0;g<f;g++)i[g]=new THREE.Vector3,k[g]=new THREE.Vector3;
|
|
|
var n,p,m,r,s,l,q,u,B,x,t,F,C,z,A,f=new THREE.Vector3,g=new THREE.Vector3,H,G,I,$,D,L,y,K=this.offsets;I=0;for($=K.length;I<$;++I){G=K[I].start;D=K[I].count;var J=K[I].index;H=G;for(G+=D;H<G;H+=3)D=J+b[H],L=J+b[H+1],y=J+b[H+2],n=c[3*D],p=c[3*D+1],m=c[3*D+2],r=c[3*L],s=c[3*L+1],l=c[3*L+2],q=c[3*y],u=c[3*y+1],B=c[3*y+2],x=e[2*D],t=e[2*D+1],F=e[2*L],C=e[2*L+1],z=e[2*y],A=e[2*y+1],r-=n,n=q-n,s-=p,p=u-p,l-=m,m=B-m,F-=x,x=z-x,C-=t,t=A-t,A=1/(F*t-x*C),f.set((t*r-C*n)*A,(t*s-C*p)*A,(t*l-C*m)*A),g.set((F*
|
|
|
-n-x*r)*A,(F*p-x*s)*A,(F*m-x*l)*A),i[D].addSelf(f),i[L].addSelf(f),i[y].addSelf(f),k[D].addSelf(g),k[L].addSelf(g),k[y].addSelf(g)}var R=new THREE.Vector3,P=new THREE.Vector3,ca=new THREE.Vector3,xa=new THREE.Vector3,M,pa,ya;I=0;for($=K.length;I<$;++I){G=K[I].start;D=K[I].count;J=K[I].index;H=G;for(G+=D;H<G;H+=3)D=J+b[H],L=J+b[H+1],y=J+b[H+2],a(D),a(L),a(y)}this.tangentsNeedUpdate=this.hasTangents=!0}},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);!0===this.rotationAutoUpdate&&(!1===this.useQuaternion?this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder):this.quaternion.copy(this.matrix.decompose()[1]))};THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*Math.atan(b/(2*a))*(180/Math.PI);this.updateProjectionMatrix()};
|
|
|
+n-x*r)*A,(F*p-x*s)*A,(F*m-x*l)*A),i[D].addSelf(f),i[L].addSelf(f),i[y].addSelf(f),k[D].addSelf(g),k[L].addSelf(g),k[y].addSelf(g)}var R=new THREE.Vector3,P=new THREE.Vector3,ca=new THREE.Vector3,xa=new THREE.Vector3,M,pa,ya;I=0;for($=K.length;I<$;++I){G=K[I].start;D=K[I].count;J=K[I].index;H=G;for(G+=D;H<G;H+=3)D=J+b[H],L=J+b[H+1],y=J+b[H+2],a(D),a(L),a(y)}this.tangentsNeedUpdate=this.hasTangents=!0}},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);!0===this.rotationAutoUpdate&&(!1===this.useQuaternion?this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder):this.quaternion.copy(this.matrix.decompose()[1]))};THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
|
|
|
THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
|
|
|
-THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCascade=!1;this.shadowCascadeOffset=
|
|
|
+THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(THREE.Math.degToRad(0.5*this.fov))*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCascade=!1;this.shadowCascadeOffset=
|
|
|
new THREE.Vector3(0,0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);THREE.HemisphereLight=function(a,b,c){THREE.Light.call(this,a);this.groundColor=new THREE.Color(b);this.position=new THREE.Vector3(0,100,0);this.intensity=void 0!==c?c:1};THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype);THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=void 0!==b?b:1;this.distance=void 0!==c?c:0};THREE.PointLight.prototype=Object.create(THREE.Light.prototype);THREE.SpotLight=function(a,b,c,d,e){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.distance=void 0!==c?c:0;this.angle=void 0!==d?d:Math.PI/2;this.exponent=void 0!==e?e:10;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowMatrix=this.shadowCamera=
|
|
|
this.shadowMapSize=this.shadowMap=null};THREE.SpotLight.prototype=Object.create(THREE.Light.prototype);THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
|
|
|
THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:"anonymous",addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/
|
|
@@ -196,26 +196,26 @@ a.bones;d.animation=a.animation;if(void 0!==a.morphTargets){i=0;for(k=a.morphTar
|
|
|
THREE.SceneLoader.prototype.load=function(a,b){var c=this,d=new XMLHttpRequest;d.onreadystatechange=function(){if(4===d.readyState)if(200===d.status||0===d.status){var e=JSON.parse(d.responseText);c.parse(e,b,a)}else console.error("THREE.SceneLoader: Couldn't load ["+a+"] ["+d.status+"]")};d.open("GET",a,!0);d.send(null)};THREE.SceneLoader.prototype.addGeometryHandler=function(a,b){this.geometryHandlerMap[a]={loaderClass:b}};
|
|
|
THREE.SceneLoader.prototype.addHierarchyHandler=function(a,b){this.hierarchyHandlerMap[a]={loaderClass:b}};
|
|
|
THREE.SceneLoader.prototype.parse=function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:p+"/"+a}function e(){f(A.scene,G.objects)}function f(a,b){var c,e,g,i,k,p;for(p in b)if(void 0===A.objects[p]){var l=b[p],q=null;if(l.type&&l.type in n.hierarchyHandlerMap){if(void 0===l.loading){c={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,properties:1,skin:1,morph:1,mirroredLoop:1,duration:1};e={};for(var t in l)t in c||(e[t]=l[t]);r=A.materials[l.material];l.loading=!0;
|
|
|
-c=n.hierarchyHandlerMap[l.type].loaderObject;c.options?c.load(d(l.url,G.urlBaseType),h(p,a,r,l)):c.load(d(l.url,G.urlBaseType),h(p,a,r,l),e)}}else if(void 0!==l.geometry){if(m=A.geometries[l.geometry]){q=!1;r=A.materials[l.material];q=r instanceof THREE.ShaderMaterial;e=l.position;g=l.rotation;i=l.scale;c=l.matrix;k=0;l.material||(r=new THREE.MeshFaceMaterial(A.face_materials[l.geometry]));r instanceof THREE.MeshFaceMaterial&&0===r.materials.length&&(r=new THREE.MeshFaceMaterial(A.face_materials[l.geometry]));
|
|
|
+c=n.hierarchyHandlerMap[l.type].loaderObject;c.options?c.load(d(l.url,G.urlBaseType),h(p,a,r,l)):c.load(d(l.url,G.urlBaseType),h(p,a,r,l),e)}}else if(void 0!==l.geometry){if(m=A.geometries[l.geometry]){q=!1;r=A.materials[l.material];q=r instanceof THREE.ShaderMaterial;e=l.position;g=l.rotation;i=l.scale;c=l.matrix;k=l.quaternion;l.material||(r=new THREE.MeshFaceMaterial(A.face_materials[l.geometry]));r instanceof THREE.MeshFaceMaterial&&0===r.materials.length&&(r=new THREE.MeshFaceMaterial(A.face_materials[l.geometry]));
|
|
|
if(r instanceof THREE.MeshFaceMaterial)for(var y=0;y<r.materials.length;y++)q=q||r.materials[y]instanceof THREE.ShaderMaterial;q&&m.computeTangents();l.skin?q=new THREE.SkinnedMesh(m,r):l.morph?(q=new THREE.MorphAnimMesh(m,r),void 0!==l.duration&&(q.duration=l.duration),void 0!==l.time&&(q.time=l.time),void 0!==l.mirroredLoop&&(q.mirroredLoop=l.mirroredLoop),r.morphNormals&&m.computeMorphNormals()):q=new THREE.Mesh(m,r);q.name=p;c?(q.matrixAutoUpdate=!1,q.matrix.set(c[0],c[1],c[2],c[3],c[4],c[5],
|
|
|
c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])):(q.position.set(e[0],e[1],e[2]),k?(q.quaternion.set(k[0],k[1],k[2],k[3]),q.useQuaternion=!0):q.rotation.set(g[0],g[1],g[2]),q.scale.set(i[0],i[1],i[2]));q.visible=l.visible;q.castShadow=l.castShadow;q.receiveShadow=l.receiveShadow;a.add(q);A.objects[p]=q}}else"DirectionalLight"===l.type||"PointLight"===l.type||"AmbientLight"===l.type?(B=void 0!==l.color?l.color:16777215,x=void 0!==l.intensity?l.intensity:1,"DirectionalLight"===l.type?(e=l.direction,
|
|
|
u=new THREE.DirectionalLight(B,x),u.position.set(e[0],e[1],e[2]),l.target&&(H.push({object:u,targetName:l.target}),u.target=null)):"PointLight"===l.type?(e=l.position,c=l.distance,u=new THREE.PointLight(B,x,c),u.position.set(e[0],e[1],e[2])):"AmbientLight"===l.type&&(u=new THREE.AmbientLight(B)),a.add(u),u.name=p,A.lights[p]=u,A.objects[p]=u):"PerspectiveCamera"===l.type||"OrthographicCamera"===l.type?("PerspectiveCamera"===l.type?s=new THREE.PerspectiveCamera(l.fov,l.aspect,l.near,l.far):"OrthographicCamera"===
|
|
|
-l.type&&(s=new THREE.OrthographicCamera(l.left,l.right,l.top,l.bottom,l.near,l.far)),e=l.position,s.position.set(e[0],e[1],e[2]),a.add(s),s.name=p,A.cameras[p]=s,A.objects[p]=s):(e=l.position,g=l.rotation,i=l.scale,k=0,q=new THREE.Object3D,q.name=p,q.position.set(e[0],e[1],e[2]),k?(q.quaternion.set(k[0],k[1],k[2],k[3]),q.useQuaternion=!0):q.rotation.set(g[0],g[1],g[2]),q.scale.set(i[0],i[1],i[2]),q.visible=void 0!==l.visible?l.visible:!1,a.add(q),A.objects[p]=q,A.empties[p]=q);if(q){if(void 0!==l.properties)for(var z in l.properties)q.properties[z]=
|
|
|
-l.properties[z];void 0!==l.children&&f(q,l.children)}}}function g(a){return function(b,c){A.geometries[a]=b;A.face_materials[a]=c;e();t-=1;n.onLoadComplete();k()}}function h(a,b,c,d){return function(f){var f=f.content?f.content:f.dae?f.scene:f,g=d.position,h=d.rotation,i=d.quaternion,l=d.scale;f.position.set(g[0],g[1],g[2]);i?(f.quaternion.set(i[0],i[1],i[2],i[3]),f.useQuaternion=!0):f.rotation.set(h[0],h[1],h[2]);f.scale.set(l[0],l[1],l[2]);c&&f.traverse(function(a){a.material=c});var m=void 0!==
|
|
|
-d.visible?d.visible:!0;f.traverse(function(a){a.visible=m});b.add(f);f.name=a;A.objects[a]=f;e();t-=1;n.onLoadComplete();k()}}function i(a){return function(b,c){A.geometries[a]=b;A.face_materials[a]=c}}function k(){n.callbackProgress({totalModels:C,totalTextures:z,loadedModels:C-t,loadedTextures:z-F},A);n.onLoadProgress();if(0===t&&0===F){for(var a=0;a<H.length;a++){var c=H[a],d=A.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,A.scene.add(c.object.target));c.object.target.properties.targetInverse=
|
|
|
-c.object}b(A)}}var n=this,p=THREE.Loader.prototype.extractUrlBase(c),m,r,s,l,q,u,B,x,t,F,C,z,A,H=[],G=a,I;for(I in this.geometryHandlerMap)a=this.geometryHandlerMap[I].loaderClass,this.geometryHandlerMap[I].loaderObject=new a;for(I in this.hierarchyHandlerMap)a=this.hierarchyHandlerMap[I].loaderClass,this.hierarchyHandlerMap[I].loaderObject=new a;F=t=0;A={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{}};if(G.transform&&
|
|
|
-(I=G.transform.position,a=G.transform.rotation,c=G.transform.scale,I&&A.scene.position.set(I[0],I[1],I[2]),a&&A.scene.rotation.set(a[0],a[1],a[2]),c&&A.scene.scale.set(c[0],c[1],c[2]),I||a||c))A.scene.updateMatrix(),A.scene.updateMatrixWorld();I=function(a){return function(){F-=a;k();n.onLoadComplete()}};for(var $ in G.fogs)a=G.fogs[$],"linear"===a.type?l=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(l=new THREE.FogExp2(0,a.density)),a=a.color,l.color.setRGB(a[0],a[1],a[2]),A.fogs[$]=l;for(var D in G.geometries)l=
|
|
|
-G.geometries[D],l.type in this.geometryHandlerMap&&(t+=1,n.onLoadStart());for(var L in G.objects)l=G.objects[L],l.type&&l.type in this.hierarchyHandlerMap&&(t+=1,n.onLoadStart());C=t;for(D in G.geometries)if(l=G.geometries[D],"cube"===l.type)m=new THREE.CubeGeometry(l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments),A.geometries[D]=m;else if("plane"===l.type)m=new THREE.PlaneGeometry(l.width,l.height,l.widthSegments,l.heightSegments),A.geometries[D]=m;else if("sphere"===l.type)m=
|
|
|
-new THREE.SphereGeometry(l.radius,l.widthSegments,l.heightSegments),A.geometries[D]=m;else if("cylinder"===l.type)m=new THREE.CylinderGeometry(l.topRad,l.botRad,l.height,l.radSegs,l.heightSegs),A.geometries[D]=m;else if("torus"===l.type)m=new THREE.TorusGeometry(l.radius,l.tube,l.segmentsR,l.segmentsT),A.geometries[D]=m;else if("icosahedron"===l.type)m=new THREE.IcosahedronGeometry(l.radius,l.subdivisions),A.geometries[D]=m;else if(l.type in this.geometryHandlerMap){L={};for(q in l)"type"!==q&&"url"!==
|
|
|
-q&&(L[q]=l[q]);this.geometryHandlerMap[l.type].loaderObject.load(d(l.url,G.urlBaseType),g(D),L)}else"embedded"===l.type&&(L=G.embeds[l.id],L.metadata=G.metadata,L&&this.geometryHandlerMap.ascii.loaderObject.createModel(L,i(D),""));for(var y in G.textures)if(D=G.textures[y],D.url instanceof Array){F+=D.url.length;for(q=0;q<D.url.length;q++)n.onLoadStart()}else F+=1,n.onLoadStart();z=F;for(y in G.textures){D=G.textures[y];void 0!==D.mapping&&void 0!==THREE[D.mapping]&&(D.mapping=new THREE[D.mapping]);
|
|
|
-if(D.url instanceof Array){L=D.url.length;l=[];for(q=0;q<L;q++)l[q]=d(D.url[q],G.urlBaseType);q=(q=l[0].endsWith(".dds"))?THREE.ImageUtils.loadCompressedTextureCube(l,D.mapping,I(L)):THREE.ImageUtils.loadTextureCube(l,D.mapping,I(L))}else q=D.url.toLowerCase().endsWith(".dds"),L=d(D.url,G.urlBaseType),l=I(1),q=q?THREE.ImageUtils.loadCompressedTexture(L,D.mapping,l):THREE.ImageUtils.loadTexture(L,D.mapping,l),void 0!==THREE[D.minFilter]&&(q.minFilter=THREE[D.minFilter]),void 0!==THREE[D.magFilter]&&
|
|
|
-(q.magFilter=THREE[D.magFilter]),D.anisotropy&&(q.anisotropy=D.anisotropy),D.repeat&&(q.repeat.set(D.repeat[0],D.repeat[1]),1!==D.repeat[0]&&(q.wrapS=THREE.RepeatWrapping),1!==D.repeat[1]&&(q.wrapT=THREE.RepeatWrapping)),D.offset&&q.offset.set(D.offset[0],D.offset[1]),D.wrap&&(L={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==L[D.wrap[0]]&&(q.wrapS=L[D.wrap[0]]),void 0!==L[D.wrap[1]]&&(q.wrapT=L[D.wrap[1]]));A.textures[y]=q}var K,J;for(K in G.materials){y=G.materials[K];
|
|
|
-for(J in y.parameters)"envMap"===J||"map"===J||"lightMap"===J||"bumpMap"===J?y.parameters[J]=A.textures[y.parameters[J]]:"shading"===J?y.parameters[J]="flat"===y.parameters[J]?THREE.FlatShading:THREE.SmoothShading:"side"===J?y.parameters[J]="double"==y.parameters[J]?THREE.DoubleSide:"back"==y.parameters[J]?THREE.BackSide:THREE.FrontSide:"blending"===J?y.parameters[J]=y.parameters[J]in THREE?THREE[y.parameters[J]]:THREE.NormalBlending:"combine"===J?y.parameters[J]=y.parameters[J]in THREE?THREE[y.parameters[J]]:
|
|
|
-THREE.MultiplyOperation:"vertexColors"===J?"face"==y.parameters[J]?y.parameters[J]=THREE.FaceColors:y.parameters[J]&&(y.parameters[J]=THREE.VertexColors):"wrapRGB"===J&&(I=y.parameters[J],y.parameters[J]=new THREE.Vector3(I[0],I[1],I[2]));void 0!==y.parameters.opacity&&1>y.parameters.opacity&&(y.parameters.transparent=!0);y.parameters.normalMap?(I=THREE.ShaderUtils.lib.normal,D=THREE.UniformsUtils.clone(I.uniforms),q=y.parameters.color,L=y.parameters.specular,l=y.parameters.ambient,$=y.parameters.shininess,
|
|
|
-D.tNormal.value=A.textures[y.parameters.normalMap],y.parameters.normalScale&&D.uNormalScale.value.set(y.parameters.normalScale[0],y.parameters.normalScale[1]),y.parameters.map&&(D.tDiffuse.value=y.parameters.map,D.enableDiffuse.value=!0),y.parameters.envMap&&(D.tCube.value=y.parameters.envMap,D.enableReflection.value=!0,D.uReflectivity.value=y.parameters.reflectivity),y.parameters.lightMap&&(D.tAO.value=y.parameters.lightMap,D.enableAO.value=!0),y.parameters.specularMap&&(D.tSpecular.value=A.textures[y.parameters.specularMap],
|
|
|
-D.enableSpecular.value=!0),y.parameters.displacementMap&&(D.tDisplacement.value=A.textures[y.parameters.displacementMap],D.enableDisplacement.value=!0,D.uDisplacementBias.value=y.parameters.displacementBias,D.uDisplacementScale.value=y.parameters.displacementScale),D.uDiffuseColor.value.setHex(q),D.uSpecularColor.value.setHex(L),D.uAmbientColor.value.setHex(l),D.uShininess.value=$,y.parameters.opacity&&(D.uOpacity.value=y.parameters.opacity),r=new THREE.ShaderMaterial({fragmentShader:I.fragmentShader,
|
|
|
-vertexShader:I.vertexShader,uniforms:D,lights:!0,fog:!0})):r=new THREE[y.type](y.parameters);A.materials[K]=r}for(K in G.materials)if(y=G.materials[K],y.parameters.materials){J=[];for(q=0;q<y.parameters.materials.length;q++)J.push(A.materials[y.parameters.materials[q]]);A.materials[K].materials=J}e();A.cameras&&G.defaults.camera&&(A.currentCamera=A.cameras[G.defaults.camera]);A.fogs&&G.defaults.fog&&(A.scene.fog=A.fogs[G.defaults.fog]);a=G.defaults.bgcolor;A.bgColor=new THREE.Color;A.bgColor.setRGB(a[0],
|
|
|
-a[1],a[2]);A.bgColorAlpha=G.defaults.bgalpha;n.callbackSync(A);k()};THREE.TextureLoader=function(){THREE.EventDispatcher.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=!0;b.dispatchEvent({type:"load",content:a})},!1);c.addEventListener("error",function(){b.dispatchEvent({type:"error",message:"Couldn't load URL ["+a+"]"})},!1);b.crossOrigin&&(c.crossOrigin=b.crossOrigin);c.src=a}};THREE.Material=function(){THREE.EventDispatcher.call(this);this.id=THREE.MaterialIdCount++;this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.overdraw=!1;this.needsUpdate=this.visible=!0};
|
|
|
+l.type&&(s=new THREE.OrthographicCamera(l.left,l.right,l.top,l.bottom,l.near,l.far)),e=l.position,s.position.set(e[0],e[1],e[2]),a.add(s),s.name=p,A.cameras[p]=s,A.objects[p]=s):(e=l.position,g=l.rotation,i=l.scale,k=l.quaternion,q=new THREE.Object3D,q.name=p,q.position.set(e[0],e[1],e[2]),k?(q.quaternion.set(k[0],k[1],k[2],k[3]),q.useQuaternion=!0):q.rotation.set(g[0],g[1],g[2]),q.scale.set(i[0],i[1],i[2]),q.visible=void 0!==l.visible?l.visible:!1,a.add(q),A.objects[p]=q,A.empties[p]=q);if(q){if(void 0!==
|
|
|
+l.properties)for(var z in l.properties)q.properties[z]=l.properties[z];void 0!==l.children&&f(q,l.children)}}}function g(a){return function(b,c){A.geometries[a]=b;A.face_materials[a]=c;e();t-=1;n.onLoadComplete();k()}}function h(a,b,c,d){return function(f){var f=f.content?f.content:f.dae?f.scene:f,g=d.position,h=d.rotation,i=d.quaternion,l=d.scale;f.position.set(g[0],g[1],g[2]);i?(f.quaternion.set(i[0],i[1],i[2],i[3]),f.useQuaternion=!0):f.rotation.set(h[0],h[1],h[2]);f.scale.set(l[0],l[1],l[2]);
|
|
|
+c&&f.traverse(function(a){a.material=c});var m=void 0!==d.visible?d.visible:!0;f.traverse(function(a){a.visible=m});b.add(f);f.name=a;A.objects[a]=f;e();t-=1;n.onLoadComplete();k()}}function i(a){return function(b,c){A.geometries[a]=b;A.face_materials[a]=c}}function k(){n.callbackProgress({totalModels:C,totalTextures:z,loadedModels:C-t,loadedTextures:z-F},A);n.onLoadProgress();if(0===t&&0===F){for(var a=0;a<H.length;a++){var c=H[a],d=A.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,
|
|
|
+A.scene.add(c.object.target));c.object.target.properties.targetInverse=c.object}b(A)}}var n=this,p=THREE.Loader.prototype.extractUrlBase(c),m,r,s,l,q,u,B,x,t,F,C,z,A,H=[],G=a,I;for(I in this.geometryHandlerMap)a=this.geometryHandlerMap[I].loaderClass,this.geometryHandlerMap[I].loaderObject=new a;for(I in this.hierarchyHandlerMap)a=this.hierarchyHandlerMap[I].loaderClass,this.hierarchyHandlerMap[I].loaderObject=new a;F=t=0;A={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},
|
|
|
+objects:{},cameras:{},lights:{},fogs:{},empties:{}};if(G.transform&&(I=G.transform.position,a=G.transform.rotation,c=G.transform.scale,I&&A.scene.position.set(I[0],I[1],I[2]),a&&A.scene.rotation.set(a[0],a[1],a[2]),c&&A.scene.scale.set(c[0],c[1],c[2]),I||a||c))A.scene.updateMatrix(),A.scene.updateMatrixWorld();I=function(a){return function(){F-=a;k();n.onLoadComplete()}};for(var $ in G.fogs)a=G.fogs[$],"linear"===a.type?l=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(l=new THREE.FogExp2(0,a.density)),
|
|
|
+a=a.color,l.color.setRGB(a[0],a[1],a[2]),A.fogs[$]=l;for(var D in G.geometries)l=G.geometries[D],l.type in this.geometryHandlerMap&&(t+=1,n.onLoadStart());for(var L in G.objects)l=G.objects[L],l.type&&l.type in this.hierarchyHandlerMap&&(t+=1,n.onLoadStart());C=t;for(D in G.geometries)if(l=G.geometries[D],"cube"===l.type)m=new THREE.CubeGeometry(l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments),A.geometries[D]=m;else if("plane"===l.type)m=new THREE.PlaneGeometry(l.width,l.height,
|
|
|
+l.widthSegments,l.heightSegments),A.geometries[D]=m;else if("sphere"===l.type)m=new THREE.SphereGeometry(l.radius,l.widthSegments,l.heightSegments),A.geometries[D]=m;else if("cylinder"===l.type)m=new THREE.CylinderGeometry(l.topRad,l.botRad,l.height,l.radSegs,l.heightSegs),A.geometries[D]=m;else if("torus"===l.type)m=new THREE.TorusGeometry(l.radius,l.tube,l.segmentsR,l.segmentsT),A.geometries[D]=m;else if("icosahedron"===l.type)m=new THREE.IcosahedronGeometry(l.radius,l.subdivisions),A.geometries[D]=
|
|
|
+m;else if(l.type in this.geometryHandlerMap){L={};for(q in l)"type"!==q&&"url"!==q&&(L[q]=l[q]);this.geometryHandlerMap[l.type].loaderObject.load(d(l.url,G.urlBaseType),g(D),L)}else"embedded"===l.type&&(L=G.embeds[l.id],L.metadata=G.metadata,L&&this.geometryHandlerMap.ascii.loaderObject.createModel(L,i(D),""));for(var y in G.textures)if(D=G.textures[y],D.url instanceof Array){F+=D.url.length;for(q=0;q<D.url.length;q++)n.onLoadStart()}else F+=1,n.onLoadStart();z=F;for(y in G.textures){D=G.textures[y];
|
|
|
+void 0!==D.mapping&&void 0!==THREE[D.mapping]&&(D.mapping=new THREE[D.mapping]);if(D.url instanceof Array){L=D.url.length;l=[];for(q=0;q<L;q++)l[q]=d(D.url[q],G.urlBaseType);q=(q=l[0].endsWith(".dds"))?THREE.ImageUtils.loadCompressedTextureCube(l,D.mapping,I(L)):THREE.ImageUtils.loadTextureCube(l,D.mapping,I(L))}else q=D.url.toLowerCase().endsWith(".dds"),L=d(D.url,G.urlBaseType),l=I(1),q=q?THREE.ImageUtils.loadCompressedTexture(L,D.mapping,l):THREE.ImageUtils.loadTexture(L,D.mapping,l),void 0!==
|
|
|
+THREE[D.minFilter]&&(q.minFilter=THREE[D.minFilter]),void 0!==THREE[D.magFilter]&&(q.magFilter=THREE[D.magFilter]),D.anisotropy&&(q.anisotropy=D.anisotropy),D.repeat&&(q.repeat.set(D.repeat[0],D.repeat[1]),1!==D.repeat[0]&&(q.wrapS=THREE.RepeatWrapping),1!==D.repeat[1]&&(q.wrapT=THREE.RepeatWrapping)),D.offset&&q.offset.set(D.offset[0],D.offset[1]),D.wrap&&(L={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==L[D.wrap[0]]&&(q.wrapS=L[D.wrap[0]]),void 0!==L[D.wrap[1]]&&(q.wrapT=
|
|
|
+L[D.wrap[1]]));A.textures[y]=q}var K,J;for(K in G.materials){y=G.materials[K];for(J in y.parameters)"envMap"===J||"map"===J||"lightMap"===J||"bumpMap"===J?y.parameters[J]=A.textures[y.parameters[J]]:"shading"===J?y.parameters[J]="flat"===y.parameters[J]?THREE.FlatShading:THREE.SmoothShading:"side"===J?y.parameters[J]="double"==y.parameters[J]?THREE.DoubleSide:"back"==y.parameters[J]?THREE.BackSide:THREE.FrontSide:"blending"===J?y.parameters[J]=y.parameters[J]in THREE?THREE[y.parameters[J]]:THREE.NormalBlending:
|
|
|
+"combine"===J?y.parameters[J]=y.parameters[J]in THREE?THREE[y.parameters[J]]:THREE.MultiplyOperation:"vertexColors"===J?"face"==y.parameters[J]?y.parameters[J]=THREE.FaceColors:y.parameters[J]&&(y.parameters[J]=THREE.VertexColors):"wrapRGB"===J&&(I=y.parameters[J],y.parameters[J]=new THREE.Vector3(I[0],I[1],I[2]));void 0!==y.parameters.opacity&&1>y.parameters.opacity&&(y.parameters.transparent=!0);y.parameters.normalMap?(I=THREE.ShaderUtils.lib.normal,D=THREE.UniformsUtils.clone(I.uniforms),q=y.parameters.color,
|
|
|
+L=y.parameters.specular,l=y.parameters.ambient,$=y.parameters.shininess,D.tNormal.value=A.textures[y.parameters.normalMap],y.parameters.normalScale&&D.uNormalScale.value.set(y.parameters.normalScale[0],y.parameters.normalScale[1]),y.parameters.map&&(D.tDiffuse.value=y.parameters.map,D.enableDiffuse.value=!0),y.parameters.envMap&&(D.tCube.value=y.parameters.envMap,D.enableReflection.value=!0,D.uReflectivity.value=y.parameters.reflectivity),y.parameters.lightMap&&(D.tAO.value=y.parameters.lightMap,
|
|
|
+D.enableAO.value=!0),y.parameters.specularMap&&(D.tSpecular.value=A.textures[y.parameters.specularMap],D.enableSpecular.value=!0),y.parameters.displacementMap&&(D.tDisplacement.value=A.textures[y.parameters.displacementMap],D.enableDisplacement.value=!0,D.uDisplacementBias.value=y.parameters.displacementBias,D.uDisplacementScale.value=y.parameters.displacementScale),D.uDiffuseColor.value.setHex(q),D.uSpecularColor.value.setHex(L),D.uAmbientColor.value.setHex(l),D.uShininess.value=$,y.parameters.opacity&&
|
|
|
+(D.uOpacity.value=y.parameters.opacity),r=new THREE.ShaderMaterial({fragmentShader:I.fragmentShader,vertexShader:I.vertexShader,uniforms:D,lights:!0,fog:!0})):r=new THREE[y.type](y.parameters);A.materials[K]=r}for(K in G.materials)if(y=G.materials[K],y.parameters.materials){J=[];for(q=0;q<y.parameters.materials.length;q++)J.push(A.materials[y.parameters.materials[q]]);A.materials[K].materials=J}e();A.cameras&&G.defaults.camera&&(A.currentCamera=A.cameras[G.defaults.camera]);A.fogs&&G.defaults.fog&&
|
|
|
+(A.scene.fog=A.fogs[G.defaults.fog]);a=G.defaults.bgcolor;A.bgColor=new THREE.Color;A.bgColor.setRGB(a[0],a[1],a[2]);A.bgColorAlpha=G.defaults.bgalpha;n.callbackSync(A);k()};THREE.TextureLoader=function(){THREE.EventDispatcher.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=!0;b.dispatchEvent({type:"load",content:a})},!1);c.addEventListener("error",function(){b.dispatchEvent({type:"error",message:"Couldn't load URL ["+a+"]"})},!1);b.crossOrigin&&(c.crossOrigin=b.crossOrigin);c.src=a}};THREE.Material=function(){THREE.EventDispatcher.call(this);this.id=THREE.MaterialIdCount++;this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.overdraw=!1;this.needsUpdate=this.visible=!0};
|
|
|
THREE.Material.prototype.setValues=function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color&&c instanceof THREE.Color?d.copy(c):d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]=c}}};
|
|
|
THREE.Material.prototype.clone=function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;
|
|
|
a.visible=this.visible;return a};THREE.Material.prototype.dispose=function(){this.dispatchEvent({type:"dispose"})};THREE.MaterialIdCount=0;THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=!1;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
@@ -502,7 +502,7 @@ r=k.distanceTo(n),s=n.distanceTo(p),l=p.distanceTo(m),q=k.distanceTo(m),r>b||s>b
|
|
|
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),x.vertexColors[1].copy(f),x.vertexColors[2].copy(g),t.vertexColors[0].copy(f),t.vertexColors[3].copy(g)),e=0):(r=n.clone(),r.lerpSelf(p,0.5),n=m.clone(),n.lerpSelf(k,0.5),x.a=f,x.b=g,x.c=u,x.d=B,t.a=B,t.b=u,t.c=h,t.d=i,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),x.vertexNormals[2].copy(f),x.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),x.vertexColors[2].copy(f),x.vertexColors[3].copy(g),t.vertexColors[0].copy(g),t.vertexColors[1].copy(f)),e=1);F.push(x,t);a.vertices.push(r,n);f=0;for(g=a.faceVertexUvs.length;f<
|
|
|
g;f++)a.faceVertexUvs[f].length&&(k=a.faceVertexUvs[f][c],t=k[0],h=k[1],x=k[2],k=k[3],0===e?(n=t.clone(),n.lerpSelf(h,0.5),p=x.clone(),p.lerpSelf(k,0.5),t=[t.clone(),n.clone(),p.clone(),k.clone()],h=[n.clone(),h.clone(),x.clone(),p.clone()]):(n=h.clone(),n.lerpSelf(x,0.5),p=k.clone(),p.lerpSelf(t,0.5),t=[t.clone(),h.clone(),n.clone(),p.clone()],h=[p.clone(),n.clone(),x.clone(),k.clone()]),C[f].push(t,h))}else{F.push(e);f=0;for(g=a.faceVertexUvs.length;f<g;f++)C[f].push(a.faceVertexUvs[f][c])}a.faces=
|
|
|
-F;a.faceVertexUvs=C}};THREE.GeometryUtils.random=THREE.Math.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;THREE.GeometryUtils.__v2=new THREE.Vector3;THREE.ImageUtils={crossOrigin:"anonymous",loadTexture:function(a,b,c,d){var e=new Image,f=new THREE.Texture(e,b),b=new THREE.ImageLoader;b.addEventListener("load",function(a){f.image=a.content;f.needsUpdate=!0;c&&c(f)});b.addEventListener("error",function(a){d&&d(a.message)});b.crossOrigin=this.crossOrigin;b.load(a,e);f.sourceFile=a;return f},loadCompressedTexture:function(a,b,c,d){var e=new THREE.CompressedTexture;e.mapping=b;var f=new XMLHttpRequest;f.onload=function(){var a=THREE.ImageUtils.parseDDS(f.response,
|
|
|
+F;a.faceVertexUvs=C},setMaterialIndex:function(a,b,c,d){a=a.faces;d=d||a.length-1;for(c=c||0;c<=d;c++)a[c].materialIndex=b}};THREE.GeometryUtils.random=THREE.Math.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;THREE.GeometryUtils.__v2=new THREE.Vector3;THREE.ImageUtils={crossOrigin:"anonymous",loadTexture:function(a,b,c,d){var e=new Image,f=new THREE.Texture(e,b),b=new THREE.ImageLoader;b.addEventListener("load",function(a){f.image=a.content;f.needsUpdate=!0;c&&c(f)});b.addEventListener("error",function(a){d&&d(a.message)});b.crossOrigin=this.crossOrigin;b.load(a,e);f.sourceFile=a;return f},loadCompressedTexture:function(a,b,c,d){var e=new THREE.CompressedTexture;e.mapping=b;var f=new XMLHttpRequest;f.onload=function(){var a=THREE.ImageUtils.parseDDS(f.response,
|
|
|
!0);e.format=a.format;e.mipmaps=a.mipmaps;e.image.width=a.width;e.image.height=a.height;e.generateMipmaps=!1;e.needsUpdate=!0;c&&c(e)};f.onerror=d;f.open("GET",a,!0);f.responseType="arraybuffer";f.send(null);return e},loadTextureCube:function(a,b,c,d){var e=[];e.loadCount=0;var f=new THREE.Texture;f.image=e;void 0!==b&&(f.mapping=b);f.flipY=!1;for(var b=0,g=a.length;b<g;++b){var h=new Image;e[b]=h;h.onload=function(){e.loadCount+=1;6===e.loadCount&&(f.needsUpdate=!0,c&&c(f))};h.onerror=d;h.crossOrigin=
|
|
|
this.crossOrigin;h.src=a[b]}return f},loadCompressedTextureCube:function(a,b,c,d){var e=[];e.loadCount=0;var f=new THREE.CompressedTexture;f.image=e;void 0!==b&&(f.mapping=b);f.flipY=!1;f.generateMipmaps=!1;b=function(a,b){return function(){var d=THREE.ImageUtils.parseDDS(a.response,!0);b.format=d.format;b.mipmaps=d.mipmaps;b.width=d.width;b.height=d.height;e.loadCount+=1;6===e.loadCount&&(f.format=d.format,f.needsUpdate=!0,c&&c(f))}};if(a instanceof Array)for(var g=0,h=a.length;g<h;++g){var i={};
|
|
|
e[g]=i;var k=new XMLHttpRequest;k.onload=b(k,i);k.onerror=d;i=a[g];k.open("GET",i,!0);k.responseType="arraybuffer";k.send(null)}else k=new XMLHttpRequest,k.onload=function(){var a=THREE.ImageUtils.parseDDS(k.response,!0);if(a.isCubemap){for(var b=a.mipmaps.length/a.mipmapCount,d=0;d<b;d++){e[d]={mipmaps:[]};for(var g=0;g<a.mipmapCount;g++)e[d].mipmaps.push(a.mipmaps[d*a.mipmapCount+g]),e[d].format=a.format,e[d].width=a.width,e[d].height=a.height}f.format=a.format;f.needsUpdate=!0;c&&c(f)}},k.onerror=
|
|
@@ -596,7 +596,7 @@ this.hierarchy[a]instanceof THREE.Bone?this.hierarchy[a].skinMatrix.clone():this
|
|
|
THREE.CombinedCamera.prototype.toPerspective=function(){this.near=this.cameraP.near;this.far=this.cameraP.far;this.cameraP.fov=this.fov/this.zoom;this.cameraP.updateProjectionMatrix();this.projectionMatrix=this.cameraP.projectionMatrix;this.inPerspectiveMode=!0;this.inOrthographicMode=!1};
|
|
|
THREE.CombinedCamera.prototype.toOrthographic=function(){var a=this.cameraP.aspect,b=(this.cameraP.near+this.cameraP.far)/2,b=Math.tan(this.fov/2)*b,a=2*b*a/2,b=b/this.zoom,a=a/this.zoom;this.cameraO.left=-a;this.cameraO.right=a;this.cameraO.top=b;this.cameraO.bottom=-b;this.cameraO.updateProjectionMatrix();this.near=this.cameraO.near;this.far=this.cameraO.far;this.projectionMatrix=this.cameraO.projectionMatrix;this.inPerspectiveMode=!1;this.inOrthographicMode=!0};
|
|
|
THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;this.left=-a/2;this.right=a/2;this.top=b/2;this.bottom=-b/2};THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.updateProjectionMatrix=function(){this.inPerspectiveMode?this.toPerspective():(this.toPerspective(),this.toOrthographic())};
|
|
|
-THREE.CombinedCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);var c=2*Math.atan(b/(2*a))*(180/Math.PI);this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPerspectiveMode?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.setLens=function(a,b){void 0===b&&(b=24);var c=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPerspectiveMode?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.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.AsteriskGeometry=function(a,b){THREE.Geometry.call(this);for(var c=0.707*a,d=0.707*b,c=[[a,0,0],[b,0,0],[-a,0,0],[-b,0,0],[0,a,0],[0,b,0],[0,-a,0],[0,-b,0],[0,0,a],[0,0,b],[0,0,-a],[0,0,-b],[c,c,0],[d,d,0],[-c,-c,0],[-d,-d,0],[c,-c,0],[d,-d,0],[-c,c,0],[-d,d,0],[c,0,c],[d,0,d],[-c,0,-c],[-d,0,-d],[c,0,-c],[d,0,-d],[-c,0,c],[-d,0,d],[0,c,c],[0,d,d],[0,-c,-c],[0,-d,-d],[0,c,-c],[0,d,-d],[0,-c,c],[0,-d,d]],d=0,e=c.length;d<e;d++)this.vertices.push(new THREE.Vector3(c[d][0],c[d][1],c[d][2]))};
|
|
|
THREE.AsteriskGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);var a=a||50,c=void 0!==c?c:0,d=void 0!==d?d:2*Math.PI,b=void 0!==b?Math.max(3,b):8,e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(0.5,0.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3;h.x=a*Math.cos(c+e/b*d);h.y=a*Math.sin(c+e/b*d);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,-(h.y/a+1)/2+1))}c=new THREE.Vector3(0,0,-1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c,c,c])),
|