|
@@ -26,15 +26,15 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=
|
|
|
this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;this.w=this.w-a.w;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a;this.w=this.w/a}else{this.z=this.y=this.x=0;this.w=1}return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
|
|
|
normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;this.w=this.w+(a.w-this.w)*b;return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);if(b<1.0E-4){this.x=1;this.z=this.y=0}else{this.x=a.x/b;this.y=
|
|
|
a.y/b;this.z=a.z/b}return this},setAxisAngleFromRotationMatrix:function(a){var b,c,d,a=a.elements,e=a[0];d=a[4];var f=a[8],h=a[1],j=a[5],l=a[9];c=a[2];b=a[6];var k=a[10];if(Math.abs(d-h)<0.01&&Math.abs(f-c)<0.01&&Math.abs(l-b)<0.01){if(Math.abs(d+h)<0.1&&Math.abs(f+c)<0.1&&Math.abs(l+b)<0.1&&Math.abs(e+j+k-3)<0.1){this.set(1,0,0,0);return this}a=Math.PI;e=(e+1)/2;j=(j+1)/2;k=(k+1)/2;d=(d+h)/4;f=(f+c)/4;l=(l+b)/4;if(e>j&&e>k)if(e<0.01){b=0;d=c=0.707106781}else{b=Math.sqrt(e);c=d/b;d=f/b}else if(j>
|
|
|
-k)if(j<0.01){b=0.707106781;c=0;d=0.707106781}else{c=Math.sqrt(j);b=d/c;d=l/c}else if(k<0.01){c=b=0.707106781;d=0}else{d=Math.sqrt(k);b=f/d;c=l/d}this.set(b,c,d,a);return this}a=Math.sqrt((b-l)*(b-l)+(f-c)*(f-c)+(h-d)*(h-d));Math.abs(a)<0.0010&&(a=1);this.x=(b-l)/a;this.y=(f-c)/a;this.z=(h-d)/a;this.w=Math.acos((e+j+k-1)/2);return this}};
|
|
|
+k)if(j<0.01){b=0.707106781;c=0;d=0.707106781}else{c=Math.sqrt(j);b=d/c;d=l/c}else if(k<0.01){c=b=0.707106781;d=0}else{d=Math.sqrt(k);b=f/d;c=l/d}this.set(b,c,d,a);return this}a=Math.sqrt((b-l)*(b-l)+(f-c)*(f-c)+(h-d)*(h-d));Math.abs(a)<0.001&&(a=1);this.x=(b-l)/a;this.y=(f-c)/a;this.z=(h-d)/a;this.w=Math.acos((e+j+k-1)/2);return this}};
|
|
|
THREE.EventTarget=function(){var a={};this.addEventListener=function(b,c){a[b]===void 0&&(a[b]=[]);a[b].indexOf(c)===-1&&a[b].push(c)};this.dispatchEvent=function(b){for(var c in a[b.type])a[b.type][c](b)};this.removeEventListener=function(b,c){var d=a[b].indexOf(c);d!==-1&&a[b].splice(d,1)}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]};
|
|
|
THREE.Frustum.prototype.setFromMatrix=function(a){var b=this.planes,c=a.elements,a=c[0],d=c[1],e=c[2],f=c[3],h=c[4],j=c[5],l=c[6],k=c[7],i=c[8],m=c[9],n=c[10],o=c[11],u=c[12],q=c[13],r=c[14],c=c[15];b[0].set(f-a,k-h,o-i,c-u);b[1].set(f+a,k+h,o+i,c+u);b[2].set(f+d,k+j,o+m,c+q);b[3].set(f-d,k-j,o-m,c-q);b[4].set(f-e,k-l,o-n,c-r);b[5].set(f+e,k+l,o+n,c+r);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(),e=0;e<6;e++){b=c[e].x*d[12]+c[e].y*d[13]+c[e].z*d[14]+c[e].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 e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,j=new THREE.Vector3,l=new THREE.Vector3,k=new THREE.Vector3,i=new THREE.Vector3,m=new THREE.Vector3,n=new THREE.Vector3,o=function(a,b){return a.distance-b.distance},u=new THREE.Vector3,q=new THREE.Vector3,r=new THREE.Vector3,p,x,w,H=function(a,b,c){u.sub(c,a);p=u.dot(b);x=q.add(a,r.copy(b).multiplyScalar(p));
|
|
|
-return w=c.distanceTo(x)},v,E,A,G,C,P,I,U,W=function(a,b,c,d){u.sub(d,b);q.sub(c,b);r.sub(a,b);v=u.dot(u);E=u.dot(q);A=u.dot(r);G=q.dot(q);C=q.dot(r);P=1/(v*G-E*E);I=(G*A-E*C)*P;U=(v*C-E*A)*P;return I>=0&&U>=0&&I+U<1},S=1.0E-4;this.setPrecision=function(a){S=a};this.intersectObject=function(a,b){var c,d=[];if(b===true)for(var q=0,r=a.children.length;q<r;q++)Array.prototype.push.apply(d,this.intersectObject(a.children[q],b));if(a instanceof THREE.Particle){w=H(this.origin,this.direction,a.matrixWorld.getPosition());
|
|
|
+return w=c.distanceTo(x)},v,E,A,G,C,P,I,U,V=function(a,b,c,d){u.sub(d,b);q.sub(c,b);r.sub(a,b);v=u.dot(u);E=u.dot(q);A=u.dot(r);G=q.dot(q);C=q.dot(r);P=1/(v*G-E*E);I=(G*A-E*C)*P;U=(v*C-E*A)*P;return I>=0&&U>=0&&I+U<1},S=1.0E-4;this.setPrecision=function(a){S=a};this.intersectObject=function(a,b){var c,d=[];if(b===true)for(var q=0,r=a.children.length;q<r;q++)Array.prototype.push.apply(d,this.intersectObject(a.children[q],b));if(a instanceof THREE.Particle){w=H(this.origin,this.direction,a.matrixWorld.getPosition());
|
|
|
if(w>a.scale.x)return[];c={distance:w,point:a.position,face:null,object:a};d.push(c)}else if(a instanceof THREE.Mesh){q=THREE.Frustum.__v1.set(a.matrixWorld.getColumnX().length(),a.matrixWorld.getColumnY().length(),a.matrixWorld.getColumnZ().length());q=a.geometry.boundingSphere.radius*Math.max(q.x,Math.max(q.y,q.z));w=H(this.origin,this.direction,a.matrixWorld.getPosition());if(w>q)return d;var u,p,v=a.geometry,x=v.vertices,A;a.matrixRotationWorld.extractRotation(a.matrixWorld);q=0;for(r=v.faces.length;q<
|
|
|
r;q++){c=v.faces[q];l.copy(this.origin);k.copy(this.direction);A=a.matrixWorld;i=A.multiplyVector3(i.copy(c.centroid)).subSelf(l);m=a.matrixRotationWorld.multiplyVector3(m.copy(c.normal));u=k.dot(m);if(!(Math.abs(u)<S)){p=m.dot(i)/u;if(!(p<0)&&(a.doubleSided||(a.flipSided?u>0:u<0))){n.add(l,k.multiplyScalar(p));w=l.distanceTo(n);if(!(w<this.near)&&!(w>this.far))if(c instanceof THREE.Face3){e=A.multiplyVector3(e.copy(x[c.a]));f=A.multiplyVector3(f.copy(x[c.b]));h=A.multiplyVector3(h.copy(x[c.c]));
|
|
|
-if(W(n,e,f,h)){c={distance:w,point:n.clone(),face:c,object:a};d.push(c)}}else if(c instanceof THREE.Face4){e=A.multiplyVector3(e.copy(x[c.a]));f=A.multiplyVector3(f.copy(x[c.b]));h=A.multiplyVector3(h.copy(x[c.c]));j=A.multiplyVector3(j.copy(x[c.d]));if(W(n,e,f,j)||W(n,f,h,j)){c={distance:w,point:n.clone(),face:c,object:a};d.push(c)}}}}}}d.sort(o);return d};this.intersectObjects=function(a,b){for(var c=[],d=0,f=a.length;d<f;d++)Array.prototype.push.apply(c,this.intersectObject(a[d],b));c.sort(o);
|
|
|
+if(V(n,e,f,h)){c={distance:w,point:n.clone(),face:c,object:a};d.push(c)}}else if(c instanceof THREE.Face4){e=A.multiplyVector3(e.copy(x[c.a]));f=A.multiplyVector3(f.copy(x[c.b]));h=A.multiplyVector3(h.copy(x[c.c]));j=A.multiplyVector3(j.copy(x[c.d]));if(V(n,e,f,j)||V(n,f,h,j)){c={distance:w,point:n.clone(),face:c,object:a};d.push(c)}}}}}}d.sort(o);return d};this.intersectObjects=function(a,b){for(var c=[],d=0,f=a.length;d<f;d++)Array.prototype.push.apply(c,this.intersectObject(a[d],b));c.sort(o);
|
|
|
return c}};
|
|
|
THREE.Rectangle=function(){function a(){f=d-b;h=e-c}var b=0,c=0,d=0,e=0,f=0,h=0,j=true;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return f};this.getHeight=function(){return h};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(f,h,i,m){j=false;b=f;c=h;d=i;e=m;a()};this.addPoint=function(f,h){if(j===true){j=false;b=f;c=h;d=f;e=h}else{b=b<f?b:f;c=c<h?c:
|
|
|
h;d=d>f?d:f;e=e>h?e:h}a()};this.add3Points=function(f,h,i,m,n,o){if(j===true){j=false;b=f<i?f<n?f:n:i<n?i:n;c=h<m?h<o?h:o:m<o?m:o;d=f>i?f>n?f:n:i>n?i:n;e=h>m?h>o?h:o:m>o?m:o}else{b=f<i?f<n?f<b?f:b:n<b?n:b:i<n?i<b?i:b:n<b?n:b;c=h<m?h<o?h<c?h:c:o<c?o:c:m<o?m<c?m:c:o<c?o:c;d=f>i?f>n?f>d?f:d:n>d?n:d:i>n?i>d?i:d:n>d?n:d;e=h>m?h>o?h>e?h:e:o>e?o:e:m>o?m>e?m:e:o>e?o:e}a()};this.addRectangle=function(f){if(j===true){j=false;b=f.getLeft();c=f.getTop();d=f.getRight();e=f.getBottom()}else{b=b<f.getLeft()?b:f.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,e,f,h,j,l,k,i,m,n,o,u,q){this.elements=new Float32Array(16);this.set(a!==void 0?a:1,b||0,c||0,d||0,e||0,f!==void 0?f:1,h||0,j||0,l||0,k||0,i!==void 0?i:1,m||0,n||0,o||0,u||0,q!==void 0?q:1)};
|
|
|
THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,h,j,l,k,i,m,n,o,u,q){var r=this.elements;r[0]=a;r[4]=b;r[8]=c;r[12]=d;r[1]=e;r[5]=f;r[9]=h;r[13]=j;r[2]=l;r[6]=k;r[10]=i;r[14]=m;r[3]=n;r[7]=o;r[11]=u;r[15]=q;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,h=THREE.Matrix4.__v3;h.sub(a,b).normalize();if(h.length()===0)h.z=1;e.cross(c,h).normalize();if(e.length()===0){h.x=h.x+1.0E-4;e.cross(c,h).normalize()}f.cross(h,e);d[0]=e.x;d[4]=f.x;d[8]=h.x;d[1]=e.y;d[5]=f.y;d[9]=h.y;d[2]=e.z;d[6]=f.z;d[10]=h.z;return this},multiply:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],h=c[4],j=c[8],l=c[12],k=c[1],i=c[5],m=c[9],n=c[13],o=c[2],u=c[6],q=c[10],r=c[14],p=c[3],x=c[7],w=c[11],c=c[15],H=d[0],v=d[4],
|
|
|
-E=d[8],A=d[12],G=d[1],C=d[5],P=d[9],I=d[13],U=d[2],W=d[6],S=d[10],z=d[14],O=d[3],V=d[7],F=d[11],d=d[15];e[0]=f*H+h*G+j*U+l*O;e[4]=f*v+h*C+j*W+l*V;e[8]=f*E+h*P+j*S+l*F;e[12]=f*A+h*I+j*z+l*d;e[1]=k*H+i*G+m*U+n*O;e[5]=k*v+i*C+m*W+n*V;e[9]=k*E+i*P+m*S+n*F;e[13]=k*A+i*I+m*z+n*d;e[2]=o*H+u*G+q*U+r*O;e[6]=o*v+u*C+q*W+r*V;e[10]=o*E+u*P+q*S+r*F;e[14]=o*A+u*I+q*z+r*d;e[3]=p*H+x*G+w*U+c*O;e[7]=p*v+x*C+w*W+c*V;e[11]=p*E+x*P+w*S+c*F;e[15]=p*A+x*I+w*z+c*d;return this},multiplySelf:function(a){return this.multiply(this,
|
|
|
+E=d[8],A=d[12],G=d[1],C=d[5],P=d[9],I=d[13],U=d[2],V=d[6],S=d[10],z=d[14],O=d[3],Q=d[7],F=d[11],d=d[15];e[0]=f*H+h*G+j*U+l*O;e[4]=f*v+h*C+j*V+l*Q;e[8]=f*E+h*P+j*S+l*F;e[12]=f*A+h*I+j*z+l*d;e[1]=k*H+i*G+m*U+n*O;e[5]=k*v+i*C+m*V+n*Q;e[9]=k*E+i*P+m*S+n*F;e[13]=k*A+i*I+m*z+n*d;e[2]=o*H+u*G+q*U+r*O;e[6]=o*v+u*C+q*V+r*Q;e[10]=o*E+u*P+q*S+r*F;e[14]=o*A+u*I+q*z+r*d;e[3]=p*H+x*G+w*U+c*O;e[7]=p*v+x*C+w*V+c*Q;e[11]=p*E+x*P+w*S+c*F;e[15]=p*A+x*I+w*z+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,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=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]*
|
|
@@ -75,25 +75,25 @@ 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){h=0;E.objects.length=0;E.sprites.length=0;E.lights.length=0;var e=function(a){if(a.visible!==false){if((a instanceof THREE.Mesh||a instanceof THREE.Line)&&(a.frustumCulled===false||I.contains(a)===true)){A.copy(a.matrixWorld.getPosition());C.multiplyVector3(A);f=b();f.object=a;f.z=A.z;E.objects.push(f)}else if(a instanceof THREE.Sprite||a instanceof THREE.Particle){A.copy(a.matrixWorld.getPosition());C.multiplyVector3(A);f=b();f.object=a;f.z=A.z;E.sprites.push(f)}else a instanceof
|
|
|
THREE.Light&&E.lights.push(a);for(var c=0,d=a.children.length;c<d;c++)e(a.children[c])}};e(a);c===true&&E.objects.sort(d);return E}function b(){var a;if(h===j.length){a=new THREE.RenderableObject;j.push(a)}else a=j[h];h++;return a}function c(){var a;if(k===i.length){a=new THREE.RenderableVertex;i.push(a)}else a=i[k];k++;return a}function d(a,b){return b.z-a.z}function e(a,b){var c=0,d=1,f=a.z+a.w,h=b.z+b.w,e=-a.z+a.w,j=-b.z+b.w;if(f>=0&&h>=0&&e>=0&&j>=0)return true;if(f<0&&h<0||e<0&&j<0)return false;
|
|
|
-f<0?c=Math.max(c,f/(f-h)):h<0&&(d=Math.min(d,f/(f-h)));e<0?c=Math.max(c,e/(e-j)):j<0&&(d=Math.min(d,e/(e-j)));if(d<c)return false;a.lerpSelf(b,c);b.lerpSelf(a,1-d);return true}var f,h,j=[],l,k,i=[],m,n,o=[],u,q=[],r,p,x=[],w,H,v=[],E={objects:[],sprites:[],lights:[],elements:[]},A=new THREE.Vector3,G=new THREE.Vector4,C=new THREE.Matrix4,P=new THREE.Matrix4,I=new THREE.Frustum,U=new THREE.Vector4,W=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);C.multiply(b.projectionMatrix,
|
|
|
-b.matrixWorldInverse);C.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);C.multiply(b.matrixWorld,b.projectionMatrixInverse);C.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,f,h){var j=f.near,A=f.far,ea=false,ja,Q,la,aa,T,da,ta,ia,N,ua,Ba,ma,
|
|
|
-Ja,Ia,Ca;H=p=u=n=0;E.elements.length=0;b.updateMatrixWorld();f.parent===void 0&&f.updateMatrixWorld();f.matrixWorldInverse.getInverse(f.matrixWorld);C.multiply(f.projectionMatrix,f.matrixWorldInverse);I.setFromMatrix(C);E=a(b,false);b=0;for(ja=E.objects.length;b<ja;b++){N=E.objects[b].object;ua=N.matrixWorld;k=0;if(N instanceof THREE.Mesh){Ba=N.geometry;ma=N.geometry.materials;aa=Ba.vertices;Ja=Ba.faces;Ia=Ba.faceVertexUvs;Ba=N.matrixRotationWorld.extractRotation(ua);Q=0;for(la=aa.length;Q<la;Q++){l=
|
|
|
-c();l.positionWorld.copy(aa[Q]);ua.multiplyVector3(l.positionWorld);l.positionScreen.copy(l.positionWorld);C.multiplyVector4(l.positionScreen);l.positionScreen.x=l.positionScreen.x/l.positionScreen.w;l.positionScreen.y=l.positionScreen.y/l.positionScreen.w;l.visible=l.positionScreen.z>j&&l.positionScreen.z<A}aa=0;for(Q=Ja.length;aa<Q;aa++){la=Ja[aa];if(la instanceof THREE.Face3){T=i[la.a];da=i[la.b];ta=i[la.c];if(T.visible===true&&da.visible===true&&ta.visible===true){ea=(ta.positionScreen.x-T.positionScreen.x)*
|
|
|
-(da.positionScreen.y-T.positionScreen.y)-(ta.positionScreen.y-T.positionScreen.y)*(da.positionScreen.x-T.positionScreen.x)<0;if(N.doubleSided===true||ea!==N.flipSided){ia=void 0;if(n===o.length){ia=new THREE.RenderableFace3;o.push(ia)}else ia=o[n];n++;m=ia;m.v1.copy(T);m.v2.copy(da);m.v3.copy(ta)}else continue}else continue}else if(la instanceof THREE.Face4){T=i[la.a];da=i[la.b];ta=i[la.c];ia=i[la.d];if(T.visible===true&&da.visible===true&&ta.visible===true&&ia.visible===true){ea=(ia.positionScreen.x-
|
|
|
-T.positionScreen.x)*(da.positionScreen.y-T.positionScreen.y)-(ia.positionScreen.y-T.positionScreen.y)*(da.positionScreen.x-T.positionScreen.x)<0||(da.positionScreen.x-ta.positionScreen.x)*(ia.positionScreen.y-ta.positionScreen.y)-(da.positionScreen.y-ta.positionScreen.y)*(ia.positionScreen.x-ta.positionScreen.x)<0;if(N.doubleSided===true||ea!==N.flipSided){Ca=void 0;if(u===q.length){Ca=new THREE.RenderableFace4;q.push(Ca)}else Ca=q[u];u++;m=Ca;m.v1.copy(T);m.v2.copy(da);m.v3.copy(ta);m.v4.copy(ia)}else continue}else continue}m.normalWorld.copy(la.normal);
|
|
|
-ea===false&&(N.flipSided===true||N.doubleSided===true)&&m.normalWorld.negate();Ba.multiplyVector3(m.normalWorld);m.centroidWorld.copy(la.centroid);ua.multiplyVector3(m.centroidWorld);m.centroidScreen.copy(m.centroidWorld);C.multiplyVector3(m.centroidScreen);ta=la.vertexNormals;T=0;for(da=ta.length;T<da;T++){ia=m.vertexNormalsWorld[T];ia.copy(ta[T]);ea===false&&(N.flipSided===true||N.doubleSided===true)&&ia.negate();Ba.multiplyVector3(ia)}T=0;for(da=Ia.length;T<da;T++){Ca=Ia[T][aa];if(Ca!==void 0){ta=
|
|
|
-0;for(ia=Ca.length;ta<ia;ta++)m.uvs[T][ta]=Ca[ta]}}m.material=N.material;m.faceMaterial=la.materialIndex!==null?ma[la.materialIndex]:null;m.z=m.centroidScreen.z;E.elements.push(m)}}else if(N instanceof THREE.Line){P.multiply(C,ua);aa=N.geometry.vertices;T=c();T.positionScreen.copy(aa[0]);P.multiplyVector4(T.positionScreen);ua=N.type===THREE.LinePieces?2:1;Q=1;for(la=aa.length;Q<la;Q++){T=c();T.positionScreen.copy(aa[Q]);P.multiplyVector4(T.positionScreen);if(!((Q+1)%ua>0)){da=i[k-2];U.copy(T.positionScreen);
|
|
|
-W.copy(da.positionScreen);if(e(U,W)===true){U.multiplyScalar(1/U.w);W.multiplyScalar(1/W.w);ma=void 0;if(p===x.length){ma=new THREE.RenderableLine;x.push(ma)}else ma=x[p];p++;r=ma;r.v1.positionScreen.copy(U);r.v2.positionScreen.copy(W);r.z=Math.max(U.z,W.z);r.material=N.material;E.elements.push(r)}}}}}b=0;for(ja=E.sprites.length;b<ja;b++){N=E.sprites[b].object;ua=N.matrixWorld;if(N instanceof THREE.Particle){G.set(ua.elements[12],ua.elements[13],ua.elements[14],1);C.multiplyVector4(G);G.z=G.z/G.w;
|
|
|
-if(G.z>0&&G.z<1){j=void 0;if(H===v.length){j=new THREE.RenderableParticle;v.push(j)}else j=v[H];H++;w=j;w.object=N;w.x=G.x/G.w;w.y=G.y/G.w;w.z=G.z;w.rotation=N.rotation.z;w.scale.x=N.scale.x*Math.abs(w.x-(G.x+f.projectionMatrix.elements[0])/(G.w+f.projectionMatrix.elements[12]));w.scale.y=N.scale.y*Math.abs(w.y-(G.y+f.projectionMatrix.elements[5])/(G.w+f.projectionMatrix.elements[13]));w.material=N.material;E.elements.push(w)}}}h&&E.elements.sort(d);return E}};
|
|
|
+f<0?c=Math.max(c,f/(f-h)):h<0&&(d=Math.min(d,f/(f-h)));e<0?c=Math.max(c,e/(e-j)):j<0&&(d=Math.min(d,e/(e-j)));if(d<c)return false;a.lerpSelf(b,c);b.lerpSelf(a,1-d);return true}var f,h,j=[],l,k,i=[],m,n,o=[],u,q=[],r,p,x=[],w,H,v=[],E={objects:[],sprites:[],lights:[],elements:[]},A=new THREE.Vector3,G=new THREE.Vector4,C=new THREE.Matrix4,P=new THREE.Matrix4,I=new THREE.Frustum,U=new THREE.Vector4,V=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);C.multiply(b.projectionMatrix,
|
|
|
+b.matrixWorldInverse);C.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);C.multiply(b.matrixWorld,b.projectionMatrixInverse);C.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,f,h){var j=f.near,A=f.far,ea=false,ja,N,la,aa,T,da,ta,ia,W,ua,Ba,ma,
|
|
|
+Ja,Pa,Ca,Ha,Qa;H=p=u=n=0;E.elements.length=0;b.updateMatrixWorld();f.parent===void 0&&f.updateMatrixWorld();f.matrixWorldInverse.getInverse(f.matrixWorld);C.multiply(f.projectionMatrix,f.matrixWorldInverse);I.setFromMatrix(C);E=a(b,false);b=0;for(ja=E.objects.length;b<ja;b++){W=E.objects[b].object;ua=W.matrixWorld;k=0;if(W instanceof THREE.Mesh){Ba=W.geometry;ma=W.geometry.materials;aa=Ba.vertices;Ja=Ba.faces;Pa=Ba.faceVertexUvs;Ba=W.matrixRotationWorld.extractRotation(ua);Ha=W.material.flipSided;
|
|
|
+Qa=W.material.doubleSided;N=0;for(la=aa.length;N<la;N++){l=c();l.positionWorld.copy(aa[N]);ua.multiplyVector3(l.positionWorld);l.positionScreen.copy(l.positionWorld);C.multiplyVector4(l.positionScreen);l.positionScreen.x=l.positionScreen.x/l.positionScreen.w;l.positionScreen.y=l.positionScreen.y/l.positionScreen.w;l.visible=l.positionScreen.z>j&&l.positionScreen.z<A}aa=0;for(N=Ja.length;aa<N;aa++){la=Ja[aa];if(la instanceof THREE.Face3){T=i[la.a];da=i[la.b];ta=i[la.c];if(T.visible===true&&da.visible===
|
|
|
+true&&ta.visible===true){ea=(ta.positionScreen.x-T.positionScreen.x)*(da.positionScreen.y-T.positionScreen.y)-(ta.positionScreen.y-T.positionScreen.y)*(da.positionScreen.x-T.positionScreen.x)<0;if(Qa===true||ea!==Ha){ia=void 0;if(n===o.length){ia=new THREE.RenderableFace3;o.push(ia)}else ia=o[n];n++;m=ia;m.v1.copy(T);m.v2.copy(da);m.v3.copy(ta)}else continue}else continue}else if(la instanceof THREE.Face4){T=i[la.a];da=i[la.b];ta=i[la.c];ia=i[la.d];if(T.visible===true&&da.visible===true&&ta.visible===
|
|
|
+true&&ia.visible===true){ea=(ia.positionScreen.x-T.positionScreen.x)*(da.positionScreen.y-T.positionScreen.y)-(ia.positionScreen.y-T.positionScreen.y)*(da.positionScreen.x-T.positionScreen.x)<0||(da.positionScreen.x-ta.positionScreen.x)*(ia.positionScreen.y-ta.positionScreen.y)-(da.positionScreen.y-ta.positionScreen.y)*(ia.positionScreen.x-ta.positionScreen.x)<0;if(Qa===true||ea!==Ha){Ca=void 0;if(u===q.length){Ca=new THREE.RenderableFace4;q.push(Ca)}else Ca=q[u];u++;m=Ca;m.v1.copy(T);m.v2.copy(da);
|
|
|
+m.v3.copy(ta);m.v4.copy(ia)}else continue}else continue}m.normalWorld.copy(la.normal);ea===false&&(Ha===true||Qa===true)&&m.normalWorld.negate();Ba.multiplyVector3(m.normalWorld);m.centroidWorld.copy(la.centroid);ua.multiplyVector3(m.centroidWorld);m.centroidScreen.copy(m.centroidWorld);C.multiplyVector3(m.centroidScreen);ta=la.vertexNormals;T=0;for(da=ta.length;T<da;T++){ia=m.vertexNormalsWorld[T];ia.copy(ta[T]);ea===false&&(Ha===true||Qa===true)&&ia.negate();Ba.multiplyVector3(ia)}T=0;for(da=Pa.length;T<
|
|
|
+da;T++){Ca=Pa[T][aa];if(Ca!==void 0){ta=0;for(ia=Ca.length;ta<ia;ta++)m.uvs[T][ta]=Ca[ta]}}m.material=W.material;m.faceMaterial=la.materialIndex!==null?ma[la.materialIndex]:null;m.z=m.centroidScreen.z;E.elements.push(m)}}else if(W instanceof THREE.Line){P.multiply(C,ua);aa=W.geometry.vertices;T=c();T.positionScreen.copy(aa[0]);P.multiplyVector4(T.positionScreen);ua=W.type===THREE.LinePieces?2:1;N=1;for(la=aa.length;N<la;N++){T=c();T.positionScreen.copy(aa[N]);P.multiplyVector4(T.positionScreen);if(!((N+
|
|
|
+1)%ua>0)){da=i[k-2];U.copy(T.positionScreen);V.copy(da.positionScreen);if(e(U,V)===true){U.multiplyScalar(1/U.w);V.multiplyScalar(1/V.w);ma=void 0;if(p===x.length){ma=new THREE.RenderableLine;x.push(ma)}else ma=x[p];p++;r=ma;r.v1.positionScreen.copy(U);r.v2.positionScreen.copy(V);r.z=Math.max(U.z,V.z);r.material=W.material;E.elements.push(r)}}}}}b=0;for(ja=E.sprites.length;b<ja;b++){W=E.sprites[b].object;ua=W.matrixWorld;if(W instanceof THREE.Particle){G.set(ua.elements[12],ua.elements[13],ua.elements[14],
|
|
|
+1);C.multiplyVector4(G);G.z=G.z/G.w;if(G.z>0&&G.z<1){j=void 0;if(H===v.length){j=new THREE.RenderableParticle;v.push(j)}else j=v[H];H++;w=j;w.object=W;w.x=G.x/G.w;w.y=G.y/G.w;w.z=G.z;w.rotation=W.rotation.z;w.scale.x=W.scale.x*Math.abs(w.x-(G.x+f.projectionMatrix.elements[0])/(G.w+f.projectionMatrix.elements[12]));w.scale.y=W.scale.y*Math.abs(w.y-(G.y+f.projectionMatrix.elements[5])/(G.w+f.projectionMatrix.elements[13]));w.material=W.material;E.elements.push(w)}}}h&&E.elements.sort(d);return E}};
|
|
|
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),e=Math.cos(a.z/2),f=Math.sin(a.x/2),h=Math.sin(a.y/2),j=Math.sin(a.z/2);if(b===void 0||b==="XYZ"){this.x=f*d*e+c*h*j;this.y=c*h*e-f*d*j;this.z=c*d*j+f*h*e;this.w=c*d*e-f*h*j}else if(b==="YXZ"){this.x=f*d*e+c*h*j;this.y=c*h*e-f*d*j;this.z=
|
|
|
c*d*j-f*h*e;this.w=c*d*e+f*h*j}else if(b==="ZXY"){this.x=f*d*e-c*h*j;this.y=c*h*e+f*d*j;this.z=c*d*j+f*h*e;this.w=c*d*e-f*h*j}else if(b==="ZYX"){this.x=f*d*e-c*h*j;this.y=c*h*e+f*d*j;this.z=c*d*j-f*h*e;this.w=c*d*e+f*h*j}else if(b==="YZX"){this.x=f*d*e+c*h*j;this.y=c*h*e+f*d*j;this.z=c*d*j-f*h*e;this.w=c*d*e-f*h*j}else if(b==="XZY"){this.x=f*d*e-c*h*j;this.y=c*h*e-f*d*j;this.z=c*d*j+f*h*e;this.w=c*d*e+f*h*j}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],h=b[9],j=b[2],l=b[6],b=b[10],k=c+f+b;if(k>0){c=0.5/Math.sqrt(k+1);this.w=0.25/c;this.x=(l-h)*c;this.y=(d-j)*c;this.z=(e-a)*c}else if(c>f&&c>b){c=2*Math.sqrt(1+c-f-b);this.w=(l-h)/c;this.x=0.25*c;this.y=(a+e)/c;this.z=(d+j)/c}else if(f>b){c=2*Math.sqrt(1+f-c-b);this.w=(d-j)/c;this.x=(a+e)/c;this.y=0.25*c;this.z=(h+l)/c}else{c=2*Math.sqrt(1+b-c-f);this.w=(e-a)/c;this.x=
|
|
|
(d+j)/c;this.y=(h+l)/c;this.z=0.25*c}return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x=this.x*-1;this.y=this.y*-1;this.z=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);if(a===0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x=this.x*a;this.y=
|
|
|
this.y*a;this.z=this.z*a;this.w=this.w*a}return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,h=a.y,j=a.z,a=a.w;this.x=b*a+e*f+c*j-d*h;this.y=c*a+e*h+d*f-b*j;this.z=d*a+e*j+b*h-c*f;this.w=e*a-b*f-c*h-d*j;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,
|
|
|
-f=this.x,h=this.y,j=this.z,l=this.w,k=l*c+h*e-j*d,i=l*d+j*c-f*e,m=l*e+f*d-h*c,c=-f*c-h*d-j*e;b.x=k*l+c*-f+i*-j-m*-h;b.y=i*l+c*-h+m*-f-k*-j;b.z=m*l+c*-j+k*-h-i*-f;return b},slerpSelf:function(a,b){var c=this.x,d=this.y,e=this.z,f=this.w,h=f*a.w+c*a.x+d*a.y+e*a.z;if(h<0){this.w=-a.w;this.x=-a.x;this.y=-a.y;this.z=-a.z;h=-h}else this.copy(a);if(h>=1){this.w=f;this.x=c;this.y=d;this.z=e;return this}var j=Math.acos(h),l=Math.sqrt(1-h*h);if(Math.abs(l)<0.0010){this.w=0.5*(f+this.w);this.x=0.5*(c+this.x);
|
|
|
+f=this.x,h=this.y,j=this.z,l=this.w,k=l*c+h*e-j*d,i=l*d+j*c-f*e,m=l*e+f*d-h*c,c=-f*c-h*d-j*e;b.x=k*l+c*-f+i*-j-m*-h;b.y=i*l+c*-h+m*-f-k*-j;b.z=m*l+c*-j+k*-h-i*-f;return b},slerpSelf:function(a,b){var c=this.x,d=this.y,e=this.z,f=this.w,h=f*a.w+c*a.x+d*a.y+e*a.z;if(h<0){this.w=-a.w;this.x=-a.x;this.y=-a.y;this.z=-a.z;h=-h}else this.copy(a);if(h>=1){this.w=f;this.x=c;this.y=d;this.z=e;return this}var j=Math.acos(h),l=Math.sqrt(1-h*h);if(Math.abs(l)<0.001){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);return this}h=Math.sin((1-b)*j)/l;j=Math.sin(b*j)/l;this.w=f*h+this.w*j;this.x=c*h+this.x*j;this.y=d*h+this.y*j;this.z=e*h+this.z*j;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;if(e<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;e=-e}else c.copy(b);if(Math.abs(e)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var b=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010){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);return 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.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;if(e<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;e=-e}else c.copy(b);if(Math.abs(e)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var b=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.001){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);return 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.Vertex=function(a){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.");return a};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
|
|
|
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
|
|
|
return a}};THREE.Face4=function(a,b,c,d,e,f,h){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3};
|
|
@@ -108,9 +108,9 @@ for(b=this.vertices.length;a<b;a++)d[a].normalize();a=0;for(b=this.faces.length;
|
|
|
e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone();if(!e.__originalVertexNormals)e.__originalVertexNormals=[];a=0;for(b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone()}var f=new THREE.Geometry;f.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 h=this.morphNormals[a].faceNormals,j=this.morphNormals[a].vertexNormals,l,k;c=0;for(d=this.faces.length;c<d;c++){e=this.faces[c];l=new THREE.Vector3;k=e 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};h.push(l);j.push(k)}}h=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++){e=this.faces[c];
|
|
|
l=h.faceNormals[c];k=h.vertexNormals[c];l.copy(e.normal);if(e instanceof THREE.Face3){k.a.copy(e.vertexNormals[0]);k.b.copy(e.vertexNormals[1]);k.c.copy(e.vertexNormals[2])}else{k.a.copy(e.vertexNormals[0]);k.b.copy(e.vertexNormals[1]);k.c.copy(e.vertexNormals[2]);k.d.copy(e.vertexNormals[3])}}}c=0;for(d=this.faces.length;c<d;c++){e=this.faces[c];e.normal=e.__originalFaceNormal;e.vertexNormals=e.__originalVertexNormals}},computeTangents:function(){function a(a,b,c,d,f,e,z){j=a.vertices[b];l=a.vertices[c];
|
|
|
-k=a.vertices[d];i=h[f];m=h[e];n=h[z];o=l.x-j.x;u=k.x-j.x;q=l.y-j.y;r=k.y-j.y;p=l.z-j.z;x=k.z-j.z;w=m.u-i.u;H=n.u-i.u;v=m.v-i.v;E=n.v-i.v;A=1/(w*E-H*v);I.set((E*o-v*u)*A,(E*q-v*r)*A,(E*p-v*x)*A);U.set((w*u-H*o)*A,(w*r-H*q)*A,(w*x-H*p)*A);C[b].addSelf(I);C[c].addSelf(I);C[d].addSelf(I);P[b].addSelf(U);P[c].addSelf(U);P[d].addSelf(U)}var b,c,d,e,f,h,j,l,k,i,m,n,o,u,q,r,p,x,w,H,v,E,A,G,C=[],P=[],I=new THREE.Vector3,U=new THREE.Vector3,W=new THREE.Vector3,S=new THREE.Vector3,z=new THREE.Vector3;b=0;for(c=
|
|
|
-this.vertices.length;b<c;b++){C[b]=new THREE.Vector3;P[b]=new THREE.Vector3}b=0;for(c=this.faces.length;b<c;b++){f=this.faces[b];h=this.faceVertexUvs[0][b];if(f instanceof THREE.Face3)a(this,f.a,f.b,f.c,0,1,2);else if(f instanceof THREE.Face4){a(this,f.a,f.b,f.d,0,1,3);a(this,f.b,f.c,f.d,1,2,3)}}var O=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){f=this.faces[b];for(d=0;d<f.vertexNormals.length;d++){z.copy(f.vertexNormals[d]);e=f[O[d]];G=C[e];W.copy(G);W.subSelf(z.multiplyScalar(z.dot(G))).normalize();
|
|
|
-S.cross(f.vertexNormals[d],G);e=S.dot(P[e]);e=e<0?-1:1;f.vertexTangents[d]=new THREE.Vector4(W.x,W.y,W.z,e)}}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,e=this.vertices.length;d<e;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];i=h[f];m=h[e];n=h[z];o=l.x-j.x;u=k.x-j.x;q=l.y-j.y;r=k.y-j.y;p=l.z-j.z;x=k.z-j.z;w=m.u-i.u;H=n.u-i.u;v=m.v-i.v;E=n.v-i.v;A=1/(w*E-H*v);I.set((E*o-v*u)*A,(E*q-v*r)*A,(E*p-v*x)*A);U.set((w*u-H*o)*A,(w*r-H*q)*A,(w*x-H*p)*A);C[b].addSelf(I);C[c].addSelf(I);C[d].addSelf(I);P[b].addSelf(U);P[c].addSelf(U);P[d].addSelf(U)}var b,c,d,e,f,h,j,l,k,i,m,n,o,u,q,r,p,x,w,H,v,E,A,G,C=[],P=[],I=new THREE.Vector3,U=new THREE.Vector3,V=new THREE.Vector3,S=new THREE.Vector3,z=new THREE.Vector3;b=0;for(c=
|
|
|
+this.vertices.length;b<c;b++){C[b]=new THREE.Vector3;P[b]=new THREE.Vector3}b=0;for(c=this.faces.length;b<c;b++){f=this.faces[b];h=this.faceVertexUvs[0][b];if(f instanceof THREE.Face3)a(this,f.a,f.b,f.c,0,1,2);else if(f instanceof THREE.Face4){a(this,f.a,f.b,f.d,0,1,3);a(this,f.b,f.c,f.d,1,2,3)}}var O=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){f=this.faces[b];for(d=0;d<f.vertexNormals.length;d++){z.copy(f.vertexNormals[d]);e=f[O[d]];G=C[e];V.copy(G);V.subSelf(z.multiplyScalar(z.dot(G))).normalize();
|
|
|
+S.cross(f.vertexNormals[d],G);e=S.dot(P[e]);e=e<0?-1:1;f.vertexTangents[d]=new THREE.Vector4(V.x,V.y,V.z,e)}}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,e=this.vertices.length;d<e;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,e=Math.pow(10,4),f,h,j,l;f=0;for(h=this.vertices.length;f<h;f++){d=this.vertices[f];d=
|
|
|
[Math.round(d.x*e),Math.round(d.y*e),Math.round(d.z*e)].join("_");if(a[d]===void 0){a[d]=f;b.push(this.vertices[f]);c[f]=b.length-1}else c[f]=c[a[d]]}f=0;for(h=this.faces.length;f<h;f++){a=this.faces[f];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(e=3;e>0;e--)if(d.indexOf(a["abcd"[e]])!==e){d.splice(e,1);this.faces[f]=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++)(l=this.faceVertexUvs[d][f])&&l.splice(e,1);this.faces[f].vertexColors=a.vertexColors;break}}}c=this.vertices.length-b.length;this.vertices=b;return c}};THREE.GeometryCount=0;
|
|
@@ -140,15 +140,15 @@ new THREE[l](k);if(a.DbgName!==void 0)k.name=a.DbgName;return k}};THREE.BinaryLo
|
|
|
THREE.BinaryLoader.prototype.loadAjaxJSON=function(a,b,c,d,e,f){var h=new XMLHttpRequest;h.onreadystatechange=function(){if(h.readyState==4)if(h.status==200||h.status==0){var j=JSON.parse(h.responseText);a.loadAjaxBuffers(j,c,e,d,f)}else console.error("THREE.BinaryLoader: Couldn't load ["+b+"] ["+h.status+"]")};h.open("GET",b,true);h.overrideMimeType&&h.overrideMimeType("text/plain; charset=x-user-defined");h.setRequestHeader("Content-Type","text/plain");h.send(null)};
|
|
|
THREE.BinaryLoader.prototype.loadAjaxBuffers=function(a,b,c,d,e){var f=new XMLHttpRequest,h=c+"/"+a.buffers,j=0;f.onreadystatechange=function(){if(f.readyState==4)f.status==200||f.status==0?THREE.BinaryLoader.prototype.createBinModel(f.response,b,d,a.materials):console.error("THREE.BinaryLoader: Couldn't load ["+h+"] ["+f.status+"]");else if(f.readyState==3){if(e){j==0&&(j=f.getResponseHeader("Content-Length"));e({total:j,loaded:f.responseText.length})}}else f.readyState==2&&(j=f.getResponseHeader("Content-Length"))};
|
|
|
f.open("GET",h,true);f.responseType="arraybuffer";f.send(null)};
|
|
|
-THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,d){var e=function(b){var c,e,l,k,i,m,n,o,u,q,r,p,x,w,H;function v(a){return a%4?4-a%4:0}function E(a,b){return(new Uint8Array(a,b,1))[0]}function A(a,b){return(new Uint32Array(a,b,1))[0]}function G(b,c){var d,f,e,h,j,i,k,m,l=new Uint32Array(a,c,3*b);for(d=0;d<b;d++){f=l[d*3];e=l[d*3+1];h=l[d*3+2];j=V[f*2];f=V[f*2+1];i=V[e*2];k=V[e*2+1];e=V[h*2];m=V[h*2+1];h=S.faceVertexUvs[0];var n=[];n.push(new THREE.UV(j,f));n.push(new THREE.UV(i,k));n.push(new THREE.UV(e,
|
|
|
-m));h.push(n)}}function C(b,c){var d,f,e,h,j,i,k,m,l,n,q=new Uint32Array(a,c,4*b);for(d=0;d<b;d++){f=q[d*4];e=q[d*4+1];h=q[d*4+2];j=q[d*4+3];i=V[f*2];f=V[f*2+1];k=V[e*2];l=V[e*2+1];m=V[h*2];n=V[h*2+1];h=V[j*2];e=V[j*2+1];j=S.faceVertexUvs[0];var o=[];o.push(new THREE.UV(i,f));o.push(new THREE.UV(k,l));o.push(new THREE.UV(m,n));o.push(new THREE.UV(h,e));j.push(o)}}function P(b,c,d){for(var f,e,h,j,c=new Uint32Array(a,c,3*b),i=new Uint16Array(a,d,b),d=0;d<b;d++){f=c[d*3];e=c[d*3+1];h=c[d*3+2];j=i[d];
|
|
|
+THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,d){var e=function(b){var c,e,l,k,i,m,n,o,u,q,r,p,x,w,H;function v(a){return a%4?4-a%4:0}function E(a,b){return(new Uint8Array(a,b,1))[0]}function A(a,b){return(new Uint32Array(a,b,1))[0]}function G(b,c){var d,f,e,h,j,i,k,m,l=new Uint32Array(a,c,3*b);for(d=0;d<b;d++){f=l[d*3];e=l[d*3+1];h=l[d*3+2];j=Q[f*2];f=Q[f*2+1];i=Q[e*2];k=Q[e*2+1];e=Q[h*2];m=Q[h*2+1];h=S.faceVertexUvs[0];var n=[];n.push(new THREE.UV(j,f));n.push(new THREE.UV(i,k));n.push(new THREE.UV(e,
|
|
|
+m));h.push(n)}}function C(b,c){var d,f,e,h,j,i,k,m,l,n,q=new Uint32Array(a,c,4*b);for(d=0;d<b;d++){f=q[d*4];e=q[d*4+1];h=q[d*4+2];j=q[d*4+3];i=Q[f*2];f=Q[f*2+1];k=Q[e*2];l=Q[e*2+1];m=Q[h*2];n=Q[h*2+1];h=Q[j*2];e=Q[j*2+1];j=S.faceVertexUvs[0];var o=[];o.push(new THREE.UV(i,f));o.push(new THREE.UV(k,l));o.push(new THREE.UV(m,n));o.push(new THREE.UV(h,e));j.push(o)}}function P(b,c,d){for(var f,e,h,j,c=new Uint32Array(a,c,3*b),i=new Uint16Array(a,d,b),d=0;d<b;d++){f=c[d*3];e=c[d*3+1];h=c[d*3+2];j=i[d];
|
|
|
S.faces.push(new THREE.Face3(f,e,h,null,null,j))}}function I(b,c,d){for(var f,e,h,j,i,c=new Uint32Array(a,c,4*b),k=new Uint16Array(a,d,b),d=0;d<b;d++){f=c[d*4];e=c[d*4+1];h=c[d*4+2];j=c[d*4+3];i=k[d];S.faces.push(new THREE.Face4(f,e,h,j,null,null,i))}}function U(b,c,d,f){for(var e,h,j,i,k,m,l,c=new Uint32Array(a,c,3*b),d=new Uint32Array(a,d,3*b),n=new Uint16Array(a,f,b),f=0;f<b;f++){e=c[f*3];h=c[f*3+1];j=c[f*3+2];k=d[f*3];m=d[f*3+1];l=d[f*3+2];i=n[f];var o=O[m*3],q=O[m*3+1];m=O[m*3+2];var r=O[l*3],
|
|
|
-p=O[l*3+1];l=O[l*3+2];S.faces.push(new THREE.Face3(e,h,j,[new THREE.Vector3(O[k*3],O[k*3+1],O[k*3+2]),new THREE.Vector3(o,q,m),new THREE.Vector3(r,p,l)],null,i))}}function W(b,c,d,f){for(var e,h,j,i,k,m,l,n,o,c=new Uint32Array(a,c,4*b),d=new Uint32Array(a,d,4*b),q=new Uint16Array(a,f,b),f=0;f<b;f++){e=c[f*4];h=c[f*4+1];j=c[f*4+2];i=c[f*4+3];m=d[f*4];l=d[f*4+1];n=d[f*4+2];o=d[f*4+3];k=q[f];var r=O[l*3],p=O[l*3+1];l=O[l*3+2];var u=O[n*3],w=O[n*3+1];n=O[n*3+2];var v=O[o*3],x=O[o*3+1];o=O[o*3+2];S.faces.push(new THREE.Face4(e,
|
|
|
-h,j,i,[new THREE.Vector3(O[m*3],O[m*3+1],O[m*3+2]),new THREE.Vector3(r,p,l),new THREE.Vector3(u,w,n),new THREE.Vector3(v,x,o)],null,k))}}var S=this,z=0,O=[],V=[],F,ea,ja;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(S,d,b);(function(a,b,c){for(var a=new Uint8Array(a,b,c),d="",f=0;f<c;f++)d=d+String.fromCharCode(a[b+f]);return d})(a,z,12);c=E(a,z+12);E(a,z+13);E(a,z+14);E(a,z+15);e=E(a,z+16);l=E(a,z+17);k=E(a,z+18);i=E(a,z+19);m=A(a,z+20);n=A(a,z+20+4);o=A(a,z+20+8);b=A(a,z+20+12);
|
|
|
+p=O[l*3+1];l=O[l*3+2];S.faces.push(new THREE.Face3(e,h,j,[new THREE.Vector3(O[k*3],O[k*3+1],O[k*3+2]),new THREE.Vector3(o,q,m),new THREE.Vector3(r,p,l)],null,i))}}function V(b,c,d,f){for(var e,h,j,i,k,m,l,n,o,c=new Uint32Array(a,c,4*b),d=new Uint32Array(a,d,4*b),q=new Uint16Array(a,f,b),f=0;f<b;f++){e=c[f*4];h=c[f*4+1];j=c[f*4+2];i=c[f*4+3];m=d[f*4];l=d[f*4+1];n=d[f*4+2];o=d[f*4+3];k=q[f];var r=O[l*3],p=O[l*3+1];l=O[l*3+2];var u=O[n*3],w=O[n*3+1];n=O[n*3+2];var v=O[o*3],x=O[o*3+1];o=O[o*3+2];S.faces.push(new THREE.Face4(e,
|
|
|
+h,j,i,[new THREE.Vector3(O[m*3],O[m*3+1],O[m*3+2]),new THREE.Vector3(r,p,l),new THREE.Vector3(u,w,n),new THREE.Vector3(v,x,o)],null,k))}}var S=this,z=0,O=[],Q=[],F,ea,ja;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(S,d,b);(function(a,b,c){for(var a=new Uint8Array(a,b,c),d="",f=0;f<c;f++)d=d+String.fromCharCode(a[b+f]);return d})(a,z,12);c=E(a,z+12);E(a,z+13);E(a,z+14);E(a,z+15);e=E(a,z+16);l=E(a,z+17);k=E(a,z+18);i=E(a,z+19);m=A(a,z+20);n=A(a,z+20+4);o=A(a,z+20+8);b=A(a,z+20+12);
|
|
|
u=A(a,z+20+16);q=A(a,z+20+20);r=A(a,z+20+24);p=A(a,z+20+28);x=A(a,z+20+32);w=A(a,z+20+36);H=A(a,z+20+40);z=z+c;c=e*3+i;ja=e*4+i;F=b*c;ea=u*(c+l*3);e=q*(c+k*3);i=r*(c+l*3+k*3);c=p*ja;l=x*(ja+l*4);k=w*(ja+k*4);z=z+function(b){var b=new Float32Array(a,b,m*3),c,d,f,e;for(c=0;c<m;c++){d=b[c*3];f=b[c*3+1];e=b[c*3+2];S.vertices.push(new THREE.Vector3(d,f,e))}return m*3*Float32Array.BYTES_PER_ELEMENT}(z);z=z+function(b){if(n){var b=new Int8Array(a,b,n*3),c,d,f,e;for(c=0;c<n;c++){d=b[c*3];f=b[c*3+1];e=b[c*
|
|
|
-3+2];O.push(d/127,f/127,e/127)}}return n*3*Int8Array.BYTES_PER_ELEMENT}(z);z=z+v(n*3);z=z+function(b){if(o){var b=new Float32Array(a,b,o*2),c,d,f;for(c=0;c<o;c++){d=b[c*2];f=b[c*2+1];V.push(d,f)}}return o*2*Float32Array.BYTES_PER_ELEMENT}(z);F=z+F+v(b*2);ea=F+ea+v(u*2);e=ea+e+v(q*2);i=e+i+v(r*2);c=i+c+v(p*2);l=c+l+v(x*2);k=l+k+v(w*2);(function(a){if(q){var b=a+q*Uint32Array.BYTES_PER_ELEMENT*3;P(q,a,b+q*Uint32Array.BYTES_PER_ELEMENT*3);G(q,b)}})(ea);(function(a){if(r){var b=a+r*Uint32Array.BYTES_PER_ELEMENT*
|
|
|
-3,c=b+r*Uint32Array.BYTES_PER_ELEMENT*3;U(r,a,b,c+r*Uint32Array.BYTES_PER_ELEMENT*3);G(r,c)}})(e);(function(a){if(w){var b=a+w*Uint32Array.BYTES_PER_ELEMENT*4;I(w,a,b+w*Uint32Array.BYTES_PER_ELEMENT*4);C(w,b)}})(l);(function(a){if(H){var b=a+H*Uint32Array.BYTES_PER_ELEMENT*4,c=b+H*Uint32Array.BYTES_PER_ELEMENT*4;W(H,a,b,c+H*Uint32Array.BYTES_PER_ELEMENT*4);C(H,c)}})(k);b&&P(b,z,z+b*Uint32Array.BYTES_PER_ELEMENT*3);(function(a){if(u){var b=a+u*Uint32Array.BYTES_PER_ELEMENT*3;U(u,a,b,b+u*Uint32Array.BYTES_PER_ELEMENT*
|
|
|
-3)}})(F);p&&I(p,i,i+p*Uint32Array.BYTES_PER_ELEMENT*4);(function(a){if(x){var b=a+x*Uint32Array.BYTES_PER_ELEMENT*4;W(x,a,b,b+x*Uint32Array.BYTES_PER_ELEMENT*4)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};e.prototype=Object.create(THREE.Geometry.prototype);b(new e(c))};THREE.ImageLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
|
|
|
+3+2];O.push(d/127,f/127,e/127)}}return n*3*Int8Array.BYTES_PER_ELEMENT}(z);z=z+v(n*3);z=z+function(b){if(o){var b=new Float32Array(a,b,o*2),c,d,f;for(c=0;c<o;c++){d=b[c*2];f=b[c*2+1];Q.push(d,f)}}return o*2*Float32Array.BYTES_PER_ELEMENT}(z);F=z+F+v(b*2);ea=F+ea+v(u*2);e=ea+e+v(q*2);i=e+i+v(r*2);c=i+c+v(p*2);l=c+l+v(x*2);k=l+k+v(w*2);(function(a){if(q){var b=a+q*Uint32Array.BYTES_PER_ELEMENT*3;P(q,a,b+q*Uint32Array.BYTES_PER_ELEMENT*3);G(q,b)}})(ea);(function(a){if(r){var b=a+r*Uint32Array.BYTES_PER_ELEMENT*
|
|
|
+3,c=b+r*Uint32Array.BYTES_PER_ELEMENT*3;U(r,a,b,c+r*Uint32Array.BYTES_PER_ELEMENT*3);G(r,c)}})(e);(function(a){if(w){var b=a+w*Uint32Array.BYTES_PER_ELEMENT*4;I(w,a,b+w*Uint32Array.BYTES_PER_ELEMENT*4);C(w,b)}})(l);(function(a){if(H){var b=a+H*Uint32Array.BYTES_PER_ELEMENT*4,c=b+H*Uint32Array.BYTES_PER_ELEMENT*4;V(H,a,b,c+H*Uint32Array.BYTES_PER_ELEMENT*4);C(H,c)}})(k);b&&P(b,z,z+b*Uint32Array.BYTES_PER_ELEMENT*3);(function(a){if(u){var b=a+u*Uint32Array.BYTES_PER_ELEMENT*3;U(u,a,b,b+u*Uint32Array.BYTES_PER_ELEMENT*
|
|
|
+3)}})(F);p&&I(p,i,i+p*Uint32Array.BYTES_PER_ELEMENT*4);(function(a){if(x){var b=a+x*Uint32Array.BYTES_PER_ELEMENT*4;V(x,a,b,b+x*Uint32Array.BYTES_PER_ELEMENT*4)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};e.prototype=Object.create(THREE.Geometry.prototype);b(new e(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,e){var f=new XMLHttpRequest,h=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(f.status===200||f.status===0){if(f.responseText){var j=JSON.parse(f.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+"] ["+f.status+"]");else if(f.readyState===f.LOADING){if(e){h===0&&(h=f.getResponseHeader("Content-Length"));
|
|
@@ -172,21 +172,21 @@ o;){var r=h[m++],p=r&2,f=r&4,x=r&8,w=r&16,u=r&32,H=r&64,q=r&128;if(r&1){r=new TH
|
|
|
{};d.morphColors[f].name=a.morphColors[f].name;d.morphColors[f].colors=[];e=d.morphColors[f].colors;k=a.morphColors[f].colors;n=0;for(i=k.length;n<i;n=n+3){m=new THREE.Color(16755200);m.setRGB(k[n],k[n+1],k[n+2]);e.push(m)}}}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 e=JSON.parse(d.responseText);c.createScene(e,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 e(){var a;for(n in z.objects)if(!Q.objects[n]){p=z.objects[n];if(p.geometry!==void 0){if(I=Q.geometries[p.geometry]){a=false;U=Q.materials[p.materials[0]];(a=U instanceof THREE.ShaderMaterial)&&I.computeTangents();v=p.position;E=p.rotation;A=p.quaternion;G=p.scale;x=p.matrix;A=0;p.materials.length==0&&(U=new THREE.MeshFaceMaterial);p.materials.length>1&&(U=new THREE.MeshFaceMaterial);
|
|
|
-a=new THREE.Mesh(I,U);a.name=n;if(x){a.matrixAutoUpdate=false;a.matrix.set(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15])}else{a.position.set(v[0],v[1],v[2]);if(A){a.quaternion.set(A[0],A[1],A[2],A[3]);a.useQuaternion=true}else a.rotation.set(E[0],E[1],E[2]);a.scale.set(G[0],G[1],G[2])}a.visible=p.visible;a.castShadow=p.castShadow;a.receiveShadow=p.receiveShadow;Q.scene.add(a);Q.objects[n]=a}}else{v=p.position;E=p.rotation;A=p.quaternion;G=p.scale;A=0;a=new THREE.Object3D;
|
|
|
-a.name=n;a.position.set(v[0],v[1],v[2]);if(A){a.quaternion.set(A[0],A[1],A[2],A[3]);a.useQuaternion=true}else a.rotation.set(E[0],E[1],E[2]);a.scale.set(G[0],G[1],G[2]);a.visible=p.visible!==void 0?p.visible:false;Q.scene.add(a);Q.objects[n]=a;Q.empties[n]=a}}}function f(a){return function(b){Q.geometries[a]=b;e();V=V-1;l.onLoadComplete();j()}}function h(a){return function(b){Q.geometries[a]=b}}function j(){l.callbackProgress({totalModels:ea,totalTextures:ja,loadedModels:ea-V,loadedTextures:ja-F},
|
|
|
-Q);l.onLoadProgress();V===0&&F===0&&b(Q)}var l=this,k=THREE.Loader.prototype.extractUrlBase(c),i,m,n,o,u,q,r,p,x,w,H,v,E,A,G,C,P,I,U,W,S,z,O,V,F,ea,ja,Q;z=a;c=new THREE.BinaryLoader;O=new THREE.JSONLoader;F=V=0;Q={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{}};if(z.transform){a=z.transform.position;w=z.transform.rotation;C=z.transform.scale;a&&Q.scene.position.set(a[0],a[1],a[2]);w&&Q.scene.rotation.set(w[0],w[1],w[2]);C&&Q.scene.scale.set(C[0],
|
|
|
-C[1],C[2]);if(a||w||C){Q.scene.updateMatrix();Q.scene.updateMatrixWorld()}}a=function(a){return function(){F=F-a;j();l.onLoadComplete()}};for(u in z.cameras){C=z.cameras[u];C.type==="perspective"?W=new THREE.PerspectiveCamera(C.fov,C.aspect,C.near,C.far):C.type==="ortho"&&(W=new THREE.OrthographicCamera(C.left,C.right,C.top,C.bottom,C.near,C.far));v=C.position;w=C.target;C=C.up;W.position.set(v[0],v[1],v[2]);W.target=new THREE.Vector3(w[0],w[1],w[2]);C&&W.up.set(C[0],C[1],C[2]);Q.cameras[u]=W}for(o in z.lights){w=
|
|
|
-z.lights[o];u=w.color!==void 0?w.color:16777215;W=w.intensity!==void 0?w.intensity:1;if(w.type==="directional"){v=w.direction;H=new THREE.DirectionalLight(u,W);H.position.set(v[0],v[1],v[2]);H.position.normalize()}else if(w.type==="point"){v=w.position;H=w.distance;H=new THREE.PointLight(u,W,H);H.position.set(v[0],v[1],v[2])}else w.type==="ambient"&&(H=new THREE.AmbientLight(u));Q.scene.add(H);Q.lights[o]=H}for(q in z.fogs){o=z.fogs[q];o.type==="linear"?S=new THREE.Fog(0,o.near,o.far):o.type==="exp2"&&
|
|
|
-(S=new THREE.FogExp2(0,o.density));C=o.color;S.color.setRGB(C[0],C[1],C[2]);Q.fogs[q]=S}if(Q.cameras&&z.defaults.camera)Q.currentCamera=Q.cameras[z.defaults.camera];if(Q.fogs&&z.defaults.fog)Q.scene.fog=Q.fogs[z.defaults.fog];C=z.defaults.bgcolor;Q.bgColor=new THREE.Color;Q.bgColor.setRGB(C[0],C[1],C[2]);Q.bgColorAlpha=z.defaults.bgalpha;for(i in z.geometries){q=z.geometries[i];if(q.type=="bin_mesh"||q.type=="ascii_mesh"){V=V+1;l.onLoadStart()}}ea=V;for(i in z.geometries){q=z.geometries[i];if(q.type===
|
|
|
-"cube"){I=new THREE.CubeGeometry(q.width,q.height,q.depth,q.segmentsWidth,q.segmentsHeight,q.segmentsDepth,null,q.flipped,q.sides);Q.geometries[i]=I}else if(q.type==="plane"){I=new THREE.PlaneGeometry(q.width,q.height,q.segmentsWidth,q.segmentsHeight);Q.geometries[i]=I}else if(q.type==="sphere"){I=new THREE.SphereGeometry(q.radius,q.segmentsWidth,q.segmentsHeight);Q.geometries[i]=I}else if(q.type==="cylinder"){I=new THREE.CylinderGeometry(q.topRad,q.botRad,q.height,q.radSegs,q.heightSegs);Q.geometries[i]=
|
|
|
-I}else if(q.type==="torus"){I=new THREE.TorusGeometry(q.radius,q.tube,q.segmentsR,q.segmentsT);Q.geometries[i]=I}else if(q.type==="icosahedron"){I=new THREE.IcosahedronGeometry(q.radius,q.subdivisions);Q.geometries[i]=I}else if(q.type==="bin_mesh")c.load(d(q.url,z.urlBaseType),f(i));else if(q.type==="ascii_mesh")O.load(d(q.url,z.urlBaseType),f(i));else if(q.type==="embedded_mesh"){q=z.embeds[q.id];q.metadata=z.metadata;q&&O.createModel(q,h(i),"")}}for(r in z.textures){i=z.textures[r];if(i.url instanceof
|
|
|
+THREE.SceneLoader.prototype.createScene=function(a,b,c){function d(a,b){return b=="relativeToHTML"?a:k+"/"+a}function e(){var a;for(n in z.objects)if(!N.objects[n]){p=z.objects[n];if(p.geometry!==void 0){if(I=N.geometries[p.geometry]){a=false;U=N.materials[p.materials[0]];(a=U instanceof THREE.ShaderMaterial)&&I.computeTangents();v=p.position;E=p.rotation;A=p.quaternion;G=p.scale;x=p.matrix;A=0;p.materials.length==0&&(U=new THREE.MeshFaceMaterial);p.materials.length>1&&(U=new THREE.MeshFaceMaterial);
|
|
|
+a=new THREE.Mesh(I,U);a.name=n;if(x){a.matrixAutoUpdate=false;a.matrix.set(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15])}else{a.position.set(v[0],v[1],v[2]);if(A){a.quaternion.set(A[0],A[1],A[2],A[3]);a.useQuaternion=true}else a.rotation.set(E[0],E[1],E[2]);a.scale.set(G[0],G[1],G[2])}a.visible=p.visible;a.castShadow=p.castShadow;a.receiveShadow=p.receiveShadow;N.scene.add(a);N.objects[n]=a}}else{v=p.position;E=p.rotation;A=p.quaternion;G=p.scale;A=0;a=new THREE.Object3D;
|
|
|
+a.name=n;a.position.set(v[0],v[1],v[2]);if(A){a.quaternion.set(A[0],A[1],A[2],A[3]);a.useQuaternion=true}else a.rotation.set(E[0],E[1],E[2]);a.scale.set(G[0],G[1],G[2]);a.visible=p.visible!==void 0?p.visible:false;N.scene.add(a);N.objects[n]=a;N.empties[n]=a}}}function f(a){return function(b){N.geometries[a]=b;e();Q=Q-1;l.onLoadComplete();j()}}function h(a){return function(b){N.geometries[a]=b}}function j(){l.callbackProgress({totalModels:ea,totalTextures:ja,loadedModels:ea-Q,loadedTextures:ja-F},
|
|
|
+N);l.onLoadProgress();Q===0&&F===0&&b(N)}var l=this,k=THREE.Loader.prototype.extractUrlBase(c),i,m,n,o,u,q,r,p,x,w,H,v,E,A,G,C,P,I,U,V,S,z,O,Q,F,ea,ja,N;z=a;c=new THREE.BinaryLoader;O=new THREE.JSONLoader;F=Q=0;N={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{}};if(z.transform){a=z.transform.position;w=z.transform.rotation;C=z.transform.scale;a&&N.scene.position.set(a[0],a[1],a[2]);w&&N.scene.rotation.set(w[0],w[1],w[2]);C&&N.scene.scale.set(C[0],
|
|
|
+C[1],C[2]);if(a||w||C){N.scene.updateMatrix();N.scene.updateMatrixWorld()}}a=function(a){return function(){F=F-a;j();l.onLoadComplete()}};for(u in z.cameras){C=z.cameras[u];C.type==="perspective"?V=new THREE.PerspectiveCamera(C.fov,C.aspect,C.near,C.far):C.type==="ortho"&&(V=new THREE.OrthographicCamera(C.left,C.right,C.top,C.bottom,C.near,C.far));v=C.position;w=C.target;C=C.up;V.position.set(v[0],v[1],v[2]);V.target=new THREE.Vector3(w[0],w[1],w[2]);C&&V.up.set(C[0],C[1],C[2]);N.cameras[u]=V}for(o in z.lights){w=
|
|
|
+z.lights[o];u=w.color!==void 0?w.color:16777215;V=w.intensity!==void 0?w.intensity:1;if(w.type==="directional"){v=w.direction;H=new THREE.DirectionalLight(u,V);H.position.set(v[0],v[1],v[2]);H.position.normalize()}else if(w.type==="point"){v=w.position;H=w.distance;H=new THREE.PointLight(u,V,H);H.position.set(v[0],v[1],v[2])}else w.type==="ambient"&&(H=new THREE.AmbientLight(u));N.scene.add(H);N.lights[o]=H}for(q in z.fogs){o=z.fogs[q];o.type==="linear"?S=new THREE.Fog(0,o.near,o.far):o.type==="exp2"&&
|
|
|
+(S=new THREE.FogExp2(0,o.density));C=o.color;S.color.setRGB(C[0],C[1],C[2]);N.fogs[q]=S}if(N.cameras&&z.defaults.camera)N.currentCamera=N.cameras[z.defaults.camera];if(N.fogs&&z.defaults.fog)N.scene.fog=N.fogs[z.defaults.fog];C=z.defaults.bgcolor;N.bgColor=new THREE.Color;N.bgColor.setRGB(C[0],C[1],C[2]);N.bgColorAlpha=z.defaults.bgalpha;for(i in z.geometries){q=z.geometries[i];if(q.type=="bin_mesh"||q.type=="ascii_mesh"){Q=Q+1;l.onLoadStart()}}ea=Q;for(i in z.geometries){q=z.geometries[i];if(q.type===
|
|
|
+"cube"){I=new THREE.CubeGeometry(q.width,q.height,q.depth,q.segmentsWidth,q.segmentsHeight,q.segmentsDepth,null,q.flipped,q.sides);N.geometries[i]=I}else if(q.type==="plane"){I=new THREE.PlaneGeometry(q.width,q.height,q.segmentsWidth,q.segmentsHeight);N.geometries[i]=I}else if(q.type==="sphere"){I=new THREE.SphereGeometry(q.radius,q.segmentsWidth,q.segmentsHeight);N.geometries[i]=I}else if(q.type==="cylinder"){I=new THREE.CylinderGeometry(q.topRad,q.botRad,q.height,q.radSegs,q.heightSegs);N.geometries[i]=
|
|
|
+I}else if(q.type==="torus"){I=new THREE.TorusGeometry(q.radius,q.tube,q.segmentsR,q.segmentsT);N.geometries[i]=I}else if(q.type==="icosahedron"){I=new THREE.IcosahedronGeometry(q.radius,q.subdivisions);N.geometries[i]=I}else if(q.type==="bin_mesh")c.load(d(q.url,z.urlBaseType),f(i));else if(q.type==="ascii_mesh")O.load(d(q.url,z.urlBaseType),f(i));else if(q.type==="embedded_mesh"){q=z.embeds[q.id];q.metadata=z.metadata;q&&O.createModel(q,h(i),"")}}for(r in z.textures){i=z.textures[r];if(i.url instanceof
|
|
|
Array){F=F+i.url.length;for(q=0;q<i.url.length;q++)l.onLoadStart()}else{F=F+1;l.onLoadStart()}}ja=F;for(r in z.textures){i=z.textures[r];if(i.mapping!==void 0&&THREE[i.mapping]!==void 0)i.mapping=new THREE[i.mapping];if(i.url instanceof Array){q=i.url.length;S=[];for(c=0;c<q;c++)S[c]=d(i.url[c],z.urlBaseType);q=THREE.ImageUtils.loadTextureCube(S,i.mapping,a(q))}else{q=THREE.ImageUtils.loadTexture(d(i.url,z.urlBaseType),i.mapping,a(1));if(THREE[i.minFilter]!==void 0)q.minFilter=THREE[i.minFilter];
|
|
|
-if(THREE[i.magFilter]!==void 0)q.magFilter=THREE[i.magFilter];if(i.repeat){q.repeat.set(i.repeat[0],i.repeat[1]);if(i.repeat[0]!==1)q.wrapS=THREE.RepeatWrapping;if(i.repeat[1]!==1)q.wrapT=THREE.RepeatWrapping}i.offset&&q.offset.set(i.offset[0],i.offset[1]);if(i.wrap){S={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(S[i.wrap[0]]!==void 0)q.wrapS=S[i.wrap[0]];if(S[i.wrap[1]]!==void 0)q.wrapT=S[i.wrap[1]]}}Q.textures[r]=q}for(m in z.materials){x=z.materials[m];for(P in x.parameters)if(P===
|
|
|
-"envMap"||P==="map"||P==="lightMap")x.parameters[P]=Q.textures[x.parameters[P]];else if(P==="shading")x.parameters[P]=x.parameters[P]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(P==="blending")x.parameters[P]=x.parameters[P]in THREE?THREE[x.parameters[P]]:THREE.NormalBlending;else if(P==="combine")x.parameters[P]=x.parameters[P]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(P==="vertexColors")if(x.parameters[P]=="face")x.parameters[P]=THREE.FaceColors;else if(x.parameters[P])x.parameters[P]=
|
|
|
-THREE.VertexColors;if(x.parameters.opacity!==void 0&&x.parameters.opacity<1)x.parameters.transparent=true;if(x.parameters.normalMap){r=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(r.uniforms);i=x.parameters.color;q=x.parameters.specular;S=x.parameters.ambient;c=x.parameters.shininess;a.tNormal.texture=Q.textures[x.parameters.normalMap];if(x.parameters.normalMapFactor)a.uNormalScale.value=x.parameters.normalMapFactor;if(x.parameters.map){a.tDiffuse.texture=x.parameters.map;a.enableDiffuse.value=
|
|
|
-true}if(x.parameters.lightMap){a.tAO.texture=x.parameters.lightMap;a.enableAO.value=true}if(x.parameters.specularMap){a.tSpecular.texture=Q.textures[x.parameters.specularMap];a.enableSpecular.value=true}a.uDiffuseColor.value.setHex(i);a.uSpecularColor.value.setHex(q);a.uAmbientColor.value.setHex(S);a.uShininess.value=c;if(x.parameters.opacity)a.uOpacity.value=x.parameters.opacity;U=new THREE.ShaderMaterial({fragmentShader:r.fragmentShader,vertexShader:r.vertexShader,uniforms:a,lights:true,fog:true})}else U=
|
|
|
-new THREE[x.type](x.parameters);Q.materials[m]=U}e();l.callbackSync(Q);j()};THREE.TextureLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
|
|
|
+if(THREE[i.magFilter]!==void 0)q.magFilter=THREE[i.magFilter];if(i.repeat){q.repeat.set(i.repeat[0],i.repeat[1]);if(i.repeat[0]!==1)q.wrapS=THREE.RepeatWrapping;if(i.repeat[1]!==1)q.wrapT=THREE.RepeatWrapping}i.offset&&q.offset.set(i.offset[0],i.offset[1]);if(i.wrap){S={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(S[i.wrap[0]]!==void 0)q.wrapS=S[i.wrap[0]];if(S[i.wrap[1]]!==void 0)q.wrapT=S[i.wrap[1]]}}N.textures[r]=q}for(m in z.materials){x=z.materials[m];for(P in x.parameters)if(P===
|
|
|
+"envMap"||P==="map"||P==="lightMap")x.parameters[P]=N.textures[x.parameters[P]];else if(P==="shading")x.parameters[P]=x.parameters[P]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(P==="blending")x.parameters[P]=x.parameters[P]in THREE?THREE[x.parameters[P]]:THREE.NormalBlending;else if(P==="combine")x.parameters[P]=x.parameters[P]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(P==="vertexColors")if(x.parameters[P]=="face")x.parameters[P]=THREE.FaceColors;else if(x.parameters[P])x.parameters[P]=
|
|
|
+THREE.VertexColors;if(x.parameters.opacity!==void 0&&x.parameters.opacity<1)x.parameters.transparent=true;if(x.parameters.normalMap){r=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(r.uniforms);i=x.parameters.color;q=x.parameters.specular;S=x.parameters.ambient;c=x.parameters.shininess;a.tNormal.texture=N.textures[x.parameters.normalMap];if(x.parameters.normalMapFactor)a.uNormalScale.value=x.parameters.normalMapFactor;if(x.parameters.map){a.tDiffuse.texture=x.parameters.map;a.enableDiffuse.value=
|
|
|
+true}if(x.parameters.lightMap){a.tAO.texture=x.parameters.lightMap;a.enableAO.value=true}if(x.parameters.specularMap){a.tSpecular.texture=N.textures[x.parameters.specularMap];a.enableSpecular.value=true}a.uDiffuseColor.value.setHex(i);a.uSpecularColor.value.setHex(q);a.uAmbientColor.value.setHex(S);a.uShininess.value=c;if(x.parameters.opacity)a.uOpacity.value=x.parameters.opacity;U=new THREE.ShaderMaterial({fragmentShader:r.fragmentShader,vertexShader:r.vertexShader,uniforms:a,lights:true,fog:true})}else U=
|
|
|
+new THREE[x.type](x.parameters);N.materials[m]=U}e();l.callbackSync(N);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;
|
|
@@ -202,7 +202,7 @@ THREE.MeshPhongMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.col
|
|
|
a.perPixel!==void 0?a.perPixel:false;this.wrapAround=a.wrapAround!==void 0?a.wrapAround:false;this.wrapRGB=new THREE.Vector3(1,1,1);this.map=a.map!==void 0?a.map:null;this.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.fog=a.fog!==void 0?a.fog:true;this.shading=
|
|
|
a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:false;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:THREE.NoColors;this.skinning=a.skinning!==void 0?a.skinning:false;this.morphTargets=a.morphTargets!==void 0?
|
|
|
a.morphTargets:false;this.morphNormals=a.morphNormals!==void 0?a.morphNormals:false};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:false;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
|
-THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading?a.shading:THREE.FlatShading;this.wireframe=a.wireframe?a.wireframe:false;this.wireframeLinewidth=a.wireframeLinewidth?a.wireframeLinewidth:1};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshFaceMaterial=function(){};
|
|
|
+THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading?a.shading:THREE.FlatShading;this.wireframe=a.wireframe?a.wireframe:false;this.wireframeLinewidth=a.wireframeLinewidth?a.wireframeLinewidth:1};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshFaceMaterial=function(a){THREE.Material.call(this,a)};
|
|
|
THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:null;this.size=a.size!==void 0?a.size:1;this.sizeAttenuation=a.sizeAttenuation!==void 0?a.sizeAttenuation:true;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:false;this.fog=a.fog!==void 0?a.fog:true};THREE.ParticleBasicMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
|
THREE.ShaderMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.fragmentShader=a.fragmentShader!==void 0?a.fragmentShader:"void main() {}";this.vertexShader=a.vertexShader!==void 0?a.vertexShader:"void main() {}";this.uniforms=a.uniforms!==void 0?a.uniforms:{};this.attributes=a.attributes;this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:false;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.fog=
|
|
|
a.fog!==void 0?a.fog:false;this.lights=a.lights!==void 0?a.lights:false;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:THREE.NoColors;this.skinning=a.skinning!==void 0?a.skinning:false;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:false;this.morphNormals=a.morphNormals!==void 0?a.morphNormals:false};THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
@@ -272,18 +272,18 @@ THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3
|
|
|
"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};
|
|
|
THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if(a.__webglCustomAttributesList===void 0)a.__webglCustomAttributesList=[];for(var f in d.attributes){var e=d.attributes[f];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=true;var h=1;e.type==="v2"?h=2:e.type==="v3"?h=3:e.type==="v4"?h=4:e.type==="c"&&(h=3);e.size=h;e.array=new Float32Array(c*h);e.buffer=g.createBuffer();e.buffer.belongsToAttribute=f;e.needsUpdate=true}a.__webglCustomAttributesList.push(e)}}}
|
|
|
function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMaterial))return a.material;if(b.materialIndex>=0)return a.geometry.materials[b.materialIndex]}function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?false:a&&a.shading!==void 0&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMaterial?true:false}function f(a,b,c){var d,f,e,h,i=a.vertices;h=i.length;
|
|
|
-var j=a.colors,k=j.length,m=a.__vertexArray,l=a.__colorArray,n=a.__sortArray,o=a.verticesNeedUpdate,q=a.colorsNeedUpdate,r=a.__webglCustomAttributesList;if(c.sortParticles){Vb.copy(Wb);Vb.multiplySelf(c.matrixWorld);for(d=0;d<h;d++){f=i[d];pb.copy(f);Vb.multiplyVector3(pb);n[d]=[pb.z,d]}n.sort(function(a,b){return b[0]-a[0]});for(d=0;d<h;d++){f=i[n[d][1]];e=d*3;m[e]=f.x;m[e+1]=f.y;m[e+2]=f.z}for(d=0;d<k;d++){e=d*3;f=j[n[d][1]];l[e]=f.r;l[e+1]=f.g;l[e+2]=f.b}if(r){j=0;for(k=r.length;j<k;j++){i=r[j];
|
|
|
+var j=a.colors,k=j.length,m=a.__vertexArray,l=a.__colorArray,n=a.__sortArray,o=a.verticesNeedUpdate,q=a.colorsNeedUpdate,r=a.__webglCustomAttributesList;if(c.sortParticles){Vb.copy(Wb);Vb.multiplySelf(c.matrixWorld);for(d=0;d<h;d++){f=i[d];Xa.copy(f);Vb.multiplyVector3(Xa);n[d]=[Xa.z,d]}n.sort(function(a,b){return b[0]-a[0]});for(d=0;d<h;d++){f=i[n[d][1]];e=d*3;m[e]=f.x;m[e+1]=f.y;m[e+2]=f.z}for(d=0;d<k;d++){e=d*3;f=j[n[d][1]];l[e]=f.r;l[e+1]=f.g;l[e+2]=f.b}if(r){j=0;for(k=r.length;j<k;j++){i=r[j];
|
|
|
if(i.boundTo===void 0||i.boundTo==="vertices"){e=0;f=i.value.length;if(i.size===1)for(d=0;d<f;d++){h=n[d][1];i.array[d]=i.value[h]}else if(i.size===2)for(d=0;d<f;d++){h=n[d][1];h=i.value[h];i.array[e]=h.x;i.array[e+1]=h.y;e=e+2}else if(i.size===3)if(i.type==="c")for(d=0;d<f;d++){h=n[d][1];h=i.value[h];i.array[e]=h.r;i.array[e+1]=h.g;i.array[e+2]=h.b;e=e+3}else for(d=0;d<f;d++){h=n[d][1];h=i.value[h];i.array[e]=h.x;i.array[e+1]=h.y;i.array[e+2]=h.z;e=e+3}else if(i.size===4)for(d=0;d<f;d++){h=n[d][1];
|
|
|
h=i.value[h];i.array[e]=h.x;i.array[e+1]=h.y;i.array[e+2]=h.z;i.array[e+3]=h.w;e=e+4}}}}}else{if(o)for(d=0;d<h;d++){f=i[d];e=d*3;m[e]=f.x;m[e+1]=f.y;m[e+2]=f.z}if(q)for(d=0;d<k;d++){f=j[d];e=d*3;l[e]=f.r;l[e+1]=f.g;l[e+2]=f.b}if(r){j=0;for(k=r.length;j<k;j++){i=r[j];if(i.needsUpdate&&(i.boundTo===void 0||i.boundTo==="vertices")){f=i.value.length;e=0;if(i.size===1)for(d=0;d<f;d++)i.array[d]=i.value[d];else if(i.size===2)for(d=0;d<f;d++){h=i.value[d];i.array[e]=h.x;i.array[e+1]=h.y;e=e+2}else if(i.size===
|
|
|
3)if(i.type==="c")for(d=0;d<f;d++){h=i.value[d];i.array[e]=h.r;i.array[e+1]=h.g;i.array[e+2]=h.b;e=e+3}else for(d=0;d<f;d++){h=i.value[d];i.array[e]=h.x;i.array[e+1]=h.y;i.array[e+2]=h.z;e=e+3}else if(i.size===4)for(d=0;d<f;d++){h=i.value[d];i.array[e]=h.x;i.array[e+1]=h.y;i.array[e+2]=h.z;i.array[e+3]=h.w;e=e+4}}}}}if(o||c.sortParticles){g.bindBuffer(g.ARRAY_BUFFER,a.__webglVertexBuffer);g.bufferData(g.ARRAY_BUFFER,m,b)}if(q||c.sortParticles){g.bindBuffer(g.ARRAY_BUFFER,a.__webglColorBuffer);g.bufferData(g.ARRAY_BUFFER,
|
|
|
-l,b)}if(r){j=0;for(k=r.length;j<k;j++){i=r[j];if(i.needsUpdate||c.sortParticles){g.bindBuffer(g.ARRAY_BUFFER,i.buffer);g.bufferData(g.ARRAY_BUFFER,i.array,b)}}}}function h(a,b){return b.z-a.z}function j(a,b){return b[1]-a[1]}function l(a,b,c){if(a.length)for(var d=0,g=a.length;d<g;d++){da=Q=null;aa=T=N=ia=Ca=Ia=ua=-1;Wa=true;a[d].render(b,c,gc,xc);da=Q=null;aa=T=N=ia=Ca=Ia=ua=-1;Wa=true}}function k(a,b,c,d,g,f,e,h){var i,j,k,m;if(b){j=a.length-1;m=b=-1}else{j=0;b=a.length;m=1}for(var l=j;l!==b;l=
|
|
|
+l,b)}if(r){j=0;for(k=r.length;j<k;j++){i=r[j];if(i.needsUpdate||c.sortParticles){g.bindBuffer(g.ARRAY_BUFFER,i.buffer);g.bufferData(g.ARRAY_BUFFER,i.array,b)}}}}function h(a,b){return b.z-a.z}function j(a,b){return b[1]-a[1]}function l(a,b,c){if(a.length)for(var d=0,g=a.length;d<g;d++){da=N=null;aa=T=W=ia=Ca=Pa=ua=-1;$a=true;a[d].render(b,c,gc,xc);da=N=null;aa=T=W=ia=Ca=Pa=ua=-1;$a=true}}function k(a,b,c,d,g,f,e,h){var i,j,k,m;if(b){j=a.length-1;m=b=-1}else{j=0;b=a.length;m=1}for(var l=j;l!==b;l=
|
|
|
l+m){i=a[l];if(i.render){j=i.object;k=i.buffer;if(h)i=h;else{i=i[c];if(!i)continue;e&&F.setBlending(i.blending,i.blendEquation,i.blendSrc,i.blendDst);F.setDepthTest(i.depthTest);F.setDepthWrite(i.depthWrite);x(i.polygonOffset,i.polygonOffsetFactor,i.polygonOffsetUnits)}F.setMaterialFaces(i);k instanceof THREE.BufferGeometry?F.renderBufferDirect(d,g,f,i,k,j):F.renderBuffer(d,g,f,i,k,j)}}}function i(a,b,c,d,g,f,e){for(var h,i,j=0,k=a.length;j<k;j++){h=a[j];i=h.object;if(i.visible){if(e)h=e;else{h=h[b];
|
|
|
if(!h)continue;f&&F.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);F.setDepthTest(h.depthTest);F.setDepthWrite(h.depthWrite);x(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}F.renderImmediateObject(c,d,g,h,i)}}}function m(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}function n(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return true;return false}function o(a){for(var b in a.attributes)a.attributes[b].needsUpdate=false}function u(a,b){for(var c=
|
|
|
-a.length-1;c>=0;c--)a[c].object===b&&a.splice(c,1)}function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}function r(a,b,c,d,f){if(d.needsUpdate){d.program&&F.deallocateMaterial(d);F.initMaterial(d,b,c,f);d.needsUpdate=false}if(d.morphTargets&&!f.__webglMorphTargetInfluences)f.__webglMorphTargetInfluences=new Float32Array(F.maxMorphTargets);var e=false,h=d.program,i=h.uniforms,j=d.uniforms;if(h!==Q){g.useProgram(h);Q=h;e=true}if(d.id!==aa){aa=d.id;e=true}if(e||a!==da){g.uniformMatrix4fv(i.projectionMatrix,
|
|
|
-false,a._projectionMatrixArray);a!==da&&(da=a)}if(e){if(c&&d.fog){j.fogColor.value=c.color;if(c instanceof THREE.Fog){j.fogNear.value=c.near;j.fogFar.value=c.far}else if(c instanceof THREE.FogExp2)j.fogDensity.value=c.density}if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Wa){for(var k,m=0,l=0,n=0,o,q,r,p=yc,u=p.directional.colors,w=p.directional.positions,v=p.point.colors,x=p.point.positions,z=p.point.distances,C=p.spot.colors,E=p.spot.positions,O=p.spot.distances,
|
|
|
-P=p.spot.directions,I=p.spot.angles,W=p.spot.exponents,T=0,U=0,S=0,N=r=0,c=N=0,e=b.length;c<e;c++){k=b[c];if(!k.onlyShadow&&k.visible){o=k.color;q=k.intensity;r=k.distance;if(k instanceof THREE.AmbientLight)if(F.gammaInput){m=m+o.r*o.r;l=l+o.g*o.g;n=n+o.b*o.b}else{m=m+o.r;l=l+o.g;n=n+o.b}else if(k instanceof THREE.DirectionalLight){r=T*3;if(F.gammaInput){u[r]=o.r*o.r*q*q;u[r+1]=o.g*o.g*q*q;u[r+2]=o.b*o.b*q*q}else{u[r]=o.r*q;u[r+1]=o.g*q;u[r+2]=o.b*q}Ma.copy(k.matrixWorld.getPosition());Ma.subSelf(k.target.matrixWorld.getPosition());
|
|
|
-Ma.normalize();w[r]=Ma.x;w[r+1]=Ma.y;w[r+2]=Ma.z;T=T+1}else if(k instanceof THREE.PointLight){N=U*3;if(F.gammaInput){v[N]=o.r*o.r*q*q;v[N+1]=o.g*o.g*q*q;v[N+2]=o.b*o.b*q*q}else{v[N]=o.r*q;v[N+1]=o.g*q;v[N+2]=o.b*q}o=k.matrixWorld.getPosition();x[N]=o.x;x[N+1]=o.y;x[N+2]=o.z;z[U]=r;U=U+1}else if(k instanceof THREE.SpotLight){N=S*3;if(F.gammaInput){C[N]=o.r*o.r*q*q;C[N+1]=o.g*o.g*q*q;C[N+2]=o.b*o.b*q*q}else{C[N]=o.r*q;C[N+1]=o.g*q;C[N+2]=o.b*q}o=k.matrixWorld.getPosition();E[N]=o.x;E[N+1]=o.y;E[N+2]=
|
|
|
-o.z;O[S]=r;Ma.copy(o);Ma.subSelf(k.target.matrixWorld.getPosition());Ma.normalize();P[N]=Ma.x;P[N+1]=Ma.y;P[N+2]=Ma.z;I[S]=Math.cos(k.angle);W[S]=k.exponent;S=S+1}}}c=T*3;for(e=u.length;c<e;c++)u[c]=0;c=U*3;for(e=v.length;c<e;c++)v[c]=0;c=S*3;for(e=C.length;c<e;c++)C[c]=0;p.directional.length=T;p.point.length=U;p.spot.length=S;p.ambient[0]=m;p.ambient[1]=l;p.ambient[2]=n;Wa=false}c=yc;j.ambientLightColor.value=c.ambient;j.directionalLightColor.value=c.directional.colors;j.directionalLightDirection.value=
|
|
|
+a.length-1;c>=0;c--)a[c].object===b&&a.splice(c,1)}function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}function r(a,b,c,d,f){if(d.needsUpdate){d.program&&F.deallocateMaterial(d);F.initMaterial(d,b,c,f);d.needsUpdate=false}if(d.morphTargets&&!f.__webglMorphTargetInfluences)f.__webglMorphTargetInfluences=new Float32Array(F.maxMorphTargets);var e=false,h=d.program,i=h.uniforms,j=d.uniforms;if(h!==N){g.useProgram(h);N=h;e=true}if(d.id!==aa){aa=d.id;e=true}if(e||a!==da){g.uniformMatrix4fv(i.projectionMatrix,
|
|
|
+false,a._projectionMatrixArray);a!==da&&(da=a)}if(e){if(c&&d.fog){j.fogColor.value=c.color;if(c instanceof THREE.Fog){j.fogNear.value=c.near;j.fogFar.value=c.far}else if(c instanceof THREE.FogExp2)j.fogDensity.value=c.density}if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if($a){for(var k,m=0,l=0,n=0,o,q,r,p=yc,u=p.directional.colors,w=p.directional.positions,v=p.point.colors,x=p.point.positions,z=p.point.distances,C=p.spot.colors,E=p.spot.positions,O=p.spot.distances,
|
|
|
+P=p.spot.directions,I=p.spot.angles,V=p.spot.exponents,T=0,U=0,S=0,Q=r=0,c=Q=0,e=b.length;c<e;c++){k=b[c];if(!k.onlyShadow&&k.visible){o=k.color;q=k.intensity;r=k.distance;if(k instanceof THREE.AmbientLight)if(F.gammaInput){m=m+o.r*o.r;l=l+o.g*o.g;n=n+o.b*o.b}else{m=m+o.r;l=l+o.g;n=n+o.b}else if(k instanceof THREE.DirectionalLight){r=T*3;if(F.gammaInput){u[r]=o.r*o.r*q*q;u[r+1]=o.g*o.g*q*q;u[r+2]=o.b*o.b*q*q}else{u[r]=o.r*q;u[r+1]=o.g*q;u[r+2]=o.b*q}Ma.copy(k.matrixWorld.getPosition());Ma.subSelf(k.target.matrixWorld.getPosition());
|
|
|
+Ma.normalize();w[r]=Ma.x;w[r+1]=Ma.y;w[r+2]=Ma.z;T=T+1}else if(k instanceof THREE.PointLight){Q=U*3;if(F.gammaInput){v[Q]=o.r*o.r*q*q;v[Q+1]=o.g*o.g*q*q;v[Q+2]=o.b*o.b*q*q}else{v[Q]=o.r*q;v[Q+1]=o.g*q;v[Q+2]=o.b*q}o=k.matrixWorld.getPosition();x[Q]=o.x;x[Q+1]=o.y;x[Q+2]=o.z;z[U]=r;U=U+1}else if(k instanceof THREE.SpotLight){Q=S*3;if(F.gammaInput){C[Q]=o.r*o.r*q*q;C[Q+1]=o.g*o.g*q*q;C[Q+2]=o.b*o.b*q*q}else{C[Q]=o.r*q;C[Q+1]=o.g*q;C[Q+2]=o.b*q}o=k.matrixWorld.getPosition();E[Q]=o.x;E[Q+1]=o.y;E[Q+2]=
|
|
|
+o.z;O[S]=r;Ma.copy(o);Ma.subSelf(k.target.matrixWorld.getPosition());Ma.normalize();P[Q]=Ma.x;P[Q+1]=Ma.y;P[Q+2]=Ma.z;I[S]=Math.cos(k.angle);V[S]=k.exponent;S=S+1}}}c=T*3;for(e=u.length;c<e;c++)u[c]=0;c=U*3;for(e=v.length;c<e;c++)v[c]=0;c=S*3;for(e=C.length;c<e;c++)C[c]=0;p.directional.length=T;p.point.length=U;p.spot.length=S;p.ambient[0]=m;p.ambient[1]=l;p.ambient[2]=n;$a=false}c=yc;j.ambientLightColor.value=c.ambient;j.directionalLightColor.value=c.directional.colors;j.directionalLightDirection.value=
|
|
|
c.directional.positions;j.pointLightColor.value=c.point.colors;j.pointLightPosition.value=c.point.positions;j.pointLightDistance.value=c.point.distances;j.spotLightColor.value=c.spot.colors;j.spotLightPosition.value=c.spot.positions;j.spotLightDistance.value=c.spot.distances;j.spotLightDirection.value=c.spot.directions;j.spotLightAngle.value=c.spot.angles;j.spotLightExponent.value=c.spot.exponents}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){j.opacity.value=
|
|
|
d.opacity;F.gammaInput?j.diffuse.value.copyGammaToLinear(d.color):j.diffuse.value=d.color;(j.map.texture=d.map)&&j.offsetRepeat.value.set(d.map.offset.x,d.map.offset.y,d.map.repeat.x,d.map.repeat.y);j.lightMap.texture=d.lightMap;j.envMap.texture=d.envMap;j.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;j.reflectivity.value=d.reflectivity;j.refractionRatio.value=d.refractionRatio;j.combine.value=d.combine;j.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}if(d instanceof
|
|
|
THREE.LineBasicMaterial){j.diffuse.value=d.color;j.opacity.value=d.opacity}else if(d instanceof THREE.ParticleBasicMaterial){j.psColor.value=d.color;j.opacity.value=d.opacity;j.size.value=d.size;j.scale.value=G.height/2;j.map.texture=d.map}else if(d instanceof THREE.MeshPhongMaterial){j.shininess.value=d.shininess;if(F.gammaInput){j.ambient.value.copyGammaToLinear(d.ambient);j.emissive.value.copyGammaToLinear(d.emissive);j.specular.value.copyGammaToLinear(d.specular)}else{j.ambient.value=d.ambient;
|
|
@@ -296,26 +296,26 @@ g.activeTexture(g.TEXTURE0+k);g.bindTexture(g.TEXTURE_CUBE_MAP,e.image.__webglTe
|
|
|
(m.height&m.height-1)===0;n=A(e.format);p=A(e.type);H(g.TEXTURE_CUBE_MAP,e,l);for(m=0;m<6;m++)g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,n,n,p,k[m]);e.generateMipmaps&&l&&g.generateMipmap(g.TEXTURE_CUBE_MAP);e.needsUpdate=false;if(e.onUpdate)e.onUpdate()}else{g.activeTexture(g.TEXTURE0+k);g.bindTexture(g.TEXTURE_CUBE_MAP,e.image.__webglTextureCube)}}else if(m instanceof THREE.WebGLRenderTargetCube){e=m;g.activeTexture(g.TEXTURE0+k);g.bindTexture(g.TEXTURE_CUBE_MAP,e.__webglTexture)}else F.setTexture(m,
|
|
|
k)}else if(l==="tv"){if(e._array===void 0){e._array=[];l=0;for(n=e.texture.length;l<n;l++)e._array[l]=k+l}g.uniform1iv(m,e._array);l=0;for(n=e.texture.length;l<n;l++)(m=e.texture[l])&&F.setTexture(m,e._array[l])}}if((d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&i.cameraPosition!==null){b=a.matrixWorld.getPosition();g.uniform3f(i.cameraPosition,b.x,b.y,b.z)}(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||
|
|
|
d.skinning)&&i.viewMatrix!==null&&g.uniformMatrix4fv(i.viewMatrix,false,a._viewMatrixArray)}if(d.skinning)if(hc&&f.useVertexTexture){if(i.boneTexture!==null){g.uniform1i(i.boneTexture,12);F.setTexture(f.boneTexture,12)}}else i.boneGlobalMatrices!==null&&g.uniformMatrix4fv(i.boneGlobalMatrices,false,f.boneMatrices);g.uniformMatrix4fv(i.modelViewMatrix,false,f._modelViewMatrix.elements);i.normalMatrix&&g.uniformMatrix3fv(i.normalMatrix,false,f._normalMatrix.elements);i.modelMatrix!==null&&g.uniformMatrix4fv(i.modelMatrix,
|
|
|
-false,f.matrixWorld.elements);return h}function p(a,b){a._modelViewMatrix.multiply(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getInverse(a._modelViewMatrix);a._normalMatrix.transpose()}function x(a,b,c){if(Va!==a){a?g.enable(g.POLYGON_OFFSET_FILL):g.disable(g.POLYGON_OFFSET_FILL);Va=a}if(a&&(wb!==b||Lb!==c)){g.polygonOffset(b,c);wb=b;Lb=c}}function w(a,b){var c;a==="fragment"?c=g.createShader(g.FRAGMENT_SHADER):a==="vertex"&&(c=g.createShader(g.VERTEX_SHADER));g.shaderSource(c,b);g.compileShader(c);
|
|
|
+false,f.matrixWorld.elements);return h}function p(a,b){a._modelViewMatrix.multiply(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getInverse(a._modelViewMatrix);a._normalMatrix.transpose()}function x(a,b,c){if(Ha!==a){a?g.enable(g.POLYGON_OFFSET_FILL):g.disable(g.POLYGON_OFFSET_FILL);Ha=a}if(a&&(Qa!==b||Lb!==c)){g.polygonOffset(b,c);Qa=b;Lb=c}}function w(a,b){var c;a==="fragment"?c=g.createShader(g.FRAGMENT_SHADER):a==="vertex"&&(c=g.createShader(g.VERTEX_SHADER));g.shaderSource(c,b);g.compileShader(c);
|
|
|
if(!g.getShaderParameter(c,g.COMPILE_STATUS)){console.error(g.getShaderInfoLog(c));console.error(b);return null}return c}function H(a,b,c){if(c){g.texParameteri(a,g.TEXTURE_WRAP_S,A(b.wrapS));g.texParameteri(a,g.TEXTURE_WRAP_T,A(b.wrapT));g.texParameteri(a,g.TEXTURE_MAG_FILTER,A(b.magFilter));g.texParameteri(a,g.TEXTURE_MIN_FILTER,A(b.minFilter))}else{g.texParameteri(a,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE);g.texParameteri(a,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE);g.texParameteri(a,g.TEXTURE_MAG_FILTER,E(b.magFilter));
|
|
|
-g.texParameteri(a,g.TEXTURE_MIN_FILTER,E(b.minFilter))}if(Za&&b.type!==THREE.FloatType&&(b.anisotropy>1||b.__oldAnisotropy)){g.texParameterf(a,Za.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,zc));b.__oldAnisotropy=b.anisotropy}}function v(a,b){g.bindRenderbuffer(g.RENDERBUFFER,a);if(b.depthBuffer&&!b.stencilBuffer){g.renderbufferStorage(g.RENDERBUFFER,g.DEPTH_COMPONENT16,b.width,b.height);g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_ATTACHMENT,g.RENDERBUFFER,a)}else if(b.depthBuffer&&b.stencilBuffer){g.renderbufferStorage(g.RENDERBUFFER,
|
|
|
+g.texParameteri(a,g.TEXTURE_MIN_FILTER,E(b.minFilter))}if(qb&&b.type!==THREE.FloatType&&(b.anisotropy>1||b.__oldAnisotropy)){g.texParameterf(a,qb.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,zc));b.__oldAnisotropy=b.anisotropy}}function v(a,b){g.bindRenderbuffer(g.RENDERBUFFER,a);if(b.depthBuffer&&!b.stencilBuffer){g.renderbufferStorage(g.RENDERBUFFER,g.DEPTH_COMPONENT16,b.width,b.height);g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_ATTACHMENT,g.RENDERBUFFER,a)}else if(b.depthBuffer&&b.stencilBuffer){g.renderbufferStorage(g.RENDERBUFFER,
|
|
|
g.DEPTH_STENCIL,b.width,b.height);g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_STENCIL_ATTACHMENT,g.RENDERBUFFER,a)}else g.renderbufferStorage(g.RENDERBUFFER,g.RGBA4,b.width,b.height)}function E(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?g.NEAREST:g.LINEAR}function A(a){return a===THREE.RepeatWrapping?g.REPEAT:a===THREE.ClampToEdgeWrapping?g.CLAMP_TO_EDGE:a===THREE.MirroredRepeatWrapping?g.MIRRORED_REPEAT:a===THREE.NearestFilter?
|
|
|
g.NEAREST:a===THREE.NearestMipMapNearestFilter?g.NEAREST_MIPMAP_NEAREST:a===THREE.NearestMipMapLinearFilter?g.NEAREST_MIPMAP_LINEAR:a===THREE.LinearFilter?g.LINEAR:a===THREE.LinearMipMapNearestFilter?g.LINEAR_MIPMAP_NEAREST:a===THREE.LinearMipMapLinearFilter?g.LINEAR_MIPMAP_LINEAR:a===THREE.UnsignedByteType?g.UNSIGNED_BYTE:a===THREE.UnsignedShort4444Type?g.UNSIGNED_SHORT_4_4_4_4:a===THREE.UnsignedShort5551Type?g.UNSIGNED_SHORT_5_5_5_1:a===THREE.UnsignedShort565Type?g.UNSIGNED_SHORT_5_6_5:a===THREE.ByteType?
|
|
|
g.BYTE:a===THREE.ShortType?g.SHORT:a===THREE.UnsignedShortType?g.UNSIGNED_SHORT:a===THREE.IntType?g.INT:a===THREE.UnsignedIntType?g.UNSIGNED_INT:a===THREE.FloatType?g.FLOAT:a===THREE.AlphaFormat?g.ALPHA:a===THREE.RGBFormat?g.RGB:a===THREE.RGBAFormat?g.RGBA:a===THREE.LuminanceFormat?g.LUMINANCE:a===THREE.LuminanceAlphaFormat?g.LUMINANCE_ALPHA:a===THREE.AddEquation?g.FUNC_ADD:a===THREE.SubtractEquation?g.FUNC_SUBTRACT:a===THREE.ReverseSubtractEquation?g.FUNC_REVERSE_SUBTRACT:a===THREE.ZeroFactor?g.ZERO:
|
|
|
a===THREE.OneFactor?g.ONE:a===THREE.SrcColorFactor?g.SRC_COLOR:a===THREE.OneMinusSrcColorFactor?g.ONE_MINUS_SRC_COLOR:a===THREE.SrcAlphaFactor?g.SRC_ALPHA:a===THREE.OneMinusSrcAlphaFactor?g.ONE_MINUS_SRC_ALPHA:a===THREE.DstAlphaFactor?g.DST_ALPHA:a===THREE.OneMinusDstAlphaFactor?g.ONE_MINUS_DST_ALPHA:a===THREE.DstColorFactor?g.DST_COLOR:a===THREE.OneMinusDstColorFactor?g.ONE_MINUS_DST_COLOR:a===THREE.SrcAlphaSaturateFactor?g.SRC_ALPHA_SATURATE:0}console.log("THREE.WebGLRenderer",THREE.REVISION);var a=
|
|
|
-a||{},G=a.canvas!==void 0?a.canvas:document.createElement("canvas"),C=a.precision!==void 0?a.precision:"highp",P=a.alpha!==void 0?a.alpha:true,I=a.premultipliedAlpha!==void 0?a.premultipliedAlpha:true,U=a.antialias!==void 0?a.antialias:false,W=a.stencil!==void 0?a.stencil:true,S=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:false,z=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),O=a.clearAlpha!==void 0?a.clearAlpha:0,V=a.maxLights!==void 0?a.maxLights:4;this.domElement=
|
|
|
+a||{},G=a.canvas!==void 0?a.canvas:document.createElement("canvas"),C=a.precision!==void 0?a.precision:"highp",P=a.alpha!==void 0?a.alpha:true,I=a.premultipliedAlpha!==void 0?a.premultipliedAlpha:true,U=a.antialias!==void 0?a.antialias:false,V=a.stencil!==void 0?a.stencil:true,S=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:false,z=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),O=a.clearAlpha!==void 0?a.clearAlpha:0,Q=a.maxLights!==void 0?a.maxLights:4;this.domElement=
|
|
|
G;this.context=null;this.autoUpdateScene=this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=true;this.shadowMapEnabled=this.physicallyBasedShading=this.gammaOutput=this.gammaInput=false;this.shadowMapCullFrontFaces=this.shadowMapSoft=this.shadowMapAutoUpdate=true;this.shadowMapCascade=this.shadowMapDebug=false;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=true;this.renderPluginsPre=[];this.renderPluginsPost=[];
|
|
|
-this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var F=this,ea=[],ja=0,Q=null,la=null,aa=-1,T=null,da=null,ta=0,ia=-1,N=-1,ua=-1,Ba=-1,ma=-1,Ja=-1,Ia=-1,Ca=-1,Va=null,wb=null,Lb=null,Mb=null,xb=0,Nb=0,Ob=0,Pb=0,gc=0,xc=0,ic=new THREE.Frustum,Wb=new THREE.Matrix4,Vb=new THREE.Matrix4,pb=new THREE.Vector4,Ma=new THREE.Vector3,Wa=true,yc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},
|
|
|
-spot:{length:0,colors:[],positions:[],distances:[],directions:[],angles:[],exponents:[]}},g,Za;try{if(!(g=G.getContext("experimental-webgl",{alpha:P,premultipliedAlpha:I,antialias:U,stencil:W,preserveDrawingBuffer:S})))throw"Error creating WebGL context.";}catch(Qc){console.error(Qc)}a=g.getExtension("OES_texture_float");P=g.getExtension("OES_standard_derivatives");Za=g.getExtension("EXT_texture_filter_anisotropic")||g.getExtension("MOZ_EXT_texture_filter_anisotropic")||g.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
|
|
|
-a||console.log("THREE.WebGLRenderer: Float textures not supported.");P||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");Za||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");g.clearColor(0,0,0,1);g.clearDepth(1);g.clearStencil(0);g.enable(g.DEPTH_TEST);g.depthFunc(g.LEQUAL);g.frontFace(g.CCW);g.cullFace(g.BACK);g.enable(g.CULL_FACE);g.enable(g.BLEND);g.blendEquation(g.FUNC_ADD);g.blendFunc(g.SRC_ALPHA,g.ONE_MINUS_SRC_ALPHA);g.clearColor(z.r,z.g,
|
|
|
-z.b,O);this.context=g;P=g.getParameter(g.MAX_VERTEX_TEXTURE_IMAGE_UNITS);g.getParameter(g.MAX_TEXTURE_SIZE);var Pc=g.getParameter(g.MAX_CUBE_MAP_TEXTURE_SIZE),zc=Za?g.getParameter(Za.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,jc=P>0,hc=jc&&a;this.getContext=function(){return g};this.supportsVertexTextures=function(){return jc};this.getMaxAnisotropy=function(){return zc};this.setSize=function(a,b){G.width=a;G.height=b;this.setViewport(0,0,G.width,G.height)};this.setViewport=function(a,b,c,d){xb=a!==void 0?
|
|
|
-a:0;Nb=b!==void 0?b:0;Ob=c!==void 0?c:G.width;Pb=d!==void 0?d:G.height;g.viewport(xb,Nb,Ob,Pb)};this.setScissor=function(a,b,c,d){g.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?g.enable(g.SCISSOR_TEST):g.disable(g.SCISSOR_TEST)};this.setClearColorHex=function(a,b){z.setHex(a);O=b;g.clearColor(z.r,z.g,z.b,O)};this.setClearColor=function(a,b){z.copy(a);O=b;g.clearColor(z.r,z.g,z.b,O)};this.getClearColor=function(){return z};this.getClearAlpha=function(){return O};this.clear=function(a,b,c){var d=
|
|
|
+this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var F=this,ea=[],ja=0,N=null,la=null,aa=-1,T=null,da=null,ta=0,ia=-1,W=-1,ua=-1,Ba=-1,ma=-1,Ja=-1,Pa=-1,Ca=-1,Ha=null,Qa=null,Lb=null,xb=null,Ub=0,Mb=0,Nb=0,Ob=0,gc=0,xc=0,ic=new THREE.Frustum,Wb=new THREE.Matrix4,Vb=new THREE.Matrix4,Xa=new THREE.Vector4,Ma=new THREE.Vector3,$a=true,yc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},
|
|
|
+spot:{length:0,colors:[],positions:[],distances:[],directions:[],angles:[],exponents:[]}},g,qb;try{if(!(g=G.getContext("experimental-webgl",{alpha:P,premultipliedAlpha:I,antialias:U,stencil:V,preserveDrawingBuffer:S})))throw"Error creating WebGL context.";}catch(Qc){console.error(Qc)}a=g.getExtension("OES_texture_float");P=g.getExtension("OES_standard_derivatives");qb=g.getExtension("EXT_texture_filter_anisotropic")||g.getExtension("MOZ_EXT_texture_filter_anisotropic")||g.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
|
|
|
+a||console.log("THREE.WebGLRenderer: Float textures not supported.");P||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");qb||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");g.clearColor(0,0,0,1);g.clearDepth(1);g.clearStencil(0);g.enable(g.DEPTH_TEST);g.depthFunc(g.LEQUAL);g.frontFace(g.CCW);g.cullFace(g.BACK);g.enable(g.CULL_FACE);g.enable(g.BLEND);g.blendEquation(g.FUNC_ADD);g.blendFunc(g.SRC_ALPHA,g.ONE_MINUS_SRC_ALPHA);g.clearColor(z.r,z.g,
|
|
|
+z.b,O);this.context=g;P=g.getParameter(g.MAX_VERTEX_TEXTURE_IMAGE_UNITS);g.getParameter(g.MAX_TEXTURE_SIZE);var Pc=g.getParameter(g.MAX_CUBE_MAP_TEXTURE_SIZE),zc=qb?g.getParameter(qb.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,jc=P>0,hc=jc&&a;this.getContext=function(){return g};this.supportsVertexTextures=function(){return jc};this.getMaxAnisotropy=function(){return zc};this.setSize=function(a,b){G.width=a;G.height=b;this.setViewport(0,0,G.width,G.height)};this.setViewport=function(a,b,c,d){Ub=a!==void 0?
|
|
|
+a:0;Mb=b!==void 0?b:0;Nb=c!==void 0?c:G.width;Ob=d!==void 0?d:G.height;g.viewport(Ub,Mb,Nb,Ob)};this.setScissor=function(a,b,c,d){g.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?g.enable(g.SCISSOR_TEST):g.disable(g.SCISSOR_TEST)};this.setClearColorHex=function(a,b){z.setHex(a);O=b;g.clearColor(z.r,z.g,z.b,O)};this.setClearColor=function(a,b){z.copy(a);O=b;g.clearColor(z.r,z.g,z.b,O)};this.getClearColor=function(){return z};this.getClearAlpha=function(){return O};this.clear=function(a,b,c){var d=
|
|
|
0;if(a===void 0||a)d=d|g.COLOR_BUFFER_BIT;if(b===void 0||b)d=d|g.DEPTH_BUFFER_BIT;if(c===void 0||c)d=d|g.STENCIL_BUFFER_BIT;g.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.deallocateObject=function(a){if(a.__webglInit){a.__webglInit=false;delete a._modelViewMatrix;delete a._normalMatrix;delete a._normalMatrixArray;
|
|
|
delete a._modelViewMatrixArray;delete a._modelMatrixArray;if(a instanceof THREE.Mesh)for(var b in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[b];g.deleteBuffer(c.__webglVertexBuffer);g.deleteBuffer(c.__webglNormalBuffer);g.deleteBuffer(c.__webglTangentBuffer);g.deleteBuffer(c.__webglColorBuffer);g.deleteBuffer(c.__webglUVBuffer);g.deleteBuffer(c.__webglUV2Buffer);g.deleteBuffer(c.__webglSkinVertexABuffer);g.deleteBuffer(c.__webglSkinVertexBBuffer);g.deleteBuffer(c.__webglSkinIndicesBuffer);
|
|
|
g.deleteBuffer(c.__webglSkinWeightsBuffer);g.deleteBuffer(c.__webglFaceBuffer);g.deleteBuffer(c.__webglLineBuffer);var d=void 0,e=void 0;if(c.numMorphTargets){d=0;for(e=c.numMorphTargets;d<e;d++)g.deleteBuffer(c.__webglMorphTargetsBuffers[d])}if(c.numMorphNormals){d=0;for(e=c.numMorphNormals;d<e;d++)g.deleteBuffer(c.__webglMorphNormalsBuffers[d])}if(c.__webglCustomAttributesList){d=void 0;for(d in c.__webglCustomAttributesList)g.deleteBuffer(c.__webglCustomAttributesList[d].buffer)}F.info.memory.geometries--}else if(a instanceof
|
|
|
THREE.Ribbon){a=a.geometry;g.deleteBuffer(a.__webglVertexBuffer);g.deleteBuffer(a.__webglColorBuffer);F.info.memory.geometries--}else if(a instanceof THREE.Line){a=a.geometry;g.deleteBuffer(a.__webglVertexBuffer);g.deleteBuffer(a.__webglColorBuffer);F.info.memory.geometries--}else if(a instanceof THREE.ParticleSystem){a=a.geometry;g.deleteBuffer(a.__webglVertexBuffer);g.deleteBuffer(a.__webglColorBuffer);F.info.memory.geometries--}}};this.deallocateTexture=function(a){if(a.__webglInit){a.__webglInit=
|
|
|
false;g.deleteTexture(a.__webglTexture);F.info.memory.textures--}};this.deallocateRenderTarget=function(a){if(a&&a.__webglTexture){g.deleteTexture(a.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;b<6;b++){g.deleteFramebuffer(a.__webglFramebuffer[b]);g.deleteRenderbuffer(a.__webglRenderbuffer[b])}else{g.deleteFramebuffer(a.__webglFramebuffer);g.deleteRenderbuffer(a.__webglRenderbuffer)}}};this.deallocateMaterial=function(a){var b=a.program;if(b){a.program=void 0;var c,d,e=
|
|
|
-false,a=0;for(c=ea.length;a<c;a++){d=ea[a];if(d.program===b){d.usedTimes--;d.usedTimes===0&&(e=true);break}}if(e){e=[];a=0;for(c=ea.length;a<c;a++){d=ea[a];d.program!==b&&e.push(d)}ea=e;g.deleteProgram(b);F.info.memory.programs--}}};this.updateShadowMap=function(a,b){Q=null;aa=T=Ca=Ia=ua=-1;Wa=true;N=ia=-1;this.shadowMapPlugin.update(a,b)};this.renderBufferImmediate=function(a,b,c){if(a.hasPositions&&!a.__webglVertexBuffer)a.__webglVertexBuffer=g.createBuffer();if(a.hasNormals&&!a.__webglNormalBuffer)a.__webglNormalBuffer=
|
|
|
+false,a=0;for(c=ea.length;a<c;a++){d=ea[a];if(d.program===b){d.usedTimes--;d.usedTimes===0&&(e=true);break}}if(e){e=[];a=0;for(c=ea.length;a<c;a++){d=ea[a];d.program!==b&&e.push(d)}ea=e;g.deleteProgram(b);F.info.memory.programs--}}};this.updateShadowMap=function(a,b){N=null;aa=T=Ca=Pa=ua=-1;$a=true;W=ia=-1;this.shadowMapPlugin.update(a,b)};this.renderBufferImmediate=function(a,b,c){if(a.hasPositions&&!a.__webglVertexBuffer)a.__webglVertexBuffer=g.createBuffer();if(a.hasNormals&&!a.__webglNormalBuffer)a.__webglNormalBuffer=
|
|
|
g.createBuffer();if(a.hasUvs&&!a.__webglUvBuffer)a.__webglUvBuffer=g.createBuffer();if(a.hasColors&&!a.__webglColorBuffer)a.__webglColorBuffer=g.createBuffer();if(a.hasPositions){g.bindBuffer(g.ARRAY_BUFFER,a.__webglVertexBuffer);g.bufferData(g.ARRAY_BUFFER,a.positionArray,g.DYNAMIC_DRAW);g.enableVertexAttribArray(b.attributes.position);g.vertexAttribPointer(b.attributes.position,3,g.FLOAT,false,0,0)}if(a.hasNormals){g.bindBuffer(g.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,
|
|
|
e,f,h,i,j,k,l,m,n,o,q=a.count*3;for(o=0;o<q;o=o+9){n=a.normalArray;d=n[o];e=n[o+1];f=n[o+2];h=n[o+3];j=n[o+4];l=n[o+5];i=n[o+6];k=n[o+7];m=n[o+8];d=(d+h+i)/3;e=(e+j+k)/3;f=(f+l+m)/3;n[o]=d;n[o+1]=e;n[o+2]=f;n[o+3]=d;n[o+4]=e;n[o+5]=f;n[o+6]=d;n[o+7]=e;n[o+8]=f}}g.bufferData(g.ARRAY_BUFFER,a.normalArray,g.DYNAMIC_DRAW);g.enableVertexAttribArray(b.attributes.normal);g.vertexAttribPointer(b.attributes.normal,3,g.FLOAT,false,0,0)}if(a.hasUvs&&c.map){g.bindBuffer(g.ARRAY_BUFFER,a.__webglUvBuffer);g.bufferData(g.ARRAY_BUFFER,
|
|
|
a.uvArray,g.DYNAMIC_DRAW);g.enableVertexAttribArray(b.attributes.uv);g.vertexAttribPointer(b.attributes.uv,2,g.FLOAT,false,0,0)}if(a.hasColors&&c.vertexColors!==THREE.NoColors){g.bindBuffer(g.ARRAY_BUFFER,a.__webglColorBuffer);g.bufferData(g.ARRAY_BUFFER,a.colorArray,g.DYNAMIC_DRAW);g.enableVertexAttribArray(b.attributes.color);g.vertexAttribPointer(b.attributes.color,3,g.FLOAT,false,0,0)}g.drawArrays(g.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(d.visible!==false){c=
|
|
@@ -328,49 +328,49 @@ i.sort(j):i.length===0&&i.push([0,0]);for(k=0;k<d.numSupportedMorphTargets;){if(
|
|
|
k],3,g.FLOAT,false,0,0);f.__webglMorphTargetInfluences[k]=0}k++}}d.program.uniforms.morphTargetInfluences!==null&&g.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList){h=0;for(i=e.__webglCustomAttributesList.length;h<i;h++){c=e.__webglCustomAttributesList[h];if(b[c.buffer.belongsToAttribute]>=0){g.bindBuffer(g.ARRAY_BUFFER,c.buffer);g.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,g.FLOAT,false,0,0)}}}if(b.color>=0){g.bindBuffer(g.ARRAY_BUFFER,
|
|
|
e.__webglColorBuffer);g.vertexAttribPointer(b.color,3,g.FLOAT,false,0,0)}if(b.normal>=0){g.bindBuffer(g.ARRAY_BUFFER,e.__webglNormalBuffer);g.vertexAttribPointer(b.normal,3,g.FLOAT,false,0,0)}if(b.tangent>=0){g.bindBuffer(g.ARRAY_BUFFER,e.__webglTangentBuffer);g.vertexAttribPointer(b.tangent,4,g.FLOAT,false,0,0)}if(b.uv>=0)if(e.__webglUVBuffer){g.bindBuffer(g.ARRAY_BUFFER,e.__webglUVBuffer);g.vertexAttribPointer(b.uv,2,g.FLOAT,false,0,0);g.enableVertexAttribArray(b.uv)}else g.disableVertexAttribArray(b.uv);
|
|
|
if(b.uv2>=0)if(e.__webglUV2Buffer){g.bindBuffer(g.ARRAY_BUFFER,e.__webglUV2Buffer);g.vertexAttribPointer(b.uv2,2,g.FLOAT,false,0,0);g.enableVertexAttribArray(b.uv2)}else g.disableVertexAttribArray(b.uv2);if(d.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0){g.bindBuffer(g.ARRAY_BUFFER,e.__webglSkinVertexABuffer);g.vertexAttribPointer(b.skinVertexA,4,g.FLOAT,false,0,0);g.bindBuffer(g.ARRAY_BUFFER,e.__webglSkinVertexBBuffer);g.vertexAttribPointer(b.skinVertexB,4,g.FLOAT,
|
|
|
-false,0,0);g.bindBuffer(g.ARRAY_BUFFER,e.__webglSkinIndicesBuffer);g.vertexAttribPointer(b.skinIndex,4,g.FLOAT,false,0,0);g.bindBuffer(g.ARRAY_BUFFER,e.__webglSkinWeightsBuffer);g.vertexAttribPointer(b.skinWeight,4,g.FLOAT,false,0,0)}}if(f instanceof THREE.Mesh){if(d.wireframe){d=d.wireframeLinewidth;if(d!==Mb){g.lineWidth(d);Mb=d}a&&g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer);g.drawElements(g.LINES,e.__webglLineCount,g.UNSIGNED_SHORT,0)}else{a&&g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer);
|
|
|
-g.drawElements(g.TRIANGLES,e.__webglFaceCount,g.UNSIGNED_SHORT,0)}F.info.render.calls++;F.info.render.vertices=F.info.render.vertices+e.__webglFaceCount;F.info.render.faces=F.info.render.faces+e.__webglFaceCount/3}else if(f instanceof THREE.Line){f=f.type===THREE.LineStrip?g.LINE_STRIP:g.LINES;d=d.linewidth;if(d!==Mb){g.lineWidth(d);Mb=d}g.drawArrays(f,0,e.__webglLineCount);F.info.render.calls++}else if(f instanceof THREE.ParticleSystem){g.drawArrays(g.POINTS,0,e.__webglParticleCount);F.info.render.calls++;
|
|
|
-F.info.render.points=F.info.render.points+e.__webglParticleCount}else if(f instanceof THREE.Ribbon){g.drawArrays(g.TRIANGLE_STRIP,0,e.__webglVertexCount);F.info.render.calls++}}};this.render=function(a,b,c,d){var e,f,j,m,n=a.__lights,o=a.fog;aa=-1;Wa=true;this.autoUpdateScene&&a.updateMatrixWorld();b.parent===void 0&&b.updateMatrixWorld();if(!b._viewMatrixArray)b._viewMatrixArray=new Float32Array(16);if(!b._projectionMatrixArray)b._projectionMatrixArray=new Float32Array(16);b.matrixWorldInverse.getInverse(b.matrixWorld);
|
|
|
+false,0,0);g.bindBuffer(g.ARRAY_BUFFER,e.__webglSkinIndicesBuffer);g.vertexAttribPointer(b.skinIndex,4,g.FLOAT,false,0,0);g.bindBuffer(g.ARRAY_BUFFER,e.__webglSkinWeightsBuffer);g.vertexAttribPointer(b.skinWeight,4,g.FLOAT,false,0,0)}}if(f instanceof THREE.Mesh){if(d.wireframe){d=d.wireframeLinewidth;if(d!==xb){g.lineWidth(d);xb=d}a&&g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer);g.drawElements(g.LINES,e.__webglLineCount,g.UNSIGNED_SHORT,0)}else{a&&g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer);
|
|
|
+g.drawElements(g.TRIANGLES,e.__webglFaceCount,g.UNSIGNED_SHORT,0)}F.info.render.calls++;F.info.render.vertices=F.info.render.vertices+e.__webglFaceCount;F.info.render.faces=F.info.render.faces+e.__webglFaceCount/3}else if(f instanceof THREE.Line){f=f.type===THREE.LineStrip?g.LINE_STRIP:g.LINES;d=d.linewidth;if(d!==xb){g.lineWidth(d);xb=d}g.drawArrays(f,0,e.__webglLineCount);F.info.render.calls++}else if(f instanceof THREE.ParticleSystem){g.drawArrays(g.POINTS,0,e.__webglParticleCount);F.info.render.calls++;
|
|
|
+F.info.render.points=F.info.render.points+e.__webglParticleCount}else if(f instanceof THREE.Ribbon){g.drawArrays(g.TRIANGLE_STRIP,0,e.__webglVertexCount);F.info.render.calls++}}};this.render=function(a,b,c,d){var e,f,j,m,n=a.__lights,o=a.fog;aa=-1;$a=true;this.autoUpdateScene&&a.updateMatrixWorld();b.parent===void 0&&b.updateMatrixWorld();if(!b._viewMatrixArray)b._viewMatrixArray=new Float32Array(16);if(!b._projectionMatrixArray)b._projectionMatrixArray=new Float32Array(16);b.matrixWorldInverse.getInverse(b.matrixWorld);
|
|
|
b.matrixWorldInverse.flattenToArray(b._viewMatrixArray);b.projectionMatrix.flattenToArray(b._projectionMatrixArray);Wb.multiply(b.projectionMatrix,b.matrixWorldInverse);ic.setFromMatrix(Wb);this.autoUpdateObjects&&this.initWebGLObjects(a);l(this.renderPluginsPre,a,b);F.info.render.calls=0;F.info.render.vertices=0;F.info.render.faces=0;F.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=a.__webglObjects;d=0;
|
|
|
for(e=m.length;d<e;d++){f=m[d];j=f.object;f.render=false;if(j.visible&&(!(j instanceof THREE.Mesh||j instanceof THREE.ParticleSystem)||!j.frustumCulled||ic.contains(j))){p(j,b);var q=f,r=q.object,u=q.buffer,v=void 0,v=v=void 0,v=r.material;if(v instanceof THREE.MeshFaceMaterial){v=u.materialIndex;if(v>=0){v=r.geometry.materials[v];if(v.transparent){q.transparent=v;q.opaque=null}else{q.opaque=v;q.transparent=null}}}else if(v)if(v.transparent){q.transparent=v;q.opaque=null}else{q.opaque=v;q.transparent=
|
|
|
-null}f.render=true;if(this.sortObjects)if(j.renderDepth)f.z=j.renderDepth;else{pb.copy(j.matrixWorld.getPosition());Wb.multiplyVector3(pb);f.z=pb.z}}}this.sortObjects&&m.sort(h);m=a.__webglObjectsImmediate;d=0;for(e=m.length;d<e;d++){f=m[d];j=f.object;if(j.visible){p(j,b);j=f.object.material;if(j.transparent){f.transparent=j;f.opaque=null}else{f.opaque=j;f.transparent=null}}}if(a.overrideMaterial){d=a.overrideMaterial;this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst);this.setDepthTest(d.depthTest);
|
|
|
+null}f.render=true;if(this.sortObjects)if(j.renderDepth)f.z=j.renderDepth;else{Xa.copy(j.matrixWorld.getPosition());Wb.multiplyVector3(Xa);f.z=Xa.z}}}this.sortObjects&&m.sort(h);m=a.__webglObjectsImmediate;d=0;for(e=m.length;d<e;d++){f=m[d];j=f.object;if(j.visible){p(j,b);j=f.object.material;if(j.transparent){f.transparent=j;f.opaque=null}else{f.opaque=j;f.transparent=null}}}if(a.overrideMaterial){d=a.overrideMaterial;this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst);this.setDepthTest(d.depthTest);
|
|
|
this.setDepthWrite(d.depthWrite);x(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits);k(a.__webglObjects,false,"",b,n,o,true,d);i(a.__webglObjectsImmediate,"",b,n,o,false,d)}else{this.setBlending(THREE.NormalBlending);k(a.__webglObjects,true,"opaque",b,n,o,false);i(a.__webglObjectsImmediate,"opaque",b,n,o,false);k(a.__webglObjects,false,"transparent",b,n,o,true);i(a.__webglObjectsImmediate,"transparent",b,n,o,true)}l(this.renderPluginsPost,a,b);if(c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&
|
|
|
c.minFilter!==THREE.LinearFilter)if(c instanceof THREE.WebGLRenderTargetCube){g.bindTexture(g.TEXTURE_CUBE_MAP,c.__webglTexture);g.generateMipmap(g.TEXTURE_CUBE_MAP);g.bindTexture(g.TEXTURE_CUBE_MAP,null)}else{g.bindTexture(g.TEXTURE_2D,c.__webglTexture);g.generateMipmap(g.TEXTURE_2D);g.bindTexture(g.TEXTURE_2D,null)}this.setDepthTest(true);this.setDepthWrite(true)};this.renderImmediateObject=function(a,b,c,d,e){var f=r(a,b,c,d,e);T=-1;F.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,
|
|
|
g,ic):e.render(function(a){F.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){if(!a.__webglObjects){a.__webglObjects=[];a.__webglObjectsImmediate=[];a.__webglSprites=[];a.__webglFlares=[]}for(;a.__objectsAdded.length;){var h=a.__objectsAdded[0],i=a,j=void 0,k=void 0,l=void 0;if(!h.__webglInit){h.__webglInit=true;h._modelViewMatrix=new THREE.Matrix4;h._normalMatrix=new THREE.Matrix3;if(h instanceof THREE.Mesh){k=h.geometry;if(k instanceof THREE.Geometry){if(k.geometryGroups===void 0){var p=
|
|
|
k,r=void 0,v=void 0,w=void 0,x=void 0,z=void 0,A=void 0,C=void 0,E={},H=p.morphTargets.length,P=p.morphNormals.length;p.geometryGroups={};r=0;for(v=p.faces.length;r<v;r++){w=p.faces[r];x=w.materialIndex;A=x!==void 0?x:-1;E[A]===void 0&&(E[A]={hash:A,counter:0});C=E[A].hash+"_"+E[A].counter;p.geometryGroups[C]===void 0&&(p.geometryGroups[C]={faces3:[],faces4:[],materialIndex:x,vertices:0,numMorphTargets:H,numMorphNormals:P});z=w instanceof THREE.Face3?3:4;if(p.geometryGroups[C].vertices+z>65535){E[A].counter=
|
|
|
E[A].counter+1;C=E[A].hash+"_"+E[A].counter;p.geometryGroups[C]===void 0&&(p.geometryGroups[C]={faces3:[],faces4:[],materialIndex:x,vertices:0,numMorphTargets:H,numMorphNormals:P})}w instanceof THREE.Face3?p.geometryGroups[C].faces3.push(r):p.geometryGroups[C].faces4.push(r);p.geometryGroups[C].vertices=p.geometryGroups[C].vertices+z}p.geometryGroupsList=[];var O=void 0;for(O in p.geometryGroups){p.geometryGroups[O].id=ta++;p.geometryGroupsList.push(p.geometryGroups[O])}}for(j in k.geometryGroups){l=
|
|
|
k.geometryGroups[j];if(!l.__webglVertexBuffer){var G=l;G.__webglVertexBuffer=g.createBuffer();G.__webglNormalBuffer=g.createBuffer();G.__webglTangentBuffer=g.createBuffer();G.__webglColorBuffer=g.createBuffer();G.__webglUVBuffer=g.createBuffer();G.__webglUV2Buffer=g.createBuffer();G.__webglSkinVertexABuffer=g.createBuffer();G.__webglSkinVertexBBuffer=g.createBuffer();G.__webglSkinIndicesBuffer=g.createBuffer();G.__webglSkinWeightsBuffer=g.createBuffer();G.__webglFaceBuffer=g.createBuffer();G.__webglLineBuffer=
|
|
|
-g.createBuffer();var N=void 0,Q=void 0;if(G.numMorphTargets){G.__webglMorphTargetsBuffers=[];N=0;for(Q=G.numMorphTargets;N<Q;N++)G.__webglMorphTargetsBuffers.push(g.createBuffer())}if(G.numMorphNormals){G.__webglMorphNormalsBuffers=[];N=0;for(Q=G.numMorphNormals;N<Q;N++)G.__webglMorphNormalsBuffers.push(g.createBuffer())}F.info.memory.geometries++;var I=l,S=h,T=S.geometry,U=I.faces3,W=I.faces4,V=U.length*3+W.length*4,da=U.length*1+W.length*2,ea=U.length*3+W.length*4,aa=c(S,I),ia=e(aa),la=d(aa),ua=
|
|
|
-aa.vertexColors?aa.vertexColors:false;I.__vertexArray=new Float32Array(V*3);if(la)I.__normalArray=new Float32Array(V*3);if(T.hasTangents)I.__tangentArray=new Float32Array(V*4);if(ua)I.__colorArray=new Float32Array(V*3);if(ia){if(T.faceUvs.length>0||T.faceVertexUvs.length>0)I.__uvArray=new Float32Array(V*2);if(T.faceUvs.length>1||T.faceVertexUvs.length>1)I.__uv2Array=new Float32Array(V*2)}if(S.geometry.skinWeights.length&&S.geometry.skinIndices.length){I.__skinVertexAArray=new Float32Array(V*4);I.__skinVertexBArray=
|
|
|
-new Float32Array(V*4);I.__skinIndexArray=new Float32Array(V*4);I.__skinWeightArray=new Float32Array(V*4)}I.__faceArray=new Uint16Array(da*3);I.__lineArray=new Uint16Array(ea*2);var ja=void 0,Lb=void 0;if(I.numMorphTargets){I.__morphTargetsArrays=[];ja=0;for(Lb=I.numMorphTargets;ja<Lb;ja++)I.__morphTargetsArrays.push(new Float32Array(V*3))}if(I.numMorphNormals){I.__morphNormalsArrays=[];ja=0;for(Lb=I.numMorphNormals;ja<Lb;ja++)I.__morphNormalsArrays.push(new Float32Array(V*3))}I.__webglFaceCount=da*
|
|
|
-3;I.__webglLineCount=ea*2;if(aa.attributes){if(I.__webglCustomAttributesList===void 0)I.__webglCustomAttributesList=[];var Ca=void 0;for(Ca in aa.attributes){var Ba=aa.attributes[Ca],ma={},Ja;for(Ja in Ba)ma[Ja]=Ba[Ja];if(!ma.__webglInitialized||ma.createUniqueBuffers){ma.__webglInitialized=true;var Ia=1;ma.type==="v2"?Ia=2:ma.type==="v3"?Ia=3:ma.type==="v4"?Ia=4:ma.type==="c"&&(Ia=3);ma.size=Ia;ma.array=new Float32Array(V*Ia);ma.buffer=g.createBuffer();ma.buffer.belongsToAttribute=Ca;Ba.needsUpdate=
|
|
|
-true;ma.__original=Ba}I.__webglCustomAttributesList.push(ma)}}I.__inittedArrays=true;k.verticesNeedUpdate=true;k.morphTargetsNeedUpdate=true;k.elementsNeedUpdate=true;k.uvsNeedUpdate=true;k.normalsNeedUpdate=true;k.tangentsNeedUpdate=true;k.colorsNeedUpdate=true}}}else if(k instanceof THREE.BufferGeometry){var Mb=k,Ma=void 0,xb=void 0,Va=void 0;for(Ma in Mb.attributes){Va=Ma==="index"?g.ELEMENT_ARRAY_BUFFER:g.ARRAY_BUFFER;xb=Mb.attributes[Ma];xb.buffer=g.createBuffer();g.bindBuffer(Va,xb.buffer);
|
|
|
-g.bufferData(Va,xb.array,g.STATIC_DRAW)}}}else if(h instanceof THREE.Ribbon){k=h.geometry;if(!k.__webglVertexBuffer){var pb=k;pb.__webglVertexBuffer=g.createBuffer();pb.__webglColorBuffer=g.createBuffer();F.info.memory.geometries++;var Wa=k,Za=Wa.vertices.length;Wa.__vertexArray=new Float32Array(Za*3);Wa.__colorArray=new Float32Array(Za*3);Wa.__webglVertexCount=Za;k.verticesNeedUpdate=true;k.colorsNeedUpdate=true}}else if(h instanceof THREE.Line){k=h.geometry;if(!k.__webglVertexBuffer){var wb=k;wb.__webglVertexBuffer=
|
|
|
-g.createBuffer();wb.__webglColorBuffer=g.createBuffer();F.info.memory.geometries++;var kc=k,Wb=h,Nb=kc.vertices.length;kc.__vertexArray=new Float32Array(Nb*3);kc.__colorArray=new Float32Array(Nb*3);kc.__webglLineCount=Nb;b(kc,Wb);k.verticesNeedUpdate=true;k.colorsNeedUpdate=true}}else if(h instanceof THREE.ParticleSystem){k=h.geometry;if(!k.__webglVertexBuffer){var Vb=k;Vb.__webglVertexBuffer=g.createBuffer();Vb.__webglColorBuffer=g.createBuffer();F.info.geometries++;var Xb=k,hc=h,Ob=Xb.vertices.length;
|
|
|
-Xb.__vertexArray=new Float32Array(Ob*3);Xb.__colorArray=new Float32Array(Ob*3);Xb.__sortArray=[];Xb.__webglParticleCount=Ob;b(Xb,hc);k.verticesNeedUpdate=true;k.colorsNeedUpdate=true}}}if(!h.__webglActive){if(h instanceof THREE.Mesh){k=h.geometry;if(k instanceof THREE.BufferGeometry)m(i.__webglObjects,k,h);else for(j in k.geometryGroups){l=k.geometryGroups[j];m(i.__webglObjects,l,h)}}else if(h instanceof THREE.Ribbon||h instanceof THREE.Line||h instanceof THREE.ParticleSystem){k=h.geometry;m(i.__webglObjects,
|
|
|
-k,h)}else h instanceof THREE.ImmediateRenderObject||h.immediateRenderCallback?i.__webglObjectsImmediate.push({object:h,opaque:null,transparent:null}):h instanceof THREE.Sprite?i.__webglSprites.push(h):h instanceof THREE.LensFlare&&i.__webglFlares.push(h);h.__webglActive=true}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;){var Ra=a.__objectsRemoved[0],Ac=a;Ra instanceof THREE.Mesh||Ra instanceof THREE.ParticleSystem||Ra instanceof THREE.Ribbon||Ra instanceof THREE.Line?u(Ac.__webglObjects,
|
|
|
-Ra):Ra instanceof THREE.Sprite?q(Ac.__webglSprites,Ra):Ra instanceof THREE.LensFlare?q(Ac.__webglFlares,Ra):(Ra instanceof THREE.ImmediateRenderObject||Ra.immediateRenderCallback)&&u(Ac.__webglObjectsImmediate,Ra);Ra.__webglActive=false;a.__objectsRemoved.splice(0,1)}for(var Pb=0,ic=a.__webglObjects.length;Pb<ic;Pb++){var Xa=a.__webglObjects[Pb].object,X=Xa.geometry,lc=void 0,Yb=void 0,Na=void 0;if(Xa instanceof THREE.Mesh)if(X instanceof THREE.BufferGeometry){if(X.verticesNeedUpdate||X.elementsNeedUpdate||
|
|
|
-X.uvsNeedUpdate||X.normalsNeedUpdate||X.colorsNeedUpdate||X.tangentsNeedUpdate){var qb=X,Zb=g.DYNAMIC_DRAW,jc=!X.dynamic,$b=qb.attributes,Rc=$b.index,Sc=$b.position,Tc=$b.normal,Uc=$b.uv,Vc=$b.color,Wc=$b.tangent;if(qb.elementsNeedUpdate&&Rc!==void 0){g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,Rc.buffer);g.bufferData(g.ELEMENT_ARRAY_BUFFER,Rc.array,Zb)}if(qb.verticesNeedUpdate&&Sc!==void 0){g.bindBuffer(g.ARRAY_BUFFER,Sc.buffer);g.bufferData(g.ARRAY_BUFFER,Sc.array,Zb)}if(qb.normalsNeedUpdate&&Tc!==void 0){g.bindBuffer(g.ARRAY_BUFFER,
|
|
|
-Tc.buffer);g.bufferData(g.ARRAY_BUFFER,Tc.array,Zb)}if(qb.uvsNeedUpdate&&Uc!==void 0){g.bindBuffer(g.ARRAY_BUFFER,Uc.buffer);g.bufferData(g.ARRAY_BUFFER,Uc.array,Zb)}if(qb.colorsNeedUpdate&&Vc!==void 0){g.bindBuffer(g.ARRAY_BUFFER,Vc.buffer);g.bufferData(g.ARRAY_BUFFER,Vc.array,Zb)}if(qb.tangentsNeedUpdate&&Wc!==void 0){g.bindBuffer(g.ARRAY_BUFFER,Wc.buffer);g.bufferData(g.ARRAY_BUFFER,Wc.array,Zb)}if(jc){var gc=void 0;for(gc in qb.attributes)delete qb.attributes[gc].array}}X.verticesNeedUpdate=false;
|
|
|
-X.elementsNeedUpdate=false;X.uvsNeedUpdate=false;X.normalsNeedUpdate=false;X.colorsNeedUpdate=false;X.tangentsNeedUpdate=false}else{for(var Xc=0,xc=X.geometryGroupsList.length;Xc<xc;Xc++){lc=X.geometryGroupsList[Xc];Na=c(Xa,lc);Yb=Na.attributes&&n(Na);if(X.verticesNeedUpdate||X.morphTargetsNeedUpdate||X.elementsNeedUpdate||X.uvsNeedUpdate||X.normalsNeedUpdate||X.colorsNeedUpdate||X.tangentsNeedUpdate||Yb){var Z=lc,yc=Xa,Pa=g.DYNAMIC_DRAW,zc=!X.dynamic,Qb=Na;if(Z.__inittedArrays){var fd=d(Qb),Yc=Qb.vertexColors?
|
|
|
-Qb.vertexColors:false,gd=e(Qb),Bc=fd===THREE.SmoothShading,y=void 0,M=void 0,Ua=void 0,D=void 0,ac=void 0,yb=void 0,Ya=void 0,Cc=void 0,rb=void 0,bc=void 0,cc=void 0,J=void 0,K=void 0,L=void 0,$=void 0,$a=void 0,ab=void 0,bb=void 0,mc=void 0,cb=void 0,db=void 0,eb=void 0,nc=void 0,fb=void 0,gb=void 0,hb=void 0,oc=void 0,ib=void 0,jb=void 0,kb=void 0,pc=void 0,lb=void 0,mb=void 0,nb=void 0,qc=void 0,zb=void 0,Ab=void 0,Bb=void 0,Dc=void 0,Cb=void 0,Db=void 0,Eb=void 0,Ec=void 0,fa=void 0,hd=void 0,
|
|
|
-Fb=void 0,dc=void 0,ec=void 0,Da=void 0,id=void 0,za=void 0,Aa=void 0,Gb=void 0,sb=void 0,va=0,ya=0,tb=0,ub=0,Sa=0,Ha=0,ha=0,Ka=0,wa=0,B=0,Y=0,t=0,ga=void 0,Ea=Z.__vertexArray,rc=Z.__uvArray,sc=Z.__uv2Array,Ta=Z.__normalArray,na=Z.__tangentArray,Fa=Z.__colorArray,oa=Z.__skinVertexAArray,pa=Z.__skinVertexBArray,qa=Z.__skinIndexArray,ra=Z.__skinWeightArray,Zc=Z.__morphTargetsArrays,$c=Z.__morphNormalsArrays,ad=Z.__webglCustomAttributesList,s=void 0,ob=Z.__faceArray,Qa=Z.__lineArray,La=yc.geometry,Pc=
|
|
|
-La.elementsNeedUpdate,jd=La.uvsNeedUpdate,Qc=La.normalsNeedUpdate,qd=La.tangentsNeedUpdate,rd=La.colorsNeedUpdate,sd=La.morphTargetsNeedUpdate,Rb=La.vertices,ba=Z.faces3,ca=Z.faces4,xa=La.faces,bd=La.faceVertexUvs[0],cd=La.faceVertexUvs[1],Sb=La.skinVerticesA,Tb=La.skinVerticesB,Ub=La.skinIndices,Hb=La.skinWeights,Ib=La.morphTargets,Fc=La.morphNormals;if(La.verticesNeedUpdate){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];J=Rb[D.a];K=Rb[D.b];L=Rb[D.c];Ea[ya]=J.x;Ea[ya+1]=J.y;Ea[ya+2]=J.z;Ea[ya+3]=K.x;
|
|
|
-Ea[ya+4]=K.y;Ea[ya+5]=K.z;Ea[ya+6]=L.x;Ea[ya+7]=L.y;Ea[ya+8]=L.z;ya=ya+9}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];J=Rb[D.a];K=Rb[D.b];L=Rb[D.c];$=Rb[D.d];Ea[ya]=J.x;Ea[ya+1]=J.y;Ea[ya+2]=J.z;Ea[ya+3]=K.x;Ea[ya+4]=K.y;Ea[ya+5]=K.z;Ea[ya+6]=L.x;Ea[ya+7]=L.y;Ea[ya+8]=L.z;Ea[ya+9]=$.x;Ea[ya+10]=$.y;Ea[ya+11]=$.z;ya=ya+12}g.bindBuffer(g.ARRAY_BUFFER,Z.__webglVertexBuffer);g.bufferData(g.ARRAY_BUFFER,Ea,Pa)}if(sd){Da=0;for(id=Ib.length;Da<id;Da++){y=Y=0;for(M=ba.length;y<M;y++){Gb=ba[y];D=xa[Gb];J=Ib[Da].vertices[D.a];
|
|
|
-K=Ib[Da].vertices[D.b];L=Ib[Da].vertices[D.c];za=Zc[Da];za[Y]=J.x;za[Y+1]=J.y;za[Y+2]=J.z;za[Y+3]=K.x;za[Y+4]=K.y;za[Y+5]=K.z;za[Y+6]=L.x;za[Y+7]=L.y;za[Y+8]=L.z;if(Qb.morphNormals){if(Bc){sb=Fc[Da].vertexNormals[Gb];cb=sb.a;db=sb.b;eb=sb.c}else eb=db=cb=Fc[Da].faceNormals[Gb];Aa=$c[Da];Aa[Y]=cb.x;Aa[Y+1]=cb.y;Aa[Y+2]=cb.z;Aa[Y+3]=db.x;Aa[Y+4]=db.y;Aa[Y+5]=db.z;Aa[Y+6]=eb.x;Aa[Y+7]=eb.y;Aa[Y+8]=eb.z}Y=Y+9}y=0;for(M=ca.length;y<M;y++){Gb=ca[y];D=xa[Gb];J=Ib[Da].vertices[D.a];K=Ib[Da].vertices[D.b];
|
|
|
-L=Ib[Da].vertices[D.c];$=Ib[Da].vertices[D.d];za=Zc[Da];za[Y]=J.x;za[Y+1]=J.y;za[Y+2]=J.z;za[Y+3]=K.x;za[Y+4]=K.y;za[Y+5]=K.z;za[Y+6]=L.x;za[Y+7]=L.y;za[Y+8]=L.z;za[Y+9]=$.x;za[Y+10]=$.y;za[Y+11]=$.z;if(Qb.morphNormals){if(Bc){sb=Fc[Da].vertexNormals[Gb];cb=sb.a;db=sb.b;eb=sb.c;nc=sb.d}else nc=eb=db=cb=Fc[Da].faceNormals[Gb];Aa=$c[Da];Aa[Y]=cb.x;Aa[Y+1]=cb.y;Aa[Y+2]=cb.z;Aa[Y+3]=db.x;Aa[Y+4]=db.y;Aa[Y+5]=db.z;Aa[Y+6]=eb.x;Aa[Y+7]=eb.y;Aa[Y+8]=eb.z;Aa[Y+9]=nc.x;Aa[Y+10]=nc.y;Aa[Y+11]=nc.z}Y=Y+12}g.bindBuffer(g.ARRAY_BUFFER,
|
|
|
-Z.__webglMorphTargetsBuffers[Da]);g.bufferData(g.ARRAY_BUFFER,Zc[Da],Pa);if(Qb.morphNormals){g.bindBuffer(g.ARRAY_BUFFER,Z.__webglMorphNormalsBuffers[Da]);g.bufferData(g.ARRAY_BUFFER,$c[Da],Pa)}}}if(Hb.length){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];ib=Hb[D.a];jb=Hb[D.b];kb=Hb[D.c];ra[B]=ib.x;ra[B+1]=ib.y;ra[B+2]=ib.z;ra[B+3]=ib.w;ra[B+4]=jb.x;ra[B+5]=jb.y;ra[B+6]=jb.z;ra[B+7]=jb.w;ra[B+8]=kb.x;ra[B+9]=kb.y;ra[B+10]=kb.z;ra[B+11]=kb.w;lb=Ub[D.a];mb=Ub[D.b];nb=Ub[D.c];qa[B]=lb.x;qa[B+1]=lb.y;qa[B+
|
|
|
-2]=lb.z;qa[B+3]=lb.w;qa[B+4]=mb.x;qa[B+5]=mb.y;qa[B+6]=mb.z;qa[B+7]=mb.w;qa[B+8]=nb.x;qa[B+9]=nb.y;qa[B+10]=nb.z;qa[B+11]=nb.w;zb=Sb[D.a];Ab=Sb[D.b];Bb=Sb[D.c];oa[B]=zb.x;oa[B+1]=zb.y;oa[B+2]=zb.z;oa[B+3]=1;oa[B+4]=Ab.x;oa[B+5]=Ab.y;oa[B+6]=Ab.z;oa[B+7]=1;oa[B+8]=Bb.x;oa[B+9]=Bb.y;oa[B+10]=Bb.z;oa[B+11]=1;Cb=Tb[D.a];Db=Tb[D.b];Eb=Tb[D.c];pa[B]=Cb.x;pa[B+1]=Cb.y;pa[B+2]=Cb.z;pa[B+3]=1;pa[B+4]=Db.x;pa[B+5]=Db.y;pa[B+6]=Db.z;pa[B+7]=1;pa[B+8]=Eb.x;pa[B+9]=Eb.y;pa[B+10]=Eb.z;pa[B+11]=1;B=B+12}y=0;for(M=
|
|
|
-ca.length;y<M;y++){D=xa[ca[y]];ib=Hb[D.a];jb=Hb[D.b];kb=Hb[D.c];pc=Hb[D.d];ra[B]=ib.x;ra[B+1]=ib.y;ra[B+2]=ib.z;ra[B+3]=ib.w;ra[B+4]=jb.x;ra[B+5]=jb.y;ra[B+6]=jb.z;ra[B+7]=jb.w;ra[B+8]=kb.x;ra[B+9]=kb.y;ra[B+10]=kb.z;ra[B+11]=kb.w;ra[B+12]=pc.x;ra[B+13]=pc.y;ra[B+14]=pc.z;ra[B+15]=pc.w;lb=Ub[D.a];mb=Ub[D.b];nb=Ub[D.c];qc=Ub[D.d];qa[B]=lb.x;qa[B+1]=lb.y;qa[B+2]=lb.z;qa[B+3]=lb.w;qa[B+4]=mb.x;qa[B+5]=mb.y;qa[B+6]=mb.z;qa[B+7]=mb.w;qa[B+8]=nb.x;qa[B+9]=nb.y;qa[B+10]=nb.z;qa[B+11]=nb.w;qa[B+12]=qc.x;
|
|
|
-qa[B+13]=qc.y;qa[B+14]=qc.z;qa[B+15]=qc.w;zb=Sb[D.a];Ab=Sb[D.b];Bb=Sb[D.c];Dc=Sb[D.d];oa[B]=zb.x;oa[B+1]=zb.y;oa[B+2]=zb.z;oa[B+3]=1;oa[B+4]=Ab.x;oa[B+5]=Ab.y;oa[B+6]=Ab.z;oa[B+7]=1;oa[B+8]=Bb.x;oa[B+9]=Bb.y;oa[B+10]=Bb.z;oa[B+11]=1;oa[B+12]=Dc.x;oa[B+13]=Dc.y;oa[B+14]=Dc.z;oa[B+15]=1;Cb=Tb[D.a];Db=Tb[D.b];Eb=Tb[D.c];Ec=Tb[D.d];pa[B]=Cb.x;pa[B+1]=Cb.y;pa[B+2]=Cb.z;pa[B+3]=1;pa[B+4]=Db.x;pa[B+5]=Db.y;pa[B+6]=Db.z;pa[B+7]=1;pa[B+8]=Eb.x;pa[B+9]=Eb.y;pa[B+10]=Eb.z;pa[B+11]=1;pa[B+12]=Ec.x;pa[B+13]=Ec.y;
|
|
|
-pa[B+14]=Ec.z;pa[B+15]=1;B=B+16}if(B>0){g.bindBuffer(g.ARRAY_BUFFER,Z.__webglSkinVertexABuffer);g.bufferData(g.ARRAY_BUFFER,oa,Pa);g.bindBuffer(g.ARRAY_BUFFER,Z.__webglSkinVertexBBuffer);g.bufferData(g.ARRAY_BUFFER,pa,Pa);g.bindBuffer(g.ARRAY_BUFFER,Z.__webglSkinIndicesBuffer);g.bufferData(g.ARRAY_BUFFER,qa,Pa);g.bindBuffer(g.ARRAY_BUFFER,Z.__webglSkinWeightsBuffer);g.bufferData(g.ARRAY_BUFFER,ra,Pa)}}if(rd&&Yc){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];Ya=D.vertexColors;Cc=D.color;if(Ya.length===
|
|
|
-3&&Yc===THREE.VertexColors){fb=Ya[0];gb=Ya[1];hb=Ya[2]}else hb=gb=fb=Cc;Fa[wa]=fb.r;Fa[wa+1]=fb.g;Fa[wa+2]=fb.b;Fa[wa+3]=gb.r;Fa[wa+4]=gb.g;Fa[wa+5]=gb.b;Fa[wa+6]=hb.r;Fa[wa+7]=hb.g;Fa[wa+8]=hb.b;wa=wa+9}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];Ya=D.vertexColors;Cc=D.color;if(Ya.length===4&&Yc===THREE.VertexColors){fb=Ya[0];gb=Ya[1];hb=Ya[2];oc=Ya[3]}else oc=hb=gb=fb=Cc;Fa[wa]=fb.r;Fa[wa+1]=fb.g;Fa[wa+2]=fb.b;Fa[wa+3]=gb.r;Fa[wa+4]=gb.g;Fa[wa+5]=gb.b;Fa[wa+6]=hb.r;Fa[wa+7]=hb.g;Fa[wa+8]=hb.b;Fa[wa+
|
|
|
-9]=oc.r;Fa[wa+10]=oc.g;Fa[wa+11]=oc.b;wa=wa+12}if(wa>0){g.bindBuffer(g.ARRAY_BUFFER,Z.__webglColorBuffer);g.bufferData(g.ARRAY_BUFFER,Fa,Pa)}}if(qd&&La.hasTangents){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];rb=D.vertexTangents;$a=rb[0];ab=rb[1];bb=rb[2];na[ha]=$a.x;na[ha+1]=$a.y;na[ha+2]=$a.z;na[ha+3]=$a.w;na[ha+4]=ab.x;na[ha+5]=ab.y;na[ha+6]=ab.z;na[ha+7]=ab.w;na[ha+8]=bb.x;na[ha+9]=bb.y;na[ha+10]=bb.z;na[ha+11]=bb.w;ha=ha+12}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];rb=D.vertexTangents;$a=rb[0];ab=
|
|
|
-rb[1];bb=rb[2];mc=rb[3];na[ha]=$a.x;na[ha+1]=$a.y;na[ha+2]=$a.z;na[ha+3]=$a.w;na[ha+4]=ab.x;na[ha+5]=ab.y;na[ha+6]=ab.z;na[ha+7]=ab.w;na[ha+8]=bb.x;na[ha+9]=bb.y;na[ha+10]=bb.z;na[ha+11]=bb.w;na[ha+12]=mc.x;na[ha+13]=mc.y;na[ha+14]=mc.z;na[ha+15]=mc.w;ha=ha+16}g.bindBuffer(g.ARRAY_BUFFER,Z.__webglTangentBuffer);g.bufferData(g.ARRAY_BUFFER,na,Pa)}if(Qc&&fd){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];ac=D.vertexNormals;yb=D.normal;if(ac.length===3&&Bc)for(fa=0;fa<3;fa++){Fb=ac[fa];Ta[Ha]=Fb.x;Ta[Ha+1]=
|
|
|
-Fb.y;Ta[Ha+2]=Fb.z;Ha=Ha+3}else for(fa=0;fa<3;fa++){Ta[Ha]=yb.x;Ta[Ha+1]=yb.y;Ta[Ha+2]=yb.z;Ha=Ha+3}}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];ac=D.vertexNormals;yb=D.normal;if(ac.length===4&&Bc)for(fa=0;fa<4;fa++){Fb=ac[fa];Ta[Ha]=Fb.x;Ta[Ha+1]=Fb.y;Ta[Ha+2]=Fb.z;Ha=Ha+3}else for(fa=0;fa<4;fa++){Ta[Ha]=yb.x;Ta[Ha+1]=yb.y;Ta[Ha+2]=yb.z;Ha=Ha+3}}g.bindBuffer(g.ARRAY_BUFFER,Z.__webglNormalBuffer);g.bufferData(g.ARRAY_BUFFER,Ta,Pa)}if(jd&&bd&&gd){y=0;for(M=ba.length;y<M;y++){Ua=ba[y];D=xa[Ua];bc=bd[Ua];
|
|
|
-if(bc!==void 0)for(fa=0;fa<3;fa++){dc=bc[fa];rc[tb]=dc.u;rc[tb+1]=dc.v;tb=tb+2}}y=0;for(M=ca.length;y<M;y++){Ua=ca[y];D=xa[Ua];bc=bd[Ua];if(bc!==void 0)for(fa=0;fa<4;fa++){dc=bc[fa];rc[tb]=dc.u;rc[tb+1]=dc.v;tb=tb+2}}if(tb>0){g.bindBuffer(g.ARRAY_BUFFER,Z.__webglUVBuffer);g.bufferData(g.ARRAY_BUFFER,rc,Pa)}}if(jd&&cd&&gd){y=0;for(M=ba.length;y<M;y++){Ua=ba[y];D=xa[Ua];cc=cd[Ua];if(cc!==void 0)for(fa=0;fa<3;fa++){ec=cc[fa];sc[ub]=ec.u;sc[ub+1]=ec.v;ub=ub+2}}y=0;for(M=ca.length;y<M;y++){Ua=ca[y];D=
|
|
|
-xa[Ua];cc=cd[Ua];if(cc!==void 0)for(fa=0;fa<4;fa++){ec=cc[fa];sc[ub]=ec.u;sc[ub+1]=ec.v;ub=ub+2}}if(ub>0){g.bindBuffer(g.ARRAY_BUFFER,Z.__webglUV2Buffer);g.bufferData(g.ARRAY_BUFFER,sc,Pa)}}if(Pc){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];ob[Sa]=va;ob[Sa+1]=va+1;ob[Sa+2]=va+2;Sa=Sa+3;Qa[Ka]=va;Qa[Ka+1]=va+1;Qa[Ka+2]=va;Qa[Ka+3]=va+2;Qa[Ka+4]=va+1;Qa[Ka+5]=va+2;Ka=Ka+6;va=va+3}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];ob[Sa]=va;ob[Sa+1]=va+1;ob[Sa+2]=va+3;ob[Sa+3]=va+1;ob[Sa+4]=va+2;ob[Sa+5]=va+3;Sa=
|
|
|
-Sa+6;Qa[Ka]=va;Qa[Ka+1]=va+1;Qa[Ka+2]=va;Qa[Ka+3]=va+3;Qa[Ka+4]=va+1;Qa[Ka+5]=va+2;Qa[Ka+6]=va+2;Qa[Ka+7]=va+3;Ka=Ka+8;va=va+4}g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,Z.__webglFaceBuffer);g.bufferData(g.ELEMENT_ARRAY_BUFFER,ob,Pa);g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,Z.__webglLineBuffer);g.bufferData(g.ELEMENT_ARRAY_BUFFER,Qa,Pa)}if(ad){fa=0;for(hd=ad.length;fa<hd;fa++){s=ad[fa];if(s.__original.needsUpdate){t=0;if(s.size===1)if(s.boundTo===void 0||s.boundTo==="vertices"){y=0;for(M=ba.length;y<M;y++){D=
|
|
|
+g.createBuffer();var N=void 0,Q=void 0;if(G.numMorphTargets){G.__webglMorphTargetsBuffers=[];N=0;for(Q=G.numMorphTargets;N<Q;N++)G.__webglMorphTargetsBuffers.push(g.createBuffer())}if(G.numMorphNormals){G.__webglMorphNormalsBuffers=[];N=0;for(Q=G.numMorphNormals;N<Q;N++)G.__webglMorphNormalsBuffers.push(g.createBuffer())}F.info.memory.geometries++;var I=l,S=h,T=S.geometry,U=I.faces3,V=I.faces4,W=U.length*3+V.length*4,da=U.length*1+V.length*2,ea=U.length*3+V.length*4,aa=c(S,I),ia=e(aa),la=d(aa),ua=
|
|
|
+aa.vertexColors?aa.vertexColors:false;I.__vertexArray=new Float32Array(W*3);if(la)I.__normalArray=new Float32Array(W*3);if(T.hasTangents)I.__tangentArray=new Float32Array(W*4);if(ua)I.__colorArray=new Float32Array(W*3);if(ia){if(T.faceUvs.length>0||T.faceVertexUvs.length>0)I.__uvArray=new Float32Array(W*2);if(T.faceUvs.length>1||T.faceVertexUvs.length>1)I.__uv2Array=new Float32Array(W*2)}if(S.geometry.skinWeights.length&&S.geometry.skinIndices.length){I.__skinVertexAArray=new Float32Array(W*4);I.__skinVertexBArray=
|
|
|
+new Float32Array(W*4);I.__skinIndexArray=new Float32Array(W*4);I.__skinWeightArray=new Float32Array(W*4)}I.__faceArray=new Uint16Array(da*3);I.__lineArray=new Uint16Array(ea*2);var ja=void 0,Lb=void 0;if(I.numMorphTargets){I.__morphTargetsArrays=[];ja=0;for(Lb=I.numMorphTargets;ja<Lb;ja++)I.__morphTargetsArrays.push(new Float32Array(W*3))}if(I.numMorphNormals){I.__morphNormalsArrays=[];ja=0;for(Lb=I.numMorphNormals;ja<Lb;ja++)I.__morphNormalsArrays.push(new Float32Array(W*3))}I.__webglFaceCount=da*
|
|
|
+3;I.__webglLineCount=ea*2;if(aa.attributes){if(I.__webglCustomAttributesList===void 0)I.__webglCustomAttributesList=[];var Ca=void 0;for(Ca in aa.attributes){var Ba=aa.attributes[Ca],ma={},Ja;for(Ja in Ba)ma[Ja]=Ba[Ja];if(!ma.__webglInitialized||ma.createUniqueBuffers){ma.__webglInitialized=true;var Ha=1;ma.type==="v2"?Ha=2:ma.type==="v3"?Ha=3:ma.type==="v4"?Ha=4:ma.type==="c"&&(Ha=3);ma.size=Ha;ma.array=new Float32Array(W*Ha);ma.buffer=g.createBuffer();ma.buffer.belongsToAttribute=Ca;Ba.needsUpdate=
|
|
|
+true;ma.__original=Ba}I.__webglCustomAttributesList.push(ma)}}I.__inittedArrays=true;k.verticesNeedUpdate=true;k.morphTargetsNeedUpdate=true;k.elementsNeedUpdate=true;k.uvsNeedUpdate=true;k.normalsNeedUpdate=true;k.tangentsNeedUpdate=true;k.colorsNeedUpdate=true}}}else if(k instanceof THREE.BufferGeometry){var Pa=k,xb=void 0,Ma=void 0,Qa=void 0;for(xb in Pa.attributes){Qa=xb==="index"?g.ELEMENT_ARRAY_BUFFER:g.ARRAY_BUFFER;Ma=Pa.attributes[xb];Ma.buffer=g.createBuffer();g.bindBuffer(Qa,Ma.buffer);
|
|
|
+g.bufferData(Qa,Ma.array,g.STATIC_DRAW)}}}else if(h instanceof THREE.Ribbon){k=h.geometry;if(!k.__webglVertexBuffer){var Ub=k;Ub.__webglVertexBuffer=g.createBuffer();Ub.__webglColorBuffer=g.createBuffer();F.info.memory.geometries++;var Xa=k,$a=Xa.vertices.length;Xa.__vertexArray=new Float32Array($a*3);Xa.__colorArray=new Float32Array($a*3);Xa.__webglVertexCount=$a;k.verticesNeedUpdate=true;k.colorsNeedUpdate=true}}else if(h instanceof THREE.Line){k=h.geometry;if(!k.__webglVertexBuffer){var qb=k;qb.__webglVertexBuffer=
|
|
|
+g.createBuffer();qb.__webglColorBuffer=g.createBuffer();F.info.memory.geometries++;var kc=k,Wb=h,Mb=kc.vertices.length;kc.__vertexArray=new Float32Array(Mb*3);kc.__colorArray=new Float32Array(Mb*3);kc.__webglLineCount=Mb;b(kc,Wb);k.verticesNeedUpdate=true;k.colorsNeedUpdate=true}}else if(h instanceof THREE.ParticleSystem){k=h.geometry;if(!k.__webglVertexBuffer){var Vb=k;Vb.__webglVertexBuffer=g.createBuffer();Vb.__webglColorBuffer=g.createBuffer();F.info.geometries++;var Xb=k,hc=h,Nb=Xb.vertices.length;
|
|
|
+Xb.__vertexArray=new Float32Array(Nb*3);Xb.__colorArray=new Float32Array(Nb*3);Xb.__sortArray=[];Xb.__webglParticleCount=Nb;b(Xb,hc);k.verticesNeedUpdate=true;k.colorsNeedUpdate=true}}}if(!h.__webglActive){if(h instanceof THREE.Mesh){k=h.geometry;if(k instanceof THREE.BufferGeometry)m(i.__webglObjects,k,h);else for(j in k.geometryGroups){l=k.geometryGroups[j];m(i.__webglObjects,l,h)}}else if(h instanceof THREE.Ribbon||h instanceof THREE.Line||h instanceof THREE.ParticleSystem){k=h.geometry;m(i.__webglObjects,
|
|
|
+k,h)}else h instanceof THREE.ImmediateRenderObject||h.immediateRenderCallback?i.__webglObjectsImmediate.push({object:h,opaque:null,transparent:null}):h instanceof THREE.Sprite?i.__webglSprites.push(h):h instanceof THREE.LensFlare&&i.__webglFlares.push(h);h.__webglActive=true}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;){var Ta=a.__objectsRemoved[0],Ac=a;Ta instanceof THREE.Mesh||Ta instanceof THREE.ParticleSystem||Ta instanceof THREE.Ribbon||Ta instanceof THREE.Line?u(Ac.__webglObjects,
|
|
|
+Ta):Ta instanceof THREE.Sprite?q(Ac.__webglSprites,Ta):Ta instanceof THREE.LensFlare?q(Ac.__webglFlares,Ta):(Ta instanceof THREE.ImmediateRenderObject||Ta.immediateRenderCallback)&&u(Ac.__webglObjectsImmediate,Ta);Ta.__webglActive=false;a.__objectsRemoved.splice(0,1)}for(var Ob=0,ic=a.__webglObjects.length;Ob<ic;Ob++){var Ya=a.__webglObjects[Ob].object,X=Ya.geometry,lc=void 0,Yb=void 0,Na=void 0;if(Ya instanceof THREE.Mesh)if(X instanceof THREE.BufferGeometry){if(X.verticesNeedUpdate||X.elementsNeedUpdate||
|
|
|
+X.uvsNeedUpdate||X.normalsNeedUpdate||X.colorsNeedUpdate||X.tangentsNeedUpdate){var rb=X,Zb=g.DYNAMIC_DRAW,jc=!X.dynamic,$b=rb.attributes,Rc=$b.index,Sc=$b.position,Tc=$b.normal,Uc=$b.uv,Vc=$b.color,Wc=$b.tangent;if(rb.elementsNeedUpdate&&Rc!==void 0){g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,Rc.buffer);g.bufferData(g.ELEMENT_ARRAY_BUFFER,Rc.array,Zb)}if(rb.verticesNeedUpdate&&Sc!==void 0){g.bindBuffer(g.ARRAY_BUFFER,Sc.buffer);g.bufferData(g.ARRAY_BUFFER,Sc.array,Zb)}if(rb.normalsNeedUpdate&&Tc!==void 0){g.bindBuffer(g.ARRAY_BUFFER,
|
|
|
+Tc.buffer);g.bufferData(g.ARRAY_BUFFER,Tc.array,Zb)}if(rb.uvsNeedUpdate&&Uc!==void 0){g.bindBuffer(g.ARRAY_BUFFER,Uc.buffer);g.bufferData(g.ARRAY_BUFFER,Uc.array,Zb)}if(rb.colorsNeedUpdate&&Vc!==void 0){g.bindBuffer(g.ARRAY_BUFFER,Vc.buffer);g.bufferData(g.ARRAY_BUFFER,Vc.array,Zb)}if(rb.tangentsNeedUpdate&&Wc!==void 0){g.bindBuffer(g.ARRAY_BUFFER,Wc.buffer);g.bufferData(g.ARRAY_BUFFER,Wc.array,Zb)}if(jc){var gc=void 0;for(gc in rb.attributes)delete rb.attributes[gc].array}}X.verticesNeedUpdate=false;
|
|
|
+X.elementsNeedUpdate=false;X.uvsNeedUpdate=false;X.normalsNeedUpdate=false;X.colorsNeedUpdate=false;X.tangentsNeedUpdate=false}else{for(var Xc=0,xc=X.geometryGroupsList.length;Xc<xc;Xc++){lc=X.geometryGroupsList[Xc];Na=c(Ya,lc);Yb=Na.attributes&&n(Na);if(X.verticesNeedUpdate||X.morphTargetsNeedUpdate||X.elementsNeedUpdate||X.uvsNeedUpdate||X.normalsNeedUpdate||X.colorsNeedUpdate||X.tangentsNeedUpdate||Yb){var Z=lc,yc=Ya,Ra=g.DYNAMIC_DRAW,zc=!X.dynamic,Pb=Na;if(Z.__inittedArrays){var fd=d(Pb),Yc=Pb.vertexColors?
|
|
|
+Pb.vertexColors:false,gd=e(Pb),Bc=fd===THREE.SmoothShading,y=void 0,M=void 0,Wa=void 0,D=void 0,ac=void 0,yb=void 0,Za=void 0,Cc=void 0,sb=void 0,bc=void 0,cc=void 0,J=void 0,K=void 0,L=void 0,$=void 0,ab=void 0,bb=void 0,cb=void 0,mc=void 0,db=void 0,eb=void 0,fb=void 0,nc=void 0,gb=void 0,hb=void 0,ib=void 0,oc=void 0,jb=void 0,kb=void 0,lb=void 0,pc=void 0,mb=void 0,nb=void 0,ob=void 0,qc=void 0,zb=void 0,Ab=void 0,Bb=void 0,Dc=void 0,Cb=void 0,Db=void 0,Eb=void 0,Ec=void 0,fa=void 0,hd=void 0,
|
|
|
+Fb=void 0,dc=void 0,ec=void 0,Da=void 0,id=void 0,za=void 0,Aa=void 0,Gb=void 0,tb=void 0,va=0,ya=0,ub=0,vb=0,Ua=0,Ia=0,ha=0,Ka=0,wa=0,B=0,Y=0,t=0,ga=void 0,Ea=Z.__vertexArray,rc=Z.__uvArray,sc=Z.__uv2Array,Va=Z.__normalArray,na=Z.__tangentArray,Fa=Z.__colorArray,oa=Z.__skinVertexAArray,pa=Z.__skinVertexBArray,qa=Z.__skinIndexArray,ra=Z.__skinWeightArray,Zc=Z.__morphTargetsArrays,$c=Z.__morphNormalsArrays,ad=Z.__webglCustomAttributesList,s=void 0,pb=Z.__faceArray,Sa=Z.__lineArray,La=yc.geometry,Pc=
|
|
|
+La.elementsNeedUpdate,jd=La.uvsNeedUpdate,Qc=La.normalsNeedUpdate,qd=La.tangentsNeedUpdate,rd=La.colorsNeedUpdate,sd=La.morphTargetsNeedUpdate,Qb=La.vertices,ba=Z.faces3,ca=Z.faces4,xa=La.faces,bd=La.faceVertexUvs[0],cd=La.faceVertexUvs[1],Rb=La.skinVerticesA,Sb=La.skinVerticesB,Tb=La.skinIndices,Hb=La.skinWeights,Ib=La.morphTargets,Fc=La.morphNormals;if(La.verticesNeedUpdate){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];J=Qb[D.a];K=Qb[D.b];L=Qb[D.c];Ea[ya]=J.x;Ea[ya+1]=J.y;Ea[ya+2]=J.z;Ea[ya+3]=K.x;
|
|
|
+Ea[ya+4]=K.y;Ea[ya+5]=K.z;Ea[ya+6]=L.x;Ea[ya+7]=L.y;Ea[ya+8]=L.z;ya=ya+9}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];J=Qb[D.a];K=Qb[D.b];L=Qb[D.c];$=Qb[D.d];Ea[ya]=J.x;Ea[ya+1]=J.y;Ea[ya+2]=J.z;Ea[ya+3]=K.x;Ea[ya+4]=K.y;Ea[ya+5]=K.z;Ea[ya+6]=L.x;Ea[ya+7]=L.y;Ea[ya+8]=L.z;Ea[ya+9]=$.x;Ea[ya+10]=$.y;Ea[ya+11]=$.z;ya=ya+12}g.bindBuffer(g.ARRAY_BUFFER,Z.__webglVertexBuffer);g.bufferData(g.ARRAY_BUFFER,Ea,Ra)}if(sd){Da=0;for(id=Ib.length;Da<id;Da++){y=Y=0;for(M=ba.length;y<M;y++){Gb=ba[y];D=xa[Gb];J=Ib[Da].vertices[D.a];
|
|
|
+K=Ib[Da].vertices[D.b];L=Ib[Da].vertices[D.c];za=Zc[Da];za[Y]=J.x;za[Y+1]=J.y;za[Y+2]=J.z;za[Y+3]=K.x;za[Y+4]=K.y;za[Y+5]=K.z;za[Y+6]=L.x;za[Y+7]=L.y;za[Y+8]=L.z;if(Pb.morphNormals){if(Bc){tb=Fc[Da].vertexNormals[Gb];db=tb.a;eb=tb.b;fb=tb.c}else fb=eb=db=Fc[Da].faceNormals[Gb];Aa=$c[Da];Aa[Y]=db.x;Aa[Y+1]=db.y;Aa[Y+2]=db.z;Aa[Y+3]=eb.x;Aa[Y+4]=eb.y;Aa[Y+5]=eb.z;Aa[Y+6]=fb.x;Aa[Y+7]=fb.y;Aa[Y+8]=fb.z}Y=Y+9}y=0;for(M=ca.length;y<M;y++){Gb=ca[y];D=xa[Gb];J=Ib[Da].vertices[D.a];K=Ib[Da].vertices[D.b];
|
|
|
+L=Ib[Da].vertices[D.c];$=Ib[Da].vertices[D.d];za=Zc[Da];za[Y]=J.x;za[Y+1]=J.y;za[Y+2]=J.z;za[Y+3]=K.x;za[Y+4]=K.y;za[Y+5]=K.z;za[Y+6]=L.x;za[Y+7]=L.y;za[Y+8]=L.z;za[Y+9]=$.x;za[Y+10]=$.y;za[Y+11]=$.z;if(Pb.morphNormals){if(Bc){tb=Fc[Da].vertexNormals[Gb];db=tb.a;eb=tb.b;fb=tb.c;nc=tb.d}else nc=fb=eb=db=Fc[Da].faceNormals[Gb];Aa=$c[Da];Aa[Y]=db.x;Aa[Y+1]=db.y;Aa[Y+2]=db.z;Aa[Y+3]=eb.x;Aa[Y+4]=eb.y;Aa[Y+5]=eb.z;Aa[Y+6]=fb.x;Aa[Y+7]=fb.y;Aa[Y+8]=fb.z;Aa[Y+9]=nc.x;Aa[Y+10]=nc.y;Aa[Y+11]=nc.z}Y=Y+12}g.bindBuffer(g.ARRAY_BUFFER,
|
|
|
+Z.__webglMorphTargetsBuffers[Da]);g.bufferData(g.ARRAY_BUFFER,Zc[Da],Ra);if(Pb.morphNormals){g.bindBuffer(g.ARRAY_BUFFER,Z.__webglMorphNormalsBuffers[Da]);g.bufferData(g.ARRAY_BUFFER,$c[Da],Ra)}}}if(Hb.length){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];jb=Hb[D.a];kb=Hb[D.b];lb=Hb[D.c];ra[B]=jb.x;ra[B+1]=jb.y;ra[B+2]=jb.z;ra[B+3]=jb.w;ra[B+4]=kb.x;ra[B+5]=kb.y;ra[B+6]=kb.z;ra[B+7]=kb.w;ra[B+8]=lb.x;ra[B+9]=lb.y;ra[B+10]=lb.z;ra[B+11]=lb.w;mb=Tb[D.a];nb=Tb[D.b];ob=Tb[D.c];qa[B]=mb.x;qa[B+1]=mb.y;qa[B+
|
|
|
+2]=mb.z;qa[B+3]=mb.w;qa[B+4]=nb.x;qa[B+5]=nb.y;qa[B+6]=nb.z;qa[B+7]=nb.w;qa[B+8]=ob.x;qa[B+9]=ob.y;qa[B+10]=ob.z;qa[B+11]=ob.w;zb=Rb[D.a];Ab=Rb[D.b];Bb=Rb[D.c];oa[B]=zb.x;oa[B+1]=zb.y;oa[B+2]=zb.z;oa[B+3]=1;oa[B+4]=Ab.x;oa[B+5]=Ab.y;oa[B+6]=Ab.z;oa[B+7]=1;oa[B+8]=Bb.x;oa[B+9]=Bb.y;oa[B+10]=Bb.z;oa[B+11]=1;Cb=Sb[D.a];Db=Sb[D.b];Eb=Sb[D.c];pa[B]=Cb.x;pa[B+1]=Cb.y;pa[B+2]=Cb.z;pa[B+3]=1;pa[B+4]=Db.x;pa[B+5]=Db.y;pa[B+6]=Db.z;pa[B+7]=1;pa[B+8]=Eb.x;pa[B+9]=Eb.y;pa[B+10]=Eb.z;pa[B+11]=1;B=B+12}y=0;for(M=
|
|
|
+ca.length;y<M;y++){D=xa[ca[y]];jb=Hb[D.a];kb=Hb[D.b];lb=Hb[D.c];pc=Hb[D.d];ra[B]=jb.x;ra[B+1]=jb.y;ra[B+2]=jb.z;ra[B+3]=jb.w;ra[B+4]=kb.x;ra[B+5]=kb.y;ra[B+6]=kb.z;ra[B+7]=kb.w;ra[B+8]=lb.x;ra[B+9]=lb.y;ra[B+10]=lb.z;ra[B+11]=lb.w;ra[B+12]=pc.x;ra[B+13]=pc.y;ra[B+14]=pc.z;ra[B+15]=pc.w;mb=Tb[D.a];nb=Tb[D.b];ob=Tb[D.c];qc=Tb[D.d];qa[B]=mb.x;qa[B+1]=mb.y;qa[B+2]=mb.z;qa[B+3]=mb.w;qa[B+4]=nb.x;qa[B+5]=nb.y;qa[B+6]=nb.z;qa[B+7]=nb.w;qa[B+8]=ob.x;qa[B+9]=ob.y;qa[B+10]=ob.z;qa[B+11]=ob.w;qa[B+12]=qc.x;
|
|
|
+qa[B+13]=qc.y;qa[B+14]=qc.z;qa[B+15]=qc.w;zb=Rb[D.a];Ab=Rb[D.b];Bb=Rb[D.c];Dc=Rb[D.d];oa[B]=zb.x;oa[B+1]=zb.y;oa[B+2]=zb.z;oa[B+3]=1;oa[B+4]=Ab.x;oa[B+5]=Ab.y;oa[B+6]=Ab.z;oa[B+7]=1;oa[B+8]=Bb.x;oa[B+9]=Bb.y;oa[B+10]=Bb.z;oa[B+11]=1;oa[B+12]=Dc.x;oa[B+13]=Dc.y;oa[B+14]=Dc.z;oa[B+15]=1;Cb=Sb[D.a];Db=Sb[D.b];Eb=Sb[D.c];Ec=Sb[D.d];pa[B]=Cb.x;pa[B+1]=Cb.y;pa[B+2]=Cb.z;pa[B+3]=1;pa[B+4]=Db.x;pa[B+5]=Db.y;pa[B+6]=Db.z;pa[B+7]=1;pa[B+8]=Eb.x;pa[B+9]=Eb.y;pa[B+10]=Eb.z;pa[B+11]=1;pa[B+12]=Ec.x;pa[B+13]=Ec.y;
|
|
|
+pa[B+14]=Ec.z;pa[B+15]=1;B=B+16}if(B>0){g.bindBuffer(g.ARRAY_BUFFER,Z.__webglSkinVertexABuffer);g.bufferData(g.ARRAY_BUFFER,oa,Ra);g.bindBuffer(g.ARRAY_BUFFER,Z.__webglSkinVertexBBuffer);g.bufferData(g.ARRAY_BUFFER,pa,Ra);g.bindBuffer(g.ARRAY_BUFFER,Z.__webglSkinIndicesBuffer);g.bufferData(g.ARRAY_BUFFER,qa,Ra);g.bindBuffer(g.ARRAY_BUFFER,Z.__webglSkinWeightsBuffer);g.bufferData(g.ARRAY_BUFFER,ra,Ra)}}if(rd&&Yc){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];Za=D.vertexColors;Cc=D.color;if(Za.length===
|
|
|
+3&&Yc===THREE.VertexColors){gb=Za[0];hb=Za[1];ib=Za[2]}else ib=hb=gb=Cc;Fa[wa]=gb.r;Fa[wa+1]=gb.g;Fa[wa+2]=gb.b;Fa[wa+3]=hb.r;Fa[wa+4]=hb.g;Fa[wa+5]=hb.b;Fa[wa+6]=ib.r;Fa[wa+7]=ib.g;Fa[wa+8]=ib.b;wa=wa+9}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];Za=D.vertexColors;Cc=D.color;if(Za.length===4&&Yc===THREE.VertexColors){gb=Za[0];hb=Za[1];ib=Za[2];oc=Za[3]}else oc=ib=hb=gb=Cc;Fa[wa]=gb.r;Fa[wa+1]=gb.g;Fa[wa+2]=gb.b;Fa[wa+3]=hb.r;Fa[wa+4]=hb.g;Fa[wa+5]=hb.b;Fa[wa+6]=ib.r;Fa[wa+7]=ib.g;Fa[wa+8]=ib.b;Fa[wa+
|
|
|
+9]=oc.r;Fa[wa+10]=oc.g;Fa[wa+11]=oc.b;wa=wa+12}if(wa>0){g.bindBuffer(g.ARRAY_BUFFER,Z.__webglColorBuffer);g.bufferData(g.ARRAY_BUFFER,Fa,Ra)}}if(qd&&La.hasTangents){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];sb=D.vertexTangents;ab=sb[0];bb=sb[1];cb=sb[2];na[ha]=ab.x;na[ha+1]=ab.y;na[ha+2]=ab.z;na[ha+3]=ab.w;na[ha+4]=bb.x;na[ha+5]=bb.y;na[ha+6]=bb.z;na[ha+7]=bb.w;na[ha+8]=cb.x;na[ha+9]=cb.y;na[ha+10]=cb.z;na[ha+11]=cb.w;ha=ha+12}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];sb=D.vertexTangents;ab=sb[0];bb=
|
|
|
+sb[1];cb=sb[2];mc=sb[3];na[ha]=ab.x;na[ha+1]=ab.y;na[ha+2]=ab.z;na[ha+3]=ab.w;na[ha+4]=bb.x;na[ha+5]=bb.y;na[ha+6]=bb.z;na[ha+7]=bb.w;na[ha+8]=cb.x;na[ha+9]=cb.y;na[ha+10]=cb.z;na[ha+11]=cb.w;na[ha+12]=mc.x;na[ha+13]=mc.y;na[ha+14]=mc.z;na[ha+15]=mc.w;ha=ha+16}g.bindBuffer(g.ARRAY_BUFFER,Z.__webglTangentBuffer);g.bufferData(g.ARRAY_BUFFER,na,Ra)}if(Qc&&fd){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];ac=D.vertexNormals;yb=D.normal;if(ac.length===3&&Bc)for(fa=0;fa<3;fa++){Fb=ac[fa];Va[Ia]=Fb.x;Va[Ia+1]=
|
|
|
+Fb.y;Va[Ia+2]=Fb.z;Ia=Ia+3}else for(fa=0;fa<3;fa++){Va[Ia]=yb.x;Va[Ia+1]=yb.y;Va[Ia+2]=yb.z;Ia=Ia+3}}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];ac=D.vertexNormals;yb=D.normal;if(ac.length===4&&Bc)for(fa=0;fa<4;fa++){Fb=ac[fa];Va[Ia]=Fb.x;Va[Ia+1]=Fb.y;Va[Ia+2]=Fb.z;Ia=Ia+3}else for(fa=0;fa<4;fa++){Va[Ia]=yb.x;Va[Ia+1]=yb.y;Va[Ia+2]=yb.z;Ia=Ia+3}}g.bindBuffer(g.ARRAY_BUFFER,Z.__webglNormalBuffer);g.bufferData(g.ARRAY_BUFFER,Va,Ra)}if(jd&&bd&&gd){y=0;for(M=ba.length;y<M;y++){Wa=ba[y];D=xa[Wa];bc=bd[Wa];
|
|
|
+if(bc!==void 0)for(fa=0;fa<3;fa++){dc=bc[fa];rc[ub]=dc.u;rc[ub+1]=dc.v;ub=ub+2}}y=0;for(M=ca.length;y<M;y++){Wa=ca[y];D=xa[Wa];bc=bd[Wa];if(bc!==void 0)for(fa=0;fa<4;fa++){dc=bc[fa];rc[ub]=dc.u;rc[ub+1]=dc.v;ub=ub+2}}if(ub>0){g.bindBuffer(g.ARRAY_BUFFER,Z.__webglUVBuffer);g.bufferData(g.ARRAY_BUFFER,rc,Ra)}}if(jd&&cd&&gd){y=0;for(M=ba.length;y<M;y++){Wa=ba[y];D=xa[Wa];cc=cd[Wa];if(cc!==void 0)for(fa=0;fa<3;fa++){ec=cc[fa];sc[vb]=ec.u;sc[vb+1]=ec.v;vb=vb+2}}y=0;for(M=ca.length;y<M;y++){Wa=ca[y];D=
|
|
|
+xa[Wa];cc=cd[Wa];if(cc!==void 0)for(fa=0;fa<4;fa++){ec=cc[fa];sc[vb]=ec.u;sc[vb+1]=ec.v;vb=vb+2}}if(vb>0){g.bindBuffer(g.ARRAY_BUFFER,Z.__webglUV2Buffer);g.bufferData(g.ARRAY_BUFFER,sc,Ra)}}if(Pc){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];pb[Ua]=va;pb[Ua+1]=va+1;pb[Ua+2]=va+2;Ua=Ua+3;Sa[Ka]=va;Sa[Ka+1]=va+1;Sa[Ka+2]=va;Sa[Ka+3]=va+2;Sa[Ka+4]=va+1;Sa[Ka+5]=va+2;Ka=Ka+6;va=va+3}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];pb[Ua]=va;pb[Ua+1]=va+1;pb[Ua+2]=va+3;pb[Ua+3]=va+1;pb[Ua+4]=va+2;pb[Ua+5]=va+3;Ua=
|
|
|
+Ua+6;Sa[Ka]=va;Sa[Ka+1]=va+1;Sa[Ka+2]=va;Sa[Ka+3]=va+3;Sa[Ka+4]=va+1;Sa[Ka+5]=va+2;Sa[Ka+6]=va+2;Sa[Ka+7]=va+3;Ka=Ka+8;va=va+4}g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,Z.__webglFaceBuffer);g.bufferData(g.ELEMENT_ARRAY_BUFFER,pb,Ra);g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,Z.__webglLineBuffer);g.bufferData(g.ELEMENT_ARRAY_BUFFER,Sa,Ra)}if(ad){fa=0;for(hd=ad.length;fa<hd;fa++){s=ad[fa];if(s.__original.needsUpdate){t=0;if(s.size===1)if(s.boundTo===void 0||s.boundTo==="vertices"){y=0;for(M=ba.length;y<M;y++){D=
|
|
|
xa[ba[y]];s.array[t]=s.value[D.a];s.array[t+1]=s.value[D.b];s.array[t+2]=s.value[D.c];t=t+3}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];s.array[t]=s.value[D.a];s.array[t+1]=s.value[D.b];s.array[t+2]=s.value[D.c];s.array[t+3]=s.value[D.d];t=t+4}}else{if(s.boundTo==="faces"){y=0;for(M=ba.length;y<M;y++){ga=s.value[ba[y]];s.array[t]=ga;s.array[t+1]=ga;s.array[t+2]=ga;t=t+3}y=0;for(M=ca.length;y<M;y++){ga=s.value[ca[y]];s.array[t]=ga;s.array[t+1]=ga;s.array[t+2]=ga;s.array[t+3]=ga;t=t+4}}}else if(s.size===
|
|
|
2)if(s.boundTo===void 0||s.boundTo==="vertices"){y=0;for(M=ba.length;y<M;y++){D=xa[ba[y]];J=s.value[D.a];K=s.value[D.b];L=s.value[D.c];s.array[t]=J.x;s.array[t+1]=J.y;s.array[t+2]=K.x;s.array[t+3]=K.y;s.array[t+4]=L.x;s.array[t+5]=L.y;t=t+6}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];J=s.value[D.a];K=s.value[D.b];L=s.value[D.c];$=s.value[D.d];s.array[t]=J.x;s.array[t+1]=J.y;s.array[t+2]=K.x;s.array[t+3]=K.y;s.array[t+4]=L.x;s.array[t+5]=L.y;s.array[t+6]=$.x;s.array[t+7]=$.y;t=t+8}}else{if(s.boundTo===
|
|
|
"faces"){y=0;for(M=ba.length;y<M;y++){L=K=J=ga=s.value[ba[y]];s.array[t]=J.x;s.array[t+1]=J.y;s.array[t+2]=K.x;s.array[t+3]=K.y;s.array[t+4]=L.x;s.array[t+5]=L.y;t=t+6}y=0;for(M=ca.length;y<M;y++){$=L=K=J=ga=s.value[ca[y]];s.array[t]=J.x;s.array[t+1]=J.y;s.array[t+2]=K.x;s.array[t+3]=K.y;s.array[t+4]=L.x;s.array[t+5]=L.y;s.array[t+6]=$.x;s.array[t+7]=$.y;t=t+8}}}else if(s.size===3){var R;R=s.type==="c"?["r","g","b"]:["x","y","z"];if(s.boundTo===void 0||s.boundTo==="vertices"){y=0;for(M=ba.length;y<
|
|
@@ -381,15 +381,15 @@ s.array[t+3]=K[R[0]];s.array[t+4]=K[R[1]];s.array[t+5]=K[R[2]];s.array[t+6]=L[R[
|
|
|
J.x;s.array[t+1]=J.y;s.array[t+2]=J.z;s.array[t+3]=J.w;s.array[t+4]=K.x;s.array[t+5]=K.y;s.array[t+6]=K.z;s.array[t+7]=K.w;s.array[t+8]=L.x;s.array[t+9]=L.y;s.array[t+10]=L.z;s.array[t+11]=L.w;t=t+12}y=0;for(M=ca.length;y<M;y++){D=xa[ca[y]];J=s.value[D.a];K=s.value[D.b];L=s.value[D.c];$=s.value[D.d];s.array[t]=J.x;s.array[t+1]=J.y;s.array[t+2]=J.z;s.array[t+3]=J.w;s.array[t+4]=K.x;s.array[t+5]=K.y;s.array[t+6]=K.z;s.array[t+7]=K.w;s.array[t+8]=L.x;s.array[t+9]=L.y;s.array[t+10]=L.z;s.array[t+11]=
|
|
|
L.w;s.array[t+12]=$.x;s.array[t+13]=$.y;s.array[t+14]=$.z;s.array[t+15]=$.w;t=t+16}}else if(s.boundTo==="faces"){y=0;for(M=ba.length;y<M;y++){L=K=J=ga=s.value[ba[y]];s.array[t]=J.x;s.array[t+1]=J.y;s.array[t+2]=J.z;s.array[t+3]=J.w;s.array[t+4]=K.x;s.array[t+5]=K.y;s.array[t+6]=K.z;s.array[t+7]=K.w;s.array[t+8]=L.x;s.array[t+9]=L.y;s.array[t+10]=L.z;s.array[t+11]=L.w;t=t+12}y=0;for(M=ca.length;y<M;y++){$=L=K=J=ga=s.value[ca[y]];s.array[t]=J.x;s.array[t+1]=J.y;s.array[t+2]=J.z;s.array[t+3]=J.w;s.array[t+
|
|
|
4]=K.x;s.array[t+5]=K.y;s.array[t+6]=K.z;s.array[t+7]=K.w;s.array[t+8]=L.x;s.array[t+9]=L.y;s.array[t+10]=L.z;s.array[t+11]=L.w;s.array[t+12]=$.x;s.array[t+13]=$.y;s.array[t+14]=$.z;s.array[t+15]=$.w;t=t+16}}else if(s.boundTo==="faceVertices"){y=0;for(M=ba.length;y<M;y++){ga=s.value[ba[y]];J=ga[0];K=ga[1];L=ga[2];s.array[t]=J.x;s.array[t+1]=J.y;s.array[t+2]=J.z;s.array[t+3]=J.w;s.array[t+4]=K.x;s.array[t+5]=K.y;s.array[t+6]=K.z;s.array[t+7]=K.w;s.array[t+8]=L.x;s.array[t+9]=L.y;s.array[t+10]=L.z;
|
|
|
-s.array[t+11]=L.w;t=t+12}y=0;for(M=ca.length;y<M;y++){ga=s.value[ca[y]];J=ga[0];K=ga[1];L=ga[2];$=ga[3];s.array[t]=J.x;s.array[t+1]=J.y;s.array[t+2]=J.z;s.array[t+3]=J.w;s.array[t+4]=K.x;s.array[t+5]=K.y;s.array[t+6]=K.z;s.array[t+7]=K.w;s.array[t+8]=L.x;s.array[t+9]=L.y;s.array[t+10]=L.z;s.array[t+11]=L.w;s.array[t+12]=$.x;s.array[t+13]=$.y;s.array[t+14]=$.z;s.array[t+15]=$.w;t=t+16}}g.bindBuffer(g.ARRAY_BUFFER,s.buffer);g.bufferData(g.ARRAY_BUFFER,s.array,Pa)}}}if(zc){delete Z.__inittedArrays;delete Z.__colorArray;
|
|
|
-delete Z.__normalArray;delete Z.__tangentArray;delete Z.__uvArray;delete Z.__uv2Array;delete Z.__faceArray;delete Z.__vertexArray;delete Z.__lineArray;delete Z.__skinVertexAArray;delete Z.__skinVertexBArray;delete Z.__skinIndexArray;delete Z.__skinWeightArray}}}}X.verticesNeedUpdate=false;X.morphTargetsNeedUpdate=false;X.elementsNeedUpdate=false;X.uvsNeedUpdate=false;X.normalsNeedUpdate=false;X.colorsNeedUpdate=false;X.tangentsNeedUpdate=false;Na.attributes&&o(Na)}else if(Xa instanceof THREE.Ribbon){if(X.verticesNeedUpdate||
|
|
|
+s.array[t+11]=L.w;t=t+12}y=0;for(M=ca.length;y<M;y++){ga=s.value[ca[y]];J=ga[0];K=ga[1];L=ga[2];$=ga[3];s.array[t]=J.x;s.array[t+1]=J.y;s.array[t+2]=J.z;s.array[t+3]=J.w;s.array[t+4]=K.x;s.array[t+5]=K.y;s.array[t+6]=K.z;s.array[t+7]=K.w;s.array[t+8]=L.x;s.array[t+9]=L.y;s.array[t+10]=L.z;s.array[t+11]=L.w;s.array[t+12]=$.x;s.array[t+13]=$.y;s.array[t+14]=$.z;s.array[t+15]=$.w;t=t+16}}g.bindBuffer(g.ARRAY_BUFFER,s.buffer);g.bufferData(g.ARRAY_BUFFER,s.array,Ra)}}}if(zc){delete Z.__inittedArrays;delete Z.__colorArray;
|
|
|
+delete Z.__normalArray;delete Z.__tangentArray;delete Z.__uvArray;delete Z.__uv2Array;delete Z.__faceArray;delete Z.__vertexArray;delete Z.__lineArray;delete Z.__skinVertexAArray;delete Z.__skinVertexBArray;delete Z.__skinIndexArray;delete Z.__skinWeightArray}}}}X.verticesNeedUpdate=false;X.morphTargetsNeedUpdate=false;X.elementsNeedUpdate=false;X.uvsNeedUpdate=false;X.normalsNeedUpdate=false;X.colorsNeedUpdate=false;X.tangentsNeedUpdate=false;Na.attributes&&o(Na)}else if(Ya instanceof THREE.Ribbon){if(X.verticesNeedUpdate||
|
|
|
X.colorsNeedUpdate){var Jb=X,kd=g.DYNAMIC_DRAW,tc=void 0,uc=void 0,Gc=void 0,Kb=void 0,Hc=void 0,ld=Jb.vertices,md=Jb.colors,td=ld.length,ud=md.length,Ic=Jb.__vertexArray,Jc=Jb.__colorArray,vd=Jb.colorsNeedUpdate;if(Jb.verticesNeedUpdate){for(tc=0;tc<td;tc++){Gc=ld[tc];Kb=tc*3;Ic[Kb]=Gc.x;Ic[Kb+1]=Gc.y;Ic[Kb+2]=Gc.z}g.bindBuffer(g.ARRAY_BUFFER,Jb.__webglVertexBuffer);g.bufferData(g.ARRAY_BUFFER,Ic,kd)}if(vd){for(uc=0;uc<ud;uc++){Hc=md[uc];Kb=uc*3;Jc[Kb]=Hc.r;Jc[Kb+1]=Hc.g;Jc[Kb+2]=Hc.b}g.bindBuffer(g.ARRAY_BUFFER,
|
|
|
-Jb.__webglColorBuffer);g.bufferData(g.ARRAY_BUFFER,Jc,kd)}}X.verticesNeedUpdate=false;X.colorsNeedUpdate=false}else if(Xa instanceof THREE.Line){Na=c(Xa,lc);Yb=Na.attributes&&n(Na);if(X.verticesNeedUpdate||X.colorsNeedUpdate||Yb){var vb=X,dd=g.DYNAMIC_DRAW,vc=void 0,wc=void 0,Kc=void 0,sa=void 0,Lc=void 0,nd=vb.vertices,od=vb.colors,wd=nd.length,xd=od.length,Mc=vb.__vertexArray,Nc=vb.__colorArray,yd=vb.colorsNeedUpdate,ed=vb.__webglCustomAttributesList,Oc=void 0,pd=void 0,Ga=void 0,fc=void 0,Oa=void 0,
|
|
|
-ka=void 0;if(vb.verticesNeedUpdate){for(vc=0;vc<wd;vc++){Kc=nd[vc];sa=vc*3;Mc[sa]=Kc.x;Mc[sa+1]=Kc.y;Mc[sa+2]=Kc.z}g.bindBuffer(g.ARRAY_BUFFER,vb.__webglVertexBuffer);g.bufferData(g.ARRAY_BUFFER,Mc,dd)}if(yd){for(wc=0;wc<xd;wc++){Lc=od[wc];sa=wc*3;Nc[sa]=Lc.r;Nc[sa+1]=Lc.g;Nc[sa+2]=Lc.b}g.bindBuffer(g.ARRAY_BUFFER,vb.__webglColorBuffer);g.bufferData(g.ARRAY_BUFFER,Nc,dd)}if(ed){Oc=0;for(pd=ed.length;Oc<pd;Oc++){ka=ed[Oc];if(ka.needsUpdate&&(ka.boundTo===void 0||ka.boundTo==="vertices")){sa=0;fc=ka.value.length;
|
|
|
+Jb.__webglColorBuffer);g.bufferData(g.ARRAY_BUFFER,Jc,kd)}}X.verticesNeedUpdate=false;X.colorsNeedUpdate=false}else if(Ya instanceof THREE.Line){Na=c(Ya,lc);Yb=Na.attributes&&n(Na);if(X.verticesNeedUpdate||X.colorsNeedUpdate||Yb){var wb=X,dd=g.DYNAMIC_DRAW,vc=void 0,wc=void 0,Kc=void 0,sa=void 0,Lc=void 0,nd=wb.vertices,od=wb.colors,wd=nd.length,xd=od.length,Mc=wb.__vertexArray,Nc=wb.__colorArray,yd=wb.colorsNeedUpdate,ed=wb.__webglCustomAttributesList,Oc=void 0,pd=void 0,Ga=void 0,fc=void 0,Oa=void 0,
|
|
|
+ka=void 0;if(wb.verticesNeedUpdate){for(vc=0;vc<wd;vc++){Kc=nd[vc];sa=vc*3;Mc[sa]=Kc.x;Mc[sa+1]=Kc.y;Mc[sa+2]=Kc.z}g.bindBuffer(g.ARRAY_BUFFER,wb.__webglVertexBuffer);g.bufferData(g.ARRAY_BUFFER,Mc,dd)}if(yd){for(wc=0;wc<xd;wc++){Lc=od[wc];sa=wc*3;Nc[sa]=Lc.r;Nc[sa+1]=Lc.g;Nc[sa+2]=Lc.b}g.bindBuffer(g.ARRAY_BUFFER,wb.__webglColorBuffer);g.bufferData(g.ARRAY_BUFFER,Nc,dd)}if(ed){Oc=0;for(pd=ed.length;Oc<pd;Oc++){ka=ed[Oc];if(ka.needsUpdate&&(ka.boundTo===void 0||ka.boundTo==="vertices")){sa=0;fc=ka.value.length;
|
|
|
if(ka.size===1)for(Ga=0;Ga<fc;Ga++)ka.array[Ga]=ka.value[Ga];else if(ka.size===2)for(Ga=0;Ga<fc;Ga++){Oa=ka.value[Ga];ka.array[sa]=Oa.x;ka.array[sa+1]=Oa.y;sa=sa+2}else if(ka.size===3)if(ka.type==="c")for(Ga=0;Ga<fc;Ga++){Oa=ka.value[Ga];ka.array[sa]=Oa.r;ka.array[sa+1]=Oa.g;ka.array[sa+2]=Oa.b;sa=sa+3}else for(Ga=0;Ga<fc;Ga++){Oa=ka.value[Ga];ka.array[sa]=Oa.x;ka.array[sa+1]=Oa.y;ka.array[sa+2]=Oa.z;sa=sa+3}else if(ka.size===4)for(Ga=0;Ga<fc;Ga++){Oa=ka.value[Ga];ka.array[sa]=Oa.x;ka.array[sa+1]=
|
|
|
-Oa.y;ka.array[sa+2]=Oa.z;ka.array[sa+3]=Oa.w;sa=sa+4}g.bindBuffer(g.ARRAY_BUFFER,ka.buffer);g.bufferData(g.ARRAY_BUFFER,ka.array,dd)}}}}X.verticesNeedUpdate=false;X.colorsNeedUpdate=false;Na.attributes&&o(Na)}else if(Xa instanceof THREE.ParticleSystem){Na=c(Xa,lc);Yb=Na.attributes&&n(Na);(X.verticesNeedUpdate||X.colorsNeedUpdate||Xa.sortParticles||Yb)&&f(X,g.DYNAMIC_DRAW,Xa);X.verticesNeedUpdate=false;X.colorsNeedUpdate=false;Na.attributes&&o(Na)}}};this.initMaterial=function(a,b,c,d){var e,f,h,i,
|
|
|
+Oa.y;ka.array[sa+2]=Oa.z;ka.array[sa+3]=Oa.w;sa=sa+4}g.bindBuffer(g.ARRAY_BUFFER,ka.buffer);g.bufferData(g.ARRAY_BUFFER,ka.array,dd)}}}}X.verticesNeedUpdate=false;X.colorsNeedUpdate=false;Na.attributes&&o(Na)}else if(Ya instanceof THREE.ParticleSystem){Na=c(Ya,lc);Yb=Na.attributes&&n(Na);(X.verticesNeedUpdate||X.colorsNeedUpdate||Ya.sortParticles||Yb)&&f(X,g.DYNAMIC_DRAW,Ya);X.verticesNeedUpdate=false;X.colorsNeedUpdate=false;Na.attributes&&o(Na)}}};this.initMaterial=function(a,b,c,d){var e,f,h,i,
|
|
|
j,k,l,m;a instanceof THREE.MeshDepthMaterial?m="depth":a instanceof THREE.MeshNormalMaterial?m="normal":a instanceof THREE.MeshBasicMaterial?m="basic":a instanceof THREE.MeshLambertMaterial?m="lambert":a instanceof THREE.MeshPhongMaterial?m="phong":a instanceof THREE.LineBasicMaterial?m="basic":a instanceof THREE.ParticleBasicMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];a.uniforms=THREE.UniformsUtils.clone(n.uniforms);a.vertexShader=n.vertexShader;a.fragmentShader=n.fragmentShader}var o,
|
|
|
-q;o=h=e=n=0;for(f=b.length;o<f;o++){q=b[o];if(!q.onlyShadow){q instanceof THREE.DirectionalLight&&h++;q instanceof THREE.PointLight&&e++;q instanceof THREE.SpotLight&&n++}}if(e+n+h<=V){o=h;f=e}else{o=Math.ceil(V*h/(e+h));n=f=V-o}e=o;h=n;n=l=0;for(o=b.length;n<o;n++){q=b[n];if(q.castShadow){q instanceof THREE.SpotLight&&l++;q instanceof THREE.DirectionalLight&&!q.shadowCascade&&l++}}if(hc&&d&&d.useVertexTexture)k=1024;else{b=g.getParameter(g.MAX_VERTEX_UNIFORM_VECTORS);b=Math.floor((b-20)/4);if(d!==
|
|
|
+q;o=h=e=n=0;for(f=b.length;o<f;o++){q=b[o];if(!q.onlyShadow){q instanceof THREE.DirectionalLight&&h++;q instanceof THREE.PointLight&&e++;q instanceof THREE.SpotLight&&n++}}if(e+n+h<=Q){o=h;f=e}else{o=Math.ceil(Q*h/(e+h));n=f=Q-o}e=o;h=n;n=l=0;for(o=b.length;n<o;n++){q=b[n];if(q.castShadow){q instanceof THREE.SpotLight&&l++;q instanceof THREE.DirectionalLight&&!q.shadowCascade&&l++}}if(hc&&d&&d.useVertexTexture)k=1024;else{b=g.getParameter(g.MAX_VERTEX_UNIFORM_VECTORS);b=Math.floor((b-20)/4);if(d!==
|
|
|
void 0&&d instanceof THREE.SkinnedMesh){b=Math.min(d.bones.length,b);b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+d.bones.length+", this GPU supports just "+b+" (try OpenGL instead of ANGLE)")}k=b}var p;a:{q=a.fragmentShader;o=a.vertexShader;var n=a.uniforms,b=a.attributes,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,maxBones:k,useVertexTexture:hc&&d&&d.useVertexTexture,
|
|
|
boneTextureWidth:d&&d.boneTextureWidth,boneTextureHeight:d&&d.boneTextureHeight,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLights:h,maxShadows:l,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround,
|
|
|
doubleSided:a.doubleSided},r,d=[];if(m)d.push(m);else{d.push(q);d.push(o)}for(r in c){d.push(r);d.push(c[r])}m=d.join();r=0;for(d=ea.length;r<d;r++){e=ea[r];if(e.code===m){e.usedTimes++;p=e.program;break a}}r=g.createProgram();d=["precision "+C+" float;",jc?"#define VERTEX_TEXTURES":"",F.gammaInput?"#define GAMMA_INPUT":"",F.gammaOutput?"#define GAMMA_OUTPUT":"",F.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,
|
|
@@ -401,14 +401,14 @@ e=w("fragment",e+q);d=w("vertex",d+o);g.attachShader(r,d);g.attachShader(r,e);g.
|
|
|
d.push("boneGlobalMatrices");for(u in n)d.push(u);u=d;d=0;for(n=u.length;d<n;d++){e=u[d];r.uniforms[e]=g.getUniformLocation(r,e)}d=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(u=0;u<c.maxMorphTargets;u++)d.push("morphTarget"+u);for(u=0;u<c.maxMorphNormals;u++)d.push("morphNormal"+u);for(p in b)d.push(p);p=d;u=0;for(c=p.length;u<c;u++){d=p[u];r.attributes[d]=g.getAttribLocation(r,d)}r.id=ja++;ea.push({program:r,code:m,usedTimes:1});F.info.memory.programs=
|
|
|
ea.length;p=r}a.program=p;p=a.program.attributes;p.position>=0&&g.enableVertexAttribArray(p.position);p.color>=0&&g.enableVertexAttribArray(p.color);p.normal>=0&&g.enableVertexAttribArray(p.normal);p.tangent>=0&&g.enableVertexAttribArray(p.tangent);if(a.skinning&&p.skinVertexA>=0&&p.skinVertexB>=0&&p.skinIndex>=0&&p.skinWeight>=0){g.enableVertexAttribArray(p.skinVertexA);g.enableVertexAttribArray(p.skinVertexB);g.enableVertexAttribArray(p.skinIndex);g.enableVertexAttribArray(p.skinWeight)}if(a.attributes)for(j in a.attributes)p[j]!==
|
|
|
void 0&&p[j]>=0&&g.enableVertexAttribArray(p[j]);if(a.morphTargets){a.numSupportedMorphTargets=0;r="morphTarget";for(j=0;j<this.maxMorphTargets;j++){u=r+j;if(p[u]>=0){g.enableVertexAttribArray(p[u]);a.numSupportedMorphTargets++}}}if(a.morphNormals){a.numSupportedMorphNormals=0;r="morphNormal";for(j=0;j<this.maxMorphNormals;j++){u=r+j;if(p[u]>=0){g.enableVertexAttribArray(p[u]);a.numSupportedMorphNormals++}}}a.uniformsList=[];for(i in a.uniforms)a.uniformsList.push([a.uniforms[i],i])};this.setFaceCulling=
|
|
|
-function(a,b){if(a){!b||b==="ccw"?g.frontFace(g.CCW):g.frontFace(g.CW);a==="back"?g.cullFace(g.BACK):a==="front"?g.cullFace(g.FRONT):g.cullFace(g.FRONT_AND_BACK);g.enable(g.CULL_FACE)}else g.disable(g.CULL_FACE)};this.setMaterialFaces=function(a){if(ia!==a.doubleSided){a.doubleSided?g.disable(g.CULL_FACE):g.enable(g.CULL_FACE);ia=a.doubleSided}if(N!==a.flipSided){a.flipSided?g.frontFace(g.CW):g.frontFace(g.CCW);N=a.flipSided}};this.setDepthTest=function(a){if(Ia!==a){a?g.enable(g.DEPTH_TEST):g.disable(g.DEPTH_TEST);
|
|
|
-Ia=a}};this.setDepthWrite=function(a){if(Ca!==a){g.depthMask(a);Ca=a}};this.setBlending=function(a,b,c,d){if(a!==ua){if(a===THREE.NoBlending)g.disable(g.BLEND);else if(a===THREE.AdditiveBlending){g.enable(g.BLEND);g.blendEquation(g.FUNC_ADD);g.blendFunc(g.SRC_ALPHA,g.ONE)}else if(a===THREE.SubtractiveBlending){g.enable(g.BLEND);g.blendEquation(g.FUNC_ADD);g.blendFunc(g.ZERO,g.ONE_MINUS_SRC_COLOR)}else if(a===THREE.MultiplyBlending){g.enable(g.BLEND);g.blendEquation(g.FUNC_ADD);g.blendFunc(g.ZERO,
|
|
|
+function(a,b){if(a){!b||b==="ccw"?g.frontFace(g.CCW):g.frontFace(g.CW);a==="back"?g.cullFace(g.BACK):a==="front"?g.cullFace(g.FRONT):g.cullFace(g.FRONT_AND_BACK);g.enable(g.CULL_FACE)}else g.disable(g.CULL_FACE)};this.setMaterialFaces=function(a){if(ia!==a.doubleSided){a.doubleSided?g.disable(g.CULL_FACE):g.enable(g.CULL_FACE);ia=a.doubleSided}if(W!==a.flipSided){a.flipSided?g.frontFace(g.CW):g.frontFace(g.CCW);W=a.flipSided}};this.setDepthTest=function(a){if(Pa!==a){a?g.enable(g.DEPTH_TEST):g.disable(g.DEPTH_TEST);
|
|
|
+Pa=a}};this.setDepthWrite=function(a){if(Ca!==a){g.depthMask(a);Ca=a}};this.setBlending=function(a,b,c,d){if(a!==ua){if(a===THREE.NoBlending)g.disable(g.BLEND);else if(a===THREE.AdditiveBlending){g.enable(g.BLEND);g.blendEquation(g.FUNC_ADD);g.blendFunc(g.SRC_ALPHA,g.ONE)}else if(a===THREE.SubtractiveBlending){g.enable(g.BLEND);g.blendEquation(g.FUNC_ADD);g.blendFunc(g.ZERO,g.ONE_MINUS_SRC_COLOR)}else if(a===THREE.MultiplyBlending){g.enable(g.BLEND);g.blendEquation(g.FUNC_ADD);g.blendFunc(g.ZERO,
|
|
|
g.SRC_COLOR)}else if(a===THREE.CustomBlending)g.enable(g.BLEND);else{g.enable(g.BLEND);g.blendEquationSeparate(g.FUNC_ADD,g.FUNC_ADD);g.blendFuncSeparate(g.SRC_ALPHA,g.ONE_MINUS_SRC_ALPHA,g.ONE,g.ONE_MINUS_SRC_ALPHA)}ua=a}if(a===THREE.CustomBlending){if(b!==Ba){g.blendEquation(A(b));Ba=b}if(c!==ma||d!==Ja){g.blendFunc(A(c),A(d));ma=c;Ja=d}}else Ja=ma=Ba=null};this.setTexture=function(a,b){if(a.needsUpdate){if(!a.__webglInit){a.__webglInit=true;a.__webglTexture=g.createTexture();F.info.memory.textures++}g.activeTexture(g.TEXTURE0+
|
|
|
b);g.bindTexture(g.TEXTURE_2D,a.__webglTexture);g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,a.flipY);g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);var c=a.image,d=(c.width&c.width-1)===0&&(c.height&c.height-1)===0,e=A(a.format),f=A(a.type);H(g.TEXTURE_2D,a,d);a instanceof THREE.DataTexture?g.texImage2D(g.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data):g.texImage2D(g.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&g.generateMipmap(g.TEXTURE_2D);a.needsUpdate=false;if(a.onUpdate)a.onUpdate()}else{g.activeTexture(g.TEXTURE0+
|
|
|
b);g.bindTexture(g.TEXTURE_2D,a.__webglTexture)}};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=true;if(a.stencilBuffer===void 0)a.stencilBuffer=true;a.__webglTexture=g.createTexture();var c=(a.width&a.width-1)===0&&(a.height&a.height-1)===0,d=A(a.format),e=A(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];g.bindTexture(g.TEXTURE_CUBE_MAP,a.__webglTexture);H(g.TEXTURE_CUBE_MAP,a,c);
|
|
|
for(var f=0;f<6;f++){a.__webglFramebuffer[f]=g.createFramebuffer();a.__webglRenderbuffer[f]=g.createRenderbuffer();g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var h=a,i=g.TEXTURE_CUBE_MAP_POSITIVE_X+f;g.bindFramebuffer(g.FRAMEBUFFER,a.__webglFramebuffer[f]);g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,i,h.__webglTexture,0);v(a.__webglRenderbuffer[f],a)}c&&g.generateMipmap(g.TEXTURE_CUBE_MAP)}else{a.__webglFramebuffer=g.createFramebuffer();a.__webglRenderbuffer=
|
|
|
g.createRenderbuffer();g.bindTexture(g.TEXTURE_2D,a.__webglTexture);H(g.TEXTURE_2D,a,c);g.texImage2D(g.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null);d=g.TEXTURE_2D;g.bindFramebuffer(g.FRAMEBUFFER,a.__webglFramebuffer);g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,d,a.__webglTexture,0);v(a.__webglRenderbuffer,a);c&&g.generateMipmap(g.TEXTURE_2D)}b?g.bindTexture(g.TEXTURE_CUBE_MAP,null):g.bindTexture(g.TEXTURE_2D,null);g.bindRenderbuffer(g.RENDERBUFFER,null);g.bindFramebuffer(g.FRAMEBUFFER,
|
|
|
-null)}if(a){b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer;c=a.width;a=a.height;e=d=0}else{b=null;c=Ob;a=Pb;d=xb;e=Nb}if(b!==la){g.bindFramebuffer(g.FRAMEBUFFER,b);g.viewport(d,e,c,a);la=b}gc=c;xc=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};
|
|
|
+null)}if(a){b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer;c=a.width;a=a.height;e=d=0}else{b=null;c=Nb;a=Ob;d=Ub;e=Mb}if(b!==la){g.bindFramebuffer(g.FRAMEBUFFER,b);g.viewport(d,e,c,a);la=b}gc=c;xc=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};
|
|
|
THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=c.wrapS!==void 0?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=c.wrapT!==void 0?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=c.magFilter!==void 0?c.magFilter:THREE.LinearFilter;this.minFilter=c.minFilter!==void 0?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=c.anisotropy!==void 0?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=c.format!==void 0?c.format:
|
|
|
THREE.RGBAFormat;this.type=c.type!==void 0?c.type:THREE.UnsignedByteType;this.depthBuffer=c.depthBuffer!==void 0?c.depthBuffer:true;this.stencilBuffer=c.stencilBuffer!==void 0?c.stencilBuffer:true;this.generateMipmaps=true};
|
|
|
THREE.WebGLRenderTarget.prototype.clone=function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.anisotropy=this.anisotropy;a.minFilter=this.minFilter;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;return a};
|
|
@@ -421,10 +421,10 @@ Infinity),max:new THREE.Vector3(-Infinity,-Infinity,-Infinity)};var a=this.attri
|
|
|
{radius:0};var a=this.attributes.position.array;if(a){for(var b,c=0,d,e,f=0,h=a.length;f<h;f=f+3){b=a[f];d=a[f+1];e=a[f+2];b=Math.sqrt(b*b+d*d+e*e);b>c&&(c=b)}this.boundingSphere.radius=c}},computeVertexNormals:function(){if(this.attributes.position&&this.attributes.index){var a,b,c,d;a=this.attributes.position.array.length;if(this.attributes.normal===void 0)this.attributes.normal={itemSize:3,array:new Float32Array(a),numItems:a};else{a=0;for(b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=
|
|
|
0}var e=this.offsets,f=this.attributes.index.array,h=this.attributes.position.array,j=this.attributes.normal.array,l,k,i,m,n,o,u=new THREE.Vector3,q=new THREE.Vector3,r=new THREE.Vector3,p=new THREE.Vector3,x=new THREE.Vector3;c=0;for(d=e.length;c<d;++c){b=e[c].start;l=e[c].count;var w=e[c].index;a=b;for(b=b+l;a<b;a=a+3){l=w+f[a];k=w+f[a+1];i=w+f[a+2];m=h[l*3];n=h[l*3+1];o=h[l*3+2];u.set(m,n,o);m=h[k*3];n=h[k*3+1];o=h[k*3+2];q.set(m,n,o);m=h[i*3];n=h[i*3+1];o=h[i*3+2];r.set(m,n,o);p.sub(r,q);x.sub(u,
|
|
|
q);p.crossSelf(x);j[l*3]=j[l*3]+p.x;j[l*3+1]=j[l*3+1]+p.y;j[l*3+2]=j[l*3+2]+p.z;j[k*3]=j[k*3]+p.x;j[k*3+1]=j[k*3+1]+p.y;j[k*3+2]=j[k*3+2]+p.z;j[i*3]=j[i*3]+p.x;j[i*3+1]=j[i*3+1]+p.y;j[i*3+2]=j[i*3+2]+p.z}}a=0;for(b=j.length;a<b;a=a+3){m=j[a];n=j[a+1];o=j[a+2];c=1/Math.sqrt(m*m+n*n+o*o);j[a]=j[a]*c;j[a+1]=j[a+1]*c;j[a+2]=j[a+2]*c}this.normalsNeedUpdate=true}},computeTangents:function(){function a(a,b,c){m=d[a*3];n=d[a*3+1];o=d[a*3+2];u=d[b*3];q=d[b*3+1];r=d[b*3+2];p=d[c*3];x=d[c*3+1];w=d[c*3+2];H=
|
|
|
-f[a*2];v=f[a*2+1];E=f[b*2];A=f[b*2+1];G=f[c*2];C=f[c*2+1];P=u-m;I=p-m;U=q-n;W=x-n;S=r-o;z=w-o;O=E-H;V=G-H;F=A-v;ea=C-v;ja=1/(O*ea-V*F);Q.set((ea*P-F*I)*ja,(ea*U-F*W)*ja,(ea*S-F*z)*ja);la.set((O*I-V*P)*ja,(O*W-V*U)*ja,(O*z-V*S)*ja);k[a].addSelf(Q);k[b].addSelf(Q);k[c].addSelf(Q);i[a].addSelf(la);i[b].addSelf(la);i[c].addSelf(la)}function b(a){Ja.x=e[a*3];Ja.y=e[a*3+1];Ja.z=e[a*3+2];Ia.copy(Ja);Va=k[a];Ba.copy(Va);Ba.subSelf(Ja.multiplyScalar(Ja.dot(Va))).normalize();ma.cross(Ia,Va);wb=ma.dot(i[a]);
|
|
|
-Ca=wb<0?-1:1;l[a*4]=Ba.x;l[a*4+1]=Ba.y;l[a*4+2]=Ba.z;l[a*4+3]=Ca}if(this.attributes.index===void 0||this.attributes.position===void 0||this.attributes.normal===void 0||this.attributes.uv===void 0)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,h=d.length/3;if(this.attributes.tangent===void 0){var j=4*h;this.attributes.tangent=
|
|
|
-{itemSize:4,array:new Float32Array(j),numItems:j}}for(var l=this.attributes.tangent.array,k=[],i=[],j=0;j<h;j++){k[j]=new THREE.Vector3;i[j]=new THREE.Vector3}var m,n,o,u,q,r,p,x,w,H,v,E,A,G,C,P,I,U,W,S,z,O,V,F,ea,ja,Q=new THREE.Vector3,la=new THREE.Vector3,aa,T,da,ta,ia,N=this.offsets,j=0;for(T=N.length;j<T;++j){aa=N[j].start;da=N[j].count;var ua=N[j].index,h=aa;for(aa=aa+da;h<aa;h=h+3){da=ua+c[h];ta=ua+c[h+1];ia=ua+c[h+2];a(da,ta,ia)}}var Ba=new THREE.Vector3,ma=new THREE.Vector3,Ja=new THREE.Vector3,
|
|
|
-Ia=new THREE.Vector3,Ca,Va,wb,j=0;for(T=N.length;j<T;++j){aa=N[j].start;da=N[j].count;ua=N[j].index;h=aa;for(aa=aa+da;h<aa;h=h+3){da=ua+c[h];ta=ua+c[h+1];ia=ua+c[h+2];b(da);b(ta);b(ia)}}this.tangentsNeedUpdate=this.hasTangents=true}}};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
+f[a*2];v=f[a*2+1];E=f[b*2];A=f[b*2+1];G=f[c*2];C=f[c*2+1];P=u-m;I=p-m;U=q-n;V=x-n;S=r-o;z=w-o;O=E-H;Q=G-H;F=A-v;ea=C-v;ja=1/(O*ea-Q*F);N.set((ea*P-F*I)*ja,(ea*U-F*V)*ja,(ea*S-F*z)*ja);la.set((O*I-Q*P)*ja,(O*V-Q*U)*ja,(O*z-Q*S)*ja);k[a].addSelf(N);k[b].addSelf(N);k[c].addSelf(N);i[a].addSelf(la);i[b].addSelf(la);i[c].addSelf(la)}function b(a){Ja.x=e[a*3];Ja.y=e[a*3+1];Ja.z=e[a*3+2];Pa.copy(Ja);Ha=k[a];Ba.copy(Ha);Ba.subSelf(Ja.multiplyScalar(Ja.dot(Ha))).normalize();ma.cross(Pa,Ha);Qa=ma.dot(i[a]);
|
|
|
+Ca=Qa<0?-1:1;l[a*4]=Ba.x;l[a*4+1]=Ba.y;l[a*4+2]=Ba.z;l[a*4+3]=Ca}if(this.attributes.index===void 0||this.attributes.position===void 0||this.attributes.normal===void 0||this.attributes.uv===void 0)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,h=d.length/3;if(this.attributes.tangent===void 0){var j=4*h;this.attributes.tangent=
|
|
|
+{itemSize:4,array:new Float32Array(j),numItems:j}}for(var l=this.attributes.tangent.array,k=[],i=[],j=0;j<h;j++){k[j]=new THREE.Vector3;i[j]=new THREE.Vector3}var m,n,o,u,q,r,p,x,w,H,v,E,A,G,C,P,I,U,V,S,z,O,Q,F,ea,ja,N=new THREE.Vector3,la=new THREE.Vector3,aa,T,da,ta,ia,W=this.offsets,j=0;for(T=W.length;j<T;++j){aa=W[j].start;da=W[j].count;var ua=W[j].index,h=aa;for(aa=aa+da;h<aa;h=h+3){da=ua+c[h];ta=ua+c[h+1];ia=ua+c[h+2];a(da,ta,ia)}}var Ba=new THREE.Vector3,ma=new THREE.Vector3,Ja=new THREE.Vector3,
|
|
|
+Pa=new THREE.Vector3,Ca,Ha,Qa,j=0;for(T=W.length;j<T;++j){aa=W[j].start;da=W[j].count;ua=W[j].index;h=aa;for(aa=aa+da;h<aa;h=h+3){da=ua+c[h];ta=ua+c[h+1];ia=ua+c[h+2];b(da);b(ta);b(ia)}}this.tangentsNeedUpdate=this.hasTangents=true}}};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.Gyroscope.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){if(this.parent){this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix);this.matrixWorld.decompose(this.translationWorld,this.rotationWorld,this.scaleWorld);this.matrix.decompose(this.translationObject,this.rotationObject,this.scaleObject);this.matrixWorld.compose(this.translationWorld,this.rotationObject,this.scaleWorld)}else 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)};THREE.Gyroscope.prototype.translationWorld=new THREE.Vector3;THREE.Gyroscope.prototype.translationObject=new THREE.Vector3;THREE.Gyroscope.prototype.rotationWorld=new THREE.Quaternion;THREE.Gyroscope.prototype.rotationObject=new THREE.Quaternion;THREE.Gyroscope.prototype.scaleWorld=new THREE.Vector3;THREE.Gyroscope.prototype.scaleObject=new THREE.Vector3;
|
|
|
THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.lineGeometry.vertices.push(new THREE.Vector3);d.lineGeometry.colors.push(new THREE.Color(b));d.pointMap[a]===void 0&&(d.pointMap[a]=[]);d.pointMap[a].push(d.lineGeometry.vertices.length-1)}THREE.Object3D.call(this);var d=this;this.lineGeometry=new THREE.Geometry;this.lineMaterial=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors});this.pointMap={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4",
|
|
@@ -440,9 +440,9 @@ THREE.LensFlarePlugin=function(){function a(a){var c=b.createProgram(),d=b.creat
|
|
|
b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,l);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);
|
|
|
b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);if(b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)<=0){k=false;i=a(THREE.ShaderFlares.lensFlare)}else{k=true;i=a(THREE.ShaderFlares.lensFlareVertexTexture)}m={};n={};m.vertex=b.getAttribLocation(i,"position");m.uv=b.getAttribLocation(i,"uv");n.renderType=b.getUniformLocation(i,"renderType");n.map=b.getUniformLocation(i,"map");n.occlusionMap=b.getUniformLocation(i,"occlusionMap");n.opacity=b.getUniformLocation(i,"opacity");n.color=b.getUniformLocation(i,
|
|
|
"color");n.scale=b.getUniformLocation(i,"scale");n.rotation=b.getUniformLocation(i,"rotation");n.screenPosition=b.getUniformLocation(i,"screenPosition");o=false};this.render=function(a,d,e,p){var a=a.__webglFlares,x=a.length;if(x){var w=new THREE.Vector3,H=p/e,v=e*0.5,E=p*0.5,A=16/p,G=new THREE.Vector2(A*H,A),C=new THREE.Vector3(1,1,0),P=new THREE.Vector2(1,1),I=n,A=m;b.useProgram(i);if(!o){b.enableVertexAttribArray(m.vertex);b.enableVertexAttribArray(m.uv);o=true}b.uniform1i(I.occlusionMap,0);b.uniform1i(I.map,
|
|
|
-1);b.bindBuffer(b.ARRAY_BUFFER,f);b.vertexAttribPointer(A.vertex,2,b.FLOAT,false,16,0);b.vertexAttribPointer(A.uv,2,b.FLOAT,false,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(false);var U,W,S,z,O;for(U=0;U<x;U++){A=16/p;G.set(A*H,A);z=a[U];w.set(z.matrixWorld.elements[12],z.matrixWorld.elements[13],z.matrixWorld.elements[14]);d.matrixWorldInverse.multiplyVector3(w);d.projectionMatrix.multiplyVector3(w);C.copy(w);P.x=C.x*v+v;P.y=C.y*E+E;if(k||P.x>0&&P.x<e&&P.y>0&&
|
|
|
+1);b.bindBuffer(b.ARRAY_BUFFER,f);b.vertexAttribPointer(A.vertex,2,b.FLOAT,false,16,0);b.vertexAttribPointer(A.uv,2,b.FLOAT,false,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(false);var U,V,S,z,O;for(U=0;U<x;U++){A=16/p;G.set(A*H,A);z=a[U];w.set(z.matrixWorld.elements[12],z.matrixWorld.elements[13],z.matrixWorld.elements[14]);d.matrixWorldInverse.multiplyVector3(w);d.projectionMatrix.multiplyVector3(w);C.copy(w);P.x=C.x*v+v;P.y=C.y*E+E;if(k||P.x>0&&P.x<e&&P.y>0&&
|
|
|
P.y<p){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,j);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,P.x-8,P.y-8,16,16,0);b.uniform1i(I.renderType,0);b.uniform2f(I.scale,G.x,G.y);b.uniform3f(I.screenPosition,C.x,C.y,C.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,l);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,P.x-8,P.y-8,16,16,0);b.uniform1i(I.renderType,1);b.disable(b.DEPTH_TEST);b.activeTexture(b.TEXTURE1);
|
|
|
-b.bindTexture(b.TEXTURE_2D,j);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);z.positionScreen.copy(C);z.customUpdateCallback?z.customUpdateCallback(z):z.updateLensFlares();b.uniform1i(I.renderType,2);b.enable(b.BLEND);W=0;for(S=z.lensFlares.length;W<S;W++){O=z.lensFlares[W];if(O.opacity>0.0010&&O.scale>0.0010){C.x=O.x;C.y=O.y;C.z=O.z;A=O.size*O.scale/p;G.x=A*H;G.y=A;b.uniform3f(I.screenPosition,C.x,C.y,C.z);b.uniform2f(I.scale,G.x,G.y);b.uniform1f(I.rotation,O.rotation);b.uniform1f(I.opacity,O.opacity);
|
|
|
+b.bindTexture(b.TEXTURE_2D,j);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);z.positionScreen.copy(C);z.customUpdateCallback?z.customUpdateCallback(z):z.updateLensFlares();b.uniform1i(I.renderType,2);b.enable(b.BLEND);V=0;for(S=z.lensFlares.length;V<S;V++){O=z.lensFlares[V];if(O.opacity>0.001&&O.scale>0.001){C.x=O.x;C.y=O.y;C.z=O.z;A=O.size*O.scale/p;G.x=A*H;G.y=A;b.uniform3f(I.screenPosition,C.x,C.y,C.z);b.uniform2f(I.scale,G.x,G.y);b.uniform1f(I.rotation,O.rotation);b.uniform1f(I.opacity,O.opacity);
|
|
|
b.uniform3f(I.color,O.color.r,O.color.g,O.color.b);c.setBlending(O.blending,O.blendEquation,O.blendSrc,O.blendDst);c.setTexture(O.texture,1);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}}}}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(true)}}};
|
|
|
THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f=new THREE.Frustum,h=new THREE.Matrix4,j=new THREE.Vector3,l=new THREE.Vector3;this.init=function(f){a=f.context;b=f;var f=THREE.ShaderLib.depthRGBA,h=THREE.UniformsUtils.clone(f.uniforms);c=new THREE.ShaderMaterial({fragmentShader:f.fragmentShader,vertexShader:f.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:f.fragmentShader,vertexShader:f.vertexShader,uniforms:h,morphTargets:true});e=new THREE.ShaderMaterial({fragmentShader:f.fragmentShader,
|
|
|
vertexShader:f.vertexShader,uniforms:h,skinning:true});c._shadowPass=true;d._shadowPass=true;e._shadowPass=true};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(k,i){var m,n,o,u,q,r,p,x,w,H=[];u=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);b.shadowMapCullFrontFaces?a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(true);m=0;for(n=k.__lights.length;m<n;m++){o=k.__lights[m];if(o.castShadow)if(o instanceof THREE.DirectionalLight&&
|