// threejs.org/license (function(m,na){"object"===typeof exports&&"undefined"!==typeof module?na(exports):"function"===typeof define&&define.amd?define(["exports"],na):na(m.three=m.three||{})})(this,function(m){function na(){}function d(a,b){this.x=a||0;this.y=b||0}function n(a,b,c,d,e,f,g,h,k,l){object.defineproperty(this,"id",{value:lf++});this.uuid=r.generateuuid();this.name="";this.image=void 0!==a?a:n.default_image;this.mipmaps=[];this.mapping=void 0!==b?b:n.default_mapping;this.wraps=void 0!==c?c:1001;this.wrapt= void 0!==d?d:1001;this.magfilter=void 0!==e?e:1006;this.minfilter=void 0!==f?f:1008;this.anisotropy=void 0!==k?k:1;this.format=void 0!==g?g:1023;this.type=void 0!==h?h:1009;this.offset=new d(0,0);this.repeat=new d(1,1);this.generatemipmaps=!0;this.premultiplyalpha=!1;this.flipy=!0;this.unpackalignment=4;this.encoding=void 0!==l?l:3e3;this.version=0;this.onupdate=null}function s(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}function ab(a,b,c){this.uuid=r.generateuuid();this.width= a;this.height=b;this.scissor=new s(0,0,a,b);this.scissortest=!1;this.viewport=new s(0,0,a,b);c=c||{};void 0===c.minfilter&&(c.minfilter=1006);this.texture=new n(void 0,void 0,c.wraps,c.wrapt,c.magfilter,c.minfilter,c.format,c.type,c.anisotropy,c.encoding);this.depthbuffer=void 0!==c.depthbuffer?c.depthbuffer:!0;this.stencilbuffer=void 0!==c.stencilbuffer?c.stencilbuffer:!0;this.depthtexture=void 0!==c.depthtexture?c.depthtexture:null}function bb(a,b,c){ab.call(this,a,b,c);this.activemipmaplevel=this.activecubeface= 0}function ia(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1}function n(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}function o(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];0=d||0 0 ) {\nfloat depth = gl_fragcoord.z / gl_fragcoord.w;\nfloat fogfactor = 0.0;\nif ( fogtype == 1 ) {\nfogfactor = smoothstep( fognear, fogfar, depth );\n} else {\nconst float log2 = 1.442695;\nfogfactor = exp2( - fogdensity * fogdensity * depth * depth * log2 );\nfogfactor = 1.0 - clamp( fogfactor, 0.0, 1.0 );\n}\ngl_fragcolor = mix( gl_fragcolor, vec4( fogcolor, gl_fragcolor.w ), fogfactor );\n}\n}"].join("\n")); b.compileshader(z);b.compileshader(w);b.attachshader(m,z);b.attachshader(m,w);b.linkprogram(m);ba=m;b=b.getattriblocation(ba,"position");h=b.getattriblocation(ba,"uv");f=b.getuniformlocation(ba,"uvoffset");g=b.getuniformlocation(ba,"uvscale");h=b.getuniformlocation(ba,"rotation");k=b.getuniformlocation(ba,"scale");l=b.getuniformlocation(ba,"color");q=b.getuniformlocation(ba,"map");p=b.getuniformlocation(ba,"opacity");t=b.getuniformlocation(ba,"modelviewmatrix");r=b.getuniformlocation(ba,"projectionmatrix"); m=b.getuniformlocation(ba,"fogtype");u=b.getuniformlocation(ba,"fogdensity");x=b.getuniformlocation(ba,"fognear");y=b.getuniformlocation(ba,"fogfar");a=b.getuniformlocation(ba,"fogcolor");i=b.getuniformlocation(ba,"alphatest");m=document.createelementns("http://www.w3.org/1999/xhtml","canvas");m.width=8;m.height=8;z=m.getcontext("2d");z.fillstyle="white";z.fillrect(0,0,8,8);je=new oc(m)}c.useprogram(ba);c.initattributes();c.enableattribute(b);c.enableattribute(h);c.disableunusedattributes();c.disable(b.cull_face); c.enable(b.blend);b.bindbuffer(b.array_buffer,xa);b.vertexattribpointer(b,2,b.float,!1,16,0);b.vertexattribpointer(h,2,b.float,!1,16,8);b.bindbuffer(b.element_array_buffer,la);b.uniformmatrix4fv(r,!1,t.projectionmatrix.elements);c.activetexture(b.texture0);b.uniform1i(q,0);z=m=0;(w=n.fog)?(b.uniform3f(a,w.color.r,w.color.g,w.color.b),w.isfog?(b.uniform1f(x,w.near),b.uniform1f(y,w.far),b.uniform1i(m,1),z=m=1):w.isfogexp2&&(b.uniform1f(u,w.density),b.uniform1i(m,2),z=m=2)):(b.uniform1i(m,0),z=m=0); for(var d=0,c=v.length;db&&(b=a[c]);return b}function f(){object.defineproperty(this,"id",{value:rd++});this.uuid=r.generateuuid();this.name="";this.type="buffergeometry";this.index=null;this.attributes={};this.morphattributes={};this.groups=[];this.boundingsphere=this.boundingbox=null;this.drawrange={start:0,count:infinity}}function eb(a,b,c,d,e,f){q.call(this);this.type="boxgeometry";this.parameters={width:a,height:b,depth:c,widthsegments:d,heightsegments:e,depthsegments:f};this.frombuffergeometry(new fb(a, b,c,d,e,f));this.mergevertices()}function fb(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,m,va,xa,la){var a=f/va,v=g/xa,u=f/2,x=g/2,i=m/2;g=va+1;var b=xa+1,y=f=0,h,w,z=new n;for(w=0;wl;l++){if(p=d[l])if(h=p[0],p=p[1]){q&&e.addattribute("morphtarget"+l,q[h]);f&&e.addattribute("morphnormal"+l,f[h]);c[l]=p;continue}c[l]=0}g.getuniforms().setvalue(a,"morphtargetinfluences", c)}}}function wf(a,b,c){var d,e,f;this.setmode=function(a){d=a};this.setindex=function(a){e=a.type;f=a.bytesperelement};this.render=function(b,h){a.drawelements(d,h,e,b*f);c.calls++;c.vertices+=h;d===a.triangles?c.faces+=h/3:d===a.points&&(c.points+=h)};this.renderinstances=function(g,h,k){var l=b.get("angle_instanced_arrays");null===l?console.error("three.webglindexedbufferrenderer: using three.instancedbuffergeometry but hardware does not support extension angle_instanced_arrays."):(l.drawelementsinstancedangle(d, k,e,h*f,g.maxinstancedcount),c.calls++,c.vertices+=k*g.maxinstancedcount,d===a.triangles?c.faces+=g.maxinstancedcount*k/3:d===a.points&&(c.points+=g.maxinstancedcount*k))}}function xf(a,b,c){var d;this.setmode=function(a){d=a};this.render=function(b,f){a.drawarrays(d,b,f);c.calls++;c.vertices+=f;d===a.triangles?c.faces+=f/3:d===a.points&&(c.points+=f)};this.renderinstances=function(e,f,g){var h=b.get("angle_instanced_arrays");if(null===h)console.error("three.webglbufferrenderer: using three.instancedbuffergeometry but hardware does not support extension angle_instanced_arrays."); else{var k=e.attributes.position;k.isinterleavedbufferattribute?(g=k.data.count,h.drawarraysinstancedangle(d,0,g,e.maxinstancedcount)):h.drawarraysinstancedangle(d,f,g,e.maxinstancedcount);c.calls++;c.vertices+=g*e.maxinstancedcount;d===a.triangles?c.faces+=e.maxinstancedcount*g/3:d===a.points&&(c.points+=e.maxinstancedcount*g)}}}function yf(a,b,c){function d(a){a=a.target;var g=e[a.id];null!==g.index&&b.remove(g.index);for(var k in g.attributes)b.remove(g.attributes[k]);a.removeeventlistener("dispose", d);delete e[a.id];if(k=f[a.id])b.remove(k),delete f[a.id];if(k=f[g.id])b.remove(k),delete f[g.id];c.geometries--}var e={},f={};return{get:function(a,b){var f=e[b.id];if(f)return f;b.addeventlistener("dispose",d);b.isbuffergeometry?f=b:b.isgeometry&&(void 0===b._buffergeometry&&(b._buffergeometry=(new f).setfromobject(a)),f=b._buffergeometry);e[b.id]=f;c.geometries++;return f},update:function(c){var d=c.index,e=c.attributes;null!==d&&b.update(d,a.element_array_buffer);for(var f in e)b.update(e[f], a.array_buffer);c=c.morphattributes;for(f in c)for(var d=c[f],e=0,g=d.length;e/gm,function(a,c){a=v[c];if(void 0===a)throw error("can not resolve #include <"+c+">");return ud(a)})}function pe(a){return a.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\s]+?)(?=\})\}/g, function(a,c,d,e){a="";for(c=parseint(c);cb||a.height>b){b/=math.max(a.width,a.height);var c=document.createelementns("http://www.w3.org/1999/xhtml","canvas");c.width=math.floor(a.width*b);c.height=math.floor(a.height*b);c.getcontext("2d").drawimage(a, 0,0,a.width,a.height,0,0,c.width,c.height);console.warn("three.webglrenderer: image is too big ("+a.width+"x"+a.height+"). resized to "+c.width+"x"+c.height,a);return c}return a}function k(a){return r.ispoweroftwo(a.width)&&r.ispoweroftwo(a.height)}function l(a,b){return a.generatemipmaps&&b&&1003!==a.minfilter&&1006!==a.minfilter}function q(b){return 1003===b||1004===b||1005===b?a.nearest:a.linear}function p(b){b=b.target;b.removeeventlistener("dispose",p);a:{var c=d.get(b);if(b.image&&c.__image__webgltexturecube)a.deletetexture(c.__image__webgltexturecube); else{if(void 0===c.__webglinit)break a;a.deletetexture(c.__webgltexture)}d.remove(b)}g.textures--}function t(b){b=b.target;b.removeeventlistener("dispose",t);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webgltexture&&a.deletetexture(e.__webgltexture);b.depthtexture&&b.depthtexture.dispose();if(b.iswebglrendertargetcube)for(e=0;6>e;e++)a.deleteframebuffer(c.__webglframebuffer[e]),c.__webgldepthbuffer&&a.deleterenderbuffer(c.__webgldepthbuffer[e]);else a.deleteframebuffer(c.__webglframebuffer), c.__webgldepthbuffer&&a.deleterenderbuffer(c.__webgldepthbuffer);d.remove(b.texture);d.remove(b)}g.textures--}function r(b,q){var t=d.get(b);if(0n;n++)v[n]=q||r?r?b.image[n].image:b.image[n]:h(b.image[n],e.maxcubemapsize); var u=k(v[0]),x=f.convert(b.format),a=f.convert(b.type);m(a.texture_cube_map,b,u);for(n=0;6>n;n++)if(q)for(var y,i=v[n].mipmaps,w=0,z=i.length;wq;q++)e.__webglframebuffer[q]=a.createframebuffer()}else e.__webglframebuffer=a.createframebuffer();if(h){c.bindtexture(a.texture_cube_map,f.__webgltexture);m(a.texture_cube_map,b.texture,p);for(q=0;6>q;q++)n(e.__webglframebuffer[q],b,a.color_attachment0,a.texture_cube_map_positive_x+q); l(b.texture,p)&&a.generatemipmap(a.texture_cube_map);c.bindtexture(a.texture_cube_map,null)}else c.bindtexture(a.texture_2d,f.__webgltexture),m(a.texture_2d,b.texture,p),n(e.__webglframebuffer,b,a.color_attachment0,a.texture_2d),l(b.texture,p)&&a.generatemipmap(a.texture_2d),c.bindtexture(a.texture_2d,null);if(b.depthbuffer){e=d.get(b);f=!0===b.iswebglrendertargetcube;if(b.depthtexture){if(f)throw error("target.depthtexture not supported in cube render targets");if(b&&b.iswebglrendertargetcube)throw error("depth texture with cube render targets is not supported"); a.bindframebuffer(a.framebuffer,e.__webglframebuffer);if(!b.depthtexture||!b.depthtexture.isdepthtexture)throw error("rendertarget.depthtexture must be an instance of three.depthtexture");d.get(b.depthtexture).__webgltexture&&b.depthtexture.image.width===b.width&&b.depthtexture.image.height===b.height||(b.depthtexture.image.width=b.width,b.depthtexture.image.height=b.height,b.depthtexture.needsupdate=!0);r(b.depthtexture,0);e=d.get(b.depthtexture).__webgltexture;if(1026===b.depthtexture.format)a.framebuffertexture2d(a.framebuffer, a.depth_attachment,a.texture_2d,e,0);else if(1027===b.depthtexture.format)a.framebuffertexture2d(a.framebuffer,a.depth_stencil_attachment,a.texture_2d,e,0);else throw error("unknown depthtexture format");}else if(f)for(e.__webgldepthbuffer=[],f=0;6>f;f++)a.bindframebuffer(a.framebuffer,e.__webglframebuffer[f]),e.__webgldepthbuffer[f]=a.createrenderbuffer(),x(e.__webgldepthbuffer[f],b);else a.bindframebuffer(a.framebuffer,e.__webglframebuffer),e.__webgldepthbuffer=a.createrenderbuffer(),x(e.__webgldepthbuffer, b);a.bindframebuffer(a.framebuffer,null)}};this.updaterendertargetmipmap=function(b){var e=b.texture,f=k(b);l(e,f)&&(b=b.iswebglrendertargetcube?a.texture_cube_map:a.texture_2d,e=d.get(e).__webgltexture,c.bindtexture(b,e),a.generatemipmap(b),c.bindtexture(b,null))}}function kg(){var a={};return{get:function(b){b=b.uuid;var c=a[b];void 0===c&&(c={},a[b]=c);return c},remove:function(b){delete a[b.uuid]},clear:function(){a={}}}}function lg(a,b,c){function d(b,c,d){var e=new uint8array(4),f=a.createtexture(); a.bindtexture(b,f);a.texparameteri(b,a.texture_min_filter,a.nearest);a.texparameteri(b,a.texture_mag_filter,a.nearest);for(b=0;b=ea.maxtextures&&console.warn("three.webglrenderer: trying to use "+a+" texture units while this gpu supports only "+ ea.maxtextures);g+=1;return a};this.settexture2d=function(){var a=!1;return function(b,c){b&&b.iswebglrendertarget&&(a||(console.warn("three.webglrenderer.settexture2d: don't use render targets as textures. use their .texture property instead."),a=!0),b=b.texture);fa.settexture2d(b,c)}}();this.settexture=function(){var a=!1;return function(b,c){a||(console.warn("three.webglrenderer: .settexture is deprecated, use settexture2d instead."),a=!0);fa.settexture2d(b,c)}}();this.settexturecube=function(){var a= !1;return function(b,c){b&&b.iswebglrendertargetcube&&(a||(console.warn("three.webglrenderer.settexturecube: don't use cube render targets as textures. use their .texture property instead."),a=!0),b=b.texture);b&&b.iscubetexture||array.isarray(b.image)&&6===b.image.length?fa.settexturecube(b,c):fa.settexturecubedynamic(b,c)}}();this.getrendertarget=function(){return ga};this.setrendertarget=function(a){(ga=a)&&void 0===da.get(a).__webglframebuffer&&fa.setuprendertarget(a);var b=null,c=!1;a?(b=da.get(a).__webglframebuffer, a.iswebglrendertargetcube&&(b=b[a.activecubeface],c=!0),v.copy(a.viewport),w.copy(a.scissor),x=a.scissortest):(v.copy(aa).multiplyscalar(n),w.copy(ia).multiplyscalar(n),x=ha);m!==b&&(e.bindframebuffer(e.framebuffer,b),m=b);z.viewport(v);z.scissor(w);z.setscissortest(x);c&&(c=da.get(a.texture),e.framebuffertexture2d(e.framebuffer,e.color_attachment0,e.texture_cube_map_positive_x+a.activecubeface,c.__webgltexture,a.activemipmaplevel))};this.readrendertargetpixels=function(a,b,c,d,e,f){if(a&&a.iswebglrendertarget){var g= da.get(a).__webglframebuffer;if(g){var h=!1;g!==m&&(e.bindframebuffer(e.framebuffer,g),h=!0);try{var l=a.texture,k=l.format,q=l.type;1023!==k&&qa.convert(k)!==e.getparameter(e.implementation_color_read_format)?console.error("three.webglrenderer.readrendertargetpixels: rendertarget is not in rgba or implementation defined format."):1009===q||qa.convert(q)===e.getparameter(e.implementation_color_read_type)||1015===q&&(ka.get("oes_texture_float")||ka.get("webgl_color_buffer_float"))||1016===q&&ka.get("ext_color_buffer_half_float")? e.checkframebufferstatus(e.framebuffer)===e.framebuffer_complete?0<=b&&b<=a.width-d&&0<=c&&c<=a.height-e&&e.readpixels(b,c,d,e,qa.convert(k),qa.convert(q),f):console.error("three.webglrenderer.readrendertargetpixels: readpixels from rendertarget failed. framebuffer not complete."):console.error("three.webglrenderer.readrendertargetpixels: rendertarget is not in unsignedbytetype or implementation defined type.")}finally{h&&e.bindframebuffer(e.framebuffer,m)}}}else console.error("three.webglrenderer.readrendertargetpixels: rendertarget is not three.webglrendertarget.")}} function hb(a,b){this.name="";this.color=new c(a);this.density=void 0!==b?b:2.5e-4}function ib(a,b,c){this.name="";this.color=new c(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1e3}function nd(){w.call(this);this.type="scene";this.overridematerial=this.fog=this.background=null;this.autoupdate=!0}function zd(a,b,c,d,e){w.call(this);this.lensflares=[];this.positionscreen=new n;this.customupdatecallback=void 0;void 0!==a&&this.add(a,b,c,d,e)}function za(a){p.call(this);this.type="spritematerial"; this.color=new c(16777215);this.map=null;this.rotation=0;this.lights=this.fog=!1;this.setvalues(a)}function xc(a){w.call(this);this.type="sprite";this.material=void 0!==a?a:new za}function yc(){w.call(this);this.type="lod";object.defineproperties(this,{levels:{enumerable:!0,value:[]}})}function zc(a,b){a=a||[];this.bones=a.slice(0);this.bonematrices=new float32array(16*this.bones.length);if(void 0===b)this.calculateinverses();else if(this.bones.length===b.length)this.boneinverses=b.slice(0);else for(console.warn("three.skeleton boneinverses is the wrong length."), this.boneinverses=[],a=0,b=this.bones.length;a=a.have_current_data&&(q.needsupdate=!0)}n.call(this,a,b,c,d,e,f,g,h,k);this.generatemipmaps=!1;var q=this;l()}function kb(a,b,c,d,e,f,g,h,k,l, q,p){n.call(this,null,f,g,h,k,l,d,e,q,p);this.image={width:b,height:c};this.mipmaps=a;this.generatemipmaps=this.flipy=!1}function bc(a,b,c,d,e,f,g,h,k,l){l=void 0!==l?l:1026;if(1026!==l&&1027!==l)throw error("depthtexture format must be either three.depthformat or three.depthstencilformat");void 0===c&&1026===l&&(c=1012);void 0===c&&1027===l&&(c=1020);n.call(this,null,d,e,f,g,h,l,c,k);this.image={width:a,height:b};this.magfilter=void 0!==g?g:1003;this.minfilter=void 0!==h?h:1003;this.generatemipmaps= this.flipy=!1}function lb(a){f.call(this);this.type="wireframegeometry";var b=[],c,d,e,f=[0,0],g={},h=["a","b","c"];if(a&&a.isgeometry){var k=a.faces;var l=0;for(d=k.length;lc;c++){var p=q[h[c]];var t=q[h[(c+1)%3]];f[0]=math.min(p,t);f[1]=math.max(p,t);p=f[0]+","+f[1];void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]})}}for(p in g)l=g[p],h=a.vertices[l.index1],b.push(h.x,h.y,h.z),h=a.vertices[l.index2],b.push(h.x,h.y,h.z)}else if(a&&a.isbuffergeometry){var h=new n;if(null!== a.index){k=a.attributes.position;q=a.index;var r=a.groups;0===r.length&&(r=[{start:0,count:q.count,materialindex:0}]);a=0;for(e=r.length;ac;c++)p=q.getx(l+c),t=q.getx(l+(c+1)%3),f[0]=math.min(p,t),f[1]=math.max(p,t),p=f[0]+","+f[1],void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]});for(p in g)l=g[p],h.frombufferattribute(k,l.index1),b.push(h.x,h.y,h.z),h.frombufferattribute(k,l.index2),b.push(h.x,h.y,h.z)}else for(k=a.attributes.position, l=0,d=k.count/3;lc;c++)g=3*l+c,h.frombufferattribute(k,g),b.push(h.x,h.y,h.z),g=3*l+(c+1)%3,h.frombufferattribute(k,g),b.push(h.x,h.y,h.z)}this.addattribute("position",new z(b,3))}function cc(a,b,c){q.call(this);this.type="parametricgeometry";this.parameters={func:a,slices:b,stacks:c};this.frombuffergeometry(new mb(a,b,c));this.mergevertices()}function mb(a,b,c){f.call(this);this.type="parametricbuffergeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],h= new n,k=new n,l=new n,q=new n,p=new n,t,r,m=b+1;for(t=0;t<=c;t++){var u=t/c;for(r=0;r<=b;r++){var x=r/b,k=a(x,u,k);e.push(k.x,k.y,k.z);0<=x-1e-5?(l=a(x-1e-5,u,l),q.subvectors(k,l)):(l=a(x+1e-5,u,l),q.subvectors(l,k));0<=u-1e-5?(l=a(x,u-1e-5,l),p.subvectors(k,l)):(l=a(x,u+1e-5,l),p.subvectors(l,k));h.crossvectors(q,p).normalize();f.push(h.x,h.y,h.z);g.push(x,u)}}for(t=0;td&&1===a.x&&(k[b]=a.x-1);0===c.x&&0===c.z&&(k[b]=d/2/math.pi+.5)}f.call(this);this.type="polyhedronbuffergeometry"; this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;var h=[],k=[];(function(a){for(var c=new n,d=new n,g=new n,h=0;he&&(.2>b&&(k[a+0]+=1),.2>c&&(k[a+2]+=1),.2>d&&(k[a+4]+=1))})();this.addattribute("position",new z(h,3));this.addattribute("normal",new z(h.slice(),3));this.addattribute("uv",new z(k,2));0===d?this.computevertexnormals(): this.normalizenormals()}function ec(a,b){q.call(this);this.type="tetrahedrongeometry";this.parameters={radius:a,detail:b};this.frombuffergeometry(new nb(a,b));this.mergevertices()}function nb(a,b){ua.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="tetrahedronbuffergeometry";this.parameters={radius:a,detail:b}}function fc(a,b){q.call(this);this.type="octahedrongeometry";this.parameters={radius:a,detail:b};this.frombuffergeometry(new jb(a,b));this.mergevertices()} function jb(a,b){ua.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="octahedronbuffergeometry";this.parameters={radius:a,detail:b}}function gc(a,b){q.call(this);this.type="icosahedrongeometry";this.parameters={radius:a,detail:b};this.frombuffergeometry(new ob(a,b));this.mergevertices()}function ob(a,b){var c=(1+math.sqrt(5))/2;ua.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11, 5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="icosahedronbuffergeometry";this.parameters={radius:a,detail:b}}function hc(a,b){q.call(this);this.type="dodecahedrongeometry";this.parameters={radius:a,detail:b};this.frombuffergeometry(new pb(a,b));this.mergevertices()}function pb(a,b){var c=(1+math.sqrt(5))/2,d=1/c;ua.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0, d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b);this.type="dodecahedronbuffergeometry";this.parameters={radius:a,detail:b}}function ic(a,b,c,d,e,f){q.call(this);this.type="tubegeometry";this.parameters={path:a, tubularsegments:b,radius:c,radialsegments:d,closed:e};void 0!==f&&console.warn("three.tubegeometry: taper has been removed.");a=new qb(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.frombuffergeometry(a);this.mergevertices()}function qb(a,b,c,d,e){function f(e){var f=a.getpointat(e/b),l=g.normals[e];e=g.binormals[e];for(p=0;p<=d;p++){var q=p/d*math.pi*2,r=math.sin(q),q=-math.cos(q);k.x=q*l.x+r*e.x;k.y=q*l.y+r*e.y;k.z=q*l.z+r*e.z;k.normalize();m.push(k.x, k.y,k.z);h.x=f.x+c*k.x;h.y=f.y+c*k.y;h.z=f.z+c*k.z;t.push(h.x,h.y,h.z)}}f.call(this);this.type="tubebuffergeometry";this.parameters={path:a,tubularsegments:b,radius:c,radialsegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computefrenetframes(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new n,k=new n,l=new d,q,p,t=[],m=[],v=[],u=[];for(q=0;qq;q++){var p=l[f[q]];var t=l[f[(q+1)%3]];d[0]=math.min(p,t);d[1]=math.max(p,t);p=d[0]+","+d[1];void 0===e[p]?e[p]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[p].face2=h}for(p in e)if(d=e[p],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.addattribute("position", new z(c,3))}function lb(a,b,c,d,e,f,g,h){q.call(this);this.type="cylindergeometry";this.parameters={radiustop:a,radiusbottom:b,height:c,radialsegments:d,heightsegments:e,openended:f,thetastart:g,thetalength:h};this.frombuffergeometry(new ta(a,b,c,d,e,f,g,h));this.mergevertices()}function ta(a,b,c,d,e,f,g,h){function k(c){var e,f=new d,k=new n,r=0,u=!0===c?a:b,a=!0===c?1:-1;var w=v;for(e=1;e<=d;e++)p.push(0,x*a,0),t.push(0,a,0),m.push(.5,.5),v++;var z=v;for(e=0;e<=d;e++){var c=e/d*h+g,j=math.cos(c), c=math.sin(c);k.x=u*c;k.y=x*a;k.z=u*j;p.push(k.x,k.y,k.z);t.push(0,a,0);f.x=.5*j+.5;f.y=.5*c*a+.5;m.push(f.x,f.y);v++}for(e=0;ethis.duration&&this.resetduration();this.optimize()}function hd(a){this.manager=void 0!==a?a:oa;this.textures={}}function ce(a){this.manager=void 0!==a?a:oa}function dc(){this.onloadstart=function(){};this.onloadprogress=function(){};this.onloadcomplete=function(){}}function de(a){"boolean"===typeof a&&(console.warn("three.jsonloader: showstatus parameter has been removed from constructor."),a=void 0);this.manager=void 0!== a?a:oa;this.withcredentials=!1}function se(a){this.manager=void 0!==a?a:oa;this.texturepath=""}function te(a,b,c,d,e){b=.5*(d-b);e=.5*(e-c);var f=a*a;return(2*c-2*d+b+e)*a*f+(-3*c+3*d-2*b-e)*f+b*a+c}function ub(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}function vb(a,b,c,d,e){var f=1-a,g=1-a;return f*f*f*b+3*g*g*a*c+3*(1-a)*a*a*d+a*a*a*e}function pa(){this.arclengthdivisions=200}function oa(a,b){this.arclengthdivisions=200;this.v1=a;this.v2=b}function vc(){this.arclengthdivisions=200;this.curves= [];this.autoclose=!1}function ua(a,b,c,d,e,f,g,h){this.arclengthdivisions=200;this.ax=a;this.ay=b;this.xradius=c;this.yradius=d;this.astartangle=e;this.aendangle=f;this.aclockwise=g;this.arotation=h||0}function wb(a){this.arclengthdivisions=200;this.points=void 0===a?[]:a}function ec(a,b,c,d){this.arclengthdivisions=200;this.v0=a;this.v1=b;this.v2=c;this.v3=d}function fc(a,b,c){this.arclengthdivisions=200;this.v0=a;this.v1=b;this.v2=c}function wc(a){vc.call(this);this.currentpoint=new d;a&&this.frompoints(a)} function xb(){wc.apply(this,arguments);this.holes=[]}function ee(){this.subpaths=[];this.currentpath=null}function fe(a){this.data=a}function ue(a){this.manager=void 0!==a?a:oa}function ge(a){this.manager=void 0!==a?a:oa}function ve(){this.type="stereocamera";this.aspect=1;this.eyesep=.064;this.cameral=new ja;this.cameral.layers.enable(1);this.cameral.matrixautoupdate=!1;this.camerar=new ja;this.camerar.layers.enable(2);this.camerar.matrixautoupdate=!1}function xc(a,b,c){w.call(this);this.type="cubecamera"; var d=new ja(90,1,a,b);d.up.set(0,-1,0);d.lookat(new n(1,0,0));this.add(d);var e=new ja(90,1,a,b);e.up.set(0,-1,0);e.lookat(new n(-1,0,0));this.add(e);var f=new ja(90,1,a,b);f.up.set(0,0,1);f.lookat(new n(0,1,0));this.add(f);var g=new ja(90,1,a,b);g.up.set(0,0,-1);g.lookat(new n(0,-1,0));this.add(g);var h=new ja(90,1,a,b);h.up.set(0,-1,0);h.lookat(new n(0,0,1));this.add(h);var k=new ja(90,1,a,b);k.up.set(0,-1,0);k.lookat(new n(0,0,-1));this.add(k);this.rendertarget=new bb(c,c,{format:1022,magfilter:1006, minfilter:1006});this.rendertarget.texture.name="cubecamera";this.update=function(a,b){null===this.parent&&this.updatematrixworld();var c=this.rendertarget,l=c.texture.generatemipmaps;c.texture.generatemipmaps=!1;c.activecubeface=0;a.render(b,d,c);c.activecubeface=1;a.render(b,e,c);c.activecubeface=2;a.render(b,f,c);c.activecubeface=3;a.render(b,g,c);c.activecubeface=4;a.render(b,h,c);c.texture.generatemipmaps=l;c.activecubeface=5;a.render(b,k,c);a.setrendertarget(null)};this.clear=function(a,b,c, d){for(var e=this.rendertarget,f=0;6>f;f++)e.activecubeface=f,a.setrendertarget(e),a.clear(b,c,d);a.setrendertarget(null)}}function he(){w.call(this);this.type="audiolistener";this.context=ie.getcontext();this.gain=this.context.creategain();this.gain.connect(this.context.destination);this.filter=null}function gc(a){w.call(this);this.type="audio";this.context=a.context;this.gain=this.context.creategain();this.gain.connect(a.getinput());this.autoplay=!1;this.buffer=null;this.loop=!1;this.starttime= 0;this.playbackrate=1;this.isplaying=!1;this.hasplaybackcontrol=!0;this.sourcetype="empty";this.filters=[]}function je(a){gc.call(this,a);this.panner=this.context.createpanner();this.panner.connect(this.gain)}function ke(a,b){this.analyser=a.context.createanalyser();this.analyser.fftsize=void 0!==b?b:2048;this.data=new uint8array(this.analyser.frequencybincount);a.getoutput().connect(this.analyser)}function le(a,b,c){this.binding=a;this.valuesize=c;a=float64array;switch(b){case "quaternion":b=this._slerp; break;case "string":case "bool":a=array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixbufferregion=b;this.referencecount=this.usecount=this.cumulativeweight=0}function we(a,b,c){c=c||da.parsetrackname(b);this._targetgroup=a;this._bindings=a.subscribe_(b,c)}function da(a,b,c){this.path=b;this.parsedpath=c||da.parsetrackname(b);this.node=da.findnode(a,this.parsedpath.nodename)||a;this.rootnode=a}function xe(a){this.uuid=r.generateuuid();this._objects=array.prototype.slice.call(arguments); this.ncachedobjects_=0;var b={};this._indicesbyuuid=b;for(var c=0,d=arguments.length;c!==d;++c)b[arguments[c].uuid]=c;this._paths=[];this._parsedpaths=[];this._bindings=[];this._bindingsindicesbypath={};var e=this;this.stats={objects:{get total(){return e._objects.length},get inuse(){return this.total-e.ncachedobjects_}},get bindingsperobject(){return e._bindings.length}}}function ye(a,b,c){this._mixer=a;this._clip=b;this._localroot=c||null;a=b.tracks;b=a.length;c=array(b);for(var d={endingstart:2400, endingend:2400},e=0;e!==b;++e){var f=a[e].createinterpolant(null);c[e]=f;f.settings=d}this._interpolantsettings=d;this._interpolants=c;this._propertybindings=array(b);this._weightinterpolant=this._timescaleinterpolant=this._byclipcacheindex=this._cacheindex=null;this.loop=2201;this._loopcount=-1;this._starttime=null;this.time=0;this._effectiveweight=this.weight=this._effectivetimescale=this.timescale=1;this.repetitions=infinity;this.paused=!1;this.enabled=!0;this.clampwhenfinished=!1;this.zeroslopeatend= this.zeroslopeatstart=!0}function ze(a){this._root=a;this._initmemorymanager();this.time=this._accuindex=0;this.timescale=1}function id(a,b){"string"===typeof a&&(console.warn("three.uniform: type parameter is no longer needed."),a=b);this.value=a}function me(){f.call(this);this.type="instancedbuffergeometry";this.maxinstancedcount=void 0}function ne(a,b,c,d){this.uuid=r.generateuuid();this.data=a;this.itemsize=b;this.offset=c;this.normalized=!0===d}function hc(a,b){this.uuid=r.generateuuid();this.array= a;this.stride=b;this.count=void 0!==a?a.length/b:0;this.dynamic=!1;this.updaterange={offset:0,count:-1};this.onuploadcallback=function(){};this.version=0}function oe(a,b,c){hc.call(this,a,b);this.meshperattribute=c||1}function pe(a,b,c){k.call(this,a,b);this.meshperattribute=c||1}function $e(a,b,c,d){this.ray=new hb(a,b);this.near=c||0;this.far=d||infinity;this.params={mesh:{},line:{},lod:{},points:{threshold:1},sprite:{}};object.defineproperties(this.params,{pointcloud:{get:function(){console.warn("three.raycaster: params.pointcloud has been renamed to params.points."); return this.points}}})}function af(a,b){return a.distance-b.distance}function qe(a,b,c,d){if(!1!==a.visible&&(a.raycast(b,c),!0===d)){a=a.children;d=0;for(var e=a.length;dc;c++,d++){var e=c/32*math.pi*2,f=d/32*math.pi*2;b.push(math.cos(e),math.sin(e),1,math.cos(f),math.sin(f),1)}a.addattribute("position",new z(b,3));b=new w({fog:!1});this.cone=new x(a,b);this.add(this.cone);this.update()}function ef(a){var b=[];a&&a.isbone&&b.push(a);for(var c=0;ca.length&&console.warn("three.catmullromcurve3: points array needs at least two entries.");this.points=a||[];this.closed=!1}function ed(a,b,c,d){this.arclengthdivisions=200;this.v0= a;this.v1=b;this.v2=c;this.v3=d}function fd(a,b,c){this.arclengthdivisions=200;this.v0=a;this.v1=b;this.v2=c}function gd(a,b){this.arclengthdivisions=200;this.v1=a;this.v2=b}function md(a,b,c,d,e,f){ua.call(this,a,b,c,c,d,e,f)}function ff(a){console.warn("three.closedsplinecurve3 has been deprecated. use three.catmullromcurve3 instead.");ja.call(this,a);this.type="catmullrom";this.closed=!0}function gf(a){console.warn("three.splinecurve3 has been deprecated. use three.catmullromcurve3 instead."); ja.call(this,a);this.type="catmullrom"}function te(a){console.warn("three.spline has been removed. use three.catmullromcurve3 instead.");ja.call(this,a);this.type="catmullrom"}void 0===number.epsilon&&(number.epsilon=math.pow(2,-52));void 0===number.isinteger&&(number.isinteger=function(a){return"number"===typeof a&&isfinite(a)&&math.floor(a)===a});void 0===math.sign&&(math.sign=function(a){return 0>a?-1:0e;e++)8===e||13===e||18===e||23===e?b[e]="-":14===e?b[e]="4":(2>=c&&(c=33554432+16777216*math.random()|0),d=c&15,c>>=4,b[e]=a[19===e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return math.max(b,math.min(c,a))},euclideanmodulo:function(a,b){return(a%b+b)%b},maplinear:function(a, b,c,d,e){return d+(a-b)*(e-d)/(c-b)},lerp:function(a,b,c){return(1-c)*a+c*b},smoothstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},randint:function(a,b){return a+math.floor(math.random()*(b-a+1))},randfloat:function(a,b){return a+math.random()*(b-a)},randfloatspread:function(a){return a*(.5-math.random())},degtorad:function(a){return a*r.deg2rad},radtodeg:function(a){return a* r.rad2deg},ispoweroftwo:function(a){return 0===(a&a-1)&&0!==a},nearestpoweroftwo:function(a){return math.pow(2,math.round(math.log(a)/math.ln2))},nextpoweroftwo:function(a){a--;a|=a>>1;a|=a>>2;a|=a>>4;a|=a>>8;a|=a>>16;a++;return a}};object.defineproperties(d.prototype,{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});object.assign(d.prototype,{isvector2:!0,set:function(a,b){this.x=a;this.y=b;return this},setscalar:function(a){this.y= this.x=a;return this},setx:function(a){this.x=a;return this},sety:function(a){this.y=a;return this},setcomponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw error("index is out of range: "+a);}return this},getcomponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a, b){if(void 0!==b)return console.warn("three.vector2: .add() now only accepts one argument. use .addvectors( a, b ) instead."),this.addvectors(a,b);this.x+=a.x;this.y+=a.y;return this},addscalar:function(a){this.x+=a;this.y+=a;return this},addvectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addscaledvector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("three.vector2: .sub() now only accepts one argument. use .subvectors( a, b ) instead."), this.subvectors(a,b);this.x-=a.x;this.y-=a.y;return this},subscalar:function(a){this.x-=a;this.y-=a;return this},subvectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyscalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},dividescalar:function(a){return this.multiplyscalar(1/a)},min:function(a){this.x=math.min(this.x,a.x);this.y=math.min(this.y,a.y);return this},max:function(a){this.x= math.max(this.x,a.x);this.y=math.max(this.y,a.y);return this},clamp:function(a,b){this.x=math.max(a.x,math.min(b.x,this.x));this.y=math.max(a.y,math.min(b.y,this.y));return this},clampscalar:function(){var a=new d,b=new d;return function(c,d){a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),clamplength:function(a,b){var c=this.length();return this.dividescalar(c||1).multiplyscalar(math.max(a,math.min(b,c)))},floor:function(){this.x=math.floor(this.x);this.y=math.floor(this.y);return this},ceil:function(){this.x= math.ceil(this.x);this.y=math.ceil(this.y);return this},round:function(){this.x=math.round(this.x);this.y=math.round(this.y);return this},roundtozero:function(){this.x=0>this.x?math.ceil(this.x):math.floor(this.x);this.y=0>this.y?math.ceil(this.y):math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthsq:function(){return this.x*this.x+this.y*this.y},length:function(){return math.sqrt(this.x*this.x+this.y*this.y)}, lengthmanhattan:function(){return math.abs(this.x)+math.abs(this.y)},normalize:function(){return this.dividescalar(this.length()||1)},angle:function(){var a=math.atan2(this.y,this.x);0>a&&(a+=2*math.pi);return a},distanceto:function(a){return math.sqrt(this.distancetosquared(a))},distancetosquared:function(a){var b=this.x-a.x;a=this.y-a.y;return b*b+a*a},distancetomanhattan:function(a){return math.abs(this.x-a.x)+math.abs(this.y-a.y)},setlength:function(a){return this.normalize().multiplyscalar(a)}, lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},lerpvectors:function(a,b,c){return this.subvectors(b,a).multiplyscalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y},fromarray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toarray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},frombufferattribute:function(a,b,c){void 0!==c&&console.warn("three.vector2: offset has been removed from .frombufferattribute()."); this.x=a.getx(b);this.y=a.gety(b);return this},rotatearound:function(a,b){var c=math.cos(b);b=math.sin(b);var d=this.x-a.x,e=this.y-a.y;this.x=d*c-e*b+a.x;this.y=d*b+e*c+a.y;return this}});var lf=0;n.default_image=void 0;n.default_mapping=300;object.defineproperty(n.prototype,"needsupdate",{set:function(a){!0===a&&this.version++}});object.assign(n.prototype,na.prototype,{constructor:n,istexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.name=a.name;this.image= a.image;this.mipmaps=a.mipmaps.slice(0);this.mapping=a.mapping;this.wraps=a.wraps;this.wrapt=a.wrapt;this.magfilter=a.magfilter;this.minfilter=a.minfilter;this.anisotropy=a.anisotropy;this.format=a.format;this.type=a.type;this.offset.copy(a.offset);this.repeat.copy(a.repeat);this.generatemipmaps=a.generatemipmaps;this.premultiplyalpha=a.premultiplyalpha;this.flipy=a.flipy;this.unpackalignment=a.unpackalignment;this.encoding=a.encoding;return this},tojson:function(a){if(void 0!==a.textures[this.uuid])return a.textures[this.uuid]; var b={metadata:{version:4.5,type:"texture",generator:"texture.tojson"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wraps,this.wrapt],minfilter:this.minfilter,magfilter:this.magfilter,anisotropy:this.anisotropy,flipy:this.flipy};if(void 0!==this.image){var c=this.image;void 0===c.uuid&&(c.uuid=r.generateuuid());if(void 0===a.images[c.uuid]){var d=a.images,e=c.uuid,f=c.uuid;if(c instanceof htmlcanvaselement)var g= c;else{g=document.createelementns("http://www.w3.org/1999/xhtml","canvas");g.width=c.width;g.height=c.height;var h=g.getcontext("2d");c instanceof imagedata?h.putimagedata(c,0,0):h.drawimage(c,0,0,c.width,c.height)}g=2048a.x||1a.x?0:1;break;case 1002:a.x=1===math.abs(math.floor(a.x)%2)?math.ceil(a.x)-a.x:a.x-math.floor(a.x)}if(0>a.y||1a.y?0:1;break;case 1002:a.y=1===math.abs(math.floor(a.y)%2)?math.ceil(a.y)-a.y:a.y-math.floor(a.y)}this.flipy&&(a.y=1-a.y)}}});object.assign(s.prototype,{isvector4:!0,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this}, setscalar:function(a){this.w=this.z=this.y=this.x=a;return this},setx:function(a){this.x=a;return this},sety:function(a){this.y=a;return this},setz:function(a){this.z=a;return this},setw:function(a){this.w=a;return this},setcomponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw error("index is out of range: "+a);}return this},getcomponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z; case 3:return this.w;default:throw error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("three.vector4: .add() now only accepts one argument. use .addvectors( a, b ) instead."),this.addvectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addscalar:function(a){this.x+=a;this.y+=a; this.z+=a;this.w+=a;return this},addvectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addscaledvector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;this.w+=a.w*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("three.vector4: .sub() now only accepts one argument. use .subvectors( a, b ) instead."),this.subvectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subscalar:function(a){this.x-=a;this.y-=a;this.z-= a;this.w-=a;return this},subvectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyscalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applymatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},dividescalar:function(a){return this.multiplyscalar(1/a)},setaxisanglefromquaternion:function(a){this.w= 2*math.acos(a.w);var b=math.sqrt(1-a.w*a.w);1e-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this},setaxisanglefromrotationmatrix:function(a){a=a.elements;var b=a[0];var c=a[4];var d=a[8],e=a[1],f=a[5],g=a[9];var h=a[2];var k=a[6];var l=a[10];if(.01>math.abs(c-e)&&.01>math.abs(d-h)&&.01>math.abs(g-k)){if(.1>math.abs(c+e)&&.1>math.abs(d+h)&&.1>math.abs(g+k)&&.1>math.abs(b+f+l-3))return this.set(1,0,0,0),this;a=math.pi;b=(b+1)/2;f=(f+1)/2;l=(l+1)/2;c=(c+e)/4;d=(d+h)/ 4;g=(g+k)/4;b>f&&b>l?.01>b?(k=0,c=h=.707106781):(k=math.sqrt(b),h=c/k,c=d/k):f>l?.01>f?(k=.707106781,h=0,c=.707106781):(h=math.sqrt(f),k=c/h,c=g/h):.01>l?(h=k=.707106781,c=0):(c=math.sqrt(l),k=d/c,h=g/c);this.set(k,h,c,a);return this}a=math.sqrt((k-g)*(k-g)+(d-h)*(d-h)+(e-c)*(e-c));.001>math.abs(a)&&(a=1);this.x=(k-g)/a;this.y=(d-h)/a;this.z=(e-c)/a;this.w=math.acos((b+f+l-1)/2);return this},min:function(a){this.x=math.min(this.x,a.x);this.y=math.min(this.y,a.y);this.z=math.min(this.z,a.z);this.w= math.min(this.w,a.w);return this},max:function(a){this.x=math.max(this.x,a.x);this.y=math.max(this.y,a.y);this.z=math.max(this.z,a.z);this.w=math.max(this.w,a.w);return this},clamp:function(a,b){this.x=math.max(a.x,math.min(b.x,this.x));this.y=math.max(a.y,math.min(b.y,this.y));this.z=math.max(a.z,math.min(b.z,this.z));this.w=math.max(a.w,math.min(b.w,this.w));return this},clampscalar:function(){var a,b;return function(c,d){void 0===a&&(a=new s,b=new s);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a, b)}}(),clamplength:function(a,b){var c=this.length();return this.dividescalar(c||1).multiplyscalar(math.max(a,math.min(b,c)))},floor:function(){this.x=math.floor(this.x);this.y=math.floor(this.y);this.z=math.floor(this.z);this.w=math.floor(this.w);return this},ceil:function(){this.x=math.ceil(this.x);this.y=math.ceil(this.y);this.z=math.ceil(this.z);this.w=math.ceil(this.w);return this},round:function(){this.x=math.round(this.x);this.y=math.round(this.y);this.z=math.round(this.z);this.w=math.round(this.w); return this},roundtozero:function(){this.x=0>this.x?math.ceil(this.x):math.floor(this.x);this.y=0>this.y?math.ceil(this.y):math.floor(this.y);this.z=0>this.z?math.ceil(this.z):math.floor(this.z);this.w=0>this.w?math.ceil(this.w):math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthsq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}, length:function(){return math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthmanhattan:function(){return math.abs(this.x)+math.abs(this.y)+math.abs(this.z)+math.abs(this.w)},normalize:function(){return this.dividescalar(this.length()||1)},setlength:function(a){return this.normalize().multiplyscalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},lerpvectors:function(a,b,c){return this.subvectors(b, a).multiplyscalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromarray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toarray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},frombufferattribute:function(a,b,c){void 0!==c&&console.warn("three.vector4: offset has been removed from .frombufferattribute().");this.x=a.getx(b);this.y=a.gety(b); this.z=a.getz(b);this.w=a.getw(b);return this}});object.assign(ab.prototype,na.prototype,{iswebglrendertarget:!0,setsize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.viewport.copy(a.viewport);this.texture=a.texture.clone();this.depthbuffer=a.depthbuffer;this.stencilbuffer=a.stencilbuffer; this.depthtexture=a.depthtexture;return this},dispose:function(){this.dispatchevent({type:"dispose"})}});bb.prototype=object.create(ab.prototype);bb.prototype.constructor=bb;bb.prototype.iswebglrendertargetcube=!0;object.assign(ia,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpflat:function(a,b,c,d,e,f,g){var h=c[d+0],k=c[d+1],l=c[d+2];c=c[d+3];d=e[f+0];var q=e[f+1],p=e[f+2];e=e[f+3];if(c!==e||h!==d||k!==q||l!==p){f=1-g;var m=h*d+k*q+l*p+c*e,r=0<=m?1:-1,n=1-m*m;n>number.epsilon&&(n=math.sqrt(n), m=math.atan2(n,m*r),f=math.sin(f*m)/n,g=math.sin(g*m)/n);r*=g;h=h*f+d*r;k=k*f+q*r;l=l*f+p*r;c=c*f+e*r;f===1-g&&(g=1/math.sqrt(h*h+k*k+l*l+c*c),h*=g,k*=g,l*=g,c*=g)}a[b]=h;a[b+1]=k;a[b+2]=l;a[b+3]=c}});object.defineproperties(ia.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onchangecallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onchangecallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this.onchangecallback()}},w:{get:function(){return this._w}, set:function(a){this._w=a;this.onchangecallback()}}});object.assign(ia.prototype,{set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onchangecallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;this._w=a.w;this.onchangecallback();return this},setfromeuler:function(a,b){if(!a||!a.iseuler)throw error("three.quaternion: .setfromeuler() now expects an euler rotation rather than a vector3 and order."); var c=a._x,d=a._y,e=a._z;a=a.order;var f=math.cos,g=math.sin,h=f(c/2),k=f(d/2),f=f(e/2),c=g(c/2),d=g(d/2),e=g(e/2);"xyz"===a?(this._x=c*k*f+h*d*e,this._y=h*d*f-c*k*e,this._z=h*k*e+c*d*f,this._w=h*k*f-c*d*e):"yxz"===a?(this._x=c*k*f+h*d*e,this._y=h*d*f-c*k*e,this._z=h*k*e-c*d*f,this._w=h*k*f+c*d*e):"zxy"===a?(this._x=c*k*f-h*d*e,this._y=h*d*f+c*k*e,this._z=h*k*e+c*d*f,this._w=h*k*f-c*d*e):"zyx"===a?(this._x=c*k*f-h*d*e,this._y=h*d*f+c*k*e,this._z=h*k*e-c*d*f,this._w=h*k*f+c*d*e):"yzx"===a?(this._x= c*k*f+h*d*e,this._y=h*d*f+c*k*e,this._z=h*k*e-c*d*f,this._w=h*k*f-c*d*e):"xzy"===a&&(this._x=c*k*f-h*d*e,this._y=h*d*f-c*k*e,this._z=h*k*e+c*d*f,this._w=h*k*f+c*d*e);if(!1!==b)this.onchangecallback();return this},setfromaxisangle:function(a,b){b/=2;var c=math.sin(b);this._x=a.x*c;this._y=a.y*c;this._z=a.z*c;this._w=math.cos(b);this.onchangecallback();return this},setfromrotationmatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],k=b[6],b=b[10],l=c+f+b;0f&&c>b?(c=2*math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+k)/c):(c=2*math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=.25*c);this.onchangecallback();return this},setfromunitvectors:function(){var a=new n,b;return function(c,d){void 0===a&&(a=new n);b=c.dot(d)+1;1e-6>b?(b=0, math.abs(c.x)>math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossvectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;return this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this.onchangecallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthsq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return math.sqrt(this._x* this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onchangecallback();return this},multiply:function(a,b){return void 0!==b?(console.warn("three.quaternion: .multiply() now only accepts one argument. use .multiplyquaternions( a, b ) instead."),this.multiplyquaternions(a,b)):this.multiplyquaternions(this,a)},premultiply:function(a){return this.multiplyquaternions(a, this)},multiplyquaternions:function(a,b){var c=a._x,d=a._y,e=a._z;a=a._w;var f=b._x,g=b._y,h=b._z;b=b._w;this._x=c*b+a*f+d*h-e*g;this._y=d*b+a*g+e*f-c*h;this._z=e*b+a*h+c*g-d*f;this._w=a*b-c*f-d*g-e*h;this.onchangecallback();return this},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y= d,this._z=e,this;a=math.sqrt(1-g*g);if(.001>math.abs(a))return this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;var h=math.atan2(a,g),g=math.sin((1-b)*h)/a;b=math.sin(b*h)/a;this._w=f*g+this._w*b;this._x=c*g+this._x*b;this._y=d*g+this._y*b;this._z=e*g+this._z*b;this.onchangecallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromarray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+ 1];this._z=a[b+2];this._w=a[b+3];this.onchangecallback();return this},toarray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onchange:function(a){this.onchangecallback=a;return this},onchangecallback:function(){}});object.assign(n.prototype,{isvector3:!0,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setscalar:function(a){this.z=this.y=this.x=a;return this},setx:function(a){this.x=a;return this},sety:function(a){this.y= a;return this},setz:function(a){this.z=a;return this},setcomponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw error("index is out of range: "+a);}return this},getcomponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this}, add:function(a,b){if(void 0!==b)return console.warn("three.vector3: .add() now only accepts one argument. use .addvectors( a, b ) instead."),this.addvectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addscalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addvectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addscaledvector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("three.vector3: .sub() now only accepts one argument. use .subvectors( a, b ) instead."), this.subvectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subscalar:function(a){this.x-=a;this.y-=a;this.z-=a;return this},subvectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("three.vector3: .multiply() now only accepts one argument. use .multiplyvectors( a, b ) instead."),this.multiplyvectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyscalar:function(a){this.x*=a;this.y*=a;this.z*= a;return this},multiplyvectors:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyeuler:function(){var a=new ia;return function(b){b&&b.iseuler||console.error("three.vector3: .applyeuler() now expects an euler rotation rather than a vector3 and order.");return this.applyquaternion(a.setfromeuler(b))}}(),applyaxisangle:function(){var a=new ia;return function(b,c){return this.applyquaternion(a.setfromaxisangle(b,c))}}(),applymatrix3:function(a){var b=this.x,c=this.y,d=this.z; a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applymatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyquaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,l=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b* -e+k*-g-l*-f;this.y=k*a+b*-f+l*-e-h*-g;this.z=l*a+b*-g+h*-f-k*-e;return this},project:function(){var a=new o;return function(b){a.multiplymatrices(b.projectionmatrix,a.getinverse(b.matrixworld));return this.applymatrix4(a)}}(),unproject:function(){var a=new o;return function(b){a.multiplymatrices(b.matrixworld,a.getinverse(b.projectionmatrix));return this.applymatrix4(a)}}(),transformdirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+ a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;return this.normalize()},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},dividescalar:function(a){return this.multiplyscalar(1/a)},min:function(a){this.x=math.min(this.x,a.x);this.y=math.min(this.y,a.y);this.z=math.min(this.z,a.z);return this},max:function(a){this.x=math.max(this.x,a.x);this.y=math.max(this.y,a.y);this.z=math.max(this.z,a.z);return this},clamp:function(a,b){this.x=math.max(a.x,math.min(b.x,this.x));this.y=math.max(a.y,math.min(b.y, this.y));this.z=math.max(a.z,math.min(b.z,this.z));return this},clampscalar:function(){var a=new n,b=new n;return function(c,d){a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),clamplength:function(a,b){var c=this.length();return this.dividescalar(c||1).multiplyscalar(math.max(a,math.min(b,c)))},floor:function(){this.x=math.floor(this.x);this.y=math.floor(this.y);this.z=math.floor(this.z);return this},ceil:function(){this.x=math.ceil(this.x);this.y=math.ceil(this.y);this.z=math.ceil(this.z);return this}, round:function(){this.x=math.round(this.x);this.y=math.round(this.y);this.z=math.round(this.z);return this},roundtozero:function(){this.x=0>this.x?math.ceil(this.x):math.floor(this.x);this.y=0>this.y?math.ceil(this.y):math.floor(this.y);this.z=0>this.z?math.ceil(this.z):math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthsq:function(){return this.x*this.x+this.y*this.y+this.z*this.z}, length:function(){return math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthmanhattan:function(){return math.abs(this.x)+math.abs(this.y)+math.abs(this.z)},normalize:function(){return this.dividescalar(this.length()||1)},setlength:function(a){return this.normalize().multiplyscalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},lerpvectors:function(a,b,c){return this.subvectors(b,a).multiplyscalar(c).add(a)},cross:function(a,b){if(void 0!== b)return console.warn("three.vector3: .cross() now only accepts one argument. use .crossvectors( a, b ) instead."),this.crossvectors(a,b);b=this.x;var c=this.y,d=this.z;this.x=c*a.z-d*a.y;this.y=d*a.x-b*a.z;this.z=b*a.y-c*a.x;return this},crossvectors:function(a,b){var c=a.x,d=a.y;a=a.z;var e=b.x,f=b.y;b=b.z;this.x=d*b-a*f;this.y=a*e-c*b;this.z=c*f-d*e;return this},projectonvector:function(a){var b=a.dot(this)/a.lengthsq();return this.copy(a).multiplyscalar(b)},projectonplane:function(){var a=new n; return function(b){a.copy(this).projectonvector(b);return this.sub(a)}}(),reflect:function(){var a=new n;return function(b){return this.sub(a.copy(b).multiplyscalar(2*this.dot(b)))}}(),angleto:function(a){a=this.dot(a)/math.sqrt(this.lengthsq()*a.lengthsq());return math.acos(r.clamp(a,-1,1))},distanceto:function(a){return math.sqrt(this.distancetosquared(a))},distancetosquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},distancetomanhattan:function(a){return math.abs(this.x- a.x)+math.abs(this.y-a.y)+math.abs(this.z-a.z)},setfromspherical:function(a){var b=math.sin(a.phi)*a.radius;this.x=b*math.sin(a.theta);this.y=math.cos(a.phi)*a.radius;this.z=b*math.cos(a.theta);return this},setfromcylindrical:function(a){this.x=a.radius*math.sin(a.theta);this.y=a.y;this.z=a.radius*math.cos(a.theta);return this},setfrommatrixposition:function(a){a=a.elements;this.x=a[12];this.y=a[13];this.z=a[14];return this},setfrommatrixscale:function(a){var b=this.setfrommatrixcolumn(a,0).length(), c=this.setfrommatrixcolumn(a,1).length();a=this.setfrommatrixcolumn(a,2).length();this.x=b;this.y=c;this.z=a;return this},setfrommatrixcolumn:function(a,b){return this.fromarray(a.elements,4*b)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromarray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toarray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},frombufferattribute:function(a,b,c){void 0!== c&&console.warn("three.vector3: offset has been removed from .frombufferattribute().");this.x=a.getx(b);this.y=a.gety(b);this.z=a.getz(b);return this}});object.assign(o.prototype,{ismatrix4:!0,set:function(a,b,c,d,e,f,g,h,k,l,q,p,m,r,n,u){var t=this.elements;t[0]=a;t[4]=b;t[8]=c;t[12]=d;t[1]=e;t[5]=f;t[9]=g;t[13]=h;t[2]=k;t[6]=l;t[10]=q;t[14]=p;t[3]=m;t[7]=r;t[11]=n;t[15]=u;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new o).fromarray(this.elements)}, copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return this},copyposition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractbasis:function(a,b,c){a.setfrommatrixcolumn(this,0);b.setfrommatrixcolumn(this,1);c.setfrommatrixcolumn(this,2);return this},makebasis:function(a,b,c){this.set(a.x, b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractrotation:function(){var a=new n;return function(b){var c=this.elements,d=b.elements,e=1/a.setfrommatrixcolumn(b,0).length(),f=1/a.setfrommatrixcolumn(b,1).length();b=1/a.setfrommatrixcolumn(b,2).length();c[0]=d[0]*e;c[1]=d[1]*e;c[2]=d[2]*e;c[4]=d[4]*f;c[5]=d[5]*f;c[6]=d[6]*f;c[8]=d[8]*b;c[9]=d[9]*b;c[10]=d[10]*b;return this}}(),makerotationfromeuler:function(a){a&&a.iseuler||console.error("three.matrix4: .makerotationfromeuler() now expects a euler rotation rather than a vector3 and order."); var b=this.elements,c=a.x,d=a.y,e=a.z,f=math.cos(c),c=math.sin(c),g=math.cos(d),d=math.sin(d),h=math.cos(e),e=math.sin(e);if("xyz"===a.order){var k=f*h;var l=f*e;var q=c*h;a=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=l+q*d;b[5]=k-a*d;b[9]=-c*g;b[2]=a-k*d;b[6]=q+l*d;b[10]=f*g}else"yxz"===a.order?(k=g*h,l=g*e,q=d*h,a=d*e,b[0]=k+a*c,b[4]=q*c-l,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=l*c-q,b[6]=a+k*c,b[10]=f*g):"zxy"===a.order?(k=g*h,l=g*e,q=d*h,a=d*e,b[0]=k-a*c,b[4]=-f*e,b[8]=q+l*c,b[1]=l+q*c,b[5]=f*h,b[9]= a-k*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"zyx"===a.order?(k=f*h,l=f*e,q=c*h,a=c*e,b[0]=g*h,b[4]=q*d-l,b[8]=k*d+a,b[1]=g*e,b[5]=a*d+k,b[9]=l*d-q,b[2]=-d,b[6]=c*g,b[10]=f*g):"yzx"===a.order?(k=f*g,l=f*d,q=c*g,a=c*d,b[0]=g*h,b[4]=a-k*e,b[8]=q*e+l,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+q,b[10]=k-a*e):"xzy"===a.order&&(k=f*g,l=f*d,q=c*g,a=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=k*e+a,b[5]=f*h,b[9]=l*e-q,b[2]=q*e-l,b[6]=c*h,b[10]=a*e+k);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makerotationfromquaternion:function(a){var b= this.elements,c=a._x,d=a._y,e=a._z,f=a._w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*h,c=c*k,q=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(q+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+q);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookat:function(){var a=new n,b=new n,c=new n;return function(d,e,f){var g=this.elements;c.subvectors(d,e);0===c.lengthsq()&&(c.z=1);c.normalize();a.crossvectors(f,c);0===a.lengthsq()&&(1===math.abs(f.z)?c.x+=1e-4:c.z+=1e-4, c.normalize(),a.crossvectors(f,c));a.normalize();b.crossvectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("three.matrix4: .multiply() now only accepts one argument. use .multiplymatrices( a, b ) instead."),this.multiplymatrices(a,b)):this.multiplymatrices(this,a)},premultiply:function(a){return this.multiplymatrices(a,this)},multiplymatrices:function(a,b){var c=a.elements,d=b.elements; b=this.elements;a=c[0];var e=c[4],f=c[8],g=c[12],h=c[1],k=c[5],l=c[9],q=c[13],p=c[2],m=c[6],r=c[10],n=c[14],u=c[3],x=c[7],y=c[11],c=c[15],a=d[0],i=d[4],b=d[8],h=d[12],w=d[1],z=d[5],d=d[9],c=d[13],f=d[2],l=d[6],j=d[10],k=d[14],ga=d[3],m=d[7],t=d[11],d=d[15];b[0]=a*a+e*w+f*f+g*ga;b[4]=a*i+e*z+f*l+g*m;b[8]=a*b+e*d+f*j+g*t;b[12]=a*h+e*c+f*k+g*d;b[1]=h*a+k*w+l*f+q*ga;b[5]=h*i+k*z+l*l+q*m;b[9]=h*b+k*d+l*j+q*t;b[13]=h*h+k*c+l*k+q*d;b[2]=p*a+m*w+r*f+n*ga;b[6]=p*i+m*z+r*l+n*m;b[10]=p*b+m*d+r*j+n*t;b[14]=p* h+m*c+r*k+n*d;b[3]=u*a+x*w+y*f+c*ga;b[7]=u*i+x*z+y*l+c*m;b[11]=u*b+x*d+y*j+c*t;b[15]=u*h+x*c+y*k+c*d;return this},multiplyscalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},applytobufferattribute:function(){var a=new n;return function(b){for(var c=0,d=b.count;cthis.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.copy(this);c=1/g;var f=1/h,l=1/k;b.elements[0]*=c;b.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=l;b.elements[9]*=l;b.elements[10]*=l;d.setfromrotationmatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeperspective:function(a,b,c,d,e,f){void 0===f&&console.warn("three.matrix4: .makeperspective() has been redefined and has a new signature. please check the docs."); var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(c-d);g[9]=(c+d)/(c-d);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makeorthographic:function(a,b,c,d,e,f){var g=this.elements,h=1/(b-a),k=1/(c-d),l=1/(f-e);g[0]=2*h;g[4]=0;g[8]=0;g[12]=-((b+a)*h);g[1]=0;g[5]=2*k;g[9]=0;g[13]=-((c+d)*k);g[2]=0;g[6]=0;g[10]=-2*l;g[14]=-((f+e)*l);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},equals:function(a){var b=this.elements; a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0},fromarray:function(a,b){void 0===b&&(b=0);for(var c=0;16>c;c++)this.elements[c]=a[c+b];return this},toarray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a}});bb.prototype=object.create(n.prototype); bb.prototype.constructor=bb;bb.prototype.isdatatexture=!0;va.prototype=object.create(n.prototype);va.prototype.constructor=va;va.prototype.iscubetexture=!0;object.defineproperty(va.prototype,"images",{get:function(){return this.image},set:function(a){this.image=a}});var de=new n,ee=new va,ye=[],ae=[],ce=new float32array(16),be=new float32array(9);ie.prototype.setvalue=function(a,b){for(var c=this.seq,d=0,e=c.length;d!==e;++d){var f=c[d];f.setvalue(a,b[f.id])}};var pd=/([\w\d_]+)(\])?(\[|\.)?/g;cb.prototype.setvalue= function(a,b,c){b=this.map[b];void 0!==b&&b.setvalue(a,c,this.renderer)};cb.prototype.setoptional=function(a,b,c){b=b[c];void 0!==b&&this.setvalue(a,c,b)};cb.upload=function(a,b,c,d){for(var e=0,f=b.length;e!==f;++e){var g=b[e],h=c[g.id];!1!==h.needsupdate&&g.setvalue(a,h.value,d)}};cb.seqwithvalue=function(a,b){for(var c=[],d=0,e=a.length;d!==e;++d){var f=a[d];f.id in b&&c.push(f)}return c};var rg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260, bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919, darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410, lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667, mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035, plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285, yellow:16776960,yellowgreen:10145074};object.assign(c.prototype,{iscolor:!0,r:1,g:1,b:1,set:function(a){a&&a.iscolor?this.copy(a):"number"===typeof a?this.sethex(a):"string"===typeof a&&this.setstyle(a);return this},setscalar:function(a){this.b=this.g=this.r=a;return this},sethex:function(a){a=math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setrgb:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},sethsl:function(){function a(a,c,d){0>d&&(d+=1);1d?c:d<2/3?a+6*(c-a)*(2/3-d):a}return function(b,c,d){b=r.euclideanmodulo(b,1);c=r.clamp(c,0,1);d=r.clamp(d,0,1);0===c?this.r=this.g=this.b=d:(c=.5>=d?d*(1+c):d+c-d*c,d=2*d-c,this.r=a(d,c,b+1/3),this.g=a(d,c,b),this.b=a(d,c,b-1/3));return this}}(),setstyle:function(a){function b(b){void 0!==b&&1>parsefloat(b)&&console.warn("three.color: alpha component of "+a+" will be ignored.")}var c;if(c=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)){var d=c[2];switch(c[1]){case "rgb":case "rgba":if(c= /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=math.min(255,parseint(c[1],10))/255,this.g=math.min(255,parseint(c[2],10))/255,this.b=math.min(255,parseint(c[3],10))/255,b(c[5]),this;if(c=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=math.min(100,parseint(c[1],10))/100,this.g=math.min(100,parseint(c[2],10))/100,this.b=math.min(100,parseint(c[3],10))/100,b(c[5]),this;break;case "hsl":case "hsla":if(c=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)){var d= parsefloat(c[1])/360,e=parseint(c[2],10)/100,f=parseint(c[3],10)/100;b(c[5]);return this.sethsl(d,e,f)}}}else if(c=/^\#([a-fa-f0-9]+)$/.exec(a)){c=c[1];d=c.length;if(3===d)return this.r=parseint(c.charat(0)+c.charat(0),16)/255,this.g=parseint(c.charat(1)+c.charat(1),16)/255,this.b=parseint(c.charat(2)+c.charat(2),16)/255,this;if(6===d)return this.r=parseint(c.charat(0)+c.charat(1),16)/255,this.g=parseint(c.charat(2)+c.charat(3),16)/255,this.b=parseint(c.charat(4)+c.charat(5),16)/255,this}a&&0=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(c 0.0 ) {\n#if defined ( physically_correct_lights )\n\t\tfloat distancefalloff = 1.0 / max( pow( lightdistance, decayexponent ), 0.01 );\n\t\tfloat maxdistancecutofffactor = pow2( saturate( 1.0 - pow4( lightdistance / cutoffdistance ) ) );\n\t\treturn distancefalloff * maxdistancecutofffactor;\n#else\n\t\treturn pow( saturate( -lightdistance / cutoffdistance + 1.0 ), decayexponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 brdf_diffuse_lambert( const in vec3 diffusecolor ) {\n\treturn reciprocal_pi * diffusecolor;\n}\nvec3 f_schlick( const in vec3 specularcolor, const in float dotlh ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotlh - 6.98316 ) * dotlh );\n\treturn ( 1.0 - specularcolor ) * fresnel + specularcolor;\n}\nfloat g_ggx_smith( const in float alpha, const in float dotnl, const in float dotnv ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotnl + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotnl ) );\n\tfloat gv = dotnv + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotnv ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat g_ggx_smithcorrelated( const in float alpha, const in float dotnl, const in float dotnv ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotnl * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotnv ) );\n\tfloat gl = dotnv * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotnl ) );\n\treturn 0.5 / max( gv + gl, epsilon );\n}\nfloat d_ggx( const in float alpha, const in float dotnh ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotnh ) * ( a2 - 1.0 ) + 1.0;\n\treturn reciprocal_pi * a2 / pow2( denom );\n}\nvec3 brdf_specular_ggx( const in incidentlight incidentlight, const in geometriccontext geometry, const in vec3 specularcolor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfdir = normalize( incidentlight.direction + geometry.viewdir );\n\tfloat dotnl = saturate( dot( geometry.normal, incidentlight.direction ) );\n\tfloat dotnv = saturate( dot( geometry.normal, geometry.viewdir ) );\n\tfloat dotnh = saturate( dot( geometry.normal, halfdir ) );\n\tfloat dotlh = saturate( dot( incidentlight.direction, halfdir ) );\n\tvec3 f = f_schlick( specularcolor, dotlh );\n\tfloat g = g_ggx_smithcorrelated( alpha, dotnl, dotnv );\n\tfloat d = d_ggx( alpha, dotnh );\n\treturn f * ( g * d );\n}\nvec2 ltc_uv( const in vec3 n, const in vec3 v, const in float roughness ) {\n\tconst float lut_size = 64.0;\n\tconst float lut_scale = ( lut_size - 1.0 ) / lut_size;\n\tconst float lut_bias = 0.5 / lut_size;\n\tfloat theta = acos( dot( n, v ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * pi ) ) );\n\tuv = uv * lut_scale + lut_bias;\n\treturn uv;\n}\nfloat ltc_clippedsphereformfactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 ltc_edgevectorformfactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 ltc_evaluate( const in vec3 n, const in vec3 v, const in vec3 p, const in mat3 minv, const in vec3 rectcoords[ 4 ] ) {\n\tvec3 v1 = rectcoords[ 1 ] - rectcoords[ 0 ];\n\tvec3 v2 = rectcoords[ 3 ] - rectcoords[ 0 ];\n\tvec3 lightnormal = cross( v1, v2 );\n\tif( dot( lightnormal, p - rectcoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 t1, t2;\n\tt1 = normalize( v - n * dot( v, n ) );\n\tt2 = - cross( n, t1 );\n\tmat3 mat = minv * transpose( mat3( t1, t2, n ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectcoords[ 0 ] - p );\n\tcoords[ 1 ] = mat * ( rectcoords[ 1 ] - p );\n\tcoords[ 2 ] = mat * ( rectcoords[ 2 ] - p );\n\tcoords[ 3 ] = mat * ( rectcoords[ 3 ] - p );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorformfactor = vec3( 0.0 );\n\tvectorformfactor += ltc_edgevectorformfactor( coords[ 0 ], coords[ 1 ] );\n\tvectorformfactor += ltc_edgevectorformfactor( coords[ 1 ], coords[ 2 ] );\n\tvectorformfactor += ltc_edgevectorformfactor( coords[ 2 ], coords[ 3 ] );\n\tvectorformfactor += ltc_edgevectorformfactor( coords[ 3 ], coords[ 0 ] );\n\tvec3 result = vec3( ltc_clippedsphereformfactor( vectorformfactor ) );\n\treturn result;\n}\nvec3 brdf_specular_ggx_environment( const in geometriccontext geometry, const in vec3 specularcolor, const in float roughness ) {\n\tfloat dotnv = saturate( dot( geometry.normal, geometry.viewdir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotnv ) ) * r.x + r.y;\n\tvec2 ab = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularcolor * ab.x + ab.y;\n}\nfloat g_blinnphong_implicit( ) {\n\treturn 0.25;\n}\nfloat d_blinnphong( const in float shininess, const in float dotnh ) {\n\treturn reciprocal_pi * ( shininess * 0.5 + 1.0 ) * pow( dotnh, shininess );\n}\nvec3 brdf_specular_blinnphong( const in incidentlight incidentlight, const in geometriccontext geometry, const in vec3 specularcolor, const in float shininess ) {\n\tvec3 halfdir = normalize( incidentlight.direction + geometry.viewdir );\n\tfloat dotnh = saturate( dot( geometry.normal, halfdir ) );\n\tfloat dotlh = saturate( dot( incidentlight.direction, halfdir ) );\n\tvec3 f = f_schlick( specularcolor, dotlh );\n\tfloat g = g_blinnphong_implicit( );\n\tfloat d = d_blinnphong( shininess, dotnh );\n\treturn f * ( g * d );\n}\nfloat ggxroughnesstoblinnexponent( const in float ggxroughness ) {\n\treturn ( 2.0 / pow2( ggxroughness + 0.0001 ) - 2.0 );\n}\nfloat blinnexponenttoggxroughness( const in float blinnexponent ) {\n\treturn sqrt( 2.0 / ( blinnexponent + 2.0 ) );\n}\n", bumpmap_pars_fragment:"#ifdef use_bumpmap\n\tuniform sampler2d bumpmap;\n\tuniform float bumpscale;\n\tvec2 dhdxy_fwd() {\n\t\tvec2 dstdx = dfdx( vuv );\n\t\tvec2 dstdy = dfdy( vuv );\n\t\tfloat hll = bumpscale * texture2d( bumpmap, vuv ).x;\n\t\tfloat dbx = bumpscale * texture2d( bumpmap, vuv + dstdx ).x - hll;\n\t\tfloat dby = bumpscale * texture2d( bumpmap, vuv + dstdy ).x - hll;\n\t\treturn vec2( dbx, dby );\n\t}\n\tvec3 perturbnormalarb( vec3 surf_pos, vec3 surf_norm, vec2 dhdxy ) {\n\t\tvec3 vsigmax = vec3( dfdx( surf_pos.x ), dfdx( surf_pos.y ), dfdx( surf_pos.z ) );\n\t\tvec3 vsigmay = vec3( dfdy( surf_pos.x ), dfdy( surf_pos.y ), dfdy( surf_pos.z ) );\n\t\tvec3 vn = surf_norm;\n\t\tvec3 r1 = cross( vsigmay, vn );\n\t\tvec3 r2 = cross( vn, vsigmax );\n\t\tfloat fdet = dot( vsigmax, r1 );\n\t\tvec3 vgrad = sign( fdet ) * ( dhdxy.x * r1 + dhdxy.y * r2 );\n\t\treturn normalize( abs( fdet ) * surf_norm - vgrad );\n\t}\n#endif\n", clipping_planes_fragment:"#if num_clipping_planes > 0\n\tfor ( int i = 0; i < union_clipping_planes; ++ i ) {\n\t\tvec4 plane = clippingplanes[ i ];\n\t\tif ( dot( vviewposition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if union_clipping_planes < num_clipping_planes\n\t\tbool clipped = true;\n\t\tfor ( int i = union_clipping_planes; i < num_clipping_planes; ++ i ) {\n\t\t\tvec4 plane = clippingplanes[ i ];\n\t\t\tclipped = ( dot( vviewposition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n", clipping_planes_pars_fragment:"#if num_clipping_planes > 0\n\t#if ! defined( physical ) && ! defined( phong )\n\t\tvarying vec3 vviewposition;\n\t#endif\n\tuniform vec4 clippingplanes[ num_clipping_planes ];\n#endif\n",clipping_planes_pars_vertex:"#if num_clipping_planes > 0 && ! defined( physical ) && ! defined( phong )\n\tvarying vec3 vviewposition;\n#endif\n",clipping_planes_vertex:"#if num_clipping_planes > 0 && ! defined( physical ) && ! defined( phong )\n\tvviewposition = - mvposition.xyz;\n#endif\n", color_fragment:"#ifdef use_color\n\tdiffusecolor.rgb *= vcolor;\n#endif",color_pars_fragment:"#ifdef use_color\n\tvarying vec3 vcolor;\n#endif\n",color_pars_vertex:"#ifdef use_color\n\tvarying vec3 vcolor;\n#endif",color_vertex:"#ifdef use_color\n\tvcolor.xyz = color.xyz;\n#endif",common:"#define pi 3.14159265359\n#define pi2 6.28318530718\n#define pi_half 1.5707963267949\n#define reciprocal_pi 0.31830988618\n#define reciprocal_pi2 0.15915494\n#define log2 1.442695\n#define epsilon 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whitecompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, pi );\n\treturn fract(sin(sn) * c);\n}\nstruct incidentlight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct reflectedlight {\n\tvec3 directdiffuse;\n\tvec3 directspecular;\n\tvec3 indirectdiffuse;\n\tvec3 indirectspecular;\n};\nstruct geometriccontext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewdir;\n};\nvec3 transformdirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inversetransformdirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectonplane(in vec3 point, in vec3 pointonplane, in vec3 planenormal ) {\n\tfloat distance = dot( planenormal, point - pointonplane );\n\treturn - distance * planenormal + point;\n}\nfloat sideofplane( in vec3 point, in vec3 pointonplane, in vec3 planenormal ) {\n\treturn sign( dot( point - pointonplane, planenormal ) );\n}\nvec3 lineplaneintersect( in vec3 pointonline, in vec3 linedirection, in vec3 pointonplane, in vec3 planenormal ) {\n\treturn linedirection * ( dot( planenormal, pointonplane - pointonline ) / dot( planenormal, linedirection ) ) + pointonline;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n", cube_uv_reflection_fragment:"#ifdef envmap_type_cube_uv\n#define cubeuv_texturesize (1024.0)\nint getfacefromdirection(vec3 direction) {\n\tvec3 absdirection = abs(direction);\n\tint face = -1;\n\tif( absdirection.x > absdirection.z ) {\n\t\tif(absdirection.x > absdirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absdirection.z > absdirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeuv_maxlods1 (log2(cubeuv_texturesize*0.25) - 1.0)\n#define cubeuv_rangeclamp (exp2((6.0 - 1.0) * 2.0))\nvec2 miplevelinfo( vec3 vec, float roughnesslevel, float roughness ) {\n\tfloat scale = exp2(cubeuv_maxlods1 - roughnesslevel);\n\tfloat dxroughness = dfdx(roughness);\n\tfloat dyroughness = dfdy(roughness);\n\tvec3 dx = dfdx( vec * scale * dxroughness );\n\tvec3 dy = dfdy( vec * scale * dyroughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeuv_rangeclamp);\n\tfloat miplevel = 0.5 * log2(d);\n\treturn vec2(floor(miplevel), fract(miplevel));\n}\n#define cubeuv_maxlods2 (log2(cubeuv_texturesize*0.25) - 2.0)\n#define cubeuv_rcptexturesize (1.0 / cubeuv_texturesize)\nvec2 getcubeuv(vec3 direction, float roughnesslevel, float miplevel) {\n\tmiplevel = roughnesslevel > cubeuv_maxlods2 - 3.0 ? 0.0 : miplevel;\n\tfloat a = 16.0 * cubeuv_rcptexturesize;\n\tvec2 exp2_packed = exp2( vec2( roughnesslevel, miplevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powscale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipoffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bres = miplevel == 0.0;\n\tscale = bres && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getfacefromdirection(direction);\n\tfloat rcppowscale = 1.0 / powscale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipoffset,0.75 * rcppowscale);\n\t\toffset.y = bres && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipoffset, 0.75 * rcppowscale);\n\t\toffset.y = bres && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipoffset, 0.75 * rcppowscale);\n\t\toffset.y = bres && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipoffset,0.5 * rcppowscale);\n\t\toffset.y = bres && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipoffset, 0.5 * rcppowscale);\n\t\toffset.y = bres && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipoffset, 0.5 * rcppowscale);\n\t\toffset.y = bres && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texeloffset = 0.5 * cubeuv_rcptexturesize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texeloffset );\n\treturn base + s * ( scale - 2.0 * texeloffset );\n}\n#define cubeuv_maxlods3 (log2(cubeuv_texturesize*0.25) - 3.0)\nvec4 texturecubeuv(vec3 reflecteddirection, float roughness ) {\n\tfloat roughnessval = roughness* cubeuv_maxlods3;\n\tfloat r1 = floor(roughnessval);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessval);\n\tvec2 mipinfo = miplevelinfo(reflecteddirection, r1, roughness);\n\tfloat s = mipinfo.y;\n\tfloat level0 = mipinfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getcubeuv(reflecteddirection, r1, level0);\n\tvec4 color10 = envmaptexeltolinear(texture2d(envmap, uv_10));\n\tvec2 uv_20 = getcubeuv(reflecteddirection, r2, level0);\n\tvec4 color20 = envmaptexeltolinear(texture2d(envmap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n", defaultnormal_vertex:"vec3 transformednormal = normalmatrix * objectnormal;\n#ifdef flip_sided\n\ttransformednormal = - transformednormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef use_displacementmap\n\tuniform sampler2d displacementmap;\n\tuniform float displacementscale;\n\tuniform float displacementbias;\n#endif\n",displacementmap_vertex:"#ifdef use_displacementmap\n\ttransformed += normalize( objectnormal ) * ( texture2d( displacementmap, uv ).x * displacementscale + displacementbias );\n#endif\n", emissivemap_fragment:"#ifdef use_emissivemap\n\tvec4 emissivecolor = texture2d( emissivemap, vuv );\n\temissivecolor.rgb = emissivemaptexeltolinear( emissivecolor ).rgb;\n\ttotalemissiveradiance *= emissivecolor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef use_emissivemap\n\tuniform sampler2d emissivemap;\n#endif\n",encodings_fragment:" gl_fragcolor = lineartooutputtexel( gl_fragcolor );\n",encodings_pars_fragment:"\nvec4 lineartolinear( in vec4 value ) {\n\treturn value;\n}\nvec4 gammatolinear( in vec4 value, in float gammafactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammafactor ) ), value.w );\n}\nvec4 lineartogamma( in vec4 value, in float gammafactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammafactor ) ), value.w );\n}\nvec4 srgbtolinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessthanequal( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 lineartosrgb( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessthanequal( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 rgbetolinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 lineartorgbe( in vec4 value ) {\n\tfloat maxcomponent = max( max( value.r, value.g ), value.b );\n\tfloat fexp = clamp( ceil( log2( maxcomponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fexp ), ( fexp + 128.0 ) / 255.0 );\n}\nvec4 rgbmtolinear( in vec4 value, in float maxrange ) {\n\treturn vec4( value.xyz * value.w * maxrange, 1.0 );\n}\nvec4 lineartorgbm( in vec4 value, in float maxrange ) {\n\tfloat maxrgb = max( value.x, max( value.g, value.b ) );\n\tfloat m = clamp( maxrgb / maxrange, 0.0, 1.0 );\n\tm = ceil( m * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( m * maxrange ), m );\n}\nvec4 rgbdtolinear( in vec4 value, in float maxrange ) {\n\treturn vec4( value.rgb * ( ( maxrange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 lineartorgbd( in vec4 value, in float maxrange ) {\n\tfloat maxrgb = max( value.x, max( value.g, value.b ) );\n\tfloat d = max( maxrange / maxrgb, 1.0 );\n\td = min( floor( d ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( d * ( 255.0 / maxrange ) ), d );\n}\nconst mat3 clogluvm = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 lineartologluv( in vec4 value ) {\n\tvec3 xp_y_xyzp = value.rgb * clogluvm;\n\txp_y_xyzp = max(xp_y_xyzp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vresult;\n\tvresult.xy = xp_y_xyzp.xy / xp_y_xyzp.z;\n\tfloat le = 2.0 * log2(xp_y_xyzp.y) + 127.0;\n\tvresult.w = fract(le);\n\tvresult.z = (le - (floor(vresult.w*255.0))/255.0)/255.0;\n\treturn vresult;\n}\nconst mat3 clogluvinversem = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 logluvtolinear( in vec4 value ) {\n\tfloat le = value.z * 255.0 + value.w;\n\tvec3 xp_y_xyzp;\n\txp_y_xyzp.y = exp2((le - 127.0) / 2.0);\n\txp_y_xyzp.z = xp_y_xyzp.y / value.y;\n\txp_y_xyzp.x = value.x * xp_y_xyzp.z;\n\tvec3 vrgb = xp_y_xyzp.rgb * clogluvinversem;\n\treturn vec4( max(vrgb, 0.0), 1.0 );\n}\n", envmap_fragment:"#ifdef use_envmap\n\t#if defined( use_bumpmap ) || defined( use_normalmap ) || defined( phong )\n\t\tvec3 cameratovertex = normalize( vworldposition - cameraposition );\n\t\tvec3 worldnormal = inversetransformdirection( normal, viewmatrix );\n\t\t#ifdef envmap_mode_reflection\n\t\t\tvec3 reflectvec = reflect( cameratovertex, worldnormal );\n\t\t#else\n\t\t\tvec3 reflectvec = refract( cameratovertex, worldnormal, refractionratio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectvec = vreflect;\n\t#endif\n\t#ifdef envmap_type_cube\n\t\tvec4 envcolor = texturecube( envmap, vec3( flipenvmap * reflectvec.x, reflectvec.yz ) );\n\t#elif defined( envmap_type_equirec )\n\t\tvec2 sampleuv;\n\t\treflectvec = normalize( reflectvec );\n\t\tsampleuv.y = asin( clamp( reflectvec.y, - 1.0, 1.0 ) ) * reciprocal_pi + 0.5;\n\t\tsampleuv.x = atan( reflectvec.z, reflectvec.x ) * reciprocal_pi2 + 0.5;\n\t\tvec4 envcolor = texture2d( envmap, sampleuv );\n\t#elif defined( envmap_type_sphere )\n\t\treflectvec = normalize( reflectvec );\n\t\tvec3 reflectview = normalize( ( viewmatrix * vec4( reflectvec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envcolor = texture2d( envmap, reflectview.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envcolor = vec4( 0.0 );\n\t#endif\n\tenvcolor = envmaptexeltolinear( envcolor );\n\t#ifdef envmap_blending_multiply\n\t\toutgoinglight = mix( outgoinglight, outgoinglight * envcolor.xyz, specularstrength * reflectivity );\n\t#elif defined( envmap_blending_mix )\n\t\toutgoinglight = mix( outgoinglight, envcolor.xyz, specularstrength * reflectivity );\n\t#elif defined( envmap_blending_add )\n\t\toutgoinglight += envcolor.xyz * specularstrength * reflectivity;\n\t#endif\n#endif\n", envmap_pars_fragment:"#if defined( use_envmap ) || defined( physical )\n\tuniform float reflectivity;\n\tuniform float envmapintensity;\n#endif\n#ifdef use_envmap\n\t#if ! defined( physical ) && ( defined( use_bumpmap ) || defined( use_normalmap ) || defined( phong ) )\n\t\tvarying vec3 vworldposition;\n\t#endif\n\t#ifdef envmap_type_cube\n\t\tuniform samplercube envmap;\n\t#else\n\t\tuniform sampler2d envmap;\n\t#endif\n\tuniform float flipenvmap;\n\t#if defined( use_bumpmap ) || defined( use_normalmap ) || defined( phong ) || defined( physical )\n\t\tuniform float refractionratio;\n\t#else\n\t\tvarying vec3 vreflect;\n\t#endif\n#endif\n", envmap_pars_vertex:"#ifdef use_envmap\n\t#if defined( use_bumpmap ) || defined( use_normalmap ) || defined( phong )\n\t\tvarying vec3 vworldposition;\n\t#else\n\t\tvarying vec3 vreflect;\n\t\tuniform float refractionratio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef use_envmap\n\t#if defined( use_bumpmap ) || defined( use_normalmap ) || defined( phong )\n\t\tvworldposition = worldposition.xyz;\n\t#else\n\t\tvec3 cameratovertex = normalize( worldposition.xyz - cameraposition );\n\t\tvec3 worldnormal = inversetransformdirection( transformednormal, viewmatrix );\n\t\t#ifdef envmap_mode_reflection\n\t\t\tvreflect = reflect( cameratovertex, worldnormal );\n\t\t#else\n\t\t\tvreflect = refract( cameratovertex, worldnormal, refractionratio );\n\t\t#endif\n\t#endif\n#endif\n", fog_vertex:"\n#ifdef use_fog\nfogdepth = -mvposition.z;\n#endif",fog_pars_vertex:"#ifdef use_fog\n varying float fogdepth;\n#endif\n",fog_fragment:"#ifdef use_fog\n\t#ifdef fog_exp2\n\t\tfloat fogfactor = whitecompliment( exp2( - fogdensity * fogdensity * fogdepth * fogdepth * log2 ) );\n\t#else\n\t\tfloat fogfactor = smoothstep( fognear, fogfar, fogdepth );\n\t#endif\n\tgl_fragcolor.rgb = mix( gl_fragcolor.rgb, fogcolor, fogfactor );\n#endif\n",fog_pars_fragment:"#ifdef use_fog\n\tuniform vec3 fogcolor;\n\tvarying float fogdepth;\n\t#ifdef fog_exp2\n\t\tuniform float fogdensity;\n\t#else\n\t\tuniform float fognear;\n\t\tuniform float fogfar;\n\t#endif\n#endif\n", gradientmap_pars_fragment:"#ifdef toon\n\tuniform sampler2d gradientmap;\n\tvec3 getgradientirradiance( vec3 normal, vec3 lightdirection ) {\n\t\tfloat dotnl = dot( normal, lightdirection );\n\t\tvec2 coord = vec2( dotnl * 0.5 + 0.5, 0.0 );\n\t\t#ifdef use_gradientmap\n\t\t\treturn texture2d( gradientmap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef use_lightmap\n\treflectedlight.indirectdiffuse += pi * texture2d( lightmap, vuv2 ).xyz * lightmapintensity;\n#endif\n", lightmap_pars_fragment:"#ifdef use_lightmap\n\tuniform sampler2d lightmap;\n\tuniform float lightmapintensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\ngeometriccontext geometry;\ngeometry.position = mvposition.xyz;\ngeometry.normal = normalize( transformednormal );\ngeometry.viewdir = normalize( -mvposition.xyz );\ngeometriccontext backgeometry;\nbackgeometry.position = geometry.position;\nbackgeometry.normal = -geometry.normal;\nbackgeometry.viewdir = geometry.viewdir;\nvlightfront = vec3( 0.0 );\n#ifdef double_sided\n\tvlightback = vec3( 0.0 );\n#endif\nincidentlight directlight;\nfloat dotnl;\nvec3 directlightcolor_diffuse;\n#if num_point_lights > 0\n\tfor ( int i = 0; i < num_point_lights; i ++ ) {\n\t\tgetpointdirectlightirradiance( pointlights[ i ], geometry, directlight );\n\t\tdotnl = dot( geometry.normal, directlight.direction );\n\t\tdirectlightcolor_diffuse = pi * directlight.color;\n\t\tvlightfront += saturate( dotnl ) * directlightcolor_diffuse;\n\t\t#ifdef double_sided\n\t\t\tvlightback += saturate( -dotnl ) * directlightcolor_diffuse;\n\t\t#endif\n\t}\n#endif\n#if num_spot_lights > 0\n\tfor ( int i = 0; i < num_spot_lights; i ++ ) {\n\t\tgetspotdirectlightirradiance( spotlights[ i ], geometry, directlight );\n\t\tdotnl = dot( geometry.normal, directlight.direction );\n\t\tdirectlightcolor_diffuse = pi * directlight.color;\n\t\tvlightfront += saturate( dotnl ) * directlightcolor_diffuse;\n\t\t#ifdef double_sided\n\t\t\tvlightback += saturate( -dotnl ) * directlightcolor_diffuse;\n\t\t#endif\n\t}\n#endif\n#if num_dir_lights > 0\n\tfor ( int i = 0; i < num_dir_lights; i ++ ) {\n\t\tgetdirectionaldirectlightirradiance( directionallights[ i ], geometry, directlight );\n\t\tdotnl = dot( geometry.normal, directlight.direction );\n\t\tdirectlightcolor_diffuse = pi * directlight.color;\n\t\tvlightfront += saturate( dotnl ) * directlightcolor_diffuse;\n\t\t#ifdef double_sided\n\t\t\tvlightback += saturate( -dotnl ) * directlightcolor_diffuse;\n\t\t#endif\n\t}\n#endif\n#if num_hemi_lights > 0\n\tfor ( int i = 0; i < num_hemi_lights; i ++ ) {\n\t\tvlightfront += gethemispherelightirradiance( hemispherelights[ i ], geometry );\n\t\t#ifdef double_sided\n\t\t\tvlightback += gethemispherelightirradiance( hemispherelights[ i ], backgeometry );\n\t\t#endif\n\t}\n#endif\n", lights_pars:"uniform vec3 ambientlightcolor;\nvec3 getambientlightirradiance( const in vec3 ambientlightcolor ) {\n\tvec3 irradiance = ambientlightcolor;\n\t#ifndef physically_correct_lights\n\t\tirradiance *= pi;\n\t#endif\n\treturn irradiance;\n}\n#if num_dir_lights > 0\n\tstruct directionallight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowbias;\n\t\tfloat shadowradius;\n\t\tvec2 shadowmapsize;\n\t};\n\tuniform directionallight directionallights[ num_dir_lights ];\n\tvoid getdirectionaldirectlightirradiance( const in directionallight directionallight, const in geometriccontext geometry, out incidentlight directlight ) {\n\t\tdirectlight.color = directionallight.color;\n\t\tdirectlight.direction = directionallight.direction;\n\t\tdirectlight.visible = true;\n\t}\n#endif\n#if num_point_lights > 0\n\tstruct pointlight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowbias;\n\t\tfloat shadowradius;\n\t\tvec2 shadowmapsize;\n\t\tfloat shadowcameranear;\n\t\tfloat shadowcamerafar;\n\t};\n\tuniform pointlight pointlights[ num_point_lights ];\n\tvoid getpointdirectlightirradiance( const in pointlight pointlight, const in geometriccontext geometry, out incidentlight directlight ) {\n\t\tvec3 lvector = pointlight.position - geometry.position;\n\t\tdirectlight.direction = normalize( lvector );\n\t\tfloat lightdistance = length( lvector );\n\t\tdirectlight.color = pointlight.color;\n\t\tdirectlight.color *= punctuallightintensitytoirradiancefactor( lightdistance, pointlight.distance, pointlight.decay );\n\t\tdirectlight.visible = ( directlight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if num_spot_lights > 0\n\tstruct spotlight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat conecos;\n\t\tfloat penumbracos;\n\t\tint shadow;\n\t\tfloat shadowbias;\n\t\tfloat shadowradius;\n\t\tvec2 shadowmapsize;\n\t};\n\tuniform spotlight spotlights[ num_spot_lights ];\n\tvoid getspotdirectlightirradiance( const in spotlight spotlight, const in geometriccontext geometry, out incidentlight directlight ) {\n\t\tvec3 lvector = spotlight.position - geometry.position;\n\t\tdirectlight.direction = normalize( lvector );\n\t\tfloat lightdistance = length( lvector );\n\t\tfloat anglecos = dot( directlight.direction, spotlight.direction );\n\t\tif ( anglecos > spotlight.conecos ) {\n\t\t\tfloat spoteffect = smoothstep( spotlight.conecos, spotlight.penumbracos, anglecos );\n\t\t\tdirectlight.color = spotlight.color;\n\t\t\tdirectlight.color *= spoteffect * punctuallightintensitytoirradiancefactor( lightdistance, spotlight.distance, spotlight.decay );\n\t\t\tdirectlight.visible = true;\n\t\t} else {\n\t\t\tdirectlight.color = vec3( 0.0 );\n\t\t\tdirectlight.visible = false;\n\t\t}\n\t}\n#endif\n#if num_rect_area_lights > 0\n\tstruct rectarealight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfwidth;\n\t\tvec3 halfheight;\n\t};\n\tuniform sampler2d ltcmat;\tuniform sampler2d ltcmag;\n\tuniform rectarealight rectarealights[ num_rect_area_lights ];\n#endif\n#if num_hemi_lights > 0\n\tstruct hemispherelight {\n\t\tvec3 direction;\n\t\tvec3 skycolor;\n\t\tvec3 groundcolor;\n\t};\n\tuniform hemispherelight hemispherelights[ num_hemi_lights ];\n\tvec3 gethemispherelightirradiance( const in hemispherelight hemilight, const in geometriccontext geometry ) {\n\t\tfloat dotnl = dot( geometry.normal, hemilight.direction );\n\t\tfloat hemidiffuseweight = 0.5 * dotnl + 0.5;\n\t\tvec3 irradiance = mix( hemilight.groundcolor, hemilight.skycolor, hemidiffuseweight );\n\t\t#ifndef physically_correct_lights\n\t\t\tirradiance *= pi;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( use_envmap ) && defined( physical )\n\tvec3 getlightprobeindirectirradiance( const in geometriccontext geometry, const in int maxmiplevel ) {\n\t\tvec3 worldnormal = inversetransformdirection( geometry.normal, viewmatrix );\n\t\t#ifdef envmap_type_cube\n\t\t\tvec3 queryvec = vec3( flipenvmap * worldnormal.x, worldnormal.yz );\n\t\t\t#ifdef texture_lod_ext\n\t\t\t\tvec4 envmapcolor = texturecubelodext( envmap, queryvec, float( maxmiplevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envmapcolor = texturecube( envmap, queryvec, float( maxmiplevel ) );\n\t\t\t#endif\n\t\t\tenvmapcolor.rgb = envmaptexeltolinear( envmapcolor ).rgb;\n\t\t#elif defined( envmap_type_cube_uv )\n\t\t\tvec3 queryvec = vec3( flipenvmap * worldnormal.x, worldnormal.yz );\n\t\t\tvec4 envmapcolor = texturecubeuv( queryvec, 1.0 );\n\t\t#else\n\t\t\tvec4 envmapcolor = vec4( 0.0 );\n\t\t#endif\n\t\treturn pi * envmapcolor.rgb * envmapintensity;\n\t}\n\tfloat getspecularmiplevel( const in float blinnshininessexponent, const in int maxmiplevel ) {\n\t\tfloat maxmiplevelscalar = float( maxmiplevel );\n\t\tfloat desiredmiplevel = maxmiplevelscalar - 0.79248 - 0.5 * log2( pow2( blinnshininessexponent ) + 1.0 );\n\t\treturn clamp( desiredmiplevel, 0.0, maxmiplevelscalar );\n\t}\n\tvec3 getlightprobeindirectradiance( const in geometriccontext geometry, const in float blinnshininessexponent, const in int maxmiplevel ) {\n\t\t#ifdef envmap_mode_reflection\n\t\t\tvec3 reflectvec = reflect( -geometry.viewdir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectvec = refract( -geometry.viewdir, geometry.normal, refractionratio );\n\t\t#endif\n\t\treflectvec = inversetransformdirection( reflectvec, viewmatrix );\n\t\tfloat specularmiplevel = getspecularmiplevel( blinnshininessexponent, maxmiplevel );\n\t\t#ifdef envmap_type_cube\n\t\t\tvec3 queryreflectvec = vec3( flipenvmap * reflectvec.x, reflectvec.yz );\n\t\t\t#ifdef texture_lod_ext\n\t\t\t\tvec4 envmapcolor = texturecubelodext( envmap, queryreflectvec, specularmiplevel );\n\t\t\t#else\n\t\t\t\tvec4 envmapcolor = texturecube( envmap, queryreflectvec, specularmiplevel );\n\t\t\t#endif\n\t\t\tenvmapcolor.rgb = envmaptexeltolinear( envmapcolor ).rgb;\n\t\t#elif defined( envmap_type_cube_uv )\n\t\t\tvec3 queryreflectvec = vec3( flipenvmap * reflectvec.x, reflectvec.yz );\n\t\t\tvec4 envmapcolor = texturecubeuv(queryreflectvec, blinnexponenttoggxroughness(blinnshininessexponent));\n\t\t#elif defined( envmap_type_equirec )\n\t\t\tvec2 sampleuv;\n\t\t\tsampleuv.y = asin( clamp( reflectvec.y, - 1.0, 1.0 ) ) * reciprocal_pi + 0.5;\n\t\t\tsampleuv.x = atan( reflectvec.z, reflectvec.x ) * reciprocal_pi2 + 0.5;\n\t\t\t#ifdef texture_lod_ext\n\t\t\t\tvec4 envmapcolor = texture2dlodext( envmap, sampleuv, specularmiplevel );\n\t\t\t#else\n\t\t\t\tvec4 envmapcolor = texture2d( envmap, sampleuv, specularmiplevel );\n\t\t\t#endif\n\t\t\tenvmapcolor.rgb = envmaptexeltolinear( envmapcolor ).rgb;\n\t\t#elif defined( envmap_type_sphere )\n\t\t\tvec3 reflectview = normalize( ( viewmatrix * vec4( reflectvec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef texture_lod_ext\n\t\t\t\tvec4 envmapcolor = texture2dlodext( envmap, reflectview.xy * 0.5 + 0.5, specularmiplevel );\n\t\t\t#else\n\t\t\t\tvec4 envmapcolor = texture2d( envmap, reflectview.xy * 0.5 + 0.5, specularmiplevel );\n\t\t\t#endif\n\t\t\tenvmapcolor.rgb = envmaptexeltolinear( envmapcolor ).rgb;\n\t\t#endif\n\t\treturn envmapcolor.rgb * envmapintensity;\n\t}\n#endif\n", lights_phong_fragment:"blinnphongmaterial material;\nmaterial.diffusecolor = diffusecolor.rgb;\nmaterial.specularcolor = specular;\nmaterial.specularshininess = shininess;\nmaterial.specularstrength = specularstrength;\n",lights_phong_pars_fragment:"varying vec3 vviewposition;\n#ifndef flat_shaded\n\tvarying vec3 vnormal;\n#endif\nstruct blinnphongmaterial {\n\tvec3\tdiffusecolor;\n\tvec3\tspecularcolor;\n\tfloat\tspecularshininess;\n\tfloat\tspecularstrength;\n};\nvoid re_direct_blinnphong( const in incidentlight directlight, const in geometriccontext geometry, const in blinnphongmaterial material, inout reflectedlight reflectedlight ) {\n\t#ifdef toon\n\t\tvec3 irradiance = getgradientirradiance( geometry.normal, directlight.direction ) * directlight.color;\n\t#else\n\t\tfloat dotnl = saturate( dot( geometry.normal, directlight.direction ) );\n\t\tvec3 irradiance = dotnl * directlight.color;\n\t#endif\n\t#ifndef physically_correct_lights\n\t\tirradiance *= pi;\n\t#endif\n\treflectedlight.directdiffuse += irradiance * brdf_diffuse_lambert( material.diffusecolor );\n\treflectedlight.directspecular += irradiance * brdf_specular_blinnphong( directlight, geometry, material.specularcolor, material.specularshininess ) * material.specularstrength;\n}\nvoid re_indirectdiffuse_blinnphong( const in vec3 irradiance, const in geometriccontext geometry, const in blinnphongmaterial material, inout reflectedlight reflectedlight ) {\n\treflectedlight.indirectdiffuse += irradiance * brdf_diffuse_lambert( material.diffusecolor );\n}\n#define re_direct\t\t\t\tre_direct_blinnphong\n#define re_indirectdiffuse\t\tre_indirectdiffuse_blinnphong\n#define material_lightprobelod( material )\t(0)\n", lights_physical_fragment:"physicalmaterial material;\nmaterial.diffusecolor = diffusecolor.rgb * ( 1.0 - metalnessfactor );\nmaterial.specularroughness = clamp( roughnessfactor, 0.04, 1.0 );\n#ifdef standard\n\tmaterial.specularcolor = mix( vec3( default_specular_coefficient ), diffusecolor.rgb, metalnessfactor );\n#else\n\tmaterial.specularcolor = mix( vec3( maximum_specular_coefficient * pow2( reflectivity ) ), diffusecolor.rgb, metalnessfactor );\n\tmaterial.clearcoat = saturate( clearcoat );\tmaterial.clearcoatroughness = clamp( clearcoatroughness, 0.04, 1.0 );\n#endif\n", lights_physical_pars_fragment:"struct physicalmaterial {\n\tvec3\tdiffusecolor;\n\tfloat\tspecularroughness;\n\tvec3\tspecularcolor;\n\t#ifndef standard\n\t\tfloat clearcoat;\n\t\tfloat clearcoatroughness;\n\t#endif\n};\n#define maximum_specular_coefficient 0.16\n#define default_specular_coefficient 0.04\nfloat clearcoatdhrapprox( const in float roughness, const in float dotnl ) {\n\treturn default_specular_coefficient + ( 1.0 - default_specular_coefficient ) * ( pow( 1.0 - dotnl, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if num_rect_area_lights > 0\n\tvoid re_direct_rectarea_physical( const in rectarealight rectarealight, const in geometriccontext geometry, const in physicalmaterial material, inout reflectedlight reflectedlight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewdir = geometry.viewdir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightpos = rectarealight.position;\n\t\tvec3 halfwidth = rectarealight.halfwidth;\n\t\tvec3 halfheight = rectarealight.halfheight;\n\t\tvec3 lightcolor = rectarealight.color;\n\t\tfloat roughness = material.specularroughness;\n\t\tvec3 rectcoords[ 4 ];\n\t\trectcoords[ 0 ] = lightpos - halfwidth - halfheight;\t\trectcoords[ 1 ] = lightpos + halfwidth - halfheight;\n\t\trectcoords[ 2 ] = lightpos + halfwidth + halfheight;\n\t\trectcoords[ 3 ] = lightpos - halfwidth + halfheight;\n\t\tvec2 uv = ltc_uv( normal, viewdir, roughness );\n\t\tfloat norm = texture2d( ltcmag, uv ).a;\n\t\tvec4 t = texture2d( ltcmat, uv );\n\t\tmat3 minv = mat3(\n\t\t\tvec3( 1, 0, t.y ),\n\t\t\tvec3( 0, t.z, 0 ),\n\t\t\tvec3( t.w, 0, t.x )\n\t\t);\n\t\treflectedlight.directspecular += lightcolor * material.specularcolor * norm * ltc_evaluate( normal, viewdir, position, minv, rectcoords );\n\t\treflectedlight.directdiffuse += lightcolor * material.diffusecolor * ltc_evaluate( normal, viewdir, position, mat3( 1 ), rectcoords );\n\t}\n#endif\nvoid re_direct_physical( const in incidentlight directlight, const in geometriccontext geometry, const in physicalmaterial material, inout reflectedlight reflectedlight ) {\n\tfloat dotnl = saturate( dot( geometry.normal, directlight.direction ) );\n\tvec3 irradiance = dotnl * directlight.color;\n\t#ifndef physically_correct_lights\n\t\tirradiance *= pi;\n\t#endif\n\t#ifndef standard\n\t\tfloat clearcoatdhr = material.clearcoat * clearcoatdhrapprox( material.clearcoatroughness, dotnl );\n\t#else\n\t\tfloat clearcoatdhr = 0.0;\n\t#endif\n\treflectedlight.directspecular += ( 1.0 - clearcoatdhr ) * irradiance * brdf_specular_ggx( directlight, geometry, material.specularcolor, material.specularroughness );\n\treflectedlight.directdiffuse += ( 1.0 - clearcoatdhr ) * irradiance * brdf_diffuse_lambert( material.diffusecolor );\n\t#ifndef standard\n\t\treflectedlight.directspecular += irradiance * material.clearcoat * brdf_specular_ggx( directlight, geometry, vec3( default_specular_coefficient ), material.clearcoatroughness );\n\t#endif\n}\nvoid re_indirectdiffuse_physical( const in vec3 irradiance, const in geometriccontext geometry, const in physicalmaterial material, inout reflectedlight reflectedlight ) {\n\treflectedlight.indirectdiffuse += irradiance * brdf_diffuse_lambert( material.diffusecolor );\n}\nvoid re_indirectspecular_physical( const in vec3 radiance, const in vec3 clearcoatradiance, const in geometriccontext geometry, const in physicalmaterial material, inout reflectedlight reflectedlight ) {\n\t#ifndef standard\n\t\tfloat dotnv = saturate( dot( geometry.normal, geometry.viewdir ) );\n\t\tfloat dotnl = dotnv;\n\t\tfloat clearcoatdhr = material.clearcoat * clearcoatdhrapprox( material.clearcoatroughness, dotnl );\n\t#else\n\t\tfloat clearcoatdhr = 0.0;\n\t#endif\n\treflectedlight.indirectspecular += ( 1.0 - clearcoatdhr ) * radiance * brdf_specular_ggx_environment( geometry, material.specularcolor, material.specularroughness );\n\t#ifndef standard\n\t\treflectedlight.indirectspecular += clearcoatradiance * material.clearcoat * brdf_specular_ggx_environment( geometry, vec3( default_specular_coefficient ), material.clearcoatroughness );\n\t#endif\n}\n#define re_direct\t\t\t\tre_direct_physical\n#define re_direct_rectarea\t\tre_direct_rectarea_physical\n#define re_indirectdiffuse\t\tre_indirectdiffuse_physical\n#define re_indirectspecular\t\tre_indirectspecular_physical\n#define material_blinnshininessexponent( material ) ggxroughnesstoblinnexponent( material.specularroughness )\n#define material_clearcoat_blinnshininessexponent( material ) ggxroughnesstoblinnexponent( material.clearcoatroughness )\nfloat computespecularocclusion( const in float dotnv, const in float ambientocclusion, const in float roughness ) {\n\treturn saturate( pow( dotnv + ambientocclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientocclusion );\n}\n", lights_template:"\ngeometriccontext geometry;\ngeometry.position = - vviewposition;\ngeometry.normal = normal;\ngeometry.viewdir = normalize( vviewposition );\nincidentlight directlight;\n#if ( num_point_lights > 0 ) && defined( re_direct )\n\tpointlight pointlight;\n\tfor ( int i = 0; i < num_point_lights; i ++ ) {\n\t\tpointlight = pointlights[ i ];\n\t\tgetpointdirectlightirradiance( pointlight, geometry, directlight );\n\t\t#ifdef use_shadowmap\n\t\tdirectlight.color *= all( bvec2( pointlight.shadow, directlight.visible ) ) ? getpointshadow( pointshadowmap[ i ], pointlight.shadowmapsize, pointlight.shadowbias, pointlight.shadowradius, vpointshadowcoord[ i ], pointlight.shadowcameranear, pointlight.shadowcamerafar ) : 1.0;\n\t\t#endif\n\t\tre_direct( directlight, geometry, material, reflectedlight );\n\t}\n#endif\n#if ( num_spot_lights > 0 ) && defined( re_direct )\n\tspotlight spotlight;\n\tfor ( int i = 0; i < num_spot_lights; i ++ ) {\n\t\tspotlight = spotlights[ i ];\n\t\tgetspotdirectlightirradiance( spotlight, geometry, directlight );\n\t\t#ifdef use_shadowmap\n\t\tdirectlight.color *= all( bvec2( spotlight.shadow, directlight.visible ) ) ? getshadow( spotshadowmap[ i ], spotlight.shadowmapsize, spotlight.shadowbias, spotlight.shadowradius, vspotshadowcoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tre_direct( directlight, geometry, material, reflectedlight );\n\t}\n#endif\n#if ( num_dir_lights > 0 ) && defined( re_direct )\n\tdirectionallight directionallight;\n\tfor ( int i = 0; i < num_dir_lights; i ++ ) {\n\t\tdirectionallight = directionallights[ i ];\n\t\tgetdirectionaldirectlightirradiance( directionallight, geometry, directlight );\n\t\t#ifdef use_shadowmap\n\t\tdirectlight.color *= all( bvec2( directionallight.shadow, directlight.visible ) ) ? getshadow( directionalshadowmap[ i ], directionallight.shadowmapsize, directionallight.shadowbias, directionallight.shadowradius, vdirectionalshadowcoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tre_direct( directlight, geometry, material, reflectedlight );\n\t}\n#endif\n#if ( num_rect_area_lights > 0 ) && defined( re_direct_rectarea )\n\trectarealight rectarealight;\n\tfor ( int i = 0; i < num_rect_area_lights; i ++ ) {\n\t\trectarealight = rectarealights[ i ];\n\t\tre_direct_rectarea( rectarealight, geometry, material, reflectedlight );\n\t}\n#endif\n#if defined( re_indirectdiffuse )\n\tvec3 irradiance = getambientlightirradiance( ambientlightcolor );\n\t#ifdef use_lightmap\n\t\tvec3 lightmapirradiance = texture2d( lightmap, vuv2 ).xyz * lightmapintensity;\n\t\t#ifndef physically_correct_lights\n\t\t\tlightmapirradiance *= pi;\n\t\t#endif\n\t\tirradiance += lightmapirradiance;\n\t#endif\n\t#if ( num_hemi_lights > 0 )\n\t\tfor ( int i = 0; i < num_hemi_lights; i ++ ) {\n\t\t\tirradiance += gethemispherelightirradiance( hemispherelights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( use_envmap ) && defined( physical ) && defined( envmap_type_cube_uv )\n\t\tirradiance += getlightprobeindirectirradiance( geometry, 8 );\n\t#endif\n\tre_indirectdiffuse( irradiance, geometry, material, reflectedlight );\n#endif\n#if defined( use_envmap ) && defined( re_indirectspecular )\n\tvec3 radiance = getlightprobeindirectradiance( geometry, material_blinnshininessexponent( material ), 8 );\n\t#ifndef standard\n\t\tvec3 clearcoatradiance = getlightprobeindirectradiance( geometry, material_clearcoat_blinnshininessexponent( material ), 8 );\n\t#else\n\t\tvec3 clearcoatradiance = vec3( 0.0 );\n\t#endif\n\tre_indirectspecular( radiance, clearcoatradiance, geometry, material, reflectedlight );\n#endif\n", logdepthbuf_fragment:"#if defined(use_logdepthbuf) && defined(use_logdepthbuf_ext)\n\tgl_fragdepthext = log2(vfragdepth) * logdepthbuffc * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef use_logdepthbuf\n\tuniform float logdepthbuffc;\n\t#ifdef use_logdepthbuf_ext\n\t\tvarying float vfragdepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef use_logdepthbuf\n\t#ifdef use_logdepthbuf_ext\n\t\tvarying float vfragdepth;\n\t#endif\n\tuniform float logdepthbuffc;\n#endif",logdepthbuf_vertex:"#ifdef use_logdepthbuf\n\tgl_position.z = log2(max( epsilon, gl_position.w + 1.0 )) * logdepthbuffc;\n\t#ifdef use_logdepthbuf_ext\n\t\tvfragdepth = 1.0 + gl_position.w;\n\t#else\n\t\tgl_position.z = (gl_position.z - 1.0) * gl_position.w;\n\t#endif\n#endif\n", map_fragment:"#ifdef use_map\n\tvec4 texelcolor = texture2d( map, vuv );\n\ttexelcolor = maptexeltolinear( texelcolor );\n\tdiffusecolor *= texelcolor;\n#endif\n",map_pars_fragment:"#ifdef use_map\n\tuniform sampler2d map;\n#endif\n",map_particle_fragment:"#ifdef use_map\n\tvec4 maptexel = texture2d( map, vec2( gl_pointcoord.x, 1.0 - gl_pointcoord.y ) * offsetrepeat.zw + offsetrepeat.xy );\n\tdiffusecolor *= maptexeltolinear( maptexel );\n#endif\n",map_particle_pars_fragment:"#ifdef use_map\n\tuniform vec4 offsetrepeat;\n\tuniform sampler2d map;\n#endif\n", metalnessmap_fragment:"float metalnessfactor = metalness;\n#ifdef use_metalnessmap\n\tvec4 texelmetalness = texture2d( metalnessmap, vuv );\n\tmetalnessfactor *= texelmetalness.b;\n#endif\n",metalnessmap_pars_fragment:"#ifdef use_metalnessmap\n\tuniform sampler2d metalnessmap;\n#endif",morphnormal_vertex:"#ifdef use_morphnormals\n\tobjectnormal += ( morphnormal0 - normal ) * morphtargetinfluences[ 0 ];\n\tobjectnormal += ( morphnormal1 - normal ) * morphtargetinfluences[ 1 ];\n\tobjectnormal += ( morphnormal2 - normal ) * morphtargetinfluences[ 2 ];\n\tobjectnormal += ( morphnormal3 - normal ) * morphtargetinfluences[ 3 ];\n#endif\n", morphtarget_pars_vertex:"#ifdef use_morphtargets\n\t#ifndef use_morphnormals\n\tuniform float morphtargetinfluences[ 8 ];\n\t#else\n\tuniform float morphtargetinfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef use_morphtargets\n\ttransformed += ( morphtarget0 - position ) * morphtargetinfluences[ 0 ];\n\ttransformed += ( morphtarget1 - position ) * morphtargetinfluences[ 1 ];\n\ttransformed += ( morphtarget2 - position ) * morphtargetinfluences[ 2 ];\n\ttransformed += ( morphtarget3 - position ) * morphtargetinfluences[ 3 ];\n\t#ifndef use_morphnormals\n\ttransformed += ( morphtarget4 - position ) * morphtargetinfluences[ 4 ];\n\ttransformed += ( morphtarget5 - position ) * morphtargetinfluences[ 5 ];\n\ttransformed += ( morphtarget6 - position ) * morphtargetinfluences[ 6 ];\n\ttransformed += ( morphtarget7 - position ) * morphtargetinfluences[ 7 ];\n\t#endif\n#endif\n", normal_fragment:"#ifdef flat_shaded\n\tvec3 fdx = vec3( dfdx( vviewposition.x ), dfdx( vviewposition.y ), dfdx( vviewposition.z ) );\n\tvec3 fdy = vec3( dfdy( vviewposition.x ), dfdy( vviewposition.y ), dfdy( vviewposition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vnormal );\n\t#ifdef double_sided\n\t\tnormal = normal * ( float( gl_frontfacing ) * 2.0 - 1.0 );\n\t#endif\n#endif\n#ifdef use_normalmap\n\tnormal = perturbnormal2arb( -vviewposition, normal );\n#elif defined( use_bumpmap )\n\tnormal = perturbnormalarb( -vviewposition, normal, dhdxy_fwd() );\n#endif\n", normalmap_pars_fragment:"#ifdef use_normalmap\n\tuniform sampler2d normalmap;\n\tuniform vec2 normalscale;\n\tvec3 perturbnormal2arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = vec3( dfdx( eye_pos.x ), dfdx( eye_pos.y ), dfdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dfdy( eye_pos.x ), dfdy( eye_pos.y ), dfdy( eye_pos.z ) );\n\t\tvec2 st0 = dfdx( vuv.st );\n\t\tvec2 st1 = dfdy( vuv.st );\n\t\tvec3 s = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 t = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 n = normalize( surf_norm );\n\t\tvec3 mapn = texture2d( normalmap, vuv ).xyz * 2.0 - 1.0;\n\t\tmapn.xy = normalscale * mapn.xy;\n\t\tmat3 tsn = mat3( s, t, n );\n\t\treturn normalize( tsn * mapn );\n\t}\n#endif\n", packing:"vec3 packnormaltorgb( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackrgbtonormal( const in vec3 rgb ) {\n\treturn 1.0 - 2.0 * rgb.xyz;\n}\nconst float packupscale = 256. / 255.;const float unpackdownscale = 255. / 256.;\nconst vec3 packfactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 unpackfactors = unpackdownscale / vec4( packfactors, 1. );\nconst float shiftright8 = 1. / 256.;\nvec4 packdepthtorgba( const in float v ) {\n\tvec4 r = vec4( fract( v * packfactors ), v );\n\tr.yzw -= r.xyz * shiftright8;\treturn r * packupscale;\n}\nfloat unpackrgbatodepth( const in vec4 v ) {\n\treturn dot( v, unpackfactors );\n}\nfloat viewztoorthographicdepth( const in float viewz, const in float near, const in float far ) {\n\treturn ( viewz + near ) / ( near - far );\n}\nfloat orthographicdepthtoviewz( const in float linearclipz, const in float near, const in float far ) {\n\treturn linearclipz * ( near - far ) - near;\n}\nfloat viewztoperspectivedepth( const in float viewz, const in float near, const in float far ) {\n\treturn (( near + viewz ) * far ) / (( far - near ) * viewz );\n}\nfloat perspectivedepthtoviewz( const in float invclipz, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invclipz - far );\n}\n", premultiplied_alpha_fragment:"#ifdef premultiplied_alpha\n\tgl_fragcolor.rgb *= gl_fragcolor.a;\n#endif\n",project_vertex:"vec4 mvposition = modelviewmatrix * vec4( transformed, 1.0 );\ngl_position = projectionmatrix * mvposition;\n",dithering_fragment:"#if defined( dithering )\n gl_fragcolor.rgb = dithering( gl_fragcolor.rgb );\n#endif\n",dithering_pars_fragment:"#if defined( dithering )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_fragcoord.xy );\n\t\tvec3 dither_shift_rgb = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_rgb = mix( 2.0 * dither_shift_rgb, -2.0 * dither_shift_rgb, grid_position );\n\t\treturn color + dither_shift_rgb;\n\t}\n#endif\n", roughnessmap_fragment:"float roughnessfactor = roughness;\n#ifdef use_roughnessmap\n\tvec4 texelroughness = texture2d( roughnessmap, vuv );\n\troughnessfactor *= texelroughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef use_roughnessmap\n\tuniform sampler2d roughnessmap;\n#endif",shadowmap_pars_fragment:"#ifdef use_shadowmap\n\t#if num_dir_lights > 0\n\t\tuniform sampler2d directionalshadowmap[ num_dir_lights ];\n\t\tvarying vec4 vdirectionalshadowcoord[ num_dir_lights ];\n\t#endif\n\t#if num_spot_lights > 0\n\t\tuniform sampler2d spotshadowmap[ num_spot_lights ];\n\t\tvarying vec4 vspotshadowcoord[ num_spot_lights ];\n\t#endif\n\t#if num_point_lights > 0\n\t\tuniform sampler2d pointshadowmap[ num_point_lights ];\n\t\tvarying vec4 vpointshadowcoord[ num_point_lights ];\n\t#endif\n\tfloat texture2dcompare( sampler2d depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackrgbatodepth( texture2d( depths, uv ) ) );\n\t}\n\tfloat texture2dshadowlerp( sampler2d depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelsize = vec2( 1.0 ) / size;\n\t\tvec2 centroiduv = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2dcompare( depths, centroiduv + texelsize * offset.xx, compare );\n\t\tfloat lt = texture2dcompare( depths, centroiduv + texelsize * offset.xy, compare );\n\t\tfloat rb = texture2dcompare( depths, centroiduv + texelsize * offset.yx, compare );\n\t\tfloat rt = texture2dcompare( depths, centroiduv + texelsize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getshadow( sampler2d shadowmap, vec2 shadowmapsize, float shadowbias, float shadowradius, vec4 shadowcoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowcoord.xyz /= shadowcoord.w;\n\t\tshadowcoord.z += shadowbias;\n\t\tbvec4 infrustumvec = bvec4 ( shadowcoord.x >= 0.0, shadowcoord.x <= 1.0, shadowcoord.y >= 0.0, shadowcoord.y <= 1.0 );\n\t\tbool infrustum = all( infrustumvec );\n\t\tbvec2 frustumtestvec = bvec2( infrustum, shadowcoord.z <= 1.0 );\n\t\tbool frustumtest = all( frustumtestvec );\n\t\tif ( frustumtest ) {\n\t\t#if defined( shadowmap_type_pcf )\n\t\t\tvec2 texelsize = vec2( 1.0 ) / shadowmapsize;\n\t\t\tfloat dx0 = - texelsize.x * shadowradius;\n\t\t\tfloat dy0 = - texelsize.y * shadowradius;\n\t\t\tfloat dx1 = + texelsize.x * shadowradius;\n\t\t\tfloat dy1 = + texelsize.y * shadowradius;\n\t\t\tshadow = (\n\t\t\t\ttexture2dcompare( shadowmap, shadowcoord.xy + vec2( dx0, dy0 ), shadowcoord.z ) +\n\t\t\t\ttexture2dcompare( shadowmap, shadowcoord.xy + vec2( 0.0, dy0 ), shadowcoord.z ) +\n\t\t\t\ttexture2dcompare( shadowmap, shadowcoord.xy + vec2( dx1, dy0 ), shadowcoord.z ) +\n\t\t\t\ttexture2dcompare( shadowmap, shadowcoord.xy + vec2( dx0, 0.0 ), shadowcoord.z ) +\n\t\t\t\ttexture2dcompare( shadowmap, shadowcoord.xy, shadowcoord.z ) +\n\t\t\t\ttexture2dcompare( shadowmap, shadowcoord.xy + vec2( dx1, 0.0 ), shadowcoord.z ) +\n\t\t\t\ttexture2dcompare( shadowmap, shadowcoord.xy + vec2( dx0, dy1 ), shadowcoord.z ) +\n\t\t\t\ttexture2dcompare( shadowmap, shadowcoord.xy + vec2( 0.0, dy1 ), shadowcoord.z ) +\n\t\t\t\ttexture2dcompare( shadowmap, shadowcoord.xy + vec2( dx1, dy1 ), shadowcoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( shadowmap_type_pcf_soft )\n\t\t\tvec2 texelsize = vec2( 1.0 ) / shadowmapsize;\n\t\t\tfloat dx0 = - texelsize.x * shadowradius;\n\t\t\tfloat dy0 = - texelsize.y * shadowradius;\n\t\t\tfloat dx1 = + texelsize.x * shadowradius;\n\t\t\tfloat dy1 = + texelsize.y * shadowradius;\n\t\t\tshadow = (\n\t\t\t\ttexture2dshadowlerp( shadowmap, shadowmapsize, shadowcoord.xy + vec2( dx0, dy0 ), shadowcoord.z ) +\n\t\t\t\ttexture2dshadowlerp( shadowmap, shadowmapsize, shadowcoord.xy + vec2( 0.0, dy0 ), shadowcoord.z ) +\n\t\t\t\ttexture2dshadowlerp( shadowmap, shadowmapsize, shadowcoord.xy + vec2( dx1, dy0 ), shadowcoord.z ) +\n\t\t\t\ttexture2dshadowlerp( shadowmap, shadowmapsize, shadowcoord.xy + vec2( dx0, 0.0 ), shadowcoord.z ) +\n\t\t\t\ttexture2dshadowlerp( shadowmap, shadowmapsize, shadowcoord.xy, shadowcoord.z ) +\n\t\t\t\ttexture2dshadowlerp( shadowmap, shadowmapsize, shadowcoord.xy + vec2( dx1, 0.0 ), shadowcoord.z ) +\n\t\t\t\ttexture2dshadowlerp( shadowmap, shadowmapsize, shadowcoord.xy + vec2( dx0, dy1 ), shadowcoord.z ) +\n\t\t\t\ttexture2dshadowlerp( shadowmap, shadowmapsize, shadowcoord.xy + vec2( 0.0, dy1 ), shadowcoord.z ) +\n\t\t\t\ttexture2dshadowlerp( shadowmap, shadowmapsize, shadowcoord.xy + vec2( dx1, dy1 ), shadowcoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2dcompare( shadowmap, shadowcoord.xy, shadowcoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubetouv( vec3 v, float texelsizey ) {\n\t\tvec3 absv = abs( v );\n\t\tfloat scaletocube = 1.0 / max( absv.x, max( absv.y, absv.z ) );\n\t\tabsv *= scaletocube;\n\t\tv *= scaletocube * ( 1.0 - 2.0 * texelsizey );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostatexel = 1.5 * texelsizey;\n\t\tfloat almostone = 1.0 - almostatexel;\n\t\tif ( absv.z >= almostone ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absv.x >= almostone ) {\n\t\t\tfloat signx = sign( v.x );\n\t\t\tplanar.x = v.z * signx + 2.0 * signx;\n\t\t} else if ( absv.y >= almostone ) {\n\t\t\tfloat signy = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signy + 2.0;\n\t\t\tplanar.y = v.z * signy - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getpointshadow( sampler2d shadowmap, vec2 shadowmapsize, float shadowbias, float shadowradius, vec4 shadowcoord, float shadowcameranear, float shadowcamerafar ) {\n\t\tvec2 texelsize = vec2( 1.0 ) / ( shadowmapsize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lighttoposition = shadowcoord.xyz;\n\t\tfloat dp = ( length( lighttoposition ) - shadowcameranear ) / ( shadowcamerafar - shadowcameranear );\t\tdp += shadowbias;\n\t\tvec3 bd3d = normalize( lighttoposition );\n\t\t#if defined( shadowmap_type_pcf ) || defined( shadowmap_type_pcf_soft )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowradius * texelsize.y;\n\t\t\treturn (\n\t\t\t\ttexture2dcompare( shadowmap, cubetouv( bd3d + offset.xyy, texelsize.y ), dp ) +\n\t\t\t\ttexture2dcompare( shadowmap, cubetouv( bd3d + offset.yyy, texelsize.y ), dp ) +\n\t\t\t\ttexture2dcompare( shadowmap, cubetouv( bd3d + offset.xyx, texelsize.y ), dp ) +\n\t\t\t\ttexture2dcompare( shadowmap, cubetouv( bd3d + offset.yyx, texelsize.y ), dp ) +\n\t\t\t\ttexture2dcompare( shadowmap, cubetouv( bd3d, texelsize.y ), dp ) +\n\t\t\t\ttexture2dcompare( shadowmap, cubetouv( bd3d + offset.xxy, texelsize.y ), dp ) +\n\t\t\t\ttexture2dcompare( shadowmap, cubetouv( bd3d + offset.yxy, texelsize.y ), dp ) +\n\t\t\t\ttexture2dcompare( shadowmap, cubetouv( bd3d + offset.xxx, texelsize.y ), dp ) +\n\t\t\t\ttexture2dcompare( shadowmap, cubetouv( bd3d + offset.yxx, texelsize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2dcompare( shadowmap, cubetouv( bd3d, texelsize.y ), dp );\n\t\t#endif\n\t}\n#endif\n", shadowmap_pars_vertex:"#ifdef use_shadowmap\n\t#if num_dir_lights > 0\n\t\tuniform mat4 directionalshadowmatrix[ num_dir_lights ];\n\t\tvarying vec4 vdirectionalshadowcoord[ num_dir_lights ];\n\t#endif\n\t#if num_spot_lights > 0\n\t\tuniform mat4 spotshadowmatrix[ num_spot_lights ];\n\t\tvarying vec4 vspotshadowcoord[ num_spot_lights ];\n\t#endif\n\t#if num_point_lights > 0\n\t\tuniform mat4 pointshadowmatrix[ num_point_lights ];\n\t\tvarying vec4 vpointshadowcoord[ num_point_lights ];\n\t#endif\n#endif\n", shadowmap_vertex:"#ifdef use_shadowmap\n\t#if num_dir_lights > 0\n\tfor ( int i = 0; i < num_dir_lights; i ++ ) {\n\t\tvdirectionalshadowcoord[ i ] = directionalshadowmatrix[ i ] * worldposition;\n\t}\n\t#endif\n\t#if num_spot_lights > 0\n\tfor ( int i = 0; i < num_spot_lights; i ++ ) {\n\t\tvspotshadowcoord[ i ] = spotshadowmatrix[ i ] * worldposition;\n\t}\n\t#endif\n\t#if num_point_lights > 0\n\tfor ( int i = 0; i < num_point_lights; i ++ ) {\n\t\tvpointshadowcoord[ i ] = pointshadowmatrix[ i ] * worldposition;\n\t}\n\t#endif\n#endif\n", shadowmask_pars_fragment:"float getshadowmask() {\n\tfloat shadow = 1.0;\n\t#ifdef use_shadowmap\n\t#if num_dir_lights > 0\n\tdirectionallight directionallight;\n\tfor ( int i = 0; i < num_dir_lights; i ++ ) {\n\t\tdirectionallight = directionallights[ i ];\n\t\tshadow *= bool( directionallight.shadow ) ? getshadow( directionalshadowmap[ i ], directionallight.shadowmapsize, directionallight.shadowbias, directionallight.shadowradius, vdirectionalshadowcoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if num_spot_lights > 0\n\tspotlight spotlight;\n\tfor ( int i = 0; i < num_spot_lights; i ++ ) {\n\t\tspotlight = spotlights[ i ];\n\t\tshadow *= bool( spotlight.shadow ) ? getshadow( spotshadowmap[ i ], spotlight.shadowmapsize, spotlight.shadowbias, spotlight.shadowradius, vspotshadowcoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if num_point_lights > 0\n\tpointlight pointlight;\n\tfor ( int i = 0; i < num_point_lights; i ++ ) {\n\t\tpointlight = pointlights[ i ];\n\t\tshadow *= bool( pointlight.shadow ) ? getpointshadow( pointshadowmap[ i ], pointlight.shadowmapsize, pointlight.shadowbias, pointlight.shadowradius, vpointshadowcoord[ i ], pointlight.shadowcameranear, pointlight.shadowcamerafar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n", skinbase_vertex:"#ifdef use_skinning\n\tmat4 bonematx = getbonematrix( skinindex.x );\n\tmat4 bonematy = getbonematrix( skinindex.y );\n\tmat4 bonematz = getbonematrix( skinindex.z );\n\tmat4 bonematw = getbonematrix( skinindex.w );\n#endif",skinning_pars_vertex:"#ifdef use_skinning\n\tuniform mat4 bindmatrix;\n\tuniform mat4 bindmatrixinverse;\n\t#ifdef bone_texture\n\t\tuniform sampler2d bonetexture;\n\t\tuniform int bonetexturesize;\n\t\tmat4 getbonematrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( bonetexturesize ) );\n\t\t\tfloat y = floor( j / float( bonetexturesize ) );\n\t\t\tfloat dx = 1.0 / float( bonetexturesize );\n\t\t\tfloat dy = 1.0 / float( bonetexturesize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2d( bonetexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2d( bonetexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2d( bonetexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2d( bonetexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 bonematrices[ max_bones ];\n\t\tmat4 getbonematrix( const in float i ) {\n\t\t\tmat4 bone = bonematrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n", skinning_vertex:"#ifdef use_skinning\n\tvec4 skinvertex = bindmatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += bonematx * skinvertex * skinweight.x;\n\tskinned += bonematy * skinvertex * skinweight.y;\n\tskinned += bonematz * skinvertex * skinweight.z;\n\tskinned += bonematw * skinvertex * skinweight.w;\n\ttransformed = ( bindmatrixinverse * skinned ).xyz;\n#endif\n",skinnormal_vertex:"#ifdef use_skinning\n\tmat4 skinmatrix = mat4( 0.0 );\n\tskinmatrix += skinweight.x * bonematx;\n\tskinmatrix += skinweight.y * bonematy;\n\tskinmatrix += skinweight.z * bonematz;\n\tskinmatrix += skinweight.w * bonematw;\n\tskinmatrix = bindmatrixinverse * skinmatrix * bindmatrix;\n\tobjectnormal = vec4( skinmatrix * vec4( objectnormal, 0.0 ) ).xyz;\n#endif\n", specularmap_fragment:"float specularstrength;\n#ifdef use_specularmap\n\tvec4 texelspecular = texture2d( specularmap, vuv );\n\tspecularstrength = texelspecular.r;\n#else\n\tspecularstrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef use_specularmap\n\tuniform sampler2d specularmap;\n#endif",tonemapping_fragment:"#if defined( tone_mapping )\n gl_fragcolor.rgb = tonemapping( gl_fragcolor.rgb );\n#endif\n",tonemapping_pars_fragment:"#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float tonemappingexposure;\nuniform float tonemappingwhitepoint;\nvec3 lineartonemapping( vec3 color ) {\n\treturn tonemappingexposure * color;\n}\nvec3 reinhardtonemapping( vec3 color ) {\n\tcolor *= tonemappingexposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define uncharted2helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 uncharted2tonemapping( vec3 color ) {\n\tcolor *= tonemappingexposure;\n\treturn saturate( uncharted2helper( color ) / uncharted2helper( vec3( tonemappingwhitepoint ) ) );\n}\nvec3 optimizedcineontonemapping( vec3 color ) {\n\tcolor *= tonemappingexposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n", uv_pars_fragment:"#if defined( use_map ) || defined( use_bumpmap ) || defined( use_normalmap ) || defined( use_specularmap ) || defined( use_alphamap ) || defined( use_emissivemap ) || defined( use_roughnessmap ) || defined( use_metalnessmap )\n\tvarying vec2 vuv;\n#endif",uv_pars_vertex:"#if defined( use_map ) || defined( use_bumpmap ) || defined( use_normalmap ) || defined( use_specularmap ) || defined( use_alphamap ) || defined( use_emissivemap ) || defined( use_roughnessmap ) || defined( use_metalnessmap )\n\tvarying vec2 vuv;\n\tuniform vec4 offsetrepeat;\n#endif\n", uv_vertex:"#if defined( use_map ) || defined( use_bumpmap ) || defined( use_normalmap ) || defined( use_specularmap ) || defined( use_alphamap ) || defined( use_emissivemap ) || defined( use_roughnessmap ) || defined( use_metalnessmap )\n\tvuv = uv * offsetrepeat.zw + offsetrepeat.xy;\n#endif",uv2_pars_fragment:"#if defined( use_lightmap ) || defined( use_aomap )\n\tvarying vec2 vuv2;\n#endif",uv2_pars_vertex:"#if defined( use_lightmap ) || defined( use_aomap )\n\tattribute vec2 uv2;\n\tvarying vec2 vuv2;\n#endif", uv2_vertex:"#if defined( use_lightmap ) || defined( use_aomap )\n\tvuv2 = uv2;\n#endif",worldpos_vertex:"#if defined( use_envmap ) || defined( phong ) || defined( physical ) || defined( lambert ) || defined( distance ) || defined ( use_shadowmap )\n\tvec4 worldposition = modelmatrix * vec4( transformed, 1.0 );\n#endif\n",cube_frag:"uniform samplercube tcube;\nuniform float tflip;\nuniform float opacity;\nvarying vec3 vworldposition;\nvoid main() {\n\tgl_fragcolor = texturecube( tcube, vec3( tflip * vworldposition.x, vworldposition.yz ) );\n\tgl_fragcolor.a *= opacity;\n}\n", cube_vert:"varying vec3 vworldposition;\n#include \nvoid main() {\n\tvworldposition = transformdirection( position, modelmatrix );\n\t#include \n\t#include \n}\n",depth_frag:"#if depth_packing == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffusecolor = vec4( 1.0 );\n\t#if depth_packing == 3200\n\t\tdiffusecolor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if depth_packing == 3200\n\t\tgl_fragcolor = vec4( vec3( gl_fragcoord.z ), opacity );\n\t#elif depth_packing == 3201\n\t\tgl_fragcolor = packdepthtorgba( gl_fragcoord.z );\n\t#endif\n}\n", depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef use_displacementmap\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", distancergba_frag:"#define distance\nuniform vec3 referenceposition;\nuniform float neardistance;\nuniform float fardistance;\nvarying vec3 vworldposition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffusecolor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vworldposition - referenceposition );\n\tdist = ( dist - neardistance ) / ( fardistance - neardistance );\n\tdist = saturate( dist );\n\tgl_fragcolor = packdepthtorgba( dist );\n}\n", distancergba_vert:"#define distance\nvarying vec3 vworldposition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef use_displacementmap\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvworldposition = worldposition.xyz;\n}\n", equirect_frag:"uniform sampler2d tequirect;\nvarying vec3 vworldposition;\n#include \nvoid main() {\n\tvec3 direction = normalize( vworldposition );\n\tvec2 sampleuv;\n\tsampleuv.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * reciprocal_pi + 0.5;\n\tsampleuv.x = atan( direction.z, direction.x ) * reciprocal_pi2 + 0.5;\n\tgl_fragcolor = texture2d( tequirect, sampleuv );\n}\n",equirect_vert:"varying vec3 vworldposition;\n#include \nvoid main() {\n\tvworldposition = transformdirection( position, modelmatrix );\n\t#include \n\t#include \n}\n", linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashsize;\nuniform float totalsize;\nvarying float vlinedistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vlinedistance, totalsize ) > dashsize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoinglight = vec3( 0.0 );\n\tvec4 diffusecolor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoinglight = diffusecolor.rgb;\n\tgl_fragcolor = vec4( outgoinglight, diffusecolor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", linedashed_vert:"uniform float scale;\nattribute float linedistance;\nvarying float vlinedistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvlinedistance = scale * linedistance;\n\tvec4 mvposition = modelviewmatrix * vec4( position, 1.0 );\n\tgl_position = projectionmatrix * mvposition;\n\t#include \n\t#include \n\t#include \n}\n", meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef flat_shaded\n\tvarying vec3 vnormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffusecolor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedlight reflectedlight = reflectedlight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef use_lightmap\n\t\treflectedlight.indirectdiffuse += texture2d( lightmap, vuv2 ).xyz * lightmapintensity;\n\t#else\n\t\treflectedlight.indirectdiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedlight.indirectdiffuse *= diffusecolor.rgb;\n\tvec3 outgoinglight = reflectedlight.indirectdiffuse;\n\t#include \n\tgl_fragcolor = vec4( outgoinglight, diffusecolor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef use_envmap\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vlightfront;\n#ifdef double_sided\n\tvarying vec3 vlightback;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffusecolor = vec4( diffuse, opacity );\n\treflectedlight reflectedlight = reflectedlight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalemissiveradiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedlight.indirectdiffuse = getambientlightirradiance( ambientlightcolor );\n\t#include \n\treflectedlight.indirectdiffuse *= brdf_diffuse_lambert( diffusecolor.rgb );\n\t#ifdef double_sided\n\t\treflectedlight.directdiffuse = ( gl_frontfacing ) ? vlightfront : vlightback;\n\t#else\n\t\treflectedlight.directdiffuse = vlightfront;\n\t#endif\n\treflectedlight.directdiffuse *= brdf_diffuse_lambert( diffusecolor.rgb ) * getshadowmask();\n\t#include \n\tvec3 outgoinglight = reflectedlight.directdiffuse + reflectedlight.indirectdiffuse + totalemissiveradiance;\n\t#include \n\tgl_fragcolor = vec4( outgoinglight, diffusecolor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshlambert_vert:"#define lambert\nvarying vec3 vlightfront;\n#ifdef double_sided\n\tvarying vec3 vlightback;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshphong_frag:"#define phong\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffusecolor = vec4( diffuse, opacity );\n\treflectedlight reflectedlight = reflectedlight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalemissiveradiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoinglight = reflectedlight.directdiffuse + reflectedlight.indirectdiffuse + reflectedlight.directspecular + reflectedlight.indirectspecular + totalemissiveradiance;\n\t#include \n\tgl_fragcolor = vec4( outgoinglight, diffusecolor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshphong_vert:"#define phong\nvarying vec3 vviewposition;\n#ifndef flat_shaded\n\tvarying vec3 vnormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef flat_shaded\n\tvnormal = normalize( transformednormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvviewposition = - mvposition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshphysical_frag:"#define physical\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef standard\n\tuniform float clearcoat;\n\tuniform float clearcoatroughness;\n#endif\nvarying vec3 vviewposition;\n#ifndef flat_shaded\n\tvarying vec3 vnormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffusecolor = vec4( diffuse, opacity );\n\treflectedlight reflectedlight = reflectedlight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalemissiveradiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoinglight = reflectedlight.directdiffuse + reflectedlight.indirectdiffuse + reflectedlight.directspecular + reflectedlight.indirectspecular + totalemissiveradiance;\n\tgl_fragcolor = vec4( outgoinglight, diffusecolor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshphysical_vert:"#define physical\nvarying vec3 vviewposition;\n#ifndef flat_shaded\n\tvarying vec3 vnormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef flat_shaded\n\tvnormal = normalize( transformednormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvviewposition = - mvposition.xyz;\n\t#include \n\t#include \n\t#include \n}\n", normal_frag:"#define normal\nuniform float opacity;\n#if defined( flat_shaded ) || defined( use_bumpmap ) || defined( use_normalmap )\n\tvarying vec3 vviewposition;\n#endif\n#ifndef flat_shaded\n\tvarying vec3 vnormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\tgl_fragcolor = vec4( packnormaltorgb( normal ), opacity );\n}\n", normal_vert:"#define normal\n#if defined( flat_shaded ) || defined( use_bumpmap ) || defined( use_normalmap )\n\tvarying vec3 vviewposition;\n#endif\n#ifndef flat_shaded\n\tvarying vec3 vnormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef flat_shaded\n\tvnormal = normalize( transformednormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( flat_shaded ) || defined( use_bumpmap ) || defined( use_normalmap )\n\tvviewposition = - mvposition.xyz;\n#endif\n}\n", points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoinglight = vec3( 0.0 );\n\tvec4 diffusecolor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoinglight = diffusecolor.rgb;\n\tgl_fragcolor = vec4( outgoinglight, diffusecolor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef use_sizeattenuation\n\t\tgl_pointsize = size * ( scale / - mvposition.z );\n\t#else\n\t\tgl_pointsize = size;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_fragcolor = vec4( color, opacity * ( 1.0 - getshadowmask() ) );\n}\n",shadow_vert:"#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"},ib={basic:{uniforms:da.merge([l.common, l.specularmap,l.envmap,l.aomap,l.lightmap,l.fog]),vertexshader:v.meshbasic_vert,fragmentshader:v.meshbasic_frag},lambert:{uniforms:da.merge([l.common,l.specularmap,l.envmap,l.aomap,l.lightmap,l.emissivemap,l.fog,l.lights,{emissive:{value:new c(0)}}]),vertexshader:v.meshlambert_vert,fragmentshader:v.meshlambert_frag},phong:{uniforms:da.merge([l.common,l.specularmap,l.envmap,l.aomap,l.lightmap,l.emissivemap,l.bumpmap,l.normalmap,l.displacementmap,l.gradientmap,l.fog,l.lights,{emissive:{value:new c(0)}, specular:{value:new c(1118481)},shininess:{value:30}}]),vertexshader:v.meshphong_vert,fragmentshader:v.meshphong_frag},standard:{uniforms:da.merge([l.common,l.envmap,l.aomap,l.lightmap,l.emissivemap,l.bumpmap,l.normalmap,l.displacementmap,l.roughnessmap,l.metalnessmap,l.fog,l.lights,{emissive:{value:new c(0)},roughness:{value:.5},metalness:{value:.5},envmapintensity:{value:1}}]),vertexshader:v.meshphysical_vert,fragmentshader:v.meshphysical_frag},points:{uniforms:da.merge([l.points,l.fog]),vertexshader:v.points_vert, fragmentshader:v.points_frag},dashed:{uniforms:da.merge([l.common,l.fog,{scale:{value:1},dashsize:{value:1},totalsize:{value:2}}]),vertexshader:v.linedashed_vert,fragmentshader:v.linedashed_frag},depth:{uniforms:da.merge([l.common,l.displacementmap]),vertexshader:v.depth_vert,fragmentshader:v.depth_frag},normal:{uniforms:da.merge([l.common,l.bumpmap,l.normalmap,l.displacementmap,{opacity:{value:1}}]),vertexshader:v.normal_vert,fragmentshader:v.normal_frag},cube:{uniforms:{tcube:{value:null},tflip:{value:-1}, opacity:{value:1}},vertexshader:v.cube_vert,fragmentshader:v.cube_frag},equirect:{uniforms:{tequirect:{value:null}},vertexshader:v.equirect_vert,fragmentshader:v.equirect_frag},distancergba:{uniforms:da.merge([l.common,l.displacementmap,{referenceposition:{value:new n},neardistance:{value:1},fardistance:{value:1e3}}]),vertexshader:v.distancergba_vert,fragmentshader:v.distancergba_frag},shadow:{uniforms:da.merge([l.lights,{color:{value:new c(0)},opacity:{value:1}}]),vertexshader:v.shadow_vert,fragmentshader:v.shadow_frag}}; ib.physical={uniforms:da.merge([ib.standard.uniforms,{clearcoat:{value:0},clearcoatroughness:{value:0}}]),vertexshader:v.meshphysical_vert,fragmentshader:v.meshphysical_frag};object.assign(id.prototype,{set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setfrompoints:function(a){this.makeempty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y?!1:!0},containsbox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y},getparameter:function(a,b){return(b||new d).set((a.x- this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},intersectsbox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0},clamppoint:function(a,b){return(b||new d).copy(a).clamp(this.min,this.max)},distancetopoint:function(){var a=new d;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min); this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});oc.prototype=object.create(n.prototype);oc.prototype.constructor=oc;var mf=0;object.assign(p.prototype,na.prototype,{ismaterial:!0,onbeforecompile:function(){},setvalues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("three.material: '"+b+"' parameter is undefined.");else if("shading"===b)console.warn("three."+ this.type+": .shading has been removed. use the boolean .flatshading instead."),this.flatshading=1===c?!0:!1;else{var d=this[b];void 0===d?console.warn("three."+this.type+": '"+b+"' is not a property of this material."):d&&d.iscolor?d.set(c):d&&d.isvector3&&c&&c.isvector3?d.copy(c):this[b]="overdraw"===b?number(c):c}}},tojson:function(a){function b(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push(d)}return b}var c=void 0===a;c&&(a={textures:{},images:{}});var d={metadata:{version:4.5, type:"material",generator:"material.tojson"}};d.uuid=this.uuid;d.type=this.type;""!==this.name&&(d.name=this.name);this.color&&this.color.iscolor&&(d.color=this.color.gethex());void 0!==this.roughness&&(d.roughness=this.roughness);void 0!==this.metalness&&(d.metalness=this.metalness);this.emissive&&this.emissive.iscolor&&(d.emissive=this.emissive.gethex());this.specular&&this.specular.iscolor&&(d.specular=this.specular.gethex());void 0!==this.shininess&&(d.shininess=this.shininess);void 0!==this.clearcoat&& (d.clearcoat=this.clearcoat);void 0!==this.clearcoatroughness&&(d.clearcoatroughness=this.clearcoatroughness);this.map&&this.map.istexture&&(d.map=this.map.tojson(a).uuid);this.alphamap&&this.alphamap.istexture&&(d.alphamap=this.alphamap.tojson(a).uuid);this.lightmap&&this.lightmap.istexture&&(d.lightmap=this.lightmap.tojson(a).uuid);this.bumpmap&&this.bumpmap.istexture&&(d.bumpmap=this.bumpmap.tojson(a).uuid,d.bumpscale=this.bumpscale);this.normalmap&&this.normalmap.istexture&&(d.normalmap=this.normalmap.tojson(a).uuid, d.normalscale=this.normalscale.toarray());this.displacementmap&&this.displacementmap.istexture&&(d.displacementmap=this.displacementmap.tojson(a).uuid,d.displacementscale=this.displacementscale,d.displacementbias=this.displacementbias);this.roughnessmap&&this.roughnessmap.istexture&&(d.roughnessmap=this.roughnessmap.tojson(a).uuid);this.metalnessmap&&this.metalnessmap.istexture&&(d.metalnessmap=this.metalnessmap.tojson(a).uuid);this.emissivemap&&this.emissivemap.istexture&&(d.emissivemap=this.emissivemap.tojson(a).uuid); this.specularmap&&this.specularmap.istexture&&(d.specularmap=this.specularmap.tojson(a).uuid);this.envmap&&this.envmap.istexture&&(d.envmap=this.envmap.tojson(a).uuid,d.reflectivity=this.reflectivity);this.gradientmap&&this.gradientmap.istexture&&(d.gradientmap=this.gradientmap.tojson(a).uuid);void 0!==this.size&&(d.size=this.size);void 0!==this.sizeattenuation&&(d.sizeattenuation=this.sizeattenuation);1!==this.blending&&(d.blending=this.blending);!0===this.flatshading&&(d.flatshading=this.flatshading); 0!==this.side&&(d.side=this.side);0!==this.vertexcolors&&(d.vertexcolors=this.vertexcolors);1>this.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);d.depthfunc=this.depthfunc;d.depthtest=this.depthtest;d.depthwrite=this.depthwrite;!0===this.dithering&&(d.dithering=!0);0e&&(e=l);q>f&&(f=q);p>g&&(g=p)}this.min.set(b,c,d);this.max.set(e,f,g);return this},setfrombufferattribute:function(a){for(var b=infinity,c=infinity,d=infinity,e=-infinity,f=-infinity,g=-infinity,h=0,k=a.count;he&&(e=l);q>f&&(f=q);p>g&&(g=p)}this.min.set(b,c,d);this.max.set(e,f,g); return this},setfrompoints:function(a){this.makeempty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsbox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z},getparameter:function(a,b){return(b||new n).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/ (this.max.z-this.min.z))},intersectsbox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},intersectssphere:function(){var a=new n;return function(b){this.clamppoint(b.center,a);return a.distancetosquared(b.center)<=b.radius*b.radius}}(),intersectsplane:function(a){if(0=a.constant},clamppoint:function(a,b){return(b||new n).copy(a).clamp(this.min,this.max)},distancetopoint:function(){var a=new n;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getboundingsphere:function(){var a=new n;return function(b){b= b||new ca;this.getcenter(b.center);b.radius=.5*this.getsize(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);this.isempty()&&this.makeempty();return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applymatrix4:function(){var a=[new n,new n,new n,new n,new n,new n,new n,new n];return function(b){if(this.isempty())return this;a[0].set(this.min.x,this.min.y,this.min.z).applymatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applymatrix4(b); a[2].set(this.min.x,this.max.y,this.min.z).applymatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applymatrix4(b);a[4].set(this.max.x,this.min.y,this.min.z).applymatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applymatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applymatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applymatrix4(b);this.setfrompoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&& a.max.equals(this.max)}});object.assign(ca.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this},setfrompoints:function(){var a=new pa;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setfrompoints(b).getcenter(d);for(var e=c=0,f=b.length;e= this.radius},containspoint:function(a){return a.distancetosquared(this.center)<=this.radius*this.radius},distancetopoint:function(a){return a.distanceto(this.center)-this.radius},intersectssphere:function(a){var b=this.radius+a.radius;return a.center.distancetosquared(this.center)<=b*b},intersectsbox:function(a){return a.intersectssphere(this)},intersectsplane:function(a){return math.abs(a.distancetopoint(this.center))<=this.radius},clamppoint:function(a,b){var c=this.center.distancetosquared(a); b=b||new n;b.copy(a);c>this.radius*this.radius&&(b.sub(this.center).normalize(),b.multiplyscalar(this.radius).add(this.center));return b},getboundingbox:function(a){a=a||new pa;a.set(this.center,this.center);a.expandbyscalar(this.radius);return a},applymatrix4:function(a){this.center.applymatrix4(a);this.radius*=a.getmaxscaleonaxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius}});object.assign(qa.prototype, {ismatrix3:!0,set:function(a,b,c,d,e,f,g,h,k){var l=this.elements;l[0]=a;l[1]=d;l[2]=g;l[3]=b;l[4]=e;l[5]=h;l[6]=c;l[7]=f;l[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromarray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return this},setfrommatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5], a[9],a[2],a[6],a[10]);return this},applytobufferattribute:function(){var a=new n;return function(b){for(var c=0,d=b.count;cc;c++)if(b[c]!==a[c])return!1;return!0},fromarray:function(a,b){void 0===b&&(b=0);for(var c=0;9>c;c++)this.elements[c]=a[c+b];return this},toarray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a}});object.assign(za.prototype,{set:function(a,b){this.normal.copy(a);this.constant=b;return this},setcomponents:function(a,b,c, d){this.normal.set(a,b,c);this.constant=d;return this},setfromnormalandcoplanarpoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setfromcoplanarpoints:function(){var a=new n,b=new n;return function(c,d,e){d=a.subvectors(e,d).cross(b.subvectors(c,d)).normalize();this.setfromnormalandcoplanarpoint(d,c);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a= 1/this.normal.length();this.normal.multiplyscalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distancetopoint:function(a){return this.normal.dot(a)+this.constant},distancetosphere:function(a){return this.distancetopoint(a.center)-a.radius},projectpoint:function(a,b){return(b||new n).copy(this.normal).multiplyscalar(-this.distancetopoint(a)).add(a)},intersectline:function(){var a=new n;return function(b,c){c=c||new n;var d=b.delta(a),e=this.normal.dot(d); if(0===e){if(0===this.distancetopoint(b.start))return c.copy(b.start)}else if(e=-(b.start.dot(this.normal)+this.constant)/e,!(0>e||1b&&0a&&0c;c++)b[c].copy(a.planes[c]);return this},setfrommatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],q=c[8],p=c[9],m=c[10],r=c[11],n=c[12],u=c[13],x=c[14],c=c[15];b[0].setcomponents(f-a,l-g,r-q,c-n).normalize();b[1].setcomponents(f+a,l+g,r+q,c+n).normalize();b[2].setcomponents(f+d,l+h,r+p,c+u).normalize();b[3].setcomponents(f- d,l-h,r-p,c-u).normalize();b[4].setcomponents(f-e,l-k,r-m,c-x).normalize();b[5].setcomponents(f+e,l+k,r+m,c+x).normalize();return this},intersectsobject:function(){var a=new ca;return function(b){var c=b.geometry;null===c.boundingsphere&&c.computeboundingsphere();a.copy(c.boundingsphere).applymatrix4(b.matrixworld);return this.intersectssphere(a)}}(),intersectssprite:function(){var a=new ca;return function(b){a.center.set(0,0,0);a.radius=.7071067811865476;a.applymatrix4(b.matrixworld);return this.intersectssphere(a)}}(), intersectssphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distancetopoint(c)e;e++){var f=d[e];a.x=0 g&&0>f)return!1}return!0}}(),containspoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distancetopoint(a))return!1;return!0}});ya.rotationorders="xyz yzx zxy xzy yxz zyx".split(" ");ya.defaultorder="xyz";object.defineproperties(ya.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onchangecallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onchangecallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this.onchangecallback()}}, order:{get:function(){return this._order},set:function(a){this._order=a;this.onchangecallback()}}});object.assign(ya.prototype,{iseuler:!0,set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onchangecallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onchangecallback();return this},setfromrotationmatrix:function(a,b,c){var d=r.clamp, e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],l=e[9],q=e[2],p=e[6],e=e[10];b=b||this._order;"xyz"===b?(this._y=math.asin(d(g,-1,1)),.99999>math.abs(g)?(this._x=math.atan2(-l,e),this._z=math.atan2(-f,a)):(this._x=math.atan2(p,k),this._z=0)):"yxz"===b?(this._x=math.asin(-d(l,-1,1)),.99999>math.abs(l)?(this._y=math.atan2(g,e),this._z=math.atan2(h,k)):(this._y=math.atan2(-q,a),this._z=0)):"zxy"===b?(this._x=math.asin(d(p,-1,1)),.99999>math.abs(p)?(this._y=math.atan2(-q,e),this._z=math.atan2(-f, k)):(this._y=0,this._z=math.atan2(h,a))):"zyx"===b?(this._y=math.asin(-d(q,-1,1)),.99999>math.abs(q)?(this._x=math.atan2(p,e),this._z=math.atan2(h,a)):(this._x=0,this._z=math.atan2(-f,k))):"yzx"===b?(this._z=math.asin(d(h,-1,1)),.99999>math.abs(h)?(this._x=math.atan2(-l,k),this._y=math.atan2(-q,a)):(this._x=0,this._y=math.atan2(g,e))):"xzy"===b?(this._z=math.asin(-d(f,-1,1)),.99999>math.abs(f)?(this._x=math.atan2(p,k),this._y=math.atan2(g,a)):(this._x=math.atan2(-l,e),this._y=0)):console.warn("three.euler: .setfromrotationmatrix() given unsupported order: "+ b);this._order=b;if(!1!==c)this.onchangecallback();return this},setfromquaternion:function(){var a=new o;return function(b,c,d){a.makerotationfromquaternion(b);return this.setfromrotationmatrix(a,c,d)}}(),setfromvector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new ia;return function(b){a.setfromeuler(this);return this.setfromquaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromarray:function(a){this._x= a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onchangecallback();return this},toarray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},tovector3:function(a){return a?a.set(this._x,this._y,this._z):new n(this._x,this._y,this._z)},onchange:function(a){this.onchangecallback=a;return this},onchangecallback:function(){}});object.assign(qd.prototype,{set:function(a){this.mask=1<g;g++)if(d[g]===d[(g+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(d=a[f],this.faces.splice(d,1),c=0,e=this.facevertexuvs.length;ca?b.copy(this.origin):b.copy(this.direction).multiplyscalar(a).add(this.origin)},distancetopoint:function(a){return math.sqrt(this.distancesqtopoint(a))},distancesqtopoint:function(){var a=new n;return function(b){var c=a.subvectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distancetosquared(b);a.copy(this.direction).multiplyscalar(c).add(this.origin);return a.distancetosquared(b)}}(),distancesqtosegment:function(){var a=new n,b=new n,c=new n;return function(d, e,f,g){a.copy(d).add(e).multiplyscalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceto(e),k=-this.direction.dot(b),l=c.dot(this.direction),q=-c.dot(b),m=c.lengthsq(),t=math.abs(1-k*k);if(0=-n?e<=n?(h=1/t,d*=h,e*=h,k=d*(d+k*e+2*l)+e*(k*d+e+2*q)+m):(e=h,d=math.max(0,-(k*e+l)),k=-d*d+e*(e+2*q)+m):(e=-h,d=math.max(0,-(k*e+l)),k=-d*d+e*(e+2*q)+m):e<=-n?(d=math.max(0,-(-k*h+l)),e=0b)return null;b=math.sqrt(b-e);e= d-b;d+=b;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),intersectssphere:function(a){return this.distancetopoint(a.center)<=a.radius},distancetoplane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distancetopoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectplane:function(a,b){a=this.distancetoplane(a);return null===a?null:this.at(a,b)},intersectsplane:function(a){var b=a.distancetopoint(this.origin);return 0===b||0>a.normal.dot(this.direction)* b?!0:!1},intersectbox:function(a,b){var c=1/this.direction.x;var d=1/this.direction.y;var e=1/this.direction.z,f=this.origin;if(0<=c){var g=(a.min.x-f.x)*c;c*=a.max.x-f.x}else g=(a.max.x-f.x)*c,c*=a.min.x-f.x;if(0<=d){var h=(a.min.y-f.y)*d;d*=a.max.y-f.y}else h=(a.max.y-f.y)*d,d*=a.min.y-f.y;if(g>d||h>c)return null;if(h>g||g!==g)g=h;if(da||h>c)return null;if(h>g||g!==g)g=h;if(a c?null:this.at(0<=g?g:c,b)},intersectsbox:function(){var a=new n;return function(b){return null!==this.intersectbox(b,a)}}(),intersecttriangle:function(){var a=new n,b=new n,c=new n,d=new n;return function(e,f,g,h,k){b.subvectors(f,e);c.subvectors(g,e);d.crossvectors(b,c);f=this.direction.dot(d);if(0f)h=-1,f=-f;else return null;a.subvectors(this.origin,e);e=h*this.direction.dot(c.crossvectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));if(0>g||e+ g>f)return null;e=-h*a.dot(d);return 0>e?null:this.at(e/f,k)}}(),applymatrix4:function(a){this.origin.applymatrix4(a);this.direction.transformdirection(a);return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}});object.assign(fb.prototype,{set:function(a,b){this.start.copy(a);this.end.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},getcenter:function(a){return(a|| new n).addvectors(this.start,this.end).multiplyscalar(.5)},delta:function(a){return(a||new n).subvectors(this.end,this.start)},distancesq:function(){return this.start.distancetosquared(this.end)},distance:function(){return this.start.distanceto(this.end)},at:function(a,b){b=b||new n;return this.delta(b).multiplyscalar(a).add(this.start)},closestpointtopointparameter:function(){var a=new n,b=new n;return function(c,d){a.subvectors(c,this.start);b.subvectors(this.end,this.start);c=b.dot(b);c=b.dot(a)/ c;d&&(c=r.clamp(c,0,1));return c}}(),closestpointtopoint:function(a,b,c){a=this.closestpointtopointparameter(a,b);c=c||new n;return this.delta(c).multiplyscalar(a).add(this.start)},applymatrix4:function(a){this.start.applymatrix4(a);this.end.applymatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)}});object.assign(ra,{normal:function(){var a=new n;return function(b,c,d,e){e=e||new n;e.subvectors(d,c);a.subvectors(b,c);e.cross(a);b=e.lengthsq();return 0< b?e.multiplyscalar(1/math.sqrt(b)):e.set(0,0,0)}}(),barycoordfrompoint:function(){var a=new n,b=new n,c=new n;return function(d,e,f,g,h){a.subvectors(g,e);b.subvectors(f,e);c.subvectors(d,e);d=a.dot(a);e=a.dot(b);f=a.dot(c);var k=b.dot(b);g=b.dot(c);var l=d*k-e*e;h=h||new n;if(0===l)return h.set(-2,-1,-1);l=1/l;k=(k*f-e*g)*l;d=(d*g-e*f)*l;return h.set(1-k-d,d,k)}}(),containspoint:function(){var a=new n;return function(b,c,d,e){b=ra.barycoordfrompoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}()}); object.assign(ra.prototype,{set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setfrompointsandindices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new n,b=new n;return function(){a.subvectors(this.c,this.b);b.subvectors(this.a,this.b);return.5*a.cross(b).length()}}(),midpoint:function(a){return(a|| new n).addvectors(this.a,this.b).add(this.c).multiplyscalar(1/3)},normal:function(a){return ra.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new za).setfromcoplanarpoints(this.a,this.b,this.c)},barycoordfrompoint:function(a,b){return ra.barycoordfrompoint(a,this.a,this.b,this.c,b)},containspoint:function(a){return ra.containspoint(a,this.a,this.b,this.c)},closestpointtopoint:function(){var a=new za,b=[new fb,new fb,new fb],c=new n,d=new n;return function(e,f){f=f||new n;var g=infinity; a.setfromcoplanarpoints(this.a,this.b,this.c);a.projectpoint(e,c);if(!0===this.containspoint(c))f.copy(c);else for(b[0].set(this.a,this.b),b[1].set(this.b,this.c),b[2].set(this.c,this.a),e=0;ec.far?null:{distance:b,point:y.clone(),object:a}}function c(c,d,e,f,l,q,m,p){g.frombufferattribute(f,q);h.frombufferattribute(f,m);k.frombufferattribute(f,p);if(c=b(c,c.material,d,e,g,h,k,x))l&&(t.frombufferattribute(l,q),r.frombufferattribute(l,m),v.frombufferattribute(l,p),c.uv=a(x,g,h,k,t,r,v)),c.face=new qa(q,m,p,ra.normal(g,h,k)),c.faceindex=q;return c}var d=new o,e=new hb,f=new ca,g=new n,h=new n,k=new n,l=new n,q=new n,m=new n,t=new d,r=new d,v= new d,u=new n,x=new n,y=new n;return function(p,n){var u=this.geometry,y=this.material,a=this.matrixworld;if(void 0!==y&&(null===u.boundingsphere&&u.computeboundingsphere(),f.copy(u.boundingsphere),f.applymatrix4(a),!1!==p.ray.intersectssphere(f)&&(d.getinverse(a),e.copy(p.ray).applymatrix4(d),null===u.boundingbox||!1!==e.intersectsbox(u.boundingbox)))){var w;if(u.isbuffergeometry){var y=u.index,i=u.attributes.position,a=u.attributes.uv,z;if(null!==y){var d=0;for(z=y.count;df|| (f=d.ray.origin.distanceto(a),fd.far||e.push({distance:f,point:a.clone(),face:null,object:this}))}}(),clone:function(){return(new this.constructor(this.material)).copy(this)}});yc.prototype=object.assign(object.create(w.prototype),{constructor:yc,copy:function(a){w.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b=d[e].distance)d[e-1].object.visible=!1,d[e].object.visible=!0;else break;for(;ef||(q.applymatrix4(this.matrixworld),t=d.ray.origin.distanceto(q),td.far||e.push({distance:t,point:h.clone().applymatrix4(this.matrixworld),index:g,face:null,faceindex:null,object:this}));else for(g=0,u=r.length/3-1;gf||(q.applymatrix4(this.matrixworld),t=d.ray.origin.distanceto(q),td.far||e.push({distance:t,point:h.clone().applymatrix4(this.matrixworld),index:g, face:null,faceindex:null,object:this}))}else if(g.isgeometry)for(k=g.vertices,l=k.length,g=0;gf||(q.applymatrix4(this.matrixworld),t=d.ray.origin.distanceto(q),td.far||e.push({distance:t,point:h.clone().applymatrix4(this.matrixworld),index:g,face:null,faceindex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});x.prototype=object.assign(object.create(ra.prototype),{constructor:x, islinesegments:!0});qd.prototype=object.assign(object.create(ra.prototype),{constructor:qd,islineloop:!0});ma.prototype=object.create(p.prototype);ma.prototype.constructor=ma;ma.prototype.ispointsmaterial=!0;ma.prototype.copy=function(a){p.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.size=a.size;this.sizeattenuation=a.sizeattenuation;return this};jb.prototype=object.assign(object.create(w.prototype),{constructor:jb,ispoints:!0,raycast:function(){var a=new o,b=new hb,c= new ca;return function(d,e){function f(a,c){var f=b.distancesqtopoint(a);if(fd.far||e.push({distance:h,distancetoray:math.sqrt(f),point:a.clone(),index:c,face:null,object:g})}}var g=this,h=this.geometry,k=this.matrixworld,l=d.params.points.threshold;null===h.boundingsphere&&h.computeboundingsphere();c.copy(h.boundingsphere);c.applymatrix4(k);c.radius+=l;if(!1!==d.ray.intersectssphere(c)){a.getinverse(k); b.copy(d.ray).applymatrix4(a);var l=l/((this.scale.x+this.scale.y+this.scale.z)/3),q=l*l,l=new n;if(h.isbuffergeometry){var m=h.index,h=h.attributes.position.array;if(null!==m)for(var t=m.array,m=0,r=t.length;mc)return null;var d=[],e=[],f=[],g;if(0=h--){console.warn("three.shapeutils: unable to triangulate polygon! in triangulate()");break}var k=g;c<=k&&(k=0);g=k+ 1;c<=g&&(g=0);var l=g+1;c<=l&&(l=0);a:{var m;var p=a[e[k]].x;var t=a[e[k]].y;var n=a[e[g]].x;var v=a[e[g]].y;var u=a[e[l]].x;var x=a[e[l]].y;if(0>=(n-p)*(x-t)-(v-t)*(u-p))var y=!1;else{var a=u-n;var w=x-v;var b=p-u;var z=t-x;var d=n-p;y=v-t;for(m=0;m=-number.epsilon&&c>=-number.epsilon&&l>=-number.epsilon){y=!1;break a}}}y=!0}}if(y){d.push([a[e[k]], a[e[g]],a[e[l]]]);f.push([e[k],e[g],e[l]]);k=g;for(l=g+1;lnumber.epsilon){if(0n||n>p)return[];k=l*m-k* q;if(0>k||k>p)return[]}else{if(0c?[]:k===c?f?[]:[g]:a<=c?[g,h]:[g,l]}function f(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return math.abs(a)>number.epsilon?(b=g*c-d*b,0d&&(d=c);var e=a+1;e>c&&(e=0);c=f(h[a],h[d],h[e],d[b]);if(!c)return!1;c=d.length-1;d=b-1;0>d&&(d=c);e=b+1;e>c&&(e=0);return(c=f(d[b],d[d],d[e],h[a]))?!0:!1}function d(a,b){var c;for(c=0;ct){console.log('three.shapeutils: infinite loop! holes left:" + indepholes.length + ", probably hole outside shape!');break}for(m=n;ma;a++)m=b[a].x+":"+b[a].y,m=h[m],void 0!==m&&(b[a]=m);return k.concat()},isclockwise:function(a){return 0>fa.area(a)}};$a.prototype=object.create(q.prototype);$a.prototype.constructor=$a;ea.prototype=object.create(f.prototype); ea.prototype.constructor=ea;ea.prototype.getarrays=function(){var a=this.getattribute("position"),a=a?array.prototype.slice.call(a.array):[],b=this.getattribute("uv"),b=b?array.prototype.slice.call(b.array):[],c=this.index,c=c?array.prototype.slice.call(c.array):[];return{position:a,uv:b,index:c}};ea.prototype.addshapelist=function(a,b){var c=a.length;b.arrays=this.getarrays();for(var d=0;dnumber.epsilon){var k=math.sqrt(h),l=math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;g=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new d(f,d);e=math.sqrt(e/ 2)}else a=!1,d>number.epsilon?f>number.epsilon&&(a=!0):d<-number.epsilon?f<-number.epsilon&&(a=!0):math.sign(e)===math.sign(g)&&(a=!0),a?(f=-e,e=math.sqrt(h)):(f=d,d=e,e=math.sqrt(h/2));return new d(f/e,d/e)}function e(a,b){for(g=a.length;0<=--g;){var c=g;var d=g-1;0>d&&(d=a.length-1);var e,f=w+2*x;for(e=0;emath.abs(g-k)?[new d(a,1-c),new d(h,1-d),new d(l,1-e),new d(p,1-b)]:[new d(g,1-c),new d(k,1-d),new d(m,1-e),new d(n,1-b)]}};lc.prototype=object.create(q.prototype);lc.prototype.constructor=lc;tb.prototype= object.create(ea.prototype);tb.prototype.constructor=tb;mc.prototype=object.create(q.prototype);mc.prototype.constructor=mc;kb.prototype=object.create(f.prototype);kb.prototype.constructor=kb;nc.prototype=object.create(q.prototype);nc.prototype.constructor=nc;ub.prototype=object.create(f.prototype);ub.prototype.constructor=ub;oc.prototype=object.create(q.prototype);oc.prototype.constructor=oc;vb.prototype=object.create(f.prototype);vb.prototype.constructor=vb;wb.prototype=object.create(q.prototype); wb.prototype.constructor=wb;xb.prototype=object.create(f.prototype);xb.prototype.constructor=xb;yb.prototype=object.create(f.prototype);yb.prototype.constructor=yb;lb.prototype=object.create(q.prototype);lb.prototype.constructor=lb;ta.prototype=object.create(f.prototype);ta.prototype.constructor=ta;pc.prototype=object.create(lb.prototype);pc.prototype.constructor=pc;qc.prototype=object.create(ta.prototype);qc.prototype.constructor=qc;rc.prototype=object.create(q.prototype);rc.prototype.constructor= rc;zb.prototype=object.create(f.prototype);zb.prototype.constructor=zb;var ka=object.freeze({wireframegeometry:lb,parametricgeometry:cc,parametricbuffergeometry:mb,tetrahedrongeometry:ec,tetrahedronbuffergeometry:nb,octahedrongeometry:fc,octahedronbuffergeometry:jb,icosahedrongeometry:gc,icosahedronbuffergeometry:ob,dodecahedrongeometry:hc,dodecahedronbuffergeometry:pb,polyhedrongeometry:dc,polyhedronbuffergeometry:ua,tubegeometry:ic,tubebuffergeometry:qb,torusknotgeometry:jc,torusknotbuffergeometry:rb, torusgeometry:kc,torusbuffergeometry:sb,textgeometry:lc,textbuffergeometry:tb,spheregeometry:mc,spherebuffergeometry:kb,ringgeometry:nc,ringbuffergeometry:ub,planegeometry:vc,planebuffergeometry:gb,lathegeometry:oc,lathebuffergeometry:vb,shapegeometry:wb,shapebuffergeometry:xb,extrudegeometry:$a,extrudebuffergeometry:ea,edgesgeometry:yb,conegeometry:pc,conebuffergeometry:qc,cylindergeometry:lb,cylinderbuffergeometry:ta,circlegeometry:rc,circlebuffergeometry:zb,boxgeometry:eb,boxbuffergeometry:fb}); $b.prototype=object.create(p.prototype);$b.prototype.constructor=$b;$b.prototype.isshadowmaterial=!0;ac.prototype=object.create(ya.prototype);ac.prototype.constructor=ac;ac.prototype.israwshadermaterial=!0;na.prototype=object.create(p.prototype);na.prototype.constructor=na;na.prototype.ismeshstandardmaterial=!0;na.prototype.copy=function(a){p.prototype.copy.call(this,a);this.defines={standard:""};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightmap= a.lightmap;this.lightmapintensity=a.lightmapintensity;this.aomap=a.aomap;this.aomapintensity=a.aomapintensity;this.emissive.copy(a.emissive);this.emissivemap=a.emissivemap;this.emissiveintensity=a.emissiveintensity;this.bumpmap=a.bumpmap;this.bumpscale=a.bumpscale;this.normalmap=a.normalmap;this.normalscale.copy(a.normalscale);this.displacementmap=a.displacementmap;this.displacementscale=a.displacementscale;this.displacementbias=a.displacementbias;this.roughnessmap=a.roughnessmap;this.metalnessmap= a.metalnessmap;this.alphamap=a.alphamap;this.envmap=a.envmap;this.envmapintensity=a.envmapintensity;this.refractionratio=a.refractionratio;this.wireframe=a.wireframe;this.wireframelinewidth=a.wireframelinewidth;this.wireframelinecap=a.wireframelinecap;this.wireframelinejoin=a.wireframelinejoin;this.skinning=a.skinning;this.morphtargets=a.morphtargets;this.morphnormals=a.morphnormals;return this};mb.prototype=object.create(na.prototype);mb.prototype.constructor=mb;mb.prototype.ismeshphysicalmaterial= !0;mb.prototype.copy=function(a){na.prototype.copy.call(this,a);this.defines={physical:""};this.reflectivity=a.reflectivity;this.clearcoat=a.clearcoat;this.clearcoatroughness=a.clearcoatroughness;return this};aa.prototype=object.create(p.prototype);aa.prototype.constructor=aa;aa.prototype.ismeshphongmaterial=!0;aa.prototype.copy=function(a){p.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.lightmap=a.lightmap;this.lightmapintensity= a.lightmapintensity;this.aomap=a.aomap;this.aomapintensity=a.aomapintensity;this.emissive.copy(a.emissive);this.emissivemap=a.emissivemap;this.emissiveintensity=a.emissiveintensity;this.bumpmap=a.bumpmap;this.bumpscale=a.bumpscale;this.normalmap=a.normalmap;this.normalscale.copy(a.normalscale);this.displacementmap=a.displacementmap;this.displacementscale=a.displacementscale;this.displacementbias=a.displacementbias;this.specularmap=a.specularmap;this.alphamap=a.alphamap;this.envmap=a.envmap;this.combine= a.combine;this.reflectivity=a.reflectivity;this.refractionratio=a.refractionratio;this.wireframe=a.wireframe;this.wireframelinewidth=a.wireframelinewidth;this.wireframelinecap=a.wireframelinecap;this.wireframelinejoin=a.wireframelinejoin;this.skinning=a.skinning;this.morphtargets=a.morphtargets;this.morphnormals=a.morphnormals;return this};nb.prototype=object.create(aa.prototype);nb.prototype.constructor=nb;nb.prototype.ismeshtoonmaterial=!0;nb.prototype.copy=function(a){aa.prototype.copy.call(this, a);this.gradientmap=a.gradientmap;return this};ob.prototype=object.create(p.prototype);ob.prototype.constructor=ob;ob.prototype.ismeshnormalmaterial=!0;ob.prototype.copy=function(a){p.prototype.copy.call(this,a);this.bumpmap=a.bumpmap;this.bumpscale=a.bumpscale;this.normalmap=a.normalmap;this.normalscale.copy(a.normalscale);this.displacementmap=a.displacementmap;this.displacementscale=a.displacementscale;this.displacementbias=a.displacementbias;this.wireframe=a.wireframe;this.wireframelinewidth=a.wireframelinewidth; this.skinning=a.skinning;this.morphtargets=a.morphtargets;this.morphnormals=a.morphnormals;return this};pb.prototype=object.create(p.prototype);pb.prototype.constructor=pb;pb.prototype.ismeshlambertmaterial=!0;pb.prototype.copy=function(a){p.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightmap=a.lightmap;this.lightmapintensity=a.lightmapintensity;this.aomap=a.aomap;this.aomapintensity=a.aomapintensity;this.emissive.copy(a.emissive);this.emissivemap=a.emissivemap;this.emissiveintensity= a.emissiveintensity;this.specularmap=a.specularmap;this.alphamap=a.alphamap;this.envmap=a.envmap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionratio=a.refractionratio;this.wireframe=a.wireframe;this.wireframelinewidth=a.wireframelinewidth;this.wireframelinecap=a.wireframelinecap;this.wireframelinejoin=a.wireframelinejoin;this.skinning=a.skinning;this.morphtargets=a.morphtargets;this.morphnormals=a.morphnormals;return this};qb.prototype=object.create(w.prototype);qb.prototype.constructor= qb;qb.prototype.islinedashedmaterial=!0;qb.prototype.copy=function(a){w.prototype.copy.call(this,a);this.scale=a.scale;this.dashsize=a.dashsize;this.gapsize=a.gapsize;return this};var sg=object.freeze({shadowmaterial:$b,spritematerial:za,rawshadermaterial:ac,shadermaterial:ya,pointsmaterial:ma,meshphysicalmaterial:mb,meshstandardmaterial:na,meshphongmaterial:aa,meshtoonmaterial:nb,meshnormalmaterial:ob,meshlambertmaterial:pb,meshdepthmaterial:wa,meshdistancematerial:xa,meshbasicmaterial:sa,linedashedmaterial:qb, linebasicmaterial:w,material:p}),hd={enabled:!1,files:{},add:function(a,b){!1!==this.enabled&&(this.files[a]=b)},get:function(a){if(!1!==this.enabled)return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}},oa=new $d;object.assign(ia.prototype,{load:function(a,b,c,d){void 0===a&&(a="");void 0!==this.path&&(a=this.path+a);var e=this,f=hd.get(a);if(void 0!==f)return e.manager.itemstart(a),settimeout(function(){b&&b(f);e.manager.itemend(a)},0),f;var g=a.match(/^data:(.*?)(;base64)?,(.*)$/); if(g){var h=g[1],k=!!g[2],g=g[3],g=window.decodeuricomponent(g);k&&(g=window.atob(g));try{var l=(this.responsetype||"").tolowercase();switch(l){case "arraybuffer":case "blob":var m=new arraybuffer(g.length);for(var p=new uint8array(m),k=0;k=e)break a;else{f=b[1];a=e)break b}d=c;c=0}}for(;c>>1,ab;)--f;++f;if(0!==e||f!==d)e>=f&&(f=math.max(f,1),e=f-1),a=this.getvaluesize(),this.times=ea.arrayslice(c,e,f),this.values=ea.arrayslice(this.values,e*a,f*a);return this},validate:function(){var a=!0,b=this.getvaluesize();0!==b-math.floor(b)&&(console.error("three.keyframetrackprototype: invalid value size in track.",this),a=!1);var c=this.times,b=this.values,d=c.length;0===d&&(console.error("three.keyframetrackprototype: track is empty.", this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if("number"===typeof g&&isnan(g)){console.error("three.keyframetrackprototype: time is not a valid number.",this,f,g);a=!1;break}if(null!==e&&e>g){console.error("three.keyframetrackprototype: out of order keys.",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&ea.istypedarray(b))for(f=0,c=b.length;f!==c;++f)if(d=b[f],isnan(d)){console.error("three.keyframetrackprototype: value is not a valid number.",this,f,d);a=!1;break}return a},optimize:function(){for(var a, b,c=this.times,d=this.values,e=this.getvaluesize(),f=2302===this.getinterpolation(),g=1,h=c.length-1,k=1;kl.opacity&&(l.transparent=!0);d.settextures(k);return d.parse(l)}}()});object.assign(de.prototype,{load:function(a,b,c,d){var e=this,f=this.texturepath&&"string"===typeof this.texturepath?this.texturepath:dc.prototype.extracturlbase(a),g=new ia(this.manager);g.setwithcredentials(this.withcredentials); g.load(a,function(c){c=json.parse(c);var d=c.metadata;if(void 0!==d&&(d=d.type,void 0!==d)){if("object"===d.tolowercase()){console.error("three.jsonloader: "+a+" should be loaded with three.objectloader instead.");return}if("scene"===d.tolowercase()){console.error("three.jsonloader: "+a+" should be loaded with three.sceneloader instead.");return}}c=e.parse(c,f);b(c.geometry,c.materials)},c,d)},settexturepath:function(a){this.texturepath=a},parse:function(){return function(a,b){void 0!==a.data&&(a= a.data);a.scale=void 0!==a.scale?1/a.scale:1;var c=new q,d=a,e,f,g,h=d.faces;var k=d.vertices;var l=d.normals,m=d.colors;var p=d.scale;var t=0;if(void 0!==d.uvs){for(e=0;ef;f++){var b=h[r++];var h=z[2*b];b=z[2*b+1];h=new d(h,b);2!==f&&c.facevertexuvs[e][u].push(h);0!==f&&c.facevertexuvs[e][u+1].push(h)}}x&&(x=3*h[r++],v.normal.set(l[x++],l[x++],l[x]),w.normal.copy(v.normal));if(y)for(e=0;4>e;e++)x=3*h[r++],y=new n(l[x++],l[x++],l[x]),2!==e&&v.vertexnormals.push(y),0!== e&&w.vertexnormals.push(y);p&&(p=h[r++],p=m[p],v.color.sethex(p),w.color.sethex(p));if(k)for(e=0;4>e;e++)p=h[r++],p=m[p],2!==e&&v.vertexcolors.push(new c(p)),0!==e&&w.vertexcolors.push(new c(p));c.faces.push(v);c.faces.push(w)}else{v=new qa;v.a=h[r++];v.b=h[r++];v.c=h[r++];u&&(u=h[r++],v.materialindex=u);u=c.faces.length;if(e)for(e=0;ef;f++)b=h[r++],h=z[2*b],b=z[2*b+1],h=new d(h,b),c.facevertexuvs[e][u].push(h);x&&(x=3*h[r++],v.normal.set(l[x++], l[x++],l[x]));if(y)for(e=0;3>e;e++)x=3*h[r++],y=new n(l[x++],l[x++],l[x]),v.vertexnormals.push(y);p&&(p=h[r++],v.color.sethex(m[p]));if(k)for(e=0;3>e;e++)p=h[r++],v.vertexcolors.push(new c(m[p]));c.faces.push(v)}}d=a;r=void 0!==d.influencespervertex?d.influencespervertex:2;if(d.skinweights)for(g=0,h=d.skinweights.length;gg)e=a+1;else if(0b&&(b=0);1number.epsilon&&(g.normalize(),c=math.acos(r.clamp(d[k- 1].dot(d[k]),-1,1)),e[k].applymatrix4(h.makerotationaxis(g,c))),f[k].crossvectors(d[k],e[k]);if(!0===b)for(c=math.acos(r.clamp(e[0].dot(e[a]),-1,1)),c/=a,0=b)return b=c[a]-b,a=this.curves[a],c=a.getlength(),a.getpointat(0===c?0:1-b/c);a++}return null},getlength:function(){var a=this.getcurvelengths();return a[a.length-1]},updatearclengths:function(){this.needsupdate=!0;this.cachelengths=null;this.getcurvelengths()},getcurvelengths:function(){if(this.cachelengths&&this.cachelengths.length===this.curves.length)return this.cachelengths;for(var a=[],b=0,c=0,d=this.curves.length;cc;)c+=b;for(;c>b;)c-=b;cb.length-2?b.length-1:a+1],b=b[a>b.length-3?b.length-1:a+2];return new d(te(c,d.x,e.x,f.x,b.x),te(c,d.y,e.y,f.y,b.y))};ec.prototype=object.create(pa.prototype);ec.prototype.constructor=ec;ec.prototype.getpoint=function(a){var b=this.v0,c=this.v1,d=this.v2,e=this.v3;return new d(vb(a,b.x,c.x,d.x,e.x),vb(a,b.y,c.y,d.y,e.y))};fc.prototype=object.create(pa.prototype);fc.prototype.constructor=fc;fc.prototype.getpoint= function(a){var b=this.v0,c=this.v1,d=this.v2;return new d(ub(a,b.x,c.x,d.x),ub(a,b.y,c.y,d.y))};var ue=object.assign(object.create(vc.prototype),{frompoints:function(a){this.moveto(a[0].x,a[0].y);for(var b=1,c=a.length;bnumber.epsilon){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<= a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=fa.isclockwise,f=this.subpaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new xb;h.curves=g.curves;b.push(h);return b}var k=!e(f[0].getpoints()),k=a?!k:k;h=[];var l=[],m=[],p=0;l[p]=void 0;m[p]=[];for(var n=0,r=f.length;nd&&this._mixbufferregion(c,a,3*b,1-d,b);for(var d=b,f=b+b;d!==f;++d)if(c[d]!==c[d+b]){e.setvalue(c,a);break}},saveoriginalstate:function(){var a=this.buffer,b=this.valuesize,c=3*b;this.binding.getvalue(a,c);for(var d=b;d!==c;++d)a[d]=a[c+d%b];this.cumulativeweight=0},restoreoriginalstate:function(){this.binding.setvalue(this.buffer,3*this.valuesize)},_select:function(a,b,c,d,e){if(.5<=d)for(d=0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d){ia.slerpflat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d, e){for(var f=1-d,g=0;g!==e;++g){var h=b+g;a[h]=a[h]*f+a[c+g]*d}}});object.assign(we.prototype,{getvalue:function(a,b){this.bind();var c=this._bindings[this._targetgroup.ncachedobjects_];void 0!==c&&c.getvalue(a,b)},setvalue:function(a,b){for(var c=this._bindings,d=this._targetgroup.ncachedobjects_,e=c.length;d!==e;++d)c[d].setvalue(a,b)},bind:function(){for(var a=this._bindings,b=this._targetgroup.ncachedobjects_,c=a.length;b!==c;++b)a[b].bind()},unbind:function(){for(var a=this._bindings,b=this._targetgroup.ncachedobjects_, c=a.length;b!==c;++b)a[b].unbind()}});object.assign(da,{composite:we,create:function(a,b,c){return a&&a.isanimationobjectgroup?new da.composite(a,b,c):new da(a,b,c)},sanitizenodename:function(a){return a.replace(/\s/g,"_").replace(/[^\w-]/g,"")},parsetrackname:function(){var a=new regexp("^"+/((?:[\w-]+[\/:])*)/.source+/([\w-\.]+)?/.source+/(?:\.([\w-]+)(?:\[(.+)\])?)?/.source+/\.([\w-]+)(?:\[(.+)\])?/.source+"$"),b=["material","materials","bones"];return function(c){var d=a.exec(c);if(!d)throw error("propertybinding: cannot parse trackname: "+ c);var d={nodename:d[2],objectname:d[3],objectindex:d[4],propertyname:d[5],propertyindex:d[6]},e=d.nodename&&d.nodename.lastindexof(".");if(void 0!==e&&-1!==e){var f=d.nodename.substring(e+1);-1!==b.indexof(f)&&(d.nodename=d.nodename.substring(0,e),d.objectname=f)}if(null===d.propertyname||0===d.propertyname.length)throw error("propertybinding: can not parse propertyname from trackname: "+c);return d}}(),findnode:function(a,b){if(!b||""===b||"root"===b||"."===b||-1===b||b===a.name||b===a.uuid)return a; if(a.skeleton){var c=function(a){for(var c=0;c=c){var p=c++,n=b[p];d[n.uuid]=m;b[m]=n;d[l]=p;b[p]=k;k=0;for(l=f;k!==l;++k){var n=e[k],r=n[m];n[m]=n[p];n[p]=r}}}this.ncachedobjects_=c},uncache:function(a){for(var b,c,d=this._objects,e=d.length,f=this.ncachedobjects_,g=this._indicesbyuuid,h=this._bindings,k=h.length,l=0,m=arguments.length;l!==m;++l){c=arguments[l].uuid;var p= g[c];if(void 0!==p)if(delete g[c],pb||0===c)return;this._starttime=null;b*=c}b*=this._updatetimescale(a);c=this._updatetime(b);a=this._updateweight(a);if(0c.parameterpositions[1]&&(this.stopfading(),0===d&&(this.enabled=!1))}}return this._effectiveweight=b},_updatetimescale:function(a){var b=0;if(!this.paused){var b=this.timescale,c=this._timescaleinterpolant;if(null!==c){var d=c.evaluate(a)[0],b=b*d;a>c.parameterpositions[1]&&(this.stopwarping(),0===b?this.paused=!0:this.timescale=b)}}return this._effectivetimescale=b},_updatetime:function(a){var b=this.time+a;if(0===a)return b;var c=this._clip.duration,d=this.loop,e=this._loopcount;if(2200=== d)a:{if(-1===e&&(this._loopcount=0,this._setendings(!0,!0,!1)),b>=c)b=c;else if(0>b)b=0;else break a;this.clampwhenfinished?this.paused=!0:this.enabled=!1;this._mixer.dispatchevent({type:"finished",action:this,direction:0>a?-1:1})}else{d=2202===d;-1===e&&(0<=a?(e=0,this._setendings(!0,0===this.repetitions,d)):this._setendings(0===this.repetitions,!0,d));if(b>=c||0>b){var f=math.floor(b/c),b=b-c*f,e=e+math.abs(f),g=this.repetitions-e;0>g?(this.clampwhenfinished?this.paused=!0:this.enabled=!1,b=0a,this._setendings(a,!a,d)):this._setendings(!1,!1,d),this._loopcount=e,this._mixer.dispatchevent({type:"loop",action:this,loopdelta:f}))}if(d&&1===(e&1))return this.time=b,c-b}return this.time=b},_setendings:function(a,b,c){var d=this._interpolantsettings;c?(d.endingstart=2401,d.endingend=2401):(d.endingstart=a?this.zeroslopeatstart?2401:2400:2402,d.endingend=b?this.zeroslopeatend?2401:2400:2402)},_schedulefading:function(a, b,c){var d=this._mixer,e=d.time,f=this._weightinterpolant;null===f&&(this._weightinterpolant=f=d._lendcontrolinterpolant());d=f.parameterpositions;f=f.samplevalues;d[0]=e;f[0]=b;d[1]=e+a;f[1]=c;return this}});object.assign(ze.prototype,na.prototype,{_bindaction:function(a,b){var c=a._localroot||this._root,d=a._clip.tracks,e=d.length,f=a._propertybindings;a=a._interpolants;var g=c.uuid,h=this._bindingsbyrootandname,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var l=d[h],m=l.name,n=k[m];if(void 0=== n){n=f[h];if(void 0!==n){null===n._cacheindex&&(++n.referencecount,this._addinactivebinding(n,g,m));continue}n=new le(da.create(c,m,b&&b._propertybindings[h].binding.parsedpath),l.valuetypename,l.getvaluesize());++n.referencecount;this._addinactivebinding(n,g,m)}f[h]=n;a[h].resultbuffer=n.buffer}},_activateaction:function(a){if(!this._isactiveaction(a)){if(null===a._cacheindex){var b=(a._localroot||this._root).uuid,c=a._clip.uuid,d=this._actionsbyclip[c];this._bindaction(a,d&&d.knownactions[0]);this._addinactiveaction(a, c,b)}b=a._propertybindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.usecount++&&(this._lendbinding(e),e.saveoriginalstate())}this._lendaction(a)}},_deactivateaction:function(a){if(this._isactiveaction(a)){for(var b=a._propertybindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.usecount&&(e.restoreoriginalstate(),this._takebackbinding(e))}this._takebackaction(a)}},_initmemorymanager:function(){this._actions=[];this._nactiveactions=0;this._actionsbyclip={};this._bindings=[];this._nactivebindings= 0;this._bindingsbyrootandname={};this._controlinterpolants=[];this._nactivecontrolinterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inuse(){return a._nactiveactions}},bindings:{get total(){return a._bindings.length},get inuse(){return a._nactivebindings}},controlinterpolants:{get total(){return a._controlinterpolants.length},get inuse(){return a._nactivecontrolinterpolants}}}},_isactiveaction:function(a){a=a._cacheindex;return null!==a&&amath.abs(a)&&(a=1e-8);this.scale.set(.5*this.size,.5*this.size,a);this.lookat(this.plane.normal); this.updatematrixworld()};var kd,re;zb.prototype=object.create(w.prototype);zb.prototype.constructor=zb;zb.prototype.setdirection=function(){var a=new n,b;return function(c){.99999c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=math.acos(c.y),this.quaternion.setfromaxisangle(a,b))}}();zb.prototype.setlength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,math.max(0,a-b),1);this.line.updatematrix();this.cone.scale.set(c, b,c);this.cone.position.y=a;this.cone.updatematrix()};zb.prototype.setcolor=function(a){this.line.material.color.copy(a);this.cone.material.color.copy(a)};ld.prototype=object.create(x.prototype);ld.prototype.constructor=ld;var od=new n,ve=new se,we=new se,xe=new se;ja.prototype=object.create(pa.prototype);ja.prototype.constructor=ja;ja.prototype.getpoint=function(a){var b=this.points,c=b.length;a*=c-(this.closed?0:1);var d=math.floor(a);a-=d;this.closed?d+=0d&&(d=1);1e-4>c&&(c=d);1e-4>h&&(h=d);ve.initnonuniformcatmullrom(e.x, f.x,g.x,b.x,c,d,h);we.initnonuniformcatmullrom(e.y,f.y,g.y,b.y,c,d,h);xe.initnonuniformcatmullrom(e.z,f.z,g.z,b.z,c,d,h)}else"catmullrom"===this.type&&(c=void 0!==this.tension?this.tension:.5,ve.initcatmullrom(e.x,f.x,g.x,b.x,c),we.initcatmullrom(e.y,f.y,g.y,b.y,c),xe.initcatmullrom(e.z,f.z,g.z,b.z,c));return new n(ve.calc(a),we.calc(a),xe.calc(a))};ed.prototype=object.create(pa.prototype);ed.prototype.constructor=ed;ed.prototype.getpoint=function(a){var b=this.v0,c=this.v1,d=this.v2,e=this.v3;return new n(vb(a, b.x,c.x,d.x,e.x),vb(a,b.y,c.y,d.y,e.y),vb(a,b.z,c.z,d.z,e.z))};fd.prototype=object.create(pa.prototype);fd.prototype.constructor=fd;fd.prototype.getpoint=function(a){var b=this.v0,c=this.v1,d=this.v2;return new n(ub(a,b.x,c.x,d.x),ub(a,b.y,c.y,d.y),ub(a,b.z,c.z,d.z))};gd.prototype=object.create(pa.prototype);gd.prototype.constructor=gd;gd.prototype.getpoint=function(a){if(1===a)return this.v2.clone();var b=new n;b.subvectors(this.v2,this.v1);b.multiplyscalar(a);b.add(this.v1);return b};md.prototype= object.create(ua.prototype);md.prototype.constructor=md;pa.create=function(a,b){console.log("three.curve.create() has been deprecated");a.prototype=object.create(pa.prototype);a.prototype.constructor=a;a.prototype.getpoint=b;return a};ff.prototype=object.create(ja.prototype);gf.prototype=object.create(ja.prototype);te.prototype=object.create(ja.prototype);object.assign(te.prototype,{initfromarray:function(a){console.error("three.spline: .initfromarray() has been removed.")},getcontrolpointsarray:function(a){console.error("three.spline: .getcontrolpointsarray() has been removed.")}, reparametrizebyarclength:function(a){console.error("three.spline: .reparametrizebyarclength() has been removed.")}});$c.prototype.setcolors=function(){console.error("three.gridhelper: setcolors() has been deprecated, pass them in the constructor instead.")};jc.prototype.update=function(){console.error("three.skeletonhelper: update() no longer needs to be called.")};object.assign(id.prototype,{center:function(a){console.warn("three.box2: .center() has been renamed to .getcenter().");return this.getcenter(a)}, empty:function(){console.warn("three.box2: .empty() has been renamed to .isempty().");return this.isempty()},isintersectionbox:function(a){console.warn("three.box2: .isintersectionbox() has been renamed to .intersectsbox().");return this.intersectsbox(a)},size:function(a){console.warn("three.box2: .size() has been renamed to .getsize().");return this.getsize(a)}});object.assign(pa.prototype,{center:function(a){console.warn("three.box3: .center() has been renamed to .getcenter().");return this.getcenter(a)}, empty:function(){console.warn("three.box3: .empty() has been renamed to .isempty().");return this.isempty()},isintersectionbox:function(a){console.warn("three.box3: .isintersectionbox() has been renamed to .intersectsbox().");return this.intersectsbox(a)},isintersectionsphere:function(a){console.warn("three.box3: .isintersectionsphere() has been renamed to .intersectssphere().");return this.intersectssphere(a)},size:function(a){console.warn("three.box3: .size() has been renamed to .getsize().");return this.getsize(a)}}); fb.prototype.center=function(a){console.warn("three.line3: .center() has been renamed to .getcenter().");return this.getcenter(a)};r.random16=function(){console.warn("three.math.random16() has been deprecated. use math.random() instead.");return math.random()};object.assign(qa.prototype,{flattentoarrayoffset:function(a,b){console.warn("three.matrix3: .flattentoarrayoffset() has been deprecated. use .toarray() instead.");return this.toarray(a,b)},multiplyvector3:function(a){console.warn("three.matrix3: .multiplyvector3() has been removed. use vector.applymatrix3( matrix ) instead."); return a.applymatrix3(this)},multiplyvector3array:function(a){console.error("three.matrix3: .multiplyvector3array() has been removed.")},applytobuffer:function(a,b,c){console.warn("three.matrix3: .applytobuffer() has been removed. use matrix.applytobufferattribute( attribute ) instead.");return this.applytobufferattribute(a)},applytovector3array:function(a,b,c){console.error("three.matrix3: .applytovector3array() has been removed.")}});object.assign(o.prototype,{extractposition:function(a){console.warn("three.matrix4: .extractposition() has been renamed to .copyposition()."); return this.copyposition(a)},flattentoarrayoffset:function(a,b){console.warn("three.matrix4: .flattentoarrayoffset() has been deprecated. use .toarray() instead.");return this.toarray(a,b)},getposition:function(){var a;return function(){void 0===a&&(a=new n);console.warn("three.matrix4: .getposition() has been removed. use vector3.setfrommatrixposition( matrix ) instead.");return a.setfrommatrixcolumn(this,3)}}(),setrotationfromquaternion:function(a){console.warn("three.matrix4: .setrotationfromquaternion() has been renamed to .makerotationfromquaternion()."); return this.makerotationfromquaternion(a)},multiplytoarray:function(){console.warn("three.matrix4: .multiplytoarray() has been removed.")},multiplyvector3:function(a){console.warn("three.matrix4: .multiplyvector3() has been removed. use vector.applymatrix4( matrix ) instead.");return a.applymatrix4(this)},multiplyvector4:function(a){console.warn("three.matrix4: .multiplyvector4() has been removed. use vector.applymatrix4( matrix ) instead.");return a.applymatrix4(this)},multiplyvector3array:function(a){console.error("three.matrix4: .multiplyvector3array() has been removed.")}, 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.");return a.applymatrix4(this)},translate:function(){console.error("three.matrix4: .translate() has been removed.")},rotatex:function(){console.error("three.matrix4: .rotatex() has been removed.")},rotatey:function(){console.error("three.matrix4: .rotatey() has been removed.")}, rotatez:function(){console.error("three.matrix4: .rotatez() has been removed.")},rotatebyaxis:function(){console.error("three.matrix4: .rotatebyaxis() has been removed.")},applytobuffer:function(a,b,c){console.warn("three.matrix4: .applytobuffer() has been removed. use matrix.applytobufferattribute( attribute ) instead.");return this.applytobufferattribute(a)},applytovector3array:function(a,b,c){console.error("three.matrix4: .applytovector3array() has been removed.")},makefrustum:function(a,b,c,d, e,f){console.warn("three.matrix4: .makefrustum() has been removed. use .makeperspective( left, right, top, bottom, near, far ) instead.");return this.makeperspective(a,b,d,c,e,f)}});za.prototype.isintersectionline=function(a){console.warn("three.plane: .isintersectionline() has been renamed to .intersectsline().");return this.intersectsline(a)};ia.prototype.multiplyvector3=function(a){console.warn("three.quaternion: .multiplyvector3() has been removed. use is now vector.applyquaternion( quaternion ) instead."); return a.applyquaternion(this)};object.assign(hb.prototype,{isintersectionbox:function(a){console.warn("three.ray: .isintersectionbox() has been renamed to .intersectsbox().");return this.intersectsbox(a)},isintersectionplane:function(a){console.warn("three.ray: .isintersectionplane() has been renamed to .intersectsplane().");return this.intersectsplane(a)},isintersectionsphere:function(a){console.warn("three.ray: .isintersectionsphere() has been renamed to .intersectssphere().");return this.intersectssphere(a)}}); object.assign(xb.prototype,{extrude:function(a){console.warn("three.shape: .extrude() has been removed. use extrudegeometry() instead.");return new $a(this,a)},makegeometry:function(a){console.warn("three.shape: .makegeometry() has been removed. use shapegeometry() instead.");return new wb(this,a)}});object.assign(d.prototype,{fromattribute:function(a,b,c){console.error("three.vector2: .fromattribute() has been renamed to .frombufferattribute().");return this.frombufferattribute(a,b,c)}});object.assign(n.prototype, {seteulerfromrotationmatrix:function(){console.error("three.vector3: .seteulerfromrotationmatrix() has been removed. use euler.setfromrotationmatrix() instead.")},seteulerfromquaternion:function(){console.error("three.vector3: .seteulerfromquaternion() has been removed. use euler.setfromquaternion() instead.")},getpositionfrommatrix:function(a){console.warn("three.vector3: .getpositionfrommatrix() has been renamed to .setfrommatrixposition().");return this.setfrommatrixposition(a)},getscalefrommatrix:function(a){console.warn("three.vector3: .getscalefrommatrix() has been renamed to .setfrommatrixscale()."); return this.setfrommatrixscale(a)},getcolumnfrommatrix:function(a,b){console.warn("three.vector3: .getcolumnfrommatrix() has been renamed to .setfrommatrixcolumn().");return this.setfrommatrixcolumn(b,a)},applyprojection:function(a){console.warn("three.vector3: .applyprojection() has been removed. use .applymatrix4( m ) instead.");return this.applymatrix4(a)},fromattribute:function(a,b,c){console.error("three.vector3: .fromattribute() has been renamed to .frombufferattribute().");return this.frombufferattribute(a, b,c)}});object.assign(s.prototype,{fromattribute:function(a,b,c){console.error("three.vector4: .fromattribute() has been renamed to .frombufferattribute().");return this.frombufferattribute(a,b,c)}});q.prototype.computetangents=function(){console.warn("three.geometry: .computetangents() has been removed.")};object.assign(w.prototype,{getchildbyname:function(a){console.warn("three.object3d: .getchildbyname() has been renamed to .getobjectbyname().");return this.getobjectbyname(a)},renderdepth:function(){console.warn("three.object3d: .renderdepth has been removed. use .renderorder, instead.")}, translate:function(a,b){console.warn("three.object3d: .translate() has been removed. use .translateonaxis( axis, distance ) instead.");return this.translateonaxis(b,a)}});object.defineproperties(w.prototype,{eulerorder:{get:function(){console.warn("three.object3d: .eulerorder is now .rotation.order.");return this.rotation.order},set:function(a){console.warn("three.object3d: .eulerorder is now .rotation.order.");this.rotation.order=a}},usequaternion:{get:function(){console.warn("three.object3d: .usequaternion has been removed. the library now uses quaternions by default.")}, set:function(){console.warn("three.object3d: .usequaternion has been removed. the library now uses quaternions by default.")}}});object.defineproperties(yc.prototype,{objects:{get:function(){console.warn("three.lod: .objects has been renamed to .levels.");return this.levels}}});object.defineproperty(zc.prototype,"usevertextexture",{get:function(){console.warn("three.skeleton: usevertextexture has been removed.")},set:function(){console.warn("three.skeleton: usevertextexture has been removed.")}}); object.defineproperty(pa.prototype,"__arclengthdivisions",{get:function(){console.warn("three.curve: .__arclengthdivisions is now .arclengthdivisions.");return this.arclengthdivisions},set:function(a){console.warn("three.curve: .__arclengthdivisions is now .arclengthdivisions.");this.arclengthdivisions=a}});ja.prototype.setlens=function(a,b){console.warn("three.perspectivecamera.setlens is deprecated. use .setfocallength and .filmgauge for a photographic setup.");void 0!==b&&(this.filmgauge=b);this.setfocallength(a)}; object.defineproperties(aa.prototype,{onlyshadow:{set:function(){console.warn("three.light: .onlyshadow has been removed.")}},shadowcamerafov:{set:function(a){console.warn("three.light: .shadowcamerafov is now .shadow.camera.fov.");this.shadow.camera.fov=a}},shadowcameraleft:{set:function(a){console.warn("three.light: .shadowcameraleft is now .shadow.camera.left.");this.shadow.camera.left=a}},shadowcameraright:{set:function(a){console.warn("three.light: .shadowcameraright is now .shadow.camera.right."); this.shadow.camera.right=a}},shadowcameratop:{set:function(a){console.warn("three.light: .shadowcameratop is now .shadow.camera.top.");this.shadow.camera.top=a}},shadowcamerabottom:{set:function(a){console.warn("three.light: .shadowcamerabottom is now .shadow.camera.bottom.");this.shadow.camera.bottom=a}},shadowcameranear:{set:function(a){console.warn("three.light: .shadowcameranear is now .shadow.camera.near.");this.shadow.camera.near=a}},shadowcamerafar:{set:function(a){console.warn("three.light: .shadowcamerafar is now .shadow.camera.far."); this.shadow.camera.far=a}},shadowcameravisible:{set:function(){console.warn("three.light: .shadowcameravisible has been removed. use new three.camerahelper( light.shadow.camera ) instead.")}},shadowbias:{set:function(a){console.warn("three.light: .shadowbias is now .shadow.bias.");this.shadow.bias=a}},shadowdarkness:{set:function(){console.warn("three.light: .shadowdarkness has been removed.")}},shadowmapwidth:{set:function(a){console.warn("three.light: .shadowmapwidth is now .shadow.mapsize.width."); this.shadow.mapsize.width=a}},shadowmapheight:{set:function(a){console.warn("three.light: .shadowmapheight is now .shadow.mapsize.height.");this.shadow.mapsize.height=a}}});object.defineproperties(k.prototype,{length:{get:function(){console.warn("three.bufferattribute: .length has been deprecated. use .count instead.");return this.array.length}}});object.assign(f.prototype,{addindex:function(a){console.warn("three.buffergeometry: .addindex() has been renamed to .setindex().");this.setindex(a)},adddrawcall:function(a, b,c){void 0!==c&&console.warn("three.buffergeometry: .adddrawcall() no longer supports indexoffset.");console.warn("three.buffergeometry: .adddrawcall() is now .addgroup().");this.addgroup(a,b)},cleardrawcalls:function(){console.warn("three.buffergeometry: .cleardrawcalls() is now .cleargroups().");this.cleargroups()},computetangents:function(){console.warn("three.buffergeometry: .computetangents() has been removed.")},computeoffsets:function(){console.warn("three.buffergeometry: .computeoffsets() has been removed.")}}); object.defineproperties(f.prototype,{drawcalls:{get:function(){console.error("three.buffergeometry: .drawcalls has been renamed to .groups.");return this.groups}},offsets:{get:function(){console.warn("three.buffergeometry: .offsets has been renamed to .groups.");return this.groups}}});object.defineproperties(id.prototype,{dynamic:{set:function(){console.warn("three.uniform: .dynamic has been removed. use object.onbeforerender() instead.")}},onupdate:{value:function(){console.warn("three.uniform: .onupdate() has been removed. use object.onbeforerender() instead."); return this}}});object.defineproperties(p.prototype,{wraparound:{get:function(){console.warn("three.material: .wraparound has been removed.")},set:function(){console.warn("three.material: .wraparound has been removed.")}},wraprgb:{get:function(){console.warn("three.material: .wraprgb has been removed.");return new c}},shading:{get:function(){console.error("three."+this.type+": .shading has been removed. use the boolean .flatshading instead.")},set:function(a){console.warn("three."+this.type+": .shading has been removed. use the boolean .flatshading instead."); this.flatshading=1===a}}});object.defineproperties(aa.prototype,{metal:{get:function(){console.warn("three.meshphongmaterial: .metal has been removed. use three.meshstandardmaterial instead.");return!1},set:function(){console.warn("three.meshphongmaterial: .metal has been removed. use three.meshstandardmaterial instead")}}});object.defineproperties(ya.prototype,{derivatives:{get:function(){console.warn("three.shadermaterial: .derivatives has been moved to .extensions.derivatives.");return this.extensions.derivatives}, set:function(a){console.warn("three. shadermaterial: .derivatives has been moved to .extensions.derivatives.");this.extensions.derivatives=a}}});object.assign(yd.prototype,{getcurrentrendertarget:function(){console.warn("three.webglrenderer: .getcurrentrendertarget() is now .getrendertarget().");return this.getrendertarget()},getmaxanisotropy:function(){console.warn("three.webglrenderer: .getmaxanisotropy() is now .capabilities.getmaxanisotropy().");return this.capabilities.getmaxanisotropy()},getprecision:function(){console.warn("three.webglrenderer: .getprecision() is now .capabilities.precision."); return this.capabilities.precision},supportsfloattextures:function(){console.warn("three.webglrenderer: .supportsfloattextures() is now .extensions.get( 'oes_texture_float' ).");return this.extensions.get("oes_texture_float")},supportshalffloattextures:function(){console.warn("three.webglrenderer: .supportshalffloattextures() is now .extensions.get( 'oes_texture_half_float' ).");return this.extensions.get("oes_texture_half_float")},supportsstandardderivatives:function(){console.warn("three.webglrenderer: .supportsstandardderivatives() is now .extensions.get( 'oes_standard_derivatives' )."); return this.extensions.get("oes_standard_derivatives")},supportscompressedtextures3tc:function(){console.warn("three.webglrenderer: .supportscompressedtextures3tc() is now .extensions.get( 'webgl_compressed_texture_s3tc' ).");return this.extensions.get("webgl_compressed_texture_s3tc")},supportscompressedtexturepvrtc:function(){console.warn("three.webglrenderer: .supportscompressedtexturepvrtc() is now .extensions.get( 'webgl_compressed_texture_pvrtc' ).");return this.extensions.get("webgl_compressed_texture_pvrtc")}, supportsblendminmax:function(){console.warn("three.webglrenderer: .supportsblendminmax() is now .extensions.get( 'ext_blend_minmax' ).");return this.extensions.get("ext_blend_minmax")},supportsvertextextures:function(){console.warn("three.webglrenderer: .supportsvertextextures() is now .capabilities.vertextextures.");return this.capabilities.vertextextures},supportsinstancedarrays:function(){console.warn("three.webglrenderer: .supportsinstancedarrays() is now .extensions.get( 'angle_instanced_arrays' )."); return this.extensions.get("angle_instanced_arrays")},enablescissortest:function(a){console.warn("three.webglrenderer: .enablescissortest() is now .setscissortest().");this.setscissortest(a)},initmaterial:function(){console.warn("three.webglrenderer: .initmaterial() has been removed.")},addpreplugin:function(){console.warn("three.webglrenderer: .addpreplugin() has been removed.")},addpostplugin:function(){console.warn("three.webglrenderer: .addpostplugin() has been removed.")},updateshadowmap:function(){console.warn("three.webglrenderer: .updateshadowmap() has been removed.")}}); object.defineproperties(yd.prototype,{shadowmapenabled:{get:function(){return this.shadowmap.enabled},set:function(a){console.warn("three.webglrenderer: .shadowmapenabled is now .shadowmap.enabled.");this.shadowmap.enabled=a}},shadowmaptype:{get:function(){return this.shadowmap.type},set:function(a){console.warn("three.webglrenderer: .shadowmaptype is now .shadowmap.type.");this.shadowmap.type=a}},shadowmapcullface:{get:function(){return this.shadowmap.cullface},set:function(a){console.warn("three.webglrenderer: .shadowmapcullface is now .shadowmap.cullface."); this.shadowmap.cullface=a}}});object.defineproperties(ke.prototype,{cullface:{get:function(){return this.renderreversesided?2:1},set:function(a){a=1!==a;console.warn("webglrenderer: .shadowmap.cullface is deprecated. set .shadowmap.renderreversesided to "+a+".");this.renderreversesided=a}}});object.defineproperties(ab.prototype,{wraps:{get:function(){console.warn("three.webglrendertarget: .wraps is now .texture.wraps.");return this.texture.wraps},set:function(a){console.warn("three.webglrendertarget: .wraps is now .texture.wraps."); this.texture.wraps=a}},wrapt:{get:function(){console.warn("three.webglrendertarget: .wrapt is now .texture.wrapt.");return this.texture.wrapt},set:function(a){console.warn("three.webglrendertarget: .wrapt is now .texture.wrapt.");this.texture.wrapt=a}},magfilter:{get:function(){console.warn("three.webglrendertarget: .magfilter is now .texture.magfilter.");return this.texture.magfilter},set:function(a){console.warn("three.webglrendertarget: .magfilter is now .texture.magfilter.");this.texture.magfilter= a}},minfilter:{get:function(){console.warn("three.webglrendertarget: .minfilter is now .texture.minfilter.");return this.texture.minfilter},set:function(a){console.warn("three.webglrendertarget: .minfilter is now .texture.minfilter.");this.texture.minfilter=a}},anisotropy:{get:function(){console.warn("three.webglrendertarget: .anisotropy is now .texture.anisotropy.");return this.texture.anisotropy},set:function(a){console.warn("three.webglrendertarget: .anisotropy is now .texture.anisotropy.");this.texture.anisotropy= a}},offset:{get:function(){console.warn("three.webglrendertarget: .offset is now .texture.offset.");return this.texture.offset},set:function(a){console.warn("three.webglrendertarget: .offset is now .texture.offset.");this.texture.offset=a}},repeat:{get:function(){console.warn("three.webglrendertarget: .repeat is now .texture.repeat.");return this.texture.repeat},set:function(a){console.warn("three.webglrendertarget: .repeat is now .texture.repeat.");this.texture.repeat=a}},format:{get:function(){console.warn("three.webglrendertarget: .format is now .texture.format."); return this.texture.format},set:function(a){console.warn("three.webglrendertarget: .format is now .texture.format.");this.texture.format=a}},type:{get:function(){console.warn("three.webglrendertarget: .type is now .texture.type.");return this.texture.type},set:function(a){console.warn("three.webglrendertarget: .type is now .texture.type.");this.texture.type=a}},generatemipmaps:{get:function(){console.warn("three.webglrendertarget: .generatemipmaps is now .texture.generatemipmaps.");return this.texture.generatemipmaps}, set:function(a){console.warn("three.webglrendertarget: .generatemipmaps is now .texture.generatemipmaps.");this.texture.generatemipmaps=a}}});gc.prototype.load=function(a){console.warn("three.audio: .load has been deprecated. use three.audioloader instead.");var b=this;(new ge).load(a,function(a){b.setbuffer(a)});return this};ke.prototype.getdata=function(){console.warn("three.audioanalyser: .getdata() is now .getfrequencydata().");return this.getfrequencydata()};xc.prototype.updatecubemap=function(a, b){console.warn("three.cubecamera: .updatecubemap() is now .update().");return this.update(a,b)};m.webglrendertargetcube=bb;m.webglrendertarget=ab;m.webglrenderer=yd;m.shaderlib=ib;m.uniformslib=l;m.uniformsutils=da;m.shaderchunk=v;m.fogexp2=hb;m.fog=ib;m.scene=nd;m.lensflare=zd;m.sprite=xc;m.lod=yc;m.skinnedmesh=pd;m.skeleton=zc;m.bone=od;m.mesh=fa;m.linesegments=x;m.lineloop=qd;m.line=ra;m.points=jb;m.group=ac;m.videotexture=rd;m.datatexture=bb;m.compressedtexture=kb;m.cubetexture=va;m.canvastexture= oc;m.depthtexture=bc;m.texture=n;m.compressedtextureloader=re;m.datatextureloader=ae;m.cubetextureloader=be;m.textureloader=sd;m.objectloader=se;m.materialloader=hd;m.buffergeometryloader=ce;m.defaultloadingmanager=oa;m.loadingmanager=$d;m.jsonloader=de;m.imageloader=sc;m.fontloader=ue;m.fileloader=ia;m.loader=dc;m.cache=hd;m.audioloader=ge;m.spotlightshadow=ud;m.spotlight=vd;m.pointlight=wd;m.rectarealight=ad;m.hemispherelight=td;m.directionallightshadow=xd;m.directionallight=yd;m.ambientlight=zd; m.lightshadow=rb;m.light=aa;m.stereocamera=ve;m.perspectivecamera=ja;m.orthographiccamera=db;m.cubecamera=xc;m.arraycamera=md;m.camera=ma;m.audiolistener=he;m.positionalaudio=je;m.audiocontext=ie;m.audioanalyser=ke;m.audio=gc;m.vectorkeyframetrack=bc;m.stringkeyframetrack=ed;m.quaternionkeyframetrack=uc;m.numberkeyframetrack=cc;m.colorkeyframetrack=gd;m.booleankeyframetrack=fd;m.propertymixer=le;m.propertybinding=da;m.keyframetrack=tb;m.animationutils=ea;m.animationobjectgroup=xe;m.animationmixer= ze;m.animationclip=ba;m.uniform=id;m.instancedbuffergeometry=me;m.buffergeometry=f;m.geometryidcount=function(){return rd++};m.geometry=q;m.interleavedbufferattribute=ne;m.instancedinterleavedbuffer=oe;m.interleavedbuffer=hc;m.instancedbufferattribute=pe;m.face3=qa;m.object3d=w;m.raycaster=$e;m.layers=qd;m.eventdispatcher=na;m.clock=bf;m.quaternionlinearinterpolant=dd;m.linearinterpolant=tc;m.discreteinterpolant=cd;m.cubicinterpolant=bd;m.interpolant=wa;m.triangle=ra;m.math=r;m.spherical=cf;m.cylindrical= df;m.plane=za;m.frustum=kd;m.sphere=ca;m.ray=hb;m.matrix4=o;m.matrix3=qa;m.box3=pa;m.box2=id;m.line3=fb;m.euler=ya;m.vector4=s;m.vector3=n;m.vector2=d;m.quaternion=ia;m.color=c;m.immediaterenderobject=yc;m.vertexnormalshelper=zc;m.spotlighthelper=ic;m.skeletonhelper=jc;m.pointlighthelper=kc;m.rectarealighthelper=lc;m.hemispherelighthelper=mc;m.gridhelper=$c;m.polargridhelper=jd;m.facenormalshelper=ad;m.directionallighthelper=nc;m.camerahelper=bd;m.boxhelper=yb;m.box3helper=cd;m.planehelper=dd;m.arrowhelper= zb;m.axishelper=ld;m.catmullromcurve3=ja;m.cubicbeziercurve3=ed;m.quadraticbeziercurve3=fd;m.linecurve3=gd;m.arccurve=md;m.ellipsecurve=ua;m.splinecurve=wb;m.cubicbeziercurve=ec;m.quadraticbeziercurve=fc;m.linecurve=oa;m.shape=xb;m.path=wc;m.shapepath=ee;m.font=fe;m.curvepath=vc;m.curve=pa;m.shapeutils=fa;m.sceneutils={createmultimaterialobject:function(a,b){for(var c=new ac,d=0,e=b.length;d