|
@@ -1,7 +1,7 @@
|
|
// ThreeWebGL.js r46dev - http://github.com/mrdoob/three.js
|
|
// ThreeWebGL.js r46dev - http://github.com/mrdoob/three.js
|
|
var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this};
|
|
var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this};
|
|
-THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var e,h,f;if(c===0)this.r=this.g=this.b=0;else switch(e=Math.floor(a*6),h=a*6-e,a=c*(1-b),f=c*(1-
|
|
|
|
-b*h),b=c*(1-b*(1-h)),e){case 1:this.r=f;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=f;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=c;this.g=a;this.b=f;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+
|
|
|
|
|
|
+THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var e,f,h;if(c===0)this.r=this.g=this.b=0;else switch(e=Math.floor(a*6),f=a*6-e,a=c*(1-b),h=c*(1-
|
|
|
|
+b*f),b=c*(1-b*(1-f)),e){case 1:this.r=h;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=h;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=c;this.g=a;this.b=h;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+
|
|
Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
|
|
Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
|
|
THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},
|
|
THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},
|
|
divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)},
|
|
divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)},
|
|
@@ -15,85 +15,85 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,e){this.x=
|
|
b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a,this.w/=a):(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())},
|
|
b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a,this.w/=a):(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+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
|
|
normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
|
|
THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.children)},intersectObjects:function(a){var b,c,e=[];b=0;for(c=a.length;b<c;b++)Array.prototype.push.apply(e,this.intersectObject(a[b]));e.sort(function(a,b){return a.distance-b.distance});return e},intersectObject:function(a){function b(a,b,c){var e;e=c.clone().subSelf(a).dot(b);if(e<=0)return null;a=a.clone().addSelf(b.clone().multiplyScalar(e));return c.distanceTo(a)}function c(a,b,c,e){var e=e.clone().subSelf(b),
|
|
THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.children)},intersectObjects:function(a){var b,c,e=[];b=0;for(c=a.length;b<c;b++)Array.prototype.push.apply(e,this.intersectObject(a[b]));e.sort(function(a,b){return a.distance-b.distance});return e},intersectObject:function(a){function b(a,b,c){var e;e=c.clone().subSelf(a).dot(b);if(e<=0)return null;a=a.clone().addSelf(b.clone().multiplyScalar(e));return c.distanceTo(a)}function c(a,b,c,e){var e=e.clone().subSelf(b),
|
|
-c=c.clone().subSelf(b),h=a.clone().subSelf(b),a=e.dot(e),b=e.dot(c),e=e.dot(h),f=c.dot(c),c=c.dot(h),h=1/(a*f-b*b),f=(f*e-b*c)*h,a=(a*c-b*e)*h;return f>0&&a>0&&f+a<1}for(var e,h=[],f=0,i=a.children.length;f<i;f++)Array.prototype.push.apply(h,this.intersectObject(a.children[f]));if(a instanceof THREE.Particle){f=b(this.origin,this.direction,a.matrixWorld.getPosition());if(f===null||f>a.scale.x)return[];e={distance:f,point:a.position,face:null,object:a};h.push(e)}else if(a instanceof THREE.Mesh){f=
|
|
|
|
-b(this.origin,this.direction,a.matrixWorld.getPosition());if(f===null||f>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return h;var j,n,l,o,k,r,v,z,B=a.geometry,F=B.vertices;a.matrixRotationWorld.extractRotation(a.matrixWorld);f=0;for(i=B.faces.length;f<i;f++)if(e=B.faces[f],v=this.origin.clone(),z=this.direction.clone(),o=a.matrixWorld,j=o.multiplyVector3(e.centroid.clone()).subSelf(v),r=j.dot(z),!(r<=0)&&(j=o.multiplyVector3(F[e.a].position.clone()),n=o.multiplyVector3(F[e.b].position.clone()),
|
|
|
|
-l=o.multiplyVector3(F[e.c].position.clone()),o=e instanceof THREE.Face4?o.multiplyVector3(F[e.d].position.clone()):null,k=a.matrixRotationWorld.multiplyVector3(e.normal.clone()),r=z.dot(k),a.doubleSided||(a.flipSided?r>0:r<0)))if(r=k.dot((new THREE.Vector3).sub(j,v))/r,v=v.addSelf(z.multiplyScalar(r)),e instanceof THREE.Face3)c(v,j,n,l)&&(e={distance:this.origin.distanceTo(v),point:v,face:e,object:a},h.push(e));else if(e instanceof THREE.Face4&&(c(v,j,n,o)||c(v,n,l,o)))e={distance:this.origin.distanceTo(v),
|
|
|
|
-point:v,face:e,object:a},h.push(e)}return h}};
|
|
|
|
-THREE.Rectangle=function(){function a(){f=e-b;i=h-c}var b,c,e,h,f,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return f};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return h};this.set=function(f,i,o,k){j=!1;b=f;c=i;e=o;h=k;a()};this.addPoint=function(f,i){j?(j=!1,b=f,c=i,e=f,h=i):(b=b<f?b:f,c=c<i?c:i,e=e>f?e:f,h=h>i?h:i);a()};this.add3Points=
|
|
|
|
-function(f,i,o,k,r,v){j?(j=!1,b=f<o?f<r?f:r:o<r?o:r,c=i<k?i<v?i:v:k<v?k:v,e=f>o?f>r?f:r:o>r?o:r,h=i>k?i>v?i:v:k>v?k:v):(b=f<o?f<r?f<b?f:b:r<b?r:b:o<r?o<b?o:b:r<b?r:b,c=i<k?i<v?i<c?i:c:v<c?v:c:k<v?k<c?k:c:v<c?v:c,e=f>o?f>r?f>e?f:e:r>e?r:e:o>r?o>e?o:e:r>e?r:e,h=i>k?i>v?i>h?i:h:v>h?v:h:k>v?k>h?k:h:v>h?v:h);a()};this.addRectangle=function(f){j?(j=!1,b=f.getLeft(),c=f.getTop(),e=f.getRight(),h=f.getBottom()):(b=b<f.getLeft()?b:f.getLeft(),c=c<f.getTop()?c:f.getTop(),e=e>f.getRight()?e:f.getRight(),h=h>
|
|
|
|
-f.getBottom()?h:f.getBottom());a()};this.inflate=function(f){b-=f;c-=f;e+=f;h+=f;a()};this.minSelf=function(f){b=b>f.getLeft()?b:f.getLeft();c=c>f.getTop()?c:f.getTop();e=e<f.getRight()?e:f.getRight();h=h<f.getBottom()?h:f.getBottom();a()};this.intersects=function(a){return Math.min(e,a.getRight())-Math.max(b,a.getLeft())>=0&&Math.min(h,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){j=!0;h=e=c=b=0;a()};this.isEmpty=function(){return j}};THREE.Matrix3=function(){this.m=[]};
|
|
|
|
|
|
+c=c.clone().subSelf(b),f=a.clone().subSelf(b),a=e.dot(e),b=e.dot(c),e=e.dot(f),h=c.dot(c),c=c.dot(f),f=1/(a*h-b*b),h=(h*e-b*c)*f,a=(a*c-b*e)*f;return h>0&&a>0&&h+a<1}for(var e,f=[],h=0,i=a.children.length;h<i;h++)Array.prototype.push.apply(f,this.intersectObject(a.children[h]));if(a instanceof THREE.Particle){h=b(this.origin,this.direction,a.matrixWorld.getPosition());if(h===null||h>a.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h=
|
|
|
|
+b(this.origin,this.direction,a.matrixWorld.getPosition());if(h===null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;var j,n,l,o,k,r,v,z,B=a.geometry,F=B.vertices;a.matrixRotationWorld.extractRotation(a.matrixWorld);h=0;for(i=B.faces.length;h<i;h++)if(e=B.faces[h],v=this.origin.clone(),z=this.direction.clone(),o=a.matrixWorld,j=o.multiplyVector3(e.centroid.clone()).subSelf(v),r=j.dot(z),!(r<=0)&&(j=o.multiplyVector3(F[e.a].position.clone()),n=o.multiplyVector3(F[e.b].position.clone()),
|
|
|
|
+l=o.multiplyVector3(F[e.c].position.clone()),o=e instanceof THREE.Face4?o.multiplyVector3(F[e.d].position.clone()):null,k=a.matrixRotationWorld.multiplyVector3(e.normal.clone()),r=z.dot(k),a.doubleSided||(a.flipSided?r>0:r<0)))if(r=k.dot((new THREE.Vector3).sub(j,v))/r,v=v.addSelf(z.multiplyScalar(r)),e instanceof THREE.Face3)c(v,j,n,l)&&(e={distance:this.origin.distanceTo(v),point:v,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(v,j,n,o)||c(v,n,l,o)))e={distance:this.origin.distanceTo(v),
|
|
|
|
+point:v,face:e,object:a},f.push(e)}return f}};
|
|
|
|
+THREE.Rectangle=function(){function a(){h=e-b;i=f-c}var b,c,e,f,h,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(h,i,o,k){j=!1;b=h;c=i;e=o;f=k;a()};this.addPoint=function(h,i){j?(j=!1,b=h,c=i,e=h,f=i):(b=b<h?b:h,c=c<i?c:i,e=e>h?e:h,f=f>i?f:i);a()};this.add3Points=
|
|
|
|
+function(h,i,o,k,r,v){j?(j=!1,b=h<o?h<r?h:r:o<r?o:r,c=i<k?i<v?i:v:k<v?k:v,e=h>o?h>r?h:r:o>r?o:r,f=i>k?i>v?i:v:k>v?k:v):(b=h<o?h<r?h<b?h:b:r<b?r:b:o<r?o<b?o:b:r<b?r:b,c=i<k?i<v?i<c?i:c:v<c?v:c:k<v?k<c?k:c:v<c?v:c,e=h>o?h>r?h>e?h:e:r>e?r:e:o>r?o>e?o:e:r>e?r:e,f=i>k?i>v?i>f?i:f:v>f?v:f:k>v?k>f?k:f:v>f?v:f);a()};this.addRectangle=function(h){j?(j=!1,b=h.getLeft(),c=h.getTop(),e=h.getRight(),f=h.getBottom()):(b=b<h.getLeft()?b:h.getLeft(),c=c<h.getTop()?c:h.getTop(),e=e>h.getRight()?e:h.getRight(),f=f>
|
|
|
|
+h.getBottom()?f:h.getBottom());a()};this.inflate=function(h){b-=h;c-=h;e+=h;f+=h;a()};this.minSelf=function(h){b=b>h.getLeft()?b:h.getLeft();c=c>h.getTop()?c:h.getTop();e=e<h.getRight()?e:h.getRight();f=f<h.getBottom()?f:h.getBottom();a()};this.intersects=function(a){return Math.min(e,a.getRight())-Math.max(b,a.getLeft())>=0&&Math.min(f,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){j=!0;f=e=c=b=0;a()};this.isEmpty=function(){return j}};THREE.Matrix3=function(){this.m=[]};
|
|
THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;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.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;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,e,h,f,i,j,n,l,o,k,r,v,z,B){this.set(a!==void 0?a:1,b||0,c||0,e||0,h||0,f!==void 0?f:1,i||0,j||0,n||0,l||0,o!==void 0?o:1,k||0,r||0,v||0,z||0,B!==void 0?B:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
|
|
|
|
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,h,f,i,j,n,l,o,k,r,v,z,B){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=h;this.n22=f;this.n23=i;this.n24=j;this.n31=n;this.n32=l;this.n33=o;this.n34=k;this.n41=r;this.n42=v;this.n43=z;this.n44=B;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){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
|
|
|
|
-b,c){var e=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,f=THREE.Matrix4.__v3;f.sub(a,b).normalize();if(f.length()===0)f.z=1;e.cross(c,f).normalize();e.length()===0&&(f.x+=1.0E-4,e.cross(c,f).normalize());h.cross(f,e).normalize();this.n11=e.x;this.n12=h.x;this.n13=f.x;this.n21=e.y;this.n22=h.y;this.n23=f.y;this.n31=e.z;this.n32=h.z;this.n33=f.z;return this},multiply:function(a,b){var c=a.n11,e=a.n12,h=a.n13,f=a.n14,i=a.n21,j=a.n22,n=a.n23,l=a.n24,o=a.n31,k=a.n32,r=a.n33,v=a.n34,z=a.n41,B=a.n42,F=a.n43,
|
|
|
|
-E=a.n44,fa=b.n11,ia=b.n12,ra=b.n13,O=b.n14,I=b.n21,T=b.n22,ta=b.n23,U=b.n24,ma=b.n31,pa=b.n32,X=b.n33,R=b.n34,K=b.n41,A=b.n42,d=b.n43,C=b.n44;this.n11=c*fa+e*I+h*ma+f*K;this.n12=c*ia+e*T+h*pa+f*A;this.n13=c*ra+e*ta+h*X+f*d;this.n14=c*O+e*U+h*R+f*C;this.n21=i*fa+j*I+n*ma+l*K;this.n22=i*ia+j*T+n*pa+l*A;this.n23=i*ra+j*ta+n*X+l*d;this.n24=i*O+j*U+n*R+l*C;this.n31=o*fa+k*I+r*ma+v*K;this.n32=o*ia+k*T+r*pa+v*A;this.n33=o*ra+k*ta+r*X+v*d;this.n34=o*O+k*U+r*R+v*C;this.n41=z*fa+B*I+F*ma+E*K;this.n42=z*ia+
|
|
|
|
|
|
+THREE.Matrix4=function(a,b,c,e,f,h,i,j,n,l,o,k,r,v,z,B){this.set(a!==void 0?a:1,b||0,c||0,e||0,f||0,h!==void 0?h:1,i||0,j||0,n||0,l||0,o!==void 0?o:1,k||0,r||0,v||0,z||0,B!==void 0?B:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
|
|
|
|
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,f,h,i,j,n,l,o,k,r,v,z,B){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=h;this.n23=i;this.n24=j;this.n31=n;this.n32=l;this.n33=o;this.n34=k;this.n41=r;this.n42=v;this.n43=z;this.n44=B;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){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
|
|
|
|
+b,c){var 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();e.length()===0&&(h.x+=1.0E-4,e.cross(c,h).normalize());f.cross(h,e).normalize();this.n11=e.x;this.n12=f.x;this.n13=h.x;this.n21=e.y;this.n22=f.y;this.n23=h.y;this.n31=e.z;this.n32=f.z;this.n33=h.z;return this},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,n=a.n23,l=a.n24,o=a.n31,k=a.n32,r=a.n33,v=a.n34,z=a.n41,B=a.n42,F=a.n43,
|
|
|
|
+E=a.n44,fa=b.n11,ia=b.n12,ra=b.n13,O=b.n14,I=b.n21,T=b.n22,ta=b.n23,U=b.n24,ma=b.n31,pa=b.n32,X=b.n33,R=b.n34,K=b.n41,A=b.n42,d=b.n43,C=b.n44;this.n11=c*fa+e*I+f*ma+h*K;this.n12=c*ia+e*T+f*pa+h*A;this.n13=c*ra+e*ta+f*X+h*d;this.n14=c*O+e*U+f*R+h*C;this.n21=i*fa+j*I+n*ma+l*K;this.n22=i*ia+j*T+n*pa+l*A;this.n23=i*ra+j*ta+n*X+l*d;this.n24=i*O+j*U+n*R+l*C;this.n31=o*fa+k*I+r*ma+v*K;this.n32=o*ia+k*T+r*pa+v*A;this.n33=o*ra+k*ta+r*X+v*d;this.n34=o*O+k*U+r*R+v*C;this.n41=z*fa+B*I+F*ma+E*K;this.n42=z*ia+
|
|
B*T+F*pa+E*A;this.n43=z*ra+B*ta+F*X+E*d;this.n44=z*O+B*U+F*R+E*C;return this},multiplySelf:function(a){return this.multiply(this,a)},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;
|
|
B*T+F*pa+E*A;this.n43=z*ra+B*ta+F*X+E*d;this.n44=z*O+B*U+F*R+E*C;return this},multiplySelf:function(a){return this.multiply(this,a)},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;
|
|
-this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},multiplyVector3:function(a){var b=a.x,c=a.y,e=a.z,h=1/(this.n41*b+this.n42*c+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*e+this.n14)*h;a.y=(this.n21*b+this.n22*c+this.n23*e+this.n24)*h;a.z=(this.n31*b+this.n32*c+this.n33*e+this.n34)*h;return a},multiplyVector4:function(a){var b=a.x,c=a.y,e=a.z,h=a.w;a.x=this.n11*b+this.n12*c+this.n13*
|
|
|
|
-e+this.n14*h;a.y=this.n21*b+this.n22*c+this.n23*e+this.n24*h;a.z=this.n31*b+this.n32*c+this.n33*e+this.n34*h;a.w=this.n41*b+this.n42*c+this.n43*e+this.n44*h;return a},rotateAxis:function(a){var b=a.x,c=a.y,e=a.z;a.x=b*this.n11+c*this.n12+e*this.n13;a.y=b*this.n21+c*this.n22+e*this.n23;a.z=b*this.n31+c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*
|
|
|
|
-a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,h=this.n21,f=this.n22,i=this.n23,j=this.n24,n=this.n31,l=this.n32,o=this.n33,k=this.n34,r=this.n41,v=this.n42,z=this.n43,B=this.n44;return e*i*l*r-c*j*l*r-e*f*o*r+b*j*o*r+c*f*k*r-b*i*k*r-e*i*n*v+c*j*n*v+e*h*o*v-a*j*o*v-c*h*k*v+a*i*k*v+e*f*n*z-b*j*n*z-e*h*l*z+a*j*l*z+b*h*k*z-a*f*k*z-c*f*n*B+b*i*n*B+
|
|
|
|
-c*h*l*B-a*i*l*B-b*h*o*B+a*f*o*B},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;
|
|
|
|
|
|
+this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},multiplyVector3:function(a){var b=a.x,c=a.y,e=a.z,f=1/(this.n41*b+this.n42*c+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*e+this.n14)*f;a.y=(this.n21*b+this.n22*c+this.n23*e+this.n24)*f;a.z=(this.n31*b+this.n32*c+this.n33*e+this.n34)*f;return a},multiplyVector4:function(a){var b=a.x,c=a.y,e=a.z,f=a.w;a.x=this.n11*b+this.n12*c+this.n13*
|
|
|
|
+e+this.n14*f;a.y=this.n21*b+this.n22*c+this.n23*e+this.n24*f;a.z=this.n31*b+this.n32*c+this.n33*e+this.n34*f;a.w=this.n41*b+this.n42*c+this.n43*e+this.n44*f;return a},rotateAxis:function(a){var b=a.x,c=a.y,e=a.z;a.x=b*this.n11+c*this.n12+e*this.n13;a.y=b*this.n21+c*this.n22+e*this.n23;a.z=b*this.n31+c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*
|
|
|
|
+a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,f=this.n21,h=this.n22,i=this.n23,j=this.n24,n=this.n31,l=this.n32,o=this.n33,k=this.n34,r=this.n41,v=this.n42,z=this.n43,B=this.n44;return e*i*l*r-c*j*l*r-e*h*o*r+b*j*o*r+c*h*k*r-b*i*k*r-e*i*n*v+c*j*n*v+e*f*o*v-a*j*o*v-c*f*k*v+a*i*k*v+e*h*n*z-b*j*n*z-e*f*l*z+a*j*l*z+b*f*k*z-a*h*k*z-c*h*n*B+b*i*n*B+
|
|
|
|
+c*f*l*B-a*i*l*B-b*f*o*B+a*h*o*B},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;
|
|
a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=
|
|
a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=
|
|
this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=
|
|
this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=
|
|
this.n34;a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,
|
|
this.n34;a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,
|
|
-0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),e=Math.sin(b),h=1-c,f=a.x,i=a.y,j=a.z,n=h*f,l=h*i;this.set(n*f+c,n*i-e*j,n*j+e*i,0,n*i+e*j,l*i+c,l*j-e*f,0,n*j-e*i,l*j+e*f,h*j*j+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){return THREE.Matrix4.__v1.set(this.n14,this.n24,this.n34)},getColumnX:function(){return THREE.Matrix4.__v1.set(this.n11,this.n21,this.n31)},getColumnY:function(){return THREE.Matrix4.__v1.set(this.n12,
|
|
|
|
-this.n22,this.n32)},getColumnZ:function(){return THREE.Matrix4.__v1.set(this.n13,this.n23,this.n33)},getInverse:function(a){var b=a.n11,c=a.n12,e=a.n13,h=a.n14,f=a.n21,i=a.n22,j=a.n23,n=a.n24,l=a.n31,o=a.n32,k=a.n33,r=a.n34,v=a.n41,z=a.n42,B=a.n43,F=a.n44;this.n11=j*r*z-n*k*z+n*o*B-i*r*B-j*o*F+i*k*F;this.n12=h*k*z-e*r*z-h*o*B+c*r*B+e*o*F-c*k*F;this.n13=e*n*z-h*j*z+h*i*B-c*n*B-e*i*F+c*j*F;this.n14=h*j*o-e*n*o-h*i*k+c*n*k+e*i*r-c*j*r;this.n21=n*k*v-j*r*v-n*l*B+f*r*B+j*l*F-f*k*F;this.n22=e*r*v-h*k*v+
|
|
|
|
-h*l*B-b*r*B-e*l*F+b*k*F;this.n23=h*j*v-e*n*v-h*f*B+b*n*B+e*f*F-b*j*F;this.n24=e*n*l-h*j*l+h*f*k-b*n*k-e*f*r+b*j*r;this.n31=i*r*v-n*o*v+n*l*z-f*r*z-i*l*F+f*o*F;this.n32=h*o*v-c*r*v-h*l*z+b*r*z+c*l*F-b*o*F;this.n33=e*n*v-h*i*v+h*f*z-b*n*z-c*f*F+b*i*F;this.n34=h*i*l-c*n*l-h*f*o+b*n*o+c*f*r-b*i*r;this.n41=j*o*v-i*k*v-j*l*z+f*k*z+i*l*B-f*o*B;this.n42=c*k*v-e*o*v+e*l*z-b*k*z-c*l*B+b*o*B;this.n43=e*i*v-c*j*v-e*f*z+b*j*z+c*f*B-b*i*B;this.n44=c*j*l-e*i*l+e*f*o-b*j*o-c*f*k+b*i*k;this.multiplyScalar(1/a.determinant());
|
|
|
|
-return this},setRotationFromEuler:function(a,b){var c=a.x,e=a.y,h=a.z,f=Math.cos(c),c=Math.sin(c),i=Math.cos(e),e=Math.sin(e),j=Math.cos(h),h=Math.sin(h);switch(b){case "YXZ":var n=i*j,l=i*h,o=e*j,k=e*h;this.n11=n+k*c;this.n12=o*c-l;this.n13=f*e;this.n21=f*h;this.n22=f*j;this.n23=-c;this.n31=l*c-o;this.n32=k+n*c;this.n33=f*i;break;case "ZXY":n=i*j;l=i*h;o=e*j;k=e*h;this.n11=n-k*c;this.n12=-f*h;this.n13=o+l*c;this.n21=l+o*c;this.n22=f*j;this.n23=k-n*c;this.n31=-f*e;this.n32=c;this.n33=f*i;break;case "ZYX":n=
|
|
|
|
-f*j;l=f*h;o=c*j;k=c*h;this.n11=i*j;this.n12=o*e-l;this.n13=n*e+k;this.n21=i*h;this.n22=k*e+n;this.n23=l*e-o;this.n31=-e;this.n32=c*i;this.n33=f*i;break;case "YZX":n=f*i;l=f*e;o=c*i;k=c*e;this.n11=i*j;this.n12=k-n*h;this.n13=o*h+l;this.n21=h;this.n22=f*j;this.n23=-c*j;this.n31=-e*j;this.n32=l*h+o;this.n33=n-k*h;break;case "XZY":n=f*i;l=f*e;o=c*i;k=c*e;this.n11=i*j;this.n12=-h;this.n13=e*j;this.n21=n*h+k;this.n22=f*j;this.n23=l*h-o;this.n31=o*h-l;this.n32=c*j;this.n33=k*h+n;break;default:n=f*j,l=f*
|
|
|
|
-h,o=c*j,k=c*h,this.n11=i*j,this.n12=-i*h,this.n13=e,this.n21=l+o*e,this.n22=n-k*e,this.n23=-c*i,this.n31=k-n*e,this.n32=o+l*e,this.n33=f*i}return this},setRotationFromQuaternion:function(a){var b=a.x,c=a.y,e=a.z,h=a.w,f=b+b,i=c+c,j=e+e,a=b*f,n=b*i;b*=j;var l=c*i;c*=j;e*=j;f*=h;i*=h;h*=j;this.n11=1-(l+e);this.n12=n-h;this.n13=b+i;this.n21=n+h;this.n22=1-(a+e);this.n23=c-f;this.n31=b-i;this.n32=c+f;this.n33=1-(a+l);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=
|
|
|
|
-a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var e=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2;e.identity();e.setRotationFromQuaternion(b);h.setScale(c.x,c.y,c.z);this.multiply(e,h);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var e=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,f=THREE.Matrix4.__v3;e.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);f.set(this.n13,
|
|
|
|
-this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=e.length();c.y=h.length();c.z=f.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;e=THREE.Matrix4.__m1;e.copy(this);e.n11/=c.x;e.n21/=c.x;e.n31/=c.x;e.n12/=c.y;e.n22/=c.y;e.n32/=c.y;e.n13/=c.z;e.n23/=c.z;e.n33/=c.z;b.setFromRotationMatrix(e);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34;
|
|
|
|
|
|
+0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),e=Math.sin(b),f=1-c,h=a.x,i=a.y,j=a.z,n=f*h,l=f*i;this.set(n*h+c,n*i-e*j,n*j+e*i,0,n*i+e*j,l*i+c,l*j-e*h,0,n*j-e*i,l*j+e*h,f*j*j+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){return THREE.Matrix4.__v1.set(this.n14,this.n24,this.n34)},getColumnX:function(){return THREE.Matrix4.__v1.set(this.n11,this.n21,this.n31)},getColumnY:function(){return THREE.Matrix4.__v1.set(this.n12,
|
|
|
|
+this.n22,this.n32)},getColumnZ:function(){return THREE.Matrix4.__v1.set(this.n13,this.n23,this.n33)},getInverse:function(a){var b=a.n11,c=a.n12,e=a.n13,f=a.n14,h=a.n21,i=a.n22,j=a.n23,n=a.n24,l=a.n31,o=a.n32,k=a.n33,r=a.n34,v=a.n41,z=a.n42,B=a.n43,F=a.n44;this.n11=j*r*z-n*k*z+n*o*B-i*r*B-j*o*F+i*k*F;this.n12=f*k*z-e*r*z-f*o*B+c*r*B+e*o*F-c*k*F;this.n13=e*n*z-f*j*z+f*i*B-c*n*B-e*i*F+c*j*F;this.n14=f*j*o-e*n*o-f*i*k+c*n*k+e*i*r-c*j*r;this.n21=n*k*v-j*r*v-n*l*B+h*r*B+j*l*F-h*k*F;this.n22=e*r*v-f*k*v+
|
|
|
|
+f*l*B-b*r*B-e*l*F+b*k*F;this.n23=f*j*v-e*n*v-f*h*B+b*n*B+e*h*F-b*j*F;this.n24=e*n*l-f*j*l+f*h*k-b*n*k-e*h*r+b*j*r;this.n31=i*r*v-n*o*v+n*l*z-h*r*z-i*l*F+h*o*F;this.n32=f*o*v-c*r*v-f*l*z+b*r*z+c*l*F-b*o*F;this.n33=e*n*v-f*i*v+f*h*z-b*n*z-c*h*F+b*i*F;this.n34=f*i*l-c*n*l-f*h*o+b*n*o+c*h*r-b*i*r;this.n41=j*o*v-i*k*v-j*l*z+h*k*z+i*l*B-h*o*B;this.n42=c*k*v-e*o*v+e*l*z-b*k*z-c*l*B+b*o*B;this.n43=e*i*v-c*j*v-e*h*z+b*j*z+c*h*B-b*i*B;this.n44=c*j*l-e*i*l+e*h*o-b*j*o-c*h*k+b*i*k;this.multiplyScalar(1/a.determinant());
|
|
|
|
+return this},setRotationFromEuler:function(a,b){var c=a.x,e=a.y,f=a.z,h=Math.cos(c),c=Math.sin(c),i=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var n=i*j,l=i*f,o=e*j,k=e*f;this.n11=n+k*c;this.n12=o*c-l;this.n13=h*e;this.n21=h*f;this.n22=h*j;this.n23=-c;this.n31=l*c-o;this.n32=k+n*c;this.n33=h*i;break;case "ZXY":n=i*j;l=i*f;o=e*j;k=e*f;this.n11=n-k*c;this.n12=-h*f;this.n13=o+l*c;this.n21=l+o*c;this.n22=h*j;this.n23=k-n*c;this.n31=-h*e;this.n32=c;this.n33=h*i;break;case "ZYX":n=
|
|
|
|
+h*j;l=h*f;o=c*j;k=c*f;this.n11=i*j;this.n12=o*e-l;this.n13=n*e+k;this.n21=i*f;this.n22=k*e+n;this.n23=l*e-o;this.n31=-e;this.n32=c*i;this.n33=h*i;break;case "YZX":n=h*i;l=h*e;o=c*i;k=c*e;this.n11=i*j;this.n12=k-n*f;this.n13=o*f+l;this.n21=f;this.n22=h*j;this.n23=-c*j;this.n31=-e*j;this.n32=l*f+o;this.n33=n-k*f;break;case "XZY":n=h*i;l=h*e;o=c*i;k=c*e;this.n11=i*j;this.n12=-f;this.n13=e*j;this.n21=n*f+k;this.n22=h*j;this.n23=l*f-o;this.n31=o*f-l;this.n32=c*j;this.n33=k*f+n;break;default:n=h*j,l=h*
|
|
|
|
+f,o=c*j,k=c*f,this.n11=i*j,this.n12=-i*f,this.n13=e,this.n21=l+o*e,this.n22=n-k*e,this.n23=-c*i,this.n31=k-n*e,this.n32=o+l*e,this.n33=h*i}return this},setRotationFromQuaternion:function(a){var b=a.x,c=a.y,e=a.z,f=a.w,h=b+b,i=c+c,j=e+e,a=b*h,n=b*i;b*=j;var l=c*i;c*=j;e*=j;h*=f;i*=f;f*=j;this.n11=1-(l+e);this.n12=n-f;this.n13=b+i;this.n21=n+f;this.n22=1-(a+e);this.n23=c-h;this.n31=b-i;this.n32=c+h;this.n33=1-(a+l);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=
|
|
|
|
+a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2;e.identity();e.setRotationFromQuaternion(b);f.setScale(c.x,c.y,c.z);this.multiply(e,f);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;e.set(this.n11,this.n21,this.n31);f.set(this.n12,this.n22,this.n32);h.set(this.n13,
|
|
|
|
+this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=e.length();c.y=f.length();c.z=h.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;e=THREE.Matrix4.__m1;e.copy(this);e.n11/=c.x;e.n21/=c.x;e.n31/=c.x;e.n12/=c.y;e.n22/=c.y;e.n32/=c.y;e.n13/=c.z;e.n23/=c.z;e.n33/=c.z;b.setFromRotationMatrix(e);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34;
|
|
return this},extractRotation:function(a){var b=THREE.Matrix4.__v1,c=1/b.set(a.n11,a.n21,a.n31).length(),e=1/b.set(a.n12,a.n22,a.n32).length(),b=1/b.set(a.n13,a.n23,a.n33).length();this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*e;this.n22=a.n22*e;this.n32=a.n32*e;this.n13=a.n13*b;this.n23=a.n23*b;this.n33=a.n33*b;return this}};
|
|
return this},extractRotation:function(a){var b=THREE.Matrix4.__v1,c=1/b.set(a.n11,a.n21,a.n31).length(),e=1/b.set(a.n12,a.n22,a.n32).length(),b=1/b.set(a.n13,a.n23,a.n33).length();this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*e;this.n22=a.n22*e;this.n32=a.n32*e;this.n13=a.n13*b;this.n23=a.n23*b;this.n33=a.n33*b;return this}};
|
|
-THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,h=-a.n33*a.n21+a.n31*a.n23,f=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,n=-a.n32*a.n11+a.n31*a.n12,l=a.n23*a.n12-a.n22*a.n13,o=-a.n23*a.n11+a.n21*a.n13,k=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*l;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*h;c[2]=a*f;c[3]=a*i;c[4]=a*j;c[5]=a*n;c[6]=a*l;c[7]=a*o;c[8]=a*k;return b};
|
|
|
|
-THREE.Matrix4.makeFrustum=function(a,b,c,e,h,f){var i;i=new THREE.Matrix4;i.n11=2*h/(b-a);i.n12=0;i.n13=(b+a)/(b-a);i.n14=0;i.n21=0;i.n22=2*h/(e-c);i.n23=(e+c)/(e-c);i.n24=0;i.n31=0;i.n32=0;i.n33=-(f+h)/(f-h);i.n34=-2*f*h/(f-h);i.n41=0;i.n42=0;i.n43=-1;i.n44=0;return i};THREE.Matrix4.makePerspective=function(a,b,c,e){var h,a=c*Math.tan(a*Math.PI/360);h=-a;return THREE.Matrix4.makeFrustum(h*b,a*b,h,a,c,e)};
|
|
|
|
-THREE.Matrix4.makeOrtho=function(a,b,c,e,h,f){var i,j,n,l;i=new THREE.Matrix4;j=b-a;n=c-e;l=f-h;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/n;i.n23=0;i.n24=-((c+e)/n);i.n31=0;i.n32=0;i.n33=-2/l;i.n34=-((f+h)/l);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
|
|
|
|
|
|
+THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,n=-a.n32*a.n11+a.n31*a.n12,l=a.n23*a.n12-a.n22*a.n13,o=-a.n23*a.n11+a.n21*a.n13,k=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*l;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*n;c[6]=a*l;c[7]=a*o;c[8]=a*k;return b};
|
|
|
|
+THREE.Matrix4.makeFrustum=function(a,b,c,e,f,h){var i;i=new THREE.Matrix4;i.n11=2*f/(b-a);i.n12=0;i.n13=(b+a)/(b-a);i.n14=0;i.n21=0;i.n22=2*f/(e-c);i.n23=(e+c)/(e-c);i.n24=0;i.n31=0;i.n32=0;i.n33=-(h+f)/(h-f);i.n34=-2*h*f/(h-f);i.n41=0;i.n42=0;i.n43=-1;i.n44=0;return i};THREE.Matrix4.makePerspective=function(a,b,c,e){var f,a=c*Math.tan(a*Math.PI/360);f=-a;return THREE.Matrix4.makeFrustum(f*b,a*b,f,a,c,e)};
|
|
|
|
+THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var i,j,n,l;i=new THREE.Matrix4;j=b-a;n=c-e;l=h-f;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/n;i.n23=0;i.n24=-((c+e)/n);i.n31=0;i.n32=0;i.n33=-2/l;i.n34=-((h+f)/l);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
|
|
THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
|
|
THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
|
|
!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
|
|
!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
|
|
THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)===
|
|
THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)===
|
|
--1){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.addObject(a)}},remove:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.removeObject(a)}},getChildByName:function(a,b){var c,e,h;c=0;for(e=this.children.length;c<e;c++){h=this.children[c];if(h.name===a)return h;
|
|
|
|
-if(b&&(h=h.getChildByName(a,b),h!==void 0))return h}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){this.matrixAutoUpdate&&
|
|
|
|
|
|
+-1){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.addObject(a)}},remove:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.removeObject(a)}},getChildByName:function(a,b){var c,e,f;c=0;for(e=this.children.length;c<e;c++){f=this.children[c];if(f.name===a)return f;
|
|
|
|
+if(b&&(f=f.getChildByName(a,b),f!==void 0))return f}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){this.matrixAutoUpdate&&
|
|
this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)}};THREE.Object3DCount=0;
|
|
this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)}};THREE.Object3DCount=0;
|
|
-THREE.Projector=function(){function a(){var a=f[h]=f[h]||new THREE.RenderableVertex;h++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,e=1,f=a.z+a.w,h=b.z+b.w,i=-a.z+a.w,j=-b.z+b.w;return f>=0&&h>=0&&i>=0&&j>=0?!0:f<0&&h<0||i<0&&j<0?!1:(f<0?c=Math.max(c,f/(f-h)):h<0&&(e=Math.min(e,f/(f-h))),i<0?c=Math.max(c,i/(i-j)):j<0&&(e=Math.min(e,i/(i-j))),e<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-e),!0))}var e,h,f=[],i,j,n=[],l,o=[],k,r,v=[],z,B,F=[],E={objects:[],sprites:[],lights:[],elements:[]};
|
|
|
|
|
|
+THREE.Projector=function(){function a(){var a=h[f]=h[f]||new THREE.RenderableVertex;f++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,e=1,h=a.z+a.w,f=b.z+b.w,i=-a.z+a.w,j=-b.z+b.w;return h>=0&&f>=0&&i>=0&&j>=0?!0:h<0&&f<0||i<0&&j<0?!1:(h<0?c=Math.max(c,h/(h-f)):f<0&&(e=Math.min(e,h/(h-f))),i<0?c=Math.max(c,i/(i-j)):j<0&&(e=Math.min(e,i/(i-j))),e<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-e),!0))}var e,f,h=[],i,j,n=[],l,o=[],k,r,v=[],z,B,F=[],E={objects:[],sprites:[],lights:[],elements:[]};
|
|
new THREE.Vector3;var fa=new THREE.Vector4,ia=new THREE.Matrix4,ra=new THREE.Matrix4,O=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],I=new THREE.Vector4,T=new THREE.Vector4;this.computeFrustum=function(a){O[0].set(a.n41-a.n11,a.n42-a.n12,a.n43-a.n13,a.n44-a.n14);O[1].set(a.n41+a.n11,a.n42+a.n12,a.n43+a.n13,a.n44+a.n14);O[2].set(a.n41+a.n21,a.n42+a.n22,a.n43+a.n23,a.n44+a.n24);O[3].set(a.n41-a.n21,a.n42-a.n22,a.n43-a.n23,a.n44-a.n24);
|
|
new THREE.Vector3;var fa=new THREE.Vector4,ia=new THREE.Matrix4,ra=new THREE.Matrix4,O=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],I=new THREE.Vector4,T=new THREE.Vector4;this.computeFrustum=function(a){O[0].set(a.n41-a.n11,a.n42-a.n12,a.n43-a.n13,a.n44-a.n14);O[1].set(a.n41+a.n11,a.n42+a.n12,a.n43+a.n13,a.n44+a.n14);O[2].set(a.n41+a.n21,a.n42+a.n22,a.n43+a.n23,a.n44+a.n24);O[3].set(a.n41-a.n21,a.n42-a.n22,a.n43-a.n23,a.n44-a.n24);
|
|
O[4].set(a.n41-a.n31,a.n42-a.n32,a.n43-a.n33,a.n44-a.n34);O[5].set(a.n41+a.n31,a.n42+a.n32,a.n43+a.n33,a.n44+a.n34);for(a=0;a<6;a++){var b=O[a];b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}};this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);ia.multiply(b.projectionMatrix,b.matrixWorldInverse);ia.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);ia.multiply(b.matrixWorld,b.projectionMatrixInverse);
|
|
O[4].set(a.n41-a.n31,a.n42-a.n32,a.n43-a.n33,a.n44-a.n34);O[5].set(a.n41+a.n31,a.n42+a.n32,a.n43+a.n33,a.n44+a.n34);for(a=0;a<6;a++){var b=O[a];b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}};this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);ia.multiply(b.projectionMatrix,b.matrixWorldInverse);ia.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);ia.multiply(b.matrixWorld,b.projectionMatrixInverse);
|
|
-ia.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.projectGraph=function(a){E.objects.length=0;E.sprites.length=0;E.lights.length=0;var b=function(a){if(a.visible!=!1){var c;if(c=a instanceof THREE.Mesh)if(!(c=a.frustumCulled==!1))a:{for(var e=a.matrixWorld,f=-a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)),
|
|
|
|
-h=0;h<6;h++)if(c=O[h].x*e.n14+O[h].y*e.n24+O[h].z*e.n34+O[h].w,c<=f){c=!1;break a}c=!0}c?E.objects.push(a):a instanceof THREE.Line?E.objects.push(a):a instanceof THREE.Sprite||a instanceof THREE.Particle?E.sprites.push(a):a instanceof THREE.Light&&E.lights.push(a);c=0;for(e=a.children.length;c<e;c++)b(a.children[c])}};b(a);return E};this.projectScene=function(O,U,ma){var pa=U.near,X=U.far,R,K,A,d,C,S,W,Q,N,Aa,va,Ga,Ka,wa,Ba,ya;B=r=l=j=0;E.elements.length=0;U.parent==null&&(console.warn("Camera is not on the Scene. Adding it..."),
|
|
|
|
-O.add(U));O.updateMatrixWorld();U.matrixWorldInverse.getInverse(U.matrixWorld);ia.multiply(U.projectionMatrix,U.matrixWorldInverse);this.computeFrustum(ia);E=this.projectGraph(O);O=0;for(R=E.objects.length;O<R;O++)if(N=E.objects[O],Aa=N.matrixWorld,Ga=N.material,h=0,N instanceof THREE.Mesh){va=N.geometry;Ka=N.geometry.materials;d=va.vertices;wa=va.faces;Ba=va.faceVertexUvs;va=N.matrixRotationWorld.extractRotation(Aa);K=0;for(A=d.length;K<A;K++)e=a(),e.positionWorld.copy(d[K].position),Aa.multiplyVector3(e.positionWorld),
|
|
|
|
-e.positionScreen.copy(e.positionWorld),ia.multiplyVector4(e.positionScreen),e.positionScreen.x/=e.positionScreen.w,e.positionScreen.y/=e.positionScreen.w,e.visible=e.positionScreen.z>pa&&e.positionScreen.z<X;d=0;for(K=wa.length;d<K;d++){A=wa[d];if(A instanceof THREE.Face3)if(C=f[A.a],S=f[A.b],W=f[A.c],C.visible&&S.visible&&W.visible&&(N.doubleSided||N.flipSided!=(W.positionScreen.x-C.positionScreen.x)*(S.positionScreen.y-C.positionScreen.y)-(W.positionScreen.y-C.positionScreen.y)*(S.positionScreen.x-
|
|
|
|
-C.positionScreen.x)<0))Q=n[j]=n[j]||new THREE.RenderableFace3,j++,i=Q,i.v1.copy(C),i.v2.copy(S),i.v3.copy(W);else continue;else if(A instanceof THREE.Face4)if(C=f[A.a],S=f[A.b],W=f[A.c],Q=f[A.d],C.visible&&S.visible&&W.visible&&Q.visible&&(N.doubleSided||N.flipSided!=((Q.positionScreen.x-C.positionScreen.x)*(S.positionScreen.y-C.positionScreen.y)-(Q.positionScreen.y-C.positionScreen.y)*(S.positionScreen.x-C.positionScreen.x)<0||(S.positionScreen.x-W.positionScreen.x)*(Q.positionScreen.y-W.positionScreen.y)-
|
|
|
|
|
|
+ia.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.projectGraph=function(a){E.objects.length=0;E.sprites.length=0;E.lights.length=0;var b=function(a){if(a.visible!=!1){var c;if(c=a instanceof THREE.Mesh)if(!(c=a.frustumCulled==!1))a:{for(var e=a.matrixWorld,h=-a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)),
|
|
|
|
+f=0;f<6;f++)if(c=O[f].x*e.n14+O[f].y*e.n24+O[f].z*e.n34+O[f].w,c<=h){c=!1;break a}c=!0}c?E.objects.push(a):a instanceof THREE.Line?E.objects.push(a):a instanceof THREE.Sprite||a instanceof THREE.Particle?E.sprites.push(a):a instanceof THREE.Light&&E.lights.push(a);c=0;for(e=a.children.length;c<e;c++)b(a.children[c])}};b(a);return E};this.projectScene=function(O,U,ma){var pa=U.near,X=U.far,R,K,A,d,C,S,W,Q,N,Aa,va,Ga,Ka,wa,Ba,ya;B=r=l=j=0;E.elements.length=0;U.parent==null&&(console.warn("Camera is not on the Scene. Adding it..."),
|
|
|
|
+O.add(U));O.updateMatrixWorld();U.matrixWorldInverse.getInverse(U.matrixWorld);ia.multiply(U.projectionMatrix,U.matrixWorldInverse);this.computeFrustum(ia);E=this.projectGraph(O);O=0;for(R=E.objects.length;O<R;O++)if(N=E.objects[O],Aa=N.matrixWorld,Ga=N.material,f=0,N instanceof THREE.Mesh){va=N.geometry;Ka=N.geometry.materials;d=va.vertices;wa=va.faces;Ba=va.faceVertexUvs;va=N.matrixRotationWorld.extractRotation(Aa);K=0;for(A=d.length;K<A;K++)e=a(),e.positionWorld.copy(d[K].position),Aa.multiplyVector3(e.positionWorld),
|
|
|
|
+e.positionScreen.copy(e.positionWorld),ia.multiplyVector4(e.positionScreen),e.positionScreen.x/=e.positionScreen.w,e.positionScreen.y/=e.positionScreen.w,e.visible=e.positionScreen.z>pa&&e.positionScreen.z<X;d=0;for(K=wa.length;d<K;d++){A=wa[d];if(A instanceof THREE.Face3)if(C=h[A.a],S=h[A.b],W=h[A.c],C.visible&&S.visible&&W.visible&&(N.doubleSided||N.flipSided!=(W.positionScreen.x-C.positionScreen.x)*(S.positionScreen.y-C.positionScreen.y)-(W.positionScreen.y-C.positionScreen.y)*(S.positionScreen.x-
|
|
|
|
+C.positionScreen.x)<0))Q=n[j]=n[j]||new THREE.RenderableFace3,j++,i=Q,i.v1.copy(C),i.v2.copy(S),i.v3.copy(W);else continue;else if(A instanceof THREE.Face4)if(C=h[A.a],S=h[A.b],W=h[A.c],Q=h[A.d],C.visible&&S.visible&&W.visible&&Q.visible&&(N.doubleSided||N.flipSided!=((Q.positionScreen.x-C.positionScreen.x)*(S.positionScreen.y-C.positionScreen.y)-(Q.positionScreen.y-C.positionScreen.y)*(S.positionScreen.x-C.positionScreen.x)<0||(S.positionScreen.x-W.positionScreen.x)*(Q.positionScreen.y-W.positionScreen.y)-
|
|
(S.positionScreen.y-W.positionScreen.y)*(Q.positionScreen.x-W.positionScreen.x)<0)))ya=o[l]=o[l]||new THREE.RenderableFace4,l++,i=ya,i.v1.copy(C),i.v2.copy(S),i.v3.copy(W),i.v4.copy(Q);else continue;i.normalWorld.copy(A.normal);va.multiplyVector3(i.normalWorld);i.centroidWorld.copy(A.centroid);Aa.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);ia.multiplyVector3(i.centroidScreen);W=A.vertexNormals;C=0;for(S=W.length;C<S;C++)Q=i.vertexNormalsWorld[C],Q.copy(W[C]),va.multiplyVector3(Q);
|
|
(S.positionScreen.y-W.positionScreen.y)*(Q.positionScreen.x-W.positionScreen.x)<0)))ya=o[l]=o[l]||new THREE.RenderableFace4,l++,i=ya,i.v1.copy(C),i.v2.copy(S),i.v3.copy(W),i.v4.copy(Q);else continue;i.normalWorld.copy(A.normal);va.multiplyVector3(i.normalWorld);i.centroidWorld.copy(A.centroid);Aa.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);ia.multiplyVector3(i.centroidScreen);W=A.vertexNormals;C=0;for(S=W.length;C<S;C++)Q=i.vertexNormalsWorld[C],Q.copy(W[C]),va.multiplyVector3(Q);
|
|
-C=0;for(S=Ba.length;C<S;C++)if(ya=Ba[C][d]){W=0;for(Q=ya.length;W<Q;W++)i.uvs[C][W]=ya[W]}i.material=Ga;i.faceMaterial=A.materialIndex!==null?Ka[A.materialIndex]:null;i.z=i.centroidScreen.z;E.elements.push(i)}}else if(N instanceof THREE.Line){ra.multiply(ia,Aa);d=N.geometry.vertices;C=a();C.positionScreen.copy(d[0].position);ra.multiplyVector4(C.positionScreen);K=1;for(A=d.length;K<A;K++)if(C=a(),C.positionScreen.copy(d[K].position),ra.multiplyVector4(C.positionScreen),S=f[h-2],I.copy(C.positionScreen),
|
|
|
|
|
|
+C=0;for(S=Ba.length;C<S;C++)if(ya=Ba[C][d]){W=0;for(Q=ya.length;W<Q;W++)i.uvs[C][W]=ya[W]}i.material=Ga;i.faceMaterial=A.materialIndex!==null?Ka[A.materialIndex]:null;i.z=i.centroidScreen.z;E.elements.push(i)}}else if(N instanceof THREE.Line){ra.multiply(ia,Aa);d=N.geometry.vertices;C=a();C.positionScreen.copy(d[0].position);ra.multiplyVector4(C.positionScreen);K=1;for(A=d.length;K<A;K++)if(C=a(),C.positionScreen.copy(d[K].position),ra.multiplyVector4(C.positionScreen),S=h[f-2],I.copy(C.positionScreen),
|
|
T.copy(S.positionScreen),c(I,T))I.multiplyScalar(1/I.w),T.multiplyScalar(1/T.w),N=v[r]=v[r]||new THREE.RenderableLine,r++,k=N,k.v1.positionScreen.copy(I),k.v2.positionScreen.copy(T),k.z=Math.max(I.z,T.z),k.material=Ga,E.elements.push(k)}O=0;for(R=E.sprites.length;O<R;O++)if(N=E.sprites[O],Aa=N.matrixWorld,N instanceof THREE.Particle&&(fa.set(Aa.n14,Aa.n24,Aa.n34,1),ia.multiplyVector4(fa),fa.z/=fa.w,fa.z>0&&fa.z<1))pa=F[B]=F[B]||new THREE.RenderableParticle,B++,z=pa,z.x=fa.x/fa.w,z.y=fa.y/fa.w,z.z=
|
|
T.copy(S.positionScreen),c(I,T))I.multiplyScalar(1/I.w),T.multiplyScalar(1/T.w),N=v[r]=v[r]||new THREE.RenderableLine,r++,k=N,k.v1.positionScreen.copy(I),k.v2.positionScreen.copy(T),k.z=Math.max(I.z,T.z),k.material=Ga,E.elements.push(k)}O=0;for(R=E.sprites.length;O<R;O++)if(N=E.sprites[O],Aa=N.matrixWorld,N instanceof THREE.Particle&&(fa.set(Aa.n14,Aa.n24,Aa.n34,1),ia.multiplyVector4(fa),fa.z/=fa.w,fa.z>0&&fa.z<1))pa=F[B]=F[B]||new THREE.RenderableParticle,B++,z=pa,z.x=fa.x/fa.w,z.y=fa.y/fa.w,z.z=
|
|
fa.z,z.rotation=N.rotation.z,z.scale.x=N.scale.x*Math.abs(z.x-(fa.x+U.projectionMatrix.n11)/(fa.w+U.projectionMatrix.n14)),z.scale.y=N.scale.y*Math.abs(z.y-(fa.y+U.projectionMatrix.n22)/(fa.w+U.projectionMatrix.n24)),z.material=N.material,E.elements.push(z);ma&&E.elements.sort(b);return E}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)};
|
|
fa.z,z.rotation=N.rotation.z,z.scale.x=N.scale.x*Math.abs(z.x-(fa.x+U.projectionMatrix.n11)/(fa.w+U.projectionMatrix.n14)),z.scale.y=N.scale.y*Math.abs(z.y-(fa.y+U.projectionMatrix.n22)/(fa.w+U.projectionMatrix.n24)),z.material=N.material,E.elements.push(z);ma&&E.elements.sort(b);return E}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)};
|
|
-THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,h=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-h),h=Math.sin(-h),f=Math.cos(c),c=Math.sin(c),i=a*b,j=e*h;this.w=i*f-j*c;this.x=i*c+j*f;this.y=e*b*f+a*h*c;this.z=a*h*f-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c);
|
|
|
|
|
|
+THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),h=Math.cos(c),c=Math.sin(c),i=a*b,j=e*f;this.w=i*h-j*c;this.x=i*c+j*h;this.y=e*b*h+a*f*c;this.z=a*f*h-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c);
|
|
this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
|
|
this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
|
|
this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a===0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=
|
|
this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a===0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=
|
|
-this.x,c=this.y,e=this.z,h=this.w,f=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+h*f+c*j-e*i;this.y=c*a+h*i+e*f-b*j;this.z=e*a+h*j+b*i-c*f;this.w=h*a-b*f-c*i-e*j;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},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,h=a.z,f=this.x,i=this.y,j=this.z,n=this.w,l=n*c+i*h-j*e,o=n*e+j*c-f*h,k=n*h+f*e-i*c,c=-f*
|
|
|
|
-c-i*e-j*h;b.x=l*n+c*-f+o*-j-k*-i;b.y=o*n+c*-i+k*-f-l*-j;b.z=k*n+c*-j+l*-i-o*-f;return b}};
|
|
|
|
-THREE.Quaternion.slerp=function(a,b,c,e){var h=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;h<0?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,h=-h):c.copy(b);if(Math.abs(h)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var f=Math.acos(h),h=Math.sqrt(1-h*h);if(Math.abs(h)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-e)*f)/h;e=Math.sin(e*f)/h;c.w=a.w*b+c.w*e;c.x=a.x*b+c.x*e;c.y=a.y*b+c.y*e;c.z=a.z*b+c.z*e;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
|
|
|
|
-THREE.Face3=function(a,b,c,e,h,f){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
|
|
|
|
-THREE.Face4=function(a,b,c,e,h,f,i){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=i;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
|
|
|
|
|
|
+this.x,c=this.y,e=this.z,f=this.w,h=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+f*h+c*j-e*i;this.y=c*a+f*i+e*h-b*j;this.z=e*a+f*j+b*i-c*h;this.w=f*a-b*h-c*i-e*j;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},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,h=this.x,i=this.y,j=this.z,n=this.w,l=n*c+i*f-j*e,o=n*e+j*c-h*f,k=n*f+h*e-i*c,c=-h*
|
|
|
|
+c-i*e-j*f;b.x=l*n+c*-h+o*-j-k*-i;b.y=o*n+c*-i+k*-h-l*-j;b.z=k*n+c*-j+l*-i-o*-h;return b}};
|
|
|
|
+THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;f<0?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,f=-f):c.copy(b);if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),f=Math.sqrt(1-f*f);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-e)*h)/f;e=Math.sin(e*h)/f;c.w=a.w*b+c.w*e;c.x=a.x*b+c.x*e;c.y=a.y*b+c.y*e;c.z=a.z*b+c.z*e;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
|
|
|
|
+THREE.Face3=function(a,b,c,e,f,h){this.a=a;this.b=b;this.c=c;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};
|
|
|
|
+THREE.Face4=function(a,b,c,e,f,h,i){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materialIndex=i;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
|
|
THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
|
|
THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
|
|
THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
|
|
THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
|
|
-THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c<e;c++)a.multiplyVector3(this.vertices[c].position);c=0;for(e=this.faces.length;c<e;c++){var h=this.faces[c];b.multiplyVector3(h.normal);for(var f=0,i=h.vertexNormals.length;f<i;f++)b.multiplyVector3(h.vertexNormals[f]);a.multiplyVector3(h.centroid)}},computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;a<
|
|
|
|
|
|
+THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c<e;c++)a.multiplyVector3(this.vertices[c].position);c=0;for(e=this.faces.length;c<e;c++){var f=this.faces[c];b.multiplyVector3(f.normal);for(var h=0,i=f.vertexNormals.length;h<i;h++)b.multiplyVector3(f.vertexNormals[h]);a.multiplyVector3(f.centroid)}},computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;a<
|
|
b;a++)c=this.faces[a],c.centroid.set(0,0,0),c instanceof THREE.Face3?(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.divideScalar(3)):c instanceof THREE.Face4&&(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.addSelf(this.vertices[c.d].position),c.centroid.divideScalar(4))},computeFaceNormals:function(a){var b,
|
|
b;a++)c=this.faces[a],c.centroid.set(0,0,0),c instanceof THREE.Face3?(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.divideScalar(3)):c instanceof THREE.Face4&&(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.addSelf(this.vertices[c.d].position),c.centroid.divideScalar(4))},computeFaceNormals:function(a){var b,
|
|
-c,e,h,f,i,j=new THREE.Vector3,n=new THREE.Vector3;e=0;for(h=this.faces.length;e<h;e++){f=this.faces[e];if(a&&f.vertexNormals.length){j.set(0,0,0);b=0;for(c=f.vertexNormals.length;b<c;b++)j.addSelf(f.vertexNormals[b]);j.divideScalar(3)}else b=this.vertices[f.a],c=this.vertices[f.b],i=this.vertices[f.c],j.sub(i.position,c.position),n.sub(b.position,c.position),j.crossSelf(n);j.isZero()||j.normalize();f.normal.copy(j)}},computeVertexNormals:function(){var a,b,c,e;if(this.__tmpVertices===void 0){e=this.__tmpVertices=
|
|
|
|
|
|
+c,e,f,h,i,j=new THREE.Vector3,n=new THREE.Vector3;e=0;for(f=this.faces.length;e<f;e++){h=this.faces[e];if(a&&h.vertexNormals.length){j.set(0,0,0);b=0;for(c=h.vertexNormals.length;b<c;b++)j.addSelf(h.vertexNormals[b]);j.divideScalar(3)}else b=this.vertices[h.a],c=this.vertices[h.b],i=this.vertices[h.c],j.sub(i.position,c.position),n.sub(b.position,c.position),j.crossSelf(n);j.isZero()||j.normalize();h.normal.copy(j)}},computeVertexNormals:function(){var a,b,c,e;if(this.__tmpVertices===void 0){e=this.__tmpVertices=
|
|
Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)e[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)if(c=this.faces[a],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{e=this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)e[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof
|
|
Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)e[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)if(c=this.faces[a],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{e=this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)e[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof
|
|
THREE.Face3?(e[c.a].addSelf(c.normal),e[c.b].addSelf(c.normal),e[c.c].addSelf(c.normal)):c instanceof THREE.Face4&&(e[c.a].addSelf(c.normal),e[c.b].addSelf(c.normal),e[c.c].addSelf(c.normal),e[c.d].addSelf(c.normal));a=0;for(b=this.vertices.length;a<b;a++)e[a].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(c.vertexNormals[0].copy(e[c.a]),c.vertexNormals[1].copy(e[c.b]),c.vertexNormals[2].copy(e[c.c])):c instanceof THREE.Face4&&(c.vertexNormals[0].copy(e[c.a]),
|
|
THREE.Face3?(e[c.a].addSelf(c.normal),e[c.b].addSelf(c.normal),e[c.c].addSelf(c.normal)):c instanceof THREE.Face4&&(e[c.a].addSelf(c.normal),e[c.b].addSelf(c.normal),e[c.c].addSelf(c.normal),e[c.d].addSelf(c.normal));a=0;for(b=this.vertices.length;a<b;a++)e[a].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(c.vertexNormals[0].copy(e[c.a]),c.vertexNormals[1].copy(e[c.b]),c.vertexNormals[2].copy(e[c.c])):c instanceof THREE.Face4&&(c.vertexNormals[0].copy(e[c.a]),
|
|
-c.vertexNormals[1].copy(e[c.b]),c.vertexNormals[2].copy(e[c.c]),c.vertexNormals[3].copy(e[c.d]))},computeTangents:function(){function a(a,d,b,c,e,f,h){j=a.vertices[d].position;n=a.vertices[b].position;l=a.vertices[c].position;o=i[e];k=i[f];r=i[h];v=n.x-j.x;z=l.x-j.x;B=n.y-j.y;F=l.y-j.y;E=n.z-j.z;fa=l.z-j.z;ia=k.u-o.u;ra=r.u-o.u;O=k.v-o.v;I=r.v-o.v;T=1/(ia*I-ra*O);pa.set((I*v-O*z)*T,(I*B-O*F)*T,(I*E-O*fa)*T);X.set((ia*z-ra*v)*T,(ia*F-ra*B)*T,(ia*fa-ra*E)*T);U[d].addSelf(pa);U[b].addSelf(pa);U[c].addSelf(pa);
|
|
|
|
-ma[d].addSelf(X);ma[b].addSelf(X);ma[c].addSelf(X)}var b,c,e,h,f,i,j,n,l,o,k,r,v,z,B,F,E,fa,ia,ra,O,I,T,ta,U=[],ma=[],pa=new THREE.Vector3,X=new THREE.Vector3,R=new THREE.Vector3,K=new THREE.Vector3,A=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)U[b]=new THREE.Vector3,ma[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)f=this.faces[b],i=this.faceVertexUvs[0][b],f instanceof THREE.Face3?a(this,f.a,f.b,f.c,0,1,2):f instanceof THREE.Face4&&(a(this,f.a,f.b,f.c,0,1,2),a(this,f.a,f.b,
|
|
|
|
-f.d,0,1,3));var d=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){f=this.faces[b];for(e=0;e<f.vertexNormals.length;e++)A.copy(f.vertexNormals[e]),h=f[d[e]],ta=U[h],R.copy(ta),R.subSelf(A.multiplyScalar(A.dot(ta))).normalize(),K.cross(f.vertexNormals[e],ta),h=K.dot(ma[h]),h=h<0?-1:1,f.vertexTangents[e]=new THREE.Vector4(R.x,R.y,R.z,h)}this.hasTangents=!0},computeBoundingBox:function(){var a;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],
|
|
|
|
|
|
+c.vertexNormals[1].copy(e[c.b]),c.vertexNormals[2].copy(e[c.c]),c.vertexNormals[3].copy(e[c.d]))},computeTangents:function(){function a(a,d,b,c,e,h,f){j=a.vertices[d].position;n=a.vertices[b].position;l=a.vertices[c].position;o=i[e];k=i[h];r=i[f];v=n.x-j.x;z=l.x-j.x;B=n.y-j.y;F=l.y-j.y;E=n.z-j.z;fa=l.z-j.z;ia=k.u-o.u;ra=r.u-o.u;O=k.v-o.v;I=r.v-o.v;T=1/(ia*I-ra*O);pa.set((I*v-O*z)*T,(I*B-O*F)*T,(I*E-O*fa)*T);X.set((ia*z-ra*v)*T,(ia*F-ra*B)*T,(ia*fa-ra*E)*T);U[d].addSelf(pa);U[b].addSelf(pa);U[c].addSelf(pa);
|
|
|
|
+ma[d].addSelf(X);ma[b].addSelf(X);ma[c].addSelf(X)}var b,c,e,f,h,i,j,n,l,o,k,r,v,z,B,F,E,fa,ia,ra,O,I,T,ta,U=[],ma=[],pa=new THREE.Vector3,X=new THREE.Vector3,R=new THREE.Vector3,K=new THREE.Vector3,A=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)U[b]=new THREE.Vector3,ma[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)h=this.faces[b],i=this.faceVertexUvs[0][b],h instanceof THREE.Face3?a(this,h.a,h.b,h.c,0,1,2):h instanceof THREE.Face4&&(a(this,h.a,h.b,h.c,0,1,2),a(this,h.a,h.b,
|
|
|
|
+h.d,0,1,3));var d=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){h=this.faces[b];for(e=0;e<h.vertexNormals.length;e++)A.copy(h.vertexNormals[e]),f=h[d[e]],ta=U[f],R.copy(ta),R.subSelf(A.multiplyScalar(A.dot(ta))).normalize(),K.cross(h.vertexNormals[e],ta),f=K.dot(ma[f]),f=f<0?-1:1,h.vertexTangents[e]=new THREE.Vector4(R.x,R.y,R.z,f)}this.hasTangents=!0},computeBoundingBox:function(){var a;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],
|
|
y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;b<c;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<
|
|
y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;b<c;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<
|
|
-this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},mergeVertices:function(){var a={},b=[],c=[],e,h=Math.pow(10,4),f,i;f=0;for(i=this.vertices.length;f<i;f++)e=this.vertices[f].position,e=[Math.round(e.x*h),Math.round(e.y*h),Math.round(e.z*h)].join("_"),
|
|
|
|
-a[e]===void 0?(a[e]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[e]];f=0;for(i=this.faces.length;f<i;f++)if(a=this.faces[f],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];this.vertices=b}};THREE.GeometryCount=0;
|
|
|
|
-THREE.Spline=function(a){function b(a,b,c,e,f,h,i){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*i+(-3*(b-c)-2*a-e)*h+a*f+b}this.points=a;var c=[],e={x:0,y:0,z:0},h,f,i,j,n,l,o,k,r;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){h=(this.points.length-1)*a;f=Math.floor(h);i=h-f;c[0]=f===0?f:f-1;c[1]=f;c[2]=f>this.points.length-2?f:f+1;c[3]=f>this.points.length-3?f:f+2;l=this.points[c[0]];o=this.points[c[1]];
|
|
|
|
-k=this.points[c[2]];r=this.points[c[3]];j=i*i;n=i*j;e.x=b(l.x,o.x,k.x,r.x,i,j,n);e.y=b(l.y,o.y,k.y,r.y,i,j,n);e.z=b(l.z,o.z,k.z,r.z,i,j,n);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;a<c;a++)b=this.points[a],e[a]=[b.x,b.y,b.z];return e};this.getLength=function(a){var b,c,e=b=b=0,f=new THREE.Vector3,h=new THREE.Vector3,i=[],j=0;i[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=a/c,position=this.getPoint(b),h.copy(position),
|
|
|
|
-j+=h.distanceTo(f),f.copy(position),b*=this.points.length-1,b=Math.floor(b),b!=e&&(i[b]=j,e=b);i[i.length]=j;return{chunks:i,total:j}};this.reparametrizeByArcLength=function(a){var b,c,e,f,h,i,j=[],o=new THREE.Vector3,n=this.getLength();j.push(o.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=n.chunks[b]-n.chunks[b-1];i=Math.ceil(a*c/n.total);f=(b-1)/(this.points.length-1);h=b/(this.points.length-1);for(c=1;c<i-1;c++)e=f+c*(1/i)*(h-f),position=this.getPoint(e),j.push(o.copy(position).clone());
|
|
|
|
|
|
+this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},mergeVertices:function(){var a={},b=[],c=[],e,f=Math.pow(10,4),h,i;h=0;for(i=this.vertices.length;h<i;h++)e=this.vertices[h].position,e=[Math.round(e.x*f),Math.round(e.y*f),Math.round(e.z*f)].join("_"),
|
|
|
|
+a[e]===void 0?(a[e]=h,b.push(this.vertices[h]),c[h]=b.length-1):c[h]=c[a[e]];h=0;for(i=this.faces.length;h<i;h++)if(a=this.faces[h],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];this.vertices=b}};THREE.GeometryCount=0;
|
|
|
|
+THREE.Spline=function(a){function b(a,b,c,e,h,f,i){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*i+(-3*(b-c)-2*a-e)*f+a*h+b}this.points=a;var c=[],e={x:0,y:0,z:0},f,h,i,j,n,l,o,k,r;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){f=(this.points.length-1)*a;h=Math.floor(f);i=f-h;c[0]=h===0?h:h-1;c[1]=h;c[2]=h>this.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;l=this.points[c[0]];o=this.points[c[1]];
|
|
|
|
+k=this.points[c[2]];r=this.points[c[3]];j=i*i;n=i*j;e.x=b(l.x,o.x,k.x,r.x,i,j,n);e.y=b(l.y,o.y,k.y,r.y,i,j,n);e.z=b(l.z,o.z,k.z,r.z,i,j,n);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;a<c;a++)b=this.points[a],e[a]=[b.x,b.y,b.z];return e};this.getLength=function(a){var b,c,e=b=b=0,h=new THREE.Vector3,f=new THREE.Vector3,i=[],j=0;i[0]=0;a||(a=100);c=this.points.length*a;h.copy(this.points[0]);for(a=1;a<c;a++)b=a/c,position=this.getPoint(b),f.copy(position),
|
|
|
|
+j+=f.distanceTo(h),h.copy(position),b*=this.points.length-1,b=Math.floor(b),b!=e&&(i[b]=j,e=b);i[i.length]=j;return{chunks:i,total:j}};this.reparametrizeByArcLength=function(a){var b,c,e,h,f,i,j=[],o=new THREE.Vector3,n=this.getLength();j.push(o.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=n.chunks[b]-n.chunks[b-1];i=Math.ceil(a*c/n.total);h=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<i-1;c++)e=h+c*(1/i)*(f-h),position=this.getPoint(e),j.push(o.copy(position).clone());
|
|
j.push(o.copy(this.points[b]).clone())}this.points=j}};THREE.Edge=function(a,b,c,e){this.vertices=[a,b];this.vertexIndices=[c,e];this.faces=[];this.faceIndices=[]};
|
|
j.push(o.copy(this.points[b]).clone())}this.points=j}};THREE.Edge=function(a,b,c,e){this.vertices=[a,b];this.vertexIndices=[c,e];this.faces=[];this.faceIndices=[]};
|
|
THREE.Camera=function(){if(arguments.length)return console.warn("DEPRECATED: Camera() is now PerspectiveCamera() or OrthographicCamera()."),new THREE.PerspectiveCamera(arguments[0],arguments[1],arguments[2],arguments[3]);THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;
|
|
THREE.Camera=function(){if(arguments.length)return console.warn("DEPRECATED: Camera() is now PerspectiveCamera() or OrthographicCamera()."),new THREE.PerspectiveCamera(arguments[0],arguments[1],arguments[2],arguments[3]);THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;
|
|
-THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};THREE.OrthographicCamera=function(a,b,c,e,h,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=e;this.near=h!==void 0?h:0.1;this.far=f!==void 0?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;
|
|
|
|
|
|
+THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};THREE.OrthographicCamera=function(a,b,c,e,f,h){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=e;this.near=f!==void 0?f:0.1;this.far=h!==void 0?h:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;
|
|
THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,e){THREE.Camera.call(this);this.fov=a!==void 0?a:50;this.aspect=b!==void 0?b:1;this.near=c!==void 0?c:0.1;this.far=e!==void 0?e:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;
|
|
THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,e){THREE.Camera.call(this);this.fov=a!==void 0?a:50;this.aspect=b!==void 0?b:1;this.near=c!==void 0?c:0.1;this.far=e!==void 0?e:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;
|
|
-THREE.PerspectiveCamera.prototype.setLens=function(a,b){this.fov=2*Math.atan((b!==void 0?b:43.25)/(a*2));this.fov*=180/Math.PI;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,e,h,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=e;this.width=h;this.height=f;this.updateProjectionMatrix()};
|
|
|
|
|
|
+THREE.PerspectiveCamera.prototype.setLens=function(a,b){this.fov=2*Math.atan((b!==void 0?b:43.25)/(a*2));this.fov*=180/Math.PI;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,e,f,h){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=e;this.width=f;this.height=h;this.updateProjectionMatrix()};
|
|
THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,e=a*c,a=Math.abs(a*b-e),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(e+this.x*a/this.fullWidth,e+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,
|
|
THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,e=a*c,a=Math.abs(a*b-e),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(e+this.x*a/this.fullWidth,e+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,
|
|
this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;
|
|
this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;
|
|
THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=new THREE.Light;
|
|
THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=new THREE.Light;
|
|
@@ -116,24 +116,23 @@ THREE.MeshShaderMaterial=function(a){console.warn("DEPRECATED: MeshShaderMateria
|
|
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:!0;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.fog=a.fog!==void 0?a.fog:!0};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
|
|
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:!0;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.fog=a.fog!==void 0?a.fog:!0};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
|
|
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:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.fog=a.fog!==
|
|
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:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.fog=a.fog!==
|
|
void 0?a.fog:!1;this.lights=a.lights!==void 0?a.lights:!1;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};THREE.ShaderMaterial.prototype=new THREE.Material;THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial;
|
|
void 0?a.fog:!1;this.lights=a.lights!==void 0?a.lights:!1;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};THREE.ShaderMaterial.prototype=new THREE.Material;THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial;
|
|
-THREE.Texture=function(a,b,c,e,h,f){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=e!==void 0?e:THREE.ClampToEdgeWrapping;this.magFilter=h!==void 0?h:THREE.LinearFilter;this.minFilter=f!==void 0?f:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
|
|
|
|
|
|
+THREE.Texture=function(a,b,c,e,f,h){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=e!==void 0?e:THREE.ClampToEdgeWrapping;this.magFilter=f!==void 0?f:THREE.LinearFilter;this.minFilter=h!==void 0?h:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
|
|
THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
|
|
THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
|
|
THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;
|
|
THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;
|
|
-THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(a,b,c,e,h,f,i,j,n){THREE.Texture.call(this,null,h,f,i,j,n);this.image={data:a,width:b,height:c};this.format=e!==void 0?e:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
|
|
|
|
|
|
+THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(a,b,c,e,f,h,i,j,n){THREE.Texture.call(this,null,f,h,i,j,n);this.image={data:a,width:b,height:c};this.format=e!==void 0?e:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
|
|
THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};THREE.Particle=function(a){THREE.Object3D.call(this);this.material=a};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;THREE.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.sortParticles=!1};
|
|
THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};THREE.Particle=function(a){THREE.Object3D.call(this);this.material=a};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;THREE.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.sortParticles=!1};
|
|
THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.type=c!=void 0?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
|
|
THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.type=c!=void 0?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
|
|
THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b;if(b instanceof Array)console.warn("DEPRECATE: Material array is no longer supported. Using material 0..."),this.material=b[0];if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=a.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<
|
|
THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b;if(b instanceof Array)console.warn("DEPRECATE: Material array is no longer supported. Using material 0..."),this.material=b[0];if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=a.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<
|
|
this.geometry.morphTargets.length;c++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;
|
|
this.geometry.morphTargets.length;c++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;
|
|
-THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
|
|
|
|
-THREE.Bone.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;var e,h=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(e=0;e<h;e++)a=this.children[e],a instanceof THREE.Bone?a.update(this.skinMatrix,b,c):a.update(this.matrixWorld,!0,c)}else for(e=0;e<h;e++)this.children[e].update(this.skinMatrix,
|
|
|
|
-b,c)};THREE.Bone.prototype.add=function(a){if(this.children.indexOf(a)===-1&&(a.parent!==void 0&&a.parent.removeChild(a),a.parent=this,this.children.push(a),!(a instanceof THREE.Bone)))this.hasNoneBoneChildren=!0};
|
|
|
|
-THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var c,e,h,f,i,j;if(this.geometry.bones!==void 0){for(c=0;c<this.geometry.bones.length;c++)h=this.geometry.bones[c],f=h.pos,i=h.rotq,j=h.scl,e=this.addBone(),e.name=h.name,e.position.set(f[0],f[1],f[2]),e.quaternion.set(i[0],i[1],i[2],i[3]),e.useQuaternion=!0,j!==void 0?e.scale.set(j[0],j[1],j[2]):e.scale.set(1,1,1);for(c=0;c<this.bones.length;c++)h=this.geometry.bones[c],
|
|
|
|
-e=this.bones[c],h.parent===-1?this.add(e):this.bones[h.parent].add(e);this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;
|
|
|
|
-THREE.SkinnedMesh.prototype.update=function(a,b,c){if(this.visible){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;var e,h=this.children.length;for(e=0;e<h;e++)a=this.children[e],a instanceof THREE.Bone?a.update(this.identityMatrix,!1,c):a.update(this.matrixWorld,b,c);c=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(b=0;b<c;b++)ba[b].skinMatrix.flattenToArrayOffset(bm,
|
|
|
|
-b*16)}};THREE.SkinnedMesh.prototype.addBone=function(a){a===void 0&&(a=new THREE.Bone(this));this.bones.push(a);return a};
|
|
|
|
-THREE.SkinnedMesh.prototype.pose=function(){this.update(void 0,!0);for(var a,b=[],c=0;c<this.bones.length;c++)a=this.bones[c],b.push(THREE.Matrix4.makeInvert(a.skinMatrix)),a.skinMatrix.flattenToArrayOffset(this.boneMatrices,c*16);if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var e;for(a=0;a<this.geometry.skinIndices.length;a++){var c=this.geometry.vertices[a].position,h=this.geometry.skinIndices[a].x,f=this.geometry.skinIndices[a].y;e=new THREE.Vector3(c.x,
|
|
|
|
-c.y,c.z);this.geometry.skinVerticesA.push(b[h].multiplyVector3(e));e=new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesB.push(b[f].multiplyVector3(e));this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1&&(c=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5,this.geometry.skinWeights[a].x+=c,this.geometry.skinWeights[a].y+=c)}}};THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b};THREE.Ribbon.prototype=new THREE.Object3D;
|
|
|
|
-THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c<this.LODs.length;c++)if(b<this.LODs[c].visibleAtDistance)break;this.LODs.splice(c,0,{visibleAtDistance:b,object3D:a});this.add(a)};
|
|
|
|
|
|
+THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
|
|
|
|
+THREE.Bone.prototype.update=function(a,b){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;var c,e=this.children.length;for(c=0;c<e;c++)this.children[c].update(this.skinMatrix,b)};
|
|
|
|
+THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var c,e,f,h,i,j;if(this.geometry.bones!==void 0){for(c=0;c<this.geometry.bones.length;c++)f=this.geometry.bones[c],h=f.pos,i=f.rotq,j=f.scl,e=this.addBone(),e.name=f.name,e.position.set(h[0],h[1],h[2]),e.quaternion.set(i[0],i[1],i[2],i[3]),e.useQuaternion=!0,j!==void 0?e.scale.set(j[0],j[1],j[2]):e.scale.set(1,1,1);for(c=0;c<this.bones.length;c++)f=this.geometry.bones[c],
|
|
|
|
+e=this.bones[c],f.parent===-1?this.add(e):this.bones[f.parent].add(e);this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;THREE.SkinnedMesh.prototype.addBone=function(a){a===void 0&&(a=new THREE.Bone(this));this.bones.push(a);return a};
|
|
|
|
+THREE.SkinnedMesh.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1;for(var a=0,b=this.children.length;a<b;a++){var c=this.children[a];c instanceof THREE.Bone?c.update(this.identityMatrix,!1):c.updateMatrixWorld(!0)}b=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(a=0;a<b;a++)ba[a].skinMatrix.flattenToArrayOffset(bm,
|
|
|
|
+a*16)};
|
|
|
|
+THREE.SkinnedMesh.prototype.pose=function(){this.updateMatrixWorld(!0);for(var a,b=[],c=0;c<this.bones.length;c++){a=this.bones[c];var e=new THREE.Matrix4;e.getInverse(a.skinMatrix);b.push(e);a.skinMatrix.flattenToArrayOffset(this.boneMatrices,c*16)}if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];for(a=0;a<this.geometry.skinIndices.length;a++){var c=this.geometry.vertices[a].position,f=this.geometry.skinIndices[a].x,h=this.geometry.skinIndices[a].y,e=
|
|
|
|
+new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesA.push(b[f].multiplyVector3(e));e=new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesB.push(b[h].multiplyVector3(e));this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1&&(c=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5,this.geometry.skinWeights[a].x+=c,this.geometry.skinWeights[a].y+=c)}}};THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b};
|
|
|
|
+THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c<this.LODs.length;c++)if(b<this.LODs[c].visibleAtDistance)break;this.LODs.splice(c,0,{visibleAtDistance:b,object3D:a});this.add(a)};
|
|
THREE.LOD.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;if(this.LODs.length>1){a=c.matrixWorldInverse;a=-(a.n31*this.position.x+a.n32*this.position.y+a.n33*this.position.z+a.n34);this.LODs[0].object3D.visible=!0;for(var e=1;e<this.LODs.length;e++)if(a>=this.LODs[e].visibleAtDistance)this.LODs[e-1].object3D.visible=!1,
|
|
THREE.LOD.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;if(this.LODs.length>1){a=c.matrixWorldInverse;a=-(a.n31*this.position.x+a.n32*this.position.y+a.n33*this.position.z+a.n34);this.LODs[0].object3D.visible=!0;for(var e=1;e<this.LODs.length;e++)if(a>=this.LODs[e].visibleAtDistance)this.LODs[e-1].object3D.visible=!1,
|
|
this.LODs[e].object3D.visible=!0;else break;for(;e<this.LODs.length;e++)this.LODs[e].object3D.visible=!1}for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};
|
|
this.LODs[e].object3D.visible=!0;else break;for(;e<this.LODs.length;e++)this.LODs[e].object3D.visible=!1}for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};
|
|
THREE.Sprite=function(a){THREE.Object3D.call(this);this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map instanceof THREE.Texture?a.map:THREE.ImageUtils.loadTexture(a.map);this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.useScreenCoordinates=a.useScreenCoordinates!==void 0?a.useScreenCoordinates:!0;this.mergeWith3D=a.mergeWith3D!==void 0?a.mergeWith3D:!this.useScreenCoordinates;this.affectedByDistance=a.affectedByDistance!==void 0?a.affectedByDistance:
|
|
THREE.Sprite=function(a){THREE.Object3D.call(this);this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map instanceof THREE.Texture?a.map:THREE.ImageUtils.loadTexture(a.map);this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.useScreenCoordinates=a.useScreenCoordinates!==void 0?a.useScreenCoordinates:!0;this.mergeWith3D=a.mergeWith3D!==void 0?a.mergeWith3D:!this.useScreenCoordinates;this.affectedByDistance=a.affectedByDistance!==void 0?a.affectedByDistance:
|
|
@@ -157,7 +156,7 @@ morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\nuniform float morphTargetInflu
|
|
default_vertex:"#ifndef USE_MORPHTARGETS\n#ifndef USE_SKINNING\ngl_Position = projectionMatrix * mvPosition;\n#endif\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform float shadowDarkness;\nuniform float shadowBias;\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif",
|
|
default_vertex:"#ifndef USE_MORPHTARGETS\n#ifndef USE_SKINNING\ngl_Position = projectionMatrix * mvPosition;\n#endif\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform float shadowDarkness;\nuniform float shadowBias;\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif",
|
|
shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_SOFT\nconst float xPixelOffset = 1.0 / SHADOWMAP_WIDTH;\nconst float yPixelOffset = 1.0 / SHADOWMAP_HEIGHT;\n#endif\nvec3 shadowColor = vec3( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nshadowCoord.z += shadowBias;\nif ( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness * shadow ) );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec3( shadowDarkness );\n#endif\n}\n}\n#ifdef GAMMA_OUTPUT\nshadowColor *= shadowColor;\n#endif\ngl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\n#endif",
|
|
shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_SOFT\nconst float xPixelOffset = 1.0 / SHADOWMAP_WIDTH;\nconst float yPixelOffset = 1.0 / SHADOWMAP_HEIGHT;\n#endif\nvec3 shadowColor = vec3( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nshadowCoord.z += shadowBias;\nif ( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness * shadow ) );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec3( shadowDarkness );\n#endif\n}\n}\n#ifdef GAMMA_OUTPUT\nshadowColor *= shadowColor;\n#endif\ngl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\n#endif",
|
|
shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif",linear_to_gamma_fragment:"#ifdef GAMMA_OUTPUT\ngl_FragColor.xyz = sqrt( gl_FragColor.xyz );\n#endif"};
|
|
shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif",linear_to_gamma_fragment:"#ifdef GAMMA_OUTPUT\ngl_FragColor.xyz = sqrt( gl_FragColor.xyz );\n#endif"};
|
|
-THREE.UniformsUtils={merge:function(a){var b,c,e,h={};for(b=0;b<a.length;b++)for(c in e=this.clone(a[b]),e)h[c]=e[c];return h},clone:function(a){var b,c,e,h={};for(b in a)for(c in h[b]={},a[b])e=a[b][c],h[b][c]=e instanceof THREE.Color||e instanceof THREE.Vector2||e instanceof THREE.Vector3||e instanceof THREE.Vector4||e instanceof THREE.Matrix4||e instanceof THREE.Texture?e.clone():e instanceof Array?e.slice():e;return h}};
|
|
|
|
|
|
+THREE.UniformsUtils={merge:function(a){var b,c,e,f={};for(b=0;b<a.length;b++)for(c in e=this.clone(a[b]),e)f[c]=e[c];return f},clone:function(a){var b,c,e,f={};for(b in a)for(c in f[b]={},a[b])e=a[b][c],f[b][c]=e instanceof THREE.Color||e instanceof THREE.Vector2||e instanceof THREE.Vector3||e instanceof THREE.Vector4||e instanceof THREE.Matrix4||e instanceof THREE.Texture?e.clone():e instanceof Array?e.slice():e;return f}};
|
|
THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:0,texture:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:2,texture:null},envMap:{type:"t",value:1,texture:null},flipEnvMap:{type:"f",value:-1},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:0.98},combine:{type:"i",value:0},morphTargetInfluences:{type:"f",value:0}},fog:{fogDensity:{type:"f",
|
|
THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:0,texture:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:2,texture:null},envMap:{type:"t",value:1,texture:null},flipEnvMap:{type:"f",value:-1},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:0.98},combine:{type:"i",value:0},morphTargetInfluences:{type:"f",value:0}},fog:{fogDensity:{type:"f",
|
|
value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{enableLighting:{type:"i",value:1},ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",
|
|
value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{enableLighting:{type:"i",value:1},ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",
|
|
value:1},scale:{type:"f",value:1},map:{type:"t",value:0,texture:null},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:6,texture:[]},shadowMatrix:{type:"m4v",value:[]},shadowBias:{type:"f",value:0.0039},shadowDarkness:{type:"f",value:0.2}}};
|
|
value:1},scale:{type:"f",value:1},map:{type:"t",value:0,texture:null},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:6,texture:[]},shadowMatrix:{type:"m4v",value:[]},shadowBias:{type:"f",value:0.0039},shadowDarkness:{type:"f",value:0.2}}};
|
|
@@ -177,11 +176,11 @@ THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.lights_phong_fragment,THR
|
|
THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,
|
|
THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,
|
|
THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,
|
|
THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",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.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){if(a.material&&!(a.material instanceof THREE.MeshFaceMaterial))return a.material;else if(b.materialIndex>=0)return a.geometry.materials[b.materialIndex]}function c(a,b,c){var e,f,h,i=a.vertices,u=i.length,p=a.colors,q=p.length,j=a.__vertexArray,xa=a.__colorArray,za=a.__sortArray,P=a.__dirtyVertices,o=a.__dirtyColors,n=a.__webglCustomAttributesList,k;if(n){h=0;for(e=n.length;h<e;h++)n[h].offset=0}if(c.sortParticles){Ca.multiplySelf(c.matrixWorld);for(e=
|
|
|
|
-0;e<u;e++)f=i[e].position,Ha.copy(f),Ca.multiplyVector3(Ha),za[e]=[Ha.z,e];za.sort(function(a,b){return b[0]-a[0]});for(e=0;e<u;e++)f=i[za[e][1]].position,h=e*3,j[h]=f.x,j[h+1]=f.y,j[h+2]=f.z;for(e=0;e<q;e++)h=e*3,color=p[za[e][1]],xa[h]=color.r,xa[h+1]=color.g,xa[h+2]=color.b;if(n){h=0;for(e=n.length;h<e;h++){u=n[h];q=u.value.length;for(p=0;p<q;p++){index=za[p][1];i=u.offset;if(u.size===1){if(u.boundTo===void 0||u.boundTo==="vertices")u.array[i]=u.value[index]}else{if(u.boundTo===void 0||u.boundTo===
|
|
|
|
-"vertices")k=u.value[index];u.size===2?(u.array[i]=k.x,u.array[i+1]=k.y):u.size===3?u.type==="c"?(u.array[i]=k.r,u.array[i+1]=k.g,u.array[i+2]=k.b):(u.array[i]=k.x,u.array[i+1]=k.y,u.array[i+2]=k.z):(u.array[i]=k.x,u.array[i+1]=k.y,u.array[i+2]=k.z,u.array[i+3]=k.w)}u.offset+=u.size}}}}else{if(P)for(e=0;e<u;e++)f=i[e].position,h=e*3,j[h]=f.x,j[h+1]=f.y,j[h+2]=f.z;if(o)for(e=0;e<q;e++)color=p[e],h=e*3,xa[h]=color.r,xa[h+1]=color.g,xa[h+2]=color.b;if(n){h=0;for(e=n.length;h<e;h++)if(u=n[h],u.__original.needsUpdate){q=
|
|
|
|
|
|
+THREE.WebGLRenderer=function(a){function b(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMaterial))return a.material;else if(b.materialIndex>=0)return a.geometry.materials[b.materialIndex]}function c(a,b,c){var e,h,f,i=a.vertices,u=i.length,p=a.colors,q=p.length,j=a.__vertexArray,xa=a.__colorArray,za=a.__sortArray,P=a.__dirtyVertices,o=a.__dirtyColors,n=a.__webglCustomAttributesList,k;if(n){f=0;for(e=n.length;f<e;f++)n[f].offset=0}if(c.sortParticles){Ca.multiplySelf(c.matrixWorld);for(e=
|
|
|
|
+0;e<u;e++)h=i[e].position,Ha.copy(h),Ca.multiplyVector3(Ha),za[e]=[Ha.z,e];za.sort(function(a,b){return b[0]-a[0]});for(e=0;e<u;e++)h=i[za[e][1]].position,f=e*3,j[f]=h.x,j[f+1]=h.y,j[f+2]=h.z;for(e=0;e<q;e++)f=e*3,color=p[za[e][1]],xa[f]=color.r,xa[f+1]=color.g,xa[f+2]=color.b;if(n){f=0;for(e=n.length;f<e;f++){u=n[f];q=u.value.length;for(p=0;p<q;p++){index=za[p][1];i=u.offset;if(u.size===1){if(u.boundTo===void 0||u.boundTo==="vertices")u.array[i]=u.value[index]}else{if(u.boundTo===void 0||u.boundTo===
|
|
|
|
+"vertices")k=u.value[index];u.size===2?(u.array[i]=k.x,u.array[i+1]=k.y):u.size===3?u.type==="c"?(u.array[i]=k.r,u.array[i+1]=k.g,u.array[i+2]=k.b):(u.array[i]=k.x,u.array[i+1]=k.y,u.array[i+2]=k.z):(u.array[i]=k.x,u.array[i+1]=k.y,u.array[i+2]=k.z,u.array[i+3]=k.w)}u.offset+=u.size}}}}else{if(P)for(e=0;e<u;e++)h=i[e].position,f=e*3,j[f]=h.x,j[f+1]=h.y,j[f+2]=h.z;if(o)for(e=0;e<q;e++)color=p[e],f=e*3,xa[f]=color.r,xa[f+1]=color.g,xa[f+2]=color.b;if(n){f=0;for(e=n.length;f<e;f++)if(u=n[f],u.__original.needsUpdate){q=
|
|
u.value.length;for(p=0;p<q;p++){i=u.offset;if(u.size===1){if(u.boundTo===void 0||u.boundTo==="vertices")u.array[i]=u.value[p]}else{if(u.boundTo===void 0||u.boundTo==="vertices")k=u.value[p];u.size===2?(u.array[i]=k.x,u.array[i+1]=k.y):u.size===3?u.type==="c"?(u.array[i]=k.r,u.array[i+1]=k.g,u.array[i+2]=k.b):(u.array[i]=k.x,u.array[i+1]=k.y,u.array[i+2]=k.z):(u.array[i]=k.x,u.array[i+1]=k.y,u.array[i+2]=k.z,u.array[i+3]=k.w)}u.offset+=u.size}}}}if(P||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),
|
|
u.value.length;for(p=0;p<q;p++){i=u.offset;if(u.size===1){if(u.boundTo===void 0||u.boundTo==="vertices")u.array[i]=u.value[p]}else{if(u.boundTo===void 0||u.boundTo==="vertices")k=u.value[p];u.size===2?(u.array[i]=k.x,u.array[i+1]=k.y):u.size===3?u.type==="c"?(u.array[i]=k.r,u.array[i+1]=k.g,u.array[i+2]=k.b):(u.array[i]=k.x,u.array[i+1]=k.y,u.array[i+2]=k.z):(u.array[i]=k.x,u.array[i+1]=k.y,u.array[i+2]=k.z,u.array[i+3]=k.w)}u.offset+=u.size}}}}if(P||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),
|
|
-d.bufferData(d.ARRAY_BUFFER,j,b);if(o||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,a.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,xa,b);if(n){h=0;for(e=n.length;h<e;h++)if(u=n[h],u.__original.needsUpdate||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,u.buffer),d.bufferData(d.ARRAY_BUFFER,u.array,b)}}function e(a,b,c,e,h){e.program||A.initMaterial(e,b,c,h);if(e.morphTargets&&!h.__webglMorphTargetInfluences){h.__webglMorphTargetInfluences=new Float32Array(A.maxMorphTargets);for(var f=0,i=A.maxMorphTargets;f<
|
|
|
|
|
|
+d.bufferData(d.ARRAY_BUFFER,j,b);if(o||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,a.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,xa,b);if(n){f=0;for(e=n.length;f<e;f++)if(u=n[f],u.__original.needsUpdate||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,u.buffer),d.bufferData(d.ARRAY_BUFFER,u.array,b)}}function e(a,b,c,e,h){e.program||A.initMaterial(e,b,c,h);if(e.morphTargets&&!h.__webglMorphTargetInfluences){h.__webglMorphTargetInfluences=new Float32Array(A.maxMorphTargets);for(var f=0,i=A.maxMorphTargets;f<
|
|
i;f++)h.__webglMorphTargetInfluences[f]=0}var u=!1,f=e.program,i=f.uniforms,p=e.uniforms;f!==S&&(d.useProgram(f),S=f,u=!0);if(e.id!==Q)Q=e.id,u=!0;if(u){d.uniformMatrix4fv(i.projectionMatrix,!1,Ta);if(c&&e.fog)if(p.fogColor.value=c.color,c instanceof THREE.Fog)p.fogNear.value=c.near,p.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)p.fogDensity.value=c.density;if(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e.lights){for(var q,j,k=0,n=0,P=0,o,l,r,v=Za,y=v.directional.colors,
|
|
i;f++)h.__webglMorphTargetInfluences[f]=0}var u=!1,f=e.program,i=f.uniforms,p=e.uniforms;f!==S&&(d.useProgram(f),S=f,u=!0);if(e.id!==Q)Q=e.id,u=!0;if(u){d.uniformMatrix4fv(i.projectionMatrix,!1,Ta);if(c&&e.fog)if(p.fogColor.value=c.color,c instanceof THREE.Fog)p.fogNear.value=c.near,p.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)p.fogDensity.value=c.density;if(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e.lights){for(var q,j,k=0,n=0,P=0,o,l,r,v=Za,y=v.directional.colors,
|
|
t=v.directional.positions,z=v.point.colors,B=v.point.positions,C=v.point.distances,O=0,G=0,c=q=r=0,u=b.length;c<u;c++)if(q=b[c],j=q.color,o=q.position,l=q.intensity,r=q.distance,q instanceof THREE.AmbientLight)A.gammaInput?(k+=j.r*j.r,n+=j.g*j.g,P+=j.b*j.b):(k+=j.r,n+=j.g,P+=j.b);else if(q instanceof THREE.DirectionalLight)r=O*3,A.gammaInput?(y[r]=j.r*j.r*l*l,y[r+1]=j.g*j.g*l*l,y[r+2]=j.b*j.b*l*l):(y[r]=j.r*l,y[r+1]=j.g*l,y[r+2]=j.b*l),t[r]=o.x,t[r+1]=o.y,t[r+2]=o.z,O+=1;else if(q instanceof THREE.SpotLight)r=
|
|
t=v.directional.positions,z=v.point.colors,B=v.point.positions,C=v.point.distances,O=0,G=0,c=q=r=0,u=b.length;c<u;c++)if(q=b[c],j=q.color,o=q.position,l=q.intensity,r=q.distance,q instanceof THREE.AmbientLight)A.gammaInput?(k+=j.r*j.r,n+=j.g*j.g,P+=j.b*j.b):(k+=j.r,n+=j.g,P+=j.b);else if(q instanceof THREE.DirectionalLight)r=O*3,A.gammaInput?(y[r]=j.r*j.r*l*l,y[r+1]=j.g*j.g*l*l,y[r+2]=j.b*j.b*l*l):(y[r]=j.r*l,y[r+1]=j.g*l,y[r+2]=j.b*l),t[r]=o.x,t[r+1]=o.y,t[r+2]=o.z,O+=1;else if(q instanceof THREE.SpotLight)r=
|
|
O*3,A.gammaInput?(y[r]=j.r*j.r*l*l,y[r+1]=j.g*j.g*l*l,y[r+2]=j.b*j.b*l*l):(y[r]=j.r*l,y[r+1]=j.g*l,y[r+2]=j.b*l),j=1/o.length(),t[r]=o.x*j,t[r+1]=o.y*j,t[r+2]=o.z*j,O+=1;else if(q instanceof THREE.PointLight)q=G*3,A.gammaInput?(z[q]=j.r*j.r*l*l,z[q+1]=j.g*j.g*l*l,z[q+2]=j.b*j.b*l*l):(z[q]=j.r*l,z[q+1]=j.g*l,z[q+2]=j.b*l),B[q]=o.x,B[q+1]=o.y,B[q+2]=o.z,C[G]=r,G+=1;c=O*3;for(u=y.length;c<u;c++)y[c]=0;c=G*3;for(u=z.length;c<u;c++)z[c]=0;v.point.length=G;v.directional.length=O;v.ambient[0]=k;v.ambient[1]=
|
|
O*3,A.gammaInput?(y[r]=j.r*j.r*l*l,y[r+1]=j.g*j.g*l*l,y[r+2]=j.b*j.b*l*l):(y[r]=j.r*l,y[r+1]=j.g*l,y[r+2]=j.b*l),j=1/o.length(),t[r]=o.x*j,t[r+1]=o.y*j,t[r+2]=o.z*j,O+=1;else if(q instanceof THREE.PointLight)q=G*3,A.gammaInput?(z[q]=j.r*j.r*l*l,z[q+1]=j.g*j.g*l*l,z[q+2]=j.b*j.b*l*l):(z[q]=j.r*l,z[q+1]=j.g*l,z[q+2]=j.b*l),B[q]=o.x,B[q+1]=o.y,B[q+2]=o.z,C[G]=r,G+=1;c=O*3;for(u=y.length;c<u;c++)y[c]=0;c=G*3;for(u=z.length;c<u;c++)z[c]=0;v.point.length=G;v.directional.length=O;v.ambient[0]=k;v.ambient[1]=
|
|
@@ -193,7 +192,7 @@ b.length;p<c;p++)if(n=f.uniforms[b[p][1]])if(k=b[p][0],P=k.type,u=k.value,P==="i
|
|
1]=u[P].y,k._array[v+2]=u[P].z;d.uniform3fv(n,k._array)}else if(P==="m4"){if(!k._array)k._array=new Float32Array(16);u.flattenToArray(k._array);d.uniformMatrix4fv(n,!1,k._array)}else if(P==="m4v"){if(!k._array)k._array=new Float32Array(16*u.length);P=0;for(o=u.length;P<o;P++)u[P].flattenToArrayOffset(k._array,P*16);d.uniformMatrix4fv(n,!1,k._array)}else if(P==="t"){if(d.uniform1i(n,u),n=k.texture)if(n.image instanceof Array&&n.image.length===6){if(k=n,k.image.length===6)if(k.needsUpdate){if(!k.image.__webglTextureCube)k.image.__webglTextureCube=
|
|
1]=u[P].y,k._array[v+2]=u[P].z;d.uniform3fv(n,k._array)}else if(P==="m4"){if(!k._array)k._array=new Float32Array(16);u.flattenToArray(k._array);d.uniformMatrix4fv(n,!1,k._array)}else if(P==="m4v"){if(!k._array)k._array=new Float32Array(16*u.length);P=0;for(o=u.length;P<o;P++)u[P].flattenToArrayOffset(k._array,P*16);d.uniformMatrix4fv(n,!1,k._array)}else if(P==="t"){if(d.uniform1i(n,u),n=k.texture)if(n.image instanceof Array&&n.image.length===6){if(k=n,k.image.length===6)if(k.needsUpdate){if(!k.image.__webglTextureCube)k.image.__webglTextureCube=
|
|
d.createTexture();d.activeTexture(d.TEXTURE0+u);d.bindTexture(d.TEXTURE_CUBE_MAP,k.image.__webglTextureCube);for(u=0;u<6;u++)d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+u,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,k.image[u]);T(d.TEXTURE_CUBE_MAP,k,k.image[0]);k.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+u),d.bindTexture(d.TEXTURE_CUBE_MAP,k.image.__webglTextureCube)}else n instanceof THREE.WebGLRenderTargetCube?(k=n,d.activeTexture(d.TEXTURE0+u),d.bindTexture(d.TEXTURE_CUBE_MAP,k.__webglTexture)):ta(n,u)}else if(P===
|
|
d.createTexture();d.activeTexture(d.TEXTURE0+u);d.bindTexture(d.TEXTURE_CUBE_MAP,k.image.__webglTextureCube);for(u=0;u<6;u++)d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+u,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,k.image[u]);T(d.TEXTURE_CUBE_MAP,k,k.image[0]);k.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+u),d.bindTexture(d.TEXTURE_CUBE_MAP,k.image.__webglTextureCube)}else n instanceof THREE.WebGLRenderTargetCube?(k=n,d.activeTexture(d.TEXTURE0+u),d.bindTexture(d.TEXTURE_CUBE_MAP,k.__webglTexture)):ta(n,u)}else if(P===
|
|
"tv"){if(!k._array){k._array=[];P=0;for(o=k.texture.length;P<o;P++)k._array[P]=u+P}d.uniform1iv(n,k._array);P=0;for(o=k.texture.length;P<o;P++)(n=k.texture[P])&&ta(n,k._array[P])}(e instanceof THREE.ShaderMaterial||e instanceof THREE.MeshPhongMaterial||e.envMap)&&i.cameraPosition!==null&&d.uniform3f(i.cameraPosition,a.position.x,a.position.y,a.position.z);(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.ShaderMaterial||e.skinning)&&i.viewMatrix!==null&&
|
|
"tv"){if(!k._array){k._array=[];P=0;for(o=k.texture.length;P<o;P++)k._array[P]=u+P}d.uniform1iv(n,k._array);P=0;for(o=k.texture.length;P<o;P++)(n=k.texture[P])&&ta(n,k._array[P])}(e instanceof THREE.ShaderMaterial||e instanceof THREE.MeshPhongMaterial||e.envMap)&&i.cameraPosition!==null&&d.uniform3f(i.cameraPosition,a.position.x,a.position.y,a.position.z);(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.ShaderMaterial||e.skinning)&&i.viewMatrix!==null&&
|
|
-d.uniformMatrix4fv(i.viewMatrix,!1,Ua);e.skinning&&(d.uniformMatrix4fv(i.cameraInverseMatrix,!1,Ua),d.uniformMatrix4fv(i.boneGlobalMatrices,!1,h.boneMatrices))}d.uniformMatrix4fv(i.modelViewMatrix,!1,h._modelViewMatrixArray);i.normalMatrix&&d.uniformMatrix3fv(i.normalMatrix,!1,h._normalMatrixArray);(e instanceof THREE.ShaderMaterial||e.envMap||e.skinning||h.receiveShadow)&&i.objectMatrix!==null&&d.uniformMatrix4fv(i.objectMatrix,!1,h._objectMatrixArray);return f}function h(a,b,c,h,f,i){if(h.opacity!==
|
|
|
|
|
|
+d.uniformMatrix4fv(i.viewMatrix,!1,Ua);e.skinning&&(d.uniformMatrix4fv(i.cameraInverseMatrix,!1,Ua),d.uniformMatrix4fv(i.boneGlobalMatrices,!1,h.boneMatrices))}d.uniformMatrix4fv(i.modelViewMatrix,!1,h._modelViewMatrixArray);i.normalMatrix&&d.uniformMatrix3fv(i.normalMatrix,!1,h._normalMatrixArray);(e instanceof THREE.ShaderMaterial||e.envMap||e.skinning||h.receiveShadow)&&i.objectMatrix!==null&&d.uniformMatrix4fv(i.objectMatrix,!1,h._objectMatrixArray);return f}function f(a,b,c,h,f,i){if(h.opacity!==
|
|
0){var j,u,c=e(a,b,c,h,i),a=c.attributes,b=!1,c=f.id*16777215+c.id*2+(h.wireframe?1:0);c!==N&&(N=c,b=!0);if(!h.morphTargets&&a.position>=0)b&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),d.vertexAttribPointer(a.position,3,d.FLOAT,!1,0,0));else if(i.morphTargetBase){c=h.program.attributes;i.morphTargetBase!==-1?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[i.morphTargetBase]),d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0)):c.position>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),
|
|
0){var j,u,c=e(a,b,c,h,i),a=c.attributes,b=!1,c=f.id*16777215+c.id*2+(h.wireframe?1:0);c!==N&&(N=c,b=!0);if(!h.morphTargets&&a.position>=0)b&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),d.vertexAttribPointer(a.position,3,d.FLOAT,!1,0,0));else if(i.morphTargetBase){c=h.program.attributes;i.morphTargetBase!==-1?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[i.morphTargetBase]),d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0)):c.position>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),
|
|
d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var p=i.morphTargetForcedOrder;for(u=i.morphTargetInfluences;j<h.numSupportedMorphTargets&&j<p.length;)d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[p[j]]),d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0),i.__webglMorphTargetInfluences[j]=u[p[j]],j++}else{var p=[],q=-1,k=0;u=i.morphTargetInfluences;var n,o=u.length;j=0;for(i.morphTargetBase!==-1&&(p[i.morphTargetBase]=!0);j<h.numSupportedMorphTargets;){for(n=
|
|
d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var p=i.morphTargetForcedOrder;for(u=i.morphTargetInfluences;j<h.numSupportedMorphTargets&&j<p.length;)d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[p[j]]),d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0),i.__webglMorphTargetInfluences[j]=u[p[j]],j++}else{var p=[],q=-1,k=0;u=i.morphTargetInfluences;var n,o=u.length;j=0;for(i.morphTargetBase!==-1&&(p[i.morphTargetBase]=!0);j<h.numSupportedMorphTargets;){for(n=
|
|
0;n<o;n++)!p[n]&&u[n]>q&&(k=n,q=u[k]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[k]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=q;p[k]=1;q=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(u=f.__webglCustomAttributesList.length;j<u;j++)c=f.__webglCustomAttributesList[j],a[c.buffer.belongsToAttribute]>=
|
|
0;n<o;n++)!p[n]&&u[n]>q&&(k=n,q=u[k]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[k]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=q;p[k]=1;q=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(u=f.__webglCustomAttributesList.length;j<u;j++)c=f.__webglCustomAttributesList[j],a[c.buffer.belongsToAttribute]>=
|
|
@@ -201,7 +200,7 @@ d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.
|
|
f.__webglUVBuffer),d.vertexAttribPointer(a.uv,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv)):d.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglUV2Buffer),d.vertexAttribPointer(a.uv2,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv2)):d.disableVertexAttribArray(a.uv2));h.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexABuffer),d.vertexAttribPointer(a.skinVertexA,4,
|
|
f.__webglUVBuffer),d.vertexAttribPointer(a.uv,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv)):d.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglUV2Buffer),d.vertexAttribPointer(a.uv2,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv2)):d.disableVertexAttribArray(a.uv2));h.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexABuffer),d.vertexAttribPointer(a.skinVertexA,4,
|
|
d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),d.vertexAttribPointer(a.skinVertexB,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),d.vertexAttribPointer(a.skinIndex,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),d.vertexAttribPointer(a.skinWeight,4,d.FLOAT,!1,0,0))}i instanceof THREE.Mesh?(h.wireframe?(d.lineWidth(h.wireframeLinewidth),b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),d.drawElements(d.LINES,f.__webglLineCount,
|
|
d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),d.vertexAttribPointer(a.skinVertexB,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),d.vertexAttribPointer(a.skinIndex,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),d.vertexAttribPointer(a.skinWeight,4,d.FLOAT,!1,0,0))}i instanceof THREE.Mesh?(h.wireframe?(d.lineWidth(h.wireframeLinewidth),b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),d.drawElements(d.LINES,f.__webglLineCount,
|
|
d.UNSIGNED_SHORT,0)):(b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),d.drawElements(d.TRIANGLES,f.__webglFaceCount,d.UNSIGNED_SHORT,0)),A.info.render.calls++,A.info.render.vertices+=f.__webglFaceCount,A.info.render.faces+=f.__webglFaceCount/3):i instanceof THREE.Line?(i=i.type===THREE.LineStrip?d.LINE_STRIP:d.LINES,d.lineWidth(h.linewidth),d.drawArrays(i,0,f.__webglLineCount),A.info.render.calls++):i instanceof THREE.ParticleSystem?(d.drawArrays(d.POINTS,0,f.__webglParticleCount),A.info.render.calls++):
|
|
d.UNSIGNED_SHORT,0)):(b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),d.drawElements(d.TRIANGLES,f.__webglFaceCount,d.UNSIGNED_SHORT,0)),A.info.render.calls++,A.info.render.vertices+=f.__webglFaceCount,A.info.render.faces+=f.__webglFaceCount/3):i instanceof THREE.Line?(i=i.type===THREE.LineStrip?d.LINE_STRIP:d.LINES,d.lineWidth(h.linewidth),d.drawArrays(i,0,f.__webglLineCount),A.info.render.calls++):i instanceof THREE.ParticleSystem?(d.drawArrays(d.POINTS,0,f.__webglParticleCount),A.info.render.calls++):
|
|
-i instanceof THREE.Ribbon&&(d.drawArrays(d.TRIANGLE_STRIP,0,f.__webglVertexCount),A.info.render.calls++)}}function f(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=d.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=d.createBuffer();a.hasPos&&(d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,a.positionArray,d.DYNAMIC_DRAW),d.enableVertexAttribArray(b.attributes.position),d.vertexAttribPointer(b.attributes.position,3,d.FLOAT,!1,0,0));if(a.hasNormal){d.bindBuffer(d.ARRAY_BUFFER,
|
|
|
|
|
|
+i instanceof THREE.Ribbon&&(d.drawArrays(d.TRIANGLE_STRIP,0,f.__webglVertexCount),A.info.render.calls++)}}function h(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=d.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=d.createBuffer();a.hasPos&&(d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,a.positionArray,d.DYNAMIC_DRAW),d.enableVertexAttribArray(b.attributes.position),d.vertexAttribPointer(b.attributes.position,3,d.FLOAT,!1,0,0));if(a.hasNormal){d.bindBuffer(d.ARRAY_BUFFER,
|
|
a.__webglNormalBuffer);if(c===THREE.FlatShading){var e,f,h,i,j,p,q,k,n,o,l=a.count*3;for(o=0;o<l;o+=9)c=a.normalArray,e=c[o],f=c[o+1],h=c[o+2],i=c[o+3],p=c[o+4],k=c[o+5],j=c[o+6],q=c[o+7],n=c[o+8],e=(e+i+j)/3,f=(f+p+q)/3,h=(h+k+n)/3,c[o]=e,c[o+1]=f,c[o+2]=h,c[o+3]=e,c[o+4]=f,c[o+5]=h,c[o+6]=e,c[o+7]=f,c[o+8]=h}d.bufferData(d.ARRAY_BUFFER,a.normalArray,d.DYNAMIC_DRAW);d.enableVertexAttribArray(b.attributes.normal);d.vertexAttribPointer(b.attributes.normal,3,d.FLOAT,!1,0,0)}d.drawArrays(d.TRIANGLES,
|
|
a.__webglNormalBuffer);if(c===THREE.FlatShading){var e,f,h,i,j,p,q,k,n,o,l=a.count*3;for(o=0;o<l;o+=9)c=a.normalArray,e=c[o],f=c[o+1],h=c[o+2],i=c[o+3],p=c[o+4],k=c[o+5],j=c[o+6],q=c[o+7],n=c[o+8],e=(e+i+j)/3,f=(f+p+q)/3,h=(h+k+n)/3,c[o]=e,c[o+1]=f,c[o+2]=h,c[o+3]=e,c[o+4]=f,c[o+5]=h,c[o+6]=e,c[o+7]=f,c[o+8]=h}d.bufferData(d.ARRAY_BUFFER,a.normalArray,d.DYNAMIC_DRAW);d.enableVertexAttribArray(b.attributes.normal);d.vertexAttribPointer(b.attributes.normal,3,d.FLOAT,!1,0,0)}d.drawArrays(d.TRIANGLES,
|
|
0,a.count);a.count=0}function i(a){if(va!==a.doubleSided)a.doubleSided?d.disable(d.CULL_FACE):d.enable(d.CULL_FACE),va=a.doubleSided;if(Ga!==a.flipSided)a.flipSided?d.frontFace(d.CW):d.frontFace(d.CCW),Ga=a.flipSided}function j(a){wa!==a&&(a?d.enable(d.DEPTH_TEST):d.disable(d.DEPTH_TEST),wa=a)}function n(a){Ba!==a&&(d.depthMask(a),Ba=a)}function l(a,b,c){ya!==a&&(a?d.enable(d.POLYGON_OFFSET_FILL):d.disable(d.POLYGON_OFFSET_FILL),ya=a);if(a&&($a!==b||ab!==c))d.polygonOffset(b,c),$a=b,ab=c}function o(a){Z[0].set(a.n41-
|
|
0,a.count);a.count=0}function i(a){if(va!==a.doubleSided)a.doubleSided?d.disable(d.CULL_FACE):d.enable(d.CULL_FACE),va=a.doubleSided;if(Ga!==a.flipSided)a.flipSided?d.frontFace(d.CW):d.frontFace(d.CCW),Ga=a.flipSided}function j(a){wa!==a&&(a?d.enable(d.DEPTH_TEST):d.disable(d.DEPTH_TEST),wa=a)}function n(a){Ba!==a&&(d.depthMask(a),Ba=a)}function l(a,b,c){ya!==a&&(a?d.enable(d.POLYGON_OFFSET_FILL):d.disable(d.POLYGON_OFFSET_FILL),ya=a);if(a&&($a!==b||ab!==c))d.polygonOffset(b,c),$a=b,ab=c}function o(a){Z[0].set(a.n41-
|
|
a.n11,a.n42-a.n12,a.n43-a.n13,a.n44-a.n14);Z[1].set(a.n41+a.n11,a.n42+a.n12,a.n43+a.n13,a.n44+a.n14);Z[2].set(a.n41+a.n21,a.n42+a.n22,a.n43+a.n23,a.n44+a.n24);Z[3].set(a.n41-a.n21,a.n42-a.n22,a.n43-a.n23,a.n44-a.n24);Z[4].set(a.n41-a.n31,a.n42-a.n32,a.n43-a.n33,a.n44-a.n34);Z[5].set(a.n41+a.n31,a.n42+a.n32,a.n43+a.n33,a.n44+a.n34);for(var b,a=0;a<6;a++)b=Z[a],b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}function k(a){for(var b=a.matrixWorld,d=-a.geometry.boundingSphere.radius*Math.max(a.scale.x,
|
|
a.n11,a.n42-a.n12,a.n43-a.n13,a.n44-a.n14);Z[1].set(a.n41+a.n11,a.n42+a.n12,a.n43+a.n13,a.n44+a.n14);Z[2].set(a.n41+a.n21,a.n42+a.n22,a.n43+a.n23,a.n44+a.n24);Z[3].set(a.n41-a.n21,a.n42-a.n22,a.n43-a.n23,a.n44-a.n24);Z[4].set(a.n41-a.n31,a.n42-a.n32,a.n43-a.n33,a.n44-a.n34);Z[5].set(a.n41+a.n31,a.n42+a.n32,a.n43+a.n33,a.n44+a.n34);for(var b,a=0;a<6;a++)b=Z[a],b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}function k(a){for(var b=a.matrixWorld,d=-a.geometry.boundingSphere.radius*Math.max(a.scale.x,
|
|
@@ -209,7 +208,7 @@ Math.max(a.scale.y,a.scale.z)),c=0;c<6;c++)if(a=Z[c].x*b.n14+Z[c].y*b.n24+Z[c].z
|
|
a.opaque=null):(a.opaque=b,a.transparent=null)}function z(a,b){return b.z-a.z}function B(a){var b,c,n,sa=0,J,l,u,p,q=a.lights;ja||(ja=new THREE.PerspectiveCamera(A.shadowCameraFov,A.shadowMapWidth/A.shadowMapHeight,A.shadowCameraNear,A.shadowCameraFar));b=0;for(c=q.length;b<c;b++)if(n=q[b],n instanceof THREE.SpotLight&&n.castShadow){Q=-1;A.shadowMap[sa]||(A.shadowMap[sa]=new THREE.WebGLRenderTarget(A.shadowMapWidth,A.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));
|
|
a.opaque=null):(a.opaque=b,a.transparent=null)}function z(a,b){return b.z-a.z}function B(a){var b,c,n,sa=0,J,l,u,p,q=a.lights;ja||(ja=new THREE.PerspectiveCamera(A.shadowCameraFov,A.shadowMapWidth/A.shadowMapHeight,A.shadowCameraNear,A.shadowCameraFar));b=0;for(c=q.length;b<c;b++)if(n=q[b],n instanceof THREE.SpotLight&&n.castShadow){Q=-1;A.shadowMap[sa]||(A.shadowMap[sa]=new THREE.WebGLRenderTarget(A.shadowMapWidth,A.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));
|
|
Ra[sa]||(Ra[sa]=new THREE.Matrix4);J=A.shadowMap[sa];l=Ra[sa];ja.position.copy(n.position);ja.lookAt(n.target.position);ja.parent==null&&(console.warn("Camera is not on the Scene. Adding it..."),a.add(ja));a.updateMatrixWorld();ja.matrixWorldInverse.getInverse(ja.matrixWorld);l.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);l.multiplySelf(ja.projectionMatrix);l.multiplySelf(ja.matrixWorldInverse);ja.matrixWorldInverse.flattenToArray(Ua);ja.projectionMatrix.flattenToArray(Ta);Ca.multiply(ja.projectionMatrix,
|
|
Ra[sa]||(Ra[sa]=new THREE.Matrix4);J=A.shadowMap[sa];l=Ra[sa];ja.position.copy(n.position);ja.lookAt(n.target.position);ja.parent==null&&(console.warn("Camera is not on the Scene. Adding it..."),a.add(ja));a.updateMatrixWorld();ja.matrixWorldInverse.getInverse(ja.matrixWorld);l.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);l.multiplySelf(ja.projectionMatrix);l.multiplySelf(ja.matrixWorldInverse);ja.matrixWorldInverse.flattenToArray(Ua);ja.projectionMatrix.flattenToArray(Ta);Ca.multiply(ja.projectionMatrix,
|
|
ja.matrixWorldInverse);o(Ca);ma(J);d.clearColor(1,1,1,1);A.clear();d.clearColor(ga.r,ga.g,ga.b,Ea);l=a.__webglObjects.length;n=a.__webglObjectsImmediate.length;for(J=0;J<l;J++)u=a.__webglObjects[J],p=u.object,p.visible&&p.castShadow?!(p instanceof THREE.Mesh)||!p.frustumCulled||k(p)?(p.matrixWorld.flattenToArray(p._objectMatrixArray),E(p,ja,!1),u.render=!0):u.render=!1:u.render=!1;j(!0);I(THREE.NormalBlending);for(J=0;J<l;J++)if(u=a.__webglObjects[J],u.render)p=u.object,buffer=u.buffer,i(p),u=p.customDepthMaterial?
|
|
ja.matrixWorldInverse);o(Ca);ma(J);d.clearColor(1,1,1,1);A.clear();d.clearColor(ga.r,ga.g,ga.b,Ea);l=a.__webglObjects.length;n=a.__webglObjectsImmediate.length;for(J=0;J<l;J++)u=a.__webglObjects[J],p=u.object,p.visible&&p.castShadow?!(p instanceof THREE.Mesh)||!p.frustumCulled||k(p)?(p.matrixWorld.flattenToArray(p._objectMatrixArray),E(p,ja,!1),u.render=!0):u.render=!1:u.render=!1;j(!0);I(THREE.NormalBlending);for(J=0;J<l;J++)if(u=a.__webglObjects[J],u.render)p=u.object,buffer=u.buffer,i(p),u=p.customDepthMaterial?
|
|
-p.customDepthMaterial:p.geometry.morphTargets.length?bb:Va,h(ja,q,null,u,buffer,p);for(J=0;J<n;J++)u=a.__webglObjectsImmediate[J],p=u.object,p.visible&&p.castShadow&&(p.matrixAutoUpdate&&p.matrixWorld.flattenToArray(p._objectMatrixArray),N=-1,E(p,ja,!1),i(p),program=e(ja,q,null,Va,p),p.immediateRenderCallback?p.immediateRenderCallback(program,d,Z):p.render(function(a){f(a,program,Va.shading)}));sa++}}function F(a,b){var c,e,f;c=t.attributes;var h=t.uniforms,i=Ia/Sa,j,p=[],q=Sa*0.5,k=Ia*0.5,n=!0;d.useProgram(t.program);
|
|
|
|
|
|
+p.customDepthMaterial:p.geometry.morphTargets.length?bb:Va,f(ja,q,null,u,buffer,p);for(J=0;J<n;J++)u=a.__webglObjectsImmediate[J],p=u.object,p.visible&&p.castShadow&&(p.matrixAutoUpdate&&p.matrixWorld.flattenToArray(p._objectMatrixArray),N=-1,E(p,ja,!1),i(p),program=e(ja,q,null,Va,p),p.immediateRenderCallback?p.immediateRenderCallback(program,d,Z):p.render(function(a){h(a,program,Va.shading)}));sa++}}function F(a,b){var c,e,f;c=t.attributes;var h=t.uniforms,i=Ia/Sa,j,p=[],q=Sa*0.5,k=Ia*0.5,n=!0;d.useProgram(t.program);
|
|
S=t.program;N=wa=Ka=-1;cb||(d.enableVertexAttribArray(t.attributes.position),d.enableVertexAttribArray(t.attributes.uv),cb=!0);d.disable(d.CULL_FACE);d.enable(d.BLEND);d.depthMask(!0);d.bindBuffer(d.ARRAY_BUFFER,t.vertexBuffer);d.vertexAttribPointer(c.position,2,d.FLOAT,!1,16,0);d.vertexAttribPointer(c.uv,2,d.FLOAT,!1,16,8);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,t.elementBuffer);d.uniformMatrix4fv(h.projectionMatrix,!1,Ta);d.activeTexture(d.TEXTURE0);d.uniform1i(h.map,0);c=0;for(e=a.__webglSprites.length;c<
|
|
S=t.program;N=wa=Ka=-1;cb||(d.enableVertexAttribArray(t.attributes.position),d.enableVertexAttribArray(t.attributes.uv),cb=!0);d.disable(d.CULL_FACE);d.enable(d.BLEND);d.depthMask(!0);d.bindBuffer(d.ARRAY_BUFFER,t.vertexBuffer);d.vertexAttribPointer(c.position,2,d.FLOAT,!1,16,0);d.vertexAttribPointer(c.uv,2,d.FLOAT,!1,16,8);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,t.elementBuffer);d.uniformMatrix4fv(h.projectionMatrix,!1,Ta);d.activeTexture(d.TEXTURE0);d.uniform1i(h.map,0);c=0;for(e=a.__webglSprites.length;c<
|
|
e;c++)if(f=a.__webglSprites[c],f.visible&&f.opacity!==0)f.useScreenCoordinates?f.z=-f.position.z:(f._modelViewMatrix.multiplyToArray(b.matrixWorldInverse,f.matrixWorld,f._modelViewMatrixArray),f.z=-f._modelViewMatrix.n34);a.__webglSprites.sort(z);c=0;for(e=a.__webglSprites.length;c<e;c++)f=a.__webglSprites[c],f.visible&&f.opacity!==0&&f.map&&f.map.image&&f.map.image.width&&(f.useScreenCoordinates?(d.uniform1i(h.useScreenCoordinates,1),d.uniform3f(h.screenPosition,(f.position.x-q)/q,(k-f.position.y)/
|
|
e;c++)if(f=a.__webglSprites[c],f.visible&&f.opacity!==0)f.useScreenCoordinates?f.z=-f.position.z:(f._modelViewMatrix.multiplyToArray(b.matrixWorldInverse,f.matrixWorld,f._modelViewMatrixArray),f.z=-f._modelViewMatrix.n34);a.__webglSprites.sort(z);c=0;for(e=a.__webglSprites.length;c<e;c++)f=a.__webglSprites[c],f.visible&&f.opacity!==0&&f.map&&f.map.image&&f.map.image.width&&(f.useScreenCoordinates?(d.uniform1i(h.useScreenCoordinates,1),d.uniform3f(h.screenPosition,(f.position.x-q)/q,(k-f.position.y)/
|
|
k,Math.max(0,Math.min(1,f.position.z)))):(d.uniform1i(h.useScreenCoordinates,0),d.uniform1i(h.affectedByDistance,f.affectedByDistance?1:0),d.uniformMatrix4fv(h.modelViewMatrix,!1,f._modelViewMatrixArray)),j=f.map.image.width/(f.scaleByViewport?Ia:1),p[0]=j*i*f.scale.x,p[1]=j*f.scale.y,d.uniform2f(h.uvScale,f.uvScale.x,f.uvScale.y),d.uniform2f(h.uvOffset,f.uvOffset.x,f.uvOffset.y),d.uniform2f(h.alignment,f.alignment.x,f.alignment.y),d.uniform1f(h.opacity,f.opacity),d.uniform3f(h.color,f.color.r,f.color.g,
|
|
k,Math.max(0,Math.min(1,f.position.z)))):(d.uniform1i(h.useScreenCoordinates,0),d.uniform1i(h.affectedByDistance,f.affectedByDistance?1:0),d.uniformMatrix4fv(h.modelViewMatrix,!1,f._modelViewMatrixArray)),j=f.map.image.width/(f.scaleByViewport?Ia:1),p[0]=j*i*f.scale.x,p[1]=j*f.scale.y,d.uniform2f(h.uvScale,f.uvScale.x,f.uvScale.y),d.uniform2f(h.uvOffset,f.uvOffset.x,f.uvOffset.y),d.uniform2f(h.alignment,f.alignment.x,f.alignment.y),d.uniform1f(h.opacity,f.opacity),d.uniform3f(h.color,f.color.r,f.color.g,
|
|
@@ -251,9 +250,9 @@ l.tangent>=0&&d.enableVertexAttribArray(l.tangent);a.skinning&&l.skinVertexA>=0&
|
|
a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,b,c,d){ma(a);this.clear(b,c,d)};this.updateShadowMap=function(a,b){B(a,b)};this.render=function(a,b,c,t){var sa,J,Qa,u,p,q,Pa,xa=a.lights,za=a.fog;Q=-1;this.autoUpdateObjects&&this.initWebGLObjects(a);this.shadowMapEnabled&&this.shadowMapAutoUpdate&&B(a,b);A.info.render.calls=0;A.info.render.vertices=0;A.info.render.faces=0;b.parent==null&&(console.warn("Camera is not on the Scene. Adding it..."),
|
|
a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,b,c,d){ma(a);this.clear(b,c,d)};this.updateShadowMap=function(a,b){B(a,b)};this.render=function(a,b,c,t){var sa,J,Qa,u,p,q,Pa,xa=a.lights,za=a.fog;Q=-1;this.autoUpdateObjects&&this.initWebGLObjects(a);this.shadowMapEnabled&&this.shadowMapAutoUpdate&&B(a,b);A.info.render.calls=0;A.info.render.vertices=0;A.info.render.faces=0;b.parent==null&&(console.warn("Camera is not on the Scene. Adding it..."),
|
|
a.add(b));a.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);b.matrixWorldInverse.flattenToArray(Ua);b.projectionMatrix.flattenToArray(Ta);Ca.multiply(b.projectionMatrix,b.matrixWorldInverse);o(Ca);ma(c);(this.autoClear||t)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);Qa=a.__webglObjects.length;for(t=0;t<Qa;t++)if(p=a.__webglObjects[t],q=p.object,q.visible)if(!(q instanceof THREE.Mesh)||!q.frustumCulled||k(q)){if(q.matrixWorld.flattenToArray(q._objectMatrixArray),
|
|
a.add(b));a.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);b.matrixWorldInverse.flattenToArray(Ua);b.projectionMatrix.flattenToArray(Ta);Ca.multiply(b.projectionMatrix,b.matrixWorldInverse);o(Ca);ma(c);(this.autoClear||t)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);Qa=a.__webglObjects.length;for(t=0;t<Qa;t++)if(p=a.__webglObjects[t],q=p.object,q.visible)if(!(q instanceof THREE.Mesh)||!q.frustumCulled||k(q)){if(q.matrixWorld.flattenToArray(q._objectMatrixArray),
|
|
E(q,b,!0),v(p),p.render=!0,this.sortObjects)q.renderDepth?p.z=q.renderDepth:(Ha.copy(q.position),Ca.multiplyVector3(Ha),p.z=Ha.z)}else p.render=!1;else p.render=!1;this.sortObjects&&a.__webglObjects.sort(z);u=a.__webglObjectsImmediate.length;for(t=0;t<u;t++)p=a.__webglObjectsImmediate[t],q=p.object,q.visible&&(q.matrixAutoUpdate&&q.matrixWorld.flattenToArray(q._objectMatrixArray),E(q,b,!0),r(p));if(a.overrideMaterial){j(a.overrideMaterial.depthTest);I(a.overrideMaterial.blending);for(t=0;t<Qa;t++)if(p=
|
|
E(q,b,!0),v(p),p.render=!0,this.sortObjects)q.renderDepth?p.z=q.renderDepth:(Ha.copy(q.position),Ca.multiplyVector3(Ha),p.z=Ha.z)}else p.render=!1;else p.render=!1;this.sortObjects&&a.__webglObjects.sort(z);u=a.__webglObjectsImmediate.length;for(t=0;t<u;t++)p=a.__webglObjectsImmediate[t],q=p.object,q.visible&&(q.matrixAutoUpdate&&q.matrixWorld.flattenToArray(q._objectMatrixArray),E(q,b,!0),r(p));if(a.overrideMaterial){j(a.overrideMaterial.depthTest);I(a.overrideMaterial.blending);for(t=0;t<Qa;t++)if(p=
|
|
-a.__webglObjects[t],p.render)q=p.object,Pa=p.buffer,i(q),h(b,xa,za,a.overrideMaterial,Pa,q);for(t=0;t<u;t++)p=a.__webglObjectsImmediate[t],q=p.object,q.visible&&(N=-1,i(q),sa=e(b,xa,za,a.overrideMaterial,q),q.immediateRenderCallback?q.immediateRenderCallback(sa,d,Z):q.render(function(b){f(b,sa,a.overrideMaterial.shading)}))}else{I(THREE.NormalBlending);for(t=Qa-1;t>=0;t--)if(p=a.__webglObjects[t],p.render&&(q=p.object,Pa=p.buffer,J=p.opaque))i(q),j(J.depthTest),n(J.depthWrite),l(J.polygonOffset,J.polygonOffsetFactor,
|
|
|
|
-J.polygonOffsetUnits),h(b,xa,za,J,Pa,q);for(t=0;t<u;t++)if(p=a.__webglObjectsImmediate[t],q=p.object,q.visible&&(N=-1,J=p.opaque))i(q),j(J.depthTest),n(J.depthWrite),l(J.polygonOffset,J.polygonOffsetFactor,J.polygonOffsetUnits),sa=e(b,xa,za,J,q),q.immediateRenderCallback?q.immediateRenderCallback(sa,d,Z):q.render(function(a){f(a,sa,J.shading)});for(t=0;t<Qa;t++)if(p=a.__webglObjects[t],p.render&&(q=p.object,Pa=p.buffer,J=p.transparent))i(q),I(J.blending),j(J.depthTest),n(J.depthWrite),l(J.polygonOffset,
|
|
|
|
-J.polygonOffsetFactor,J.polygonOffsetUnits),h(b,xa,za,J,Pa,q);for(t=0;t<u;t++)if(p=a.__webglObjectsImmediate[t],q=p.object,q.visible&&(N=-1,J=p.transparent))i(q),I(J.blending),j(J.depthTest),n(J.depthWrite),l(J.polygonOffset,J.polygonOffsetFactor,J.polygonOffsetUnits),sa=e(b,xa,za,J,q),q.immediateRenderCallback?q.immediateRenderCallback(sa,d,Z):q.render(function(a){f(a,sa,J.shading)})}a.__webglSprites.length&&F(a,b);c&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&pa(c)};this.initWebGLObjects=
|
|
|
|
|
|
+a.__webglObjects[t],p.render)q=p.object,Pa=p.buffer,i(q),f(b,xa,za,a.overrideMaterial,Pa,q);for(t=0;t<u;t++)p=a.__webglObjectsImmediate[t],q=p.object,q.visible&&(N=-1,i(q),sa=e(b,xa,za,a.overrideMaterial,q),q.immediateRenderCallback?q.immediateRenderCallback(sa,d,Z):q.render(function(b){h(b,sa,a.overrideMaterial.shading)}))}else{I(THREE.NormalBlending);for(t=Qa-1;t>=0;t--)if(p=a.__webglObjects[t],p.render&&(q=p.object,Pa=p.buffer,J=p.opaque))i(q),j(J.depthTest),n(J.depthWrite),l(J.polygonOffset,J.polygonOffsetFactor,
|
|
|
|
+J.polygonOffsetUnits),f(b,xa,za,J,Pa,q);for(t=0;t<u;t++)if(p=a.__webglObjectsImmediate[t],q=p.object,q.visible&&(N=-1,J=p.opaque))i(q),j(J.depthTest),n(J.depthWrite),l(J.polygonOffset,J.polygonOffsetFactor,J.polygonOffsetUnits),sa=e(b,xa,za,J,q),q.immediateRenderCallback?q.immediateRenderCallback(sa,d,Z):q.render(function(a){h(a,sa,J.shading)});for(t=0;t<Qa;t++)if(p=a.__webglObjects[t],p.render&&(q=p.object,Pa=p.buffer,J=p.transparent))i(q),I(J.blending),j(J.depthTest),n(J.depthWrite),l(J.polygonOffset,
|
|
|
|
+J.polygonOffsetFactor,J.polygonOffsetUnits),f(b,xa,za,J,Pa,q);for(t=0;t<u;t++)if(p=a.__webglObjectsImmediate[t],q=p.object,q.visible&&(N=-1,J=p.transparent))i(q),I(J.blending),j(J.depthTest),n(J.depthWrite),l(J.polygonOffset,J.polygonOffsetFactor,J.polygonOffsetUnits),sa=e(b,xa,za,J,q),q.immediateRenderCallback?q.immediateRenderCallback(sa,d,Z):q.render(function(a){h(a,sa,J.shading)})}a.__webglSprites.length&&F(a,b);c&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&pa(c)};this.initWebGLObjects=
|
|
function(a){if(!a.__webglObjects)a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[];for(;a.__objectsAdded.length;){var e=a.__objectsAdded[0],f=a,h=void 0,i=void 0,j=void 0;if(!e.__webglInit)if(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrixArray=new Float32Array(9),e._modelViewMatrixArray=new Float32Array(16),e._objectMatrixArray=new Float32Array(16),e.matrixWorld.flattenToArray(e._objectMatrixArray),e instanceof THREE.Mesh){i=e.geometry;if(i.geometryGroups===
|
|
function(a){if(!a.__webglObjects)a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[];for(;a.__objectsAdded.length;){var e=a.__objectsAdded[0],f=a,h=void 0,i=void 0,j=void 0;if(!e.__webglInit)if(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrixArray=new Float32Array(9),e._modelViewMatrixArray=new Float32Array(16),e._objectMatrixArray=new Float32Array(16),e.matrixWorld.flattenToArray(e._objectMatrixArray),e instanceof THREE.Mesh){i=e.geometry;if(i.geometryGroups===
|
|
void 0){var j=i,k=void 0,n=void 0,p=void 0,q=void 0,l=p=void 0,o=void 0,r={},t=j.morphTargets.length;j.geometryGroups={};k=0;for(n=j.faces.length;k<n;k++)p=j.faces[k],q=p.materialIndex,l=q!==void 0?q:-1,r[l]===void 0&&(r[l]={hash:l,counter:0}),o=r[l].hash+"_"+r[l].counter,j.geometryGroups[o]===void 0&&(j.geometryGroups[o]={faces:[],materialIndex:q,vertices:0,numMorphTargets:t}),p=p instanceof THREE.Face3?3:4,j.geometryGroups[o].vertices+p>65535&&(r[l].counter+=1,o=r[l].hash+"_"+r[l].counter,j.geometryGroups[o]===
|
|
void 0){var j=i,k=void 0,n=void 0,p=void 0,q=void 0,l=p=void 0,o=void 0,r={},t=j.morphTargets.length;j.geometryGroups={};k=0;for(n=j.faces.length;k<n;k++)p=j.faces[k],q=p.materialIndex,l=q!==void 0?q:-1,r[l]===void 0&&(r[l]={hash:l,counter:0}),o=r[l].hash+"_"+r[l].counter,j.geometryGroups[o]===void 0&&(j.geometryGroups[o]={faces:[],materialIndex:q,vertices:0,numMorphTargets:t}),p=p instanceof THREE.Face3?3:4,j.geometryGroups[o].vertices+p>65535&&(r[l].counter+=1,o=r[l].hash+"_"+r[l].counter,j.geometryGroups[o]===
|
|
void 0&&(j.geometryGroups[o]={faces:[],materialIndex:q,vertices:0,numMorphTargets:t})),j.geometryGroups[o].faces.push(k),j.geometryGroups[o].vertices+=p;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=Aa++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer=d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=
|
|
void 0&&(j.geometryGroups[o]={faces:[],materialIndex:q,vertices:0,numMorphTargets:t})),j.geometryGroups[o].faces.push(k),j.geometryGroups[o].vertices+=p;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=Aa++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer=d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=
|