123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- // ThreeExtras.js r37 - http://github.com/mrdoob/three.js
- var GeometryUtils={merge:function(a,g){var b=g instanceof THREE.Mesh,c=a.vertices.length,d=b?g.geometry:g,e=a.vertices,f=d.vertices,h=a.faces,j=d.faces,k=a.faceVertexUvs[0];d=d.faceVertexUvs[0];b&&g.matrixAutoUpdate&&g.updateMatrix();for(var l=0,p=f.length;l<p;l++){var q=new THREE.Vertex(f[l].position.clone());b&&g.matrix.multiplyVector3(q.position);e.push(q)}l=0;for(p=j.length;l<p;l++){f=j[l];var m,t,y=f.vertexNormals;q=f.vertexColors;if(f instanceof THREE.Face3)m=new THREE.Face3(f.a+c,f.b+c,f.c+
- c);else f instanceof THREE.Face4&&(m=new THREE.Face4(f.a+c,f.b+c,f.c+c,f.d+c));m.normal.copy(f.normal);b=0;for(e=y.length;b<e;b++){t=y[b];m.vertexNormals.push(t.clone())}m.color.copy(f.color);b=0;for(e=q.length;b<e;b++){t=q[b];m.vertexColors.push(t.clone())}m.materials=f.materials.slice();m.centroid.copy(f.centroid);h.push(m)}l=0;for(p=d.length;l<p;l++){c=d[l];h=[];b=0;for(e=c.length;b<e;b++)h.push(new THREE.UV(c[b].u,c[b].v));k.push(h)}}},ImageUtils={loadTexture:function(a,g,b){var c=new Image,d=
- new THREE.Texture(c,g);c.onload=function(){d.needsUpdate=!0;b&&b(this)};c.src=a;return d},loadTextureCube:function(a,g,b){var c,d=[],e=new THREE.Texture(d,g);g=d.loadCount=0;for(c=a.length;g<c;++g){d[g]=new Image;d[g].onload=function(){d.loadCount+=1;if(d.loadCount==6)e.needsUpdate=!0;b&&b(this)};d[g].src=a[g]}return e}},SceneUtils={loadScene:function(a,g,b,c){a=new Worker(a);a.postMessage(0);a.onmessage=function(d){function e(){for(l in F.objects)if(!E.objects[l]){y=F.objects[l];if(n=E.geometries[y.geometry]){M=
- [];for(i=0;i<y.materials.length;i++)M[i]=E.materials[y.materials[i]];C=y.position;r=y.rotation;s=y.scale;object=new THREE.Mesh(n,M);object.position.set(C[0],C[1],C[2]);object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=y.visible;E.scene.addObject(object);E.objects[l]=object}}}function f(O){return function(U){E.geometries[O]=U;e();K-=1;h()}}function h(){c({total_models:P,total_textures:Q,loaded_models:P-K,loaded_textures:Q-L},E);K==0&&L==0&&b(E)}var j,k,l,p,q,m,t,y,
- C,x,z,n,H,D,M,F,J,I,K,L,P,Q,E;F=d.data;J=new THREE.BinaryLoader;I=new THREE.JSONLoader;L=K=0;E={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{}};d=function(){L-=1;h()};for(q in F.cameras){x=F.cameras[q];if(x.type=="perspective")H=new THREE.Camera(x.fov,x.aspect,x.near,x.far);else if(x.type=="ortho"){H=new THREE.Camera;H.projectionMatrix=THREE.Matrix4.makeOrtho(x.left,x.right,x.top,x.bottom,x.near,x.far)}C=x.position;x=x.target;H.position.set(C[0],
- C[1],C[2]);H.target.position.set(x[0],x[1],x[2]);E.cameras[q]=H}for(p in F.lights){q=F.lights[p];if(q.type=="directional"){C=q.direction;light=new THREE.DirectionalLight;light.position.set(C[0],C[1],C[2]);light.position.normalize()}else if(q.type=="point"){C=q.position;light=new THREE.PointLight;light.position.set(C[0],C[1],C[2])}x=q.color;i=q.intensity||1;light.color.setRGB(x[0]*i,x[1]*i,x[2]*i);E.scene.addLight(light);E.lights[p]=light}for(m in F.fogs){p=F.fogs[m];if(p.type=="linear")D=new THREE.Fog(0,
- p.near,p.far);else p.type=="exp2"&&(D=new THREE.FogExp2(0,p.density));x=p.color;D.color.setRGB(x[0],x[1],x[2]);E.fogs[m]=D}if(E.cameras&&F.defaults.camera)E.currentCamera=E.cameras[F.defaults.camera];if(E.fogs&&F.defaults.fog)E.scene.fog=E.fogs[F.defaults.fog];x=F.defaults.bgcolor;E.bgColor=new THREE.Color;E.bgColor.setRGB(x[0],x[1],x[2]);E.bgColorAlpha=F.defaults.bgalpha;for(j in F.geometries){m=F.geometries[j];if(m.type=="bin_mesh"||m.type=="ascii_mesh")K+=1}P=K;for(j in F.geometries){m=F.geometries[j];
- if(m.type=="cube"){n=new Cube(m.width,m.height,m.depth,m.segmentsWidth,m.segmentsHeight,m.segmentsDepth,null,m.flipped,m.sides);E.geometries[j]=n}else if(m.type=="plane"){n=new Plane(m.width,m.height,m.segmentsWidth,m.segmentsHeight);E.geometries[j]=n}else if(m.type=="sphere"){n=new Sphere(m.radius,m.segmentsWidth,m.segmentsHeight);E.geometries[j]=n}else if(m.type=="cylinder"){n=new Cylinder(m.numSegs,m.topRad,m.botRad,m.height,m.topOffset,m.botOffset);E.geometries[j]=n}else if(m.type=="torus"){n=
- new Torus(m.radius,m.tube,m.segmentsR,m.segmentsT);E.geometries[j]=n}else if(m.type=="icosahedron"){n=new Icosahedron(m.subdivisions);E.geometries[j]=n}else if(m.type=="bin_mesh")J.load({model:m.url,callback:f(j)});else m.type=="ascii_mesh"&&I.load({model:m.url,callback:f(j)})}for(t in F.textures){j=F.textures[t];L+=j.url instanceof Array?j.url.length:1}Q=L;for(t in F.textures){j=F.textures[t];if(j.mapping!=undefined&&THREE[j.mapping]!=undefined)j.mapping=new THREE[j.mapping];if(j.url instanceof Array)m=
- ImageUtils.loadTextureCube(j.url,j.mapping,d);else{m=ImageUtils.loadTexture(j.url,j.mapping,d);if(THREE[j.minFilter]!=undefined)m.minFilter=THREE[j.minFilter];if(THREE[j.magFilter]!=undefined)m.magFilter=THREE[j.magFilter]}E.textures[t]=m}for(k in F.materials){t=F.materials[k];for(z in t.parameters)if(z=="envMap"||z=="map"||z=="lightMap")t.parameters[z]=E.textures[t.parameters[z]];else if(z=="shading")t.parameters[z]=t.parameters[z]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(z=="blending")t.parameters[z]=
- THREE[t.parameters[z]]?THREE[t.parameters[z]]:THREE.NormalBlending;else z=="combine"&&(t.parameters[z]=t.parameters[z]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation);t=new THREE[t.type](t.parameters);E.materials[k]=t}e();g(E)}},addMesh:function(a,g,b,c,d,e,f,h,j,k){g=new THREE.Mesh(g,k);g.scale.x=g.scale.y=g.scale.z=b;g.position.x=c;g.position.y=d;g.position.z=e;g.rotation.x=f;g.rotation.y=h;g.rotation.z=j;a.addObject(g);return g},addPanoramaCubeWebGL:function(a,g,b){var c=ShaderUtils.lib.cube;
- c.uniforms.tCube.texture=b;b=new THREE.MeshShaderMaterial({fragmentShader:c.fragmentShader,vertexShader:c.vertexShader,uniforms:c.uniforms});g=new THREE.Mesh(new Cube(g,g,g,1,1,1,null,!0),b);a.addObject(g);return g},addPanoramaCube:function(a,g,b){var c=[];c.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[0])}));c.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[1])}));c.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[2])}));c.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[3])}));
- c.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[4])}));c.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[5])}));g=new THREE.Mesh(new Cube(g,g,g,1,1,c,!0),new THREE.MeshFaceMaterial);a.addObject(g);return g},addPanoramaCubePlanes:function(a,g,b){var c=g/2;g=new Plane(g,g);var d=Math.PI,e=Math.PI/2;SceneUtils.addMesh(a,g,1,0,0,-c,0,0,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[5])}));SceneUtils.addMesh(a,g,1,-c,0,0,0,e,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[0])}));
- SceneUtils.addMesh(a,g,1,c,0,0,0,-e,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[1])}));SceneUtils.addMesh(a,g,1,0,c,0,e,0,d,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[2])}));SceneUtils.addMesh(a,g,1,0,-c,0,-e,0,d,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[3])}))},showHierarchy:function(a,g){SceneUtils.traverseHierarchy(a,function(b){b.visible=g})},traverseHierarchy:function(a,g){var b,c,d=a.children.length;for(c=0;c<d;c++){b=a.children[c];g(b);SceneUtils.traverseHierarchy(b,
- g)}}},ShaderUtils={lib:{fresnel:{uniforms:{mRefractionRatio:{type:"f",value:1.02},mFresnelBias:{type:"f",value:0.1},mFresnelPower:{type:"f",value:2},mFresnelScale:{type:"f",value:1},tCube:{type:"t",value:1,texture:null}},fragmentShader:"uniform samplerCube tCube;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\nvec4 refractedColor = vec4( 1.0, 1.0, 1.0, 1.0 );\nrefractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;\nrefractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;\nrefractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;\nrefractedColor.a = 1.0;\ngl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );\n}",
- vertexShader:"uniform float mRefractionRatio;\nuniform float mFresnelBias;\nuniform float mFresnelScale;\nuniform float mFresnelPower;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = normalize ( mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal );\nvec3 I = mPosition.xyz - cameraPosition;\nvReflect = reflect( I, nWorld );\nvRefract[0] = refract( normalize( I ), nWorld, mRefractionRatio );\nvRefract[1] = refract( normalize( I ), nWorld, mRefractionRatio * 0.99 );\nvRefract[2] = refract( normalize( I ), nWorld, mRefractionRatio * 0.98 );\nvReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), nWorld ), mFresnelPower );\ngl_Position = projectionMatrix * mvPosition;\n}"},
- normal:{uniforms:{enableAO:{type:"i",value:0},enableDiffuse:{type:"i",value:0},tDiffuse:{type:"t",value:0,texture:null},tNormal:{type:"t",value:2,texture:null},tAO:{type:"t",value:3,texture:null},uNormalScale:{type:"f",value:1},tDisplacement:{type:"t",value:4,texture:null},uDisplacementBias:{type:"f",value:-0.5},uDisplacementScale:{type:"f",value:2.5},uPointLightPos:{type:"v3",value:new THREE.Vector3},uPointLightColor:{type:"c",value:new THREE.Color(15658734)},uDirLightPos:{type:"v3",value:new THREE.Vector3},
- uDirLightColor:{type:"c",value:new THREE.Color(15658734)},uAmbientLightColor:{type:"c",value:new THREE.Color(328965)},uDiffuseColor:{type:"c",value:new THREE.Color(15658734)},uSpecularColor:{type:"c",value:new THREE.Color(1118481)},uAmbientColor:{type:"c",value:new THREE.Color(328965)},uShininess:{type:"f",value:30}},fragmentShader:"uniform vec3 uDirLightPos;\nuniform vec3 uAmbientLightColor;\nuniform vec3 uDirLightColor;\nuniform vec3 uPointLightColor;\nuniform vec3 uAmbientColor;\nuniform vec3 uDiffuseColor;\nuniform vec3 uSpecularColor;\nuniform float uShininess;\nuniform bool enableDiffuse;\nuniform bool enableAO;\nuniform sampler2D tDiffuse;\nuniform sampler2D tNormal;\nuniform sampler2D tAO;\nuniform float uNormalScale;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nvarying vec3 vPointLightVector;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 diffuseTex = vec3( 1.0, 1.0, 1.0 );\nvec3 aoTex = vec3( 1.0, 1.0, 1.0 );\nvec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\nnormalTex.xy *= uNormalScale;\nnormalTex = normalize( normalTex );\nif( enableDiffuse )\ndiffuseTex = texture2D( tDiffuse, vUv ).xyz;\nif( enableAO )\naoTex = texture2D( tAO, vUv ).xyz;\nmat3 tsb = mat3( vTangent, vBinormal, vNormal );\nvec3 finalNormal = tsb * normalTex;\nvec3 normal = normalize( finalNormal );\nvec3 viewPosition = normalize( vViewPosition );\nvec4 pointDiffuse = vec4( 0.0, 0.0, 0.0, 0.0 );\nvec4 pointSpecular = vec4( 0.0, 0.0, 0.0, 0.0 );\nvec3 pointVector = normalize( vPointLightVector );\nvec3 pointHalfVector = normalize( vPointLightVector + vViewPosition );\nfloat pointDotNormalHalf = dot( normal, pointHalfVector );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = 0.0;\nif ( pointDotNormalHalf >= 0.0 )\npointSpecularWeight = pow( pointDotNormalHalf, uShininess );\npointDiffuse += vec4( uDiffuseColor, 1.0 ) * pointDiffuseWeight;\npointSpecular += vec4( uSpecularColor, 1.0 ) * pointSpecularWeight;\nvec4 dirDiffuse = vec4( 0.0, 0.0, 0.0, 0.0 );\nvec4 dirSpecular = vec4( 0.0, 0.0, 0.0, 0.0 );\nvec4 lDirection = viewMatrix * vec4( uDirLightPos, 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\nvec3 dirHalfVector = normalize( lDirection.xyz + vViewPosition );\nfloat dirDotNormalHalf = dot( normal, dirHalfVector );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = 0.0;\nif ( dirDotNormalHalf >= 0.0 )\ndirSpecularWeight = pow( dirDotNormalHalf, uShininess );\ndirDiffuse += vec4( uDiffuseColor, 1.0 ) * dirDiffuseWeight;\ndirSpecular += vec4( uSpecularColor, 1.0 ) * dirSpecularWeight;\nvec4 totalLight = vec4( uAmbientLightColor * uAmbientColor, 1.0 );\ntotalLight += vec4( uDirLightColor, 1.0 ) * ( dirDiffuse + dirSpecular );\ntotalLight += vec4( uPointLightColor, 1.0 ) * ( pointDiffuse + pointSpecular );\ngl_FragColor = vec4( totalLight.xyz * aoTex * diffuseTex, 1.0 );\n}",
- vertexShader:"attribute vec4 tangent;\nuniform vec3 uPointLightPos;\n#ifdef VERTEX_TEXTURES\nuniform sampler2D tDisplacement;\nuniform float uDisplacementScale;\nuniform float uDisplacementBias;\n#endif\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nvarying vec3 vPointLightVector;\nvarying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvViewPosition = cameraPosition - mPosition.xyz;\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvNormal = normalize( normalMatrix * normal );\nvTangent = normalize( normalMatrix * tangent.xyz );\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvBinormal = normalize( vBinormal );\nvUv = uv;\nvec4 lPosition = viewMatrix * vec4( uPointLightPos, 1.0 );\nvPointLightVector = normalize( lPosition.xyz - mvPosition.xyz );\n#ifdef VERTEX_TEXTURES\nvec3 dv = texture2D( tDisplacement, uv ).xyz;\nfloat df = uDisplacementScale * dv.x + uDisplacementBias;\nvec4 displacedPosition = vec4( vNormal.xyz * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif\n}"},
- cube:{uniforms:{tCube:{type:"t",value:1,texture:null}},vertexShader:"varying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvViewPosition = cameraPosition - mPosition.xyz;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform samplerCube tCube;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( - wPos.x, wPos.yz ) );\n}"},convolution:{uniforms:{tDiffuse:{type:"t",
- value:0,texture:null},uImageIncrement:{type:"v2",value:new THREE.Vector2(0.001953125,0)},cKernel:{type:"fv1",value:[]}},vertexShader:"varying vec2 vUv;\nuniform vec2 uImageIncrement;\nvoid main(void) {\nvUv = uv - ((KERNEL_SIZE - 1.0) / 2.0) * uImageIncrement;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"varying vec2 vUv;\nuniform sampler2D tDiffuse;\nuniform vec2 uImageIncrement;\nuniform float cKernel[KERNEL_SIZE];\nvoid main(void) {\nvec2 imageCoord = vUv;\nvec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );\nfor( int i=0; i<KERNEL_SIZE; ++i ) {\nsum += texture2D( tDiffuse, imageCoord ) * cKernel[i];\nimageCoord += uImageIncrement;\n}\ngl_FragColor = sum;\n}"},
- film:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},time:{type:"f",value:0},nIntensity:{type:"f",value:0.5},sIntensity:{type:"f",value:0.05},sCount:{type:"f",value:4096},grayscale:{type:"i",value:1}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"varying vec2 vUv;\nuniform sampler2D tDiffuse;\nuniform float time;\nuniform bool grayscale;\nuniform float nIntensity;\nuniform float sIntensity;\nuniform float sCount;\nvoid main() {\nvec4 cTextureScreen = texture2D( tDiffuse, vUv );\nfloat x = vUv.x * vUv.y * time * 1000.0;\nx = mod( x, 13.0 ) * mod( x, 123.0 );\nfloat dx = mod( x, 0.01 );\nvec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 );\nvec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );\ncResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;\ncResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );\nif( grayscale ) {\ncResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );\n}\ngl_FragColor = vec4( cResult, cTextureScreen.a );\n}"},
- screen:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},opacity:{type:"f",value:1}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"varying vec2 vUv;\nuniform sampler2D tDiffuse;\nuniform float opacity;\nvoid main() {\nvec4 texel = texture2D( tDiffuse, vUv );\ngl_FragColor = opacity * texel;\n}"},basic:{uniforms:{},vertexShader:"void main() {\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
- fragmentShader:"void main() {\ngl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );\n}"}},buildKernel:function(a){var g,b,c,d,e=2*Math.ceil(a*3)+1;e>25&&(e=25);d=(e-1)*0.5;b=Array(e);for(g=c=0;g<e;++g){b[g]=Math.exp(-((g-d)*(g-d))/(2*a*a));c+=b[g]}for(g=0;g<e;++g)b[g]/=c;return b}};
- THREE.QuakeCamera=function(a){function g(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.dragToLook=!1;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.domElement=document;if(a){if(a.movementSpeed!==undefined)this.movementSpeed=a.movementSpeed;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.noFly!==undefined)this.noFly=
- a.noFly;if(a.lookVertical!==undefined)this.lookVertical=a.lookVertical;if(a.autoForward!==undefined)this.autoForward=a.autoForward;if(a.dragToLook!==undefined)this.dragToLook=a.dragToLook;if(a.heightSpeed!==undefined)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==undefined)this.heightCoef=a.heightCoef;if(a.heightMin!==undefined)this.heightMin=a.heightMin;if(a.heightMax!==undefined)this.heightMax=a.heightMax;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=
- this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.moveForward=!1;this.moveBackward=!1;this.moveLeft=!1;this.moveRight=!1;this.mouseDragOn=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(b){b.preventDefault();b.stopPropagation();if(!this.dragToLook)switch(b.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(b){b.preventDefault();b.stopPropagation();if(!this.dragToLook)switch(b.button){case 0:this.moveForward=
- !1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(b){this.mouseX=b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.onKeyDown=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0}};this.onKeyUp=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=
- !1;break;case 39:case 68:this.moveRight=!1}};this.update=function(){this.autoSpeedFactor=this.heightSpeed?((this.position.y<this.heightMin?this.heightMin:this.position.y>this.heightMax?this.heightMax:this.position.y)-this.heightMin)*this.heightCoef:0;(this.moveForward||this.autoForward)&&this.translateZ(-(this.movementSpeed+this.autoSpeedFactor));this.moveBackward&&this.translateZ(this.movementSpeed);this.moveLeft&&this.translateX(-this.movementSpeed);this.moveRight&&this.translateX(this.movementSpeed);
- var b=this.lookSpeed;this.dragToLook&&!this.mouseDragOn&&(b=0);this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;b=this.target.position;var c=this.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},
- !1);this.domElement.addEventListener("mousemove",g(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",g(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",g(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",g(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",g(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
- THREE.QuakeCamera.prototype.translate=function(a,g){this.matrix.rotateAxis(g);if(this.noFly)g.y=0;this.position.addSelf(g.multiplyScalar(a));this.target.position.addSelf(g.multiplyScalar(a))};
- THREE.PathCamera=function(a){function g(k,l,p,q){var m={name:p,fps:0.6,length:q,hierarchy:[]},t,y=l.getControlPointsArray(),C=l.getLength(),x=y.length,z=0;t=x-1;l={parent:-1,keys:[]};l.keys[0]={time:0,pos:y[0],rot:[0,0,0,1],scl:[1,1,1]};l.keys[t]={time:q,pos:y[t],rot:[0,0,0,1],scl:[1,1,1]};for(t=1;t<x-1;t++){z=q*C.chunks[t]/C.total;l.keys[t]={time:z,pos:y[t]}}m.hierarchy[0]=l;THREE.AnimationHandler.add(m);return new THREE.Animation(k,p,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function b(k,l){var p,
- q,m=new THREE.Geometry;for(p=0;p<k.points.length*l;p++){q=p/(k.points.length*l);q=k.getPoint(q);m.vertices[p]=new THREE.Vertex(new THREE.Vector3(q.x,q.y,q.z))}return m}function c(k,l){var p=b(l,10),q=b(l,10),m=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(p,m);particleObj=new THREE.ParticleSystem(q,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);k.addChild(lineObj);particleObj.scale.set(1,1,1);k.addChild(particleObj);q=new Sphere(1,
- 16,8);m=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<l.points.length;i++){p=new THREE.Mesh(q,m);p.position.copy(l.points[i]);p.updateMatrix();k.addChild(p)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookVertical=
- !0;this.lookHorizontal=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(a){if(a.duration!==undefined)this.duration=a.duration*1E3;if(a.waypoints!==undefined)this.waypoints=a.waypoints;if(a.useConstantSpeed!==undefined)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==undefined)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==undefined)this.createDebugPath=a.createDebugPath;
- if(a.createDebugDummy!==undefined)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==undefined)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==undefined)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==undefined)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==undefined)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=
- this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var d=Math.PI*2,e=Math.PI/180;this.update=function(k,l,p){var q,m;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*e;this.theta=this.lon*e;q=this.phi%d;this.phi=q>=0?q:q+d;q=this.verticalAngleMap.srcRange;m=this.verticalAngleMap.dstRange;
- this.phi=(this.phi-q[0])*(m[1]-m[0])/(q[1]-q[0])+m[0];q=this.horizontalAngleMap.srcRange;m=this.horizontalAngleMap.dstRange;this.theta=(this.theta-q[0])*(m[1]-m[0])/(q[1]-q[0])+m[0];q=this.target.position;q.x=100*Math.sin(this.phi)*Math.cos(this.theta);q.y=100*Math.cos(this.phi);q.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,k,l,p)};this.onMouseMove=function(k){this.mouseX=k.clientX-this.windowHalfX;this.mouseY=k.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);
- this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){a=new THREE.MeshLambertMaterial({color:30719});var f=new THREE.MeshLambertMaterial({color:65280}),h=new Cube(10,10,20),j=new Cube(2,2,10);this.animationParent=new THREE.Mesh(h,a);a=new THREE.Mesh(j,f);a.position.set(0,10,0);this.animation=g(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else{this.animation=
- g(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this.target);this.animationParent.addChild(this)}this.createDebugPath&&c(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(k,l){return function(){l.apply(k,arguments)}}(this,this.onMouseMove),!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
- var Cube=function(a,g,b,c,d,e,f,h,j){function k(C,x,z,n,H,D,M,F){var J,I,K=c||1,L=d||1,P=H/2,Q=D/2,E=l.vertices.length;if(C=="x"&&x=="y"||C=="y"&&x=="x")J="z";else if(C=="x"&&x=="z"||C=="z"&&x=="x"){J="y";L=e||1}else if(C=="z"&&x=="y"||C=="y"&&x=="z"){J="x";K=e||1}var O=K+1,U=L+1;H/=K;var $=D/L;for(I=0;I<U;I++)for(D=0;D<O;D++){var T=new THREE.Vector3;T[C]=(D*H-P)*z;T[x]=(I*$-Q)*n;T[J]=M;l.vertices.push(new THREE.Vertex(T))}for(I=0;I<L;I++)for(D=0;D<K;D++){l.faces.push(new THREE.Face4(D+O*I+E,D+O*
- (I+1)+E,D+1+O*(I+1)+E,D+1+O*I+E,null,null,F));l.faceVertexUvs[0].push([new THREE.UV(D/K,I/L),new THREE.UV(D/K,(I+1)/L),new THREE.UV((D+1)/K,(I+1)/L),new THREE.UV((D+1)/K,I/L)])}}THREE.Geometry.call(this);var l=this,p=a/2,q=g/2,m=b/2;h=h?-1:1;if(f!==undefined)if(f instanceof Array)this.materials=f;else{this.materials=[];for(var t=0;t<6;t++)this.materials.push([f])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(j!=undefined)for(var y in j)this.sides[y]!=undefined&&(this.sides[y]=
- j[y]);this.sides.px&&k("z","y",1*h,-1,b,g,-p,this.materials[0]);this.sides.nx&&k("z","y",-1*h,-1,b,g,p,this.materials[1]);this.sides.py&&k("x","z",1*h,1,a,b,q,this.materials[2]);this.sides.ny&&k("x","z",1*h,-1,a,b,-q,this.materials[3]);this.sides.pz&&k("x","y",1*h,-1,a,g,m,this.materials[4]);this.sides.nz&&k("x","y",-1*h,-1,a,g,-m,this.materials[5]);(function(){for(var C=[],x=[],z=0,n=l.vertices.length;z<n;z++){for(var H=l.vertices[z],D=!1,M=0,F=C.length;M<F;M++){var J=C[M];if(H.position.x==J.position.x&&
- H.position.y==J.position.y&&H.position.z==J.position.z){x[z]=M;D=!0;break}}if(!D){x[z]=C.length;C.push(new THREE.Vertex(H.position.clone()))}}z=0;for(n=l.faces.length;z<n;z++){H=l.faces[z];H.a=x[H.a];H.b=x[H.b];H.c=x[H.c];H.d=x[H.d]}l.vertices=C})();this.computeCentroids();this.computeFaceNormals()};Cube.prototype=new THREE.Geometry;Cube.prototype.constructor=Cube;
- var Cylinder=function(a,g,b,c,d,e){function f(l,p,q){h.vertices.push(new THREE.Vertex(new THREE.Vector3(l,p,q)))}THREE.Geometry.call(this);var h=this,j=Math.PI,k=c/2;for(c=0;c<a;c++)f(Math.sin(2*j*c/a)*g,Math.cos(2*j*c/a)*g,-k);for(c=0;c<a;c++)f(Math.sin(2*j*c/a)*b,Math.cos(2*j*c/a)*b,k);for(c=0;c<a;c++)h.faces.push(new THREE.Face4(c,c+a,a+(c+1)%a,(c+1)%a));if(b>0){f(0,0,-k-(e||0));for(c=a;c<a+a/2;c++)h.faces.push(new THREE.Face4(2*a,(2*c-2*a)%a,(2*c-2*a+1)%a,(2*c-2*a+2)%a))}if(g>0){f(0,0,k+(d||0));
- for(c=a+a/2;c<2*a;c++)h.faces.push(new THREE.Face4(2*a+1,(2*c-2*a+2)%a+a,(2*c-2*a+1)%a+a,(2*c-2*a)%a+a))}this.computeCentroids();this.computeFaceNormals()};Cylinder.prototype=new THREE.Geometry;Cylinder.prototype.constructor=Cylinder;
- var Icosahedron=function(a){function g(p,q,m){var t=Math.sqrt(p*p+q*q+m*m);return d.vertices.push(new THREE.Vertex(new THREE.Vector3(p/t,q/t,m/t)))-1}function b(p,q,m,t){t.faces.push(new THREE.Face3(p,q,m))}function c(p,q){var m=d.vertices[p].position,t=d.vertices[q].position;return g((m.x+t.x)/2,(m.y+t.y)/2,(m.z+t.z)/2)}var d=this,e=new THREE.Geometry,f;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;g(-1,a,0);g(1,a,0);g(-1,-a,0);g(1,-a,0);g(0,-1,a);g(0,1,a);g(0,-1,-a);g(0,
- 1,-a);g(a,0,-1);g(a,0,1);g(-a,0,-1);g(-a,0,1);b(0,11,5,e);b(0,5,1,e);b(0,1,7,e);b(0,7,10,e);b(0,10,11,e);b(1,5,9,e);b(5,11,4,e);b(11,10,2,e);b(10,7,6,e);b(7,1,8,e);b(3,9,4,e);b(3,4,2,e);b(3,2,6,e);b(3,6,8,e);b(3,8,9,e);b(4,9,5,e);b(2,4,11,e);b(6,2,10,e);b(8,6,7,e);b(9,8,1,e);for(a=0;a<this.subdivisions;a++){f=new THREE.Geometry;for(var h in e.faces){var j=c(e.faces[h].a,e.faces[h].b),k=c(e.faces[h].b,e.faces[h].c),l=c(e.faces[h].c,e.faces[h].a);b(e.faces[h].a,j,l,f);b(e.faces[h].b,k,j,f);b(e.faces[h].c,
- l,k,f);b(j,k,l,f)}e.faces=f.faces}d.faces=e.faces;delete e;delete f;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};Icosahedron.prototype=new THREE.Geometry;Icosahedron.prototype.constructor=Icosahedron;
- function Lathe(a,g,b){THREE.Geometry.call(this);this.steps=g||12;this.angle=b||2*Math.PI;g=this.angle/this.steps;for(var c=[],d=[],e=[],f=[],h=0;h<a.length;h++){this.vertices.push(new THREE.Vertex(a[h]));c[h]=a[h].clone();d[h]=this.vertices.length-1}for(var j=(new THREE.Matrix4).setRotationZ(g),k=0;k<=this.angle+0.001;k+=g){for(h=0;h<c.length;h++)if(k<this.angle){c[h]=j.multiplyVector3(c[h].clone());this.vertices.push(new THREE.Vertex(c[h]));e[h]=this.vertices.length-1}else e=f;k==0&&(f=d);for(h=
- 0;h<d.length-1;h++){this.faces.push(new THREE.Face4(e[h],e[h+1],d[h+1],d[h]));this.faceVertexUvs[0].push([new THREE.UV(k/b,h/a.length),new THREE.UV(k/b,(h+1)/a.length),new THREE.UV((k-g)/b,(h+1)/a.length),new THREE.UV((k-g)/b,h/a.length)])}d=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()}Lathe.prototype=new THREE.Geometry;Lathe.prototype.constructor=Lathe;
- var Plane=function(a,g,b,c){THREE.Geometry.call(this);var d,e=a/2,f=g/2;b=b||1;c=c||1;var h=b+1,j=c+1;a/=b;var k=g/c;for(d=0;d<j;d++)for(g=0;g<h;g++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(g*a-e,-(d*k-f),0)));for(d=0;d<c;d++)for(g=0;g<b;g++){this.faces.push(new THREE.Face4(g+h*d,g+h*(d+1),g+1+h*(d+1),g+1+h*d));this.faceVertexUvs[0].push([new THREE.UV(g/b,d/c),new THREE.UV(g/b,(d+1)/c),new THREE.UV((g+1)/b,(d+1)/c),new THREE.UV((g+1)/b,d/c)])}this.computeCentroids();this.computeFaceNormals()};
- Plane.prototype=new THREE.Geometry;Plane.prototype.constructor=Plane;
- var Sphere=function(a,g,b){THREE.Geometry.call(this);var c,d=Math.PI,e=Math.max(3,g||8),f=Math.max(2,b||6);g=[];for(b=0;b<f+1;b++){c=b/f;var h=a*Math.cos(c*d),j=a*Math.sin(c*d),k=[],l=0;for(c=0;c<e;c++){var p=2*c/e,q=j*Math.sin(p*d);p=j*Math.cos(p*d);(b==0||b==f)&&c>0||(l=this.vertices.push(new THREE.Vertex(new THREE.Vector3(p,h,q)))-1);k.push(l)}g.push(k)}var m,t,y;d=g.length;for(b=0;b<d;b++){e=g[b].length;if(b>0)for(c=0;c<e;c++){k=c==e-1;f=g[b][k?0:c+1];h=g[b][k?e-1:c];j=g[b-1][k?e-1:c];k=g[b-1][k?
- 0:c+1];q=b/(d-1);m=(b-1)/(d-1);t=(c+1)/e;p=c/e;l=new THREE.UV(1-t,q);q=new THREE.UV(1-p,q);p=new THREE.UV(1-p,m);var C=new THREE.UV(1-t,m);if(b<g.length-1){m=this.vertices[f].position.clone();t=this.vertices[h].position.clone();y=this.vertices[j].position.clone();m.normalize();t.normalize();y.normalize();this.faces.push(new THREE.Face3(f,h,j,[new THREE.Vector3(m.x,m.y,m.z),new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(y.x,y.y,y.z)]));this.faceVertexUvs[0].push([l,q,p])}if(b>1){m=this.vertices[f].position.clone();
- t=this.vertices[j].position.clone();y=this.vertices[k].position.clone();m.normalize();t.normalize();y.normalize();this.faces.push(new THREE.Face3(f,j,k,[new THREE.Vector3(m.x,m.y,m.z),new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(y.x,y.y,y.z)]));this.faceVertexUvs[0].push([l,p,C])}}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};Sphere.prototype=new THREE.Geometry;Sphere.prototype.constructor=Sphere;
- var Torus=function(a,g,b,c){this.radius=a||100;this.tube=g||40;this.segmentsR=b||8;this.segmentsT=c||6;a=[];THREE.Geometry.call(this);for(g=0;g<=this.segmentsR;++g)for(b=0;b<=this.segmentsT;++b){c=b/this.segmentsT*2*Math.PI;var d=g/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(d))*Math.cos(c),(this.radius+this.tube*Math.cos(d))*Math.sin(c),this.tube*Math.sin(d))));a.push([b/this.segmentsT,1-g/this.segmentsR])}for(g=1;g<=this.segmentsR;++g)for(b=
- 1;b<=this.segmentsT;++b){c=(this.segmentsT+1)*g+b;d=(this.segmentsT+1)*g+b-1;var e=(this.segmentsT+1)*(g-1)+b-1,f=(this.segmentsT+1)*(g-1)+b;this.faces.push(new THREE.Face4(c,d,e,f));this.faceVertexUvs[0].push([new THREE.UV(a[c][0],a[c][1]),new THREE.UV(a[d][0],a[d][1]),new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[f][0],a[f][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};Torus.prototype=new THREE.Geometry;Torus.prototype.constructor=Torus;
- var TorusKnot=function(a,g,b,c,d,e,f){function h(p,q,m,t,y,C){q=m/t*p;m=Math.cos(q);return new THREE.Vector3(y*(2+m)*0.5*Math.cos(p),y*(2+m)*Math.sin(p)*0.5,C*y*Math.sin(q)*0.5)}THREE.Geometry.call(this);this.radius=a||200;this.tube=g||40;this.segmentsR=b||64;this.segmentsT=c||8;this.p=d||2;this.q=e||3;this.heightScale=f||1;this.grid=Array(this.segmentsR);b=new THREE.Vector3;c=new THREE.Vector3;e=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=Array(this.segmentsT);for(g=0;g<this.segmentsT;++g){var j=
- a/this.segmentsR*2*this.p*Math.PI;f=g/this.segmentsT*2*Math.PI;d=h(j,f,this.q,this.p,this.radius,this.heightScale);j=h(j+0.01,f,this.q,this.p,this.radius,this.heightScale);b.x=j.x-d.x;b.y=j.y-d.y;b.z=j.z-d.z;c.x=j.x+d.x;c.y=j.y+d.y;c.z=j.z+d.z;e.cross(b,c);c.cross(e,b);e.normalize();c.normalize();j=this.tube*Math.cos(f);f=this.tube*Math.sin(f);d.x+=j*c.x+f*e.x;d.y+=j*c.y+f*e.y;d.z+=j*c.z+f*e.z;this.grid[a][g]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z)))-1}}for(a=0;a<this.segmentsR;++a)for(g=
- 0;g<this.segmentsT;++g){e=(a+1)%this.segmentsR;f=(g+1)%this.segmentsT;d=this.grid[a][g];b=this.grid[e][g];c=this.grid[a][f];e=this.grid[e][f];f=new THREE.UV(a/this.segmentsR,g/this.segmentsT);j=new THREE.UV((a+1)/this.segmentsR,g/this.segmentsT);var k=new THREE.UV(a/this.segmentsR,(g+1)/this.segmentsT),l=new THREE.UV((a+1)/this.segmentsR,(g+1)/this.segmentsT);this.faces.push(new THREE.Face3(d,b,c));this.faceVertexUvs[0].push([f,j,k]);this.faces.push(new THREE.Face3(e,c,b));this.faceVertexUvs[0].push([l,
- k,j])}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};TorusKnot.prototype=new THREE.Geometry;TorusKnot.prototype.constructor=TorusKnot;THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
- THREE.Loader.prototype={addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var g="Loaded ";g+=a.total?(100*a.loaded/a.total).toFixed(0)+"%":(a.loaded/1E3).toFixed(2)+" KB";
- this.statusDomElement.innerHTML=g},extractUrlbase:function(a){a=a.split("/");a.pop();return a.join("/")},init_materials:function(a,g,b){a.materials=[];for(var c=0;c<g.length;++c)a.materials[c]=[THREE.Loader.prototype.createMaterial(g[c],b)]},createMaterial:function(a,g){function b(h){h=Math.log(h)/Math.LN2;return Math.floor(h)==h}function c(h,j){var k=new Image;k.onload=function(){if(!b(this.width)||!b(this.height)){var l=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),p=Math.pow(2,Math.round(Math.log(this.height)/
- Math.LN2));h.image.width=l;h.image.height=p;h.image.getContext("2d").drawImage(this,0,0,l,p)}else h.image=this;h.needsUpdate=!0};k.src=j}var d,e,f;d="MeshLambertMaterial";e={color:15658734,opacity:1,map:null,lightMap:null,vertexColors:a.vertexColors?THREE.VertexColors:!1};if(a.shading)if(a.shading=="Phong")d="MeshPhongMaterial";else a.shading=="Basic"&&(d="MeshBasicMaterial");if(a.mapDiffuse&&g){f=document.createElement("canvas");e.map=new THREE.Texture(f);e.map.sourceFile=a.mapDiffuse;c(e.map,g+
- "/"+a.mapDiffuse)}else if(a.colorDiffuse){f=(a.colorDiffuse[0]*255<<16)+(a.colorDiffuse[1]*255<<8)+a.colorDiffuse[2]*255;e.color=f;e.opacity=a.transparency}else if(a.DbgColor)e.color=a.DbgColor;if(a.mapLightmap&&g){f=document.createElement("canvas");e.lightMap=new THREE.Texture(f);e.lightMap.sourceFile=a.mapLightmap;c(e.lightMap,g+"/"+a.mapLightmap)}return new THREE[d](e)}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;
- THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(a){var g=this,b=a.model,c=a.callback,d=a.texture_path?a.texture_path:this.extractUrlbase(b);a=new Worker(b);a.onmessage=function(e){g.createModel(e.data,c,d);g.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
- THREE.JSONLoader.prototype.createModel=function(a,g,b){var c=new THREE.Geometry;this.init_materials(c,a.materials,b);(function(){if(a.version===undefined||a.version!=2)console.error("Deprecated file format.");else{var d,e,f,h,j,k,l,p,q,m,t=a.faces;p=a.vertices;var y=a.normals,C=a.colors,x=0;for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&x++;for(d=0;d<x;d++){c.faceUvs[d]=[];c.faceVertexUvs[d]=[]}f=0;for(h=p.length;f<h;){q=new THREE.Vertex;q.position.x=p[f++];q.position.y=p[f++];q.position.z=p[f++];c.vertices.push(q)}f=
- 0;for(h=t.length;f<h;){j=t[f++];k=j&1;d=j&2;l=j&4;e=j&8;p=j&16;q=j&32;m=j&64;j&=128;if(k){k=new THREE.Face4;k.a=t[f++];k.b=t[f++];k.c=t[f++];k.d=t[f++];nVertices=4}else{k=new THREE.Face3;k.a=t[f++];k.b=t[f++];k.c=t[f++];nVertices=3}if(d){materialIndex=t[f++];k.materials=c.materials[materialIndex]}if(l)for(d=0;d<x;d++){uvLayer=a.uvs[d];uvIndex=t[f++];u=uvLayer[uvIndex*2];v=uvLayer[uvIndex*2+1];c.faceUvs[d].push(new THREE.UV(u,v))}if(e)for(d=0;d<x;d++){uvLayer=a.uvs[d];uvs=[];for(e=0;e<nVertices;e++){uvIndex=
- t[f++];u=uvLayer[uvIndex*2];v=uvLayer[uvIndex*2+1];uvs[e]=new THREE.UV(u,v)}e=c.faces.length;c.faceVertexUvs[d][e]=uvs}if(p){normalIndex=t[f++]*3;normal=new THREE.Vector3;normal.x=y[normalIndex++];normal.y=y[normalIndex++];normal.z=y[normalIndex];k.normal=normal}if(q)for(d=0;d<nVertices;d++){normalIndex=t[f++]*3;normal=new THREE.Vector3;normal.x=y[normalIndex++];normal.y=y[normalIndex++];normal.z=y[normalIndex];k.vertexNormals.push(normal)}if(m){color=new THREE.Color(t[f++]);k.color=color}if(j)for(d=
- 0;d<nVertices;d++){colorIndex=t[f++];color=new THREE.Color(C[colorIndex]);k.vertexColors.push(color)}c.faces.push(k)}}})();(function(){var d,e,f,h;if(a.skinWeights){d=0;for(e=a.skinWeights.length;d<e;d+=2){f=a.skinWeights[d];h=a.skinWeights[d+1];c.skinWeights.push(new THREE.Vector4(f,h,0,0))}}if(a.skinIndices){d=0;for(e=a.skinIndices.length;d<e;d+=2){f=a.skinIndices[d];h=a.skinIndices[d+1];c.skinIndices.push(new THREE.Vector4(f,h,0,0))}}c.bones=a.bones;c.animation=a.animation})();(function(){if(a.morphTargets!==
- undefined){var d,e,f,h;d=0;for(e=a.morphTargets.length;d<e;d++){c.morphTargets[d]={};c.morphTargets[d].name=a.morphTargets[d].name;c.morphTargets[d].vertices=[];dstVertices=c.morphTargets[d].vertices;srcVertices=a.morphTargets[d].vertices;f=0;for(h=srcVertices.length;f<h;f+=3)dstVertices.push(new THREE.Vertex(new THREE.Vector3(srcVertices[f],srcVertices[f+1],srcVertices[f+2])))}}})();c.computeCentroids();c.computeFaceNormals();g(c)};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};
- THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
- THREE.BinaryLoader.prototype={load:function(a){var g=a.model,b=a.callback,c=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(g),d=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(g);a=(new Date).getTime();g=new Worker(g);var e=this.showProgress?THREE.Loader.prototype.updateProgress:null;g.onmessage=function(f){THREE.BinaryLoader.prototype.loadAjaxBuffers(f.data.buffers,f.data.materials,b,d,c,e)};g.onerror=function(f){alert("worker.onerror: "+f.message+"\n"+f.data);f.preventDefault()};
- g.postMessage(a)},loadAjaxBuffers:function(a,g,b,c,d,e){var f=new XMLHttpRequest,h=c+"/"+a,j=0;f.onreadystatechange=function(){if(f.readyState==4)f.status==200||f.status==0?THREE.BinaryLoader.prototype.createBinModel(f.responseText,b,d,g):alert("Couldn't load ["+h+"] ["+f.status+"]");else if(f.readyState==3){if(e){j==0&&(j=f.getResponseHeader("Content-Length"));e({total:j,loaded:f.responseText.length})}}else f.readyState==2&&(j=f.getResponseHeader("Content-Length"))};f.open("GET",h,!0);f.overrideMimeType("text/plain; charset=x-user-defined");
- f.setRequestHeader("Content-Type","text/plain");f.send(null)},createBinModel:function(a,g,b,c){var d=function(e){function f(o,w){var A=l(o,w),B=l(o,w+1),G=l(o,w+2),N=l(o,w+3),R=(N<<1&255|G>>7)-127;A|=(G&127)<<16|B<<8;if(A==0&&R==-127)return 0;return(1-2*(N>>7))*(1+A*Math.pow(2,-23))*Math.pow(2,R)}function h(o,w){var A=l(o,w),B=l(o,w+1),G=l(o,w+2);return(l(o,w+3)<<24)+(G<<16)+(B<<8)+A}function j(o,w){var A=l(o,w);return(l(o,w+1)<<8)+A}function k(o,w){var A=l(o,w);return A>127?A-256:A}function l(o,
- w){return o.charCodeAt(w)&255}function p(o){var w,A,B;w=h(a,o);A=h(a,o+M);B=h(a,o+F);o=j(a,o+J);THREE.BinaryLoader.prototype.f3(x,w,A,B,o)}function q(o){var w,A,B,G,N,R;w=h(a,o);A=h(a,o+M);B=h(a,o+F);G=j(a,o+J);N=h(a,o+I);R=h(a,o+K);o=h(a,o+L);THREE.BinaryLoader.prototype.f3n(x,H,w,A,B,G,N,R,o)}function m(o){var w,A,B,G;w=h(a,o);A=h(a,o+P);B=h(a,o+Q);G=h(a,o+E);o=j(a,o+O);THREE.BinaryLoader.prototype.f4(x,w,A,B,G,o)}function t(o){var w,A,B,G,N,R,aa,ba;w=h(a,o);A=h(a,o+P);B=h(a,o+Q);G=h(a,o+E);N=j(a,
- o+O);R=h(a,o+U);aa=h(a,o+$);ba=h(a,o+T);o=h(a,o+ca);THREE.BinaryLoader.prototype.f4n(x,H,w,A,B,G,N,R,aa,ba,o)}function y(o){var w,A;w=h(a,o);A=h(a,o+da);o=h(a,o+ea);THREE.BinaryLoader.prototype.uv3(x.faceVertexUvs[0],D[w*2],D[w*2+1],D[A*2],D[A*2+1],D[o*2],D[o*2+1])}function C(o){var w,A,B;w=h(a,o);A=h(a,o+fa);B=h(a,o+ga);o=h(a,o+ha);THREE.BinaryLoader.prototype.uv4(x.faceVertexUvs[0],D[w*2],D[w*2+1],D[A*2],D[A*2+1],D[B*2],D[B*2+1],D[o*2],D[o*2+1])}var x=this,z=0,n,H=[],D=[],M,F,J,I,K,L,P,Q,E,O,U,
- $,T,ca,da,ea,fa,ga,ha,V,W,X,Y,Z,S;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(x,c,e);n={signature:a.substr(z,8),header_bytes:l(a,z+8),vertex_coordinate_bytes:l(a,z+9),normal_coordinate_bytes:l(a,z+10),uv_coordinate_bytes:l(a,z+11),vertex_index_bytes:l(a,z+12),normal_index_bytes:l(a,z+13),uv_index_bytes:l(a,z+14),material_index_bytes:l(a,z+15),nvertices:h(a,z+16),nnormals:h(a,z+16+4),nuvs:h(a,z+16+8),ntri_flat:h(a,z+16+12),ntri_smooth:h(a,z+16+16),ntri_flat_uv:h(a,z+16+20),ntri_smooth_uv:h(a,
- z+16+24),nquad_flat:h(a,z+16+28),nquad_smooth:h(a,z+16+32),nquad_flat_uv:h(a,z+16+36),nquad_smooth_uv:h(a,z+16+40)};z+=n.header_bytes;M=n.vertex_index_bytes;F=n.vertex_index_bytes*2;J=n.vertex_index_bytes*3;I=n.vertex_index_bytes*3+n.material_index_bytes;K=n.vertex_index_bytes*3+n.material_index_bytes+n.normal_index_bytes;L=n.vertex_index_bytes*3+n.material_index_bytes+n.normal_index_bytes*2;P=n.vertex_index_bytes;Q=n.vertex_index_bytes*2;E=n.vertex_index_bytes*3;O=n.vertex_index_bytes*4;U=n.vertex_index_bytes*
- 4+n.material_index_bytes;$=n.vertex_index_bytes*4+n.material_index_bytes+n.normal_index_bytes;T=n.vertex_index_bytes*4+n.material_index_bytes+n.normal_index_bytes*2;ca=n.vertex_index_bytes*4+n.material_index_bytes+n.normal_index_bytes*3;da=n.uv_index_bytes;ea=n.uv_index_bytes*2;fa=n.uv_index_bytes;ga=n.uv_index_bytes*2;ha=n.uv_index_bytes*3;e=n.vertex_index_bytes*3+n.material_index_bytes;S=n.vertex_index_bytes*4+n.material_index_bytes;V=n.ntri_flat*e;W=n.ntri_smooth*(e+n.normal_index_bytes*3);X=n.ntri_flat_uv*
- (e+n.uv_index_bytes*3);Y=n.ntri_smooth_uv*(e+n.normal_index_bytes*3+n.uv_index_bytes*3);Z=n.nquad_flat*S;e=n.nquad_smooth*(S+n.normal_index_bytes*4);S=n.nquad_flat_uv*(S+n.uv_index_bytes*4);z+=function(o){for(var w,A,B,G=n.vertex_coordinate_bytes*3,N=o+n.nvertices*G;o<N;o+=G){w=f(a,o);A=f(a,o+n.vertex_coordinate_bytes);B=f(a,o+n.vertex_coordinate_bytes*2);THREE.BinaryLoader.prototype.v(x,w,A,B)}return n.nvertices*G}(z);z+=function(o){for(var w,A,B,G=n.normal_coordinate_bytes*3,N=o+n.nnormals*G;o<
- N;o+=G){w=k(a,o);A=k(a,o+n.normal_coordinate_bytes);B=k(a,o+n.normal_coordinate_bytes*2);H.push(w/127,A/127,B/127)}return n.nnormals*G}(z);z+=function(o){for(var w,A,B=n.uv_coordinate_bytes*2,G=o+n.nuvs*B;o<G;o+=B){w=f(a,o);A=f(a,o+n.uv_coordinate_bytes);D.push(w,A)}return n.nuvs*B}(z);V=z+V;W=V+W;X=W+X;Y=X+Y;Z=Y+Z;e=Z+e;S=e+S;(function(o){var w,A=n.vertex_index_bytes*3+n.material_index_bytes,B=A+n.uv_index_bytes*3,G=o+n.ntri_flat_uv*B;for(w=o;w<G;w+=B){p(w);y(w+A)}return G-o})(W);(function(o){var w,
- A=n.vertex_index_bytes*3+n.material_index_bytes+n.normal_index_bytes*3,B=A+n.uv_index_bytes*3,G=o+n.ntri_smooth_uv*B;for(w=o;w<G;w+=B){q(w);y(w+A)}return G-o})(X);(function(o){var w,A=n.vertex_index_bytes*4+n.material_index_bytes,B=A+n.uv_index_bytes*4,G=o+n.nquad_flat_uv*B;for(w=o;w<G;w+=B){m(w);C(w+A)}return G-o})(e);(function(o){var w,A=n.vertex_index_bytes*4+n.material_index_bytes+n.normal_index_bytes*4,B=A+n.uv_index_bytes*4,G=o+n.nquad_smooth_uv*B;for(w=o;w<G;w+=B){t(w);C(w+A)}return G-o})(S);
- (function(o){var w,A=n.vertex_index_bytes*3+n.material_index_bytes,B=o+n.ntri_flat*A;for(w=o;w<B;w+=A)p(w);return B-o})(z);(function(o){var w,A=n.vertex_index_bytes*3+n.material_index_bytes+n.normal_index_bytes*3,B=o+n.ntri_smooth*A;for(w=o;w<B;w+=A)q(w);return B-o})(V);(function(o){var w,A=n.vertex_index_bytes*4+n.material_index_bytes,B=o+n.nquad_flat*A;for(w=o;w<B;w+=A)m(w);return B-o})(Y);(function(o){var w,A=n.vertex_index_bytes*4+n.material_index_bytes+n.normal_index_bytes*4,B=o+n.nquad_smooth*
- A;for(w=o;w<B;w+=A)t(w);return B-o})(Z);this.computeCentroids();this.computeFaceNormals()};d.prototype=new THREE.Geometry;d.prototype.constructor=d;g(new d(b))},v:function(a,g,b,c){a.vertices.push(new THREE.Vertex(new THREE.Vector3(g,b,c)))},f3:function(a,g,b,c,d){a.faces.push(new THREE.Face3(g,b,c,null,null,a.materials[d]))},f4:function(a,g,b,c,d,e){a.faces.push(new THREE.Face4(g,b,c,d,null,null,a.materials[e]))},f3n:function(a,g,b,c,d,e,f,h,j){e=a.materials[e];var k=g[h*3],l=g[h*3+1];h=g[h*3+2];
- var p=g[j*3],q=g[j*3+1];j=g[j*3+2];a.faces.push(new THREE.Face3(b,c,d,[new THREE.Vector3(g[f*3],g[f*3+1],g[f*3+2]),new THREE.Vector3(k,l,h),new THREE.Vector3(p,q,j)],null,e))},f4n:function(a,g,b,c,d,e,f,h,j,k,l){f=a.materials[f];var p=g[j*3],q=g[j*3+1];j=g[j*3+2];var m=g[k*3],t=g[k*3+1];k=g[k*3+2];var y=g[l*3],C=g[l*3+1];l=g[l*3+2];a.faces.push(new THREE.Face4(b,c,d,e,[new THREE.Vector3(g[h*3],g[h*3+1],g[h*3+2]),new THREE.Vector3(p,q,j),new THREE.Vector3(m,t,k),new THREE.Vector3(y,C,l)],null,f))},
- uv3:function(a,g,b,c,d,e,f){var h=[];h.push(new THREE.UV(g,b));h.push(new THREE.UV(c,d));h.push(new THREE.UV(e,f));a.push(h)},uv4:function(a,g,b,c,d,e,f,h,j){var k=[];k.push(new THREE.UV(g,b));k.push(new THREE.UV(c,d));k.push(new THREE.UV(e,f));k.push(new THREE.UV(h,j));a.push(k)}};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}
- THREE.MarchingCubes=function(a,g){THREE.Object3D.call(this);this.materials=g instanceof Array?g:[g];this.init=function(b){this.isolation=80;this.size=b;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(this.size3*3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=
- 0;this.hasPos=!1;this.hasNormal=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,c,d){return b+(c-b)*d};this.VIntX=function(b,c,d,e,f,h,j,k,l,p){f=(f-l)/(p-l);l=this.normal_cache;c[e]=h+f*this.delta;c[e+1]=j;c[e+2]=k;d[e]=this.lerp(l[b],l[b+3],f);d[e+1]=this.lerp(l[b+1],l[b+4],f);d[e+2]=this.lerp(l[b+2],l[b+5],f)};this.VIntY=function(b,c,d,e,f,h,j,k,l,p){f=(f-l)/(p-l);l=this.normal_cache;c[e]=h;c[e+1]=j+f*this.delta;c[e+
- 2]=k;c=b+this.yd*3;d[e]=this.lerp(l[b],l[c],f);d[e+1]=this.lerp(l[b+1],l[c+1],f);d[e+2]=this.lerp(l[b+2],l[c+2],f)};this.VIntZ=function(b,c,d,e,f,h,j,k,l,p){f=(f-l)/(p-l);l=this.normal_cache;c[e]=h;c[e+1]=j;c[e+2]=k+f*this.delta;c=b+this.zd*3;d[e]=this.lerp(l[b],l[c],f);d[e+1]=this.lerp(l[b+1],l[c+1],f);d[e+2]=this.lerp(l[b+2],l[c+2],f)};this.compNorm=function(b){var c=b*3;if(this.normal_cache[c]==0){this.normal_cache[c]=this.field[b-1]-this.field[b+1];this.normal_cache[c+1]=this.field[b-this.yd]-
- this.field[b+this.yd];this.normal_cache[c+2]=this.field[b-this.zd]-this.field[b+this.zd]}};this.polygonize=function(b,c,d,e,f,h){var j=e+1,k=e+this.yd,l=e+this.zd,p=j+this.yd,q=j+this.zd,m=e+this.yd+this.zd,t=j+this.yd+this.zd,y=0,C=this.field[e],x=this.field[j],z=this.field[k],n=this.field[p],H=this.field[l],D=this.field[q],M=this.field[m],F=this.field[t];C<f&&(y|=1);x<f&&(y|=2);z<f&&(y|=8);n<f&&(y|=4);H<f&&(y|=16);D<f&&(y|=32);M<f&&(y|=128);F<f&&(y|=64);var J=THREE.edgeTable[y];if(J==0)return 0;
- var I=this.delta,K=b+I,L=c+I;I=d+I;if(J&1){this.compNorm(e);this.compNorm(j);this.VIntX(e*3,this.vlist,this.nlist,0,f,b,c,d,C,x)}if(J&2){this.compNorm(j);this.compNorm(p);this.VIntY(j*3,this.vlist,this.nlist,3,f,K,c,d,x,n)}if(J&4){this.compNorm(k);this.compNorm(p);this.VIntX(k*3,this.vlist,this.nlist,6,f,b,L,d,z,n)}if(J&8){this.compNorm(e);this.compNorm(k);this.VIntY(e*3,this.vlist,this.nlist,9,f,b,c,d,C,z)}if(J&16){this.compNorm(l);this.compNorm(q);this.VIntX(l*3,this.vlist,this.nlist,12,f,b,c,I,
- H,D)}if(J&32){this.compNorm(q);this.compNorm(t);this.VIntY(q*3,this.vlist,this.nlist,15,f,K,c,I,D,F)}if(J&64){this.compNorm(m);this.compNorm(t);this.VIntX(m*3,this.vlist,this.nlist,18,f,b,L,I,M,F)}if(J&128){this.compNorm(l);this.compNorm(m);this.VIntY(l*3,this.vlist,this.nlist,21,f,b,c,I,H,M)}if(J&256){this.compNorm(e);this.compNorm(l);this.VIntZ(e*3,this.vlist,this.nlist,24,f,b,c,d,C,H)}if(J&512){this.compNorm(j);this.compNorm(q);this.VIntZ(j*3,this.vlist,this.nlist,27,f,K,c,d,x,D)}if(J&1024){this.compNorm(p);
- this.compNorm(t);this.VIntZ(p*3,this.vlist,this.nlist,30,f,K,L,d,n,F)}if(J&2048){this.compNorm(k);this.compNorm(m);this.VIntZ(k*3,this.vlist,this.nlist,33,f,b,L,d,z,M)}y<<=4;for(f=e=0;THREE.triTable[y+f]!=-1;){b=y+f;c=b+1;d=b+2;this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[c],3*THREE.triTable[d],h);f+=3;e++}return e};this.posnormtriv=function(b,c,d,e,f,h){var j=this.count*3;this.positionArray[j]=b[d];this.positionArray[j+1]=b[d+1];this.positionArray[j+2]=b[d+2];this.positionArray[j+
- 3]=b[e];this.positionArray[j+4]=b[e+1];this.positionArray[j+5]=b[e+2];this.positionArray[j+6]=b[f];this.positionArray[j+7]=b[f+1];this.positionArray[j+8]=b[f+2];this.normalArray[j]=c[d];this.normalArray[j+1]=c[d+1];this.normalArray[j+2]=c[d+2];this.normalArray[j+3]=c[e];this.normalArray[j+4]=c[e+1];this.normalArray[j+5]=c[e+2];this.normalArray[j+6]=c[f];this.normalArray[j+7]=c[f+1];this.normalArray[j+8]=c[f+2];this.hasPos=!0;this.hasNormal=!0;this.count+=3;this.count>=this.maxCount-3&&h(this)};this.begin=
- function(){this.count=0;this.hasPos=!1;this.hasNormal=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;c<this.positionArray.length;c++)this.positionArray[c]=0;b(this)}};this.addBall=function(b,c,d,e,f){var h=this.size*Math.sqrt(e/f),j=d*this.size,k=c*this.size,l=b*this.size,p=Math.floor(j-h);p<1&&(p=1);j=Math.floor(j+h);j>this.size-1&&(j=this.size-1);var q=Math.floor(k-h);q<1&&(q=1);k=Math.floor(k+h);k>this.size-1&&(k=this.size-1);var m=Math.floor(l-h);m<1&&(m=1);h=Math.floor(l+h);
- h>this.size-1&&(h=this.size-1);for(var t,y,C,x,z,n;p<j;p++){l=this.size2*p;y=p/this.size-d;z=y*y;for(y=q;y<k;y++){C=l+this.size*y;t=y/this.size-c;n=t*t;for(t=m;t<h;t++){x=t/this.size-b;x=e/(1.0E-6+x*x+n+z)-f;x>0&&(this.field[C+t]+=x)}}}};this.addPlaneX=function(b,c){var d,e,f,h,j,k=this.size,l=this.yd,p=this.zd,q=this.field,m=k*Math.sqrt(b/c);m>k&&(m=k);for(d=0;d<m;d++){e=d/k;e*=e;h=b/(1.0E-4+e)-c;if(h>0)for(e=0;e<k;e++){j=d+e*l;for(f=0;f<k;f++)q[p*f+j]+=h}}};this.addPlaneY=function(b,c){var d,e,
- f,h,j,k,l=this.size,p=this.yd,q=this.zd,m=this.field,t=l*Math.sqrt(b/c);t>l&&(t=l);for(e=0;e<t;e++){d=e/l;d*=d;h=b/(1.0E-4+d)-c;if(h>0){j=e*p;for(d=0;d<l;d++){k=j+d;for(f=0;f<l;f++)m[q*f+k]+=h}}}};this.addPlaneZ=function(b,c){var d,e,f,h,j,k;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/c);dist>size&&(dist=size);for(f=0;f<dist;f++){d=f/size;d*=d;h=b/(1.0E-4+d)-c;if(h>0){j=zd*f;for(e=0;e<size;e++){k=j+e*yd;for(d=0;d<size;d++)field[k+d]+=h}}}};this.reset=function(){var b;
- for(b=0;b<this.size3;b++){this.normal_cache[b*3]=0;this.field[b]=0}};this.render=function(b){this.begin();var c,d,e,f,h,j,k,l,p,q=this.size-2;for(f=1;f<q;f++){p=this.size2*f;k=(f-this.halfsize)/this.halfsize;for(e=1;e<q;e++){l=p+this.size*e;j=(e-this.halfsize)/this.halfsize;for(d=1;d<q;d++){h=(d-this.halfsize)/this.halfsize;c=l+d;this.polygonize(h,j,k,c,this.isolation,b)}}}this.end(b)};this.generateGeometry=function(){var b=0,c=new THREE.Geometry;this.render(function(d){var e,f,h,j,k,l,p,q;for(e=
- 0;e<d.count;e++){k=e*3;p=k+1;q=k+2;f=d.positionArray[k];h=d.positionArray[p];j=d.positionArray[q];l=new THREE.Vector3(f,h,j);f=d.normalArray[k];h=d.normalArray[p];j=d.normalArray[q];k=new THREE.Vector3(f,h,j);k.normalize();k=new THREE.Vertex(l,k);c.vertices.push(k)}nfaces=d.count/3;for(e=0;e<nfaces;e++){k=(b+e)*3;p=k+1;q=k+2;l=c.vertices[k].normal;f=c.vertices[p].normal;h=c.vertices[q].normal;k=new THREE.Face3(k,p,q,[l,f,h]);c.faces.push(k)}b+=nfaces;d.count=0});return c};this.init(a)};
- THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
- THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
- 1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,
- 419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]);
- THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,9,8,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,2,10,0,2,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,8,3,2,10,8,10,9,8,-1,-1,-1,-1,-1,-1,-1,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,8,11,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,11,-1,-1,-1,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