n*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;returnthis},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");
n*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;returnthis},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");
varf=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;returnthis}}(),multiply:function(a,b){returnvoid0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,
varf=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;returnthis}}(),multiply:function(a,b){returnvoid0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,
a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;returnthis},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");returna.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");returna.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;returnthis},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");returna.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");returna.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
a.y,a.z);returnb}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");returna.applyMatrix4(this)},determinant:function(){vara=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],l=a[2],n=a[6],p=a[10],m=a[14];returna[3]*(+e*h*n-d*k*
a.y,a.z);returnb}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");returna.applyMatrix4(this)},determinant:function(){vara=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],l=a[2],n=a[6],p=a[10],m=a[14];returna[3]*(+e*h*n-d*k*
THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===binstanceofTHREE.BufferAttribute&&!1===binstanceofTHREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){returnthis.attributes[a]},removeAttribute:function(a){deletethis.attributes[a]},getoffsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .drawcalls.");
THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===binstanceofTHREE.BufferAttribute&&!1===binstanceofTHREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):("index"===a&&!1===binstanceofTHREE.IndexBufferAttribute&&(console.warn("THREE.BufferGeometry.addAttribute: Use THREE.IndexBufferAttribute for index attribute."),b=newTHREE.IndexBufferAttribute(b.array,
returnthis.drawcalls},addDrawCall:function(a,b,c){void0!==c&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.");this.drawcalls.push({start:a,count:b})},clearDrawCalls:function(){this.drawcalls=[]},applyMatrix:function(a){varb=this.attributes.position;void0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void0!==b&&((newTHREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();
b.itemSize)),this.attributes[a]=b)},getAttribute:function(a){returnthis.attributes[a]},removeAttribute:function(a){deletethis.attributes[a]},getoffsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .drawcalls.");returnthis.drawcalls},addDrawCall:function(a,b,c){void0!==c&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.");this.drawcalls.push({start:a,count:b})},clearDrawCalls:function(){this.drawcalls=[]},applyMatrix:function(a){varb=this.attributes.position;
isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){vara=newTHREE.Box3,b=newTHREE.Vector3;returnfunction(){null===this.boundingSphere&&(this.boundingSphere=newTHREE.Sphere);varc=this.attributes.position.array;if(c){a.makeEmpty();for(vard=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.fromArray(c,
newTHREE.Box3);varb=this.attributes.position.array;if(b){varc=this.boundingBox;c.makeEmpty();for(vard=0,e=b.length;d<e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void0===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))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),
e),a.expandByPoint(b);a.center(d);for(varf=0,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){vara=this.attributes,b=this.drawcalls;if(a.position){varc=a.position.array;if(void0===
computeBoundingSphere:function(){vara=newTHREE.Box3,b=newTHREE.Vector3;returnfunction(){null===this.boundingSphere&&(this.boundingSphere=newTHREE.Sphere);varc=this.attributes.position.array;if(c){a.makeEmpty();for(vard=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(varf=0,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
pa=U.dot(l[a]);ea=0>pa?-1:1;h[4*a]=R.x;h[4*a+1]=R.y;h[4*a+2]=R.z;h[4*a+3]=ea}if(void0===this.attributes.index||void0===this.attributes.position||void0===this.attributes.normal||void0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{varc=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void0===this.attributes.tangent&&
l[b].add(K);l[c].add(K)}functionb(a){F.fromArray(e,3*a);$.copy(F);aa=k[a];R.copy(aa);R.sub(F.multiplyScalar(F.dot(aa))).normalize();U.crossVectors($,aa);pa=U.dot(l[a]);ea=0>pa?-1:1;h[4*a]=R.x;h[4*a+1]=R.y;h[4*a+2]=R.z;h[4*a+3]=ea}if(void0===this.attributes.index||void0===this.attributes.position||void0===this.attributes.normal||void0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{varc=
C.start,H=C.count,C=G,G+=H;C<G;C+=3)H=c[C+0],O=c[C+1],Q=c[C+2],a(H,O,Q);for(varR=newTHREE.Vector3,U=newTHREE.Vector3,F=newTHREE.Vector3,$=newTHREE.Vector3,ea,aa,pa,f=0,n=T.length;f<n;++f)for(C=T[f],G=C.start,H=C.count,C=G,G+=H;C<G;C+=3)H=c[C+0],O=c[C+1],Q=c[C+2],b(H),b(O),b(Q)}},computeOffsets:function(a){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},merge:function(a,b){if(!1===ainstanceofTHREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
newTHREE.Vector3,K=newTHREE.Vector3,C,G,H,O,Q;0===this.drawcalls.length&&this.addDrawCall(0,c.length);for(varT=this.drawcalls,f=0,n=T.length;f<n;++f)for(C=T[f],G=C.start,H=C.count,C=G,G+=H;C<G;C+=3)H=c[C+0],O=c[C+1],Q=c[C+2],a(H,O,Q);for(varR=newTHREE.Vector3,U=newTHREE.Vector3,F=newTHREE.Vector3,$=newTHREE.Vector3,ea,aa,pa,f=0,n=T.length;f<n;++f)for(C=T[f],G=C.start,H=C.count,C=G,G+=H;C<G;C+=3)H=c[C+0],O=c[C+1],Q=c[C+2],b(H),b(O),b(Q)}},computeOffsets:function(a){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},
merge:function(a,b){if(!1===ainstanceofTHREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void0===b&&(b=0);varc=this.attributes,d;for(dinc)if(void0!==a.attributes[d])for(vare=c[d].array,g=a.attributes[d],f=g.array,h=0,g=g.itemSize*b;h<f.length;h++,g++)e[g]=f[h];returnthis}},normalizeNormals:function(){for(vara=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+
if(mb&&e&&e.skeleton&&e.skeleton.useVertexTexture)pa=1024;else{varR=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),T=Math.floor((R-20)/4);void0!==e&&einstanceofTHREE.SkinnedMesh&&(T=Math.min(e.skeleton.bones.length,T),T<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+T+" (try OpenGL instead of ANGLE)"));pa=T}varU=G;null!==d.precision&&(U=L.getMaxPrecision(d.precision),U!==d.precision&&console.warn("THREE.WebGLRenderer.initMaterial:",
H;varP;if(mb&&e&&e.skeleton&&e.skeleton.useVertexTexture)P=1024;else{varR=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),T=Math.floor((R-20)/4);void0!==e&&einstanceofTHREE.SkinnedMesh&&(T=Math.min(e.skeleton.bones.length,T),T<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+T+" (try OpenGL instead of ANGLE)"));P=T}varU=G;null!==d.precision&&(U=M.getMaxPrecision(d.precision),U!==d.precision&&console.warn("THREE.WebGLRenderer.initMaterial:",
Fa=M(fa.format),Ib=M(fa.type);x(s.TEXTURE_CUBE_MAP,fa,Zb);for(ha=0;6>ha;ha++)if(Xb)for(varOa,$b=Na[ha].mipmaps,cb=0,Pb=$b.length;cb<Pb;cb++)Oa=$b[cb],fa.format!==THREE.RGBAFormat&&fa.format!==THREE.RGBFormat?-1<L.getCompressedTextureFormats().indexOf(Fa)?L.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,cb,Fa,Oa.width,Oa.height,0,Oa.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):L.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+
Fa=L(fa.format),Ib=L(fa.type);x(s.TEXTURE_CUBE_MAP,fa,Zb);for(ha=0;6>ha;ha++)if(Xb)for(varOa,$b=Na[ha].mipmaps,cb=0,Pb=$b.length;cb<Pb;cb++)Oa=$b[cb],fa.format!==THREE.RGBAFormat&&fa.format!==THREE.RGBFormat?-1<M.getCompressedTextureFormats().indexOf(Fa)?M.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,cb,Fa,Oa.width,Oa.height,0,Oa.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):M.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+
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}functionv(){vara=fb;a>=db&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+db);fb+=1;returna}functiony(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}functionx(a,b,c){c?(s.texParameteri(a,s.TEXTURE_WRAP_S,M(b.wrapS)),s.texParameteri(a,
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}functionv(){vara=fb;a>=db&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+db);fb+=1;returna}functiony(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}functionx(a,b,c){c?(s.texParameteri(a,s.TEXTURE_WRAP_S,L(b.wrapS)),s.texParameteri(a,
s.TEXTURE_WRAP_T,M(b.wrapT)),s.texParameteri(a,s.TEXTURE_MAG_FILTER,M(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,M(b.minFilter))):(s.texParameteri(a,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(a,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),s.texParameteri(a,s.TEXTURE_MAG_FILTER,
s.TEXTURE_WRAP_T,L(b.wrapT)),s.texParameteri(a,s.TEXTURE_MAG_FILTER,L(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,L(b.minFilter))):(s.texParameteri(a,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(a,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),s.texParameteri(a,s.TEXTURE_MAG_FILTER,
A(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,A(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=X.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||Z.get(b).__currentAnisotropy)&&(s.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,
A(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,A(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=X.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||Z.get(b).__currentAnisotropy)&&(s.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,
Math.min(b.anisotropy,ja.getMaxAnisotropy())),Z.get(b).__currentAnisotropy=b.anisotropy)}functionE(a,b){if(a.width>b||a.height>b){varc=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);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);returnd}returna}functionB(a,b,c){s.bindFramebuffer(s.FRAMEBUFFER,
Math.min(b.anisotropy,ja.getMaxAnisotropy())),Z.get(b).__currentAnisotropy=b.anisotropy)}functionE(a,b){if(a.width>b||a.height>b){varc=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);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);returnd}returna}functionB(a,b,c){s.bindFramebuffer(s.FRAMEBUFFER,
(n=X.get("ANGLE_instanced_arrays"),null===n)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");breaka}void0===h&&(h=0);L.initAttributes();varm=d.attributes,g=g.getAttributes(),p=e.defaultAttributeValues,q;for(qing){vart=g[q];if(0<=t){varv=m[q];if(void0!==v){L.enableAttribute(t);varw=v.itemSize,x=ua.getAttributeBuffer(v);if(vinstanceofTHREE.InterleavedBufferAttribute){vary=v.data,
(n=X.get("ANGLE_instanced_arrays"),null===n)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");breaka}void0===h&&(h=0);M.initAttributes();varm=d.attributes,g=g.getAttributes(),q=e.defaultAttributeValues,p;for(ping){vart=g[p];if(0<=t){varv=m[p];if(void0!==v){M.enableAttribute(t);varw=v.itemSize,x=ua.getAttributeBuffer(v);if(vinstanceofTHREE.InterleavedBufferAttribute){vary=v.data,
z=y.stride,v=v.offset;s.bindBuffer(s.ARRAY_BUFFER,x);s.vertexAttribPointer(t,w,s.FLOAT,!1,z*y.array.BYTES_PER_ELEMENT,(h*z+v)*y.array.BYTES_PER_ELEMENT);if(yinstanceofTHREE.InstancedInterleavedBuffer){if(null===n){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");breaka}n.vertexAttribDivisorANGLE(t,y.meshPerAttribute);void0===d.maxInstancedCount&&(d.maxInstancedCount=y.meshPerAttribute*
L=y.stride,v=v.offset;s.bindBuffer(s.ARRAY_BUFFER,x);s.vertexAttribPointer(t,w,s.FLOAT,!1,L*y.array.BYTES_PER_ELEMENT,(h*L+v)*y.array.BYTES_PER_ELEMENT);if(yinstanceofTHREE.InstancedInterleavedBuffer){if(null===n){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");breaka}n.vertexAttribDivisorANGLE(t,y.meshPerAttribute);void0===d.maxInstancedCount&&(d.maxInstancedCount=y.meshPerAttribute*
y.count)}}elseif(s.bindBuffer(s.ARRAY_BUFFER,x),s.vertexAttribPointer(t,w,s.FLOAT,!1,0,h*w*4),vinstanceofTHREE.InstancedBufferAttribute){if(null===n){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");breaka}n.vertexAttribDivisorANGLE(t,v.meshPerAttribute);void0===d.maxInstancedCount&&(d.maxInstancedCount=v.meshPerAttribute*v.count)}}elseif(void0!==p&&(w=p[q],void0!==w))switch(w.length){case2:s.vertexAttrib2fv(t,
y.count)}}elseif(s.bindBuffer(s.ARRAY_BUFFER,x),s.vertexAttribPointer(t,w,s.FLOAT,!1,0,h*w*4),vinstanceofTHREE.InstancedBufferAttribute){if(null===n){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");breaka}n.vertexAttribDivisorANGLE(t,v.meshPerAttribute);void0===d.maxInstancedCount&&(d.maxInstancedCount=v.meshPerAttribute*v.count)}}elseif(void0!==q&&(w=q[p],void0!==w))switch(w.length){case2:s.vertexAttrib2fv(t,
0<d.maxInstancedCount?c.renderInstances(d):kinstanceofTHREE.InterleavedBufferAttribute?c.render(0,k.data.count):c.renderGroups(b)):finstanceofTHREE.Line?(d=e.linewidth,void0===d&&(d=1),L.setLineWidth(d*C),finstanceofTHREE.LineSegments?c.setMode(s.LINES):c.setMode(s.LINE_STRIP),c.renderGroups(b)):finstanceofTHREE.PointCloud&&(c.setMode(s.POINTS),c.renderGroups(b))};this.render=function(a,b,c,d){if(!1===binstanceofTHREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
0<d.maxInstancedCount?c.renderInstances(d):kinstanceofTHREE.InterleavedBufferAttribute?c.render(0,k.data.count):c.renderGroups(b)):finstanceofTHREE.Line?(d=e.linewidth,void0===d&&(d=1),M.setLineWidth(d*C),finstanceofTHREE.LineSegments?c.setMode(s.LINES):c.setMode(s.LINE_STRIP),c.renderGroups(b)):finstanceofTHREE.PointCloud&&(c.setMode(s.POINTS),c.renderGroups(b))};this.render=function(a,b,c,d){if(!1===binstanceofTHREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
(b===THREE.FrontFaceDirectionCW?s.frontFace(s.CW):s.frontFace(s.CCW),a===THREE.CullFaceBack?s.cullFace(s.BACK):a===THREE.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK),L.enable(s.CULL_FACE))};this.setTexture=function(a,b){varc=Z.get(a);if(0<a.version&&c.__version!==a.version){vard=a.image;if(void0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);elseif(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",
(b===THREE.FrontFaceDirectionCW?s.frontFace(s.CW):s.frontFace(s.CCW),a===THREE.CullFaceBack?s.cullFace(s.BACK):a===THREE.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK),M.enable(s.CULL_FACE))};this.setTexture=function(a,b){varc=Z.get(a);if(0<a.version&&c.__version!==a.version){vard=a.image;if(void0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);elseif(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",
l,f,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):L.texImage2D(s.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);elseif(0<k.length&&d){l=0;for(m=k.length;l<m;l++)e=k[l],L.texImage2D(s.TEXTURE_2D,l,f,f,h,e);a.generateMipmaps=!1}elseL.texImage2D(s.TEXTURE_2D,0,f,f,h,a.image);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}elseL.activeTexture(s.TEXTURE0+
l,f,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):M.texImage2D(s.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);elseif(0<k.length&&d){l=0;for(m=k.length;l<m;l++)e=k[l],M.texImage2D(s.TEXTURE_2D,l,f,f,h,e);a.generateMipmaps=!1}elseM.texImage2D(s.TEXTURE_2D,0,f,f,h,a.image);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}elseM.activeTexture(s.TEXTURE0+
THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");elseif(Z.get(a).__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{varg=!1;Z.get(a).__webglFramebuffer!==ya&&(s.bindFramebuffer(s.FRAMEBUFFER,Z.get(a).__webglFramebuffer),g=!0);s.checkFramebufferStatus(s.FRAMEBUFFER)===s.FRAMEBUFFER_COMPLETE?
THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");elseif(Z.get(a).__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{varg=!1;Z.get(a).__webglFramebuffer!==ya&&(s.bindFramebuffer(s.FRAMEBUFFER,Z.get(a).__webglFramebuffer),g=!0);s.checkFramebufferStatus(s.FRAMEBUFFER)===s.FRAMEBUFFER_COMPLETE?
s.readPixels(b,c,d,e,s.RGBA,s.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&s.bindFramebuffer(s.FRAMEBUFFER,ya)}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");returnX.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");
s.readPixels(b,c,d,e,s.RGBA,s.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&s.bindFramebuffer(s.FRAMEBUFFER,ya)}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");returnX.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");
returnX.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");returnX.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");returnX.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=
returnX.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");returnX.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");returnX.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=
break;case"WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+c+" extension not supported.");returnb[c]=d}};
break;case"WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+c+" extension not supported.");returnb[c]=d}};
varh=a.STATIC_DRAW;if(finstanceofTHREE.DynamicBufferAttribute||finstanceofTHREE.InstancedBufferAttribute&&!0===f.dynamic||finstanceofTHREE.InterleavedBuffer&&!0===f.dynamic)h=a.DYNAMIC_DRAW;a.bufferData(e,f.array,h);g.version=f.version}elseg.version!==f.version&&(a.bindBuffer(e,g.__webglBuffer),void0===f.updateRange||-1===f.updateRange.count?a.bufferSubData(e,0,f.array):0===f.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
a.bindBuffer(d,e.__webglBuffer);varf=a.STATIC_DRAW;if(cinstanceofTHREE.DynamicBufferAttribute||cinstanceofTHREE.InstancedBufferAttribute&&!0===c.dynamic||cinstanceofTHREE.InterleavedBuffer&&!0===c.dynamic)f=a.DYNAMIC_DRAW;a.bufferData(d,c.array,f);e.version=c.version}elsee.version!==c.version&&(a.bindBuffer(d,e.__webglBuffer),void0===c.updateRange||-1===c.updateRange.count?a.bufferSubData(d,0,c.array):0===c.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
r.shadowMatrix=newTHREE.Matrix4}if(!r.shadowCamera){if(rinstanceofTHREE.SpotLight)r.shadowCamera=newTHREE.PerspectiveCamera(r.shadowCameraFov,r.shadowMapWidth/r.shadowMapHeight,r.shadowCameraNear,r.shadowCameraFar);elseif(rinstanceofTHREE.DirectionalLight)r.shadowCamera=newTHREE.OrthographicCamera(r.shadowCameraLeft,r.shadowCameraRight,r.shadowCameraTop,r.shadowCameraBottom,r.shadowCameraNear,r.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",
r.shadowMatrix=newTHREE.Matrix4}if(!r.shadowCamera){if(rinstanceofTHREE.SpotLight)r.shadowCamera=newTHREE.PerspectiveCamera(r.shadowCameraFov,r.shadowMapWidth/r.shadowMapHeight,r.shadowCameraNear,r.shadowCameraFar);elseif(rinstanceofTHREE.DirectionalLight)r.shadowCamera=newTHREE.OrthographicCamera(r.shadowCameraLeft,r.shadowCameraRight,r.shadowCameraTop,r.shadowCameraBottom,r.shadowCameraNear,r.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",
THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");vard;binstanceofTHREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");returna.center()}};
THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");vard;binstanceofTHREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");returna.center()}};
d)};for(varh=0,k=a.length;h<k;++h)b(h);returng},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){varc=function(a){varb=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;vard=a.width,e=a.height,g=document.createElement("canvas");
d)};for(varh=0,k=a.length;h<k;++h)b(h);returng},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){varc=function(a){varb=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;vard=a.width,e=a.height,g=document.createElement("canvas");
(function(a){varb=function(a){for(varb=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){vare=a.length;if(3>e)returnnull;varg=[],f=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)f[l]=l;elsefor(l=0;l<e;l++)f[l]=e-1-l;varp=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);varm;a:{varq=m=void0,t=void0,r=void0,
(function(a){varb=function(a){for(varb=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){vare=a.length;if(3>e)returnnull;varg=[],f=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)f[l]=l;elsefor(l=0;l<e;l++)f[l]=e-1-l;varp=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);varm;a:{varq=m=void0,t=void0,r=void0,
THREE.ExtrudeGeometry.prototype.addShape=function(a,b){functionc(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");returnb.clone().multiplyScalar(c).add(a)}functiond(a,b,c){vard=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){vark=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)returnnewTHREE.Vector2(c,a);d=Math.sqrt(d/2)}elsea=!1,1E-10<d?1E-10<f&&(a=
THREE.ExtrudeGeometry.prototype.addShape=function(a,b){functionc(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");returnb.clone().multiplyScalar(c).add(a)}functiond(a,b,c){vard=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){vark=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)returnnewTHREE.Vector2(c,a);d=Math.sqrt(d/2)}elsea=!1,1E-10<d?1E-10<f&&(a=