|
@@ -254,7 +254,7 @@ default:return l.LINEAR}}function F(a){switch(a){case THREE.RepeatWrapping:retur
|
|
|
case THREE.ByteType:return l.BYTE;case THREE.UnsignedByteType:return l.UNSIGNED_BYTE;case THREE.ShortType:return l.SHORT;case THREE.UnsignedShortType:return l.UNSIGNED_SHORT;case THREE.IntType:return l.INT;case THREE.UnsignedShortType:return l.UNSIGNED_INT;case THREE.FloatType:return l.FLOAT;case THREE.AlphaFormat:return l.ALPHA;case THREE.RGBFormat:return l.RGB;case THREE.RGBAFormat:return l.RGBA;case THREE.LuminanceFormat:return l.LUMINANCE;case THREE.LuminanceAlphaFormat:return l.LUMINANCE_ALPHA}return 0}
|
|
|
var a=a||{},I=a.canvas!==void 0?a.canvas:document.createElement("canvas"),R=a.precision!==void 0?a.precision:"highp",x=a.antialias!==void 0?a.antialias:!1,A=a.stencil!==void 0?a.stencil:!0,K=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,X=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),T=a.clearAlpha!==void 0?a.clearAlpha:0,$=a.maxLights!==void 0?a.maxLights:4;this.domElement=I;this.context=null;this.autoUpdateScene=this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=
|
|
|
this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;this.maxMorphTargets=8;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,
|
|
|
-vertices:0,faces:0}};var V=this,l,M=[],J=null,L=null,v=-1,Y=null,aa=0,fa=null,ca=null,U=null,N=null,W=null,S=null,da=null,va=null,ea=null,na=0,la=0,sa=0,ia=0,Ba=0,wa=0,xa=new THREE.Frustum,ya=new THREE.Matrix4,za=new THREE.Vector4,Aa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}};l=function(){var a;try{if(!(a=I.getContext("experimental-webgl",{antialias:x,stencil:A,preserveDrawingBuffer:K})))throw"Error creating WebGL context.";
|
|
|
+vertices:0,faces:0,points:0}};var V=this,l,M=[],J=null,L=null,v=-1,Y=null,aa=0,fa=null,ca=null,U=null,N=null,W=null,S=null,da=null,va=null,ea=null,na=0,la=0,sa=0,ia=0,Ba=0,wa=0,xa=new THREE.Frustum,ya=new THREE.Matrix4,za=new THREE.Vector4,Aa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}};l=function(){var a;try{if(!(a=I.getContext("experimental-webgl",{antialias:x,stencil:A,preserveDrawingBuffer:K})))throw"Error creating WebGL context.";
|
|
|
console.log(navigator.userAgent+" | "+a.getParameter(a.VERSION)+" | "+a.getParameter(a.VENDOR)+" | "+a.getParameter(a.RENDERER)+" | "+a.getParameter(a.SHADING_LANGUAGE_VERSION))}catch(b){console.error(b)}return a}();l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.clearColor(X.r,X.g,X.b,T);this.context=
|
|
|
l;var qa=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;this.getContext=function(){return l};this.supportsVertexTextures=function(){return qa};this.setSize=function(a,b){I.width=a;I.height=b;this.setViewport(0,0,I.width,I.height)};this.setViewport=function(a,b,c,d){na=a;la=b;sa=c;ia=d;l.viewport(na,la,sa,ia)};this.setScissor=function(a,b,c,d){l.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.setClearColorHex=function(a,b){X.setHex(a);
|
|
|
T=b;l.clearColor(X.r,X.g,X.b,T)};this.setClearColor=function(a,b){X.copy(a);T=b;l.clearColor(X.r,X.g,X.b,T)};this.getClearColor=function(){return X};this.getClearAlpha=function(){return T};this.clear=function(a,b,c){var d=0;if(a===void 0||a)d|=l.COLOR_BUFFER_BIT;if(b===void 0||b)d|=l.DEPTH_BUFFER_BIT;if(c===void 0||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};
|
|
@@ -270,29 +270,29 @@ h[i[g]],g++}else{var i=[],k=-1,j=0;h=f.morphTargetInfluences;var m,n=h.length;g=
|
|
|
e.__webglTangentBuffer),l.vertexAttribPointer(b.tangent,4,l.FLOAT,!1,0,0));b.uv>=0&&(e.__webglUVBuffer?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUVBuffer),l.vertexAttribPointer(b.uv,2,l.FLOAT,!1,0,0),l.enableVertexAttribArray(b.uv)):l.disableVertexAttribArray(b.uv));b.uv2>=0&&(e.__webglUV2Buffer?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUV2Buffer),l.vertexAttribPointer(b.uv2,2,l.FLOAT,!1,0,0),l.enableVertexAttribArray(b.uv2)):l.disableVertexAttribArray(b.uv2));d.skinning&&b.skinVertexA>=0&&b.skinVertexB>=
|
|
|
0&&b.skinIndex>=0&&b.skinWeight>=0&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinVertexABuffer),l.vertexAttribPointer(b.skinVertexA,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinVertexBBuffer),l.vertexAttribPointer(b.skinVertexB,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),l.vertexAttribPointer(b.skinIndex,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(d.wireframe?
|
|
|
(d=d.wireframeLinewidth,d!==ea&&(l.lineWidth(d),ea=d),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),l.drawElements(l.LINES,e.__webglLineCount,l.UNSIGNED_SHORT,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),l.drawElements(l.TRIANGLES,e.__webglFaceCount,l.UNSIGNED_SHORT,0)),V.info.render.calls++,V.info.render.vertices+=e.__webglFaceCount,V.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,d=d.linewidth,d!==
|
|
|
-ea&&(l.lineWidth(d),ea=d),l.drawArrays(f,0,e.__webglLineCount),V.info.render.calls++):f instanceof THREE.ParticleSystem?(l.drawArrays(l.POINTS,0,e.__webglParticleCount),V.info.render.calls++):f instanceof THREE.Ribbon&&(l.drawArrays(l.TRIANGLE_STRIP,0,e.__webglVertexCount),V.info.render.calls++)}};this.render=function(a,b,c,d){var e,f,g,m,n=a.lights,o=a.fog;v=-1;this.autoUpdateObjects&&this.initWebGLObjects(a);b.parent===void 0&&(console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it..."),
|
|
|
-a.add(b));this.autoUpdateScene&&a.updateMatrixWorld();i(this.renderPluginsPre,a,b);V.info.render.calls=0;V.info.render.vertices=0;V.info.render.faces=0;b.matrixWorldInverse.getInverse(b.matrixWorld);if(!b._viewMatrixArray)b._viewMatrixArray=new Float32Array(16);b.matrixWorldInverse.flattenToArray(b._viewMatrixArray);if(!b._projectionMatrixArray)b._projectionMatrixArray=new Float32Array(16);b.projectionMatrix.flattenToArray(b._projectionMatrixArray);ya.multiply(b.projectionMatrix,b.matrixWorldInverse);
|
|
|
-xa.setFromMatrix(ya);this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=a.__webglObjects;d=0;for(e=m.length;d<e;d++)if(f=m[d],g=f.object,f.render=!1,g.visible&&(!(g instanceof THREE.Mesh)||!g.frustumCulled||xa.contains(g))){g.matrixWorld.flattenToArray(g._objectMatrixArray);r(g,b);var p=f,s=p.object,q=p.buffer,x=void 0,x=x=void 0,x=s.material;if(x instanceof THREE.MeshFaceMaterial){if(x=q.materialIndex,x>=0)x=s.geometry.materials[x],
|
|
|
-x.transparent?(p.transparent=x,p.opaque=null):(p.opaque=x,p.transparent=null)}else if(x)x.transparent?(p.transparent=x,p.opaque=null):(p.opaque=x,p.transparent=null);f.render=!0;if(this.sortObjects)g.renderDepth?f.z=g.renderDepth:(za.copy(g.position),ya.multiplyVector3(za),f.z=za.z)}this.sortObjects&&m.sort(h);m=a.__webglObjectsImmediate;d=0;for(e=m.length;d<e;d++)if(f=m[d],g=f.object,g.visible)g.matrixAutoUpdate&&g.matrixWorld.flattenToArray(g._objectMatrixArray),r(g,b),g=f.object.material,g.transparent?
|
|
|
-(f.transparent=g,f.opaque=null):(f.opaque=g,f.transparent=null);a.overrideMaterial?(this.setBlending(a.overrideMaterial.blending),this.setDepthTest(a.overrideMaterial.depthTest),t(a.overrideMaterial.depthWrite),u(a.overrideMaterial.polygonOffset,a.overrideMaterial.polygonOffsetFactor,a.overrideMaterial.polygonOffsetUnits),j(a.__webglObjects,!1,"",b,n,o,!0,a.overrideMaterial),k(a.__webglObjectsImmediate,"",b,n,o,!1,a.overrideMaterial)):(this.setBlending(THREE.NormalBlending),j(a.__webglObjects,!0,
|
|
|
-"opaque",b,n,o,!1),k(a.__webglObjectsImmediate,"opaque",b,n,o,!1),j(a.__webglObjects,!1,"transparent",b,n,o,!0),k(a.__webglObjectsImmediate,"transparent",b,n,o,!0));i(this.renderPluginsPost,a,b);c&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,c.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,c.__webglTexture),l.generateMipmap(l.TEXTURE_2D),
|
|
|
-l.bindTexture(l.TEXTURE_2D,null)))};this.renderImmediateObject=function(a,b,c,d,e){var f=q(a,b,c,d,e);Y=-1;V.setObjectFaces(e);e.immediateRenderCallback?e.immediateRenderCallback(f,l,xa):e.render(function(a){V.renderBufferImmediate(a,f,d.shading)})};this.initWebGLObjects=function(a){if(!a.__webglObjects)a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[];for(;a.__objectsAdded.length;){var h=a.__objectsAdded[0],i=a,k=void 0,j=void 0,D=void 0;if(!h.__webglInit)if(h.__webglInit=
|
|
|
-!0,h._modelViewMatrix=new THREE.Matrix4,h._normalMatrixArray=new Float32Array(9),h._modelViewMatrixArray=new Float32Array(16),h._objectMatrixArray=new Float32Array(16),h.matrixWorld.flattenToArray(h._objectMatrixArray),h instanceof THREE.Mesh){j=h.geometry;if(j.geometryGroups===void 0){var D=j,q=void 0,r=void 0,x=void 0,t=void 0,u=void 0,y=void 0,C=void 0,A={},R=D.morphTargets.length;D.geometryGroups={};q=0;for(r=D.faces.length;q<r;q++)x=D.faces[q],t=x.materialIndex,y=t!==void 0?t:-1,A[y]===void 0&&
|
|
|
-(A[y]={hash:y,counter:0}),C=A[y].hash+"_"+A[y].counter,D.geometryGroups[C]===void 0&&(D.geometryGroups[C]={faces3:[],faces4:[],materialIndex:t,vertices:0,numMorphTargets:R}),u=x instanceof THREE.Face3?3:4,D.geometryGroups[C].vertices+u>65535&&(A[y].counter+=1,C=A[y].hash+"_"+A[y].counter,D.geometryGroups[C]===void 0&&(D.geometryGroups[C]={faces3:[],faces4:[],materialIndex:t,vertices:0,numMorphTargets:R})),x instanceof THREE.Face3?D.geometryGroups[C].faces3.push(q):D.geometryGroups[C].faces4.push(q),
|
|
|
-D.geometryGroups[C].vertices+=u;D.geometryGroupsList=[];q=void 0;for(q in D.geometryGroups)D.geometryGroups[q].id=aa++,D.geometryGroupsList.push(D.geometryGroups[q])}for(k in j.geometryGroups)if(D=j.geometryGroups[k],!D.__webglVertexBuffer){q=D;q.__webglVertexBuffer=l.createBuffer();q.__webglNormalBuffer=l.createBuffer();q.__webglTangentBuffer=l.createBuffer();q.__webglColorBuffer=l.createBuffer();q.__webglUVBuffer=l.createBuffer();q.__webglUV2Buffer=l.createBuffer();q.__webglSkinVertexABuffer=l.createBuffer();
|
|
|
-q.__webglSkinVertexBBuffer=l.createBuffer();q.__webglSkinIndicesBuffer=l.createBuffer();q.__webglSkinWeightsBuffer=l.createBuffer();q.__webglFaceBuffer=l.createBuffer();q.__webglLineBuffer=l.createBuffer();if(q.numMorphTargets){x=r=void 0;q.__webglMorphTargetsBuffers=[];r=0;for(x=q.numMorphTargets;r<x;r++)q.__webglMorphTargetsBuffers.push(l.createBuffer())}V.info.memory.geometries++;t=h;u=t.geometry;r=D.faces3;y=D.faces4;q=r.length*3+y.length*4;x=r.length*1+y.length*2;y=r.length*3+y.length*4;r=c(t,
|
|
|
-D);C=g(r);A=d(r);R=e(r);D.__vertexArray=new Float32Array(q*3);if(A)D.__normalArray=new Float32Array(q*3);if(u.hasTangents)D.__tangentArray=new Float32Array(q*4);if(R)D.__colorArray=new Float32Array(q*3);if(C){if(u.faceUvs.length>0||u.faceVertexUvs.length>0)D.__uvArray=new Float32Array(q*2);if(u.faceUvs.length>1||u.faceVertexUvs.length>1)D.__uv2Array=new Float32Array(q*2)}if(t.geometry.skinWeights.length&&t.geometry.skinIndices.length)D.__skinVertexAArray=new Float32Array(q*4),D.__skinVertexBArray=
|
|
|
-new Float32Array(q*4),D.__skinIndexArray=new Float32Array(q*4),D.__skinWeightArray=new Float32Array(q*4);D.__faceArray=new Uint16Array(x*3);D.__lineArray=new Uint16Array(y*2);if(D.numMorphTargets){D.__morphTargetsArrays=[];t=0;for(u=D.numMorphTargets;t<u;t++)D.__morphTargetsArrays.push(new Float32Array(q*3))}D.__webglFaceCount=x*3;D.__webglLineCount=y*2;if(r.attributes){if(D.__webglCustomAttributesList===void 0)D.__webglCustomAttributesList=[];x=void 0;for(x in r.attributes){var t=r.attributes[x],
|
|
|
-u={},K;for(K in t)u[K]=t[K];if(!u.__webglInitialized||u.createUniqueBuffers)u.__webglInitialized=!0,y=1,u.type==="v2"?y=2:u.type==="v3"?y=3:u.type==="v4"?y=4:u.type==="c"&&(y=3),u.size=y,u.array=new Float32Array(q*y),u.buffer=l.createBuffer(),u.buffer.belongsToAttribute=x,t.needsUpdate=!0,u.__original=t;D.__webglCustomAttributesList.push(u)}}D.__inittedArrays=!0;j.__dirtyVertices=!0;j.__dirtyMorphTargets=!0;j.__dirtyElements=!0;j.__dirtyUvs=!0;j.__dirtyNormals=!0;j.__dirtyTangents=!0;j.__dirtyColors=
|
|
|
-!0}}else if(h instanceof THREE.Ribbon){if(j=h.geometry,!j.__webglVertexBuffer)D=j,D.__webglVertexBuffer=l.createBuffer(),D.__webglColorBuffer=l.createBuffer(),V.info.memory.geometries++,D=j,q=D.vertices.length,D.__vertexArray=new Float32Array(q*3),D.__colorArray=new Float32Array(q*3),D.__webglVertexCount=q,j.__dirtyVertices=!0,j.__dirtyColors=!0}else if(h instanceof THREE.Line){if(j=h.geometry,!j.__webglVertexBuffer)D=j,D.__webglVertexBuffer=l.createBuffer(),D.__webglColorBuffer=l.createBuffer(),
|
|
|
-V.info.memory.geometries++,D=j,q=h,r=D.vertices.length,D.__vertexArray=new Float32Array(r*3),D.__colorArray=new Float32Array(r*3),D.__webglLineCount=r,b(D,q),j.__dirtyVertices=!0,j.__dirtyColors=!0}else if(h instanceof THREE.ParticleSystem&&(j=h.geometry,!j.__webglVertexBuffer))D=j,D.__webglVertexBuffer=l.createBuffer(),D.__webglColorBuffer=l.createBuffer(),V.info.geometries++,D=j,q=h,r=D.vertices.length,D.__vertexArray=new Float32Array(r*3),D.__colorArray=new Float32Array(r*3),D.__sortArray=[],D.__webglParticleCount=
|
|
|
-r,b(D,q),j.__dirtyVertices=!0,j.__dirtyColors=!0;if(!h.__webglActive){if(h instanceof THREE.Mesh)for(k in j=h.geometry,j.geometryGroups)D=j.geometryGroups[k],o(i.__webglObjects,D,h);else h instanceof THREE.Ribbon||h instanceof THREE.Line||h instanceof THREE.ParticleSystem?(j=h.geometry,o(i.__webglObjects,j,h)):THREE.MarchingCubes!==void 0&&h instanceof THREE.MarchingCubes||h.immediateRenderCallback?i.__webglObjectsImmediate.push({object:h,opaque:null,transparent:null}):h instanceof THREE.Sprite?i.__webglSprites.push(h):
|
|
|
-h instanceof THREE.LensFlare&&i.__webglFlares.push(h);h.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;)h=a.__objectsRemoved[0],i=a,h instanceof THREE.Mesh||h instanceof THREE.ParticleSystem||h instanceof THREE.Ribbon||h instanceof THREE.Line?s(i.__webglObjects,h):h instanceof THREE.Sprite?n(i.__webglSprites,h):h instanceof THREE.LensFlare?n(i.__webglFlares,h):(h instanceof THREE.MarchingCubes||h.immediateRenderCallback)&&s(i.__webglObjectsImmediate,h),h.__webglActive=
|
|
|
-!1,a.__objectsRemoved.splice(0,1);h=0;for(i=a.__webglObjects.length;h<i;h++)if(K=a.__webglObjects[h].object,k=K.geometry,j=x=r=void 0,K instanceof THREE.Mesh){D=0;for(q=k.geometryGroupsList.length;D<q;D++)if(r=k.geometryGroupsList[D],j=c(K,r),x=j.attributes&&p(j),k.__dirtyVertices||k.__dirtyMorphTargets||k.__dirtyElements||k.__dirtyUvs||k.__dirtyNormals||k.__dirtyColors||k.__dirtyTangents||x){var w=K,x=l.DYNAMIC_DRAW,t=!k.dynamic,C=j;if(r.__inittedArrays){var u=d(C),y=e(C),G=g(C),I=u===THREE.SmoothShading,
|
|
|
-J=A=C=void 0,H=void 0,F=void 0,L=void 0,v=void 0,B=void 0,M=void 0,$=J=void 0,Q=void 0,O=void 0,P=void 0,X=H=void 0,U=void 0,Y=void 0,T=H=M=void 0,W=void 0,ca=P=O=Q=v=void 0,N=H=P=O=Q=ca=P=O=Q=ca=P=O=Q=void 0,S=void 0,da=L=void 0,fa=void 0,ja=void 0,va=void 0,ea=void 0,na=$=ja=S=0,la=0,ia=N=J=0,ga=v=X=0,E=0,ma=void 0,ga=r.__vertexArray,fa=r.__uvArray,E=r.__uv2Array,da=r.__normalArray,F=r.__tangentArray,U=r.__colorArray,T=r.__skinVertexAArray,W=r.__skinVertexBArray,B=r.__skinIndexArray,oa=r.__skinWeightArray,
|
|
|
-ca=r.__morphTargetsArrays,R=r.__webglCustomAttributesList,z=void 0,z=r.__faceArray,ma=r.__lineArray,Y=w.geometry,qa=Y.__dirtyElements,sa=Y.__dirtyUvs,L=Y.__dirtyNormals,M=Y.__dirtyTangents,za=Y.__dirtyColors,va=Y.__dirtyMorphTargets,ea=Y.vertices,w=r.faces3,ha=r.faces4,ka=Y.faces,ya=Y.faceVertexUvs[0],Ba=Y.faceVertexUvs[1],wa=Y.skinVerticesA,xa=Y.skinVerticesB,Aa=Y.skinIndices,Ha=Y.skinWeights,Ia=Y.morphTargets;if(Y.__dirtyVertices){C=0;for(A=w.length;C<A;C++)H=ka[w[C]],Q=ea[H.a].position,O=ea[H.b].position,
|
|
|
-P=ea[H.c].position,ga[ja]=Q.x,ga[ja+1]=Q.y,ga[ja+2]=Q.z,ga[ja+3]=O.x,ga[ja+4]=O.y,ga[ja+5]=O.z,ga[ja+6]=P.x,ga[ja+7]=P.y,ga[ja+8]=P.z,ja+=9;C=0;for(A=ha.length;C<A;C++)H=ka[ha[C]],Q=ea[H.a].position,O=ea[H.b].position,P=ea[H.c].position,H=ea[H.d].position,ga[ja]=Q.x,ga[ja+1]=Q.y,ga[ja+2]=Q.z,ga[ja+3]=O.x,ga[ja+4]=O.y,ga[ja+5]=O.z,ga[ja+6]=P.x,ga[ja+7]=P.y,ga[ja+8]=P.z,ga[ja+9]=H.x,ga[ja+10]=H.y,ga[ja+11]=H.z,ja+=12;l.bindBuffer(l.ARRAY_BUFFER,r.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,ga,
|
|
|
-x)}if(va){ja=0;for(va=Ia.length;ja<va;ja++){C=ga=0;for(A=w.length;C<A;C++)H=ka[w[C]],Q=Ia[ja].vertices[H.a].position,O=Ia[ja].vertices[H.b].position,P=Ia[ja].vertices[H.c].position,ea=ca[ja],ea[ga]=Q.x,ea[ga+1]=Q.y,ea[ga+2]=Q.z,ea[ga+3]=O.x,ea[ga+4]=O.y,ea[ga+5]=O.z,ea[ga+6]=P.x,ea[ga+7]=P.y,ea[ga+8]=P.z,ga+=9;C=0;for(A=ha.length;C<A;C++)H=ka[ha[C]],Q=Ia[ja].vertices[H.a].position,O=Ia[ja].vertices[H.b].position,P=Ia[ja].vertices[H.c].position,H=Ia[ja].vertices[H.d].position,ea=ca[ja],ea[ga]=Q.x,
|
|
|
+ea&&(l.lineWidth(d),ea=d),l.drawArrays(f,0,e.__webglLineCount),V.info.render.calls++):f instanceof THREE.ParticleSystem?(l.drawArrays(l.POINTS,0,e.__webglParticleCount),V.info.render.calls++,V.info.render.points+=e.__webglParticleCount):f instanceof THREE.Ribbon&&(l.drawArrays(l.TRIANGLE_STRIP,0,e.__webglVertexCount),V.info.render.calls++)}};this.render=function(a,b,c,d){var e,f,g,m,n=a.lights,o=a.fog;v=-1;this.autoUpdateObjects&&this.initWebGLObjects(a);b.parent===void 0&&(console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it..."),
|
|
|
+a.add(b));this.autoUpdateScene&&a.updateMatrixWorld();i(this.renderPluginsPre,a,b);V.info.render.calls=0;V.info.render.vertices=0;V.info.render.faces=0;V.info.render.points=0;b.matrixWorldInverse.getInverse(b.matrixWorld);if(!b._viewMatrixArray)b._viewMatrixArray=new Float32Array(16);b.matrixWorldInverse.flattenToArray(b._viewMatrixArray);if(!b._projectionMatrixArray)b._projectionMatrixArray=new Float32Array(16);b.projectionMatrix.flattenToArray(b._projectionMatrixArray);ya.multiply(b.projectionMatrix,
|
|
|
+b.matrixWorldInverse);xa.setFromMatrix(ya);this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=a.__webglObjects;d=0;for(e=m.length;d<e;d++)if(f=m[d],g=f.object,f.render=!1,g.visible&&(!(g instanceof THREE.Mesh)||!g.frustumCulled||xa.contains(g))){g.matrixWorld.flattenToArray(g._objectMatrixArray);r(g,b);var p=f,s=p.object,q=p.buffer,x=void 0,x=x=void 0,x=s.material;if(x instanceof THREE.MeshFaceMaterial){if(x=q.materialIndex,x>=
|
|
|
+0)x=s.geometry.materials[x],x.transparent?(p.transparent=x,p.opaque=null):(p.opaque=x,p.transparent=null)}else if(x)x.transparent?(p.transparent=x,p.opaque=null):(p.opaque=x,p.transparent=null);f.render=!0;if(this.sortObjects)g.renderDepth?f.z=g.renderDepth:(za.copy(g.position),ya.multiplyVector3(za),f.z=za.z)}this.sortObjects&&m.sort(h);m=a.__webglObjectsImmediate;d=0;for(e=m.length;d<e;d++)if(f=m[d],g=f.object,g.visible)g.matrixAutoUpdate&&g.matrixWorld.flattenToArray(g._objectMatrixArray),r(g,
|
|
|
+b),g=f.object.material,g.transparent?(f.transparent=g,f.opaque=null):(f.opaque=g,f.transparent=null);a.overrideMaterial?(this.setBlending(a.overrideMaterial.blending),this.setDepthTest(a.overrideMaterial.depthTest),t(a.overrideMaterial.depthWrite),u(a.overrideMaterial.polygonOffset,a.overrideMaterial.polygonOffsetFactor,a.overrideMaterial.polygonOffsetUnits),j(a.__webglObjects,!1,"",b,n,o,!0,a.overrideMaterial),k(a.__webglObjectsImmediate,"",b,n,o,!1,a.overrideMaterial)):(this.setBlending(THREE.NormalBlending),
|
|
|
+j(a.__webglObjects,!0,"opaque",b,n,o,!1),k(a.__webglObjectsImmediate,"opaque",b,n,o,!1),j(a.__webglObjects,!1,"transparent",b,n,o,!0),k(a.__webglObjectsImmediate,"transparent",b,n,o,!0));i(this.renderPluginsPost,a,b);c&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,c.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,c.__webglTexture),
|
|
|
+l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null)))};this.renderImmediateObject=function(a,b,c,d,e){var f=q(a,b,c,d,e);Y=-1;V.setObjectFaces(e);e.immediateRenderCallback?e.immediateRenderCallback(f,l,xa):e.render(function(a){V.renderBufferImmediate(a,f,d.shading)})};this.initWebGLObjects=function(a){if(!a.__webglObjects)a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[];for(;a.__objectsAdded.length;){var h=a.__objectsAdded[0],i=a,k=void 0,j=void 0,
|
|
|
+D=void 0;if(!h.__webglInit)if(h.__webglInit=!0,h._modelViewMatrix=new THREE.Matrix4,h._normalMatrixArray=new Float32Array(9),h._modelViewMatrixArray=new Float32Array(16),h._objectMatrixArray=new Float32Array(16),h.matrixWorld.flattenToArray(h._objectMatrixArray),h instanceof THREE.Mesh){j=h.geometry;if(j.geometryGroups===void 0){var D=j,q=void 0,r=void 0,x=void 0,t=void 0,u=void 0,y=void 0,C=void 0,A={},R=D.morphTargets.length;D.geometryGroups={};q=0;for(r=D.faces.length;q<r;q++)x=D.faces[q],t=x.materialIndex,
|
|
|
+y=t!==void 0?t:-1,A[y]===void 0&&(A[y]={hash:y,counter:0}),C=A[y].hash+"_"+A[y].counter,D.geometryGroups[C]===void 0&&(D.geometryGroups[C]={faces3:[],faces4:[],materialIndex:t,vertices:0,numMorphTargets:R}),u=x instanceof THREE.Face3?3:4,D.geometryGroups[C].vertices+u>65535&&(A[y].counter+=1,C=A[y].hash+"_"+A[y].counter,D.geometryGroups[C]===void 0&&(D.geometryGroups[C]={faces3:[],faces4:[],materialIndex:t,vertices:0,numMorphTargets:R})),x instanceof THREE.Face3?D.geometryGroups[C].faces3.push(q):
|
|
|
+D.geometryGroups[C].faces4.push(q),D.geometryGroups[C].vertices+=u;D.geometryGroupsList=[];q=void 0;for(q in D.geometryGroups)D.geometryGroups[q].id=aa++,D.geometryGroupsList.push(D.geometryGroups[q])}for(k in j.geometryGroups)if(D=j.geometryGroups[k],!D.__webglVertexBuffer){q=D;q.__webglVertexBuffer=l.createBuffer();q.__webglNormalBuffer=l.createBuffer();q.__webglTangentBuffer=l.createBuffer();q.__webglColorBuffer=l.createBuffer();q.__webglUVBuffer=l.createBuffer();q.__webglUV2Buffer=l.createBuffer();
|
|
|
+q.__webglSkinVertexABuffer=l.createBuffer();q.__webglSkinVertexBBuffer=l.createBuffer();q.__webglSkinIndicesBuffer=l.createBuffer();q.__webglSkinWeightsBuffer=l.createBuffer();q.__webglFaceBuffer=l.createBuffer();q.__webglLineBuffer=l.createBuffer();if(q.numMorphTargets){x=r=void 0;q.__webglMorphTargetsBuffers=[];r=0;for(x=q.numMorphTargets;r<x;r++)q.__webglMorphTargetsBuffers.push(l.createBuffer())}V.info.memory.geometries++;t=h;u=t.geometry;r=D.faces3;y=D.faces4;q=r.length*3+y.length*4;x=r.length*
|
|
|
+1+y.length*2;y=r.length*3+y.length*4;r=c(t,D);C=g(r);A=d(r);R=e(r);D.__vertexArray=new Float32Array(q*3);if(A)D.__normalArray=new Float32Array(q*3);if(u.hasTangents)D.__tangentArray=new Float32Array(q*4);if(R)D.__colorArray=new Float32Array(q*3);if(C){if(u.faceUvs.length>0||u.faceVertexUvs.length>0)D.__uvArray=new Float32Array(q*2);if(u.faceUvs.length>1||u.faceVertexUvs.length>1)D.__uv2Array=new Float32Array(q*2)}if(t.geometry.skinWeights.length&&t.geometry.skinIndices.length)D.__skinVertexAArray=
|
|
|
+new Float32Array(q*4),D.__skinVertexBArray=new Float32Array(q*4),D.__skinIndexArray=new Float32Array(q*4),D.__skinWeightArray=new Float32Array(q*4);D.__faceArray=new Uint16Array(x*3);D.__lineArray=new Uint16Array(y*2);if(D.numMorphTargets){D.__morphTargetsArrays=[];t=0;for(u=D.numMorphTargets;t<u;t++)D.__morphTargetsArrays.push(new Float32Array(q*3))}D.__webglFaceCount=x*3;D.__webglLineCount=y*2;if(r.attributes){if(D.__webglCustomAttributesList===void 0)D.__webglCustomAttributesList=[];x=void 0;for(x in r.attributes){var t=
|
|
|
+r.attributes[x],u={},K;for(K in t)u[K]=t[K];if(!u.__webglInitialized||u.createUniqueBuffers)u.__webglInitialized=!0,y=1,u.type==="v2"?y=2:u.type==="v3"?y=3:u.type==="v4"?y=4:u.type==="c"&&(y=3),u.size=y,u.array=new Float32Array(q*y),u.buffer=l.createBuffer(),u.buffer.belongsToAttribute=x,t.needsUpdate=!0,u.__original=t;D.__webglCustomAttributesList.push(u)}}D.__inittedArrays=!0;j.__dirtyVertices=!0;j.__dirtyMorphTargets=!0;j.__dirtyElements=!0;j.__dirtyUvs=!0;j.__dirtyNormals=!0;j.__dirtyTangents=
|
|
|
+!0;j.__dirtyColors=!0}}else if(h instanceof THREE.Ribbon){if(j=h.geometry,!j.__webglVertexBuffer)D=j,D.__webglVertexBuffer=l.createBuffer(),D.__webglColorBuffer=l.createBuffer(),V.info.memory.geometries++,D=j,q=D.vertices.length,D.__vertexArray=new Float32Array(q*3),D.__colorArray=new Float32Array(q*3),D.__webglVertexCount=q,j.__dirtyVertices=!0,j.__dirtyColors=!0}else if(h instanceof THREE.Line){if(j=h.geometry,!j.__webglVertexBuffer)D=j,D.__webglVertexBuffer=l.createBuffer(),D.__webglColorBuffer=
|
|
|
+l.createBuffer(),V.info.memory.geometries++,D=j,q=h,r=D.vertices.length,D.__vertexArray=new Float32Array(r*3),D.__colorArray=new Float32Array(r*3),D.__webglLineCount=r,b(D,q),j.__dirtyVertices=!0,j.__dirtyColors=!0}else if(h instanceof THREE.ParticleSystem&&(j=h.geometry,!j.__webglVertexBuffer))D=j,D.__webglVertexBuffer=l.createBuffer(),D.__webglColorBuffer=l.createBuffer(),V.info.geometries++,D=j,q=h,r=D.vertices.length,D.__vertexArray=new Float32Array(r*3),D.__colorArray=new Float32Array(r*3),D.__sortArray=
|
|
|
+[],D.__webglParticleCount=r,b(D,q),j.__dirtyVertices=!0,j.__dirtyColors=!0;if(!h.__webglActive){if(h instanceof THREE.Mesh)for(k in j=h.geometry,j.geometryGroups)D=j.geometryGroups[k],o(i.__webglObjects,D,h);else h instanceof THREE.Ribbon||h instanceof THREE.Line||h instanceof THREE.ParticleSystem?(j=h.geometry,o(i.__webglObjects,j,h)):THREE.MarchingCubes!==void 0&&h instanceof THREE.MarchingCubes||h.immediateRenderCallback?i.__webglObjectsImmediate.push({object:h,opaque:null,transparent:null}):h instanceof
|
|
|
+THREE.Sprite?i.__webglSprites.push(h):h instanceof THREE.LensFlare&&i.__webglFlares.push(h);h.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;)h=a.__objectsRemoved[0],i=a,h instanceof THREE.Mesh||h instanceof THREE.ParticleSystem||h instanceof THREE.Ribbon||h instanceof THREE.Line?s(i.__webglObjects,h):h instanceof THREE.Sprite?n(i.__webglSprites,h):h instanceof THREE.LensFlare?n(i.__webglFlares,h):(h instanceof THREE.MarchingCubes||h.immediateRenderCallback)&&s(i.__webglObjectsImmediate,
|
|
|
+h),h.__webglActive=!1,a.__objectsRemoved.splice(0,1);h=0;for(i=a.__webglObjects.length;h<i;h++)if(K=a.__webglObjects[h].object,k=K.geometry,j=x=r=void 0,K instanceof THREE.Mesh){D=0;for(q=k.geometryGroupsList.length;D<q;D++)if(r=k.geometryGroupsList[D],j=c(K,r),x=j.attributes&&p(j),k.__dirtyVertices||k.__dirtyMorphTargets||k.__dirtyElements||k.__dirtyUvs||k.__dirtyNormals||k.__dirtyColors||k.__dirtyTangents||x){var w=K,x=l.DYNAMIC_DRAW,t=!k.dynamic,C=j;if(r.__inittedArrays){var u=d(C),y=e(C),G=g(C),
|
|
|
+I=u===THREE.SmoothShading,J=A=C=void 0,H=void 0,F=void 0,L=void 0,v=void 0,B=void 0,M=void 0,$=J=void 0,Q=void 0,O=void 0,P=void 0,X=H=void 0,U=void 0,Y=void 0,T=H=M=void 0,W=void 0,ca=P=O=Q=v=void 0,N=H=P=O=Q=ca=P=O=Q=ca=P=O=Q=void 0,S=void 0,da=L=void 0,fa=void 0,ja=void 0,va=void 0,ea=void 0,na=$=ja=S=0,la=0,ia=N=J=0,ga=v=X=0,E=0,ma=void 0,ga=r.__vertexArray,fa=r.__uvArray,E=r.__uv2Array,da=r.__normalArray,F=r.__tangentArray,U=r.__colorArray,T=r.__skinVertexAArray,W=r.__skinVertexBArray,B=r.__skinIndexArray,
|
|
|
+oa=r.__skinWeightArray,ca=r.__morphTargetsArrays,R=r.__webglCustomAttributesList,z=void 0,z=r.__faceArray,ma=r.__lineArray,Y=w.geometry,qa=Y.__dirtyElements,sa=Y.__dirtyUvs,L=Y.__dirtyNormals,M=Y.__dirtyTangents,za=Y.__dirtyColors,va=Y.__dirtyMorphTargets,ea=Y.vertices,w=r.faces3,ha=r.faces4,ka=Y.faces,ya=Y.faceVertexUvs[0],Ba=Y.faceVertexUvs[1],wa=Y.skinVerticesA,xa=Y.skinVerticesB,Aa=Y.skinIndices,Ha=Y.skinWeights,Ia=Y.morphTargets;if(Y.__dirtyVertices){C=0;for(A=w.length;C<A;C++)H=ka[w[C]],Q=ea[H.a].position,
|
|
|
+O=ea[H.b].position,P=ea[H.c].position,ga[ja]=Q.x,ga[ja+1]=Q.y,ga[ja+2]=Q.z,ga[ja+3]=O.x,ga[ja+4]=O.y,ga[ja+5]=O.z,ga[ja+6]=P.x,ga[ja+7]=P.y,ga[ja+8]=P.z,ja+=9;C=0;for(A=ha.length;C<A;C++)H=ka[ha[C]],Q=ea[H.a].position,O=ea[H.b].position,P=ea[H.c].position,H=ea[H.d].position,ga[ja]=Q.x,ga[ja+1]=Q.y,ga[ja+2]=Q.z,ga[ja+3]=O.x,ga[ja+4]=O.y,ga[ja+5]=O.z,ga[ja+6]=P.x,ga[ja+7]=P.y,ga[ja+8]=P.z,ga[ja+9]=H.x,ga[ja+10]=H.y,ga[ja+11]=H.z,ja+=12;l.bindBuffer(l.ARRAY_BUFFER,r.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,
|
|
|
+ga,x)}if(va){ja=0;for(va=Ia.length;ja<va;ja++){C=ga=0;for(A=w.length;C<A;C++)H=ka[w[C]],Q=Ia[ja].vertices[H.a].position,O=Ia[ja].vertices[H.b].position,P=Ia[ja].vertices[H.c].position,ea=ca[ja],ea[ga]=Q.x,ea[ga+1]=Q.y,ea[ga+2]=Q.z,ea[ga+3]=O.x,ea[ga+4]=O.y,ea[ga+5]=O.z,ea[ga+6]=P.x,ea[ga+7]=P.y,ea[ga+8]=P.z,ga+=9;C=0;for(A=ha.length;C<A;C++)H=ka[ha[C]],Q=Ia[ja].vertices[H.a].position,O=Ia[ja].vertices[H.b].position,P=Ia[ja].vertices[H.c].position,H=Ia[ja].vertices[H.d].position,ea=ca[ja],ea[ga]=Q.x,
|
|
|
ea[ga+1]=Q.y,ea[ga+2]=Q.z,ea[ga+3]=O.x,ea[ga+4]=O.y,ea[ga+5]=O.z,ea[ga+6]=P.x,ea[ga+7]=P.y,ea[ga+8]=P.z,ea[ga+9]=H.x,ea[ga+10]=H.y,ea[ga+11]=H.z,ga+=12;l.bindBuffer(l.ARRAY_BUFFER,r.__webglMorphTargetsBuffers[ja]);l.bufferData(l.ARRAY_BUFFER,ca[ja],x)}}if(Ha.length){C=0;for(A=w.length;C<A;C++)H=ka[w[C]],Q=Ha[H.a],O=Ha[H.b],P=Ha[H.c],oa[v]=Q.x,oa[v+1]=Q.y,oa[v+2]=Q.z,oa[v+3]=Q.w,oa[v+4]=O.x,oa[v+5]=O.y,oa[v+6]=O.z,oa[v+7]=O.w,oa[v+8]=P.x,oa[v+9]=P.y,oa[v+10]=P.z,oa[v+11]=P.w,Q=Aa[H.a],O=Aa[H.b],P=
|
|
|
Aa[H.c],B[v]=Q.x,B[v+1]=Q.y,B[v+2]=Q.z,B[v+3]=Q.w,B[v+4]=O.x,B[v+5]=O.y,B[v+6]=O.z,B[v+7]=O.w,B[v+8]=P.x,B[v+9]=P.y,B[v+10]=P.z,B[v+11]=P.w,Q=wa[H.a],O=wa[H.b],P=wa[H.c],T[v]=Q.x,T[v+1]=Q.y,T[v+2]=Q.z,T[v+3]=1,T[v+4]=O.x,T[v+5]=O.y,T[v+6]=O.z,T[v+7]=1,T[v+8]=P.x,T[v+9]=P.y,T[v+10]=P.z,T[v+11]=1,Q=xa[H.a],O=xa[H.b],P=xa[H.c],W[v]=Q.x,W[v+1]=Q.y,W[v+2]=Q.z,W[v+3]=1,W[v+4]=O.x,W[v+5]=O.y,W[v+6]=O.z,W[v+7]=1,W[v+8]=P.x,W[v+9]=P.y,W[v+10]=P.z,W[v+11]=1,v+=12;C=0;for(A=ha.length;C<A;C++)H=ka[ha[C]],Q=Ha[H.a],
|
|
|
O=Ha[H.b],P=Ha[H.c],ca=Ha[H.d],oa[v]=Q.x,oa[v+1]=Q.y,oa[v+2]=Q.z,oa[v+3]=Q.w,oa[v+4]=O.x,oa[v+5]=O.y,oa[v+6]=O.z,oa[v+7]=O.w,oa[v+8]=P.x,oa[v+9]=P.y,oa[v+10]=P.z,oa[v+11]=P.w,oa[v+12]=ca.x,oa[v+13]=ca.y,oa[v+14]=ca.z,oa[v+15]=ca.w,Q=Aa[H.a],O=Aa[H.b],P=Aa[H.c],ca=Aa[H.d],B[v]=Q.x,B[v+1]=Q.y,B[v+2]=Q.z,B[v+3]=Q.w,B[v+4]=O.x,B[v+5]=O.y,B[v+6]=O.z,B[v+7]=O.w,B[v+8]=P.x,B[v+9]=P.y,B[v+10]=P.z,B[v+11]=P.w,B[v+12]=ca.x,B[v+13]=ca.y,B[v+14]=ca.z,B[v+15]=ca.w,Q=wa[H.a],O=wa[H.b],P=wa[H.c],ca=wa[H.d],T[v]=
|