瀏覽代碼

Updated builds.

Mr.doob 10 年之前
父節點
當前提交
234861ac19
共有 2 個文件被更改,包括 1634 次插入1361 次删除
  1. 1483 1225
      build/three.js
  2. 151 136
      build/three.min.js

File diff suppressed because it is too large
+ 1483 - 1225
build/three.js


+ 151 - 136
build/three.min.js

@@ -175,32 +175,19 @@ THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d insta
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.materialIndex=this.materialIndex;for(var b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}};
 THREE.Face4=function(a,b,c,d,e,f,g){THREE.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,g)};THREE.BufferAttribute=function(a,b){this.array=a;this.itemSize=b;this.needsUpdate=!1};
 THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},copyAt:function(a,b,c){a*=this.itemSize;c*=b.itemSize;for(var d=0,e=this.itemSize;d<e;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},setX:function(a,b){this.array[a*this.itemSize]=b;return this},setY:function(a,b){this.array[a*this.itemSize+1]=b;return this},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},setXY:function(a,
-b,c){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e;return this},clone:function(){return new THREE.BufferAttribute(new this.array.constructor(this.array),this.itemSize)}};
+b,c){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e;return this},clone:function(){return new THREE.BufferAttribute(new this.array.constructor(this.array),this.itemSize)}};
 THREE.Int8Attribute=function(a,b){THREE.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.Uint8Attribute=function(a,b){THREE.warn("THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};
 THREE.Uint8ClampedAttribute=function(a,b){THREE.warn("THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.Int16Attribute=function(a,b){THREE.warn("THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};
 THREE.Uint16Attribute=function(a,b){THREE.warn("THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.Int32Attribute=function(a,b){THREE.warn("THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};
 THREE.Uint32Attribute=function(a,b){THREE.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.Float32Attribute=function(a,b){THREE.warn("THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};
 THREE.Float64Attribute=function(a,b){THREE.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.DynamicBufferAttribute=function(a,b){THREE.BufferAttribute.call(this,a,b);this.updateRange={offset:0,count:-1}};THREE.DynamicBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.DynamicBufferAttribute.prototype.constructor=THREE.DynamicBufferAttribute;
-THREE.DynamicBufferAttribute.prototype.clone=function(){return new THREE.DynamicBufferAttribute(new this.array.constructor(this.array),this.itemSize)};THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.attributesKeys=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
-THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute?(THREE.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):(this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=
-this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere()},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};
-var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=0<e[0].length,h=3==d[0].vertexNormals.length,k=new Float32Array(9*d.length);this.addAttribute("position",new THREE.BufferAttribute(k,3));var l=new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(l,3));if(f!==THREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(n,3))}if(!0===g){var p=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(p,
-2))}for(var m=0,r=0,t=0;m<d.length;m++,r+=6,t+=9){var s=d[m],u=c[s.a],v=c[s.b],x=c[s.c];k[t]=u.x;k[t+1]=u.y;k[t+2]=u.z;k[t+3]=v.x;k[t+4]=v.y;k[t+5]=v.z;k[t+6]=x.x;k[t+7]=x.y;k[t+8]=x.z;!0===h?(u=s.vertexNormals[0],v=s.vertexNormals[1],x=s.vertexNormals[2],l[t]=u.x,l[t+1]=u.y,l[t+2]=u.z,l[t+3]=v.x,l[t+4]=v.y,l[t+5]=v.z,l[t+6]=x.x,l[t+7]=x.y,l[t+8]=x.z):(u=s.normal,l[t]=u.x,l[t+1]=u.y,l[t+2]=u.z,l[t+3]=u.x,l[t+4]=u.y,l[t+5]=u.z,l[t+6]=u.x,l[t+7]=u.y,l[t+8]=u.z);f===THREE.FaceColors?(s=s.color,n[t]=
-s.r,n[t+1]=s.g,n[t+2]=s.b,n[t+3]=s.r,n[t+4]=s.g,n[t+5]=s.b,n[t+6]=s.r,n[t+7]=s.g,n[t+8]=s.b):f===THREE.VertexColors&&(u=s.vertexColors[0],v=s.vertexColors[1],s=s.vertexColors[2],n[t]=u.r,n[t+1]=u.g,n[t+2]=u.b,n[t+3]=v.r,n[t+4]=v.g,n[t+5]=v.b,n[t+6]=s.r,n[t+7]=s.g,n[t+8]=s.b);!0===g&&(s=e[0][m][0],u=e[0][m][1],v=e[0][m][2],p[r]=s.x,p[r+1]=s.y,p[r+2]=u.x,p[r+3]=u.y,p[r+4]=v.x,p[r+5]=v.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===
-this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&THREE.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),
-computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&
-THREE.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,l=new THREE.Vector3,
-n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var r=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,count:r.length,index:0}],s=0,u=t.length;s<u;++s){e=t[s].start;f=t[s].count;for(var v=t[s].index,d=e,e=e+f;d<e;d+=3)f=3*(v+r[d]),g=3*(v+r[d+1]),h=3*(v+r[d+2]),k.fromArray(b,f),l.fromArray(b,g),n.fromArray(b,h),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=
-0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),n.fromArray(b,d+6),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);m.fromArray(d,3*b);r.fromArray(d,3*c);t.fromArray(f,2*a);s.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-p.x;x=r.x-p.x;z=m.y-p.y;w=r.y-p.y;I=m.z-p.z;H=r.z-p.z;y=s.x-t.x;F=
-u.x-t.x;B=s.y-t.y;E=u.y-t.y;C=1/(y*E-F*B);N.set((E*v-B*x)*C,(E*z-B*w)*C,(E*I-B*H)*C);K.set((y*x-F*v)*C,(y*w-F*z)*C,(y*H-F*I)*C);k[a].add(N);k[b].add(N);k[c].add(N);l[a].add(K);l[b].add(K);l[c].add(K)}function b(a){na.fromArray(e,3*a);P.copy(na);W=k[a];D.copy(W);D.sub(na.multiplyScalar(na.dot(W))).normalize();$.crossVectors(P,W);Y=$.dot(l[a]);ea=0>Y?-1:1;h[4*a]=D.x;h[4*a+1]=D.y;h[4*a+2]=D.z;h[4*a+3]=ea}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||
-void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,
-l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector2,s=new THREE.Vector2,u=new THREE.Vector2,v,x,z,w,I,H,y,F,B,E,C,N=new THREE.Vector3,K=new THREE.Vector3,L,J,G,A,M;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var R=this.drawcalls,n=0;for(J=R.length;n<J;++n){L=R[n].start;G=R[n].count;var O=R[n].index,g=L;for(L+=G;g<L;g+=3)G=O+c[g],A=O+c[g+1],M=O+c[g+2],a(G,A,M)}var D=new THREE.Vector3,$=new THREE.Vector3,na=new THREE.Vector3,P=new THREE.Vector3,
-ea,W,Y,n=0;for(J=R.length;n<J;++n)for(L=R[n].start,G=R[n].count,O=R[n].index,g=L,L+=G;g<L;g+=3)G=O+c[g],A=O+c[g+1],M=O+c[g+2],b(G),b(A),b(M)}},computeOffsets:function(a){void 0===a&&(a=65535);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new Uint16Array(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,p=new Int32Array(6),m=new Int32Array(c.length),r=new Int32Array(c.length),t=0;t<c.length;t++)m[t]=-1,r[t]=-1;for(c=0;c<d;c++){for(var s=n=0;3>s;s++)t=
-b[3*c+s],-1==m[t]?(p[2*s]=t,p[2*s+1]=-1,n++):m[t]<k.index?(p[2*s]=t,p[2*s+1]=-1,l++):(p[2*s]=t,p[2*s+1]=m[t]);if(g+n>k.index+a)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)s=p[n+1],-1<s&&s<k.index&&(p[n+1]=-1);for(n=0;6>n;n+=2)t=p[n],s=p[n+1],-1===s&&(s=g++),m[t]=s,r[s]=t,e[f++]=s-k.index,k.count++}this.reorderBuffers(e,r,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
-a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!=e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*
-c));for(var f=0;f<c;f++){var g=b[f];for(e in this.attributes)if("index"!=e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,l=d[e],n=0;n<k;n++)l[f*k+n]=h[g*k+n]}this.attributes.index.array=a;for(e in this.attributes)"index"!=e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.type=this.type;a.uuid=this.uuid;""!==this.name&&(a.name=this.name);
-a.data={};a.data.attributes={};var b=this.attributes,c=this.offsets,d=this.boundingSphere,e;for(e in b){var f=b[e],g=Array.prototype.slice.call(f.array);a.data.attributes[e]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}0<c.length&&(a.data.offsets=JSON.parse(JSON.stringify(c)));null!==d&&(a.data.boundingSphere={center:d.center.toArray(),radius:d.radius});return a},clone:function(){var a=new THREE.BufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());
-b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count})}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);
+THREE.DynamicBufferAttribute.prototype.clone=function(){return new THREE.DynamicBufferAttribute(new this.array.constructor(this.array),this.itemSize)};THREE.InstancedBufferAttribute=function(a,b,c,d){THREE.DynamicBufferAttribute.call(this,a,b);this.dynamic=d||!1;this.meshPerAttribute=c||1};THREE.InstancedBufferAttribute.prototype=Object.create(THREE.DynamicBufferAttribute.prototype);THREE.InstancedBufferAttribute.prototype.constructor=THREE.InstancedBufferAttribute;
+THREE.InstancedBufferAttribute.prototype.clone=function(){return new THREE.InstancedBufferAttribute(new this.array.constructor(this.array),this.itemSize,this.meshPerAttribute,this.dynamic)};THREE.InterleavedBuffer=function(a,b,c){this.array=a;this.stride=b;this.needsUpdate=!1;this.dynamic=c||!1;this.updateRange={offset:0,count:-1}};
+THREE.InterleavedBuffer.prototype={constructor:THREE.InterleavedBuffer,get length(){return this.array.length},copyAt:function(a,b,c){a*=this.stride;c*=b.stride;for(var d=0,e=this.stride;d<e;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},clone:function(){return new THREE.InterleavedBuffer(new this.array.constructor(this.array),this.stride,this.dynamic)}};
+THREE.InstancedInterleavedBuffer=function(a,b,c,d){THREE.InterleavedBuffer.call(this,a,b,c);this.meshPerAttribute=d||1};THREE.InstancedInterleavedBuffer.prototype=Object.create(THREE.InterleavedBuffer.prototype);THREE.InstancedInterleavedBuffer.prototype.constructor=THREE.InstancedInterleavedBuffer;THREE.InstancedInterleavedBuffer.prototype.clone=function(){return new THREE.InstancedInterleavedBuffer(new this.array.constructor(this.array),this.stride,this.dynamic,this.meshPerAttribute)};
+THREE.InterleavedBufferAttribute=function(a,b,c){this.data=a;this.itemSize=b;this.offset=c};
+THREE.InterleavedBufferAttribute.prototype={constructor:THREE.InterleavedBufferAttribute,get length(){return this.itemSize*this.data.array.length/this.data.stride},setX:function(a,b){this.data.array[a*this.data.stride+this.offset]=b;return this},setY:function(a,b){this.data.array[a*this.data.stride+this.offset+1]=b;return this},setZ:function(a,b){this.data.array[a*this.data.stride+this.offset+2]=b;return this},setXY:function(a,b,c){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+
+1]=c;return this},setXYZ:function(a,b,c,d){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+1]=c;this.data.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+1]=c;this.data.array[a+2]=d;this.data.array[a+3]=e;return this}};
 THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=
 this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1};
 THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;e<f;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=
@@ -222,6 +209,28 @@ a.z);return l[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString(
 (e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],l={},n=[],p={},m=[],r={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],s=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),v=0<t.vertexNormals.length,x=1!==t.color.r||1!==t.color.g||1!==t.color.b,z=0<t.vertexColors.length,w=0,w=a(w,0,0),w=a(w,1,!1),w=a(w,2,!1),w=a(w,3,s),w=a(w,4,u),w=a(w,5,v),w=a(w,6,x),w=a(w,7,z);h.push(w);h.push(t.a,t.b,t.c);s&&(s=this.faceVertexUvs[0][g],
 h.push(d(s[0]),d(s[1]),d(s[2])));u&&h.push(b(t.normal));v&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));x&&h.push(c(t.color));z&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<n.length&&(e.data.colors=n);0<m.length&&(e.data.uvs=[m]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());c=0;
 for(d=this.faceVertexUvs.length;c<d;c++){b=this.faceVertexUvs[c];void 0===a.faceVertexUvs[c]&&(a.faceVertexUvs[c]=[]);for(var e=0,f=b.length;e<f;e++){for(var g=b[e],h=[],k=0,l=g.length;k<l;k++)h.push(g[k].clone());a.faceVertexUvs[c].push(h)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;
+THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.attributesKeys=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
+THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(THREE.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):(this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,
+index:void 0!==c?c:0})},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere()},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));
+return a},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=0<e[0].length,h=3==d[0].vertexNormals.length,k=new Float32Array(9*d.length);this.addAttribute("position",new THREE.BufferAttribute(k,3));var l=new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(l,3));if(f!==THREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(n,3))}if(!0===g){var p=new Float32Array(6*
+d.length);this.addAttribute("uv",new THREE.BufferAttribute(p,2))}for(var m=0,r=0,t=0;m<d.length;m++,r+=6,t+=9){var s=d[m],u=c[s.a],v=c[s.b],x=c[s.c];k[t]=u.x;k[t+1]=u.y;k[t+2]=u.z;k[t+3]=v.x;k[t+4]=v.y;k[t+5]=v.z;k[t+6]=x.x;k[t+7]=x.y;k[t+8]=x.z;!0===h?(u=s.vertexNormals[0],v=s.vertexNormals[1],x=s.vertexNormals[2],l[t]=u.x,l[t+1]=u.y,l[t+2]=u.z,l[t+3]=v.x,l[t+4]=v.y,l[t+5]=v.z,l[t+6]=x.x,l[t+7]=x.y,l[t+8]=x.z):(u=s.normal,l[t]=u.x,l[t+1]=u.y,l[t+2]=u.z,l[t+3]=u.x,l[t+4]=u.y,l[t+5]=u.z,l[t+6]=u.x,
+l[t+7]=u.y,l[t+8]=u.z);f===THREE.FaceColors?(s=s.color,n[t]=s.r,n[t+1]=s.g,n[t+2]=s.b,n[t+3]=s.r,n[t+4]=s.g,n[t+5]=s.b,n[t+6]=s.r,n[t+7]=s.g,n[t+8]=s.b):f===THREE.VertexColors&&(u=s.vertexColors[0],v=s.vertexColors[1],s=s.vertexColors[2],n[t]=u.r,n[t+1]=u.g,n[t+2]=u.b,n[t+3]=v.r,n[t+4]=v.g,n[t+5]=v.b,n[t+6]=s.r,n[t+7]=s.g,n[t+8]=s.b);!0===g&&(s=e[0][m][0],u=e[0][m][1],v=e[0][m][2],p[r]=s.x,p[r+1]=s.y,p[r+2]=u.x,p[r+3]=u.y,p[r+4]=v.x,p[r+5]=v.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=
+new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&THREE.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),
+computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&
+THREE.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,l=new THREE.Vector3,
+n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var r=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,count:r.length,index:0}],s=0,u=t.length;s<u;++s){e=t[s].start;f=t[s].count;for(var v=t[s].index,d=e,e=e+f;d<e;d+=3)f=3*(v+r[d]),g=3*(v+r[d+1]),h=3*(v+r[d+2]),k.fromArray(b,f),l.fromArray(b,g),n.fromArray(b,h),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=
+0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),n.fromArray(b,d+6),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);m.fromArray(d,3*b);r.fromArray(d,3*c);t.fromArray(f,2*a);s.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-p.x;x=r.x-p.x;z=m.y-p.y;w=r.y-p.y;I=m.z-p.z;H=r.z-p.z;y=s.x-t.x;F=
+u.x-t.x;B=s.y-t.y;E=u.y-t.y;C=1/(y*E-F*B);N.set((E*v-B*x)*C,(E*z-B*w)*C,(E*I-B*H)*C);K.set((y*x-F*v)*C,(y*w-F*z)*C,(y*H-F*I)*C);k[a].add(N);k[b].add(N);k[c].add(N);l[a].add(K);l[b].add(K);l[c].add(K)}function b(a){oa.fromArray(e,3*a);P.copy(oa);$=k[a];D.copy($);D.sub(oa.multiplyScalar(oa.dot($))).normalize();aa.crossVectors(P,$);X=aa.dot(l[a]);ea=0>X?-1:1;h[4*a]=D.x;h[4*a+1]=D.y;h[4*a+2]=D.z;h[4*a+3]=ea}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||
+void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,
+l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector2,s=new THREE.Vector2,u=new THREE.Vector2,v,x,z,w,I,H,y,F,B,E,C,N=new THREE.Vector3,K=new THREE.Vector3,L,J,G,A,M;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var R=this.drawcalls,n=0;for(J=R.length;n<J;++n){L=R[n].start;G=R[n].count;var O=R[n].index,g=L;for(L+=G;g<L;g+=3)G=O+c[g],A=O+c[g+1],M=O+c[g+2],a(G,A,M)}var D=new THREE.Vector3,aa=new THREE.Vector3,oa=new THREE.Vector3,P=new THREE.Vector3,
+ea,$,X,n=0;for(J=R.length;n<J;++n)for(L=R[n].start,G=R[n].count,O=R[n].index,g=L,L+=G;g<L;g+=3)G=O+c[g],A=O+c[g+1],M=O+c[g+2],b(G),b(A),b(M)}},computeOffsets:function(a){void 0===a&&(a=65535);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new Uint16Array(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,p=new Int32Array(6),m=new Int32Array(c.length),r=new Int32Array(c.length),t=0;t<c.length;t++)m[t]=-1,r[t]=-1;for(c=0;c<d;c++){for(var s=n=0;3>s;s++)t=
+b[3*c+s],-1==m[t]?(p[2*s]=t,p[2*s+1]=-1,n++):m[t]<k.index?(p[2*s]=t,p[2*s+1]=-1,l++):(p[2*s]=t,p[2*s+1]=m[t]);if(g+n>k.index+a)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)s=p[n+1],-1<s&&s<k.index&&(p[n+1]=-1);for(n=0;6>n;n+=2)t=p[n],s=p[n+1],-1===s&&(s=g++),m[t]=s,r[s]=t,e[f++]=s-k.index,k.count++}this.reorderBuffers(e,r,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
+a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!=e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*
+c));for(var f=0;f<c;f++){var g=b[f];for(e in this.attributes)if("index"!=e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,l=d[e],n=0;n<k;n++)l[f*k+n]=h[g*k+n]}this.attributes.index.array=a;for(e in this.attributes)"index"!=e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.type=this.type;a.uuid=this.uuid;""!==this.name&&(a.name=this.name);
+a.data={};a.data.attributes={};var b=this.attributes,c=this.offsets,d=this.boundingSphere,e;for(e in b){var f=b[e],g=Array.prototype.slice.call(f.array);a.data.attributes[e]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}0<c.length&&(a.data.offsets=JSON.parse(JSON.stringify(c)));null!==d&&(a.data.boundingSphere={center:d.center.toArray(),radius:d.radius});return a},clone:function(){var a=new THREE.BufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());
+b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count})}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0};THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
+THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry;THREE.InstancedBufferGeometry.prototype.addDrawCall=function(a,b,c,d){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0,instances:d})};
+THREE.InstancedBufferGeometry.prototype.clone=function(){var a=new THREE.InstancedBufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count,instances:d.instances})}return a};THREE.EventDispatcher.prototype.apply(THREE.InstancedBufferGeometry.prototype);
 THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,-1).applyQuaternion(a)}}();
 THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};
 THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1);f.lookAt(new THREE.Vector3(0,1,0));this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new THREE.Vector3(0,-1,0));
@@ -454,111 +463,117 @@ tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.Sh
 THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,
 "}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",
 THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}};
-THREE.WebGLRenderer=function(a){function b(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function c(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var f=0,g=b.length;f<g;f++){var h=b[f],k=e[h];if(0<=k){var m=c[h];void 0!==m?(h=m.itemSize,q.bindBuffer(q.ARRAY_BUFFER,m.buffer),U.enableAttribute(k),q.vertexAttribPointer(k,h,q.FLOAT,!1,0,d*h*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[h].length?q.vertexAttrib2fv(k,
-a.defaultAttributeValues[h]):3===a.defaultAttributeValues[h].length&&q.vertexAttrib3fv(k,a.defaultAttributeValues[h]))}}U.disableUnusedAttributes()}function d(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function e(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function f(a,b){return b[0]-
-a[0]}function g(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group)){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",gb));var b=a.geometry;void 0!==b&&void 0===b.__webglInit&&(b.__webglInit=!0,b.addEventListener("dispose",hb),b instanceof THREE.BufferGeometry?Q.info.memory.geometries++:a instanceof THREE.Mesh?n(a,b):a instanceof THREE.Line?za.initLineBuffers(b,a):a instanceof THREE.PointCloud&&
-za.initPointCloudBuffers(b,a));if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh)if(b instanceof THREE.BufferGeometry)p(Y,b,a);else{if(b instanceof THREE.Geometry)for(var b=Aa[b.id],c=0,d=b.length;c<d;c++)p(Y,b[c],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?p(Y,b,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&ua.push({id:null,object:a,opaque:null,transparent:null,z:0});if(a instanceof THREE.Light)W.push(a);else if(a instanceof THREE.Sprite)V.push(a);
-else if(a instanceof THREE.LensFlare)ka.push(a);else if((b=Y[a.id])&&(!1===a.frustumCulled||!0===Ja.intersectsObject(a)))for(c=0,d=b.length;c<d;c++){var e=b[c],f=e,h=f.object,k=f.buffer,m=h.geometry,h=h.material;h instanceof THREE.MeshFaceMaterial?(h=h.materials[m instanceof THREE.BufferGeometry?0:k.materialIndex],f.material=h,h.transparent?ra.push(f):qa.push(f)):h&&(f.material=h,h.transparent?ra.push(f):qa.push(f));e.render=!0;!0===Q.sortObjects&&(pa.setFromMatrixPosition(a.matrixWorld),pa.applyProjection(Ka),
-e.z=pa.z)}}c=0;for(d=a.children.length;c<d;c++)g(a.children[c])}}function h(a,b,c,d,e){for(var f,g=0,h=a.length;g<h;g++){f=a[g];var k=f.object,m=f.buffer;z(k,b);if(e)f=e;else{f=f.material;if(!f)continue;s(f)}Q.setMaterialFaces(f);m instanceof THREE.BufferGeometry?Q.renderBufferDirect(b,c,d,f,m,k):Q.renderBuffer(b,c,d,f,m,k)}}function k(a,b,c,d,e,f){for(var g,h=0,k=a.length;h<k;h++){g=a[h];var m=g.object;if(m.visible){if(f)g=f;else{g=g[b];if(!g)continue;s(g)}Q.renderImmediateObject(c,d,e,g,m)}}}function l(a){var b=
-a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function n(a,b){var c=a.material,d=!1;if(void 0===Aa[b.id]||!0===b.groupsNeedUpdate){delete Y[a.id];for(var d=Aa,e=b.id,c=c instanceof THREE.MeshFaceMaterial,f=ba.get("OES_element_index_uint")?4294967296:65535,g,h={},k=b.morphTargets.length,m=b.morphNormals.length,l,n={},q=[],r=0,s=b.faces.length;r<s;r++){g=b.faces[r];var t=c?g.materialIndex:0;t in h||(h[t]={hash:t,counter:0});g=h[t].hash+"_"+h[t].counter;
-g in n||(l={id:ib++,faces3:[],materialIndex:t,vertices:0,numMorphTargets:k,numMorphNormals:m},n[g]=l,q.push(l));n[g].vertices+3>f&&(h[t].counter+=1,g=h[t].hash+"_"+h[t].counter,g in n||(l={id:ib++,faces3:[],materialIndex:t,vertices:0,numMorphTargets:k,numMorphNormals:m},n[g]=l,q.push(l)));n[g].faces3.push(r);n[g].vertices+=3}d[e]=q;b.groupsNeedUpdate=!1}e=Aa[b.id];c=0;for(f=e.length;c<f;c++)h=e[c],void 0===h.__webglVertexBuffer?(za.initMeshBuffers(h,a),b.verticesNeedUpdate=!0,b.morphTargetsNeedUpdate=
-!0,b.elementsNeedUpdate=!0,b.uvsNeedUpdate=!0,b.normalsNeedUpdate=!0,b.tangentsNeedUpdate=!0,d=b.colorsNeedUpdate=!0):d=!1,(d||void 0===a.__webglActive)&&p(Y,h,a);a.__webglActive=!0}function p(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function m(a){var c=a.geometry;if(c instanceof THREE.BufferGeometry){a=c.attributes;for(var c=c.attributesKeys,d=0,e=c.length;d<e;d++){var f=c[d],g=a[f],f="index"===f?q.ELEMENT_ARRAY_BUFFER:q.ARRAY_BUFFER;void 0===g.buffer?
-(g.buffer=q.createBuffer(),q.bindBuffer(f,g.buffer),q.bufferData(f,g.array,g instanceof THREE.DynamicBufferAttribute?q.DYNAMIC_DRAW:q.STATIC_DRAW),g.needsUpdate=!1):!0===g.needsUpdate&&(q.bindBuffer(f,g.buffer),void 0===g.updateRange||-1===g.updateRange.count?q.bufferSubData(f,0,g.array):0===g.updateRange.count?THREE.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
-(q.bufferSubData(f,g.updateRange.offset*g.array.BYTES_PER_ELEMENT,g.array.subarray(g.updateRange.offset,g.updateRange.offset+g.updateRange.count)),g.updateRange.count=0),g.needsUpdate=!1)}}else if(a instanceof THREE.Mesh){!0===c.groupsNeedUpdate&&n(a,c);e=Aa[c.id];d=0;for(g=e.length;d<g;d++){var f=e[d],h=b(a,f),k=h.attributes&&r(h);(c.verticesNeedUpdate||c.morphTargetsNeedUpdate||c.elementsNeedUpdate||c.uvsNeedUpdate||c.normalsNeedUpdate||c.colorsNeedUpdate||c.tangentsNeedUpdate||k)&&za.setMeshBuffers(f,
-a,q.DYNAMIC_DRAW,!c.dynamic,h)}c.verticesNeedUpdate=!1;c.morphTargetsNeedUpdate=!1;c.elementsNeedUpdate=!1;c.uvsNeedUpdate=!1;c.normalsNeedUpdate=!1;c.colorsNeedUpdate=!1;c.tangentsNeedUpdate=!1;h.attributes&&t(h)}else a instanceof THREE.Line?(h=b(a,c),k=h.attributes&&r(h),(c.verticesNeedUpdate||c.colorsNeedUpdate||c.lineDistancesNeedUpdate||k)&&za.setLineBuffers(c,q.DYNAMIC_DRAW),c.verticesNeedUpdate=!1,c.colorsNeedUpdate=!1,c.lineDistancesNeedUpdate=!1,h.attributes&&t(h)):a instanceof THREE.PointCloud&&
-(h=b(a,c),k=h.attributes&&r(h),(c.verticesNeedUpdate||c.colorsNeedUpdate||k)&&za.setPointCloudBuffers(c,q.DYNAMIC_DRAW,a),c.verticesNeedUpdate=!1,c.colorsNeedUpdate=!1,h.attributes&&t(h))}function r(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function t(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function s(a){!0===a.transparent?U.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):U.setBlending(THREE.NoBlending);
-U.setDepthTest(a.depthTest);U.setDepthWrite(a.depthWrite);U.setColorWrite(a.colorWrite);U.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function u(a,b,c,d,e){var f,g,h,k;jb=0;if(d.needsUpdate){d.program&&Mb(d);d.addEventListener("dispose",Nb);var m=Wb[d.type];if(m){var l=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,
-fragmentShader:d.fragmentShader};for(var n=0,p=0,r=0,t=0,s=0,u=b.length;s<u;s++){var z=b[s];z.onlyShadow||!1===z.visible||(z instanceof THREE.DirectionalLight&&n++,z instanceof THREE.PointLight&&p++,z instanceof THREE.SpotLight&&r++,z instanceof THREE.HemisphereLight&&t++)}f=n;g=p;h=r;k=t;for(var y,A=0,B=0,F=b.length;B<F;B++){var D=b[B];D.castShadow&&(D instanceof THREE.SpotLight&&A++,D instanceof THREE.DirectionalLight&&!D.shadowCascade&&A++)}y=A;var M;if(rb&&e&&e.skeleton&&e.skeleton.useVertexTexture)M=
-1024;else{var J=q.getParameter(q.MAX_VERTEX_UNIFORM_VECTORS),N=Math.floor((J-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(N=Math.min(e.skeleton.bones.length,N),N<e.skeleton.bones.length&&THREE.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+N+" (try OpenGL instead of ANGLE)"));M=N}var O={precision:G,supportsVertexTextures:sb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,bumpMap:!!d.bumpMap,
-normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:na,skinning:d.skinning,maxBones:M,useVertexTexture:rb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:Q.maxMorphTargets,maxMorphNormals:Q.maxMorphNormals,maxDirLights:f,
-maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:y,shadowMapEnabled:oa.enabled&&e.receiveShadow&&0<y,shadowMapType:oa.type,shadowMapDebug:oa.debug,shadowMapCascade:oa.cascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},K=[];m?K.push(m):(K.push(d.fragmentShader),K.push(d.vertexShader));if(void 0!==d.defines)for(var L in d.defines)K.push(L),K.push(d.defines[L]);for(L in O)K.push(L),K.push(O[L]);for(var P=
-K.join(),R,V=0,ua=va.length;V<ua;V++){var U=va[V];if(U.code===P){R=U;R.usedTimes++;break}}void 0===R&&(R=new THREE.WebGLProgram(Q,P,d,O),va.push(R),Q.info.memory.programs=va.length);d.program=R;var Y=R.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var ra,qa="morphTarget",W=0;W<Q.maxMorphTargets;W++)ra=qa+W,0<=Y[ra]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,qa="morphNormal",W=0;W<Q.maxMorphNormals;W++)ra=qa+W,0<=Y[ra]&&d.numSupportedMorphNormals++;
-d.uniformsList=[];for(var ka in d.__webglShader.uniforms){var $=d.program.uniforms[ka];$&&d.uniformsList.push([d.__webglShader.uniforms[ka],$])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(Q.maxMorphTargets));var ba=!1,ta=!1,ea=!1,ma=d.program,fa=ma.uniforms,S=d.__webglShader.uniforms;ma.id!==La&&(q.useProgram(ma.program),La=ma.id,ea=ta=ba=!0);d.id!==Ba&&(-1===Ba&&(ea=!0),Ba=d.id,ta=!0);if(ba||a!==Ya)q.uniformMatrix4fv(fa.projectionMatrix,
-!1,a.projectionMatrix.elements),na&&q.uniform1f(fa.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Ya&&(Ya=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==fa.cameraPosition&&(pa.setFromMatrixPosition(a.matrixWorld),q.uniform3f(fa.cameraPosition,pa.x,pa.y,pa.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==fa.viewMatrix&&q.uniformMatrix4fv(fa.viewMatrix,
-!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==fa.bindMatrix&&q.uniformMatrix4fv(fa.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==fa.bindMatrixInverse&&q.uniformMatrix4fv(fa.bindMatrixInverse,!1,e.bindMatrixInverse.elements),rb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==fa.boneTexture){var za=x();q.uniform1i(fa.boneTexture,za);Q.setTexture(e.skeleton.boneTexture,za)}null!==fa.boneTextureWidth&&q.uniform1i(fa.boneTextureWidth,e.skeleton.boneTextureWidth);
-null!==fa.boneTextureHeight&&q.uniform1i(fa.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==fa.boneGlobalMatrices&&q.uniformMatrix4fv(fa.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(ta){c&&d.fog&&(S.fogColor.value=c.color,c instanceof THREE.Fog?(S.fogNear.value=c.near,S.fogFar.value=c.far):c instanceof THREE.FogExp2&&(S.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(kb){var ea=
-!0,da,wa,ca,Aa=0,Ha=0,Ia=0,Ma,Ra,Sa,Ua,Ja,ga=Ob,Ka=ga.directional.colors,Ta=ga.directional.positions,tb=ga.point.colors,ub=ga.point.positions,gb=ga.point.distances,hb=ga.point.decays,vb=ga.spot.colors,wb=ga.spot.positions,ib=ga.spot.distances,xb=ga.spot.directions,nb=ga.spot.anglesCos,ob=ga.spot.exponents,pb=ga.spot.decays,yb=ga.hemi.skyColors,zb=ga.hemi.groundColors,Ab=ga.hemi.positions,Za=0,Na=0,Ca=0,Va=0,Bb=0,Cb=0,Db=0,lb=0,$a=0,ab=0,Ea=0,Wa=0;da=0;for(wa=b.length;da<wa;da++)ca=b[da],ca.onlyShadow||
-(Ma=ca.color,Ua=ca.intensity,Ja=ca.distance,ca instanceof THREE.AmbientLight?ca.visible&&(Aa+=Ma.r,Ha+=Ma.g,Ia+=Ma.b):ca instanceof THREE.DirectionalLight?(Bb+=1,ca.visible&&(ia.setFromMatrixPosition(ca.matrixWorld),pa.setFromMatrixPosition(ca.target.matrixWorld),ia.sub(pa),ia.normalize(),$a=3*Za,Ta[$a]=ia.x,Ta[$a+1]=ia.y,Ta[$a+2]=ia.z,w(Ka,$a,Ma,Ua),Za+=1)):ca instanceof THREE.PointLight?(Cb+=1,ca.visible&&(ab=3*Na,w(tb,ab,Ma,Ua),pa.setFromMatrixPosition(ca.matrixWorld),ub[ab]=pa.x,ub[ab+1]=pa.y,
-ub[ab+2]=pa.z,gb[Na]=Ja,hb[Na]=0===ca.distance?0:ca.decay,Na+=1)):ca instanceof THREE.SpotLight?(Db+=1,ca.visible&&(Ea=3*Ca,w(vb,Ea,Ma,Ua),ia.setFromMatrixPosition(ca.matrixWorld),wb[Ea]=ia.x,wb[Ea+1]=ia.y,wb[Ea+2]=ia.z,ib[Ca]=Ja,pa.setFromMatrixPosition(ca.target.matrixWorld),ia.sub(pa),ia.normalize(),xb[Ea]=ia.x,xb[Ea+1]=ia.y,xb[Ea+2]=ia.z,nb[Ca]=Math.cos(ca.angle),ob[Ca]=ca.exponent,pb[Ca]=0===ca.distance?0:ca.decay,Ca+=1)):ca instanceof THREE.HemisphereLight&&(lb+=1,ca.visible&&(ia.setFromMatrixPosition(ca.matrixWorld),
-ia.normalize(),Wa=3*Va,Ab[Wa]=ia.x,Ab[Wa+1]=ia.y,Ab[Wa+2]=ia.z,Ra=ca.color,Sa=ca.groundColor,w(yb,Wa,Ra,Ua),w(zb,Wa,Sa,Ua),Va+=1)));da=3*Za;for(wa=Math.max(Ka.length,3*Bb);da<wa;da++)Ka[da]=0;da=3*Na;for(wa=Math.max(tb.length,3*Cb);da<wa;da++)tb[da]=0;da=3*Ca;for(wa=Math.max(vb.length,3*Db);da<wa;da++)vb[da]=0;da=3*Va;for(wa=Math.max(yb.length,3*lb);da<wa;da++)yb[da]=0;da=3*Va;for(wa=Math.max(zb.length,3*lb);da<wa;da++)zb[da]=0;ga.directional.length=Za;ga.point.length=Na;ga.spot.length=Ca;ga.hemi.length=
-Va;ga.ambient[0]=Aa;ga.ambient[1]=Ha;ga.ambient[2]=Ia;kb=!1}if(ea){var la=Ob;S.ambientLightColor.value=la.ambient;S.directionalLightColor.value=la.directional.colors;S.directionalLightDirection.value=la.directional.positions;S.pointLightColor.value=la.point.colors;S.pointLightPosition.value=la.point.positions;S.pointLightDistance.value=la.point.distances;S.pointLightDecay.value=la.point.decays;S.spotLightColor.value=la.spot.colors;S.spotLightPosition.value=la.spot.positions;S.spotLightDistance.value=
-la.spot.distances;S.spotLightDirection.value=la.spot.directions;S.spotLightAngleCos.value=la.spot.anglesCos;S.spotLightExponent.value=la.spot.exponents;S.spotLightDecay.value=la.spot.decays;S.hemisphereLightSkyColor.value=la.hemi.skyColors;S.hemisphereLightGroundColor.value=la.hemi.groundColors;S.hemisphereLightDirection.value=la.hemi.positions;v(S,!0)}else v(S,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){S.opacity.value=
-d.opacity;S.diffuse.value=d.color;S.map.value=d.map;S.lightMap.value=d.lightMap;S.lightMapIntensity.value=d.lightMapIntensity;S.aoMap.value=d.aoMap;S.aoMapIntensity.value=d.aoMapIntensity;S.specularMap.value=d.specularMap;S.alphaMap.value=d.alphaMap;d.bumpMap&&(S.bumpMap.value=d.bumpMap,S.bumpScale.value=d.bumpScale);d.normalMap&&(S.normalMap.value=d.normalMap,S.normalScale.value.copy(d.normalScale));var Fa;d.map?Fa=d.map:d.specularMap?Fa=d.specularMap:d.normalMap?Fa=d.normalMap:d.bumpMap?Fa=d.bumpMap:
-d.alphaMap&&(Fa=d.alphaMap);if(void 0!==Fa){var cb=Fa.offset,db=Fa.repeat;S.offsetRepeat.value.set(cb.x,cb.y,db.x,db.y)}S.envMap.value=d.envMap;S.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;S.reflectivity.value=d.reflectivity;S.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)S.diffuse.value=d.color,S.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)S.diffuse.value=d.color,S.opacity.value=d.opacity,S.dashSize.value=d.dashSize,
-S.totalSize.value=d.dashSize+d.gapSize,S.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(S.psColor.value=d.color,S.opacity.value=d.opacity,S.size.value=d.size,S.scale.value=C.height/2,S.map.value=d.map,null!==d.map){var eb=d.map.offset,fb=d.map.repeat;S.offsetRepeat.value.set(eb.x,eb.y,fb.x,fb.y)}}else d instanceof THREE.MeshPhongMaterial?(S.shininess.value=d.shininess,S.emissive.value=d.emissive,S.specular.value=d.specular,d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof
-THREE.MeshLambertMaterial?(S.emissive.value=d.emissive,d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(S.mNear.value=a.near,S.mFar.value=a.far,S.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(S.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&S.shadowMatrix)for(var Xa=0,Eb=0,qb=b.length;Eb<qb;Eb++){var Da=b[Eb];Da.castShadow&&(Da instanceof THREE.SpotLight||Da instanceof THREE.DirectionalLight&&!Da.shadowCascade)&&(S.shadowMap.value[Xa]=
-Da.shadowMap,S.shadowMapSize.value[Xa]=Da.shadowMapSize,S.shadowMatrix.value[Xa]=Da.shadowMatrix,S.shadowDarkness.value[Xa]=Da.shadowDarkness,S.shadowBias.value[Xa]=Da.shadowBias,Xa++)}for(var Fb=d.uniformsList,xa,Oa,ya,mb=0,Jb=Fb.length;mb<Jb;mb++){var Z=Fb[mb][0];if(!1!==Z.needsUpdate){var Pb=Z.type,T=Z.value,aa=Fb[mb][1];switch(Pb){case "1i":q.uniform1i(aa,T);break;case "1f":q.uniform1f(aa,T);break;case "2f":q.uniform2f(aa,T[0],T[1]);break;case "3f":q.uniform3f(aa,T[0],T[1],T[2]);break;case "4f":q.uniform4f(aa,
-T[0],T[1],T[2],T[3]);break;case "1iv":q.uniform1iv(aa,T);break;case "3iv":q.uniform3iv(aa,T);break;case "1fv":q.uniform1fv(aa,T);break;case "2fv":q.uniform2fv(aa,T);break;case "3fv":q.uniform3fv(aa,T);break;case "4fv":q.uniform4fv(aa,T);break;case "Matrix3fv":q.uniformMatrix3fv(aa,!1,T);break;case "Matrix4fv":q.uniformMatrix4fv(aa,!1,T);break;case "i":q.uniform1i(aa,T);break;case "f":q.uniform1f(aa,T);break;case "v2":q.uniform2f(aa,T.x,T.y);break;case "v3":q.uniform3f(aa,T.x,T.y,T.z);break;case "v4":q.uniform4f(aa,
-T.x,T.y,T.z,T.w);break;case "c":q.uniform3f(aa,T.r,T.g,T.b);break;case "iv1":q.uniform1iv(aa,T);break;case "iv":q.uniform3iv(aa,T);break;case "fv1":q.uniform1fv(aa,T);break;case "fv":q.uniform3fv(aa,T);break;case "v2v":void 0===Z._array&&(Z._array=new Float32Array(2*T.length));for(var X=0,sa=T.length;X<sa;X++)ya=2*X,Z._array[ya]=T[X].x,Z._array[ya+1]=T[X].y;q.uniform2fv(aa,Z._array);break;case "v3v":void 0===Z._array&&(Z._array=new Float32Array(3*T.length));X=0;for(sa=T.length;X<sa;X++)ya=3*X,Z._array[ya]=
-T[X].x,Z._array[ya+1]=T[X].y,Z._array[ya+2]=T[X].z;q.uniform3fv(aa,Z._array);break;case "v4v":void 0===Z._array&&(Z._array=new Float32Array(4*T.length));X=0;for(sa=T.length;X<sa;X++)ya=4*X,Z._array[ya]=T[X].x,Z._array[ya+1]=T[X].y,Z._array[ya+2]=T[X].z,Z._array[ya+3]=T[X].w;q.uniform4fv(aa,Z._array);break;case "m3":q.uniformMatrix3fv(aa,!1,T.elements);break;case "m3v":void 0===Z._array&&(Z._array=new Float32Array(9*T.length));X=0;for(sa=T.length;X<sa;X++)T[X].flattenToArrayOffset(Z._array,9*X);q.uniformMatrix3fv(aa,
-!1,Z._array);break;case "m4":q.uniformMatrix4fv(aa,!1,T.elements);break;case "m4v":void 0===Z._array&&(Z._array=new Float32Array(16*T.length));X=0;for(sa=T.length;X<sa;X++)T[X].flattenToArrayOffset(Z._array,16*X);q.uniformMatrix4fv(aa,!1,Z._array);break;case "t":xa=T;Oa=x();q.uniform1i(aa,Oa);if(!xa)continue;if(xa instanceof THREE.CubeTexture||xa.image instanceof Array&&6===xa.image.length){var ha=xa,Qb=Oa;if(6===ha.image.length)if(ha.needsUpdate){ha.image.__webglTextureCube||(ha.addEventListener("dispose",
-Gb),ha.image.__webglTextureCube=q.createTexture(),Q.info.memory.textures++);q.activeTexture(q.TEXTURE0+Qb);q.bindTexture(q.TEXTURE_CUBE_MAP,ha.image.__webglTextureCube);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,ha.flipY);for(var Rb=ha instanceof THREE.CompressedTexture,Hb=ha.image[0]instanceof THREE.DataTexture,Pa=[],ja=0;6>ja;ja++)Pa[ja]=!Q.autoScaleCubemaps||Rb||Hb?Hb?ha.image[ja].image:ha.image[ja]:H(ha.image[ja],Xb);var Sb=Pa[0],Tb=THREE.Math.isPowerOfTwo(Sb.width)&&THREE.Math.isPowerOfTwo(Sb.height),
-Ga=E(ha.format),Ib=E(ha.type);I(q.TEXTURE_CUBE_MAP,ha,Tb);for(ja=0;6>ja;ja++)if(Rb)for(var Qa,Ub=Pa[ja].mipmaps,bb=0,Kb=Ub.length;bb<Kb;bb++)Qa=Ub[bb],ha.format!==THREE.RGBAFormat&&ha.format!==THREE.RGBFormat?-1<Vb().indexOf(Ga)?q.compressedTexImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,bb,Ga,Qa.width,Qa.height,0,Qa.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,bb,Ga,Qa.width,Qa.height,
-0,Ga,Ib,Qa.data);else Hb?q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,0,Ga,Pa[ja].width,Pa[ja].height,0,Ga,Ib,Pa[ja].data):q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,0,Ga,Ga,Ib,Pa[ja]);ha.generateMipmaps&&Tb&&q.generateMipmap(q.TEXTURE_CUBE_MAP);ha.needsUpdate=!1;if(ha.onUpdate)ha.onUpdate(ha)}else q.activeTexture(q.TEXTURE0+Qb),q.bindTexture(q.TEXTURE_CUBE_MAP,ha.image.__webglTextureCube)}else if(xa instanceof THREE.WebGLRenderTargetCube){var Lb=xa;q.activeTexture(q.TEXTURE0+Oa);q.bindTexture(q.TEXTURE_CUBE_MAP,
-Lb.__webglTexture)}else Q.setTexture(xa,Oa);break;case "tv":void 0===Z._array&&(Z._array=[]);X=0;for(sa=Z.value.length;X<sa;X++)Z._array[X]=x();q.uniform1iv(aa,Z._array);X=0;for(sa=Z.value.length;X<sa;X++)xa=Z.value[X],Oa=Z._array[X],xa&&Q.setTexture(xa,Oa);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+Pb)}}}}q.uniformMatrix4fv(fa.modelViewMatrix,!1,e._modelViewMatrix.elements);fa.normalMatrix&&q.uniformMatrix3fv(fa.normalMatrix,!1,e._normalMatrix.elements);null!==fa.modelMatrix&&
-q.uniformMatrix4fv(fa.modelMatrix,!1,e.matrixWorld.elements);return ma}function v(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=
-b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function x(){var a=jb;a>=nb&&THREE.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+nb);jb+=1;return a}function z(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function w(a,b,c,d){a[b]=c.r*d;
-a[b+1]=c.g*d;a[b+2]=c.b*d}function I(a,b,c){c?(q.texParameteri(a,q.TEXTURE_WRAP_S,E(b.wrapS)),q.texParameteri(a,q.TEXTURE_WRAP_T,E(b.wrapT)),q.texParameteri(a,q.TEXTURE_MAG_FILTER,E(b.magFilter)),q.texParameteri(a,q.TEXTURE_MIN_FILTER,E(b.minFilter))):(q.texParameteri(a,q.TEXTURE_WRAP_S,q.CLAMP_TO_EDGE),q.texParameteri(a,q.TEXTURE_WRAP_T,q.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+
-b.sourceFile+" )"),q.texParameteri(a,q.TEXTURE_MAG_FILTER,B(b.magFilter)),q.texParameteri(a,q.TEXTURE_MIN_FILTER,B(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=ba.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||b.__currentAnisotropy)&&
-(q.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Q.getMaxAnisotropy())),b.__currentAnisotropy=b.anisotropy)}function H(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);THREE.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}
-function y(a,b){q.bindRenderbuffer(q.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_COMPONENT16,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_STENCIL,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a)):q.renderbufferStorage(q.RENDERBUFFER,q.RGBA4,b.width,b.height)}function F(a){a instanceof
-THREE.WebGLRenderTargetCube?(q.bindTexture(q.TEXTURE_CUBE_MAP,a.__webglTexture),q.generateMipmap(q.TEXTURE_CUBE_MAP),q.bindTexture(q.TEXTURE_CUBE_MAP,null)):(q.bindTexture(q.TEXTURE_2D,a.__webglTexture),q.generateMipmap(q.TEXTURE_2D),q.bindTexture(q.TEXTURE_2D,null))}function B(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?q.NEAREST:q.LINEAR}function E(a){var b;if(a===THREE.RepeatWrapping)return q.REPEAT;if(a===THREE.ClampToEdgeWrapping)return q.CLAMP_TO_EDGE;
-if(a===THREE.MirroredRepeatWrapping)return q.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return q.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return q.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return q.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return q.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return q.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return q.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return q.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return q.UNSIGNED_SHORT_4_4_4_4;
-if(a===THREE.UnsignedShort5551Type)return q.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return q.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return q.BYTE;if(a===THREE.ShortType)return q.SHORT;if(a===THREE.UnsignedShortType)return q.UNSIGNED_SHORT;if(a===THREE.IntType)return q.INT;if(a===THREE.UnsignedIntType)return q.UNSIGNED_INT;if(a===THREE.FloatType)return q.FLOAT;b=ba.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return q.ALPHA;
-if(a===THREE.RGBFormat)return q.RGB;if(a===THREE.RGBAFormat)return q.RGBA;if(a===THREE.LuminanceFormat)return q.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return q.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return q.FUNC_ADD;if(a===THREE.SubtractEquation)return q.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return q.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return q.ZERO;if(a===THREE.OneFactor)return q.ONE;if(a===THREE.SrcColorFactor)return q.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return q.ONE_MINUS_SRC_COLOR;
-if(a===THREE.SrcAlphaFactor)return q.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return q.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return q.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return q.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return q.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return q.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return q.SRC_ALPHA_SATURATE;b=ba.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;
-if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=ba.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
-if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=ba.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var C=void 0!==a.canvas?a.canvas:document.createElement("canvas"),N=void 0!==a.context?a.context:null,K=C.width,L=C.height,J=1,G=void 0!==a.precision?a.precision:"highp",A=void 0!==a.alpha?a.alpha:!1,M=void 0!==a.depth?a.depth:!0,
-R=void 0!==a.stencil?a.stencil:!0,O=void 0!==a.antialias?a.antialias:!1,D=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,$=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,na=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,P=new THREE.Color(0),ea=0,W=[],Y={},ua=[],qa=[],ra=[],V=[],ka=[];this.domElement=C;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=
-!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var Q=this,va=[],La=null,ta=null,Ba=-1,ma="",Ya=null,jb=0,Ha=0,Ia=0,Ra=C.width,Sa=C.height,ob=0,pb=0,Ja=new THREE.Frustum,Ka=new THREE.Matrix4,pa=new THREE.Vector3,ia=new THREE.Vector3,kb=!0,Ob={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,
-colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},q;try{var cb={alpha:A,depth:M,stencil:R,antialias:O,premultipliedAlpha:D,preserveDrawingBuffer:$};q=N||C.getContext("webgl",cb)||C.getContext("experimental-webgl",cb);if(null===q){if(null!==C.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}C.addEventListener("webglcontextlost",
-function(a){a.preventDefault();db();eb();Y={}},!1)}catch(Jb){THREE.error("THREE.WebGLRenderer: "+Jb)}var U=new THREE.WebGLState(q,E);void 0===q.getShaderPrecisionFormat&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var ba=new THREE.WebGLExtensions(q),za=new THREE.WebGLBuffers(q,this.info,ba,b);ba.get("OES_texture_float");ba.get("OES_texture_float_linear");ba.get("OES_texture_half_float");ba.get("OES_texture_half_float_linear");ba.get("OES_standard_derivatives");
-na&&ba.get("EXT_frag_depth");var Ta=function(a,b,c,d){!0===D&&(a*=d,b*=d,c*=d);q.clearColor(a,b,c,d)},eb=function(){q.clearColor(0,0,0,1);q.clearDepth(1);q.clearStencil(0);q.enable(q.DEPTH_TEST);q.depthFunc(q.LEQUAL);q.frontFace(q.CCW);q.cullFace(q.BACK);q.enable(q.CULL_FACE);q.enable(q.BLEND);q.blendEquation(q.FUNC_ADD);q.blendFunc(q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA);q.viewport(Ha,Ia,Ra,Sa);Ta(P.r,P.g,P.b,ea)},db=function(){Ya=La=null;ma="";Ba=-1;kb=!0;U.reset()};eb();this.context=q;this.extensions=
-ba;this.state=U;var oa=new THREE.WebGLShadowMap(this,W,Y,ua);this.shadowMap=oa;var nb=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS),Kb=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Lb=q.getParameter(q.MAX_TEXTURE_SIZE),Xb=q.getParameter(q.MAX_CUBE_MAP_TEXTURE_SIZE),sb=0<Kb,rb=sb&&ba.get("OES_texture_float"),Yb=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.HIGH_FLOAT),Zb=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.MEDIUM_FLOAT),$b=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.HIGH_FLOAT),ac=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,
-q.MEDIUM_FLOAT),Vb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(ba.get("WEBGL_compressed_texture_pvrtc")||ba.get("WEBGL_compressed_texture_s3tc"))for(var b=q.getParameter(q.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),bc=0<Yb.precision&&0<$b.precision,fb=0<Zb.precision&&0<ac.precision;"highp"!==G||bc||(fb?(G="mediump",THREE.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(G="lowp",THREE.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));
-"mediump"!==G||fb||(G="lowp",THREE.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var cc=new THREE.SpritePlugin(this,V),dc=new THREE.LensFlarePlugin(this,ka);this.getContext=function(){return q};this.forceContextLoss=function(){ba.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return sb};this.supportsFloatTextures=function(){return ba.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return ba.get("OES_texture_half_float")};this.supportsStandardDerivatives=
-function(){return ba.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return ba.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return ba.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return ba.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=ba.get("EXT_texture_filter_anisotropic");return a=null!==b?q.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):
+THREE.WebGLRenderer=function(a){function b(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function c(a,b,c,d){var e;if(c instanceof THREE.InstancedBufferGeometry&&(e=Y.get("ANGLE_instanced_arrays"),null===e)){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}var f=c.attributes,g=b.attributes;b=b.attributesKeys;for(var h=0,k=b.length;h<
+k;h++){var m=b[h],l=g[m];if(0<=l){var n=f[m];if(void 0!==n)if(m=n.itemSize,U.enableAttribute(l),n instanceof THREE.InterleavedBufferAttribute){var p=n.data,r=p.stride,s=n.offset;q.bindBuffer(q.ARRAY_BUFFER,n.data.buffer);q.vertexAttribPointer(l,m,q.FLOAT,!1,r*p.array.BYTES_PER_ELEMENT,(d*r+s)*p.array.BYTES_PER_ELEMENT);if(p instanceof THREE.InstancedInterleavedBuffer){if(null===e){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");
+return}e.vertexAttribDivisorANGLE(l,p.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=p.array.length/p.stride*p.meshPerAttribute)}}else{if(q.bindBuffer(q.ARRAY_BUFFER,n.buffer),q.vertexAttribPointer(l,m,q.FLOAT,!1,0,d*m*4),n instanceof THREE.InstancedBufferAttribute){if(null===e){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(l,n.meshPerAttribute);
+void 0===c.maxInstancedCount&&(c.maxInstancedCount=n.array.length/n.itemSize*n.meshPerAttribute)}}else void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?q.vertexAttrib2fv(l,a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&q.vertexAttrib3fv(l,a.defaultAttributeValues[m]))}}U.disableUnusedAttributes()}function d(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:
+a.z!==b.z?a.z-b.z:a.id-b.id}function e(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function f(a,b){return b[0]-a[0]}function g(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group)){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",gb));var b=a.geometry;void 0!==b&&void 0===b.__webglInit&&(b.__webglInit=
+!0,b.addEventListener("dispose",hb),b instanceof THREE.BufferGeometry?Q.info.memory.geometries++:a instanceof THREE.Mesh?n(a,b):a instanceof THREE.Line?za.initLineBuffers(b,a):a instanceof THREE.PointCloud&&za.initPointCloudBuffers(b,a));if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh)if(b instanceof THREE.BufferGeometry)p(X,b,a);else{if(b instanceof THREE.Geometry)for(var b=Aa[b.id],c=0,d=b.length;c<d;c++)p(X,b[c],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?
+p(X,b,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&ua.push({id:null,object:a,opaque:null,transparent:null,z:0});if(a instanceof THREE.Light)$.push(a);else if(a instanceof THREE.Sprite)V.push(a);else if(a instanceof THREE.LensFlare)la.push(a);else if((b=X[a.id])&&(!1===a.frustumCulled||!0===Ja.intersectsObject(a)))for(c=0,d=b.length;c<d;c++){var e=b[c],f=e,h=f.object,k=f.buffer,m=h.geometry,h=h.material;h instanceof THREE.MeshFaceMaterial?(h=h.materials[m instanceof THREE.BufferGeometry?
+0:k.materialIndex],f.material=h,h.transparent?ra.push(f):ka.push(f)):h&&(f.material=h,h.transparent?ra.push(f):ka.push(f));e.render=!0;!0===Q.sortObjects&&(qa.setFromMatrixPosition(a.matrixWorld),qa.applyProjection(Ka),e.z=qa.z)}}c=0;for(d=a.children.length;c<d;c++)g(a.children[c])}}function h(a,b,c,d,e){for(var f,g=0,h=a.length;g<h;g++){f=a[g];var k=f.object,m=f.buffer;z(k,b);if(e)f=e;else{f=f.material;if(!f)continue;s(f)}Q.setMaterialFaces(f);m instanceof THREE.BufferGeometry?Q.renderBufferDirect(b,
+c,d,f,m,k):Q.renderBuffer(b,c,d,f,m,k)}}function k(a,b,c,d,e,f){for(var g,h=0,k=a.length;h<k;h++){g=a[h];var m=g.object;if(m.visible){if(f)g=f;else{g=g[b];if(!g)continue;s(g)}Q.renderImmediateObject(c,d,e,g,m)}}}function l(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function n(a,b){var c=a.material,d=!1;if(void 0===Aa[b.id]||!0===b.groupsNeedUpdate){delete X[a.id];for(var d=Aa,e=b.id,c=c instanceof THREE.MeshFaceMaterial,f=Y.get("OES_element_index_uint")?
+4294967296:65535,g,h={},k=b.morphTargets.length,m=b.morphNormals.length,l,n={},q=[],r=0,s=b.faces.length;r<s;r++){g=b.faces[r];var t=c?g.materialIndex:0;t in h||(h[t]={hash:t,counter:0});g=h[t].hash+"_"+h[t].counter;g in n||(l={id:ib++,faces3:[],materialIndex:t,vertices:0,numMorphTargets:k,numMorphNormals:m},n[g]=l,q.push(l));n[g].vertices+3>f&&(h[t].counter+=1,g=h[t].hash+"_"+h[t].counter,g in n||(l={id:ib++,faces3:[],materialIndex:t,vertices:0,numMorphTargets:k,numMorphNormals:m},n[g]=l,q.push(l)));
+n[g].faces3.push(r);n[g].vertices+=3}d[e]=q;b.groupsNeedUpdate=!1}e=Aa[b.id];c=0;for(f=e.length;c<f;c++)h=e[c],void 0===h.__webglVertexBuffer?(za.initMeshBuffers(h,a),b.verticesNeedUpdate=!0,b.morphTargetsNeedUpdate=!0,b.elementsNeedUpdate=!0,b.uvsNeedUpdate=!0,b.normalsNeedUpdate=!0,b.tangentsNeedUpdate=!0,d=b.colorsNeedUpdate=!0):d=!1,(d||void 0===a.__webglActive)&&p(X,h,a);a.__webglActive=!0}function p(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function m(a){var c=
+a.geometry;if(c instanceof THREE.BufferGeometry){a=c.attributes;for(var c=c.attributesKeys,d=0,e=c.length;d<e;d++){var f=c[d],g=a[f],f="index"===f?q.ELEMENT_ARRAY_BUFFER:q.ARRAY_BUFFER,g=g instanceof THREE.InterleavedBufferAttribute?g.data:g;if(void 0===g.buffer){g.buffer=q.createBuffer();q.bindBuffer(f,g.buffer);var h=q.STATIC_DRAW;if(g instanceof THREE.DynamicBufferAttribute||g instanceof THREE.InstancedBufferAttribute&&!0===g.dynamic||g instanceof THREE.InterleavedBuffer&&!0===g.dynamic)h=q.DYNAMIC_DRAW;
+q.bufferData(f,g.array,h);g.needsUpdate=!1}else!0===g.needsUpdate&&(q.bindBuffer(f,g.buffer),void 0===g.updateRange||-1===g.updateRange.count?q.bufferSubData(f,0,g.array):0===g.updateRange.count?THREE.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(q.bufferSubData(f,g.updateRange.offset*g.array.BYTES_PER_ELEMENT,g.array.subarray(g.updateRange.offset,g.updateRange.offset+
+g.updateRange.count)),g.updateRange.count=0),g.needsUpdate=!1)}}else if(a instanceof THREE.Mesh){!0===c.groupsNeedUpdate&&n(a,c);e=Aa[c.id];d=0;for(f=e.length;d<f;d++){var g=e[d],h=b(a,g),k=h.attributes&&r(h);(c.verticesNeedUpdate||c.morphTargetsNeedUpdate||c.elementsNeedUpdate||c.uvsNeedUpdate||c.normalsNeedUpdate||c.colorsNeedUpdate||c.tangentsNeedUpdate||k)&&za.setMeshBuffers(g,a,q.DYNAMIC_DRAW,!c.dynamic,h)}c.verticesNeedUpdate=!1;c.morphTargetsNeedUpdate=!1;c.elementsNeedUpdate=!1;c.uvsNeedUpdate=
+!1;c.normalsNeedUpdate=!1;c.colorsNeedUpdate=!1;c.tangentsNeedUpdate=!1;h.attributes&&t(h)}else a instanceof THREE.Line?(h=b(a,c),k=h.attributes&&r(h),(c.verticesNeedUpdate||c.colorsNeedUpdate||c.lineDistancesNeedUpdate||k)&&za.setLineBuffers(c,q.DYNAMIC_DRAW),c.verticesNeedUpdate=!1,c.colorsNeedUpdate=!1,c.lineDistancesNeedUpdate=!1,h.attributes&&t(h)):a instanceof THREE.PointCloud&&(h=b(a,c),k=h.attributes&&r(h),(c.verticesNeedUpdate||c.colorsNeedUpdate||k)&&za.setPointCloudBuffers(c,q.DYNAMIC_DRAW,
+a),c.verticesNeedUpdate=!1,c.colorsNeedUpdate=!1,h.attributes&&t(h))}function r(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function t(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function s(a){!0===a.transparent?U.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):U.setBlending(THREE.NoBlending);U.setDepthTest(a.depthTest);U.setDepthWrite(a.depthWrite);U.setColorWrite(a.colorWrite);U.setPolygonOffset(a.polygonOffset,
+a.polygonOffsetFactor,a.polygonOffsetUnits)}function u(a,b,c,d,e){var f,g,h,k;jb=0;if(d.needsUpdate){d.program&&Mb(d);d.addEventListener("dispose",Nb);var m=Wb[d.type];if(m){var l=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var n=0,p=0,r=0,t=0,s=0,u=b.length;s<u;s++){var z=b[s];z.onlyShadow||!1===
+z.visible||(z instanceof THREE.DirectionalLight&&n++,z instanceof THREE.PointLight&&p++,z instanceof THREE.SpotLight&&r++,z instanceof THREE.HemisphereLight&&t++)}f=n;g=p;h=r;k=t;for(var y,A=0,B=0,F=b.length;B<F;B++){var D=b[B];D.castShadow&&(D instanceof THREE.SpotLight&&A++,D instanceof THREE.DirectionalLight&&!D.shadowCascade&&A++)}y=A;var M;if(rb&&e&&e.skeleton&&e.skeleton.useVertexTexture)M=1024;else{var J=q.getParameter(q.MAX_VERTEX_UNIFORM_VECTORS),N=Math.floor((J-20)/4);void 0!==e&&e instanceof
+THREE.SkinnedMesh&&(N=Math.min(e.skeleton.bones.length,N),N<e.skeleton.bones.length&&THREE.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+N+" (try OpenGL instead of ANGLE)"));M=N}var O={precision:G,supportsVertexTextures:sb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,
+fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:oa,skinning:d.skinning,maxBones:M,useVertexTexture:rb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:Q.maxMorphTargets,maxMorphNormals:Q.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:y,shadowMapEnabled:pa.enabled&&e.receiveShadow&&0<y,
+shadowMapType:pa.type,shadowMapDebug:pa.debug,shadowMapCascade:pa.cascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},K=[];m?K.push(m):(K.push(d.fragmentShader),K.push(d.vertexShader));if(void 0!==d.defines)for(var L in d.defines)K.push(L),K.push(d.defines[L]);for(L in O)K.push(L),K.push(O[L]);for(var P=K.join(),R,V=0,ua=va.length;V<ua;V++){var U=va[V];if(U.code===P){R=U;R.usedTimes++;break}}void 0===R&&(R=new THREE.WebGLProgram(Q,
+P,d,O),va.push(R),Q.info.memory.programs=va.length);d.program=R;var X=R.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var ra,Y="morphTarget",ka=0;ka<Q.maxMorphTargets;ka++)ra=Y+ka,0<=X[ra]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,Y="morphNormal",ka=0;ka<Q.maxMorphNormals;ka++)ra=Y+ka,0<=X[ra]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var $ in d.__webglShader.uniforms){var la=d.program.uniforms[$];la&&d.uniformsList.push([d.__webglShader.uniforms[$],
+la])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(Q.maxMorphTargets));var aa=!1,ta=!1,ea=!1,na=d.program,fa=na.uniforms,S=d.__webglShader.uniforms;na.id!==La&&(q.useProgram(na.program),La=na.id,ea=ta=aa=!0);d.id!==Ba&&(-1===Ba&&(ea=!0),Ba=d.id,ta=!0);if(aa||a!==Ya)q.uniformMatrix4fv(fa.projectionMatrix,!1,a.projectionMatrix.elements),oa&&q.uniform1f(fa.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Ya&&(Ya=a),(d instanceof THREE.ShaderMaterial||
+d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==fa.cameraPosition&&(qa.setFromMatrixPosition(a.matrixWorld),q.uniform3f(fa.cameraPosition,qa.x,qa.y,qa.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==fa.viewMatrix&&q.uniformMatrix4fv(fa.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==fa.bindMatrix&&q.uniformMatrix4fv(fa.bindMatrix,
+!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==fa.bindMatrixInverse&&q.uniformMatrix4fv(fa.bindMatrixInverse,!1,e.bindMatrixInverse.elements),rb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==fa.boneTexture){var za=x();q.uniform1i(fa.boneTexture,za);Q.setTexture(e.skeleton.boneTexture,za)}null!==fa.boneTextureWidth&&q.uniform1i(fa.boneTextureWidth,e.skeleton.boneTextureWidth);null!==fa.boneTextureHeight&&q.uniform1i(fa.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&
+null!==fa.boneGlobalMatrices&&q.uniformMatrix4fv(fa.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(ta){c&&d.fog&&(S.fogColor.value=c.color,c instanceof THREE.Fog?(S.fogNear.value=c.near,S.fogFar.value=c.far):c instanceof THREE.FogExp2&&(S.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(kb){var ea=!0,da,wa,ca,Aa=0,Ha=0,Ia=0,Ma,Ra,Sa,Ua,Ja,ga=Ob,Ka=ga.directional.colors,Ta=ga.directional.positions,tb=ga.point.colors,ub=ga.point.positions,
+gb=ga.point.distances,hb=ga.point.decays,vb=ga.spot.colors,wb=ga.spot.positions,ib=ga.spot.distances,xb=ga.spot.directions,nb=ga.spot.anglesCos,ob=ga.spot.exponents,pb=ga.spot.decays,yb=ga.hemi.skyColors,zb=ga.hemi.groundColors,Ab=ga.hemi.positions,Za=0,Na=0,Ca=0,Va=0,Bb=0,Cb=0,Db=0,lb=0,$a=0,ab=0,Ea=0,Wa=0;da=0;for(wa=b.length;da<wa;da++)ca=b[da],ca.onlyShadow||(Ma=ca.color,Ua=ca.intensity,Ja=ca.distance,ca instanceof THREE.AmbientLight?ca.visible&&(Aa+=Ma.r,Ha+=Ma.g,Ia+=Ma.b):ca instanceof THREE.DirectionalLight?
+(Bb+=1,ca.visible&&(ia.setFromMatrixPosition(ca.matrixWorld),qa.setFromMatrixPosition(ca.target.matrixWorld),ia.sub(qa),ia.normalize(),$a=3*Za,Ta[$a+0]=ia.x,Ta[$a+1]=ia.y,Ta[$a+2]=ia.z,w(Ka,$a,Ma,Ua),Za+=1)):ca instanceof THREE.PointLight?(Cb+=1,ca.visible&&(ab=3*Na,w(tb,ab,Ma,Ua),qa.setFromMatrixPosition(ca.matrixWorld),ub[ab+0]=qa.x,ub[ab+1]=qa.y,ub[ab+2]=qa.z,gb[Na]=Ja,hb[Na]=0===ca.distance?0:ca.decay,Na+=1)):ca instanceof THREE.SpotLight?(Db+=1,ca.visible&&(Ea=3*Ca,w(vb,Ea,Ma,Ua),ia.setFromMatrixPosition(ca.matrixWorld),
+wb[Ea+0]=ia.x,wb[Ea+1]=ia.y,wb[Ea+2]=ia.z,ib[Ca]=Ja,qa.setFromMatrixPosition(ca.target.matrixWorld),ia.sub(qa),ia.normalize(),xb[Ea+0]=ia.x,xb[Ea+1]=ia.y,xb[Ea+2]=ia.z,nb[Ca]=Math.cos(ca.angle),ob[Ca]=ca.exponent,pb[Ca]=0===ca.distance?0:ca.decay,Ca+=1)):ca instanceof THREE.HemisphereLight&&(lb+=1,ca.visible&&(ia.setFromMatrixPosition(ca.matrixWorld),ia.normalize(),Wa=3*Va,Ab[Wa+0]=ia.x,Ab[Wa+1]=ia.y,Ab[Wa+2]=ia.z,Ra=ca.color,Sa=ca.groundColor,w(yb,Wa,Ra,Ua),w(zb,Wa,Sa,Ua),Va+=1)));da=3*Za;for(wa=
+Math.max(Ka.length,3*Bb);da<wa;da++)Ka[da]=0;da=3*Na;for(wa=Math.max(tb.length,3*Cb);da<wa;da++)tb[da]=0;da=3*Ca;for(wa=Math.max(vb.length,3*Db);da<wa;da++)vb[da]=0;da=3*Va;for(wa=Math.max(yb.length,3*lb);da<wa;da++)yb[da]=0;da=3*Va;for(wa=Math.max(zb.length,3*lb);da<wa;da++)zb[da]=0;ga.directional.length=Za;ga.point.length=Na;ga.spot.length=Ca;ga.hemi.length=Va;ga.ambient[0]=Aa;ga.ambient[1]=Ha;ga.ambient[2]=Ia;kb=!1}if(ea){var ma=Ob;S.ambientLightColor.value=ma.ambient;S.directionalLightColor.value=
+ma.directional.colors;S.directionalLightDirection.value=ma.directional.positions;S.pointLightColor.value=ma.point.colors;S.pointLightPosition.value=ma.point.positions;S.pointLightDistance.value=ma.point.distances;S.pointLightDecay.value=ma.point.decays;S.spotLightColor.value=ma.spot.colors;S.spotLightPosition.value=ma.spot.positions;S.spotLightDistance.value=ma.spot.distances;S.spotLightDirection.value=ma.spot.directions;S.spotLightAngleCos.value=ma.spot.anglesCos;S.spotLightExponent.value=ma.spot.exponents;
+S.spotLightDecay.value=ma.spot.decays;S.hemisphereLightSkyColor.value=ma.hemi.skyColors;S.hemisphereLightGroundColor.value=ma.hemi.groundColors;S.hemisphereLightDirection.value=ma.hemi.positions;v(S,!0)}else v(S,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){S.opacity.value=d.opacity;S.diffuse.value=d.color;S.map.value=d.map;S.lightMap.value=d.lightMap;S.lightMapIntensity.value=d.lightMapIntensity;S.aoMap.value=d.aoMap;S.aoMapIntensity.value=
+d.aoMapIntensity;S.specularMap.value=d.specularMap;S.alphaMap.value=d.alphaMap;d.bumpMap&&(S.bumpMap.value=d.bumpMap,S.bumpScale.value=d.bumpScale);d.normalMap&&(S.normalMap.value=d.normalMap,S.normalScale.value.copy(d.normalScale));var Fa;d.map?Fa=d.map:d.specularMap?Fa=d.specularMap:d.normalMap?Fa=d.normalMap:d.bumpMap?Fa=d.bumpMap:d.alphaMap&&(Fa=d.alphaMap);if(void 0!==Fa){var cb=Fa.offset,db=Fa.repeat;S.offsetRepeat.value.set(cb.x,cb.y,db.x,db.y)}S.envMap.value=d.envMap;S.flipEnvMap.value=d.envMap instanceof
+THREE.WebGLRenderTargetCube?1:-1;S.reflectivity.value=d.reflectivity;S.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)S.diffuse.value=d.color,S.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)S.diffuse.value=d.color,S.opacity.value=d.opacity,S.dashSize.value=d.dashSize,S.totalSize.value=d.dashSize+d.gapSize,S.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(S.psColor.value=d.color,S.opacity.value=d.opacity,S.size.value=d.size,
+S.scale.value=C.height/2,S.map.value=d.map,null!==d.map){var eb=d.map.offset,fb=d.map.repeat;S.offsetRepeat.value.set(eb.x,eb.y,fb.x,fb.y)}}else d instanceof THREE.MeshPhongMaterial?(S.shininess.value=d.shininess,S.emissive.value=d.emissive,S.specular.value=d.specular,d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(S.emissive.value=d.emissive,d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(S.mNear.value=a.near,S.mFar.value=
+a.far,S.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(S.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&S.shadowMatrix)for(var Xa=0,Eb=0,qb=b.length;Eb<qb;Eb++){var Da=b[Eb];Da.castShadow&&(Da instanceof THREE.SpotLight||Da instanceof THREE.DirectionalLight&&!Da.shadowCascade)&&(S.shadowMap.value[Xa]=Da.shadowMap,S.shadowMapSize.value[Xa]=Da.shadowMapSize,S.shadowMatrix.value[Xa]=Da.shadowMatrix,S.shadowDarkness.value[Xa]=Da.shadowDarkness,S.shadowBias.value[Xa]=Da.shadowBias,
+Xa++)}for(var Fb=d.uniformsList,xa,Oa,ya,mb=0,Jb=Fb.length;mb<Jb;mb++){var Z=Fb[mb][0];if(!1!==Z.needsUpdate){var Pb=Z.type,T=Z.value,ba=Fb[mb][1];switch(Pb){case "1i":q.uniform1i(ba,T);break;case "1f":q.uniform1f(ba,T);break;case "2f":q.uniform2f(ba,T[0],T[1]);break;case "3f":q.uniform3f(ba,T[0],T[1],T[2]);break;case "4f":q.uniform4f(ba,T[0],T[1],T[2],T[3]);break;case "1iv":q.uniform1iv(ba,T);break;case "3iv":q.uniform3iv(ba,T);break;case "1fv":q.uniform1fv(ba,T);break;case "2fv":q.uniform2fv(ba,
+T);break;case "3fv":q.uniform3fv(ba,T);break;case "4fv":q.uniform4fv(ba,T);break;case "Matrix3fv":q.uniformMatrix3fv(ba,!1,T);break;case "Matrix4fv":q.uniformMatrix4fv(ba,!1,T);break;case "i":q.uniform1i(ba,T);break;case "f":q.uniform1f(ba,T);break;case "v2":q.uniform2f(ba,T.x,T.y);break;case "v3":q.uniform3f(ba,T.x,T.y,T.z);break;case "v4":q.uniform4f(ba,T.x,T.y,T.z,T.w);break;case "c":q.uniform3f(ba,T.r,T.g,T.b);break;case "iv1":q.uniform1iv(ba,T);break;case "iv":q.uniform3iv(ba,T);break;case "fv1":q.uniform1fv(ba,
+T);break;case "fv":q.uniform3fv(ba,T);break;case "v2v":void 0===Z._array&&(Z._array=new Float32Array(2*T.length));for(var W=0,sa=T.length;W<sa;W++)ya=2*W,Z._array[ya+0]=T[W].x,Z._array[ya+1]=T[W].y;q.uniform2fv(ba,Z._array);break;case "v3v":void 0===Z._array&&(Z._array=new Float32Array(3*T.length));W=0;for(sa=T.length;W<sa;W++)ya=3*W,Z._array[ya+0]=T[W].x,Z._array[ya+1]=T[W].y,Z._array[ya+2]=T[W].z;q.uniform3fv(ba,Z._array);break;case "v4v":void 0===Z._array&&(Z._array=new Float32Array(4*T.length));
+W=0;for(sa=T.length;W<sa;W++)ya=4*W,Z._array[ya+0]=T[W].x,Z._array[ya+1]=T[W].y,Z._array[ya+2]=T[W].z,Z._array[ya+3]=T[W].w;q.uniform4fv(ba,Z._array);break;case "m3":q.uniformMatrix3fv(ba,!1,T.elements);break;case "m3v":void 0===Z._array&&(Z._array=new Float32Array(9*T.length));W=0;for(sa=T.length;W<sa;W++)T[W].flattenToArrayOffset(Z._array,9*W);q.uniformMatrix3fv(ba,!1,Z._array);break;case "m4":q.uniformMatrix4fv(ba,!1,T.elements);break;case "m4v":void 0===Z._array&&(Z._array=new Float32Array(16*
+T.length));W=0;for(sa=T.length;W<sa;W++)T[W].flattenToArrayOffset(Z._array,16*W);q.uniformMatrix4fv(ba,!1,Z._array);break;case "t":xa=T;Oa=x();q.uniform1i(ba,Oa);if(!xa)continue;if(xa instanceof THREE.CubeTexture||xa.image instanceof Array&&6===xa.image.length){var ha=xa,Qb=Oa;if(6===ha.image.length)if(ha.needsUpdate){ha.image.__webglTextureCube||(ha.addEventListener("dispose",Gb),ha.image.__webglTextureCube=q.createTexture(),Q.info.memory.textures++);q.activeTexture(q.TEXTURE0+Qb);q.bindTexture(q.TEXTURE_CUBE_MAP,
+ha.image.__webglTextureCube);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,ha.flipY);for(var Rb=ha instanceof THREE.CompressedTexture,Hb=ha.image[0]instanceof THREE.DataTexture,Pa=[],ja=0;6>ja;ja++)Pa[ja]=!Q.autoScaleCubemaps||Rb||Hb?Hb?ha.image[ja].image:ha.image[ja]:H(ha.image[ja],Xb);var Sb=Pa[0],Tb=THREE.Math.isPowerOfTwo(Sb.width)&&THREE.Math.isPowerOfTwo(Sb.height),Ga=E(ha.format),Ib=E(ha.type);I(q.TEXTURE_CUBE_MAP,ha,Tb);for(ja=0;6>ja;ja++)if(Rb)for(var Qa,Ub=Pa[ja].mipmaps,bb=0,Kb=Ub.length;bb<Kb;bb++)Qa=
+Ub[bb],ha.format!==THREE.RGBAFormat&&ha.format!==THREE.RGBFormat?-1<Vb().indexOf(Ga)?q.compressedTexImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,bb,Ga,Qa.width,Qa.height,0,Qa.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,bb,Ga,Qa.width,Qa.height,0,Ga,Ib,Qa.data);else Hb?q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,0,Ga,Pa[ja].width,Pa[ja].height,0,Ga,Ib,Pa[ja].data):q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+
+ja,0,Ga,Ga,Ib,Pa[ja]);ha.generateMipmaps&&Tb&&q.generateMipmap(q.TEXTURE_CUBE_MAP);ha.needsUpdate=!1;if(ha.onUpdate)ha.onUpdate(ha)}else q.activeTexture(q.TEXTURE0+Qb),q.bindTexture(q.TEXTURE_CUBE_MAP,ha.image.__webglTextureCube)}else if(xa instanceof THREE.WebGLRenderTargetCube){var Lb=xa;q.activeTexture(q.TEXTURE0+Oa);q.bindTexture(q.TEXTURE_CUBE_MAP,Lb.__webglTexture)}else Q.setTexture(xa,Oa);break;case "tv":void 0===Z._array&&(Z._array=[]);W=0;for(sa=Z.value.length;W<sa;W++)Z._array[W]=x();q.uniform1iv(ba,
+Z._array);W=0;for(sa=Z.value.length;W<sa;W++)xa=Z.value[W],Oa=Z._array[W],xa&&Q.setTexture(xa,Oa);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+Pb)}}}}q.uniformMatrix4fv(fa.modelViewMatrix,!1,e._modelViewMatrix.elements);fa.normalMatrix&&q.uniformMatrix3fv(fa.normalMatrix,!1,e._normalMatrix.elements);null!==fa.modelMatrix&&q.uniformMatrix4fv(fa.modelMatrix,!1,e.matrixWorld.elements);return na}function v(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=
+b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=
+b}function x(){var a=jb;a>=nb&&THREE.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+nb);jb+=1;return a}function z(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function w(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function I(a,b,c){c?(q.texParameteri(a,q.TEXTURE_WRAP_S,E(b.wrapS)),q.texParameteri(a,q.TEXTURE_WRAP_T,E(b.wrapT)),q.texParameteri(a,q.TEXTURE_MAG_FILTER,E(b.magFilter)),
+q.texParameteri(a,q.TEXTURE_MIN_FILTER,E(b.minFilter))):(q.texParameteri(a,q.TEXTURE_WRAP_S,q.CLAMP_TO_EDGE),q.texParameteri(a,q.TEXTURE_WRAP_T,q.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),q.texParameteri(a,q.TEXTURE_MAG_FILTER,B(b.magFilter)),q.texParameteri(a,q.TEXTURE_MIN_FILTER,B(b.minFilter)),
+b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=Y.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||b.__currentAnisotropy)&&(q.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Q.getMaxAnisotropy())),b.__currentAnisotropy=b.anisotropy)}
+function H(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);THREE.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function y(a,b){q.bindRenderbuffer(q.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,
+q.DEPTH_COMPONENT16,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_STENCIL,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a)):q.renderbufferStorage(q.RENDERBUFFER,q.RGBA4,b.width,b.height)}function F(a){a instanceof THREE.WebGLRenderTargetCube?(q.bindTexture(q.TEXTURE_CUBE_MAP,a.__webglTexture),q.generateMipmap(q.TEXTURE_CUBE_MAP),
+q.bindTexture(q.TEXTURE_CUBE_MAP,null)):(q.bindTexture(q.TEXTURE_2D,a.__webglTexture),q.generateMipmap(q.TEXTURE_2D),q.bindTexture(q.TEXTURE_2D,null))}function B(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?q.NEAREST:q.LINEAR}function E(a){var b;if(a===THREE.RepeatWrapping)return q.REPEAT;if(a===THREE.ClampToEdgeWrapping)return q.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return q.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return q.NEAREST;
+if(a===THREE.NearestMipMapNearestFilter)return q.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return q.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return q.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return q.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return q.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return q.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return q.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return q.UNSIGNED_SHORT_5_5_5_1;
+if(a===THREE.UnsignedShort565Type)return q.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return q.BYTE;if(a===THREE.ShortType)return q.SHORT;if(a===THREE.UnsignedShortType)return q.UNSIGNED_SHORT;if(a===THREE.IntType)return q.INT;if(a===THREE.UnsignedIntType)return q.UNSIGNED_INT;if(a===THREE.FloatType)return q.FLOAT;b=Y.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return q.ALPHA;if(a===THREE.RGBFormat)return q.RGB;if(a===THREE.RGBAFormat)return q.RGBA;
+if(a===THREE.LuminanceFormat)return q.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return q.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return q.FUNC_ADD;if(a===THREE.SubtractEquation)return q.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return q.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return q.ZERO;if(a===THREE.OneFactor)return q.ONE;if(a===THREE.SrcColorFactor)return q.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return q.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return q.SRC_ALPHA;
+if(a===THREE.OneMinusSrcAlphaFactor)return q.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return q.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return q.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return q.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return q.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return q.SRC_ALPHA_SATURATE;b=Y.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;
+if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=Y.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=
+Y.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var C=void 0!==a.canvas?a.canvas:document.createElement("canvas"),N=void 0!==a.context?a.context:null,K=C.width,L=C.height,J=1,G=void 0!==a.precision?a.precision:"highp",A=void 0!==a.alpha?a.alpha:!1,M=void 0!==a.depth?a.depth:!0,R=void 0!==a.stencil?a.stencil:!0,O=void 0!==a.antialias?a.antialias:!1,D=void 0!==
+a.premultipliedAlpha?a.premultipliedAlpha:!0,aa=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,oa=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,P=new THREE.Color(0),ea=0,$=[],X={},ua=[],ka=[],ra=[],V=[],la=[];this.domElement=C;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info=
+{memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var Q=this,va=[],La=null,ta=null,Ba=-1,na="",Ya=null,jb=0,Ha=0,Ia=0,Ra=C.width,Sa=C.height,ob=0,pb=0,Ja=new THREE.Frustum,Ka=new THREE.Matrix4,qa=new THREE.Vector3,ia=new THREE.Vector3,kb=!0,Ob={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],
+decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},q;try{var cb={alpha:A,depth:M,stencil:R,antialias:O,premultipliedAlpha:D,preserveDrawingBuffer:aa};q=N||C.getContext("webgl",cb)||C.getContext("experimental-webgl",cb);if(null===q){if(null!==C.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}C.addEventListener("webglcontextlost",function(a){a.preventDefault();db();eb();X={}},!1)}catch(Jb){THREE.error("THREE.WebGLRenderer: "+
+Jb)}var U=new THREE.WebGLState(q,E);void 0===q.getShaderPrecisionFormat&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var Y=new THREE.WebGLExtensions(q),za=new THREE.WebGLBuffers(q,this.info,Y,b);Y.get("OES_texture_float");Y.get("OES_texture_float_linear");Y.get("OES_texture_half_float");Y.get("OES_texture_half_float_linear");Y.get("OES_standard_derivatives");Y.get("ANGLE_instanced_arrays");oa&&Y.get("EXT_frag_depth");var Ta=function(a,b,c,d){!0===D&&(a*=d,b*=
+d,c*=d);q.clearColor(a,b,c,d)},eb=function(){q.clearColor(0,0,0,1);q.clearDepth(1);q.clearStencil(0);q.enable(q.DEPTH_TEST);q.depthFunc(q.LEQUAL);q.frontFace(q.CCW);q.cullFace(q.BACK);q.enable(q.CULL_FACE);q.enable(q.BLEND);q.blendEquation(q.FUNC_ADD);q.blendFunc(q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA);q.viewport(Ha,Ia,Ra,Sa);Ta(P.r,P.g,P.b,ea)},db=function(){Ya=La=null;na="";Ba=-1;kb=!0;U.reset()};eb();this.context=q;this.extensions=Y;this.state=U;var pa=new THREE.WebGLShadowMap(this,$,X,ua);this.shadowMap=
+pa;var nb=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS),Kb=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Lb=q.getParameter(q.MAX_TEXTURE_SIZE),Xb=q.getParameter(q.MAX_CUBE_MAP_TEXTURE_SIZE),sb=0<Kb,rb=sb&&Y.get("OES_texture_float"),Yb=Y.get("ANGLE_instanced_arrays"),Zb=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.HIGH_FLOAT),$b=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.MEDIUM_FLOAT),ac=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.HIGH_FLOAT),bc=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.MEDIUM_FLOAT),
+Vb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(Y.get("WEBGL_compressed_texture_pvrtc")||Y.get("WEBGL_compressed_texture_s3tc"))for(var b=q.getParameter(q.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),cc=0<Zb.precision&&0<ac.precision,fb=0<$b.precision&&0<bc.precision;"highp"!==G||cc||(fb?(G="mediump",THREE.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(G="lowp",THREE.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));
+"mediump"!==G||fb||(G="lowp",THREE.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var dc=new THREE.SpritePlugin(this,V),ec=new THREE.LensFlarePlugin(this,la);this.getContext=function(){return q};this.forceContextLoss=function(){Y.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return sb};this.supportsInstancedArrays=function(){return Yb};this.supportsFloatTextures=function(){return Y.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return Y.get("OES_texture_half_float")};
+this.supportsStandardDerivatives=function(){return Y.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return Y.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return Y.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return Y.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=Y.get("EXT_texture_filter_anisotropic");return a=null!==b?q.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):
 0}}();this.getPrecision=function(){return G};this.getPixelRatio=function(){return J};this.setPixelRatio=function(a){J=a};this.getSize=function(){return{width:K,height:L}};this.setSize=function(a,b,c){K=a;L=b;C.width=a*J;C.height=b*J;!1!==c&&(C.style.width=a+"px",C.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ha=a*J;Ia=b*J;Ra=c*J;Sa=d*J;q.viewport(Ha,Ia,Ra,Sa)};this.setScissor=function(a,b,c,d){q.scissor(a*J,b*J,c*J,d*J)};this.enableScissorTest=function(a){a?q.enable(q.SCISSOR_TEST):
 q.disable(q.SCISSOR_TEST)};this.getClearColor=function(){return P};this.setClearColor=function(a,b){P.set(a);ea=void 0!==b?b:1;Ta(P.r,P.g,P.b,ea)};this.getClearAlpha=function(){return ea};this.setClearAlpha=function(a){ea=a;Ta(P.r,P.g,P.b,ea)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=q.COLOR_BUFFER_BIT;if(void 0===b||b)d|=q.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=q.STENCIL_BUFFER_BIT;q.clear(d)};this.clearColor=function(){q.clear(q.COLOR_BUFFER_BIT)};this.clearDepth=function(){q.clear(q.DEPTH_BUFFER_BIT)};
-this.clearStencil=function(){q.clear(q.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=db;var gb=function(a){a.target.traverse(function(a){a.removeEventListener("remove",gb);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete Y[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=ua,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;
+this.clearStencil=function(){q.clear(q.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=db;var gb=function(a){a.target.traverse(function(a){a.removeEventListener("remove",gb);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete X[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=ua,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;
 delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})},hb=function(a){a=a.target;a.removeEventListener("dispose",hb);delete a.__webglInit;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(q.deleteBuffer(c.buffer),delete c.buffer)}Q.info.memory.geometries--}else if(b=Aa[a.id],void 0!==b){for(var c=0,d=b.length;c<d;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=0,g=e.numMorphTargets;f<g;f++)q.deleteBuffer(e.__webglMorphTargetsBuffers[f]);
-delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)q.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}za.delete(e)}delete Aa[a.id]}else za.delete(a);ma=""},Gb=function(a){a=a.target;a.removeEventListener("dispose",Gb);a.image&&a.image.__webglTextureCube?(q.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(q.deleteTexture(a.__webglTexture),delete a.__webglTexture,
+delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)q.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}za.delete(e)}delete Aa[a.id]}else za.delete(a);na=""},Gb=function(a){a=a.target;a.removeEventListener("dispose",Gb);a.image&&a.image.__webglTextureCube?(q.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(q.deleteTexture(a.__webglTexture),delete a.__webglTexture,
 delete a.__webglInit);Q.info.memory.textures--},qb=function(a){a=a.target;a.removeEventListener("dispose",qb);if(a&&void 0!==a.__webglTexture){q.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)q.deleteFramebuffer(a.__webglFramebuffer[b]),q.deleteRenderbuffer(a.__webglRenderbuffer[b]);else q.deleteFramebuffer(a.__webglFramebuffer),q.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}Q.info.memory.textures--},
 Nb=function(a){a=a.target;a.removeEventListener("dispose",Nb);Mb(a)},Mb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=va.length;a<c;a++)if(d=va[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=va.length;a<c;a++)d=va[a],d.program!==b&&e.push(d);va=e;q.deleteProgram(b);Q.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){U.initAttributes();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=
 q.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=q.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=q.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=q.createBuffer());a.hasPositions&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglVertexBuffer),q.bufferData(q.ARRAY_BUFFER,a.positionArray,q.DYNAMIC_DRAW),U.enableAttribute(b.attributes.position),q.vertexAttribPointer(b.attributes.position,3,q.FLOAT,!1,0,0));if(a.hasNormals){q.bindBuffer(q.ARRAY_BUFFER,
-a.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,k,m,l,n,p,r,t=3*a.count;for(r=0;r<t;r+=9)p=a.normalArray,d=p[r],e=p[r+1],f=p[r+2],g=p[r+3],k=p[r+4],l=p[r+5],h=p[r+6],m=p[r+7],n=p[r+8],d=(d+g+h)/3,e=(e+k+m)/3,f=(f+l+n)/3,p[r]=d,p[r+1]=e,p[r+2]=f,p[r+3]=d,p[r+4]=e,p[r+5]=f,p[r+6]=d,p[r+7]=e,p[r+8]=f}q.bufferData(q.ARRAY_BUFFER,a.normalArray,q.DYNAMIC_DRAW);U.enableAttribute(b.attributes.normal);q.vertexAttribPointer(b.attributes.normal,
+a.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,k,m,l,n,p,r,s=3*a.count;for(r=0;r<s;r+=9)p=a.normalArray,d=p[r],e=p[r+1],f=p[r+2],g=p[r+3],k=p[r+4],l=p[r+5],h=p[r+6],m=p[r+7],n=p[r+8],d=(d+g+h)/3,e=(e+k+m)/3,f=(f+l+n)/3,p[r]=d,p[r+1]=e,p[r+2]=f,p[r+3]=d,p[r+4]=e,p[r+5]=f,p[r+6]=d,p[r+7]=e,p[r+8]=f}q.bufferData(q.ARRAY_BUFFER,a.normalArray,q.DYNAMIC_DRAW);U.enableAttribute(b.attributes.normal);q.vertexAttribPointer(b.attributes.normal,
 3,q.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglUvBuffer),q.bufferData(q.ARRAY_BUFFER,a.uvArray,q.DYNAMIC_DRAW),U.enableAttribute(b.attributes.uv),q.vertexAttribPointer(b.attributes.uv,2,q.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglColorBuffer),q.bufferData(q.ARRAY_BUFFER,a.colorArray,q.DYNAMIC_DRAW),U.enableAttribute(b.attributes.color),q.vertexAttribPointer(b.attributes.color,3,q.FLOAT,!1,0,0));U.disableUnusedAttributes();
-q.drawArrays(q.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,d,e,f,g){if(!1!==e.visible)if(m(g),a=u(a,b,d,e,g),b=!1,d="direct_"+f.id+"_"+a.id+"_"+(e.wireframe?1:0),d!==ma&&(ma=d,b=!0),b&&U.initAttributes(),g instanceof THREE.Mesh){g=!0===e.wireframe?q.LINES:q.TRIANGLES;var h=f.attributes.index;if(h){var k,l;h.array instanceof Uint32Array&&ba.get("OES_element_index_uint")?(k=q.UNSIGNED_INT,l=4):(k=q.UNSIGNED_SHORT,l=2);d=f.offsets;if(0===d.length)b&&(c(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,
-h.buffer)),q.drawElements(g,h.array.length,k,0),Q.info.render.calls++,Q.info.render.vertices+=h.array.length,Q.info.render.faces+=h.array.length/3;else{b=!0;for(var n=0,p=d.length;n<p;n++){var r=d[n].index;b&&(c(e,a,f,r),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer));q.drawElements(g,d[n].count,k,d[n].start*l);Q.info.render.calls++;Q.info.render.vertices+=d[n].count;Q.info.render.faces+=d[n].count/3}}}else b&&c(e,a,f,0),e=f.attributes.position,q.drawArrays(g,0,e.array.length/e.itemSize),Q.info.render.calls++,
-Q.info.render.vertices+=e.array.length/e.itemSize,Q.info.render.faces+=e.array.length/(3*e.itemSize)}else if(g instanceof THREE.PointCloud)if(g=q.POINTS,h=f.attributes.index)if(h.array instanceof Uint32Array&&ba.get("OES_element_index_uint")?(k=q.UNSIGNED_INT,l=4):(k=q.UNSIGNED_SHORT,l=2),d=f.offsets,0===d.length)b&&(c(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,h.array.length,k,0),Q.info.render.calls++,Q.info.render.points+=h.array.length;else for(1<d.length&&(b=!0),
-n=0,p=d.length;n<p;n++)r=d[n].index,b&&(c(e,a,f,r),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,d[n].count,k,d[n].start*l),Q.info.render.calls++,Q.info.render.points+=d[n].count;else if(b&&c(e,a,f,0),e=f.attributes.position,d=f.offsets,0===d.length)q.drawArrays(g,0,e.array.length/3),Q.info.render.calls++,Q.info.render.points+=e.array.length/3;else for(n=0,p=d.length;n<p;n++)q.drawArrays(g,d[n].index,d[n].count),Q.info.render.calls++,Q.info.render.points+=d[n].count;else if(g instanceof
-THREE.Line)if(g=g.mode===THREE.LineStrip?q.LINE_STRIP:q.LINES,U.setLineWidth(e.linewidth*J),h=f.attributes.index)if(h.array instanceof Uint32Array?(k=q.UNSIGNED_INT,l=4):(k=q.UNSIGNED_SHORT,l=2),d=f.offsets,0===d.length)b&&(c(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,h.array.length,k,0),Q.info.render.calls++,Q.info.render.vertices+=h.array.length;else for(1<d.length&&(b=!0),n=0,p=d.length;n<p;n++)r=d[n].index,b&&(c(e,a,f,r),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),
-q.drawElements(g,d[n].count,k,d[n].start*l),Q.info.render.calls++,Q.info.render.vertices+=d[n].count;else if(b&&c(e,a,f,0),e=f.attributes.position,d=f.offsets,0===d.length)q.drawArrays(g,0,e.array.length/3),Q.info.render.calls++,Q.info.render.vertices+=e.array.length/3;else for(n=0,p=d.length;n<p;n++)q.drawArrays(g,d[n].index,d[n].count),Q.info.render.calls++,Q.info.render.vertices+=d[n].count};this.renderBuffer=function(a,b,c,d,e,g){if(!1!==d.visible){m(g);c=u(a,b,c,d,g);b=c.attributes;a=!1;c=e.id+
-"_"+c.id+"_"+(d.wireframe?1:0);c!==ma&&(ma=c,a=!0);a&&U.initAttributes();if(!d.morphTargets&&0<=b.position)a&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglVertexBuffer),U.enableAttribute(b.position),q.vertexAttribPointer(b.position,3,q.FLOAT,!1,0,0));else if(g.morphTargetBase){c=d.program.attributes;-1!==g.morphTargetBase&&0<=c.position?(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[g.morphTargetBase]),U.enableAttribute(c.position),q.vertexAttribPointer(c.position,3,q.FLOAT,!1,0,0)):0<=c.position&&
-(q.bindBuffer(q.ARRAY_BUFFER,e.__webglVertexBuffer),U.enableAttribute(c.position),q.vertexAttribPointer(c.position,3,q.FLOAT,!1,0,0));if(g.morphTargetForcedOrder.length)for(var h=0,k=g.morphTargetForcedOrder,l=g.morphTargetInfluences,n;h<d.numSupportedMorphTargets&&h<k.length;)n=c["morphTarget"+h],0<=n&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k[h]]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0)),n=c["morphNormal"+h],0<=n&&d.morphNormals&&(q.bindBuffer(q.ARRAY_BUFFER,
-e.__webglMorphNormalsBuffers[k[h]]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0)),g.__webglMorphTargetInfluences[h]=l[k[h]],h++;else{k=[];l=g.morphTargetInfluences;h=g.geometry.morphTargets;l.length>h.length&&(THREE.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),l.length=h.length);h=0;for(n=l.length;h<n;h++)k.push([l[h],h]);k.length>d.numSupportedMorphTargets?(k.sort(f),k.length=d.numSupportedMorphTargets):k.length>d.numSupportedMorphNormals?k.sort(f):
-0===k.length&&k.push([0,0]);for(var h=0,p=d.numSupportedMorphTargets;h<p;h++)if(k[h]){var r=k[h][1];n=c["morphTarget"+h];0<=n&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[r]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0));n=c["morphNormal"+h];0<=n&&d.morphNormals&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[r]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0));g.__webglMorphTargetInfluences[h]=l[r]}else g.__webglMorphTargetInfluences[h]=0}null!==
-d.program.uniforms.morphTargetInfluences&&q.uniform1fv(d.program.uniforms.morphTargetInfluences,g.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(c=0,l=e.__webglCustomAttributesList.length;c<l;c++)k=e.__webglCustomAttributesList[c],0<=b[k.buffer.belongsToAttribute]&&(q.bindBuffer(q.ARRAY_BUFFER,k.buffer),U.enableAttribute(b[k.buffer.belongsToAttribute]),q.vertexAttribPointer(b[k.buffer.belongsToAttribute],k.size,q.FLOAT,!1,0,0));0<=b.color&&(0<g.geometry.colors.length||0<
-g.geometry.faces.length?(q.bindBuffer(q.ARRAY_BUFFER,e.__webglColorBuffer),U.enableAttribute(b.color),q.vertexAttribPointer(b.color,3,q.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&q.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglNormalBuffer),U.enableAttribute(b.normal),q.vertexAttribPointer(b.normal,3,q.FLOAT,!1,0,0));0<=b.tangent&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglTangentBuffer),U.enableAttribute(b.tangent),q.vertexAttribPointer(b.tangent,
-4,q.FLOAT,!1,0,0));0<=b.uv&&(g.geometry.faceVertexUvs[0]?(q.bindBuffer(q.ARRAY_BUFFER,e.__webglUVBuffer),U.enableAttribute(b.uv),q.vertexAttribPointer(b.uv,2,q.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&q.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(g.geometry.faceVertexUvs[1]?(q.bindBuffer(q.ARRAY_BUFFER,e.__webglUV2Buffer),U.enableAttribute(b.uv2),q.vertexAttribPointer(b.uv2,2,q.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&q.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));
-d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),U.enableAttribute(b.skinIndex),q.vertexAttribPointer(b.skinIndex,4,q.FLOAT,!1,0,0),q.bindBuffer(q.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),U.enableAttribute(b.skinWeight),q.vertexAttribPointer(b.skinWeight,4,q.FLOAT,!1,0,0));0<=b.lineDistance&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglLineDistanceBuffer),U.enableAttribute(b.lineDistance),q.vertexAttribPointer(b.lineDistance,1,q.FLOAT,!1,0,0))}U.disableUnusedAttributes();
-g instanceof THREE.Mesh?(g=e.__typeArray===Uint32Array?q.UNSIGNED_INT:q.UNSIGNED_SHORT,d.wireframe?(U.setLineWidth(d.wireframeLinewidth*J),a&&q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),q.drawElements(q.LINES,e.__webglLineCount,g,0)):(a&&q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),q.drawElements(q.TRIANGLES,e.__webglFaceCount,g,0)),Q.info.render.calls++,Q.info.render.vertices+=e.__webglFaceCount,Q.info.render.faces+=e.__webglFaceCount/3):g instanceof THREE.Line?(g=g.mode===
-THREE.LineStrip?q.LINE_STRIP:q.LINES,U.setLineWidth(d.linewidth*J),q.drawArrays(g,0,e.__webglLineCount),Q.info.render.calls++):g instanceof THREE.PointCloud&&(q.drawArrays(q.POINTS,0,e.__webglParticleCount),Q.info.render.calls++,Q.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,f){if(!1===b instanceof THREE.Camera)THREE.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var m=a.fog;ma="";Ba=-1;Ya=null;kb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();
-void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);Ka.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ja.setFromMatrix(Ka);W.length=0;qa.length=0;ra.length=0;V.length=0;ka.length=0;g(a);!0===Q.sortObjects&&(qa.sort(d),ra.sort(e));oa.render(a,b);Q.info.render.calls=0;Q.info.render.vertices=0;Q.info.render.faces=0;Q.info.render.points=0;this.setRenderTarget(c);(this.autoClear||
-f)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);f=0;for(var n=ua.length;f<n;f++){var p=ua[f],q=p.object;q.visible&&(z(q,b),l(p))}a.overrideMaterial?(f=a.overrideMaterial,s(f),h(qa,b,W,m,f),h(ra,b,W,m,f),k(ua,"",b,W,m,f)):(U.setBlending(THREE.NoBlending),h(qa,b,W,m,null),k(ua,"opaque",b,W,m,null),h(ra,b,W,m,null),k(ua,"transparent",b,W,m,null));cc.render(a,b);dc.render(a,b,ob,pb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&
-F(c);U.setDepthTest(!0);U.setDepthWrite(!0);U.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=u(a,b,c,d,e);ma="";Q.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,q,Ja):e.render(function(a){Q.renderBufferImmediate(a,f,d)})};var Aa={},ib=0,Wb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};
-this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?q.disable(q.CULL_FACE):(b===THREE.FrontFaceDirectionCW?q.frontFace(q.CW):q.frontFace(q.CCW),a===THREE.CullFaceBack?q.cullFace(q.BACK):a===THREE.CullFaceFront?q.cullFace(q.FRONT):q.cullFace(q.FRONT_AND_BACK),q.enable(q.CULL_FACE))};this.setMaterialFaces=function(a){U.setDoubleSided(a.side===THREE.DoubleSide);U.setFlipSided(a.side===THREE.BackSide)};this.uploadTexture=function(a,b){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",
-Gb),a.__webglTexture=q.createTexture(),Q.info.memory.textures++);q.activeTexture(q.TEXTURE0+b);q.bindTexture(q.TEXTURE_2D,a.__webglTexture);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,a.flipY);q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);q.pixelStorei(q.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=H(a.image,Lb);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=E(a.format),f=E(a.type);I(q.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<
-g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Vb().indexOf(e)?q.compressedTexImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,c.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):
-q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],q.texImage2D(q.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&q.generateMipmap(q.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate(a)};this.setTexture=function(a,b){!0===a.needsUpdate?!1===a.image.complete?THREE.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a):Q.uploadTexture(a,b):
-(q.activeTexture(q.TEXTURE0+b),q.bindTexture(q.TEXTURE_2D,a.__webglTexture))};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",qb);a.__webglTexture=q.createTexture();Q.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=E(a.format),e=E(a.type);if(b){a.__webglFramebuffer=
-[];a.__webglRenderbuffer=[];q.bindTexture(q.TEXTURE_CUBE_MAP,a.__webglTexture);I(q.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=q.createFramebuffer();a.__webglRenderbuffer[f]=q.createRenderbuffer();q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=q.TEXTURE_CUBE_MAP_POSITIVE_X+f;q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer[f]);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,h,g.__webglTexture,0);y(a.__webglRenderbuffer[f],
-a)}a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=q.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:q.createRenderbuffer(),q.bindTexture(q.TEXTURE_2D,a.__webglTexture),I(q.TEXTURE_2D,a,c),q.texImage2D(q.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=q.TEXTURE_2D,q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer),q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&
-!a.stencilBuffer?q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):y(a.__webglRenderbuffer,a),a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_2D);b?q.bindTexture(q.TEXTURE_CUBE_MAP,null):q.bindTexture(q.TEXTURE_2D,null);q.bindRenderbuffer(q.RENDERBUFFER,null);q.bindFramebuffer(q.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:
-a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Ra,a=Sa,d=Ha,e=Ia);b!==ta&&(q.bindFramebuffer(q.FRAMEBUFFER,b),q.viewport(d,e,c,a),ta=b);ob=c;pb=a};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(a.__webglFramebuffer)if(a.format!==THREE.RGBAFormat)THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");
-else{var g=!1;a.__webglFramebuffer!==ta&&(q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer),g=!0);q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?q.readPixels(b,c,d,e,q.RGBA,q.UNSIGNED_BYTE,f):THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&q.bindFramebuffer(q.FRAMEBUFFER,ta)}};this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};
-this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return oa.enabled},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");oa.enabled=a}},shadowMapType:{get:function(){return oa.type},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");
-oa.type=a}},shadowMapCullFace:{get:function(){return oa.cullFace},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");oa.cullFace=a}},shadowMapDebug:{get:function(){return oa.debug},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");oa.debug=a}},shadowMapCascade:{get:function(){return oa.cascade},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapCascade is now .shadowMap.cascade.");oa.cascade=a}}})};
+q.drawArrays(q.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,d,e,f,g){if(!1!==e.visible)if(m(g),a=u(a,b,d,e,g),b=!1,d="direct_"+f.id+"_"+a.id+"_"+(e.wireframe?1:0),d!==na&&(na=d,b=!0),b&&U.initAttributes(),g instanceof THREE.Mesh){g=!0===e.wireframe?q.LINES:q.TRIANGLES;var h=f.attributes.index;if(h){var k,l;h.array instanceof Uint32Array&&Y.get("OES_element_index_uint")?(k=q.UNSIGNED_INT,l=4):(k=q.UNSIGNED_SHORT,l=2);d=f.offsets;if(0===d.length){b&&(c(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,
+h.buffer));if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){var n=Y.get("ANGLE_instanced_arrays");if(null===n){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}n.drawElementsInstancedANGLE(g,h.array.length,k,0,f.maxInstancedCount)}else q.drawElements(g,h.array.length,k,0);Q.info.render.calls++;Q.info.render.vertices+=h.array.length;Q.info.render.faces+=h.array.length/
+3}else{b=!0;for(var p=0,r=d.length;p<r;p++){n=d[p].index;b&&(c(e,a,f,n),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer));if(f instanceof THREE.InstancedBufferGeometry&&0<d[p].instances){n=Y.get("ANGLE_instanced_arrays");if(null===n){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break}n.drawElementsInstancedANGLE(g,d[p].count,k,d[p].start*l,d[p].count,k,d[p].instances)}else q.drawElements(g,
+d[p].count,k,d[p].start*l);Q.info.render.calls++;Q.info.render.vertices+=d[p].count;Q.info.render.faces+=d[p].count/3}}}else{b&&c(e,a,f,0);e=f.attributes.position;if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){n=Y.get("ANGLE_instanced_arrays");if(null===n){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}e instanceof THREE.InterleavedBufferAttribute?n.drawArraysInstancedANGLE(g,
+0,e.data.array.length/e.data.stride,f.maxInstancedCount):n.drawArraysInstancedANGLE(g,0,e.array.length/e.itemSize,f.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?q.drawArrays(g,0,e.data.array.length/e.data.stride):q.drawArrays(g,0,e.array.length/e.itemSize);Q.info.render.calls++;Q.info.render.vertices+=e.array.length/e.itemSize;Q.info.render.faces+=e.array.length/(3*e.itemSize)}}else if(g instanceof THREE.PointCloud)if(g=q.POINTS,h=f.attributes.index)if(h.array instanceof Uint32Array&&
+Y.get("OES_element_index_uint")?(k=q.UNSIGNED_INT,l=4):(k=q.UNSIGNED_SHORT,l=2),d=f.offsets,0===d.length)b&&(c(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,h.array.length,k,0),Q.info.render.calls++,Q.info.render.points+=h.array.length;else for(1<d.length&&(b=!0),p=0,r=d.length;p<r;p++)n=d[p].index,b&&(c(e,a,f,n),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,d[p].count,k,d[p].start*l),Q.info.render.calls++,Q.info.render.points+=d[p].count;else if(b&&c(e,
+a,f,0),e=f.attributes.position,d=f.offsets,0===d.length)q.drawArrays(g,0,e.array.length/3),Q.info.render.calls++,Q.info.render.points+=e.array.length/3;else for(p=0,r=d.length;p<r;p++)q.drawArrays(g,d[p].index,d[p].count),Q.info.render.calls++,Q.info.render.points+=d[p].count;else if(g instanceof THREE.Line)if(g=g.mode===THREE.LineStrip?q.LINE_STRIP:q.LINES,U.setLineWidth(e.linewidth*J),h=f.attributes.index)if(h.array instanceof Uint32Array?(k=q.UNSIGNED_INT,l=4):(k=q.UNSIGNED_SHORT,l=2),d=f.offsets,
+0===d.length)b&&(c(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,h.array.length,k,0),Q.info.render.calls++,Q.info.render.vertices+=h.array.length;else for(1<d.length&&(b=!0),p=0,r=d.length;p<r;p++)n=d[p].index,b&&(c(e,a,f,n),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,d[p].count,k,d[p].start*l),Q.info.render.calls++,Q.info.render.vertices+=d[p].count;else if(b&&c(e,a,f,0),e=f.attributes.position,d=f.offsets,0===d.length)q.drawArrays(g,0,e.array.length/
+3),Q.info.render.calls++,Q.info.render.vertices+=e.array.length/3;else for(p=0,r=d.length;p<r;p++)q.drawArrays(g,d[p].index,d[p].count),Q.info.render.calls++,Q.info.render.vertices+=d[p].count};this.renderBuffer=function(a,b,c,d,e,g){if(!1!==d.visible){m(g);c=u(a,b,c,d,g);b=c.attributes;a=!1;c=e.id+"_"+c.id+"_"+(d.wireframe?1:0);c!==na&&(na=c,a=!0);a&&U.initAttributes();if(!d.morphTargets&&0<=b.position)a&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglVertexBuffer),U.enableAttribute(b.position),q.vertexAttribPointer(b.position,
+3,q.FLOAT,!1,0,0));else if(g.morphTargetBase){c=d.program.attributes;-1!==g.morphTargetBase&&0<=c.position?(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[g.morphTargetBase]),U.enableAttribute(c.position),q.vertexAttribPointer(c.position,3,q.FLOAT,!1,0,0)):0<=c.position&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglVertexBuffer),U.enableAttribute(c.position),q.vertexAttribPointer(c.position,3,q.FLOAT,!1,0,0));if(g.morphTargetForcedOrder.length)for(var h=0,k=g.morphTargetForcedOrder,l=g.morphTargetInfluences,
+n;h<d.numSupportedMorphTargets&&h<k.length;)n=c["morphTarget"+h],0<=n&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k[h]]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0)),n=c["morphNormal"+h],0<=n&&d.morphNormals&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[k[h]]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0)),g.__webglMorphTargetInfluences[h]=l[k[h]],h++;else{k=[];l=g.morphTargetInfluences;h=g.geometry.morphTargets;l.length>h.length&&(THREE.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),
+l.length=h.length);h=0;for(n=l.length;h<n;h++)k.push([l[h],h]);k.length>d.numSupportedMorphTargets?(k.sort(f),k.length=d.numSupportedMorphTargets):k.length>d.numSupportedMorphNormals?k.sort(f):0===k.length&&k.push([0,0]);for(var h=0,p=d.numSupportedMorphTargets;h<p;h++)if(k[h]){var r=k[h][1];n=c["morphTarget"+h];0<=n&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[r]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0));n=c["morphNormal"+h];0<=n&&d.morphNormals&&(q.bindBuffer(q.ARRAY_BUFFER,
+e.__webglMorphNormalsBuffers[r]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0));g.__webglMorphTargetInfluences[h]=l[r]}else g.__webglMorphTargetInfluences[h]=0}null!==d.program.uniforms.morphTargetInfluences&&q.uniform1fv(d.program.uniforms.morphTargetInfluences,g.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(c=0,l=e.__webglCustomAttributesList.length;c<l;c++)k=e.__webglCustomAttributesList[c],0<=b[k.buffer.belongsToAttribute]&&(q.bindBuffer(q.ARRAY_BUFFER,
+k.buffer),U.enableAttribute(b[k.buffer.belongsToAttribute]),q.vertexAttribPointer(b[k.buffer.belongsToAttribute],k.size,q.FLOAT,!1,0,0));0<=b.color&&(0<g.geometry.colors.length||0<g.geometry.faces.length?(q.bindBuffer(q.ARRAY_BUFFER,e.__webglColorBuffer),U.enableAttribute(b.color),q.vertexAttribPointer(b.color,3,q.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&q.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglNormalBuffer),U.enableAttribute(b.normal),
+q.vertexAttribPointer(b.normal,3,q.FLOAT,!1,0,0));0<=b.tangent&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglTangentBuffer),U.enableAttribute(b.tangent),q.vertexAttribPointer(b.tangent,4,q.FLOAT,!1,0,0));0<=b.uv&&(g.geometry.faceVertexUvs[0]?(q.bindBuffer(q.ARRAY_BUFFER,e.__webglUVBuffer),U.enableAttribute(b.uv),q.vertexAttribPointer(b.uv,2,q.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&q.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(g.geometry.faceVertexUvs[1]?(q.bindBuffer(q.ARRAY_BUFFER,
+e.__webglUV2Buffer),U.enableAttribute(b.uv2),q.vertexAttribPointer(b.uv2,2,q.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&q.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),U.enableAttribute(b.skinIndex),q.vertexAttribPointer(b.skinIndex,4,q.FLOAT,!1,0,0),q.bindBuffer(q.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),U.enableAttribute(b.skinWeight),q.vertexAttribPointer(b.skinWeight,4,q.FLOAT,!1,
+0,0));0<=b.lineDistance&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglLineDistanceBuffer),U.enableAttribute(b.lineDistance),q.vertexAttribPointer(b.lineDistance,1,q.FLOAT,!1,0,0))}U.disableUnusedAttributes();g instanceof THREE.Mesh?(g=e.__typeArray===Uint32Array?q.UNSIGNED_INT:q.UNSIGNED_SHORT,d.wireframe?(U.setLineWidth(d.wireframeLinewidth*J),a&&q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),q.drawElements(q.LINES,e.__webglLineCount,g,0)):(a&&q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),
+q.drawElements(q.TRIANGLES,e.__webglFaceCount,g,0)),Q.info.render.calls++,Q.info.render.vertices+=e.__webglFaceCount,Q.info.render.faces+=e.__webglFaceCount/3):g instanceof THREE.Line?(g=g.mode===THREE.LineStrip?q.LINE_STRIP:q.LINES,U.setLineWidth(d.linewidth*J),q.drawArrays(g,0,e.__webglLineCount),Q.info.render.calls++):g instanceof THREE.PointCloud&&(q.drawArrays(q.POINTS,0,e.__webglParticleCount),Q.info.render.calls++,Q.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,f){if(!1===
+b instanceof THREE.Camera)THREE.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var m=a.fog;na="";Ba=-1;Ya=null;kb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);Ka.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ja.setFromMatrix(Ka);$.length=0;ka.length=0;ra.length=0;V.length=0;la.length=0;
+g(a);!0===Q.sortObjects&&(ka.sort(d),ra.sort(e));pa.render(a,b);Q.info.render.calls=0;Q.info.render.vertices=0;Q.info.render.faces=0;Q.info.render.points=0;this.setRenderTarget(c);(this.autoClear||f)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);f=0;for(var n=ua.length;f<n;f++){var p=ua[f],q=p.object;q.visible&&(z(q,b),l(p))}a.overrideMaterial?(f=a.overrideMaterial,s(f),h(ka,b,$,m,f),h(ra,b,$,m,f),k(ua,"",b,$,m,f)):(U.setBlending(THREE.NoBlending),h(ka,b,$,m,null),k(ua,
+"opaque",b,$,m,null),h(ra,b,$,m,null),k(ua,"transparent",b,$,m,null));dc.render(a,b);ec.render(a,b,ob,pb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&F(c);U.setDepthTest(!0);U.setDepthWrite(!0);U.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=u(a,b,c,d,e);na="";Q.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,q,Ja):e.render(function(a){Q.renderBufferImmediate(a,f,d)})};var Aa={},ib=0,Wb={MeshDepthMaterial:"depth",
+MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?q.disable(q.CULL_FACE):(b===THREE.FrontFaceDirectionCW?q.frontFace(q.CW):q.frontFace(q.CCW),a===THREE.CullFaceBack?q.cullFace(q.BACK):a===THREE.CullFaceFront?q.cullFace(q.FRONT):q.cullFace(q.FRONT_AND_BACK),q.enable(q.CULL_FACE))};this.setMaterialFaces=
+function(a){U.setDoubleSided(a.side===THREE.DoubleSide);U.setFlipSided(a.side===THREE.BackSide)};this.uploadTexture=function(a,b){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Gb),a.__webglTexture=q.createTexture(),Q.info.memory.textures++);q.activeTexture(q.TEXTURE0+b);q.bindTexture(q.TEXTURE_2D,a.__webglTexture);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,a.flipY);q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);q.pixelStorei(q.UNPACK_ALIGNMENT,a.unpackAlignment);
+a.image=H(a.image,Lb);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=E(a.format),f=E(a.type);I(q.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat&&
+a.format!==THREE.RGBFormat?-1<Vb().indexOf(e)?q.compressedTexImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,c.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],q.texImage2D(q.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&q.generateMipmap(q.TEXTURE_2D);a.needsUpdate=
+!1;if(a.onUpdate)a.onUpdate(a)};this.setTexture=function(a,b){!0===a.needsUpdate?!1===a.image.complete?THREE.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a):Q.uploadTexture(a,b):(q.activeTexture(q.TEXTURE0+b),q.bindTexture(q.TEXTURE_2D,a.__webglTexture))};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",
+qb);a.__webglTexture=q.createTexture();Q.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=E(a.format),e=E(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];q.bindTexture(q.TEXTURE_CUBE_MAP,a.__webglTexture);I(q.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=q.createFramebuffer();a.__webglRenderbuffer[f]=q.createRenderbuffer();q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=q.TEXTURE_CUBE_MAP_POSITIVE_X+
+f;q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer[f]);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,h,g.__webglTexture,0);y(a.__webglRenderbuffer[f],a)}a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=q.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:q.createRenderbuffer(),q.bindTexture(q.TEXTURE_2D,a.__webglTexture),I(q.TEXTURE_2D,a,c),q.texImage2D(q.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=q.TEXTURE_2D,
+q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer),q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):y(a.__webglRenderbuffer,a),a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_2D);b?q.bindTexture(q.TEXTURE_CUBE_MAP,
+null):q.bindTexture(q.TEXTURE_2D,null);q.bindRenderbuffer(q.RENDERBUFFER,null);q.bindFramebuffer(q.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Ra,a=Sa,d=Ha,e=Ia);b!==ta&&(q.bindFramebuffer(q.FRAMEBUFFER,b),q.viewport(d,e,c,a),ta=b);ob=c;pb=a};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
+else if(a.__webglFramebuffer)if(a.format!==THREE.RGBAFormat)THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;a.__webglFramebuffer!==ta&&(q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer),g=!0);q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?q.readPixels(b,c,d,e,q.RGBA,q.UNSIGNED_BYTE,f):THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");
+g&&q.bindFramebuffer(q.FRAMEBUFFER,ta)}};this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return pa.enabled},
+set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");pa.enabled=a}},shadowMapType:{get:function(){return pa.type},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");pa.type=a}},shadowMapCullFace:{get:function(){return pa.cullFace},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");pa.cullFace=a}},shadowMapDebug:{get:function(){return pa.debug},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");
+pa.debug=a}},shadowMapCascade:{get:function(){return pa.cascade},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapCascade is now .shadowMap.cascade.");pa.cascade=a}}})};
 THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:
 THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null};
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;
@@ -575,18 +590,18 @@ l.size)for(r=0;r<s;r++)l.array[r]=l.value[r];else if(2===l.size)for(r=0;r<s;r++)
 l.array,c);l.needsUpdate=!1}};this.setLineBuffers=function(b,c){var d,e,l,n=b.vertices,p=b.colors,m=b.lineDistances,r=n.length,t=p.length,s=m.length,u=b.__vertexArray,v=b.__colorArray,x=b.__lineDistanceArray,z=b.colorsNeedUpdate,w=b.lineDistancesNeedUpdate,I=b.__webglCustomAttributesList;if(b.verticesNeedUpdate){for(d=0;d<r;d++)l=n[d],e=3*d,u[e]=l.x,u[e+1]=l.y,u[e+2]=l.z;a.bindBuffer(a.ARRAY_BUFFER,b.__webglVertexBuffer);a.bufferData(a.ARRAY_BUFFER,u,c)}if(z){for(d=0;d<t;d++)l=p[d],e=3*d,v[e]=l.r,
 v[e+1]=l.g,v[e+2]=l.b;a.bindBuffer(a.ARRAY_BUFFER,b.__webglColorBuffer);a.bufferData(a.ARRAY_BUFFER,v,c)}if(w){for(e=0;e<s;e++)x[e]=m[e];a.bindBuffer(a.ARRAY_BUFFER,b.__webglLineDistanceBuffer);a.bufferData(a.ARRAY_BUFFER,x,c)}if(I)for(m=0,s=I.length;m<s;m++)if(v=I[m],v.needsUpdate&&(void 0===v.boundTo||"vertices"===v.boundTo)){e=0;p=v.value.length;if(1===v.size)for(x=0;x<p;x++)v.array[x]=v.value[x];else if(2===v.size)for(x=0;x<p;x++)t=v.value[x],v.array[e]=t.x,v.array[e+1]=t.y,e+=2;else if(3===v.size)if("c"===
 v.type)for(x=0;x<p;x++)t=v.value[x],v.array[e]=t.r,v.array[e+1]=t.g,v.array[e+2]=t.b,e+=3;else for(x=0;x<p;x++)t=v.value[x],v.array[e]=t.x,v.array[e+1]=t.y,v.array[e+2]=t.z,e+=3;else if(4===v.size)for(x=0;x<p;x++)t=v.value[x],v.array[e]=t.x,v.array[e+1]=t.y,v.array[e+2]=t.z,v.array[e+3]=t.w,e+=4;a.bindBuffer(a.ARRAY_BUFFER,v.buffer);a.bufferData(a.ARRAY_BUFFER,v.array,c);v.needsUpdate=!1}};this.setMeshBuffers=function(b,c,d,e,l){if(b.__inittedArrays){var n=!1===l instanceof THREE.MeshPhongMaterial&&
-l.shading===THREE.FlatShading,p,m,r,t,s,u,v,x,z,w,I,H,y,F,B,E,C,N,K,L,J,G,A=x=K=E=0,M=0,R=B=C=0,O=s=I=0,D=0,O=b.__vertexArray;N=b.__uvArray;var D=b.__uv2Array,$=b.__normalArray;r=b.__tangentArray;v=b.__colorArray;H=b.__skinIndexArray;y=b.__skinWeightArray;F=b.__morphTargetsArrays;var na=b.__morphNormalsArrays,P=b.__webglCustomAttributesList,ea=b.__faceArray,W=b.__lineArray,Y=c.geometry,ua=Y.elementsNeedUpdate,qa=Y.uvsNeedUpdate;t=Y.normalsNeedUpdate;var ra=Y.tangentsNeedUpdate;u=Y.colorsNeedUpdate;
-L=Y.morphTargetsNeedUpdate;G=Y.vertices;var V=b.faces3,ka=Y.faces,Q=Y.faceVertexUvs[0],va=Y.faceVertexUvs[1],La=Y.skinIndices,ta=Y.skinWeights,Ba=Y.morphTargets,ma=Y.morphNormals;if(Y.verticesNeedUpdate){c=0;for(p=V.length;c<p;c++)m=ka[V[c]],z=G[m.a],w=G[m.b],m=G[m.c],O[K]=z.x,O[K+1]=z.y,O[K+2]=z.z,O[K+3]=w.x,O[K+4]=w.y,O[K+5]=w.z,O[K+6]=m.x,O[K+7]=m.y,O[K+8]=m.z,K+=9;a.bindBuffer(a.ARRAY_BUFFER,b.__webglVertexBuffer);a.bufferData(a.ARRAY_BUFFER,O,d)}if(L)for(K=0,L=Ba.length;K<L;K++){c=O=0;for(p=
-V.length;c<p;c++)G=V[c],m=ka[G],z=Ba[K].vertices[m.a],w=Ba[K].vertices[m.b],m=Ba[K].vertices[m.c],J=F[K],J[O]=z.x,J[O+1]=z.y,J[O+2]=z.z,J[O+3]=w.x,J[O+4]=w.y,J[O+5]=w.z,J[O+6]=m.x,J[O+7]=m.y,J[O+8]=m.z,l.morphNormals&&(n?w=z=m=ma[K].faceNormals[G]:(w=ma[K].vertexNormals[G],m=w.a,z=w.b,w=w.c),G=na[K],G[O]=m.x,G[O+1]=m.y,G[O+2]=m.z,G[O+3]=z.x,G[O+4]=z.y,G[O+5]=z.z,G[O+6]=w.x,G[O+7]=w.y,G[O+8]=w.z),O+=9;a.bindBuffer(a.ARRAY_BUFFER,b.__webglMorphTargetsBuffers[K]);a.bufferData(a.ARRAY_BUFFER,F[K],d);
-l.morphNormals&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglMorphNormalsBuffers[K]),a.bufferData(a.ARRAY_BUFFER,na[K],d))}if(ta.length){c=0;for(p=V.length;c<p;c++)m=ka[V[c]],z=ta[m.a],w=ta[m.b],F=ta[m.c],y[s]=z.x,y[s+1]=z.y,y[s+2]=z.z,y[s+3]=z.w,y[s+4]=w.x,y[s+5]=w.y,y[s+6]=w.z,y[s+7]=w.w,y[s+8]=F.x,y[s+9]=F.y,y[s+10]=F.z,y[s+11]=F.w,z=La[m.a],w=La[m.b],m=La[m.c],H[s]=z.x,H[s+1]=z.y,H[s+2]=z.z,H[s+3]=z.w,H[s+4]=w.x,H[s+5]=w.y,H[s+6]=w.z,H[s+7]=w.w,H[s+8]=m.x,H[s+9]=m.y,H[s+10]=m.z,H[s+11]=m.w,s+=12;0<s&&
-(a.bindBuffer(a.ARRAY_BUFFER,b.__webglSkinIndicesBuffer),a.bufferData(a.ARRAY_BUFFER,H,d),a.bindBuffer(a.ARRAY_BUFFER,b.__webglSkinWeightsBuffer),a.bufferData(a.ARRAY_BUFFER,y,d))}if(u){c=0;for(p=V.length;c<p;c++)m=ka[V[c]],s=m.vertexColors,u=m.color,3===s.length&&l.vertexColors===THREE.VertexColors?(H=s[0],y=s[1],s=s[2]):s=y=H=u,v[I]=H.r,v[I+1]=H.g,v[I+2]=H.b,v[I+3]=y.r,v[I+4]=y.g,v[I+5]=y.b,v[I+6]=s.r,v[I+7]=s.g,v[I+8]=s.b,I+=9;0<I&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglColorBuffer),a.bufferData(a.ARRAY_BUFFER,
-v,d))}if(ra&&Y.hasTangents){c=0;for(p=V.length;c<p;c++)m=ka[V[c]],v=m.vertexTangents,l=v[0],I=v[1],v=v[2],r[B]=l.x,r[B+1]=l.y,r[B+2]=l.z,r[B+3]=l.w,r[B+4]=I.x,r[B+5]=I.y,r[B+6]=I.z,r[B+7]=I.w,r[B+8]=v.x,r[B+9]=v.y,r[B+10]=v.z,r[B+11]=v.w,B+=12;a.bindBuffer(a.ARRAY_BUFFER,b.__webglTangentBuffer);a.bufferData(a.ARRAY_BUFFER,r,d)}if(t){c=0;for(p=V.length;c<p;c++)if(m=ka[V[c]],r=m.vertexNormals,t=m.normal,3===r.length&&!1===n)for(B=0;3>B;B++)t=r[B],$[C]=t.x,$[C+1]=t.y,$[C+2]=t.z,C+=3;else for(B=0;3>B;B++)$[C]=
-t.x,$[C+1]=t.y,$[C+2]=t.z,C+=3;a.bindBuffer(a.ARRAY_BUFFER,b.__webglNormalBuffer);a.bufferData(a.ARRAY_BUFFER,$,d)}if(qa&&Q){c=0;for(p=V.length;c<p;c++)if(n=V[c],n=Q[n],void 0!==n)for(B=0;3>B;B++)C=n[B],N[x]=C.x,N[x+1]=C.y,x+=2;0<x&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglUVBuffer),a.bufferData(a.ARRAY_BUFFER,N,d))}if(qa&&va){c=0;for(p=V.length;c<p;c++)if(n=V[c],x=va[n],void 0!==x)for(B=0;3>B;B++)N=x[B],D[A]=N.x,D[A+1]=N.y,A+=2;0<A&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglUV2Buffer),a.bufferData(a.ARRAY_BUFFER,
-D,d))}if(ua){c=0;for(p=V.length;c<p;c++)ea[M]=E,ea[M+1]=E+1,ea[M+2]=E+2,M+=3,W[R]=E,W[R+1]=E+1,W[R+2]=E,W[R+3]=E+2,W[R+4]=E+1,W[R+5]=E+2,R+=6,E+=3;a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,b.__webglFaceBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER,ea,d);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,b.__webglLineBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER,W,d)}if(P)for(B=0,E=P.length;B<E;B++)if(A=P[B],A.__original.needsUpdate){D=0;if(1===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=
-ka[V[c]],A.array[D]=A.value[m.a],A.array[D+1]=A.value[m.b],A.array[D+2]=A.value[m.c],D+=3;else{if("faces"===A.boundTo)for(c=0,p=V.length;c<p;c++)R=A.value[V[c]],A.array[D]=R,A.array[D+1]=R,A.array[D+2]=R,D+=3}else if(2===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=ka[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=w.x,A.array[D+3]=w.y,A.array[D+4]=m.x,A.array[D+5]=m.y,D+=6;else{if("faces"===A.boundTo)for(c=0,p=V.length;c<
-p;c++)m=w=z=R=A.value[V[c]],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=w.x,A.array[D+3]=w.y,A.array[D+4]=m.x,A.array[D+5]=m.y,D+=6}else if(3===A.size)if(M="c"===A.type?["r","g","b"]:["x","y","z"],void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=ka[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z[M[0]],A.array[D+1]=z[M[1]],A.array[D+2]=z[M[2]],A.array[D+3]=w[M[0]],A.array[D+4]=w[M[1]],A.array[D+5]=w[M[2]],A.array[D+6]=m[M[0]],A.array[D+7]=m[M[1]],A.array[D+8]=
+l.shading===THREE.FlatShading,p,m,r,t,s,u,v,x,z,w,I,H,y,F,B,E,C,N,K,L,J,G,A=x=K=E=0,M=0,R=B=C=0,O=s=I=0,D=0,O=b.__vertexArray;N=b.__uvArray;var D=b.__uv2Array,aa=b.__normalArray;r=b.__tangentArray;v=b.__colorArray;H=b.__skinIndexArray;y=b.__skinWeightArray;F=b.__morphTargetsArrays;var oa=b.__morphNormalsArrays,P=b.__webglCustomAttributesList,ea=b.__faceArray,$=b.__lineArray,X=c.geometry,ua=X.elementsNeedUpdate,ka=X.uvsNeedUpdate;t=X.normalsNeedUpdate;var ra=X.tangentsNeedUpdate;u=X.colorsNeedUpdate;
+L=X.morphTargetsNeedUpdate;G=X.vertices;var V=b.faces3,la=X.faces,Q=X.faceVertexUvs[0],va=X.faceVertexUvs[1],La=X.skinIndices,ta=X.skinWeights,Ba=X.morphTargets,na=X.morphNormals;if(X.verticesNeedUpdate){c=0;for(p=V.length;c<p;c++)m=la[V[c]],z=G[m.a],w=G[m.b],m=G[m.c],O[K]=z.x,O[K+1]=z.y,O[K+2]=z.z,O[K+3]=w.x,O[K+4]=w.y,O[K+5]=w.z,O[K+6]=m.x,O[K+7]=m.y,O[K+8]=m.z,K+=9;a.bindBuffer(a.ARRAY_BUFFER,b.__webglVertexBuffer);a.bufferData(a.ARRAY_BUFFER,O,d)}if(L)for(K=0,L=Ba.length;K<L;K++){c=O=0;for(p=
+V.length;c<p;c++)G=V[c],m=la[G],z=Ba[K].vertices[m.a],w=Ba[K].vertices[m.b],m=Ba[K].vertices[m.c],J=F[K],J[O]=z.x,J[O+1]=z.y,J[O+2]=z.z,J[O+3]=w.x,J[O+4]=w.y,J[O+5]=w.z,J[O+6]=m.x,J[O+7]=m.y,J[O+8]=m.z,l.morphNormals&&(n?w=z=m=na[K].faceNormals[G]:(w=na[K].vertexNormals[G],m=w.a,z=w.b,w=w.c),G=oa[K],G[O]=m.x,G[O+1]=m.y,G[O+2]=m.z,G[O+3]=z.x,G[O+4]=z.y,G[O+5]=z.z,G[O+6]=w.x,G[O+7]=w.y,G[O+8]=w.z),O+=9;a.bindBuffer(a.ARRAY_BUFFER,b.__webglMorphTargetsBuffers[K]);a.bufferData(a.ARRAY_BUFFER,F[K],d);
+l.morphNormals&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglMorphNormalsBuffers[K]),a.bufferData(a.ARRAY_BUFFER,oa[K],d))}if(ta.length){c=0;for(p=V.length;c<p;c++)m=la[V[c]],z=ta[m.a],w=ta[m.b],F=ta[m.c],y[s]=z.x,y[s+1]=z.y,y[s+2]=z.z,y[s+3]=z.w,y[s+4]=w.x,y[s+5]=w.y,y[s+6]=w.z,y[s+7]=w.w,y[s+8]=F.x,y[s+9]=F.y,y[s+10]=F.z,y[s+11]=F.w,z=La[m.a],w=La[m.b],m=La[m.c],H[s]=z.x,H[s+1]=z.y,H[s+2]=z.z,H[s+3]=z.w,H[s+4]=w.x,H[s+5]=w.y,H[s+6]=w.z,H[s+7]=w.w,H[s+8]=m.x,H[s+9]=m.y,H[s+10]=m.z,H[s+11]=m.w,s+=12;0<s&&
+(a.bindBuffer(a.ARRAY_BUFFER,b.__webglSkinIndicesBuffer),a.bufferData(a.ARRAY_BUFFER,H,d),a.bindBuffer(a.ARRAY_BUFFER,b.__webglSkinWeightsBuffer),a.bufferData(a.ARRAY_BUFFER,y,d))}if(u){c=0;for(p=V.length;c<p;c++)m=la[V[c]],s=m.vertexColors,u=m.color,3===s.length&&l.vertexColors===THREE.VertexColors?(H=s[0],y=s[1],s=s[2]):s=y=H=u,v[I]=H.r,v[I+1]=H.g,v[I+2]=H.b,v[I+3]=y.r,v[I+4]=y.g,v[I+5]=y.b,v[I+6]=s.r,v[I+7]=s.g,v[I+8]=s.b,I+=9;0<I&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglColorBuffer),a.bufferData(a.ARRAY_BUFFER,
+v,d))}if(ra&&X.hasTangents){c=0;for(p=V.length;c<p;c++)m=la[V[c]],v=m.vertexTangents,l=v[0],I=v[1],v=v[2],r[B]=l.x,r[B+1]=l.y,r[B+2]=l.z,r[B+3]=l.w,r[B+4]=I.x,r[B+5]=I.y,r[B+6]=I.z,r[B+7]=I.w,r[B+8]=v.x,r[B+9]=v.y,r[B+10]=v.z,r[B+11]=v.w,B+=12;a.bindBuffer(a.ARRAY_BUFFER,b.__webglTangentBuffer);a.bufferData(a.ARRAY_BUFFER,r,d)}if(t){c=0;for(p=V.length;c<p;c++)if(m=la[V[c]],r=m.vertexNormals,t=m.normal,3===r.length&&!1===n)for(B=0;3>B;B++)t=r[B],aa[C]=t.x,aa[C+1]=t.y,aa[C+2]=t.z,C+=3;else for(B=0;3>
+B;B++)aa[C]=t.x,aa[C+1]=t.y,aa[C+2]=t.z,C+=3;a.bindBuffer(a.ARRAY_BUFFER,b.__webglNormalBuffer);a.bufferData(a.ARRAY_BUFFER,aa,d)}if(ka&&Q){c=0;for(p=V.length;c<p;c++)if(n=V[c],n=Q[n],void 0!==n)for(B=0;3>B;B++)C=n[B],N[x]=C.x,N[x+1]=C.y,x+=2;0<x&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglUVBuffer),a.bufferData(a.ARRAY_BUFFER,N,d))}if(ka&&va){c=0;for(p=V.length;c<p;c++)if(n=V[c],x=va[n],void 0!==x)for(B=0;3>B;B++)N=x[B],D[A]=N.x,D[A+1]=N.y,A+=2;0<A&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglUV2Buffer),a.bufferData(a.ARRAY_BUFFER,
+D,d))}if(ua){c=0;for(p=V.length;c<p;c++)ea[M]=E,ea[M+1]=E+1,ea[M+2]=E+2,M+=3,$[R]=E,$[R+1]=E+1,$[R+2]=E,$[R+3]=E+2,$[R+4]=E+1,$[R+5]=E+2,R+=6,E+=3;a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,b.__webglFaceBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER,ea,d);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,b.__webglLineBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER,$,d)}if(P)for(B=0,E=P.length;B<E;B++)if(A=P[B],A.__original.needsUpdate){D=0;if(1===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=
+la[V[c]],A.array[D]=A.value[m.a],A.array[D+1]=A.value[m.b],A.array[D+2]=A.value[m.c],D+=3;else{if("faces"===A.boundTo)for(c=0,p=V.length;c<p;c++)R=A.value[V[c]],A.array[D]=R,A.array[D+1]=R,A.array[D+2]=R,D+=3}else if(2===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=la[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=w.x,A.array[D+3]=w.y,A.array[D+4]=m.x,A.array[D+5]=m.y,D+=6;else{if("faces"===A.boundTo)for(c=0,p=V.length;c<
+p;c++)m=w=z=R=A.value[V[c]],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=w.x,A.array[D+3]=w.y,A.array[D+4]=m.x,A.array[D+5]=m.y,D+=6}else if(3===A.size)if(M="c"===A.type?["r","g","b"]:["x","y","z"],void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=la[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z[M[0]],A.array[D+1]=z[M[1]],A.array[D+2]=z[M[2]],A.array[D+3]=w[M[0]],A.array[D+4]=w[M[1]],A.array[D+5]=w[M[2]],A.array[D+6]=m[M[0]],A.array[D+7]=m[M[1]],A.array[D+8]=
 m[M[2]],D+=9;else if("faces"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=w=z=R=A.value[V[c]],A.array[D]=z[M[0]],A.array[D+1]=z[M[1]],A.array[D+2]=z[M[2]],A.array[D+3]=w[M[0]],A.array[D+4]=w[M[1]],A.array[D+5]=w[M[2]],A.array[D+6]=m[M[0]],A.array[D+7]=m[M[1]],A.array[D+8]=m[M[2]],D+=9;else{if("faceVertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)R=A.value[V[c]],z=R[0],w=R[1],m=R[2],A.array[D]=z[M[0]],A.array[D+1]=z[M[1]],A.array[D+2]=z[M[2]],A.array[D+3]=w[M[0]],A.array[D+4]=w[M[1]],A.array[D+5]=w[M[2]],
-A.array[D+6]=m[M[0]],A.array[D+7]=m[M[1]],A.array[D+8]=m[M[2]],D+=9}else if(4===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=ka[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=z.z,A.array[D+3]=z.w,A.array[D+4]=w.x,A.array[D+5]=w.y,A.array[D+6]=w.z,A.array[D+7]=w.w,A.array[D+8]=m.x,A.array[D+9]=m.y,A.array[D+10]=m.z,A.array[D+11]=m.w,D+=12;else if("faces"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=w=z=R=A.value[V[c]],
+A.array[D+6]=m[M[0]],A.array[D+7]=m[M[1]],A.array[D+8]=m[M[2]],D+=9}else if(4===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=la[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=z.z,A.array[D+3]=z.w,A.array[D+4]=w.x,A.array[D+5]=w.y,A.array[D+6]=w.z,A.array[D+7]=w.w,A.array[D+8]=m.x,A.array[D+9]=m.y,A.array[D+10]=m.z,A.array[D+11]=m.w,D+=12;else if("faces"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=w=z=R=A.value[V[c]],
 A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=z.z,A.array[D+3]=z.w,A.array[D+4]=w.x,A.array[D+5]=w.y,A.array[D+6]=w.z,A.array[D+7]=w.w,A.array[D+8]=m.x,A.array[D+9]=m.y,A.array[D+10]=m.z,A.array[D+11]=m.w,D+=12;else if("faceVertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)R=A.value[V[c]],z=R[0],w=R[1],m=R[2],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=z.z,A.array[D+3]=z.w,A.array[D+4]=w.x,A.array[D+5]=w.y,A.array[D+6]=w.z,A.array[D+7]=w.w,A.array[D+8]=m.x,A.array[D+9]=m.y,A.array[D+10]=m.z,A.array[D+
 11]=m.w,D+=12;a.bindBuffer(a.ARRAY_BUFFER,A.buffer);a.bufferData(a.ARRAY_BUFFER,A.array,d)}e&&(delete b.__inittedArrays,delete b.__colorArray,delete b.__normalArray,delete b.__tangentArray,delete b.__uvArray,delete b.__uv2Array,delete b.__faceArray,delete b.__vertexArray,delete b.__lineArray,delete b.__skinIndexArray,delete b.__skinWeightArray)}};this.delete=function(c){for(var d="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),
 e=0,k=d.length;e<k;e++){var l=d[e];void 0!==c[l]&&(a.deleteBuffer(c[l]),delete c[l])}if(void 0!==c.__webglCustomAttributesList){for(l in c.__webglCustomAttributesList)a.deleteBuffer(c.__webglCustomAttributesList[l].buffer);delete c.__webglCustomAttributesList}b.memory.geometries--}};
@@ -618,8 +633,8 @@ B.lookAt(n);B.updateMatrixWorld();B.matrixWorldInverse.getInverse(B.matrixWorld)
 THREE.MeshFaceMaterial?E.material.materials[0]:E.material,N=void 0!==E.geometry.morphTargets&&0<E.geometry.morphTargets.length&&J.morphTargets,G=E instanceof THREE.SkinnedMesh&&J.skinning,N=E.customDepthMaterial?E.customDepthMaterial:G?N?v:u:N?s:t,a.setMaterialFaces(J),C instanceof THREE.BufferGeometry?a.renderBufferDirect(B,b,null,N,C,E):a.renderBuffer(B,b,null,N,C,E);y=0;for(F=d.length;y<F;y++)C=d[y],E=C.object,E.visible&&E.castShadow&&(E._modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,E.matrixWorld),
 a.renderImmediateObject(B,b,null,t,E))}r=a.getClearColor();H=a.getClearAlpha();f.clearColor(r.r,r.g,r.b,H);f.enable(f.BLEND);x.cullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState()}}};
 THREE.WebGLState=function(a,b){var c=new Uint8Array(16),d=new Uint8Array(16),e=null,f=null,g=null,h=null,k=null,l=null,n=null,p=null,m=null,r=null,t=null,s=null,u=null,v=null,x=null,z=null;this.initAttributes=function(){for(var a=0,b=c.length;a<b;a++)c[a]=0};this.enableAttribute=function(b){c[b]=1;0===d[b]&&(a.enableVertexAttribArray(b),d[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,e=d.length;b<e;b++)d[b]!==c[b]&&(a.disableVertexAttribArray(b),d[b]=0)};this.setBlending=function(c,d,
-m,p,r,t,s){c!==e&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?a.enable(a.BLEND):(a.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),
-a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),e=c);if(c===THREE.CustomBlending){r=r||d;t=t||m;s=s||p;if(d!==f||r!==k)a.blendEquationSeparate(b(d),b(r)),f=d,k=r;if(m!==g||p!==h||t!==l||s!==n)a.blendFuncSeparate(b(m),b(p),b(t),b(s)),g=m,h=p,l=t,n=s}else n=l=k=h=g=f=null};this.setDepthTest=function(b){p!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),p=b)};this.setDepthWrite=function(b){m!==b&&(a.depthMask(b),m=b)};this.setColorWrite=function(b){r!==b&&(a.colorMask(b,
+m,p,r,s,t){c!==e&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?a.enable(a.BLEND):(a.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),
+a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),e=c);if(c===THREE.CustomBlending){r=r||d;s=s||m;t=t||p;if(d!==f||r!==k)a.blendEquationSeparate(b(d),b(r)),f=d,k=r;if(m!==g||p!==h||s!==l||t!==n)a.blendFuncSeparate(b(m),b(p),b(s),b(t)),g=m,h=p,l=s,n=t}else n=l=k=h=g=f=null};this.setDepthTest=function(b){p!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),p=b)};this.setDepthWrite=function(b){m!==b&&(a.depthMask(b),m=b)};this.setColorWrite=function(b){r!==b&&(a.colorMask(b,
 b,b,b),r=b)};this.setDoubleSided=function(b){t!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),t=b)};this.setFlipSided=function(b){s!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),s=b)};this.setLineWidth=function(b){b!==u&&(a.lineWidth(b),u=b)};this.setPolygonOffset=function(b,c,d){v!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),v=b);!b||x===c&&z===d||(a.polygonOffset(c,d),x=c,z=d)};this.reset=function(){for(var a=0;a<d.length;a++)d[a]=0;s=t=r=m=p=e=null}};
 THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,l,n,p,m=a.context,r,t,s,u,v,x;this.render=function(z,w,I,H){if(0!==b.length){z=new THREE.Vector3;var y=H/I,F=.5*I,B=.5*H,E=16/H,C=new THREE.Vector2(E*y,E),N=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1);if(void 0===s){var E=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),L=new Uint16Array([0,1,2,0,2,3]);r=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,r);m.bufferData(m.ARRAY_BUFFER,E,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
 t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,L,m.STATIC_DRAW);v=m.createTexture();x=m.createTexture();m.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);m.bindTexture(m.TEXTURE_2D,x);m.texImage2D(m.TEXTURE_2D,0,
@@ -750,10 +765,10 @@ THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||THRE
 -1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)==Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(P=a.length;0<=--P;){c=P;d=P-1;0>d&&(d=a.length-1);for(var e=0,f=r+2*n,e=0;e<f;e++){var g=D*e,h=D*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+N,g=g+N,l=l+N,h=h+N;C.faces.push(new THREE.Face3(k,g,h,null,null,x));C.faces.push(new THREE.Face3(g,l,h,null,null,x));k=z.generateSideWallUV(C,k,g,l,h);C.faceVertexUvs[0].push([k[0],k[1],
 k[3]]);C.faceVertexUvs[0].push([k[1],k[2],k[3]])}}}function f(a,b,c){C.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=N;b+=N;c+=N;C.faces.push(new THREE.Face3(a,b,c,null,null,v));a=z.generateTopUV(C,a,b,c);C.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:
 12,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,s,u=!1,v=b.material,x=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,I,H,y;t&&(s=t.getSpacedPoints(r),u=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,!1),I=new THREE.Vector3,H=new THREE.Vector3,y=new THREE.Vector3);p||(l=k=n=0);var F,B,E,C=this,N=this.vertices.length,t=a.extractPoints(m),m=t.shape,K=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();B=0;for(E=
-K.length;B<E;B++)F=K[B],THREE.Shape.Utils.isClockWise(F)&&(K[B]=F.reverse());t=!1}var L=THREE.Shape.Utils.triangulateShape(m,K),J=m;B=0;for(E=K.length;B<E;B++)F=K[B],m=m.concat(F);var G,A,M,R,O,D=m.length,$,na=L.length,t=[],P=0;M=J.length;G=M-1;for(A=P+1;P<M;P++,G++,A++)G===M&&(G=0),A===M&&(A=0),t[P]=d(J[P],J[G],J[A]);var ea=[],W,Y=t.concat();B=0;for(E=K.length;B<E;B++){F=K[B];W=[];P=0;M=F.length;G=M-1;for(A=P+1;P<M;P++,G++,A++)G===M&&(G=0),A===M&&(A=0),W[P]=d(F[P],F[G],F[A]);ea.push(W);Y=Y.concat(W)}for(G=
-0;G<n;G++){M=G/n;R=k*(1-M);A=l*Math.sin(M*Math.PI/2);P=0;for(M=J.length;P<M;P++)O=c(J[P],t[P],A),f(O.x,O.y,-R);B=0;for(E=K.length;B<E;B++)for(F=K[B],W=ea[B],P=0,M=F.length;P<M;P++)O=c(F[P],W[P],A),f(O.x,O.y,-R)}A=l;for(P=0;P<D;P++)O=p?c(m[P],Y[P],A):m[P],u?(H.copy(w.normals[0]).multiplyScalar(O.x),I.copy(w.binormals[0]).multiplyScalar(O.y),y.copy(s[0]).add(H).add(I),f(y.x,y.y,y.z)):f(O.x,O.y,0);for(M=1;M<=r;M++)for(P=0;P<D;P++)O=p?c(m[P],Y[P],A):m[P],u?(H.copy(w.normals[M]).multiplyScalar(O.x),I.copy(w.binormals[M]).multiplyScalar(O.y),
-y.copy(s[M]).add(H).add(I),f(y.x,y.y,y.z)):f(O.x,O.y,h/r*M);for(G=n-1;0<=G;G--){M=G/n;R=k*(1-M);A=l*Math.sin(M*Math.PI/2);P=0;for(M=J.length;P<M;P++)O=c(J[P],t[P],A),f(O.x,O.y,h+R);B=0;for(E=K.length;B<E;B++)for(F=K[B],W=ea[B],P=0,M=F.length;P<M;P++)O=c(F[P],W[P],A),u?f(O.x,O.y+s[r-1].y,s[r-1].x+R):f(O.x,O.y,h+R)}(function(){if(p){var a;a=0*D;for(P=0;P<na;P++)$=L[P],g($[2]+a,$[1]+a,$[0]+a);a=r+2*n;a*=D;for(P=0;P<na;P++)$=L[P],g($[0]+a,$[1]+a,$[2]+a)}else{for(P=0;P<na;P++)$=L[P],g($[2],$[1],$[0]);
-for(P=0;P<na;P++)$=L[P],g($[0]+D*r,$[1]+D*r,$[2]+D*r)}})();(function(){var a=0;e(J,a);a+=J.length;B=0;for(E=K.length;B<E;B++)F=K[B],e(F,a),a+=F.length})()};
+K.length;B<E;B++)F=K[B],THREE.Shape.Utils.isClockWise(F)&&(K[B]=F.reverse());t=!1}var L=THREE.Shape.Utils.triangulateShape(m,K),J=m;B=0;for(E=K.length;B<E;B++)F=K[B],m=m.concat(F);var G,A,M,R,O,D=m.length,aa,oa=L.length,t=[],P=0;M=J.length;G=M-1;for(A=P+1;P<M;P++,G++,A++)G===M&&(G=0),A===M&&(A=0),t[P]=d(J[P],J[G],J[A]);var ea=[],$,X=t.concat();B=0;for(E=K.length;B<E;B++){F=K[B];$=[];P=0;M=F.length;G=M-1;for(A=P+1;P<M;P++,G++,A++)G===M&&(G=0),A===M&&(A=0),$[P]=d(F[P],F[G],F[A]);ea.push($);X=X.concat($)}for(G=
+0;G<n;G++){M=G/n;R=k*(1-M);A=l*Math.sin(M*Math.PI/2);P=0;for(M=J.length;P<M;P++)O=c(J[P],t[P],A),f(O.x,O.y,-R);B=0;for(E=K.length;B<E;B++)for(F=K[B],$=ea[B],P=0,M=F.length;P<M;P++)O=c(F[P],$[P],A),f(O.x,O.y,-R)}A=l;for(P=0;P<D;P++)O=p?c(m[P],X[P],A):m[P],u?(H.copy(w.normals[0]).multiplyScalar(O.x),I.copy(w.binormals[0]).multiplyScalar(O.y),y.copy(s[0]).add(H).add(I),f(y.x,y.y,y.z)):f(O.x,O.y,0);for(M=1;M<=r;M++)for(P=0;P<D;P++)O=p?c(m[P],X[P],A):m[P],u?(H.copy(w.normals[M]).multiplyScalar(O.x),I.copy(w.binormals[M]).multiplyScalar(O.y),
+y.copy(s[M]).add(H).add(I),f(y.x,y.y,y.z)):f(O.x,O.y,h/r*M);for(G=n-1;0<=G;G--){M=G/n;R=k*(1-M);A=l*Math.sin(M*Math.PI/2);P=0;for(M=J.length;P<M;P++)O=c(J[P],t[P],A),f(O.x,O.y,h+R);B=0;for(E=K.length;B<E;B++)for(F=K[B],$=ea[B],P=0,M=F.length;P<M;P++)O=c(F[P],$[P],A),u?f(O.x,O.y+s[r-1].y,s[r-1].x+R):f(O.x,O.y,h+R)}(function(){if(p){var a;a=0*D;for(P=0;P<oa;P++)aa=L[P],g(aa[2]+a,aa[1]+a,aa[0]+a);a=r+2*n;a*=D;for(P=0;P<oa;P++)aa=L[P],g(aa[0]+a,aa[1]+a,aa[2]+a)}else{for(P=0;P<oa;P++)aa=L[P],g(aa[2],aa[1],
+aa[0]);for(P=0;P<oa;P++)aa=L[P],g(aa[0]+D*r,aa[1]+D*r,aa[2]+D*r)}})();(function(){var a=0;e(J,a);a+=J.length;B=0;for(E=K.length;B<E;B++)F=K[B],e(F,a),a+=F.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],

Some files were not shown because too many files changed in this diff