瀏覽代碼

Merge remote-tracking branch 'alteredq/dev' into experimental

zz85 14 年之前
父節點
當前提交
a15e0776d1
共有 61 個文件被更改,包括 1923 次插入4470 次删除
  1. 1 1
      REVISION
  2. 315 310
      build/Three.js
  3. 78 76
      build/custom/ThreeCanvas.js
  4. 39 38
      build/custom/ThreeDOM.js
  5. 7 4
      build/custom/ThreeExtras.js
  6. 54 52
      build/custom/ThreeSVG.js
  7. 122 121
      build/custom/ThreeWebGL.js
  8. 1 2
      examples/canvas_camera_orthographic.html
  9. 12 9
      examples/canvas_sandbox.html
  10. 91 0
      examples/js/postprocessing/BloomPass.js
  11. 50 0
      examples/js/postprocessing/DotScreenPass.js
  12. 77 0
      examples/js/postprocessing/EffectComposer.js
  13. 49 0
      examples/js/postprocessing/FilmPass.js
  14. 22 0
      examples/js/postprocessing/RenderPass.js
  15. 34 0
      examples/js/postprocessing/ScreenPass.js
  16. 44 0
      examples/js/postprocessing/SepiaPass.js
  17. 46 0
      examples/js/postprocessing/VignettePass.js
  18. 8 21
      examples/misc_lights_test.html
  19. 11 9
      examples/misc_ubiquity_test.html
  20. 0 3
      examples/obj/torus/.htaccess
  21. 0 1
      examples/obj/torus/Torus.mtl
  22. 0 1406
      examples/obj/torus/Torus.obj
  23. 二進制
      examples/obj/torus/Torus_bin.bin
  24. 0 25
      examples/obj/torus/Torus_bin.js
  25. 0 25
      examples/obj/torus/Torus_slim.js
  26. 4 5
      examples/webgl_collada.html
  27. 29 195
      examples/webgl_flycamera_earth.html
  28. 2 2
      examples/webgl_geometries.html
  29. 1 2
      examples/webgl_geometry_text.html
  30. 1 1
      examples/webgl_interactive_cubes.html
  31. 34 112
      examples/webgl_lines_colors.html
  32. 14 29
      examples/webgl_materials_normalmap.html
  33. 1 2
      examples/webgl_materials_video.html
  34. 141 143
      examples/webgl_particles_dynamic.html
  35. 177 115
      examples/webgl_postprocessing.html
  36. 9 10
      examples/webgl_postprocessing_dof.html
  37. 45 124
      examples/webgl_ribbons.html
  38. 26 36
      examples/webgl_rtt.html
  39. 12 9
      examples/webgl_sandbox.html
  40. 29 115
      examples/webgl_shader_lava.html
  41. 1 2
      examples/webgl_shadowmap.html
  42. 26 0
      src/cameras/OrthoCamera.js
  43. 22 11
      src/core/Ray.js
  44. 9 11
      src/core/UV.js
  45. 3 19
      src/core/Vector2.js
  46. 8 8
      src/core/Vector3.js
  47. 16 21
      src/core/Vector4.js
  48. 181 1
      src/extras/ShaderUtils.js
  49. 33 37
      src/extras/geometries/TorusGeometry.js
  50. 0 1325
      src/extras/io/LoaderOld.js
  51. 0 0
      src/extras/loaders/BinaryLoader.js
  52. 4 4
      src/extras/loaders/ColladaLoader.js
  53. 0 0
      src/extras/loaders/JSONLoader.js
  54. 0 0
      src/extras/loaders/Loader.js
  55. 0 0
      src/extras/loaders/SceneLoader.js
  56. 0 0
      src/extras/loaders/UTF8Loader.js
  57. 0 14
      src/materials/Mappings.js
  58. 7 2
      src/renderers/WebGLRenderer.js
  59. 0 0
      src/textures/DataTexture.js
  60. 13 0
      src/textures/Texture.js
  61. 14 12
      utils/build.py

+ 1 - 1
REVISION

@@ -1 +1 @@
-43
+44dev

+ 315 - 310
build/Three.js

@@ -1,51 +1,51 @@
-// Three.js r43 - http://github.com/mrdoob/three.js
+// Three.js r44dev - http://github.com/mrdoob/three.js
 var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this};
 var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this};
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var f,g,j;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),g=b*6-f,b=e*(1-c),j=e*(1-c*g),c=e*(1-c*(1-g)),f){case 1:this.r=j;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=j;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var f,g,j;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),g=b*6-f,b=e*(1-c),j=e*(1-c*g),c=e*(1-c*(1-g)),f){case 1:this.r=j;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=j;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=
 e;this.g=b;this.b=j;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
 e;this.g=b;this.b=j;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
-THREE.Vector2=function(b,c){this.set(b||0,c||0)};
+THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0};
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this},
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this},
 divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var c=this.x-b.x,b=this.y-b.y;return c*c+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)},
 divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var c=this.x-b.x,b=this.y-b.y;return c*c+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)},
-unit:function(){return this.normalize()},equals:function(b){return b.x==this.x&&b.y==this.y}};THREE.Vector3=function(b,c,e){this.set(b||0,c||0,e||0)};
+equals:function(b){return b.x==this.x&&b.y==this.y}};THREE.Vector3=function(b,c,e){this.x=b||0;this.y=c||0;this.z=e||0};
 THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(b,c,e){this.x=b;this.y=c;this.z=e;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;return this},addScalar:function(b){this.x+=b;this.y+=b;this.z+=b;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=
 THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(b,c,e){this.x=b;this.y=c;this.z=e;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;return this},addScalar:function(b){this.x+=b;this.y+=b;this.z+=b;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=
-b.z-c.z;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;return this},multiply:function(b,c){this.x=b.x*c.x;this.y=b.y*c.y;this.z=b.z*c.z;return this},multiplySelf:function(b){this.x*=b.x;this.y*=b.y;this.z*=b.z;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;return this},divideSelf:function(b){return this.divide(this,b)},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},
+b.z-c.z;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;return this},multiply:function(b,c){this.x=b.x*c.x;this.y=b.y*c.y;this.z=b.z*c.z;return this},multiplySelf:function(b){this.x*=b.x;this.y*=b.y;this.z*=b.z;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;return this},divideSelf:function(b){this.x/=b.x;this.y/=b.y;this.z/=b.z;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},
 dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},cross:function(b,c){this.x=b.y*c.z-b.z*c.y;this.y=b.z*c.x-b.x*c.z;this.z=b.x*c.y-b.y*c.x;return this},crossSelf:function(b){return this.set(this.y*
 dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},cross:function(b,c){this.x=b.y*c.z-b.z*c.y;this.y=b.z*c.x-b.x*c.z;this.z=b.x*c.y-b.y*c.x;return this},crossSelf:function(b){return this.set(this.y*
 b.z-this.z*b.y,this.z*b.x-this.x*b.z,this.x*b.y-this.y*b.x)},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){return(new THREE.Vector3).sub(this,b).lengthSq()},setPositionFromMatrix:function(b){this.x=b.n14;this.y=b.n24;this.z=b.n34},setRotationFromMatrix:function(b){var c=Math.cos(this.y);this.y=Math.asin(b.n13);Math.abs(c)>1.0E-5?(this.x=Math.atan2(-b.n23/c,b.n33/c),this.z=Math.atan2(-b.n12/c,b.n11/c)):(this.x=0,this.z=Math.atan2(b.n21,b.n22))},isZero:function(){return this.lengthSq()<
 b.z-this.z*b.y,this.z*b.x-this.x*b.z,this.x*b.y-this.y*b.x)},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){return(new THREE.Vector3).sub(this,b).lengthSq()},setPositionFromMatrix:function(b){this.x=b.n14;this.y=b.n24;this.z=b.n34},setRotationFromMatrix:function(b){var c=Math.cos(this.y);this.y=Math.asin(b.n13);Math.abs(c)>1.0E-5?(this.x=Math.atan2(-b.n23/c,b.n33/c),this.z=Math.atan2(-b.n12/c,b.n11/c)):(this.x=0,this.z=Math.atan2(b.n21,b.n22))},isZero:function(){return this.lengthSq()<
-1.0E-4}};THREE.Vector4=function(b,c,e,f){this.set(b||0,c||0,e||0,f||1)};
-THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){return this.set(b.x,b.y,b.z,b.w||1)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;this.w=b.w+c.w;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;this.w+=b.w;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=b.z-c.z;this.w=b.w-c.w;return this},
-subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;this.w-=b.w;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;this.w*=b;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b,this.w/=b):this.set(0,0,0,1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z+this.w*b.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},
-setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3};
-THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,f=[];c=0;for(e=b.length;c<e;c++)f=f.concat(this.intersectObject(b[c]));f.sort(function(b,c){return b.distance-c.distance});return f},intersectObject:function(b){function c(b,c,e){var f,e=e.matrixWorld.getPosition();f=e.clone().subSelf(b).dot(c);b=b.clone().addSelf(c.clone().multiplyScalar(f));return e.distanceTo(b)}function e(b,c,e,f){var f=f.clone().subSelf(c),
-e=e.clone().subSelf(c),g=b.clone().subSelf(c),b=f.dot(f),c=f.dot(e),f=f.dot(g),h=e.dot(e),e=e.dot(g),g=1/(b*h-c*c),h=(h*f-c*e)*g,b=(b*e-c*f)*g;return h>0&&b>0&&h+b<1}if(b instanceof THREE.Particle){var f=c(this.origin,this.direction,b);if(!f||f>b.scale.x)return[];return[{distance:f,point:b.position,face:null,object:b}]}else if(b instanceof THREE.Mesh){f=c(this.origin,this.direction,b);if(!f||f>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return[];var g,j,h,k,
-n,o,p,u,v,t,y=b.geometry,w=y.vertices,A=[],f=0;for(g=y.faces.length;f<g;f++)if(j=y.faces[f],v=this.origin.clone(),t=this.direction.clone(),o=b.matrixWorld,h=o.multiplyVector3(w[j.a].position.clone()),k=o.multiplyVector3(w[j.b].position.clone()),n=o.multiplyVector3(w[j.c].position.clone()),o=j instanceof THREE.Face4?o.multiplyVector3(w[j.d].position.clone()):null,p=b.matrixRotationWorld.multiplyVector3(j.normal.clone()),u=t.dot(p),b.doubleSided||(b.flipSided?u>0:u<0))if(p=p.dot((new THREE.Vector3).sub(h,
-v))/u,v=v.addSelf(t.multiplyScalar(p)),j instanceof THREE.Face3)e(v,h,k,n)&&(j={distance:this.origin.distanceTo(v),point:v,face:j,object:b},A.push(j));else if(j instanceof THREE.Face4&&(e(v,h,k,o)||e(v,k,n,o)))j={distance:this.origin.distanceTo(v),point:v,face:j,object:b},A.push(j);return A}else return[]}};
+1.0E-4}};THREE.Vector4=function(b,c,e,f){this.x=b||0;this.y=c||0;this.z=e||0;this.w=f||1};
+THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w||1},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;this.w=b.w+c.w;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;this.w+=b.w;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=b.z-c.z;this.w=
+b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;this.w-=b.w;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;this.w*=b;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b,this.w/=b):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z+this.w*b.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
+normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3};
+THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,f=[];c=0;for(e=b.length;c<e;c++)f=f.concat(this.intersectObject(b[c]));f.sort(function(b,c){return b.distance-c.distance});return f},intersectObject:function(b){function c(b,c,e){var f;f=e.clone().subSelf(b).dot(c);if(f<=0)return null;b=b.clone().addSelf(c.clone().multiplyScalar(f));return e.distanceTo(b)}function e(b,c,e,f){var f=f.clone().subSelf(c),
+e=e.clone().subSelf(c),g=b.clone().subSelf(c),b=f.dot(f),c=f.dot(e),f=f.dot(g),h=e.dot(e),e=e.dot(g),g=1/(b*h-c*c),h=(h*f-c*e)*g,b=(b*e-c*f)*g;return h>0&&b>0&&h+b<1}if(b instanceof THREE.Particle){var f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.scale.x)return[];return[{distance:f,point:b.position,face:null,object:b}]}else if(b instanceof THREE.Mesh){f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.geometry.boundingSphere.radius*Math.max(b.scale.x,
+Math.max(b.scale.y,b.scale.z)))return[];var g,j,h,k,m,o,p,u,v,t,x=b.geometry,w=x.vertices,A=[],f=0;for(g=x.faces.length;f<g;f++)if(j=x.faces[f],v=this.origin.clone(),t=this.direction.clone(),o=b.matrixWorld,h=o.multiplyVector3(j.centroid.clone()).subSelf(v),u=h.dot(t),!(u<=0)&&(h=o.multiplyVector3(w[j.a].position.clone()),k=o.multiplyVector3(w[j.b].position.clone()),m=o.multiplyVector3(w[j.c].position.clone()),o=j instanceof THREE.Face4?o.multiplyVector3(w[j.d].position.clone()):null,p=b.matrixRotationWorld.multiplyVector3(j.normal.clone()),
+u=t.dot(p),b.doubleSided||(b.flipSided?u>0:u<0)))if(u=p.dot((new THREE.Vector3).sub(h,v))/u,v=v.addSelf(t.multiplyScalar(u)),j instanceof THREE.Face3)e(v,h,k,m)&&(j={distance:this.origin.distanceTo(v),point:v,face:j,object:b},A.push(j));else if(j instanceof THREE.Face4&&(e(v,h,k,o)||e(v,k,m,o)))j={distance:this.origin.distanceTo(v),point:v,face:j,object:b},A.push(j);A.sort(function(b,c){return b.distance-c.distance});return A}else return[]}};
 THREE.Rectangle=function(){function b(){j=f-c;h=g-e}var c,e,f,g,j,h,k=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return j};this.getHeight=function(){return h};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return g};this.set=function(h,j,p,u){k=!1;c=h;e=j;f=p;g=u;b()};this.addPoint=function(h,j){k?(k=!1,c=h,e=j,f=h,g=j):(c=c<h?c:h,e=e<j?e:j,f=f>h?f:h,g=g>j?g:j);b()};this.add3Points=
 THREE.Rectangle=function(){function b(){j=f-c;h=g-e}var c,e,f,g,j,h,k=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return j};this.getHeight=function(){return h};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return g};this.set=function(h,j,p,u){k=!1;c=h;e=j;f=p;g=u;b()};this.addPoint=function(h,j){k?(k=!1,c=h,e=j,f=h,g=j):(c=c<h?c:h,e=e<j?e:j,f=f>h?f:h,g=g>j?g:j);b()};this.add3Points=
 function(h,j,p,u,v,t){k?(k=!1,c=h<p?h<v?h:v:p<v?p:v,e=j<u?j<t?j:t:u<t?u:t,f=h>p?h>v?h:v:p>v?p:v,g=j>u?j>t?j:t:u>t?u:t):(c=h<p?h<v?h<c?h:c:v<c?v:c:p<v?p<c?p:c:v<c?v:c,e=j<u?j<t?j<e?j:e:t<e?t:e:u<t?u<e?u:e:t<e?t:e,f=h>p?h>v?h>f?h:f:v>f?v:f:p>v?p>f?p:f:v>f?v:f,g=j>u?j>t?j>g?j:g:t>g?t:g:u>t?u>g?u:g:t>g?t:g);b()};this.addRectangle=function(h){k?(k=!1,c=h.getLeft(),e=h.getTop(),f=h.getRight(),g=h.getBottom()):(c=c<h.getLeft()?c:h.getLeft(),e=e<h.getTop()?e:h.getTop(),f=f>h.getRight()?f:h.getRight(),g=g>
 function(h,j,p,u,v,t){k?(k=!1,c=h<p?h<v?h:v:p<v?p:v,e=j<u?j<t?j:t:u<t?u:t,f=h>p?h>v?h:v:p>v?p:v,g=j>u?j>t?j:t:u>t?u:t):(c=h<p?h<v?h<c?h:c:v<c?v:c:p<v?p<c?p:c:v<c?v:c,e=j<u?j<t?j<e?j:e:t<e?t:e:u<t?u<e?u:e:t<e?t:e,f=h>p?h>v?h>f?h:f:v>f?v:f:p>v?p>f?p:f:v>f?v:f,g=j>u?j>t?j>g?j:g:t>g?t:g:u>t?u>g?u:g:t>g?t:g);b()};this.addRectangle=function(h){k?(k=!1,c=h.getLeft(),e=h.getTop(),f=h.getRight(),g=h.getBottom()):(c=c<h.getLeft()?c:h.getLeft(),e=e<h.getTop()?e:h.getTop(),f=f>h.getRight()?f:h.getRight(),g=g>
 h.getBottom()?g:h.getBottom());b()};this.inflate=function(h){c-=h;e-=h;f+=h;g+=h;b()};this.minSelf=function(h){c=c>h.getLeft()?c:h.getLeft();e=e>h.getTop()?e:h.getTop();f=f<h.getRight()?f:h.getRight();g=g<h.getBottom()?g:h.getBottom();b()};this.instersects=function(b){return Math.min(f,b.getRight())-Math.max(c,b.getLeft())>=0&&Math.min(g,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){k=!0;g=f=e=c=0;b()};this.isEmpty=function(){return k}};THREE.Matrix3=function(){this.m=[]};
 h.getBottom()?g:h.getBottom());b()};this.inflate=function(h){c-=h;e-=h;f+=h;g+=h;b()};this.minSelf=function(h){c=c>h.getLeft()?c:h.getLeft();e=e>h.getTop()?e:h.getTop();f=f<h.getRight()?f:h.getRight();g=g<h.getBottom()?g:h.getBottom();b()};this.instersects=function(b){return Math.min(f,b.getRight())-Math.max(c,b.getLeft())>=0&&Math.min(g,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){k=!0;g=f=e=c=0;b()};this.isEmpty=function(){return k}};THREE.Matrix3=function(){this.m=[]};
-THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}};THREE.Matrix4=function(b,c,e,f,g,j,h,k,n,o,p,u,v,t,y,w){this.set(b||1,c||0,e||0,f||0,g||0,j||1,h||0,k||0,n||0,o||0,p||1,u||0,v||0,t||0,y||0,w||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,g,j,h,k,n,o,p,u,v,t,y,w){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=g;this.n22=j;this.n23=h;this.n24=k;this.n31=n;this.n32=o;this.n33=p;this.n34=u;this.n41=v;this.n42=t;this.n43=y;this.n44=w;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b,
+THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}};THREE.Matrix4=function(b,c,e,f,g,j,h,k,m,o,p,u,v,t,x,w){this.set(b||1,c||0,e||0,f||0,g||0,j||1,h||0,k||0,m||0,o||0,p||1,u||0,v||0,t||0,x||0,w||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,g,j,h,k,m,o,p,u,v,t,x,w){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=g;this.n22=j;this.n23=h;this.n24=k;this.n31=m;this.n32=o;this.n33=p;this.n34=u;this.n41=v;this.n42=t;this.n43=x;this.n44=w;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b,
 c,e){var f=THREE.Matrix4.__v1,g=THREE.Matrix4.__v2,j=THREE.Matrix4.__v3;j.sub(b,c).normalize();if(j.length()===0)j.z=1;f.cross(e,j).normalize();f.length()===0&&(j.x+=1.0E-4,f.cross(e,j).normalize());g.cross(j,f).normalize();this.n11=f.x;this.n12=g.x;this.n13=j.x;this.n21=f.y;this.n22=g.y;this.n23=j.y;this.n31=f.z;this.n32=g.z;this.n33=j.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,f=b.z,g=1/(this.n41*c+this.n42*e+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*e+this.n13*f+this.n14)*g;
 c,e){var f=THREE.Matrix4.__v1,g=THREE.Matrix4.__v2,j=THREE.Matrix4.__v3;j.sub(b,c).normalize();if(j.length()===0)j.z=1;f.cross(e,j).normalize();f.length()===0&&(j.x+=1.0E-4,f.cross(e,j).normalize());g.cross(j,f).normalize();this.n11=f.x;this.n12=g.x;this.n13=j.x;this.n21=f.y;this.n22=g.y;this.n23=j.y;this.n31=f.z;this.n32=g.z;this.n33=j.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,f=b.z,g=1/(this.n41*c+this.n42*e+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*e+this.n13*f+this.n14)*g;
 b.y=(this.n21*c+this.n22*e+this.n23*f+this.n24)*g;b.z=(this.n31*c+this.n32*e+this.n33*f+this.n34)*g;return b},multiplyVector4:function(b){var c=b.x,e=b.y,f=b.z,g=b.w;b.x=this.n11*c+this.n12*e+this.n13*f+this.n14*g;b.y=this.n21*c+this.n22*e+this.n23*f+this.n24*g;b.z=this.n31*c+this.n32*e+this.n33*f+this.n34*g;b.w=this.n41*c+this.n42*e+this.n43*f+this.n44*g;return b},rotateAxis:function(b){var c=b.x,e=b.y,f=b.z;b.x=c*this.n11+e*this.n12+f*this.n13;b.y=c*this.n21+e*this.n22+f*this.n23;b.z=c*this.n31+
 b.y=(this.n21*c+this.n22*e+this.n23*f+this.n24)*g;b.z=(this.n31*c+this.n32*e+this.n33*f+this.n34)*g;return b},multiplyVector4:function(b){var c=b.x,e=b.y,f=b.z,g=b.w;b.x=this.n11*c+this.n12*e+this.n13*f+this.n14*g;b.y=this.n21*c+this.n22*e+this.n23*f+this.n24*g;b.z=this.n31*c+this.n32*e+this.n33*f+this.n34*g;b.w=this.n41*c+this.n42*e+this.n43*f+this.n44*g;return b},rotateAxis:function(b){var c=b.x,e=b.y,f=b.z;b.x=c*this.n11+e*this.n12+f*this.n13;b.y=c*this.n21+e*this.n22+f*this.n23;b.z=c*this.n31+
-e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,g=b.n13,j=b.n14,h=b.n21,k=b.n22,n=b.n23,o=b.n24,p=b.n31,u=b.n32,v=b.n33,t=b.n34,y=b.n41,w=b.n42,A=b.n43,x=b.n44,G=c.n11,D=c.n12,
-I=c.n13,J=c.n14,C=c.n21,B=c.n22,L=c.n23,E=c.n24,V=c.n31,H=c.n32,S=c.n33,K=c.n34,Q=c.n41,m=c.n42,T=c.n43,X=c.n44;this.n11=e*G+f*C+g*V+j*Q;this.n12=e*D+f*B+g*H+j*m;this.n13=e*I+f*L+g*S+j*T;this.n14=e*J+f*E+g*K+j*X;this.n21=h*G+k*C+n*V+o*Q;this.n22=h*D+k*B+n*H+o*m;this.n23=h*I+k*L+n*S+o*T;this.n24=h*J+k*E+n*K+o*X;this.n31=p*G+u*C+v*V+t*Q;this.n32=p*D+u*B+v*H+t*m;this.n33=p*I+u*L+v*S+t*T;this.n34=p*J+u*E+v*K+t*X;this.n41=y*G+w*C+A*V+x*Q;this.n42=y*D+w*B+A*H+x*m;this.n43=y*I+w*L+A*S+x*T;this.n44=y*J+w*
-E+A*K+x*X;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=b;this.n31*=
-b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,g=this.n21,j=this.n22,h=this.n23,k=this.n24,n=this.n31,o=this.n32,p=this.n33,u=this.n34,v=this.n41,t=this.n42,y=this.n43,w=this.n44;return f*h*o*v-e*k*o*v-f*j*p*v+c*k*p*v+e*j*u*v-c*h*u*v-f*h*n*t+e*k*n*t+f*g*p*t-b*k*p*t-e*g*u*t+b*h*u*t+f*j*n*y-c*k*n*y-f*g*o*y+b*k*o*y+c*g*u*y-b*j*u*y-e*j*n*w+c*h*n*w+e*g*o*w-b*h*o*w-c*g*p*w+b*j*p*w},
+e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,g=b.n13,j=b.n14,h=b.n21,k=b.n22,m=b.n23,o=b.n24,p=b.n31,u=b.n32,v=b.n33,t=b.n34,x=b.n41,w=b.n42,A=b.n43,y=b.n44,G=c.n11,D=c.n12,
+I=c.n13,J=c.n14,C=c.n21,B=c.n22,L=c.n23,E=c.n24,V=c.n31,H=c.n32,S=c.n33,K=c.n34,Q=c.n41,n=c.n42,T=c.n43,X=c.n44;this.n11=e*G+f*C+g*V+j*Q;this.n12=e*D+f*B+g*H+j*n;this.n13=e*I+f*L+g*S+j*T;this.n14=e*J+f*E+g*K+j*X;this.n21=h*G+k*C+m*V+o*Q;this.n22=h*D+k*B+m*H+o*n;this.n23=h*I+k*L+m*S+o*T;this.n24=h*J+k*E+m*K+o*X;this.n31=p*G+u*C+v*V+t*Q;this.n32=p*D+u*B+v*H+t*n;this.n33=p*I+u*L+v*S+t*T;this.n34=p*J+u*E+v*K+t*X;this.n41=x*G+w*C+A*V+y*Q;this.n42=x*D+w*B+A*H+y*n;this.n43=x*I+w*L+A*S+y*T;this.n44=x*J+w*
+E+A*K+y*X;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=b;this.n31*=
+b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,g=this.n21,j=this.n22,h=this.n23,k=this.n24,m=this.n31,o=this.n32,p=this.n33,u=this.n34,v=this.n41,t=this.n42,x=this.n43,w=this.n44;return f*h*o*v-e*k*o*v-f*j*p*v+c*k*p*v+e*j*u*v-c*h*u*v-f*h*m*t+e*k*m*t+f*g*p*t-b*k*p*t-e*g*u*t+b*h*u*t+f*j*m*x-c*k*m*x-f*g*o*x+b*k*o*x+c*g*u*x-b*j*u*x-e*j*m*w+c*h*m*w+e*g*o*w-b*h*o*w-c*g*p*w+b*j*p*w},
 transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32;b.n33=this.n33;b.n34=this.n34;
 transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32;b.n33=this.n33;b.n34=this.n34;
 b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]=this.n11;
 b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]=this.n11;
 b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=this.n34;
 b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=this.n34;
 b[c+15]=this.n44;return b},setTranslation:function(b,c,e){this.set(1,0,0,b,0,1,0,c,0,0,1,e,0,0,0,1);return this},setScale:function(b,c,e){this.set(b,0,0,0,0,c,0,0,0,0,e,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,-b,0,0,b,c,0,0,
 b[c+15]=this.n44;return b},setTranslation:function(b,c,e){this.set(1,0,0,b,0,1,0,c,0,0,1,e,0,0,0,1);return this},setScale:function(b,c,e){this.set(b,0,0,0,0,c,0,0,0,0,e,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,-b,0,0,b,c,0,0,
-0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),f=Math.sin(c),g=1-e,j=b.x,h=b.y,k=b.z,n=g*j,o=g*h;this.set(n*j+e,n*h-f*k,n*k+f*h,0,n*h+f*k,o*h+e,o*k-f*j,0,n*k-f*h,o*k+f*j,g*k*k+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
-new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,f=b.y,g=b.z,j=Math.cos(e),e=Math.sin(e),h=Math.cos(f),f=Math.sin(f),k=Math.cos(g),g=Math.sin(g);switch(c){case "YXZ":var n=
-h*k,o=h*g,p=f*k,u=f*g;this.n11=n+u*e;this.n12=p*e-o;this.n13=j*f;this.n21=j*g;this.n22=j*k;this.n23=-e;this.n31=o*e-p;this.n32=u+n*e;this.n33=j*h;break;case "ZXY":n=h*k;o=h*g;p=f*k;u=f*g;this.n11=n-u*e;this.n12=-j*g;this.n13=p+o*e;this.n21=o+p*e;this.n22=j*k;this.n23=u-n*e;this.n31=-j*f;this.n32=e;this.n33=j*h;break;case "ZYX":n=j*k;o=j*g;p=e*k;u=e*g;this.n11=h*k;this.n12=p*f-o;this.n13=n*f+u;this.n21=h*g;this.n22=u*f+n;this.n23=o*f-p;this.n31=-f;this.n32=e*h;this.n33=j*h;break;case "YZX":n=j*h;o=
-j*f;p=e*h;u=e*f;this.n11=h*k;this.n12=u-n*g;this.n13=p*g+o;this.n21=g;this.n22=j*k;this.n23=-e*k;this.n31=-f*k;this.n32=o*g+p;this.n33=n-u*g;break;case "XZY":n=j*h;o=j*f;p=e*h;u=e*f;this.n11=h*k;this.n12=-g;this.n13=f*k;this.n21=n*g+u;this.n22=j*k;this.n23=o*g-p;this.n31=p*g-o;this.n32=e*k;this.n33=u*g+n;break;default:n=j*k,o=j*g,p=e*k,u=e*g,this.n11=h*k,this.n12=-h*g,this.n13=f,this.n21=o+p*f,this.n22=n-u*f,this.n23=-e*h,this.n31=u-n*f,this.n32=p+o*f,this.n33=j*h}return this},setRotationFromQuaternion:function(b){var c=
-b.x,e=b.y,f=b.z,g=b.w,j=c+c,h=e+e,k=f+f,b=c*j,n=c*h;c*=k;var o=e*h;e*=k;f*=k;j*=g;h*=g;g*=k;this.n11=1-(o+f);this.n12=n-g;this.n13=c+h;this.n21=n+g;this.n22=1-(b+f);this.n23=e-j;this.n31=c-h;this.n32=e+j;this.n33=1-(b+o);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var f=THREE.Matrix4.__m1,g=THREE.Matrix4.__m2;
+0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),f=Math.sin(c),g=1-e,j=b.x,h=b.y,k=b.z,m=g*j,o=g*h;this.set(m*j+e,m*h-f*k,m*k+f*h,0,m*h+f*k,o*h+e,o*k-f*j,0,m*k-f*h,o*k+f*j,g*k*k+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
+new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,f=b.y,g=b.z,j=Math.cos(e),e=Math.sin(e),h=Math.cos(f),f=Math.sin(f),k=Math.cos(g),g=Math.sin(g);switch(c){case "YXZ":var m=
+h*k,o=h*g,p=f*k,u=f*g;this.n11=m+u*e;this.n12=p*e-o;this.n13=j*f;this.n21=j*g;this.n22=j*k;this.n23=-e;this.n31=o*e-p;this.n32=u+m*e;this.n33=j*h;break;case "ZXY":m=h*k;o=h*g;p=f*k;u=f*g;this.n11=m-u*e;this.n12=-j*g;this.n13=p+o*e;this.n21=o+p*e;this.n22=j*k;this.n23=u-m*e;this.n31=-j*f;this.n32=e;this.n33=j*h;break;case "ZYX":m=j*k;o=j*g;p=e*k;u=e*g;this.n11=h*k;this.n12=p*f-o;this.n13=m*f+u;this.n21=h*g;this.n22=u*f+m;this.n23=o*f-p;this.n31=-f;this.n32=e*h;this.n33=j*h;break;case "YZX":m=j*h;o=
+j*f;p=e*h;u=e*f;this.n11=h*k;this.n12=u-m*g;this.n13=p*g+o;this.n21=g;this.n22=j*k;this.n23=-e*k;this.n31=-f*k;this.n32=o*g+p;this.n33=m-u*g;break;case "XZY":m=j*h;o=j*f;p=e*h;u=e*f;this.n11=h*k;this.n12=-g;this.n13=f*k;this.n21=m*g+u;this.n22=j*k;this.n23=o*g-p;this.n31=p*g-o;this.n32=e*k;this.n33=u*g+m;break;default:m=j*k,o=j*g,p=e*k,u=e*g,this.n11=h*k,this.n12=-h*g,this.n13=f,this.n21=o+p*f,this.n22=m-u*f,this.n23=-e*h,this.n31=u-m*f,this.n32=p+o*f,this.n33=j*h}return this},setRotationFromQuaternion:function(b){var c=
+b.x,e=b.y,f=b.z,g=b.w,j=c+c,h=e+e,k=f+f,b=c*j,m=c*h;c*=k;var o=e*h;e*=k;f*=k;j*=g;h*=g;g*=k;this.n11=1-(o+f);this.n12=m-g;this.n13=c+h;this.n21=m+g;this.n22=1-(b+f);this.n23=e-j;this.n31=c-h;this.n32=e+j;this.n33=1-(b+o);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var f=THREE.Matrix4.__m1,g=THREE.Matrix4.__m2;
 f.identity();f.setRotationFromQuaternion(c);g.setScale(e.x,e.y,e.z);this.multiply(f,g);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var f=THREE.Matrix4.__v1,g=THREE.Matrix4.__v2,j=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);g.set(this.n12,this.n22,this.n32);j.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;e=e instanceof THREE.Vector3?e:new THREE.Vector3;e.x=f.length();
 f.identity();f.setRotationFromQuaternion(c);g.setScale(e.x,e.y,e.z);this.multiply(f,g);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var f=THREE.Matrix4.__v1,g=THREE.Matrix4.__v2,j=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);g.set(this.n12,this.n22,this.n32);j.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;e=e instanceof THREE.Vector3?e:new THREE.Vector3;e.x=f.length();
 e.y=g.length();e.z=j.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=e.x;f.n21/=e.x;f.n31/=e.x;f.n12/=e.y;f.n22/=e.y;f.n32/=e.y;f.n13/=e.z;f.n23/=e.z;f.n33/=e.z;c.setFromRotationMatrix(f);return[b,c,e]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var e=1/c.x,f=1/c.y,g=1/c.z;this.n11=b.n11*e;this.n21=b.n21*e;this.n31=b.n31*e;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*g;this.n23=
 e.y=g.length();e.z=j.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=e.x;f.n21/=e.x;f.n31/=e.x;f.n12/=e.y;f.n22/=e.y;f.n32/=e.y;f.n13/=e.z;f.n23/=e.z;f.n33/=e.z;c.setFromRotationMatrix(f);return[b,c,e]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var e=1/c.x,f=1/c.y,g=1/c.z;this.n11=b.n11*e;this.n21=b.n21*e;this.n31=b.n31*e;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*g;this.n23=
 b.n23*g;this.n33=b.n33*g}};
 b.n23*g;this.n33=b.n33*g}};
-THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,g=b.n13,j=b.n14,h=b.n21,k=b.n22,n=b.n23,o=b.n24,p=b.n31,u=b.n32,v=b.n33,t=b.n34,y=b.n41,w=b.n42,A=b.n43,x=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=n*t*w-o*v*w+o*u*A-k*t*A-n*u*x+k*v*x;c.n12=j*v*w-g*t*w-j*u*A+f*t*A+g*u*x-f*v*x;c.n13=g*o*w-j*n*w+j*k*A-f*o*A-g*k*x+f*n*x;c.n14=j*n*u-g*o*u-j*k*v+f*o*v+g*k*t-f*n*t;c.n21=o*v*y-n*t*y-o*p*A+h*t*A+n*p*x-h*v*x;c.n22=g*t*y-j*v*y+j*p*A-e*t*A-g*p*x+e*v*x;c.n23=j*n*y-g*o*y-j*h*A+e*o*A+g*h*x-e*n*x;c.n24=
-g*o*p-j*n*p+j*h*v-e*o*v-g*h*t+e*n*t;c.n31=k*t*y-o*u*y+o*p*w-h*t*w-k*p*x+h*u*x;c.n32=j*u*y-f*t*y-j*p*w+e*t*w+f*p*x-e*u*x;c.n33=g*o*y-j*k*y+j*h*w-e*o*w-f*h*x+e*k*x;c.n34=j*k*p-f*o*p-j*h*u+e*o*u+f*h*t-e*k*t;c.n41=n*u*y-k*v*y-n*p*w+h*v*w+k*p*A-h*u*A;c.n42=f*v*y-g*u*y+g*p*w-e*v*w-f*p*A+e*u*A;c.n43=g*k*y-f*n*y-g*h*w+e*n*w+f*h*A-e*k*A;c.n44=f*n*p-g*k*p+g*h*u-e*n*u-f*h*v+e*k*v;c.multiplyScalar(1/b.determinant());return c};
-THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,f=b.n33*b.n22-b.n32*b.n23,g=-b.n33*b.n21+b.n31*b.n23,j=b.n32*b.n21-b.n31*b.n22,h=-b.n33*b.n12+b.n32*b.n13,k=b.n33*b.n11-b.n31*b.n13,n=-b.n32*b.n11+b.n31*b.n12,o=b.n23*b.n12-b.n22*b.n13,p=-b.n23*b.n11+b.n21*b.n13,u=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*h+b.n31*o;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*g;e[2]=b*j;e[3]=b*h;e[4]=b*k;e[5]=b*n;e[6]=b*o;e[7]=b*p;e[8]=b*u;return c};
+THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,g=b.n13,j=b.n14,h=b.n21,k=b.n22,m=b.n23,o=b.n24,p=b.n31,u=b.n32,v=b.n33,t=b.n34,x=b.n41,w=b.n42,A=b.n43,y=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=m*t*w-o*v*w+o*u*A-k*t*A-m*u*y+k*v*y;c.n12=j*v*w-g*t*w-j*u*A+f*t*A+g*u*y-f*v*y;c.n13=g*o*w-j*m*w+j*k*A-f*o*A-g*k*y+f*m*y;c.n14=j*m*u-g*o*u-j*k*v+f*o*v+g*k*t-f*m*t;c.n21=o*v*x-m*t*x-o*p*A+h*t*A+m*p*y-h*v*y;c.n22=g*t*x-j*v*x+j*p*A-e*t*A-g*p*y+e*v*y;c.n23=j*m*x-g*o*x-j*h*A+e*o*A+g*h*y-e*m*y;c.n24=
+g*o*p-j*m*p+j*h*v-e*o*v-g*h*t+e*m*t;c.n31=k*t*x-o*u*x+o*p*w-h*t*w-k*p*y+h*u*y;c.n32=j*u*x-f*t*x-j*p*w+e*t*w+f*p*y-e*u*y;c.n33=g*o*x-j*k*x+j*h*w-e*o*w-f*h*y+e*k*y;c.n34=j*k*p-f*o*p-j*h*u+e*o*u+f*h*t-e*k*t;c.n41=m*u*x-k*v*x-m*p*w+h*v*w+k*p*A-h*u*A;c.n42=f*v*x-g*u*x+g*p*w-e*v*w-f*p*A+e*u*A;c.n43=g*k*x-f*m*x-g*h*w+e*m*w+f*h*A-e*k*A;c.n44=f*m*p-g*k*p+g*h*u-e*m*u-f*h*v+e*k*v;c.multiplyScalar(1/b.determinant());return c};
+THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,f=b.n33*b.n22-b.n32*b.n23,g=-b.n33*b.n21+b.n31*b.n23,j=b.n32*b.n21-b.n31*b.n22,h=-b.n33*b.n12+b.n32*b.n13,k=b.n33*b.n11-b.n31*b.n13,m=-b.n32*b.n11+b.n31*b.n12,o=b.n23*b.n12-b.n22*b.n13,p=-b.n23*b.n11+b.n21*b.n13,u=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*h+b.n31*o;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*g;e[2]=b*j;e[3]=b*h;e[4]=b*k;e[5]=b*m;e[6]=b*o;e[7]=b*p;e[8]=b*u;return c};
 THREE.Matrix4.makeFrustum=function(b,c,e,f,g,j){var h;h=new THREE.Matrix4;h.n11=2*g/(c-b);h.n12=0;h.n13=(c+b)/(c-b);h.n14=0;h.n21=0;h.n22=2*g/(f-e);h.n23=(f+e)/(f-e);h.n24=0;h.n31=0;h.n32=0;h.n33=-(j+g)/(j-g);h.n34=-2*j*g/(j-g);h.n41=0;h.n42=0;h.n43=-1;h.n44=0;return h};THREE.Matrix4.makePerspective=function(b,c,e,f){var g,b=e*Math.tan(b*Math.PI/360);g=-b;return THREE.Matrix4.makeFrustum(g*c,b*c,g,b,e,f)};
 THREE.Matrix4.makeFrustum=function(b,c,e,f,g,j){var h;h=new THREE.Matrix4;h.n11=2*g/(c-b);h.n12=0;h.n13=(c+b)/(c-b);h.n14=0;h.n21=0;h.n22=2*g/(f-e);h.n23=(f+e)/(f-e);h.n24=0;h.n31=0;h.n32=0;h.n33=-(j+g)/(j-g);h.n34=-2*j*g/(j-g);h.n41=0;h.n42=0;h.n43=-1;h.n44=0;return h};THREE.Matrix4.makePerspective=function(b,c,e,f){var g,b=e*Math.tan(b*Math.PI/360);g=-b;return THREE.Matrix4.makeFrustum(g*c,b*c,g,b,e,f)};
-THREE.Matrix4.makeOrtho=function(b,c,e,f,g,j){var h,k,n,o;h=new THREE.Matrix4;k=c-b;n=e-f;o=j-g;h.n11=2/k;h.n12=0;h.n13=0;h.n14=-((c+b)/k);h.n21=0;h.n22=2/n;h.n23=0;h.n24=-((e+f)/n);h.n31=0;h.n32=0;h.n33=-2/o;h.n34=-((j+g)/o);h.n41=0;h.n42=0;h.n43=0;h.n44=1;return h};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
+THREE.Matrix4.makeOrtho=function(b,c,e,f,g,j){var h,k,m,o;h=new THREE.Matrix4;k=c-b;m=e-f;o=j-g;h.n11=2/k;h.n12=0;h.n13=0;h.n14=-((c+b)/k);h.n21=0;h.n22=2/m;h.n23=0;h.n24=-((e+f)/m);h.n31=0;h.n32=0;h.n33=-2/o;h.n34=-((j+g)/o);h.n41=0;h.n42=0;h.n43=0;h.n44=1;return h};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;
 THREE.Object3D=function(){this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;
 this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this._vector=new THREE.Vector3;this.name=""};
 this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this._vector=new THREE.Vector3;this.name=""};
 THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(b){if(this.children.indexOf(b)===
 THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(b){if(this.children.indexOf(b)===
@@ -55,37 +55,38 @@ this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matri
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=0.5*Math.PI/360,e=b.x*c,f=b.y*c,g=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-g),g=Math.sin(-g),j=Math.cos(e),e=Math.sin(e),h=b*c,k=f*g;this.w=h*j-k*e;this.x=h*e+k*j;this.y=f*c*j+b*g*e;this.z=b*g*j-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e);
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=0.5*Math.PI/360,e=b.x*c,f=b.y*c,g=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-g),g=Math.sin(-g),j=Math.cos(e),e=Math.sin(e),h=b*c,k=f*g;this.w=h*j-k*e;this.x=h*e+k*j;this.y=f*c*j+b*g*e;this.z=b*g*j-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e);
 this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c=
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c=
-this.x,e=this.y,f=this.z,g=this.w,j=b.x,h=b.y,k=b.z,b=b.w;this.x=c*b+g*j+e*k-f*h;this.y=e*b+g*h+f*j-c*k;this.z=f*b+g*k+c*h-e*j;this.w=g*b-c*j-e*h-f*k;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,g=b.z,j=this.x,h=this.y,k=this.z,n=this.w,o=n*e+h*g-k*f,p=n*f+k*e-j*g,u=n*g+j*f-h*e,e=-j*
-e-h*f-k*g;c.x=o*n+e*-j+p*-k-u*-h;c.y=p*n+e*-h+u*-j-o*-k;c.z=u*n+e*-k+o*-h-p*-j;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var g=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(g)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var j=Math.acos(g),h=Math.sqrt(1-g*g);if(Math.abs(h)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;g=Math.sin((1-f)*j)/h;f=Math.sin(f*j)/h;e.w=b.w*g+c.w*f;e.x=b.x*g+c.x*f;e.y=b.y*g+c.y*f;e.z=b.z*g+c.z*f;return e};
+this.x,e=this.y,f=this.z,g=this.w,j=b.x,h=b.y,k=b.z,b=b.w;this.x=c*b+g*j+e*k-f*h;this.y=e*b+g*h+f*j-c*k;this.z=f*b+g*k+c*h-e*j;this.w=g*b-c*j-e*h-f*k;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,g=b.z,j=this.x,h=this.y,k=this.z,m=this.w,o=m*e+h*g-k*f,p=m*f+k*e-j*g,u=m*g+j*f-h*e,e=-j*
+e-h*f-k*g;c.x=o*m+e*-j+p*-k-u*-h;c.y=p*m+e*-h+u*-j-o*-k;c.z=u*m+e*-k+o*-h-p*-j;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var g=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(g)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var j=Math.acos(g),h=Math.sqrt(1-g*g);if(Math.abs(h)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;g=Math.sin((1-f)*j)/h;f=Math.sin(f*j)/h;e.w=b.w*g+c.w*f;e.x=b.x*g+c.x*f;e.y=b.y*g+c.y*f;e.z=b.z*g+c.z*f;return e};
 THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,g,j){this.a=b;this.b=c;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};
 THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,g,j){this.a=b;this.b=c;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};
-THREE.Face4=function(b,c,e,f,g,j,h){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=g instanceof THREE.Vector3?g:new THREE.Vector3;this.vertexNormals=g instanceof Array?g:[];this.color=j instanceof THREE.Color?j:new THREE.Color;this.vertexColors=j instanceof Array?j:[];this.vertexTangents=[];this.materials=h instanceof Array?h:[h];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.set(b||0,c||0)};
-THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.set(b.u,b.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
+THREE.Face4=function(b,c,e,f,g,j,h){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=g instanceof THREE.Vector3?g:new THREE.Vector3;this.vertexNormals=g instanceof Array?g:[];this.color=j instanceof THREE.Color?j:new THREE.Color;this.vertexColors=j instanceof Array?j:[];this.vertexTangents=[];this.materials=h instanceof Array?h:[h];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0};
+THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
+THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
 THREE.Geometry.prototype={constructor:THREE.Geometry,computeCentroids:function(){var b,c,e;b=0;for(c=this.faces.length;b<c;b++)e=this.faces[b],e.centroid.set(0,0,0),e instanceof THREE.Face3?(e.centroid.addSelf(this.vertices[e.a].position),e.centroid.addSelf(this.vertices[e.b].position),e.centroid.addSelf(this.vertices[e.c].position),e.centroid.divideScalar(3)):e instanceof THREE.Face4&&(e.centroid.addSelf(this.vertices[e.a].position),e.centroid.addSelf(this.vertices[e.b].position),e.centroid.addSelf(this.vertices[e.c].position),
 THREE.Geometry.prototype={constructor:THREE.Geometry,computeCentroids:function(){var b,c,e;b=0;for(c=this.faces.length;b<c;b++)e=this.faces[b],e.centroid.set(0,0,0),e instanceof THREE.Face3?(e.centroid.addSelf(this.vertices[e.a].position),e.centroid.addSelf(this.vertices[e.b].position),e.centroid.addSelf(this.vertices[e.c].position),e.centroid.divideScalar(3)):e instanceof THREE.Face4&&(e.centroid.addSelf(this.vertices[e.a].position),e.centroid.addSelf(this.vertices[e.b].position),e.centroid.addSelf(this.vertices[e.c].position),
-e.centroid.addSelf(this.vertices[e.d].position),e.centroid.divideScalar(4))},computeFaceNormals:function(b){var c,e,f,g,j,h,k=new THREE.Vector3,n=new THREE.Vector3;f=0;for(g=this.faces.length;f<g;f++){j=this.faces[f];if(b&&j.vertexNormals.length){k.set(0,0,0);c=0;for(e=j.vertexNormals.length;c<e;c++)k.addSelf(j.vertexNormals[c]);k.divideScalar(3)}else c=this.vertices[j.a],e=this.vertices[j.b],h=this.vertices[j.c],k.sub(h.position,e.position),n.sub(c.position,e.position),k.crossSelf(n);k.isZero()||
+e.centroid.addSelf(this.vertices[e.d].position),e.centroid.divideScalar(4))},computeFaceNormals:function(b){var c,e,f,g,j,h,k=new THREE.Vector3,m=new THREE.Vector3;f=0;for(g=this.faces.length;f<g;f++){j=this.faces[f];if(b&&j.vertexNormals.length){k.set(0,0,0);c=0;for(e=j.vertexNormals.length;c<e;c++)k.addSelf(j.vertexNormals[c]);k.divideScalar(3)}else c=this.vertices[j.a],e=this.vertices[j.b],h=this.vertices[j.c],k.sub(h.position,e.position),m.sub(c.position,e.position),k.crossSelf(m);k.isZero()||
 k.normalize();j.normal.copy(k)}},computeVertexNormals:function(){var b,c,e,f;if(this.__tmpVertices==void 0){f=this.__tmpVertices=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)f[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)if(e=this.faces[b],e instanceof THREE.Face3)e.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(e instanceof THREE.Face4)e.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{f=
 k.normalize();j.normal.copy(k)}},computeVertexNormals:function(){var b,c,e,f;if(this.__tmpVertices==void 0){f=this.__tmpVertices=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)f[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)if(e=this.faces[b],e instanceof THREE.Face3)e.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(e instanceof THREE.Face4)e.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{f=
 this.__tmpVertices;b=0;for(c=this.vertices.length;b<c;b++)f[b].set(0,0,0)}b=0;for(c=this.faces.length;b<c;b++)e=this.faces[b],e instanceof THREE.Face3?(f[e.a].addSelf(e.normal),f[e.b].addSelf(e.normal),f[e.c].addSelf(e.normal)):e instanceof THREE.Face4&&(f[e.a].addSelf(e.normal),f[e.b].addSelf(e.normal),f[e.c].addSelf(e.normal),f[e.d].addSelf(e.normal));b=0;for(c=this.vertices.length;b<c;b++)f[b].normalize();b=0;for(c=this.faces.length;b<c;b++)e=this.faces[b],e instanceof THREE.Face3?(e.vertexNormals[0].copy(f[e.a]),
 this.__tmpVertices;b=0;for(c=this.vertices.length;b<c;b++)f[b].set(0,0,0)}b=0;for(c=this.faces.length;b<c;b++)e=this.faces[b],e instanceof THREE.Face3?(f[e.a].addSelf(e.normal),f[e.b].addSelf(e.normal),f[e.c].addSelf(e.normal)):e instanceof THREE.Face4&&(f[e.a].addSelf(e.normal),f[e.b].addSelf(e.normal),f[e.c].addSelf(e.normal),f[e.d].addSelf(e.normal));b=0;for(c=this.vertices.length;b<c;b++)f[b].normalize();b=0;for(c=this.faces.length;b<c;b++)e=this.faces[b],e instanceof THREE.Face3?(e.vertexNormals[0].copy(f[e.a]),
-e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c])):e instanceof THREE.Face4&&(e.vertexNormals[0].copy(f[e.a]),e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c]),e.vertexNormals[3].copy(f[e.d]))},computeTangents:function(){function b(b,c,e,f,g,j,m){k=b.vertices[c].position;n=b.vertices[e].position;o=b.vertices[f].position;p=h[g];u=h[j];v=h[m];t=n.x-k.x;y=o.x-k.x;w=n.y-k.y;A=o.y-k.y;x=n.z-k.z;G=o.z-k.z;D=u.u-p.u;I=v.u-p.u;J=u.v-p.v;C=v.v-p.v;B=1/(D*C-I*J);H.set((C*t-J*y)*
-B,(C*w-J*A)*B,(C*x-J*G)*B);S.set((D*y-I*t)*B,(D*A-I*w)*B,(D*G-I*x)*B);E[c].addSelf(H);E[e].addSelf(H);E[f].addSelf(H);V[c].addSelf(S);V[e].addSelf(S);V[f].addSelf(S)}var c,e,f,g,j,h,k,n,o,p,u,v,t,y,w,A,x,G,D,I,J,C,B,L,E=[],V=[],H=new THREE.Vector3,S=new THREE.Vector3,K=new THREE.Vector3,Q=new THREE.Vector3,m=new THREE.Vector3;c=0;for(e=this.vertices.length;c<e;c++)E[c]=new THREE.Vector3,V[c]=new THREE.Vector3;c=0;for(e=this.faces.length;c<e;c++)j=this.faces[c],h=this.faceVertexUvs[0][c],j instanceof
-THREE.Face3?b(this,j.a,j.b,j.c,0,1,2):j instanceof THREE.Face4&&(b(this,j.a,j.b,j.c,0,1,2),b(this,j.a,j.b,j.d,0,1,3));var T=["a","b","c","d"];c=0;for(e=this.faces.length;c<e;c++){j=this.faces[c];for(f=0;f<j.vertexNormals.length;f++)m.copy(j.vertexNormals[f]),g=j[T[f]],L=E[g],K.copy(L),K.subSelf(m.multiplyScalar(m.dot(L))).normalize(),Q.cross(j.vertexNormals[f],L),g=Q.dot(V[g]),g=g<0?-1:1,j.vertexTangents[f]=new THREE.Vector4(K.x,K.y,K.z,g)}this.hasTangents=!0},computeBoundingBox:function(){var b;
+e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c])):e instanceof THREE.Face4&&(e.vertexNormals[0].copy(f[e.a]),e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c]),e.vertexNormals[3].copy(f[e.d]))},computeTangents:function(){function b(b,c,e,f,g,j,n){k=b.vertices[c].position;m=b.vertices[e].position;o=b.vertices[f].position;p=h[g];u=h[j];v=h[n];t=m.x-k.x;x=o.x-k.x;w=m.y-k.y;A=o.y-k.y;y=m.z-k.z;G=o.z-k.z;D=u.u-p.u;I=v.u-p.u;J=u.v-p.v;C=v.v-p.v;B=1/(D*C-I*J);H.set((C*t-J*x)*
+B,(C*w-J*A)*B,(C*y-J*G)*B);S.set((D*x-I*t)*B,(D*A-I*w)*B,(D*G-I*y)*B);E[c].addSelf(H);E[e].addSelf(H);E[f].addSelf(H);V[c].addSelf(S);V[e].addSelf(S);V[f].addSelf(S)}var c,e,f,g,j,h,k,m,o,p,u,v,t,x,w,A,y,G,D,I,J,C,B,L,E=[],V=[],H=new THREE.Vector3,S=new THREE.Vector3,K=new THREE.Vector3,Q=new THREE.Vector3,n=new THREE.Vector3;c=0;for(e=this.vertices.length;c<e;c++)E[c]=new THREE.Vector3,V[c]=new THREE.Vector3;c=0;for(e=this.faces.length;c<e;c++)j=this.faces[c],h=this.faceVertexUvs[0][c],j instanceof
+THREE.Face3?b(this,j.a,j.b,j.c,0,1,2):j instanceof THREE.Face4&&(b(this,j.a,j.b,j.c,0,1,2),b(this,j.a,j.b,j.d,0,1,3));var T=["a","b","c","d"];c=0;for(e=this.faces.length;c<e;c++){j=this.faces[c];for(f=0;f<j.vertexNormals.length;f++)n.copy(j.vertexNormals[f]),g=j[T[f]],L=E[g],K.copy(L),K.subSelf(n.multiplyScalar(n.dot(L))).normalize(),Q.cross(j.vertexNormals[f],L),g=Q.dot(V[g]),g=g<0?-1:1,j.vertexTangents[f]=new THREE.Vector4(K.x,K.y,K.z,g)}this.hasTangents=!0},computeBoundingBox:function(){var b;
 if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;c<e;c++){b=this.vertices[c];if(b.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=b.position.x;else if(b.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=b.position.y;
 if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;c<e;c++){b=this.vertices[c];if(b.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=b.position.x;else if(b.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=b.position.y;
 else if(b.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=b.position.z;else if(b.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;c<e;c++)b=Math.max(b,this.vertices[c].position.length());this.boundingSphere={radius:b}},computeEdgeFaces:function(){function b(b,c){return Math.min(b,c)+"_"+Math.max(b,c)}function c(b,c,e){b[c]===
 else if(b.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=b.position.z;else if(b.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;c<e;c++)b=Math.max(b,this.vertices[c].position.length());this.boundingSphere={radius:b}},computeEdgeFaces:function(){function b(b,c){return Math.min(b,c)+"_"+Math.max(b,c)}function c(b,c,e){b[c]===
 void 0?(b[c]={set:{},array:[]},b[c].set[e]=1,b[c].array.push(e)):b[c].set[e]===void 0&&(b[c].set[e]=1,b[c].array.push(e))}var e,f,g,j,h,k={};e=0;for(f=this.faces.length;e<f;e++)h=this.faces[e],h instanceof THREE.Face3?(g=b(h.a,h.b),c(k,g,e),g=b(h.b,h.c),c(k,g,e),g=b(h.a,h.c),c(k,g,e)):h instanceof THREE.Face4&&(g=b(h.b,h.d),c(k,g,e),g=b(h.a,h.b),c(k,g,e),g=b(h.a,h.d),c(k,g,e),g=b(h.b,h.c),c(k,g,e),g=b(h.c,h.d),c(k,g,e));e=0;for(f=this.edges.length;e<f;e++){h=this.edges[e];g=h.vertexIndices[0];j=h.vertexIndices[1];
 void 0?(b[c]={set:{},array:[]},b[c].set[e]=1,b[c].array.push(e)):b[c].set[e]===void 0&&(b[c].set[e]=1,b[c].array.push(e))}var e,f,g,j,h,k={};e=0;for(f=this.faces.length;e<f;e++)h=this.faces[e],h instanceof THREE.Face3?(g=b(h.a,h.b),c(k,g,e),g=b(h.b,h.c),c(k,g,e),g=b(h.a,h.c),c(k,g,e)):h instanceof THREE.Face4&&(g=b(h.b,h.d),c(k,g,e),g=b(h.a,h.b),c(k,g,e),g=b(h.a,h.d),c(k,g,e),g=b(h.b,h.c),c(k,g,e),g=b(h.c,h.d),c(k,g,e));e=0;for(f=this.edges.length;e<f;e++){h=this.edges[e];g=h.vertexIndices[0];j=h.vertexIndices[1];
 h.faceIndices=k[b(g,j)].array;for(g=0;g<h.faceIndices.length;g++)j=h.faceIndices[g],h.faces.push(this.faces[j])}}};THREE.GeometryIdCounter=0;
 h.faceIndices=k[b(g,j)].array;for(g=0;g<h.faceIndices.length;g++)j=h.faceIndices[g],h.faces.push(this.faces[j])}}};THREE.GeometryIdCounter=0;
-THREE.Spline=function(b){function c(b,c,e,f,h,g,j){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*j+(-3*(c-e)-2*b-f)*g+b*h+c}this.points=b;var e=[],f={x:0,y:0,z:0},g,j,h,k,n,o,p,u,v;this.initFromArray=function(b){this.points=[];for(var c=0;c<b.length;c++)this.points[c]={x:b[c][0],y:b[c][1],z:b[c][2]}};this.getPoint=function(b){g=(this.points.length-1)*b;j=Math.floor(g);h=g-j;e[0]=j==0?j:j-1;e[1]=j;e[2]=j>this.points.length-2?j:j+1;e[3]=j>this.points.length-3?j:j+2;o=this.points[e[0]];p=this.points[e[1]];
-u=this.points[e[2]];v=this.points[e[3]];k=h*h;n=h*k;f.x=c(o.x,p.x,u.x,v.x,h,k,n);f.y=c(o.y,p.y,u.y,v.y,h,k,n);f.z=c(o.z,p.z,u.z,v.z,h,k,n);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;b<e;b++)c=this.points[b],f[b]=[c.x,c.y,c.z];return f};this.getLength=function(b){var c,e,f=c=c=0,h=new THREE.Vector3,g=new THREE.Vector3,j=[],k=0;j[0]=0;b||(b=100);e=this.points.length*b;h.copy(this.points[0]);for(b=1;b<e;b++)c=b/e,position=this.getPoint(c),g.copy(position),
-k+=g.distanceTo(h),h.copy(position),c*=this.points.length-1,c=Math.floor(c),c!=f&&(j[c]=k,f=c);j[j.length]=k;return{chunks:j,total:k}};this.reparametrizeByArcLength=function(b){var c,e,f,h,g,j,k=[],n=new THREE.Vector3,u=this.getLength();k.push(n.copy(this.points[0]).clone());for(c=1;c<this.points.length;c++){e=u.chunks[c]-u.chunks[c-1];j=Math.ceil(b*e/u.total);h=(c-1)/(this.points.length-1);g=c/(this.points.length-1);for(e=1;e<j-1;e++)f=h+e*(1/j)*(g-h),position=this.getPoint(f),k.push(n.copy(position).clone());
-k.push(n.copy(this.points[c]).clone())}this.points=k}};THREE.Edge=function(b,c,e,f){this.vertices=[b,c];this.vertexIndices=[e,f];this.faces=[];this.faceIndices=[]};THREE.Camera=function(b,c,e,f,g){THREE.Object3D.call(this);this.fov=b||50;this.aspect=c||1;this.near=e||0.1;this.far=f||2E3;this.target=g||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;
+THREE.Spline=function(b){function c(b,c,e,f,h,g,j){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*j+(-3*(c-e)-2*b-f)*g+b*h+c}this.points=b;var e=[],f={x:0,y:0,z:0},g,j,h,k,m,o,p,u,v;this.initFromArray=function(b){this.points=[];for(var c=0;c<b.length;c++)this.points[c]={x:b[c][0],y:b[c][1],z:b[c][2]}};this.getPoint=function(b){g=(this.points.length-1)*b;j=Math.floor(g);h=g-j;e[0]=j==0?j:j-1;e[1]=j;e[2]=j>this.points.length-2?j:j+1;e[3]=j>this.points.length-3?j:j+2;o=this.points[e[0]];p=this.points[e[1]];
+u=this.points[e[2]];v=this.points[e[3]];k=h*h;m=h*k;f.x=c(o.x,p.x,u.x,v.x,h,k,m);f.y=c(o.y,p.y,u.y,v.y,h,k,m);f.z=c(o.z,p.z,u.z,v.z,h,k,m);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;b<e;b++)c=this.points[b],f[b]=[c.x,c.y,c.z];return f};this.getLength=function(b){var c,e,f=c=c=0,h=new THREE.Vector3,g=new THREE.Vector3,j=[],k=0;j[0]=0;b||(b=100);e=this.points.length*b;h.copy(this.points[0]);for(b=1;b<e;b++)c=b/e,position=this.getPoint(c),g.copy(position),
+k+=g.distanceTo(h),h.copy(position),c*=this.points.length-1,c=Math.floor(c),c!=f&&(j[c]=k,f=c);j[j.length]=k;return{chunks:j,total:k}};this.reparametrizeByArcLength=function(b){var c,e,f,h,g,j,k=[],m=new THREE.Vector3,u=this.getLength();k.push(m.copy(this.points[0]).clone());for(c=1;c<this.points.length;c++){e=u.chunks[c]-u.chunks[c-1];j=Math.ceil(b*e/u.total);h=(c-1)/(this.points.length-1);g=c/(this.points.length-1);for(e=1;e<j-1;e++)f=h+e*(1/j)*(g-h),position=this.getPoint(f),k.push(m.copy(position).clone());
+k.push(m.copy(this.points[c]).clone())}this.points=k}};THREE.Edge=function(b,c,e,f){this.vertices=[b,c];this.vertexIndices=[e,f];this.faces=[];this.faceIndices=[]};THREE.Camera=function(b,c,e,f,g){THREE.Object3D.call(this);this.fov=b||50;this.aspect=c||1;this.near=e||0.1;this.far=f||2E3;this.target=g||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;
 THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);c.multiplyScalar(b);this.position.addSelf(c);this.target.position.addSelf(c)};
 THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);c.multiplyScalar(b);this.position.addSelf(c);this.target.position.addSelf(c)};
 THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var b=this.fullWidth/this.fullHeight,c=Math.tan(this.fov*Math.PI/360)*this.near,e=-c,f=b*e,b=Math.abs(b*c-f),e=Math.abs(c-e);this.projectionMatrix=THREE.Matrix4.makeFrustum(f+this.x*b/this.fullWidth,f+(this.x+this.width)*b/this.fullWidth,c-(this.y+this.height)*e/this.fullHeight,c-this.y*e/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var b=this.fullWidth/this.fullHeight,c=Math.tan(this.fov*Math.PI/360)*this.near,e=-c,f=b*e,b=Math.abs(b*c-f),e=Math.abs(c-e);this.projectionMatrix=THREE.Matrix4.makeFrustum(f+this.x*b/this.fullWidth,f+(this.x+this.width)*b/this.fullWidth,c-(this.y+this.height)*e/this.fullHeight,c-this.y*e/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.Camera.prototype.setViewOffset=function(b,c,e,f,g,j){this.fullWidth=b;this.fullHeight=c;this.x=e;this.y=f;this.width=g;this.height=j;this.updateProjectionMatrix()};
 THREE.Camera.prototype.setViewOffset=function(b,c,e,f,g,j){this.fullWidth=b;this.fullHeight=c;this.x=e;this.y=f;this.width=g;this.height=j;this.updateProjectionMatrix()};
 THREE.Camera.prototype.update=function(b,c,e){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),c=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
 THREE.Camera.prototype.update=function(b,c,e){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),c=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
-!1,c=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,e)};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;
+!1,c=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,e)};THREE.OrthoCamera=function(b,c,e,f,g,j,h){THREE.Camera.call(this,45,1,g,j,h);this.left=b;this.right=c;this.top=e;this.bottom=f;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
+THREE.OrthoCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(b,c,e,f){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.intensity=c||1;this.distance=e||0;this.castShadow=f!==void 0?f:!1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(b,c,e){THREE.Light.call(this,b);this.position=new THREE.Vector3;this.intensity=c||1;this.distance=e||0};
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(b,c,e,f){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.intensity=c||1;this.distance=e||0;this.castShadow=f!==void 0?f:!1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(b,c,e){THREE.Light.call(this,b);this.position=new THREE.Vector3;this.intensity=c||1;this.distance=e||0};
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.SpotLight=function(b,c,e,f){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=c||1;this.distance=e||0;this.castShadow=f!==void 0?f:!1};THREE.SpotLight.prototype=new THREE.Light;THREE.SpotLight.prototype.constructor=THREE.SpotLight;
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.SpotLight=function(b,c,e,f){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=c||1;this.distance=e||0;this.castShadow=f!==void 0?f:!1};THREE.SpotLight.prototype=new THREE.Light;THREE.SpotLight.prototype.constructor=THREE.SpotLight;
 THREE.Material=function(b){this.id=THREE.MaterialCount++;b=b||{};this.opacity=b.opacity!==void 0?b.opacity:1;this.transparent=b.transparent!==void 0?b.transparent:!1;this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.depthTest=b.depthTest!==void 0?b.depthTest:!0;this.polygonOffset=b.polygonOffset!==void 0?b.polygonOffset:!1;this.polygonOffsetFactor=b.polygonOffsetFactor!==void 0?b.polygonOffsetFactor:0;this.polygonOffsetUnits=b.polygonOffsetUnits!==void 0?b.polygonOffsetUnits:
 THREE.Material=function(b){this.id=THREE.MaterialCount++;b=b||{};this.opacity=b.opacity!==void 0?b.opacity:1;this.transparent=b.transparent!==void 0?b.transparent:!1;this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.depthTest=b.depthTest!==void 0?b.depthTest:!0;this.polygonOffset=b.polygonOffset!==void 0?b.polygonOffset:!1;this.polygonOffsetFactor=b.polygonOffsetFactor!==void 0?b.polygonOffsetFactor:0;this.polygonOffsetUnits=b.polygonOffsetUnits!==void 0?b.polygonOffsetUnits:
-0;this.alphaTest=b.alphaTest!==void 0?b.alphaTest:0};THREE.MaterialCount=0;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.AdditiveAlphaBlending=4;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
-THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.LineBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.linewidth=b.linewidth!==void 0?b.linewidth:1;this.linecap=b.linecap!==void 0?b.linecap:"round";this.linejoin=b.linejoin!==void 0?b.linejoin:"round";this.vertexColors=b.vertexColors?b.vertexColors:!1};
-THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
+0;this.alphaTest=b.alphaTest!==void 0?b.alphaTest:0};THREE.MaterialCount=0;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.AdditiveAlphaBlending=4;
+THREE.LineBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.linewidth=b.linewidth!==void 0?b.linewidth:1;this.linecap=b.linecap!==void 0?b.linecap:"round";this.linejoin=b.linejoin!==void 0?b.linejoin:"round";this.vertexColors=b.vertexColors?b.vertexColors:!1};THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
 THREE.MeshBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.lightMap=b.lightMap!==void 0?b.lightMap:null;this.envMap=b.envMap!==void 0?b.envMap:null;this.combine=b.combine!==void 0?b.combine:THREE.MultiplyOperation;this.reflectivity=b.reflectivity!==void 0?b.reflectivity:1;this.refractionRatio=b.refractionRatio!==void 0?b.refractionRatio:0.98;this.shading=b.shading!==
 THREE.MeshBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.lightMap=b.lightMap!==void 0?b.lightMap:null;this.envMap=b.envMap!==void 0?b.envMap:null;this.combine=b.combine!==void 0?b.combine:THREE.MultiplyOperation;this.reflectivity=b.reflectivity!==void 0?b.reflectivity:1;this.refractionRatio=b.refractionRatio!==void 0?b.refractionRatio:0.98;this.shading=b.shading!==
 void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.wireframeLinecap=b.wireframeLinecap!==void 0?b.wireframeLinecap:"round";this.wireframeLinejoin=b.wireframeLinejoin!==void 0?b.wireframeLinejoin:"round";this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};
 void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.wireframeLinecap=b.wireframeLinecap!==void 0?b.wireframeLinecap:"round";this.wireframeLinejoin=b.wireframeLinejoin!==void 0?b.wireframeLinejoin:"round";this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};
 THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
 THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
@@ -102,11 +103,12 @@ b.fog!==void 0?b.fog:!1;this.lights=b.lights!==void 0?b.lights:!1;this.vertexCol
 THREE.ParticleBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.size=b.size!==void 0?b.size:1;this.sizeAttenuation=b.sizeAttenuation!==void 0?b.sizeAttenuation:!0;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
 THREE.ParticleBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.size=b.size!==void 0?b.size:1;this.sizeAttenuation=b.sizeAttenuation!==void 0?b.sizeAttenuation:!0;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
 THREE.ParticleCanvasMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.program=b.program!==void 0?b.program:function(){}};THREE.ParticleCanvasMaterial.prototype=new THREE.Material;THREE.ParticleCanvasMaterial.prototype.constructor=THREE.ParticleCanvasMaterial;THREE.ParticleDOMMaterial=function(b){THREE.Material.call(this);this.domElement=b};
 THREE.ParticleCanvasMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.program=b.program!==void 0?b.program:function(){}};THREE.ParticleCanvasMaterial.prototype=new THREE.Material;THREE.ParticleCanvasMaterial.prototype.constructor=THREE.ParticleCanvasMaterial;THREE.ParticleDOMMaterial=function(b){THREE.Material.call(this);this.domElement=b};
 THREE.Texture=function(b,c,e,f,g,j){this.id=THREE.TextureCount++;this.image=b;this.mapping=c!==void 0?c:new THREE.UVMapping;this.wrapS=e!==void 0?e:THREE.ClampToEdgeWrapping;this.wrapT=f!==void 0?f:THREE.ClampToEdgeWrapping;this.magFilter=g!==void 0?g:THREE.LinearFilter;this.minFilter=j!==void 0?j:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
 THREE.Texture=function(b,c,e,f,g,j){this.id=THREE.TextureCount++;this.image=b;this.mapping=c!==void 0?c:new THREE.UVMapping;this.wrapS=e!==void 0?e:THREE.ClampToEdgeWrapping;this.wrapT=f!==void 0?f:THREE.ClampToEdgeWrapping;this.magFilter=g!==void 0?g:THREE.LinearFilter;this.minFilter=j!==void 0?j:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
-THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var b=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;
-THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(b,c,e,f,g,j,h,k,n){THREE.Texture.call(this,null,g,j,h,k,n);this.image={data:b,width:c,height:e};this.format=f!==void 0?f:THREE.RGBAFormat};
-THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;THREE.DataTexture.prototype={clone:function(){var b=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.Particle=function(b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b]};THREE.Particle.prototype=new THREE.Object3D;
-THREE.Particle.prototype.constructor=THREE.Particle;THREE.ParticleSystem=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(b,c,e){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.type=e!=void 0?e:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;
-THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
+THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var b=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
+THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;
+THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(b,c,e,f,g,j,h,k,m){THREE.Texture.call(this,null,g,j,h,k,m);this.image={data:b,width:c,height:e};this.format=f!==void 0?f:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
+THREE.DataTexture.prototype={clone:function(){var b=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.Particle=function(b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
+THREE.ParticleSystem=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(b,c,e){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.type=e!=void 0?e:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;
+THREE.Line.prototype.constructor=THREE.Line;
 THREE.Mesh=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c&&c.length?c:[c];this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=b.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var e=0;e<this.geometry.morphTargets.length;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[e].name]=
 THREE.Mesh=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c&&c.length?c:[c];this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=b.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var e=0;e<this.geometry.morphTargets.length;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[e].name]=
 e}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(b){if(this.morphTargetDictionary[b]!==void 0)return this.morphTargetDictionary[b];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+b+" does not exist. Returning 0.");return 0};
 e}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(b){if(this.morphTargetDictionary[b]!==void 0)return this.morphTargetDictionary[b];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+b+" does not exist. Returning 0.");return 0};
 THREE.Bone=function(b){THREE.Object3D.call(this);this.skin=b;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
 THREE.Bone=function(b){THREE.Object3D.call(this);this.skin=b;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
@@ -129,58 +131,58 @@ THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.c
 THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1)this.objects.push(b),this.__objectsAdded.push(b);for(var c=0;c<b.children.length;c++)this.addChildRecurse(b.children[c])};THREE.Scene.prototype.removeChild=function(b){this.supr.removeChild.call(this,b);this.removeChildRecurse(b)};
 THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1)this.objects.push(b),this.__objectsAdded.push(b);for(var c=0;c<b.children.length;c++)this.addChildRecurse(b.children[c])};THREE.Scene.prototype.removeChild=function(b){this.supr.removeChild.call(this,b);this.removeChildRecurse(b)};
 THREE.Scene.prototype.removeChildRecurse=function(b){if(b instanceof THREE.Light){var c=this.lights.indexOf(b);c!==-1&&this.lights.splice(c,1)}else b instanceof THREE.Camera||(c=this.objects.indexOf(b),c!==-1&&(this.objects.splice(c,1),this.__objectsRemoved.push(b)));for(c=0;c<b.children.length;c++)this.removeChildRecurse(b.children[c])};THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;
 THREE.Scene.prototype.removeChildRecurse=function(b){if(b instanceof THREE.Light){var c=this.lights.indexOf(b);c!==-1&&this.lights.splice(c,1)}else b instanceof THREE.Camera||(c=this.objects.indexOf(b),c!==-1&&(this.objects.splice(c,1),this.__objectsRemoved.push(b)));for(c=0;c<b.children.length;c++)this.removeChildRecurse(b.children[c])};THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;
 THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(b,c,e){this.color=new THREE.Color(b);this.near=c||1;this.far=e||1E3};THREE.FogExp2=function(b,c){this.color=new THREE.Color(b);this.density=c!==void 0?c:2.5E-4};
 THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(b,c,e){this.color=new THREE.Color(b);this.near=c||1;this.far=e||1E3};THREE.FogExp2=function(b,c){this.color=new THREE.Color(b);this.density=c!==void 0?c:2.5E-4};
-THREE.Projector=function(){function b(){var b=n[k]=n[k]||new THREE.RenderableVertex;k++;return b}function c(b,c){return c.z-b.z}function e(b,c){var e=0,f=1,h=b.z+b.w,g=c.z+c.w,j=-b.z+b.w,k=-c.z+c.w;return h>=0&&g>=0&&j>=0&&k>=0?!0:h<0&&g<0||j<0&&k<0?!1:(h<0?e=Math.max(e,h/(h-g)):g<0&&(f=Math.min(f,h/(h-g))),j<0?e=Math.max(e,j/(j-k)):k<0&&(f=Math.min(f,j/(j-k))),f<e?!1:(b.lerpSelf(c,e),c.lerpSelf(b,1-f),!0))}var f,g,j=[],h,k,n=[],o,p,u=[],v,t=[],y,w,A=[],x,G,D=[],I=new THREE.Vector4,J=new THREE.Vector4,
-C=new THREE.Matrix4,B=new THREE.Matrix4,L=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],E=new THREE.Vector4,V=new THREE.Vector4;this.projectVector=function(b,c){C.multiply(c.projectionMatrix,c.matrixWorldInverse);C.multiplyVector3(b);return b};this.unprojectVector=function(b,c){C.multiply(c.matrixWorld,THREE.Matrix4.makeInvert(c.projectionMatrix));C.multiplyVector3(b);return b};this.projectObjects=function(b,e,h){var e=[],k,m,n;g=0;m=
-b.objects;b=0;for(k=m.length;b<k;b++){n=m[b];var u;if(!(u=!n.visible))if(u=n instanceof THREE.Mesh){a:{u=void 0;for(var o=n.matrixWorld,t=-n.geometry.boundingSphere.radius*Math.max(n.scale.x,Math.max(n.scale.y,n.scale.z)),p=0;p<6;p++)if(u=L[p].x*o.n14+L[p].y*o.n24+L[p].z*o.n34+L[p].w,u<=t){u=!1;break a}u=!0}u=!u}if(!u)u=j[g]=j[g]||new THREE.RenderableObject,g++,f=u,I.copy(n.position),C.multiplyVector3(I),f.object=n,f.z=I.z,e.push(f)}h&&e.sort(c);return e};this.projectScene=function(f,g,j){var I=[],
-m=g.near,T=g.far,X,M,W,ha,ca,fa,ga,$,Y,P,ea,Z,da,ia,U,ja,pa;G=w=v=p=0;g.matrixAutoUpdate&&g.update(void 0,!0);f.update(void 0,!1,g);C.multiply(g.projectionMatrix,g.matrixWorldInverse);L[0].set(C.n41-C.n11,C.n42-C.n12,C.n43-C.n13,C.n44-C.n14);L[1].set(C.n41+C.n11,C.n42+C.n12,C.n43+C.n13,C.n44+C.n14);L[2].set(C.n41+C.n21,C.n42+C.n22,C.n43+C.n23,C.n44+C.n24);L[3].set(C.n41-C.n21,C.n42-C.n22,C.n43-C.n23,C.n44-C.n24);L[4].set(C.n41-C.n31,C.n42-C.n32,C.n43-C.n33,C.n44-C.n34);L[5].set(C.n41+C.n31,C.n42+
+THREE.Projector=function(){function b(){var b=m[k]=m[k]||new THREE.RenderableVertex;k++;return b}function c(b,c){return c.z-b.z}function e(b,c){var e=0,f=1,h=b.z+b.w,g=c.z+c.w,j=-b.z+b.w,k=-c.z+c.w;return h>=0&&g>=0&&j>=0&&k>=0?!0:h<0&&g<0||j<0&&k<0?!1:(h<0?e=Math.max(e,h/(h-g)):g<0&&(f=Math.min(f,h/(h-g))),j<0?e=Math.max(e,j/(j-k)):k<0&&(f=Math.min(f,j/(j-k))),f<e?!1:(b.lerpSelf(c,e),c.lerpSelf(b,1-f),!0))}var f,g,j=[],h,k,m=[],o,p,u=[],v,t=[],x,w,A=[],y,G,D=[],I=new THREE.Vector4,J=new THREE.Vector4,
+C=new THREE.Matrix4,B=new THREE.Matrix4,L=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],E=new THREE.Vector4,V=new THREE.Vector4;this.projectVector=function(b,c){C.multiply(c.projectionMatrix,c.matrixWorldInverse);C.multiplyVector3(b);return b};this.unprojectVector=function(b,c){C.multiply(c.matrixWorld,THREE.Matrix4.makeInvert(c.projectionMatrix));C.multiplyVector3(b);return b};this.projectObjects=function(b,e,h){var e=[],k,n,m;g=0;n=
+b.objects;b=0;for(k=n.length;b<k;b++){m=n[b];var u;if(!(u=!m.visible))if(u=m instanceof THREE.Mesh){a:{u=void 0;for(var o=m.matrixWorld,t=-m.geometry.boundingSphere.radius*Math.max(m.scale.x,Math.max(m.scale.y,m.scale.z)),p=0;p<6;p++)if(u=L[p].x*o.n14+L[p].y*o.n24+L[p].z*o.n34+L[p].w,u<=t){u=!1;break a}u=!0}u=!u}if(!u)u=j[g]=j[g]||new THREE.RenderableObject,g++,f=u,I.copy(m.position),C.multiplyVector3(I),f.object=m,f.z=I.z,e.push(f)}h&&e.sort(c);return e};this.projectScene=function(f,g,j){var I=[],
+n=g.near,T=g.far,X,M,W,ha,ca,fa,ga,$,Y,P,ea,Z,da,ia,U,ja,pa;G=w=v=p=0;g.matrixAutoUpdate&&g.update(void 0,!0);f.update(void 0,!1,g);C.multiply(g.projectionMatrix,g.matrixWorldInverse);L[0].set(C.n41-C.n11,C.n42-C.n12,C.n43-C.n13,C.n44-C.n14);L[1].set(C.n41+C.n11,C.n42+C.n12,C.n43+C.n13,C.n44+C.n14);L[2].set(C.n41+C.n21,C.n42+C.n22,C.n43+C.n23,C.n44+C.n24);L[3].set(C.n41-C.n21,C.n42-C.n22,C.n43-C.n23,C.n44-C.n24);L[4].set(C.n41-C.n31,C.n42-C.n32,C.n43-C.n33,C.n44-C.n34);L[5].set(C.n41+C.n31,C.n42+
 C.n32,C.n43+C.n33,C.n44+C.n34);for(X=0;X<6;X++)Y=L[X],Y.divideScalar(Math.sqrt(Y.x*Y.x+Y.y*Y.y+Y.z*Y.z));Y=this.projectObjects(f,g,!0);f=0;for(X=Y.length;f<X;f++)if(P=Y[f].object,P.visible)if(ea=P.matrixWorld,Z=P.matrixRotationWorld,da=P.materials,ia=P.overdraw,k=0,P instanceof THREE.Mesh){U=P.geometry;ha=U.vertices;ja=U.faces;U=U.faceVertexUvs;M=0;for(W=ha.length;M<W;M++)h=b(),h.positionWorld.copy(ha[M].position),ea.multiplyVector3(h.positionWorld),h.positionScreen.copy(h.positionWorld),C.multiplyVector4(h.positionScreen),
 C.n32,C.n43+C.n33,C.n44+C.n34);for(X=0;X<6;X++)Y=L[X],Y.divideScalar(Math.sqrt(Y.x*Y.x+Y.y*Y.y+Y.z*Y.z));Y=this.projectObjects(f,g,!0);f=0;for(X=Y.length;f<X;f++)if(P=Y[f].object,P.visible)if(ea=P.matrixWorld,Z=P.matrixRotationWorld,da=P.materials,ia=P.overdraw,k=0,P instanceof THREE.Mesh){U=P.geometry;ha=U.vertices;ja=U.faces;U=U.faceVertexUvs;M=0;for(W=ha.length;M<W;M++)h=b(),h.positionWorld.copy(ha[M].position),ea.multiplyVector3(h.positionWorld),h.positionScreen.copy(h.positionWorld),C.multiplyVector4(h.positionScreen),
-h.positionScreen.x/=h.positionScreen.w,h.positionScreen.y/=h.positionScreen.w,h.visible=h.positionScreen.z>m&&h.positionScreen.z<T;ha=0;for(M=ja.length;ha<M;ha++){W=ja[ha];if(W instanceof THREE.Face3)if(ca=n[W.a],fa=n[W.b],ga=n[W.c],ca.visible&&fa.visible&&ga.visible&&(P.doubleSided||P.flipSided!=(ga.positionScreen.x-ca.positionScreen.x)*(fa.positionScreen.y-ca.positionScreen.y)-(ga.positionScreen.y-ca.positionScreen.y)*(fa.positionScreen.x-ca.positionScreen.x)<0))$=u[p]=u[p]||new THREE.RenderableFace3,
-p++,o=$,o.v1.copy(ca),o.v2.copy(fa),o.v3.copy(ga);else continue;else if(W instanceof THREE.Face4)if(ca=n[W.a],fa=n[W.b],ga=n[W.c],$=n[W.d],ca.visible&&fa.visible&&ga.visible&&$.visible&&(P.doubleSided||P.flipSided!=(($.positionScreen.x-ca.positionScreen.x)*(fa.positionScreen.y-ca.positionScreen.y)-($.positionScreen.y-ca.positionScreen.y)*(fa.positionScreen.x-ca.positionScreen.x)<0||(fa.positionScreen.x-ga.positionScreen.x)*($.positionScreen.y-ga.positionScreen.y)-(fa.positionScreen.y-ga.positionScreen.y)*
+h.positionScreen.x/=h.positionScreen.w,h.positionScreen.y/=h.positionScreen.w,h.visible=h.positionScreen.z>n&&h.positionScreen.z<T;ha=0;for(M=ja.length;ha<M;ha++){W=ja[ha];if(W instanceof THREE.Face3)if(ca=m[W.a],fa=m[W.b],ga=m[W.c],ca.visible&&fa.visible&&ga.visible&&(P.doubleSided||P.flipSided!=(ga.positionScreen.x-ca.positionScreen.x)*(fa.positionScreen.y-ca.positionScreen.y)-(ga.positionScreen.y-ca.positionScreen.y)*(fa.positionScreen.x-ca.positionScreen.x)<0))$=u[p]=u[p]||new THREE.RenderableFace3,
+p++,o=$,o.v1.copy(ca),o.v2.copy(fa),o.v3.copy(ga);else continue;else if(W instanceof THREE.Face4)if(ca=m[W.a],fa=m[W.b],ga=m[W.c],$=m[W.d],ca.visible&&fa.visible&&ga.visible&&$.visible&&(P.doubleSided||P.flipSided!=(($.positionScreen.x-ca.positionScreen.x)*(fa.positionScreen.y-ca.positionScreen.y)-($.positionScreen.y-ca.positionScreen.y)*(fa.positionScreen.x-ca.positionScreen.x)<0||(fa.positionScreen.x-ga.positionScreen.x)*($.positionScreen.y-ga.positionScreen.y)-(fa.positionScreen.y-ga.positionScreen.y)*
 ($.positionScreen.x-ga.positionScreen.x)<0)))pa=t[v]=t[v]||new THREE.RenderableFace4,v++,o=pa,o.v1.copy(ca),o.v2.copy(fa),o.v3.copy(ga),o.v4.copy($);else continue;o.normalWorld.copy(W.normal);Z.multiplyVector3(o.normalWorld);o.centroidWorld.copy(W.centroid);ea.multiplyVector3(o.centroidWorld);o.centroidScreen.copy(o.centroidWorld);C.multiplyVector3(o.centroidScreen);ga=W.vertexNormals;ca=0;for(fa=ga.length;ca<fa;ca++)$=o.vertexNormalsWorld[ca],$.copy(ga[ca]),Z.multiplyVector3($);ca=0;for(fa=U.length;ca<
 ($.positionScreen.x-ga.positionScreen.x)<0)))pa=t[v]=t[v]||new THREE.RenderableFace4,v++,o=pa,o.v1.copy(ca),o.v2.copy(fa),o.v3.copy(ga),o.v4.copy($);else continue;o.normalWorld.copy(W.normal);Z.multiplyVector3(o.normalWorld);o.centroidWorld.copy(W.centroid);ea.multiplyVector3(o.centroidWorld);o.centroidScreen.copy(o.centroidWorld);C.multiplyVector3(o.centroidScreen);ga=W.vertexNormals;ca=0;for(fa=ga.length;ca<fa;ca++)$=o.vertexNormalsWorld[ca],$.copy(ga[ca]),Z.multiplyVector3($);ca=0;for(fa=U.length;ca<
-fa;ca++)if(pa=U[ca][ha]){ga=0;for($=pa.length;ga<$;ga++)o.uvs[ca][ga]=pa[ga]}o.meshMaterials=da;o.faceMaterials=W.materials;o.overdraw=ia;o.z=o.centroidScreen.z;I.push(o)}}else if(P instanceof THREE.Line){B.multiply(C,ea);ha=P.geometry.vertices;ca=b();ca.positionScreen.copy(ha[0].position);B.multiplyVector4(ca.positionScreen);M=1;for(W=ha.length;M<W;M++)if(ca=b(),ca.positionScreen.copy(ha[M].position),B.multiplyVector4(ca.positionScreen),fa=n[k-2],E.copy(ca.positionScreen),V.copy(fa.positionScreen),
-e(E,V))E.multiplyScalar(1/E.w),V.multiplyScalar(1/V.w),ea=A[w]=A[w]||new THREE.RenderableLine,w++,y=ea,y.v1.positionScreen.copy(E),y.v2.positionScreen.copy(V),y.z=Math.max(E.z,V.z),y.materials=P.materials,I.push(y)}else if(P instanceof THREE.Particle&&(J.set(P.matrixWorld.n14,P.matrixWorld.n24,P.matrixWorld.n34,1),C.multiplyVector4(J),J.z/=J.w,J.z>0&&J.z<1))ea=D[G]=D[G]||new THREE.RenderableParticle,G++,x=ea,x.x=J.x/J.w,x.y=J.y/J.w,x.z=J.z,x.rotation=P.rotation.z,x.scale.x=P.scale.x*Math.abs(x.x-
-(J.x+g.projectionMatrix.n11)/(J.w+g.projectionMatrix.n14)),x.scale.y=P.scale.y*Math.abs(x.y-(J.y+g.projectionMatrix.n22)/(J.w+g.projectionMatrix.n24)),x.materials=P.materials,I.push(x);j&&I.sort(c);return I}};
-THREE.DOMRenderer=function(){THREE.Renderer.call(this);var b=null,c=new THREE.Projector,e,f,g,j;this.domElement=document.createElement("div");this.setSize=function(b,c){e=b;f=c;g=e/2;j=f/2};this.render=function(e,f){var n,o,p,u,v,t,y,w;b=c.projectScene(e,f);n=0;for(o=b.length;n<o;n++)if(v=b[n],v instanceof THREE.RenderableParticle){y=v.x*g+g;w=v.y*j+j;p=0;for(u=v.material.length;p<u;p++)if(t=v.material[p],t instanceof THREE.ParticleDOMMaterial)t=t.domElement,t.style.left=y+"px",t.style.top=w+"px"}}};
-THREE.CanvasRenderer=function(b){function c(b){if(A!=b)t.globalAlpha=A=b}function e(b){if(x!=b){switch(b){case THREE.NormalBlending:t.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:t.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:t.globalCompositeOperation="darker"}x=b}}function f(b){if(G!=b)t.strokeStyle=G=b}function g(b){if(D!=b)t.fillStyle=D=b}var j=this,h=null,k=new THREE.Projector,b=b||{},n=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
-o,p,u,v,t=n.getContext("2d"),y=new THREE.Color(0),w=0,A=1,x=0,G=null,D=null,I=null,J=null,C=null,B,L,E,V,H=new THREE.RenderableVertex,S=new THREE.RenderableVertex,K,Q,m,T,X,M,W,ha,ca,fa,ga,$,Y=new THREE.Color(0),P=new THREE.Color(0),ea=new THREE.Color(0),Z=new THREE.Color(0),da=new THREE.Color(0),ia=[],U,ja,pa,la,ma,Fa,ya,Ia,Ja,Ta,ra=new THREE.Rectangle,na=new THREE.Rectangle,aa=new THREE.Rectangle,xa=!1,va=new THREE.Color,oa=new THREE.Color,Da=new THREE.Color,Ga=new THREE.Color,sa=new THREE.Vector3,
-R,Aa,ka,za,Wa,Ba,b=16;R=document.createElement("canvas");R.width=R.height=2;Aa=R.getContext("2d");Aa.fillStyle="rgba(0,0,0,1)";Aa.fillRect(0,0,2,2);ka=Aa.getImageData(0,0,2,2);za=ka.data;Wa=document.createElement("canvas");Wa.width=Wa.height=b;Ba=Wa.getContext("2d");Ba.translate(-b/2,-b/2);Ba.scale(b,b);b--;this.domElement=n;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setSize=function(b,c){o=b;p=c;u=Math.floor(o/2);v=Math.floor(p/2);n.width=o;n.height=
-p;ra.set(-u,-v,u,v);na.set(-u,-v,u,v);A=1;x=0;C=J=I=D=G=null};this.setClearColor=function(b,c){y.copy(b);w=c;na.set(-u,-v,u,v)};this.setClearColorHex=function(b,c){y.setHex(b);w=c;na.set(-u,-v,u,v)};this.clear=function(){t.setTransform(1,0,0,-1,u,v);na.isEmpty()||(na.minSelf(ra),na.inflate(2),w<1&&t.clearRect(Math.floor(na.getX()),Math.floor(na.getY()),Math.floor(na.getWidth()),Math.floor(na.getHeight())),w>0&&(e(THREE.NormalBlending),c(1),g("rgba("+Math.floor(y.r*255)+","+Math.floor(y.g*255)+","+
-Math.floor(y.b*255)+","+w+")"),t.fillRect(Math.floor(na.getX()),Math.floor(na.getY()),Math.floor(na.getWidth()),Math.floor(na.getHeight()))),na.empty())};this.render=function(b,n){function o(b){var c,e,f,h=b.lights;oa.setRGB(0,0,0);Da.setRGB(0,0,0);Ga.setRGB(0,0,0);b=0;for(c=h.length;b<c;b++)e=h[b],f=e.color,e instanceof THREE.AmbientLight?(oa.r+=f.r,oa.g+=f.g,oa.b+=f.b):e instanceof THREE.DirectionalLight?(Da.r+=f.r,Da.g+=f.g,Da.b+=f.b):e instanceof THREE.PointLight&&(Ga.r+=f.r,Ga.g+=f.g,Ga.b+=f.b)}
-function p(b,c,e,f){var h,g,j,k,m=b.lights,b=0;for(h=m.length;b<h;b++)g=m[b],j=g.color,g instanceof THREE.DirectionalLight?(k=e.dot(g.position),k<=0||(k*=g.intensity,f.r+=j.r*k,f.g+=j.g*k,f.b+=j.b*k)):g instanceof THREE.PointLight&&(k=e.dot(sa.sub(g.position,c).normalize()),k<=0||(k*=g.distance==0?1:1-Math.min(c.distanceTo(g.position)/g.distance,1),k!=0&&(k*=g.intensity,f.r+=j.r*k,f.g+=j.g*k,f.b+=j.b*k)))}function y(b,h,j){c(j.opacity);e(j.blending);var k,m,n,o,p,ka;if(j instanceof THREE.ParticleBasicMaterial){if(j.map)o=
-j.map.image,p=o.width>>1,ka=o.height>>1,j=h.scale.x*u,n=h.scale.y*v,k=j*p,m=n*ka,aa.set(b.x-k,b.y-m,b.x+k,b.y+m),ra.instersects(aa)&&(t.save(),t.translate(b.x,b.y),t.rotate(-h.rotation),t.scale(j,-n),t.translate(-p,-ka),t.drawImage(o,0,0),t.restore())}else j instanceof THREE.ParticleCanvasMaterial&&(k=h.scale.x*u,m=h.scale.y*v,aa.set(b.x-k,b.y-m,b.x+k,b.y+m),ra.instersects(aa)&&(f(j.color.getContextStyle()),g(j.color.getContextStyle()),t.save(),t.translate(b.x,b.y),t.rotate(-h.rotation),t.scale(k,
-m),j.program(t),t.restore()))}function w(b,h,g,j){c(j.opacity);e(j.blending);t.beginPath();t.moveTo(b.positionScreen.x,b.positionScreen.y);t.lineTo(h.positionScreen.x,h.positionScreen.y);t.closePath();if(j instanceof THREE.LineBasicMaterial){b=j.linewidth;if(I!=b)t.lineWidth=I=b;b=j.linecap;if(J!=b)t.lineCap=J=b;b=j.linejoin;if(C!=b)t.lineJoin=C=b;f(j.color.getContextStyle());t.stroke();aa.inflate(j.linewidth*2)}}function A(b,f,h,g,k,u,o,t,ka){j.data.vertices+=3;j.data.faces++;c(t.opacity);e(t.blending);
-K=b.positionScreen.x;Q=b.positionScreen.y;m=f.positionScreen.x;T=f.positionScreen.y;X=h.positionScreen.x;M=h.positionScreen.y;D(K,Q,m,T,X,M);if(t instanceof THREE.MeshBasicMaterial)if(t.map)t.map.mapping instanceof THREE.UVMapping&&(la=o.uvs[0],Za(K,Q,m,T,X,M,la[g].u,la[g].v,la[k].u,la[k].v,la[u].u,la[u].v,t.map));else if(t.envMap){if(t.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=n.matrixWorldInverse,sa.copy(o.vertexNormalsWorld[0]),ma=(sa.x*b.n11+sa.y*b.n12+sa.z*b.n13)*0.5+0.5,Fa=
--(sa.x*b.n21+sa.y*b.n22+sa.z*b.n23)*0.5+0.5,sa.copy(o.vertexNormalsWorld[1]),ya=(sa.x*b.n11+sa.y*b.n12+sa.z*b.n13)*0.5+0.5,Ia=-(sa.x*b.n21+sa.y*b.n22+sa.z*b.n23)*0.5+0.5,sa.copy(o.vertexNormalsWorld[2]),Ja=(sa.x*b.n11+sa.y*b.n12+sa.z*b.n13)*0.5+0.5,Ta=-(sa.x*b.n21+sa.y*b.n22+sa.z*b.n23)*0.5+0.5,Za(K,Q,m,T,X,M,ma,Fa,ya,Ia,Ja,Ta,t.envMap)}else t.wireframe?Ka(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(t.color);else if(t instanceof THREE.MeshLambertMaterial)t.map&&!t.wireframe&&
-(t.map.mapping instanceof THREE.UVMapping&&(la=o.uvs[0],Za(K,Q,m,T,X,M,la[g].u,la[g].v,la[k].u,la[k].v,la[u].u,la[u].v,t.map)),e(THREE.SubtractiveBlending)),xa?!t.wireframe&&t.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==3?(P.r=ea.r=Z.r=oa.r,P.g=ea.g=Z.g=oa.g,P.b=ea.b=Z.b=oa.b,p(ka,o.v1.positionWorld,o.vertexNormalsWorld[0],P),p(ka,o.v2.positionWorld,o.vertexNormalsWorld[1],ea),p(ka,o.v3.positionWorld,o.vertexNormalsWorld[2],Z),da.r=(ea.r+Z.r)*0.5,da.g=(ea.g+Z.g)*0.5,da.b=(ea.b+Z.b)*
-0.5,pa=Xa(P,ea,Z,da),Ua(K,Q,m,T,X,M,0,0,1,0,0,1,pa)):(va.r=oa.r,va.g=oa.g,va.b=oa.b,p(ka,o.centroidWorld,o.normalWorld,va),Y.r=Math.max(0,Math.min(t.color.r*va.r,1)),Y.g=Math.max(0,Math.min(t.color.g*va.g,1)),Y.b=Math.max(0,Math.min(t.color.b*va.b,1)),t.wireframe?Ka(Y,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(Y)):t.wireframe?Ka(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(t.color);else if(t instanceof THREE.MeshDepthMaterial)U=n.near,ja=n.far,P.r=P.g=
-P.b=1-Oa(b.positionScreen.z,U,ja),ea.r=ea.g=ea.b=1-Oa(f.positionScreen.z,U,ja),Z.r=Z.g=Z.b=1-Oa(h.positionScreen.z,U,ja),da.r=(ea.r+Z.r)*0.5,da.g=(ea.g+Z.g)*0.5,da.b=(ea.b+Z.b)*0.5,pa=Xa(P,ea,Z,da),Ua(K,Q,m,T,X,M,0,0,1,0,0,1,pa);else if(t instanceof THREE.MeshNormalMaterial)Y.r=Va(o.normalWorld.x),Y.g=Va(o.normalWorld.y),Y.b=Va(o.normalWorld.z),t.wireframe?Ka(Y,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(Y)}function x(b,f,h,g,k,u,o,t,ka){j.data.vertices+=4;j.data.faces++;c(t.opacity);
-e(t.blending);if(t.map||t.envMap)A(b,f,g,0,1,3,o,t,ka),A(k,h,u,1,2,3,o,t,ka);else if(K=b.positionScreen.x,Q=b.positionScreen.y,m=f.positionScreen.x,T=f.positionScreen.y,X=h.positionScreen.x,M=h.positionScreen.y,W=g.positionScreen.x,ha=g.positionScreen.y,ca=k.positionScreen.x,fa=k.positionScreen.y,ga=u.positionScreen.x,$=u.positionScreen.y,t instanceof THREE.MeshBasicMaterial)G(K,Q,m,T,X,M,W,ha),t.wireframe?Ka(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(t.color);else if(t instanceof
-THREE.MeshLambertMaterial)xa?!t.wireframe&&t.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==4?(P.r=ea.r=Z.r=da.r=oa.r,P.g=ea.g=Z.g=da.g=oa.g,P.b=ea.b=Z.b=da.b=oa.b,p(ka,o.v1.positionWorld,o.vertexNormalsWorld[0],P),p(ka,o.v2.positionWorld,o.vertexNormalsWorld[1],ea),p(ka,o.v4.positionWorld,o.vertexNormalsWorld[3],Z),p(ka,o.v3.positionWorld,o.vertexNormalsWorld[2],da),pa=Xa(P,ea,Z,da),D(K,Q,m,T,W,ha),Ua(K,Q,m,T,W,ha,0,0,1,0,0,1,pa),D(ca,fa,X,M,ga,$),Ua(ca,fa,X,M,ga,$,1,0,1,1,0,1,pa)):(va.r=
-oa.r,va.g=oa.g,va.b=oa.b,p(ka,o.centroidWorld,o.normalWorld,va),Y.r=Math.max(0,Math.min(t.color.r*va.r,1)),Y.g=Math.max(0,Math.min(t.color.g*va.g,1)),Y.b=Math.max(0,Math.min(t.color.b*va.b,1)),G(K,Q,m,T,X,M,W,ha),t.wireframe?Ka(Y,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(Y)):(G(K,Q,m,T,X,M,W,ha),t.wireframe?Ka(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(t.color));else if(t instanceof THREE.MeshNormalMaterial)Y.r=Va(o.normalWorld.x),Y.g=Va(o.normalWorld.y),
-Y.b=Va(o.normalWorld.z),G(K,Q,m,T,X,M,W,ha),t.wireframe?Ka(Y,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(Y);else if(t instanceof THREE.MeshDepthMaterial)U=n.near,ja=n.far,P.r=P.g=P.b=1-Oa(b.positionScreen.z,U,ja),ea.r=ea.g=ea.b=1-Oa(f.positionScreen.z,U,ja),Z.r=Z.g=Z.b=1-Oa(g.positionScreen.z,U,ja),da.r=da.g=da.b=1-Oa(h.positionScreen.z,U,ja),pa=Xa(P,ea,Z,da),D(K,Q,m,T,W,ha),Ua(K,Q,m,T,W,ha,0,0,1,0,0,1,pa),D(ca,fa,X,M,ga,$),Ua(ca,fa,X,M,ga,$,1,0,1,1,0,1,pa)}function D(b,c,e,f,
-h,g){t.beginPath();t.moveTo(b,c);t.lineTo(e,f);t.lineTo(h,g);t.lineTo(b,c);t.closePath()}function G(b,c,e,f,h,g,j,k){t.beginPath();t.moveTo(b,c);t.lineTo(e,f);t.lineTo(h,g);t.lineTo(j,k);t.lineTo(b,c);t.closePath()}function Ka(b,c,e,h){if(I!=c)t.lineWidth=I=c;if(J!=e)t.lineCap=J=e;if(C!=h)t.lineJoin=C=h;f(b.getContextStyle());t.stroke();aa.inflate(c*2)}function La(b){g(b.getContextStyle());t.fill()}function Za(b,c,e,f,h,j,k,m,n,o,u,p,ka){if(ka.image.width!=0){if(ka.needsUpdate==!0||ia[ka.id]==void 0){var v=
-ka.wrapS==THREE.RepeatWrapping,Ba=ka.wrapT==THREE.RepeatWrapping;ia[ka.id]=t.createPattern(ka.image,v&&Ba?"repeat":v&&!Ba?"repeat-x":!v&&Ba?"repeat-y":"no-repeat");ka.needsUpdate=!1}g(ia[ka.id]);var v=ka.offset.x/ka.repeat.x,Ba=ka.offset.y/ka.repeat.y,y=(ka.image.width-1)*ka.repeat.x,ka=(ka.image.height-1)*ka.repeat.y,k=(k+v)*y,m=(m+Ba)*ka,n=(n+v)*y,o=(o+Ba)*ka,u=(u+v)*y,p=(p+Ba)*ka;e-=b;f-=c;h-=b;j-=c;n-=k;o-=m;u-=k;p-=m;v=1/(n*p-u*o);ka=(p*e-o*h)*v;o=(p*f-o*j)*v;e=(n*h-u*e)*v;f=(n*j-u*f)*v;b=b-
-ka*k-e*m;c=c-o*k-f*m;t.save();t.transform(ka,o,e,f,b,c);t.fill();t.restore()}}function Ua(b,c,e,f,h,g,j,k,m,n,o,u,ka){var p,v;p=ka.width-1;v=ka.height-1;j*=p;k*=v;m*=p;n*=v;o*=p;u*=v;e-=b;f-=c;h-=b;g-=c;m-=j;n-=k;o-=j;u-=k;v=1/(m*u-o*n);p=(u*e-n*h)*v;n=(u*f-n*g)*v;e=(m*h-o*e)*v;f=(m*g-o*f)*v;b=b-p*j-e*k;c=c-n*j-f*k;t.save();t.transform(p,n,e,f,b,c);t.clip();t.drawImage(ka,0,0);t.restore()}function Xa(b,c,e,f){var h=~~(b.r*255),g=~~(b.g*255),b=~~(b.b*255),j=~~(c.r*255),k=~~(c.g*255),c=~~(c.b*255),
-m=~~(e.r*255),n=~~(e.g*255),e=~~(e.b*255),t=~~(f.r*255),o=~~(f.g*255),f=~~(f.b*255);za[0]=h<0?0:h>255?255:h;za[1]=g<0?0:g>255?255:g;za[2]=b<0?0:b>255?255:b;za[4]=j<0?0:j>255?255:j;za[5]=k<0?0:k>255?255:k;za[6]=c<0?0:c>255?255:c;za[8]=m<0?0:m>255?255:m;za[9]=n<0?0:n>255?255:n;za[10]=e<0?0:e>255?255:e;za[12]=t<0?0:t>255?255:t;za[13]=o<0?0:o>255?255:o;za[14]=f<0?0:f>255?255:f;Aa.putImageData(ka,0,0);Ba.drawImage(R,0,0);return Wa}function Oa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+
-1)*0.5;return b<0?0:b>1?1:b}function Ma(b,c){var e=c.x-b.x,f=c.y-b.y,h=e*e+f*f;h!=0&&(h=1/Math.sqrt(h),e*=h,f*=h,c.x+=e,c.y+=f,b.x-=e,b.y-=f)}var Ya,$a,qa,Ca,Na,F,z,N;this.autoClear?this.clear():t.setTransform(1,0,0,-1,u,v);j.data.vertices=0;j.data.faces=0;h=k.projectScene(b,n,this.sortElements);(xa=b.lights.length>0)&&o(b);Ya=0;for($a=h.length;Ya<$a;Ya++){qa=h[Ya];aa.empty();if(qa instanceof THREE.RenderableParticle){B=qa;B.x*=u;B.y*=v;Ca=0;for(Na=qa.materials.length;Ca<Na;)N=qa.materials[Ca++],
-N.opacity!=0&&y(B,qa,N,b)}else if(qa instanceof THREE.RenderableLine){if(B=qa.v1,L=qa.v2,B.positionScreen.x*=u,B.positionScreen.y*=v,L.positionScreen.x*=u,L.positionScreen.y*=v,aa.addPoint(B.positionScreen.x,B.positionScreen.y),aa.addPoint(L.positionScreen.x,L.positionScreen.y),ra.instersects(aa)){Ca=0;for(Na=qa.materials.length;Ca<Na;)N=qa.materials[Ca++],N.opacity!=0&&w(B,L,qa,N,b)}}else if(qa instanceof THREE.RenderableFace3){if(B=qa.v1,L=qa.v2,E=qa.v3,B.positionScreen.x*=u,B.positionScreen.y*=
+fa;ca++)if(pa=U[ca][ha]){ga=0;for($=pa.length;ga<$;ga++)o.uvs[ca][ga]=pa[ga]}o.meshMaterials=da;o.faceMaterials=W.materials;o.overdraw=ia;o.z=o.centroidScreen.z;I.push(o)}}else if(P instanceof THREE.Line){B.multiply(C,ea);ha=P.geometry.vertices;ca=b();ca.positionScreen.copy(ha[0].position);B.multiplyVector4(ca.positionScreen);M=1;for(W=ha.length;M<W;M++)if(ca=b(),ca.positionScreen.copy(ha[M].position),B.multiplyVector4(ca.positionScreen),fa=m[k-2],E.copy(ca.positionScreen),V.copy(fa.positionScreen),
+e(E,V))E.multiplyScalar(1/E.w),V.multiplyScalar(1/V.w),ea=A[w]=A[w]||new THREE.RenderableLine,w++,x=ea,x.v1.positionScreen.copy(E),x.v2.positionScreen.copy(V),x.z=Math.max(E.z,V.z),x.materials=P.materials,I.push(x)}else if(P instanceof THREE.Particle&&(J.set(P.matrixWorld.n14,P.matrixWorld.n24,P.matrixWorld.n34,1),C.multiplyVector4(J),J.z/=J.w,J.z>0&&J.z<1))ea=D[G]=D[G]||new THREE.RenderableParticle,G++,y=ea,y.x=J.x/J.w,y.y=J.y/J.w,y.z=J.z,y.rotation=P.rotation.z,y.scale.x=P.scale.x*Math.abs(y.x-
+(J.x+g.projectionMatrix.n11)/(J.w+g.projectionMatrix.n14)),y.scale.y=P.scale.y*Math.abs(y.y-(J.y+g.projectionMatrix.n22)/(J.w+g.projectionMatrix.n24)),y.materials=P.materials,I.push(y);j&&I.sort(c);return I}};
+THREE.DOMRenderer=function(){THREE.Renderer.call(this);var b=null,c=new THREE.Projector,e,f,g,j;this.domElement=document.createElement("div");this.setSize=function(b,c){e=b;f=c;g=e/2;j=f/2};this.render=function(e,f){var m,o,p,u,v,t,x,w;b=c.projectScene(e,f);m=0;for(o=b.length;m<o;m++)if(v=b[m],v instanceof THREE.RenderableParticle){x=v.x*g+g;w=v.y*j+j;p=0;for(u=v.material.length;p<u;p++)if(t=v.material[p],t instanceof THREE.ParticleDOMMaterial)t=t.domElement,t.style.left=x+"px",t.style.top=w+"px"}}};
+THREE.CanvasRenderer=function(b){function c(b){if(A!=b)t.globalAlpha=A=b}function e(b){if(y!=b){switch(b){case THREE.NormalBlending:t.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:t.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:t.globalCompositeOperation="darker"}y=b}}function f(b){if(G!=b)t.strokeStyle=G=b}function g(b){if(D!=b)t.fillStyle=D=b}var j=this,h=null,k=new THREE.Projector,b=b||{},m=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
+o,p,u,v,t=m.getContext("2d"),x=new THREE.Color(0),w=0,A=1,y=0,G=null,D=null,I=null,J=null,C=null,B,L,E,V,H=new THREE.RenderableVertex,S=new THREE.RenderableVertex,K,Q,n,T,X,M,W,ha,ca,fa,ga,$,Y=new THREE.Color(0),P=new THREE.Color(0),ea=new THREE.Color(0),Z=new THREE.Color(0),da=new THREE.Color(0),ia=[],U,ja,pa,la,ma,Fa,ya,Ia,Ja,Ta,ra=new THREE.Rectangle,na=new THREE.Rectangle,aa=new THREE.Rectangle,xa=!1,va=new THREE.Color,oa=new THREE.Color,Da=new THREE.Color,Ga=new THREE.Color,sa=new THREE.Vector3,
+R,Aa,ka,za,Wa,Ba,b=16;R=document.createElement("canvas");R.width=R.height=2;Aa=R.getContext("2d");Aa.fillStyle="rgba(0,0,0,1)";Aa.fillRect(0,0,2,2);ka=Aa.getImageData(0,0,2,2);za=ka.data;Wa=document.createElement("canvas");Wa.width=Wa.height=b;Ba=Wa.getContext("2d");Ba.translate(-b/2,-b/2);Ba.scale(b,b);b--;this.domElement=m;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setSize=function(b,c){o=b;p=c;u=Math.floor(o/2);v=Math.floor(p/2);m.width=o;m.height=
+p;ra.set(-u,-v,u,v);na.set(-u,-v,u,v);A=1;y=0;C=J=I=D=G=null};this.setClearColor=function(b,c){x.copy(b);w=c;na.set(-u,-v,u,v)};this.setClearColorHex=function(b,c){x.setHex(b);w=c;na.set(-u,-v,u,v)};this.clear=function(){t.setTransform(1,0,0,-1,u,v);na.isEmpty()||(na.minSelf(ra),na.inflate(2),w<1&&t.clearRect(Math.floor(na.getX()),Math.floor(na.getY()),Math.floor(na.getWidth()),Math.floor(na.getHeight())),w>0&&(e(THREE.NormalBlending),c(1),g("rgba("+Math.floor(x.r*255)+","+Math.floor(x.g*255)+","+
+Math.floor(x.b*255)+","+w+")"),t.fillRect(Math.floor(na.getX()),Math.floor(na.getY()),Math.floor(na.getWidth()),Math.floor(na.getHeight()))),na.empty())};this.render=function(b,m){function o(b){var c,e,f,h=b.lights;oa.setRGB(0,0,0);Da.setRGB(0,0,0);Ga.setRGB(0,0,0);b=0;for(c=h.length;b<c;b++)e=h[b],f=e.color,e instanceof THREE.AmbientLight?(oa.r+=f.r,oa.g+=f.g,oa.b+=f.b):e instanceof THREE.DirectionalLight?(Da.r+=f.r,Da.g+=f.g,Da.b+=f.b):e instanceof THREE.PointLight&&(Ga.r+=f.r,Ga.g+=f.g,Ga.b+=f.b)}
+function p(b,c,e,f){var h,g,j,k,n=b.lights,b=0;for(h=n.length;b<h;b++)g=n[b],j=g.color,g instanceof THREE.DirectionalLight?(k=e.dot(g.position),k<=0||(k*=g.intensity,f.r+=j.r*k,f.g+=j.g*k,f.b+=j.b*k)):g instanceof THREE.PointLight&&(k=e.dot(sa.sub(g.position,c).normalize()),k<=0||(k*=g.distance==0?1:1-Math.min(c.distanceTo(g.position)/g.distance,1),k!=0&&(k*=g.intensity,f.r+=j.r*k,f.g+=j.g*k,f.b+=j.b*k)))}function x(b,h,j){c(j.opacity);e(j.blending);var k,n,m,o,p,ka;if(j instanceof THREE.ParticleBasicMaterial){if(j.map)o=
+j.map.image,p=o.width>>1,ka=o.height>>1,j=h.scale.x*u,m=h.scale.y*v,k=j*p,n=m*ka,aa.set(b.x-k,b.y-n,b.x+k,b.y+n),ra.instersects(aa)&&(t.save(),t.translate(b.x,b.y),t.rotate(-h.rotation),t.scale(j,-m),t.translate(-p,-ka),t.drawImage(o,0,0),t.restore())}else j instanceof THREE.ParticleCanvasMaterial&&(k=h.scale.x*u,n=h.scale.y*v,aa.set(b.x-k,b.y-n,b.x+k,b.y+n),ra.instersects(aa)&&(f(j.color.getContextStyle()),g(j.color.getContextStyle()),t.save(),t.translate(b.x,b.y),t.rotate(-h.rotation),t.scale(k,
+n),j.program(t),t.restore()))}function w(b,h,g,j){c(j.opacity);e(j.blending);t.beginPath();t.moveTo(b.positionScreen.x,b.positionScreen.y);t.lineTo(h.positionScreen.x,h.positionScreen.y);t.closePath();if(j instanceof THREE.LineBasicMaterial){b=j.linewidth;if(I!=b)t.lineWidth=I=b;b=j.linecap;if(J!=b)t.lineCap=J=b;b=j.linejoin;if(C!=b)t.lineJoin=C=b;f(j.color.getContextStyle());t.stroke();aa.inflate(j.linewidth*2)}}function A(b,f,h,g,k,u,o,t,ka){j.data.vertices+=3;j.data.faces++;c(t.opacity);e(t.blending);
+K=b.positionScreen.x;Q=b.positionScreen.y;n=f.positionScreen.x;T=f.positionScreen.y;X=h.positionScreen.x;M=h.positionScreen.y;D(K,Q,n,T,X,M);if(t instanceof THREE.MeshBasicMaterial)if(t.map)t.map.mapping instanceof THREE.UVMapping&&(la=o.uvs[0],Za(K,Q,n,T,X,M,la[g].u,la[g].v,la[k].u,la[k].v,la[u].u,la[u].v,t.map));else if(t.envMap){if(t.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=m.matrixWorldInverse,sa.copy(o.vertexNormalsWorld[0]),ma=(sa.x*b.n11+sa.y*b.n12+sa.z*b.n13)*0.5+0.5,Fa=
+-(sa.x*b.n21+sa.y*b.n22+sa.z*b.n23)*0.5+0.5,sa.copy(o.vertexNormalsWorld[1]),ya=(sa.x*b.n11+sa.y*b.n12+sa.z*b.n13)*0.5+0.5,Ia=-(sa.x*b.n21+sa.y*b.n22+sa.z*b.n23)*0.5+0.5,sa.copy(o.vertexNormalsWorld[2]),Ja=(sa.x*b.n11+sa.y*b.n12+sa.z*b.n13)*0.5+0.5,Ta=-(sa.x*b.n21+sa.y*b.n22+sa.z*b.n23)*0.5+0.5,Za(K,Q,n,T,X,M,ma,Fa,ya,Ia,Ja,Ta,t.envMap)}else t.wireframe?Ka(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(t.color);else if(t instanceof THREE.MeshLambertMaterial)t.map&&!t.wireframe&&
+(t.map.mapping instanceof THREE.UVMapping&&(la=o.uvs[0],Za(K,Q,n,T,X,M,la[g].u,la[g].v,la[k].u,la[k].v,la[u].u,la[u].v,t.map)),e(THREE.SubtractiveBlending)),xa?!t.wireframe&&t.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==3?(P.r=ea.r=Z.r=oa.r,P.g=ea.g=Z.g=oa.g,P.b=ea.b=Z.b=oa.b,p(ka,o.v1.positionWorld,o.vertexNormalsWorld[0],P),p(ka,o.v2.positionWorld,o.vertexNormalsWorld[1],ea),p(ka,o.v3.positionWorld,o.vertexNormalsWorld[2],Z),da.r=(ea.r+Z.r)*0.5,da.g=(ea.g+Z.g)*0.5,da.b=(ea.b+Z.b)*
+0.5,pa=Xa(P,ea,Z,da),Ua(K,Q,n,T,X,M,0,0,1,0,0,1,pa)):(va.r=oa.r,va.g=oa.g,va.b=oa.b,p(ka,o.centroidWorld,o.normalWorld,va),Y.r=Math.max(0,Math.min(t.color.r*va.r,1)),Y.g=Math.max(0,Math.min(t.color.g*va.g,1)),Y.b=Math.max(0,Math.min(t.color.b*va.b,1)),t.wireframe?Ka(Y,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(Y)):t.wireframe?Ka(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(t.color);else if(t instanceof THREE.MeshDepthMaterial)U=m.near,ja=m.far,P.r=P.g=
+P.b=1-Oa(b.positionScreen.z,U,ja),ea.r=ea.g=ea.b=1-Oa(f.positionScreen.z,U,ja),Z.r=Z.g=Z.b=1-Oa(h.positionScreen.z,U,ja),da.r=(ea.r+Z.r)*0.5,da.g=(ea.g+Z.g)*0.5,da.b=(ea.b+Z.b)*0.5,pa=Xa(P,ea,Z,da),Ua(K,Q,n,T,X,M,0,0,1,0,0,1,pa);else if(t instanceof THREE.MeshNormalMaterial)Y.r=Va(o.normalWorld.x),Y.g=Va(o.normalWorld.y),Y.b=Va(o.normalWorld.z),t.wireframe?Ka(Y,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(Y)}function y(b,f,h,g,k,u,o,t,ka){j.data.vertices+=4;j.data.faces++;c(t.opacity);
+e(t.blending);if(t.map||t.envMap)A(b,f,g,0,1,3,o,t,ka),A(k,h,u,1,2,3,o,t,ka);else if(K=b.positionScreen.x,Q=b.positionScreen.y,n=f.positionScreen.x,T=f.positionScreen.y,X=h.positionScreen.x,M=h.positionScreen.y,W=g.positionScreen.x,ha=g.positionScreen.y,ca=k.positionScreen.x,fa=k.positionScreen.y,ga=u.positionScreen.x,$=u.positionScreen.y,t instanceof THREE.MeshBasicMaterial)G(K,Q,n,T,X,M,W,ha),t.wireframe?Ka(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(t.color);else if(t instanceof
+THREE.MeshLambertMaterial)xa?!t.wireframe&&t.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==4?(P.r=ea.r=Z.r=da.r=oa.r,P.g=ea.g=Z.g=da.g=oa.g,P.b=ea.b=Z.b=da.b=oa.b,p(ka,o.v1.positionWorld,o.vertexNormalsWorld[0],P),p(ka,o.v2.positionWorld,o.vertexNormalsWorld[1],ea),p(ka,o.v4.positionWorld,o.vertexNormalsWorld[3],Z),p(ka,o.v3.positionWorld,o.vertexNormalsWorld[2],da),pa=Xa(P,ea,Z,da),D(K,Q,n,T,W,ha),Ua(K,Q,n,T,W,ha,0,0,1,0,0,1,pa),D(ca,fa,X,M,ga,$),Ua(ca,fa,X,M,ga,$,1,0,1,1,0,1,pa)):(va.r=
+oa.r,va.g=oa.g,va.b=oa.b,p(ka,o.centroidWorld,o.normalWorld,va),Y.r=Math.max(0,Math.min(t.color.r*va.r,1)),Y.g=Math.max(0,Math.min(t.color.g*va.g,1)),Y.b=Math.max(0,Math.min(t.color.b*va.b,1)),G(K,Q,n,T,X,M,W,ha),t.wireframe?Ka(Y,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(Y)):(G(K,Q,n,T,X,M,W,ha),t.wireframe?Ka(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(t.color));else if(t instanceof THREE.MeshNormalMaterial)Y.r=Va(o.normalWorld.x),Y.g=Va(o.normalWorld.y),
+Y.b=Va(o.normalWorld.z),G(K,Q,n,T,X,M,W,ha),t.wireframe?Ka(Y,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(Y);else if(t instanceof THREE.MeshDepthMaterial)U=m.near,ja=m.far,P.r=P.g=P.b=1-Oa(b.positionScreen.z,U,ja),ea.r=ea.g=ea.b=1-Oa(f.positionScreen.z,U,ja),Z.r=Z.g=Z.b=1-Oa(g.positionScreen.z,U,ja),da.r=da.g=da.b=1-Oa(h.positionScreen.z,U,ja),pa=Xa(P,ea,Z,da),D(K,Q,n,T,W,ha),Ua(K,Q,n,T,W,ha,0,0,1,0,0,1,pa),D(ca,fa,X,M,ga,$),Ua(ca,fa,X,M,ga,$,1,0,1,1,0,1,pa)}function D(b,c,e,f,
+h,g){t.beginPath();t.moveTo(b,c);t.lineTo(e,f);t.lineTo(h,g);t.lineTo(b,c);t.closePath()}function G(b,c,e,f,h,g,j,k){t.beginPath();t.moveTo(b,c);t.lineTo(e,f);t.lineTo(h,g);t.lineTo(j,k);t.lineTo(b,c);t.closePath()}function Ka(b,c,e,h){if(I!=c)t.lineWidth=I=c;if(J!=e)t.lineCap=J=e;if(C!=h)t.lineJoin=C=h;f(b.getContextStyle());t.stroke();aa.inflate(c*2)}function La(b){g(b.getContextStyle());t.fill()}function Za(b,c,e,f,h,j,k,n,m,o,u,p,ka){if(ka.image.width!=0){if(ka.needsUpdate==!0||ia[ka.id]==void 0){var v=
+ka.wrapS==THREE.RepeatWrapping,Ba=ka.wrapT==THREE.RepeatWrapping;ia[ka.id]=t.createPattern(ka.image,v&&Ba?"repeat":v&&!Ba?"repeat-x":!v&&Ba?"repeat-y":"no-repeat");ka.needsUpdate=!1}g(ia[ka.id]);var v=ka.offset.x/ka.repeat.x,Ba=ka.offset.y/ka.repeat.y,x=(ka.image.width-1)*ka.repeat.x,ka=(ka.image.height-1)*ka.repeat.y,k=(k+v)*x,n=(n+Ba)*ka,m=(m+v)*x,o=(o+Ba)*ka,u=(u+v)*x,p=(p+Ba)*ka;e-=b;f-=c;h-=b;j-=c;m-=k;o-=n;u-=k;p-=n;v=1/(m*p-u*o);ka=(p*e-o*h)*v;o=(p*f-o*j)*v;e=(m*h-u*e)*v;f=(m*j-u*f)*v;b=b-
+ka*k-e*n;c=c-o*k-f*n;t.save();t.transform(ka,o,e,f,b,c);t.fill();t.restore()}}function Ua(b,c,e,f,h,g,j,k,n,m,o,u,ka){var p,v;p=ka.width-1;v=ka.height-1;j*=p;k*=v;n*=p;m*=v;o*=p;u*=v;e-=b;f-=c;h-=b;g-=c;n-=j;m-=k;o-=j;u-=k;v=1/(n*u-o*m);p=(u*e-m*h)*v;m=(u*f-m*g)*v;e=(n*h-o*e)*v;f=(n*g-o*f)*v;b=b-p*j-e*k;c=c-m*j-f*k;t.save();t.transform(p,m,e,f,b,c);t.clip();t.drawImage(ka,0,0);t.restore()}function Xa(b,c,e,f){var h=~~(b.r*255),g=~~(b.g*255),b=~~(b.b*255),j=~~(c.r*255),k=~~(c.g*255),c=~~(c.b*255),
+n=~~(e.r*255),m=~~(e.g*255),e=~~(e.b*255),t=~~(f.r*255),o=~~(f.g*255),f=~~(f.b*255);za[0]=h<0?0:h>255?255:h;za[1]=g<0?0:g>255?255:g;za[2]=b<0?0:b>255?255:b;za[4]=j<0?0:j>255?255:j;za[5]=k<0?0:k>255?255:k;za[6]=c<0?0:c>255?255:c;za[8]=n<0?0:n>255?255:n;za[9]=m<0?0:m>255?255:m;za[10]=e<0?0:e>255?255:e;za[12]=t<0?0:t>255?255:t;za[13]=o<0?0:o>255?255:o;za[14]=f<0?0:f>255?255:f;Aa.putImageData(ka,0,0);Ba.drawImage(R,0,0);return Wa}function Oa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+
+1)*0.5;return b<0?0:b>1?1:b}function Ma(b,c){var e=c.x-b.x,f=c.y-b.y,h=e*e+f*f;h!=0&&(h=1/Math.sqrt(h),e*=h,f*=h,c.x+=e,c.y+=f,b.x-=e,b.y-=f)}var Ya,$a,qa,Ca,Na,F,z,N;this.autoClear?this.clear():t.setTransform(1,0,0,-1,u,v);j.data.vertices=0;j.data.faces=0;h=k.projectScene(b,m,this.sortElements);(xa=b.lights.length>0)&&o(b);Ya=0;for($a=h.length;Ya<$a;Ya++){qa=h[Ya];aa.empty();if(qa instanceof THREE.RenderableParticle){B=qa;B.x*=u;B.y*=v;Ca=0;for(Na=qa.materials.length;Ca<Na;)N=qa.materials[Ca++],
+N.opacity!=0&&x(B,qa,N,b)}else if(qa instanceof THREE.RenderableLine){if(B=qa.v1,L=qa.v2,B.positionScreen.x*=u,B.positionScreen.y*=v,L.positionScreen.x*=u,L.positionScreen.y*=v,aa.addPoint(B.positionScreen.x,B.positionScreen.y),aa.addPoint(L.positionScreen.x,L.positionScreen.y),ra.instersects(aa)){Ca=0;for(Na=qa.materials.length;Ca<Na;)N=qa.materials[Ca++],N.opacity!=0&&w(B,L,qa,N,b)}}else if(qa instanceof THREE.RenderableFace3){if(B=qa.v1,L=qa.v2,E=qa.v3,B.positionScreen.x*=u,B.positionScreen.y*=
 v,L.positionScreen.x*=u,L.positionScreen.y*=v,E.positionScreen.x*=u,E.positionScreen.y*=v,qa.overdraw&&(Ma(B.positionScreen,L.positionScreen),Ma(L.positionScreen,E.positionScreen),Ma(E.positionScreen,B.positionScreen)),aa.add3Points(B.positionScreen.x,B.positionScreen.y,L.positionScreen.x,L.positionScreen.y,E.positionScreen.x,E.positionScreen.y),ra.instersects(aa)){Ca=0;for(Na=qa.meshMaterials.length;Ca<Na;)if(N=qa.meshMaterials[Ca++],N instanceof THREE.MeshFaceMaterial){F=0;for(z=qa.faceMaterials.length;F<
 v,L.positionScreen.x*=u,L.positionScreen.y*=v,E.positionScreen.x*=u,E.positionScreen.y*=v,qa.overdraw&&(Ma(B.positionScreen,L.positionScreen),Ma(L.positionScreen,E.positionScreen),Ma(E.positionScreen,B.positionScreen)),aa.add3Points(B.positionScreen.x,B.positionScreen.y,L.positionScreen.x,L.positionScreen.y,E.positionScreen.x,E.positionScreen.y),ra.instersects(aa)){Ca=0;for(Na=qa.meshMaterials.length;Ca<Na;)if(N=qa.meshMaterials[Ca++],N instanceof THREE.MeshFaceMaterial){F=0;for(z=qa.faceMaterials.length;F<
 z;)(N=qa.faceMaterials[F++])&&N.opacity!=0&&A(B,L,E,0,1,2,qa,N,b)}else N.opacity!=0&&A(B,L,E,0,1,2,qa,N,b)}}else if(qa instanceof THREE.RenderableFace4&&(B=qa.v1,L=qa.v2,E=qa.v3,V=qa.v4,B.positionScreen.x*=u,B.positionScreen.y*=v,L.positionScreen.x*=u,L.positionScreen.y*=v,E.positionScreen.x*=u,E.positionScreen.y*=v,V.positionScreen.x*=u,V.positionScreen.y*=v,H.positionScreen.copy(L.positionScreen),S.positionScreen.copy(V.positionScreen),qa.overdraw&&(Ma(B.positionScreen,L.positionScreen),Ma(L.positionScreen,
 z;)(N=qa.faceMaterials[F++])&&N.opacity!=0&&A(B,L,E,0,1,2,qa,N,b)}else N.opacity!=0&&A(B,L,E,0,1,2,qa,N,b)}}else if(qa instanceof THREE.RenderableFace4&&(B=qa.v1,L=qa.v2,E=qa.v3,V=qa.v4,B.positionScreen.x*=u,B.positionScreen.y*=v,L.positionScreen.x*=u,L.positionScreen.y*=v,E.positionScreen.x*=u,E.positionScreen.y*=v,V.positionScreen.x*=u,V.positionScreen.y*=v,H.positionScreen.copy(L.positionScreen),S.positionScreen.copy(V.positionScreen),qa.overdraw&&(Ma(B.positionScreen,L.positionScreen),Ma(L.positionScreen,
 V.positionScreen),Ma(V.positionScreen,B.positionScreen),Ma(E.positionScreen,H.positionScreen),Ma(E.positionScreen,S.positionScreen)),aa.addPoint(B.positionScreen.x,B.positionScreen.y),aa.addPoint(L.positionScreen.x,L.positionScreen.y),aa.addPoint(E.positionScreen.x,E.positionScreen.y),aa.addPoint(V.positionScreen.x,V.positionScreen.y),ra.instersects(aa))){Ca=0;for(Na=qa.meshMaterials.length;Ca<Na;)if(N=qa.meshMaterials[Ca++],N instanceof THREE.MeshFaceMaterial){F=0;for(z=qa.faceMaterials.length;F<
 V.positionScreen),Ma(V.positionScreen,B.positionScreen),Ma(E.positionScreen,H.positionScreen),Ma(E.positionScreen,S.positionScreen)),aa.addPoint(B.positionScreen.x,B.positionScreen.y),aa.addPoint(L.positionScreen.x,L.positionScreen.y),aa.addPoint(E.positionScreen.x,E.positionScreen.y),aa.addPoint(V.positionScreen.x,V.positionScreen.y),ra.instersects(aa))){Ca=0;for(Na=qa.meshMaterials.length;Ca<Na;)if(N=qa.meshMaterials[Ca++],N instanceof THREE.MeshFaceMaterial){F=0;for(z=qa.faceMaterials.length;F<
-z;)(N=qa.faceMaterials[F++])&&N.opacity!=0&&x(B,L,E,V,H,S,qa,N,b)}else N.opacity!=0&&x(B,L,E,V,H,S,qa,N,b)}na.addRectangle(aa)}t.setTransform(1,0,0,1,0,0)}};
-THREE.SVGRenderer=function(){function b(b,c,e){var f,h,g,j;f=0;for(h=b.lights.length;f<h;f++)g=b.lights[f],g instanceof THREE.DirectionalLight?(j=c.normalWorld.dot(g.position)*g.intensity,j>0&&(e.r+=g.color.r*j,e.g+=g.color.g*j,e.b+=g.color.b*j)):g instanceof THREE.PointLight&&(V.sub(g.position,c.centroidWorld),V.normalize(),j=c.normalWorld.dot(V)*g.intensity,j>0&&(e.r+=g.color.r*j,e.g+=g.color.g*j,e.b+=g.color.b*j))}function c(c,e,h,k,m,t){j.data.vertices+=3;j.data.faces++;K=f(Q++);K.setAttribute("d",
-"M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+"z");m instanceof THREE.MeshBasicMaterial?I.copy(m.color):m instanceof THREE.MeshLambertMaterial?D?(J.r=C.r,J.g=C.g,J.b=C.b,b(t,k,J),I.r=Math.max(0,Math.min(m.color.r*J.r,1)),I.g=Math.max(0,Math.min(m.color.g*J.g,1)),I.b=Math.max(0,Math.min(m.color.b*J.b,1))):I.copy(m.color):m instanceof THREE.MeshDepthMaterial?(E=1-m.__2near/(m.__farPlusNear-k.z*m.__farMinusNear),
-I.setRGB(E,E,E)):m instanceof THREE.MeshNormalMaterial&&I.setRGB(g(k.normalWorld.x),g(k.normalWorld.y),g(k.normalWorld.z));m.wireframe?K.setAttribute("style","fill: none; stroke: "+I.getContextStyle()+"; stroke-width: "+m.wireframeLinewidth+"; stroke-opacity: "+m.opacity+"; stroke-linecap: "+m.wireframeLinecap+"; stroke-linejoin: "+m.wireframeLinejoin):K.setAttribute("style","fill: "+I.getContextStyle()+"; fill-opacity: "+m.opacity);n.appendChild(K)}function e(c,e,h,k,m,t,o){j.data.vertices+=4;j.data.faces++;
-K=f(Q++);K.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?I.copy(t.color):t instanceof THREE.MeshLambertMaterial?D?(J.r=C.r,J.g=C.g,J.b=C.b,b(o,m,J),I.r=Math.max(0,Math.min(t.color.r*J.r,1)),I.g=Math.max(0,Math.min(t.color.g*J.g,1)),I.b=Math.max(0,Math.min(t.color.b*J.b,1))):I.copy(t.color):t instanceof
-THREE.MeshDepthMaterial?(E=1-t.__2near/(t.__farPlusNear-m.z*t.__farMinusNear),I.setRGB(E,E,E)):t instanceof THREE.MeshNormalMaterial&&I.setRGB(g(m.normalWorld.x),g(m.normalWorld.y),g(m.normalWorld.z));t.wireframe?K.setAttribute("style","fill: none; stroke: "+I.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):K.setAttribute("style","fill: "+I.getContextStyle()+"; fill-opacity: "+
-t.opacity);n.appendChild(K)}function f(b){H[b]==null&&(H[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),T==0&&H[b].setAttribute("shape-rendering","crispEdges"));return H[b]}function g(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var j=this,h=null,k=new THREE.Projector,n=document.createElementNS("http://www.w3.org/2000/svg","svg"),o,p,u,v,t,y,w,A,x=new THREE.Rectangle,G=new THREE.Rectangle,D=!1,I=new THREE.Color(16777215),J=new THREE.Color(16777215),C=new THREE.Color(0),B=new THREE.Color(0),
-L=new THREE.Color(0),E,V=new THREE.Vector3,H=[],S=[],K,Q,m,T=1;this.domElement=n;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setQuality=function(b){switch(b){case "high":T=1;break;case "low":T=0}};this.setSize=function(b,c){o=b;p=c;u=o/2;v=p/2;n.setAttribute("viewBox",-u+" "+-v+" "+o+" "+p);n.setAttribute("width",o);n.setAttribute("height",p);x.set(-u,-v,u,v)};this.clear=function(){for(;n.childNodes.length>0;)n.removeChild(n.childNodes[0])};this.render=
-function(b,f){var g,o,p,I,J,H,E,P;this.autoClear&&this.clear();j.data.vertices=0;j.data.faces=0;h=k.projectScene(b,f,this.sortElements);m=Q=0;if(D=b.lights.length>0){E=b.lights;C.setRGB(0,0,0);B.setRGB(0,0,0);L.setRGB(0,0,0);g=0;for(o=E.length;g<o;g++)p=E[g],I=p.color,p instanceof THREE.AmbientLight?(C.r+=I.r,C.g+=I.g,C.b+=I.b):p instanceof THREE.DirectionalLight?(B.r+=I.r,B.g+=I.g,B.b+=I.b):p instanceof THREE.PointLight&&(L.r+=I.r,L.g+=I.g,L.b+=I.b)}g=0;for(o=h.length;g<o;g++)if(E=h[g],G.empty(),
-E instanceof THREE.RenderableParticle){t=E;t.x*=u;t.y*=-v;p=0;for(I=E.materials.length;p<I;)p++}else if(E instanceof THREE.RenderableLine){if(t=E.v1,y=E.v2,t.positionScreen.x*=u,t.positionScreen.y*=-v,y.positionScreen.x*=u,y.positionScreen.y*=-v,G.addPoint(t.positionScreen.x,t.positionScreen.y),G.addPoint(y.positionScreen.x,y.positionScreen.y),x.instersects(G)){p=0;for(I=E.materials.length;p<I;)if((P=E.materials[p++])&&P.opacity!=0){J=t;H=y;var ea=m++;S[ea]==null&&(S[ea]=document.createElementNS("http://www.w3.org/2000/svg",
-"line"),T==0&&S[ea].setAttribute("shape-rendering","crispEdges"));K=S[ea];K.setAttribute("x1",J.positionScreen.x);K.setAttribute("y1",J.positionScreen.y);K.setAttribute("x2",H.positionScreen.x);K.setAttribute("y2",H.positionScreen.y);P instanceof THREE.LineBasicMaterial&&(K.setAttribute("style","fill: none; stroke: "+P.color.getContextStyle()+"; stroke-width: "+P.linewidth+"; stroke-opacity: "+P.opacity+"; stroke-linecap: "+P.linecap+"; stroke-linejoin: "+P.linejoin),n.appendChild(K))}}}else if(E instanceof
-THREE.RenderableFace3){if(t=E.v1,y=E.v2,w=E.v3,t.positionScreen.x*=u,t.positionScreen.y*=-v,y.positionScreen.x*=u,y.positionScreen.y*=-v,w.positionScreen.x*=u,w.positionScreen.y*=-v,G.addPoint(t.positionScreen.x,t.positionScreen.y),G.addPoint(y.positionScreen.x,y.positionScreen.y),G.addPoint(w.positionScreen.x,w.positionScreen.y),x.instersects(G)){p=0;for(I=E.meshMaterials.length;p<I;)if(P=E.meshMaterials[p++],P instanceof THREE.MeshFaceMaterial){J=0;for(H=E.faceMaterials.length;J<H;)(P=E.faceMaterials[J++])&&
-P.opacity!=0&&c(t,y,w,E,P,b)}else P&&P.opacity!=0&&c(t,y,w,E,P,b)}}else if(E instanceof THREE.RenderableFace4&&(t=E.v1,y=E.v2,w=E.v3,A=E.v4,t.positionScreen.x*=u,t.positionScreen.y*=-v,y.positionScreen.x*=u,y.positionScreen.y*=-v,w.positionScreen.x*=u,w.positionScreen.y*=-v,A.positionScreen.x*=u,A.positionScreen.y*=-v,G.addPoint(t.positionScreen.x,t.positionScreen.y),G.addPoint(y.positionScreen.x,y.positionScreen.y),G.addPoint(w.positionScreen.x,w.positionScreen.y),G.addPoint(A.positionScreen.x,A.positionScreen.y),
-x.instersects(G))){p=0;for(I=E.meshMaterials.length;p<I;)if(P=E.meshMaterials[p++],P instanceof THREE.MeshFaceMaterial){J=0;for(H=E.faceMaterials.length;J<H;)(P=E.faceMaterials[J++])&&P.opacity!=0&&e(t,y,w,A,E,P,b)}else P&&P.opacity!=0&&e(t,y,w,A,E,P,b)}}};
+z;)(N=qa.faceMaterials[F++])&&N.opacity!=0&&y(B,L,E,V,H,S,qa,N,b)}else N.opacity!=0&&y(B,L,E,V,H,S,qa,N,b)}na.addRectangle(aa)}t.setTransform(1,0,0,1,0,0)}};
+THREE.SVGRenderer=function(){function b(b,c,e){var f,h,g,j;f=0;for(h=b.lights.length;f<h;f++)g=b.lights[f],g instanceof THREE.DirectionalLight?(j=c.normalWorld.dot(g.position)*g.intensity,j>0&&(e.r+=g.color.r*j,e.g+=g.color.g*j,e.b+=g.color.b*j)):g instanceof THREE.PointLight&&(V.sub(g.position,c.centroidWorld),V.normalize(),j=c.normalWorld.dot(V)*g.intensity,j>0&&(e.r+=g.color.r*j,e.g+=g.color.g*j,e.b+=g.color.b*j))}function c(c,e,h,k,n,t){j.data.vertices+=3;j.data.faces++;K=f(Q++);K.setAttribute("d",
+"M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+"z");n instanceof THREE.MeshBasicMaterial?I.copy(n.color):n instanceof THREE.MeshLambertMaterial?D?(J.r=C.r,J.g=C.g,J.b=C.b,b(t,k,J),I.r=Math.max(0,Math.min(n.color.r*J.r,1)),I.g=Math.max(0,Math.min(n.color.g*J.g,1)),I.b=Math.max(0,Math.min(n.color.b*J.b,1))):I.copy(n.color):n instanceof THREE.MeshDepthMaterial?(E=1-n.__2near/(n.__farPlusNear-k.z*n.__farMinusNear),
+I.setRGB(E,E,E)):n instanceof THREE.MeshNormalMaterial&&I.setRGB(g(k.normalWorld.x),g(k.normalWorld.y),g(k.normalWorld.z));n.wireframe?K.setAttribute("style","fill: none; stroke: "+I.getContextStyle()+"; stroke-width: "+n.wireframeLinewidth+"; stroke-opacity: "+n.opacity+"; stroke-linecap: "+n.wireframeLinecap+"; stroke-linejoin: "+n.wireframeLinejoin):K.setAttribute("style","fill: "+I.getContextStyle()+"; fill-opacity: "+n.opacity);m.appendChild(K)}function e(c,e,h,k,n,t,o){j.data.vertices+=4;j.data.faces++;
+K=f(Q++);K.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?I.copy(t.color):t instanceof THREE.MeshLambertMaterial?D?(J.r=C.r,J.g=C.g,J.b=C.b,b(o,n,J),I.r=Math.max(0,Math.min(t.color.r*J.r,1)),I.g=Math.max(0,Math.min(t.color.g*J.g,1)),I.b=Math.max(0,Math.min(t.color.b*J.b,1))):I.copy(t.color):t instanceof
+THREE.MeshDepthMaterial?(E=1-t.__2near/(t.__farPlusNear-n.z*t.__farMinusNear),I.setRGB(E,E,E)):t instanceof THREE.MeshNormalMaterial&&I.setRGB(g(n.normalWorld.x),g(n.normalWorld.y),g(n.normalWorld.z));t.wireframe?K.setAttribute("style","fill: none; stroke: "+I.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):K.setAttribute("style","fill: "+I.getContextStyle()+"; fill-opacity: "+
+t.opacity);m.appendChild(K)}function f(b){H[b]==null&&(H[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),T==0&&H[b].setAttribute("shape-rendering","crispEdges"));return H[b]}function g(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var j=this,h=null,k=new THREE.Projector,m=document.createElementNS("http://www.w3.org/2000/svg","svg"),o,p,u,v,t,x,w,A,y=new THREE.Rectangle,G=new THREE.Rectangle,D=!1,I=new THREE.Color(16777215),J=new THREE.Color(16777215),C=new THREE.Color(0),B=new THREE.Color(0),
+L=new THREE.Color(0),E,V=new THREE.Vector3,H=[],S=[],K,Q,n,T=1;this.domElement=m;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setQuality=function(b){switch(b){case "high":T=1;break;case "low":T=0}};this.setSize=function(b,c){o=b;p=c;u=o/2;v=p/2;m.setAttribute("viewBox",-u+" "+-v+" "+o+" "+p);m.setAttribute("width",o);m.setAttribute("height",p);y.set(-u,-v,u,v)};this.clear=function(){for(;m.childNodes.length>0;)m.removeChild(m.childNodes[0])};this.render=
+function(b,f){var g,o,p,I,J,H,E,P;this.autoClear&&this.clear();j.data.vertices=0;j.data.faces=0;h=k.projectScene(b,f,this.sortElements);n=Q=0;if(D=b.lights.length>0){E=b.lights;C.setRGB(0,0,0);B.setRGB(0,0,0);L.setRGB(0,0,0);g=0;for(o=E.length;g<o;g++)p=E[g],I=p.color,p instanceof THREE.AmbientLight?(C.r+=I.r,C.g+=I.g,C.b+=I.b):p instanceof THREE.DirectionalLight?(B.r+=I.r,B.g+=I.g,B.b+=I.b):p instanceof THREE.PointLight&&(L.r+=I.r,L.g+=I.g,L.b+=I.b)}g=0;for(o=h.length;g<o;g++)if(E=h[g],G.empty(),
+E instanceof THREE.RenderableParticle){t=E;t.x*=u;t.y*=-v;p=0;for(I=E.materials.length;p<I;)p++}else if(E instanceof THREE.RenderableLine){if(t=E.v1,x=E.v2,t.positionScreen.x*=u,t.positionScreen.y*=-v,x.positionScreen.x*=u,x.positionScreen.y*=-v,G.addPoint(t.positionScreen.x,t.positionScreen.y),G.addPoint(x.positionScreen.x,x.positionScreen.y),y.instersects(G)){p=0;for(I=E.materials.length;p<I;)if((P=E.materials[p++])&&P.opacity!=0){J=t;H=x;var ea=n++;S[ea]==null&&(S[ea]=document.createElementNS("http://www.w3.org/2000/svg",
+"line"),T==0&&S[ea].setAttribute("shape-rendering","crispEdges"));K=S[ea];K.setAttribute("x1",J.positionScreen.x);K.setAttribute("y1",J.positionScreen.y);K.setAttribute("x2",H.positionScreen.x);K.setAttribute("y2",H.positionScreen.y);P instanceof THREE.LineBasicMaterial&&(K.setAttribute("style","fill: none; stroke: "+P.color.getContextStyle()+"; stroke-width: "+P.linewidth+"; stroke-opacity: "+P.opacity+"; stroke-linecap: "+P.linecap+"; stroke-linejoin: "+P.linejoin),m.appendChild(K))}}}else if(E instanceof
+THREE.RenderableFace3){if(t=E.v1,x=E.v2,w=E.v3,t.positionScreen.x*=u,t.positionScreen.y*=-v,x.positionScreen.x*=u,x.positionScreen.y*=-v,w.positionScreen.x*=u,w.positionScreen.y*=-v,G.addPoint(t.positionScreen.x,t.positionScreen.y),G.addPoint(x.positionScreen.x,x.positionScreen.y),G.addPoint(w.positionScreen.x,w.positionScreen.y),y.instersects(G)){p=0;for(I=E.meshMaterials.length;p<I;)if(P=E.meshMaterials[p++],P instanceof THREE.MeshFaceMaterial){J=0;for(H=E.faceMaterials.length;J<H;)(P=E.faceMaterials[J++])&&
+P.opacity!=0&&c(t,x,w,E,P,b)}else P&&P.opacity!=0&&c(t,x,w,E,P,b)}}else if(E instanceof THREE.RenderableFace4&&(t=E.v1,x=E.v2,w=E.v3,A=E.v4,t.positionScreen.x*=u,t.positionScreen.y*=-v,x.positionScreen.x*=u,x.positionScreen.y*=-v,w.positionScreen.x*=u,w.positionScreen.y*=-v,A.positionScreen.x*=u,A.positionScreen.y*=-v,G.addPoint(t.positionScreen.x,t.positionScreen.y),G.addPoint(x.positionScreen.x,x.positionScreen.y),G.addPoint(w.positionScreen.x,w.positionScreen.y),G.addPoint(A.positionScreen.x,A.positionScreen.y),
+y.instersects(G))){p=0;for(I=E.meshMaterials.length;p<I;)if(P=E.meshMaterials[p++],P instanceof THREE.MeshFaceMaterial){J=0;for(H=E.faceMaterials.length;J<H;)(P=E.faceMaterials[J++])&&P.opacity!=0&&e(t,x,w,A,E,P,b)}else P&&P.opacity!=0&&e(t,x,w,A,E,P,b)}}};
 THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform int combine;\n#endif",
 THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform int combine;\n#endif",
 envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[ 0 ].xyz, objectMatrix[ 1 ].xyz, objectMatrix[ 2 ].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",
 envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[ 0 ].xyz, objectMatrix[ 1 ].xyz, objectMatrix[ 2 ].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",
 map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform vec4 offsetRepeat;\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",map_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif",
 map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform vec4 offsetRepeat;\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",map_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif",
@@ -216,99 +218,99 @@ THREE.ShaderChunk.lights_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderCh
 "void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",
 "void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",
 THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},depthRGBA:{uniforms:{},fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask  = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}",vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,
 THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},depthRGBA:{uniforms:{},fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask  = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}",vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,
 "void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")}};
 "void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")}};
-THREE.WebGLRenderer=function(b){function c(b,c,e){var f,h,g,j=b.vertices,k=j.length,t=b.colors,n=t.length,o=b.__vertexArray,u=b.__colorArray,p=b.__sortArray,v=b.__dirtyVertices,y=b.__dirtyColors,w=b.__webglCustomAttributes,A,x;if(w)for(A in w)w[A].offset=0;if(e.sortParticles){ja.multiplySelf(e.matrixWorld);for(f=0;f<k;f++)h=j[f].position,ma.copy(h),ja.multiplyVector3(ma),p[f]=[ma.z,f];p.sort(function(b,c){return c[0]-b[0]});for(f=0;f<k;f++)h=j[p[f][1]].position,g=f*3,o[g]=h.x,o[g+1]=h.y,o[g+2]=h.z;
-for(f=0;f<n;f++)g=f*3,color=t[p[f][1]],u[g]=color.r,u[g+1]=color.g,u[g+2]=color.b;if(w)for(A in w){f=w[A];t=f.value.length;for(g=0;g<t;g++){index=p[g][1];n=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[n]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")x=f.value[index];f.size===2?(f.array[n]=x.x,f.array[n+1]=x.y):f.size===3?f.type==="c"?(f.array[n]=x.r,f.array[n+1]=x.g,f.array[n+2]=x.b):(f.array[n]=x.x,f.array[n+1]=x.y,f.array[n+2]=x.z):(f.array[n]=
-x.x,f.array[n+1]=x.y,f.array[n+2]=x.z,f.array[n+3]=x.w)}f.offset+=f.size}}}else{if(v)for(f=0;f<k;f++)h=j[f].position,g=f*3,o[g]=h.x,o[g+1]=h.y,o[g+2]=h.z;if(y)for(f=0;f<n;f++)color=t[f],g=f*3,u[g]=color.r,u[g+1]=color.g,u[g+2]=color.b;if(w)for(A in w)if(f=w[A],f.__original.needsUpdate){t=f.value.length;for(g=0;g<t;g++){n=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[n]=f.value[g]}else{if(f.boundTo===void 0||f.boundTo==="vertices")x=f.value[g];f.size===2?(f.array[n]=
-x.x,f.array[n+1]=x.y):f.size===3?f.type==="c"?(f.array[n]=x.r,f.array[n+1]=x.g,f.array[n+2]=x.b):(f.array[n]=x.x,f.array[n+1]=x.y,f.array[n+2]=x.z):(f.array[n]=x.x,f.array[n+1]=x.y,f.array[n+2]=x.z,f.array[n+3]=x.w)}f.offset+=f.size}}}if(v||e.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,b.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,o,c);if(y||e.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,b.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,u,c);if(w)for(A in w)if(f=w[A],f.__original.needsUpdate||e.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,
-f.buffer),m.bufferData(m.ARRAY_BUFFER,f.array,c)}function e(b,c,e,f,g){f.program||Q.initMaterial(f,c,e,g);if(f.morphTargets&&!g.__webglMorphTargetInfluences){g.__webglMorphTargetInfluences=new Float32Array(Q.maxMorphTargets);for(var h=0,j=Q.maxMorphTargets;h<j;h++)g.__webglMorphTargetInfluences[h]=0}var h=f.program,j=h.uniforms,k=f.uniforms;h!=X&&(m.useProgram(h),X=h);m.uniformMatrix4fv(j.projectionMatrix,!1,pa);if(e&&(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||
-f instanceof THREE.MeshPhongMaterial||f instanceof THREE.LineBasicMaterial||f instanceof THREE.ParticleBasicMaterial||f.fog))if(k.fogColor.value=e.color,e instanceof THREE.Fog)k.fogNear.value=e.near,k.fogFar.value=e.far;else if(e instanceof THREE.FogExp2)k.fogDensity.value=e.density;if(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f.lights){var n,t,o,u=0,p=0,v=0,y,x,w,A=Fa,D=A.directional.colors,G=A.directional.positions,I=A.point.colors,U=A.point.positions,C=A.point.distances,
-J=0,E=0,e=t=w=0;for(n=c.length;e<n;e++)if(t=c[e],o=t.color,y=t.position,x=t.intensity,w=t.distance,t instanceof THREE.AmbientLight)u+=o.r,p+=o.g,v+=o.b;else if(t instanceof THREE.DirectionalLight)w=J*3,D[w]=o.r*x,D[w+1]=o.g*x,D[w+2]=o.b*x,G[w]=y.x,G[w+1]=y.y,G[w+2]=y.z,J+=1;else if(t instanceof THREE.SpotLight)w=J*3,D[w]=o.r*x,D[w+1]=o.g*x,D[w+2]=o.b*x,o=1/y.length(),G[w]=y.x*o,G[w+1]=y.y*o,G[w+2]=y.z*o,J+=1;else if(t instanceof THREE.PointLight)t=E*3,I[t]=o.r*x,I[t+1]=o.g*x,I[t+2]=o.b*x,U[t]=y.x,
-U[t+1]=y.y,U[t+2]=y.z,C[E]=w,E+=1;for(e=J*3;e<D.length;e++)D[e]=0;for(e=E*3;e<I.length;e++)I[e]=0;A.point.length=E;A.directional.length=J;A.ambient[0]=u;A.ambient[1]=p;A.ambient[2]=v;c=Fa;k.enableLighting.value=c.directional.length+c.point.length;k.ambientLightColor.value=c.ambient;k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;k.pointLightColor.value=c.point.colors;k.pointLightPosition.value=c.point.positions;k.pointLightDistance.value=
+THREE.WebGLRenderer=function(b){function c(b,c,e){var f,h,g,j=b.vertices,k=j.length,t=b.colors,m=t.length,o=b.__vertexArray,u=b.__colorArray,p=b.__sortArray,v=b.__dirtyVertices,x=b.__dirtyColors,A=b.__webglCustomAttributes,w,y;if(A)for(w in A)A[w].offset=0;if(e.sortParticles){ja.multiplySelf(e.matrixWorld);for(f=0;f<k;f++)h=j[f].position,ma.copy(h),ja.multiplyVector3(ma),p[f]=[ma.z,f];p.sort(function(b,c){return c[0]-b[0]});for(f=0;f<k;f++)h=j[p[f][1]].position,g=f*3,o[g]=h.x,o[g+1]=h.y,o[g+2]=h.z;
+for(f=0;f<m;f++)g=f*3,color=t[p[f][1]],u[g]=color.r,u[g+1]=color.g,u[g+2]=color.b;if(A)for(w in A){f=A[w];t=f.value.length;for(g=0;g<t;g++){index=p[g][1];m=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[m]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")y=f.value[index];f.size===2?(f.array[m]=y.x,f.array[m+1]=y.y):f.size===3?f.type==="c"?(f.array[m]=y.r,f.array[m+1]=y.g,f.array[m+2]=y.b):(f.array[m]=y.x,f.array[m+1]=y.y,f.array[m+2]=y.z):(f.array[m]=
+y.x,f.array[m+1]=y.y,f.array[m+2]=y.z,f.array[m+3]=y.w)}f.offset+=f.size}}}else{if(v)for(f=0;f<k;f++)h=j[f].position,g=f*3,o[g]=h.x,o[g+1]=h.y,o[g+2]=h.z;if(x)for(f=0;f<m;f++)color=t[f],g=f*3,u[g]=color.r,u[g+1]=color.g,u[g+2]=color.b;if(A)for(w in A)if(f=A[w],f.__original.needsUpdate){t=f.value.length;for(g=0;g<t;g++){m=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[m]=f.value[g]}else{if(f.boundTo===void 0||f.boundTo==="vertices")y=f.value[g];f.size===2?(f.array[m]=
+y.x,f.array[m+1]=y.y):f.size===3?f.type==="c"?(f.array[m]=y.r,f.array[m+1]=y.g,f.array[m+2]=y.b):(f.array[m]=y.x,f.array[m+1]=y.y,f.array[m+2]=y.z):(f.array[m]=y.x,f.array[m+1]=y.y,f.array[m+2]=y.z,f.array[m+3]=y.w)}f.offset+=f.size}}}if(v||e.sortParticles)n.bindBuffer(n.ARRAY_BUFFER,b.__webglVertexBuffer),n.bufferData(n.ARRAY_BUFFER,o,c);if(x||e.sortParticles)n.bindBuffer(n.ARRAY_BUFFER,b.__webglColorBuffer),n.bufferData(n.ARRAY_BUFFER,u,c);if(A)for(w in A)if(f=A[w],f.__original.needsUpdate||e.sortParticles)n.bindBuffer(n.ARRAY_BUFFER,
+f.buffer),n.bufferData(n.ARRAY_BUFFER,f.array,c)}function e(b,c,e,f,g){f.program||Q.initMaterial(f,c,e,g);if(f.morphTargets&&!g.__webglMorphTargetInfluences){g.__webglMorphTargetInfluences=new Float32Array(Q.maxMorphTargets);for(var h=0,j=Q.maxMorphTargets;h<j;h++)g.__webglMorphTargetInfluences[h]=0}var h=f.program,j=h.uniforms,k=f.uniforms;h!=X&&(n.useProgram(h),X=h);n.uniformMatrix4fv(j.projectionMatrix,!1,pa);if(e&&(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||
+f instanceof THREE.MeshPhongMaterial||f instanceof THREE.LineBasicMaterial||f instanceof THREE.ParticleBasicMaterial||f.fog))if(k.fogColor.value=e.color,e instanceof THREE.Fog)k.fogNear.value=e.near,k.fogFar.value=e.far;else if(e instanceof THREE.FogExp2)k.fogDensity.value=e.density;if(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f.lights){var m,t,o,u=0,p=0,v=0,x,y,A,w=Fa,D=w.directional.colors,G=w.directional.positions,I=w.point.colors,U=w.point.positions,C=w.point.distances,
+J=0,E=0,e=t=A=0;for(m=c.length;e<m;e++)if(t=c[e],o=t.color,x=t.position,y=t.intensity,A=t.distance,t instanceof THREE.AmbientLight)u+=o.r,p+=o.g,v+=o.b;else if(t instanceof THREE.DirectionalLight)A=J*3,D[A]=o.r*y,D[A+1]=o.g*y,D[A+2]=o.b*y,G[A]=x.x,G[A+1]=x.y,G[A+2]=x.z,J+=1;else if(t instanceof THREE.SpotLight)A=J*3,D[A]=o.r*y,D[A+1]=o.g*y,D[A+2]=o.b*y,o=1/x.length(),G[A]=x.x*o,G[A+1]=x.y*o,G[A+2]=x.z*o,J+=1;else if(t instanceof THREE.PointLight)t=E*3,I[t]=o.r*y,I[t+1]=o.g*y,I[t+2]=o.b*y,U[t]=x.x,
+U[t+1]=x.y,U[t+2]=x.z,C[E]=A,E+=1;for(e=J*3;e<D.length;e++)D[e]=0;for(e=E*3;e<I.length;e++)I[e]=0;w.point.length=E;w.directional.length=J;w.ambient[0]=u;w.ambient[1]=p;w.ambient[2]=v;c=Fa;k.enableLighting.value=c.directional.length+c.point.length;k.ambientLightColor.value=c.ambient;k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;k.pointLightColor.value=c.point.colors;k.pointLightPosition.value=c.point.positions;k.pointLightDistance.value=
 c.point.distances}if(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial)k.diffuse.value=f.color,k.opacity.value=f.opacity,(k.map.texture=f.map)&&k.offsetRepeat.value.set(f.map.offset.x,f.map.offset.y,f.map.repeat.x,f.map.repeat.y),k.lightMap.texture=f.lightMap,k.envMap.texture=f.envMap,k.reflectivity.value=f.reflectivity,k.refractionRatio.value=f.refractionRatio,k.combine.value=f.combine,k.useRefract.value=f.envMap&&f.envMap.mapping instanceof
 c.point.distances}if(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial)k.diffuse.value=f.color,k.opacity.value=f.opacity,(k.map.texture=f.map)&&k.offsetRepeat.value.set(f.map.offset.x,f.map.offset.y,f.map.repeat.x,f.map.repeat.y),k.lightMap.texture=f.lightMap,k.envMap.texture=f.envMap,k.reflectivity.value=f.reflectivity,k.refractionRatio.value=f.refractionRatio,k.combine.value=f.combine,k.useRefract.value=f.envMap&&f.envMap.mapping instanceof
 THREE.CubeRefractionMapping;if(f instanceof THREE.LineBasicMaterial)k.diffuse.value=f.color,k.opacity.value=f.opacity;else if(f instanceof THREE.ParticleBasicMaterial)k.psColor.value=f.color,k.opacity.value=f.opacity,k.size.value=f.size,k.scale.value=ya.height/2,k.map.texture=f.map;else if(f instanceof THREE.MeshPhongMaterial)k.ambient.value=f.ambient,k.specular.value=f.specular,k.shininess.value=f.shininess;else if(f instanceof THREE.MeshDepthMaterial)k.mNear.value=b.near,k.mFar.value=b.far,k.opacity.value=
 THREE.CubeRefractionMapping;if(f instanceof THREE.LineBasicMaterial)k.diffuse.value=f.color,k.opacity.value=f.opacity;else if(f instanceof THREE.ParticleBasicMaterial)k.psColor.value=f.color,k.opacity.value=f.opacity,k.size.value=f.size,k.scale.value=ya.height/2,k.map.texture=f.map;else if(f instanceof THREE.MeshPhongMaterial)k.ambient.value=f.ambient,k.specular.value=f.specular,k.shininess.value=f.shininess;else if(f instanceof THREE.MeshDepthMaterial)k.mNear.value=b.near,k.mFar.value=b.far,k.opacity.value=
-f.opacity;else if(f instanceof THREE.MeshNormalMaterial)k.opacity.value=f.opacity;if(g.receiveShadow&&!f._shadowPass&&k.shadowMatrix){for(c=0;c<xa.length;c++)k.shadowMatrix.value[c]=xa[c],k.shadowMap.texture[c]=Q.shadowMap[c];k.shadowDarkness.value=Q.shadowMapDarkness;k.shadowBias.value=Q.shadowMapBias}for(var ja in k)if(n=h.uniforms[ja])if(e=k[ja],u=e.type,c=e.value,u=="i")m.uniform1i(n,c);else if(u=="f")m.uniform1f(n,c);else if(u=="v2")m.uniform2f(n,c.x,c.y);else if(u=="v3")m.uniform3f(n,c.x,c.y,
-c.z);else if(u=="v4")m.uniform4f(n,c.x,c.y,c.z,c.w);else if(u=="c")m.uniform3f(n,c.r,c.g,c.b);else if(u=="fv1")m.uniform1fv(n,c);else if(u=="fv")m.uniform3fv(n,c);else if(u=="v3v"){if(!e._array)e._array=new Float32Array(3*c.length);u=0;for(p=c.length;u<p;u++)v=u*3,e._array[v]=c[u].x,e._array[v+1]=c[u].y,e._array[v+2]=c[u].z;m.uniform3fv(n,e._array)}else if(u=="m4"){if(!e._array)e._array=new Float32Array(16);c.flattenToArray(e._array);m.uniformMatrix4fv(n,!1,e._array)}else if(u=="m4v"){if(!e._array)e._array=
-new Float32Array(16*c.length);u=0;for(p=c.length;u<p;u++)c[u].flattenToArrayOffset(e._array,u*16);m.uniformMatrix4fv(n,!1,e._array)}else if(u=="t"){if(m.uniform1i(n,c),n=e.texture)if(n.image instanceof Array&&n.image.length==6){if(e=n,e.image.length==6)if(e.needsUpdate){if(!e.image.__webglTextureCube)e.image.__webglTextureCube=m.createTexture();m.activeTexture(m.TEXTURE0+c);m.bindTexture(m.TEXTURE_CUBE_MAP,e.image.__webglTextureCube);for(c=0;c<6;c++)m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,
-m.RGBA,m.RGBA,m.UNSIGNED_BYTE,e.image[c]);B(m.TEXTURE_CUBE_MAP,e,e.image[0]);e.needsUpdate=!1}else m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_CUBE_MAP,e.image.__webglTextureCube)}else n instanceof THREE.WebGLRenderTargetCube?(e=n,m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_CUBE_MAP,e.__webglTexture)):L(n,c)}else if(u=="tv"){if(!e._array){e._array=[];u=0;for(p=e.texture.length;u<p;u++)e._array[u]=c+u}m.uniform1iv(n,e._array);u=0;for(p=e.texture.length;u<p;u++)(n=e.texture[u])&&
-L(n,e._array[u])}m.uniformMatrix4fv(j.modelViewMatrix,!1,g._modelViewMatrixArray);m.uniformMatrix3fv(j.normalMatrix,!1,g._normalMatrixArray);(f instanceof THREE.MeshShaderMaterial||f instanceof THREE.MeshPhongMaterial||f.envMap)&&j.cameraPosition!==null&&m.uniform3f(j.cameraPosition,b.position.x,b.position.y,b.position.z);(f instanceof THREE.MeshShaderMaterial||f.envMap||f.skinning||g.receiveShadow)&&j.objectMatrix!==null&&m.uniformMatrix4fv(j.objectMatrix,!1,g._objectMatrixArray);(f instanceof THREE.MeshPhongMaterial||
-f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshShaderMaterial||f.skinning)&&j.viewMatrix!==null&&m.uniformMatrix4fv(j.viewMatrix,!1,la);f.skinning&&(m.uniformMatrix4fv(j.cameraInverseMatrix,!1,la),m.uniformMatrix4fv(j.boneGlobalMatrices,!1,g.boneMatrices));return h}function f(b,c,f,g,h,j){if(g.opacity!=0){var k,b=e(b,c,f,g,j).attributes;if(!g.morphTargets&&b.position>=0)m.bindBuffer(m.ARRAY_BUFFER,h.__webglVertexBuffer),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0);else if(j.morphTargetBase){c=
-g.program.attributes;j.morphTargetBase!==-1?(m.bindBuffer(m.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[j.morphTargetBase]),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0)):c.position>=0&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglVertexBuffer),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0));if(j.morphTargetForcedOrder.length)for(var f=0,n=j.morphTargetForcedOrder,t=j.morphTargetInfluences;f<g.numSupportedMorphTargets&&f<n.length;)m.bindBuffer(m.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[n[f]]),m.vertexAttribPointer(c["morphTarget"+
-f],3,m.FLOAT,!1,0,0),j.__webglMorphTargetInfluences[f]=t[n[f]],f++;else{var n=[],o=-1,u=0,t=j.morphTargetInfluences,p,v=t.length,f=0;for(j.morphTargetBase!==-1&&(n[j.morphTargetBase]=!0);f<g.numSupportedMorphTargets;){for(p=0;p<v;p++)!n[p]&&t[p]>o&&(u=p,o=t[u]);m.bindBuffer(m.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[u]);m.vertexAttribPointer(c["morphTarget"+f],3,m.FLOAT,!1,0,0);j.__webglMorphTargetInfluences[f]=o;n[u]=1;o=-1;f++}}g.program.uniforms.morphTargetInfluences!==null&&m.uniform1fv(g.program.uniforms.morphTargetInfluences,
-j.__webglMorphTargetInfluences)}if(h.__webglCustomAttributes)for(k in h.__webglCustomAttributes)b[k]>=0&&(c=h.__webglCustomAttributes[k],m.bindBuffer(m.ARRAY_BUFFER,c.buffer),m.vertexAttribPointer(b[k],c.size,m.FLOAT,!1,0,0));b.color>=0&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglColorBuffer),m.vertexAttribPointer(b.color,3,m.FLOAT,!1,0,0));b.normal>=0&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglNormalBuffer),m.vertexAttribPointer(b.normal,3,m.FLOAT,!1,0,0));b.tangent>=0&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglTangentBuffer),
-m.vertexAttribPointer(b.tangent,4,m.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(m.bindBuffer(m.ARRAY_BUFFER,h.__webglUVBuffer),m.vertexAttribPointer(b.uv,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(b.uv)):m.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(m.bindBuffer(m.ARRAY_BUFFER,h.__webglUV2Buffer),m.vertexAttribPointer(b.uv2,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(b.uv2)):m.disableVertexAttribArray(b.uv2));g.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=
-0&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglSkinVertexABuffer),m.vertexAttribPointer(b.skinVertexA,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),m.vertexAttribPointer(b.skinVertexB,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),m.vertexAttribPointer(b.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),m.vertexAttribPointer(b.skinWeight,4,m.FLOAT,!1,0,0));j instanceof THREE.Mesh?(g.wireframe?(m.lineWidth(g.wireframeLinewidth),
-m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),m.drawElements(m.LINES,h.__webglLineCount,m.UNSIGNED_SHORT,0)):(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),m.drawElements(m.TRIANGLES,h.__webglFaceCount,m.UNSIGNED_SHORT,0)),Q.data.vertices+=h.__webglFaceCount,Q.data.faces+=h.__webglFaceCount/3,Q.data.drawCalls++):j instanceof THREE.Line?(j=j.type==THREE.LineStrip?m.LINE_STRIP:m.LINES,m.lineWidth(g.linewidth),m.drawArrays(j,0,h.__webglLineCount),Q.data.drawCalls++):j instanceof
-THREE.ParticleSystem?(m.drawArrays(m.POINTS,0,h.__webglParticleCount),Q.data.drawCalls++):j instanceof THREE.Ribbon&&(m.drawArrays(m.TRIANGLE_STRIP,0,h.__webglVertexCount),Q.data.drawCalls++)}}function g(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=m.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=m.createBuffer();b.hasPos&&(m.bindBuffer(m.ARRAY_BUFFER,b.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,b.positionArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(c.attributes.position),
-m.vertexAttribPointer(c.attributes.position,3,m.FLOAT,!1,0,0));if(b.hasNormal){m.bindBuffer(m.ARRAY_BUFFER,b.__webglNormalBuffer);if(e==THREE.FlatShading){var f,h,g,j,k,n,t,o,u,p,v=b.count*3;for(p=0;p<v;p+=9)e=b.normalArray,f=e[p],h=e[p+1],g=e[p+2],j=e[p+3],n=e[p+4],o=e[p+5],k=e[p+6],t=e[p+7],u=e[p+8],f=(f+j+k)/3,h=(h+n+t)/3,g=(g+o+u)/3,e[p]=f,e[p+1]=h,e[p+2]=g,e[p+3]=f,e[p+4]=h,e[p+5]=g,e[p+6]=f,e[p+7]=h,e[p+8]=g}m.bufferData(m.ARRAY_BUFFER,b.normalArray,m.DYNAMIC_DRAW);m.enableVertexAttribArray(c.attributes.normal);
-m.vertexAttribPointer(c.attributes.normal,3,m.FLOAT,!1,0,0)}m.drawArrays(m.TRIANGLES,0,b.count);b.count=0}function j(b){if(ha!=b.doubleSided)b.doubleSided?m.disable(m.CULL_FACE):m.enable(m.CULL_FACE),ha=b.doubleSided;if(ca!=b.flipSided)b.flipSided?m.frontFace(m.CW):m.frontFace(m.CCW),ca=b.flipSided}function h(b){ga!=b&&(b?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),ga=b)}function k(b,c,e){$!=b&&(b?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),$=b);if(b&&(Y!=c||P!=e))m.polygonOffset(c,
-e),Y=c,P=e}function n(b){U[0].set(b.n41-b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);U[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);U[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);U[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);U[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);U[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34);for(var c,b=0;b<6;b++)c=U[b],c.divideScalar(Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z))}function o(b){for(var c=b.matrixWorld,e=-b.geometry.boundingSphere.radius*
-Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)),f=0;f<6;f++)if(b=U[f].x*c.n14+U[f].y*c.n24+U[f].z*c.n34+U[f].w,b<=e)return!1;return!0}function p(b,c){b.list[b.count]=c;b.count+=1}function u(b){var c,e,f=b.object,h=b.opaque,g=b.transparent;g.count=0;b=h.count=0;for(c=f.materials.length;b<c;b++)e=f.materials[b],e.transparent?p(g,e):p(h,e)}function v(b){var c,e,f,h,g=b.object,j=b.buffer,k=b.opaque,m=b.transparent;m.count=0;b=k.count=0;for(f=g.materials.length;b<f;b++)if(c=g.materials[b],c instanceof
-THREE.MeshFaceMaterial){c=0;for(e=j.materials.length;c<e;c++)(h=j.materials[c])&&(h.transparent?p(m,h):p(k,h))}else(h=c)&&(h.transparent?p(m,h):p(k,h))}function t(b,c){return c.z-b.z}function y(b,c){var k,t,u,p=0,v,y,w,x,D=b.lights;aa||(aa=new THREE.Camera(Q.shadowCameraFov,c.aspect,Q.shadowCameraNear,Q.shadowCameraFar));k=0;for(t=D.length;k<t;k++)if(u=D[k],u instanceof THREE.SpotLight&&u.castShadow){Q.shadowMap[p]||(Q.shadowMap[p]=new THREE.WebGLRenderTarget(Q.shadowMapWidth,Q.shadowMapHeight,{minFilter:THREE.LinearFilter,
-magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));xa[p]||(xa[p]=new THREE.Matrix4);v=Q.shadowMap[p];y=xa[p];aa.position.copy(u.position);aa.target.position.copy(u.target.position);aa.update(void 0,!0);b.update(void 0,!1,aa);y.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);y.multiplySelf(aa.projectionMatrix);y.multiplySelf(aa.matrixWorldInverse);aa.matrixWorldInverse.flattenToArray(la);aa.projectionMatrix.flattenToArray(pa);ja.multiply(aa.projectionMatrix,aa.matrixWorldInverse);n(ja);Q.initWebGLObjects(b);
-E(v);m.clearColor(1,1,1,1);Q.clear();m.clearColor(ra.r,ra.g,ra.b,na);y=b.__webglObjects.length;u=b.__webglObjectsImmediate.length;for(v=0;v<y;v++)w=b.__webglObjects[v],x=w.object,x.visible&&x.castShadow?!(x instanceof THREE.Mesh)||o(x)?(x.matrixWorld.flattenToArray(x._objectMatrixArray),A(x,aa,!1),w.render=!0):w.render=!1:w.render=!1;h(!0);C(THREE.NormalBlending);for(v=0;v<y;v++)if(w=b.__webglObjects[v],w.render)x=w.object,buffer=w.buffer,j(x),w=x.customDepthMaterial?x.customDepthMaterial:x.geometry.morphTargets.length?
-Da:oa,f(aa,D,null,w,buffer,x);for(v=0;v<u;v++)w=b.__webglObjectsImmediate[v],x=w.object,x.visible&&x.castShadow&&(x.matrixAutoUpdate&&x.matrixWorld.flattenToArray(x._objectMatrixArray),A(x,aa,!1),j(x),program=e(aa,D,null,oa,x),x.render(function(b){g(b,program,oa.shading)}));p++}}function w(b,c){var e,f,h;e=R.attributes;var g=R.uniforms,j=ia/da,k,n=[],u=da*0.5,o=ia*0.5,p=!0;m.useProgram(R.program);X=R.program;ga=fa=-1;Aa||(m.enableVertexAttribArray(R.attributes.position),m.enableVertexAttribArray(R.attributes.uv),
-Aa=!0);m.disable(m.CULL_FACE);m.enable(m.BLEND);m.depthMask(!0);m.bindBuffer(m.ARRAY_BUFFER,R.vertexBuffer);m.vertexAttribPointer(e.position,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(e.uv,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,R.elementBuffer);m.uniformMatrix4fv(g.projectionMatrix,!1,pa);m.activeTexture(m.TEXTURE0);m.uniform1i(g.map,0);e=0;for(f=b.__webglSprites.length;e<f;e++)h=b.__webglSprites[e],h.useScreenCoordinates?h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,
-h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(t);e=0;for(f=b.__webglSprites.length;e<f;e++)h=b.__webglSprites[e],h.material===void 0&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(m.uniform1i(g.useScreenCoordinates,1),m.uniform3f(g.screenPosition,(h.position.x-u)/u,(o-h.position.y)/o,Math.max(0,Math.min(1,h.position.z)))):(m.uniform1i(g.useScreenCoordinates,0),m.uniform1i(g.affectedByDistance,h.affectedByDistance?1:0),m.uniformMatrix4fv(g.modelViewMatrix,
-!1,h._modelViewMatrixArray)),k=h.map.image.width/(h.scaleByViewport?ia:1),n[0]=k*j*h.scale.x,n[1]=k*h.scale.y,m.uniform2f(g.uvScale,h.uvScale.x,h.uvScale.y),m.uniform2f(g.uvOffset,h.uvOffset.x,h.uvOffset.y),m.uniform2f(g.alignment,h.alignment.x,h.alignment.y),m.uniform1f(g.opacity,h.opacity),m.uniform1f(g.rotation,h.rotation),m.uniform2fv(g.scale,n),h.mergeWith3D&&!p?(m.enable(m.DEPTH_TEST),p=!0):!h.mergeWith3D&&p&&(m.disable(m.DEPTH_TEST),p=!1),C(h.blending),L(h.map,0),m.drawElements(m.TRIANGLES,
-6,m.UNSIGNED_SHORT,0));m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(W)}function A(b,c,e){b._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);e&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}function x(b){var c,e,f,h;h=b.__materials;b=0;for(e=h.length;b<e;b++)if(f=h[b],f.attributes)for(c in f.attributes)if(f.attributes[c].needsUpdate)return!0;return!1}function G(b){var c,e,f,h;h=b.__materials;b=0;for(e=
-h.length;b<e;b++)if(f=h[b],f.attributes)for(c in f.attributes)f.attributes[c].needsUpdate=!1}function D(b,c){var e;for(e=b.length-1;e>=0;e--)b[e].object==c&&b.splice(e,1)}function I(b){function c(b){var h=[];e=0;for(f=b.length;e<f;e++)b[e]==void 0?h.push("undefined"):h.push(b[e].id);return h.join("_")}var e,f,h,g,j,k,m,n,t={},u=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};h=0;for(g=b.faces.length;h<g;h++)j=b.faces[h],k=j.materials,m=c(k),t[m]==void 0&&(t[m]={hash:m,counter:0}),
-n=t[m].hash+"_"+t[m].counter,b.geometryGroups[n]==void 0&&(b.geometryGroups[n]={faces:[],materials:k,vertices:0,numMorphTargets:u}),j=j instanceof THREE.Face3?3:4,b.geometryGroups[n].vertices+j>65535&&(t[m].counter+=1,n=t[m].hash+"_"+t[m].counter,b.geometryGroups[n]==void 0&&(b.geometryGroups[n]={faces:[],materials:k,vertices:0,numMorphTargets:u})),b.geometryGroups[n].faces.push(h),b.geometryGroups[n].vertices+=j}function J(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0},transparent:{list:[],
-count:0}})}function C(b){if(b!=fa){switch(b){case THREE.AdditiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE);break;case THREE.SubtractiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.SRC_COLOR);break;default:m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)}fa=b}}function B(b,c,e){(e.width&
-e.width-1)==0&&(e.height&e.height-1)==0?(m.texParameteri(b,m.TEXTURE_WRAP_S,K(c.wrapS)),m.texParameteri(b,m.TEXTURE_WRAP_T,K(c.wrapT)),m.texParameteri(b,m.TEXTURE_MAG_FILTER,K(c.magFilter)),m.texParameteri(b,m.TEXTURE_MIN_FILTER,K(c.minFilter)),m.generateMipmap(b)):(m.texParameteri(b,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(b,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(b,m.TEXTURE_MAG_FILTER,S(c.magFilter)),m.texParameteri(b,m.TEXTURE_MIN_FILTER,S(c.minFilter)))}function L(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglTexture=
-m.createTexture(),b.__webglInit=!0;m.activeTexture(m.TEXTURE0+c);m.bindTexture(m.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?m.texImage2D(m.TEXTURE_2D,0,K(b.format),b.image.width,b.image.height,0,K(b.format),m.UNSIGNED_BYTE,b.image.data):m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,b.image);B(m.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_2D,b.__webglTexture)}function E(b){var c=b instanceof THREE.WebGLRenderTargetCube;
-if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglRenderbuffer=m.createRenderbuffer();b.__webglTexture=m.createTexture();if(c){m.bindTexture(m.TEXTURE_CUBE_MAP,b.__webglTexture);B(m.TEXTURE_CUBE_MAP,b,b);b.__webglFramebuffer=[];for(var e=0;e<6;e++)b.__webglFramebuffer[e]=m.createFramebuffer(),m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,K(b.format),b.width,b.height,0,K(b.format),K(b.type),null)}else b.__webglFramebuffer=
-m.createFramebuffer(),m.bindTexture(m.TEXTURE_2D,b.__webglTexture),B(m.TEXTURE_2D,b,b),m.texImage2D(m.TEXTURE_2D,0,K(b.format),b.width,b.height,0,K(b.format),K(b.type),null);m.bindRenderbuffer(m.RENDERBUFFER,b.__webglRenderbuffer);if(c)for(e=0;e<6;++e)m.bindFramebuffer(m.FRAMEBUFFER,b.__webglFramebuffer[e]),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.TEXTURE_CUBE_MAP_POSITIVE_X+e,b.__webglTexture,0);else m.bindFramebuffer(m.FRAMEBUFFER,b.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,
-m.COLOR_ATTACHMENT0,m.TEXTURE_2D,b.__webglTexture,0);b.depthBuffer&&!b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,b.__webglRenderbuffer)):b.depthBuffer&&b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,b.__webglRenderbuffer)):m.renderbufferStorage(m.RENDERBUFFER,
-m.RGBA4,b.width,b.height);c?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,e=b.width,b=b.height):(c=null,e=da,b=ia);c!=M&&(m.bindFramebuffer(m.FRAMEBUFFER,c),m.viewport(ea,Z,e,b),M=c)}function V(b){b instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,b.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,
-null)):(m.bindTexture(m.TEXTURE_2D,b.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function H(b,c){var e;b=="fragment"?e=m.createShader(m.FRAGMENT_SHADER):b=="vertex"&&(e=m.createShader(m.VERTEX_SHADER));m.shaderSource(e,c);m.compileShader(e);if(!m.getShaderParameter(e,m.COMPILE_STATUS))return console.error(m.getShaderInfoLog(e)),console.error(c),null;return e}function S(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return m.NEAREST;
-default:return m.LINEAR}}function K(b){switch(b){case THREE.RepeatWrapping:return m.REPEAT;case THREE.ClampToEdgeWrapping:return m.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return m.MIRRORED_REPEAT;case THREE.NearestFilter:return m.NEAREST;case THREE.NearestMipMapNearestFilter:return m.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return m.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return m.LINEAR;case THREE.LinearMipMapNearestFilter:return m.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return m.LINEAR_MIPMAP_LINEAR;
-case THREE.ByteType:return m.BYTE;case THREE.UnsignedByteType:return m.UNSIGNED_BYTE;case THREE.ShortType:return m.SHORT;case THREE.UnsignedShortType:return m.UNSIGNED_SHORT;case THREE.IntType:return m.INT;case THREE.UnsignedShortType:return m.UNSIGNED_INT;case THREE.FloatType:return m.FLOAT;case THREE.AlphaFormat:return m.ALPHA;case THREE.RGBFormat:return m.RGB;case THREE.RGBAFormat:return m.RGBA;case THREE.LuminanceFormat:return m.LUMINANCE;case THREE.LuminanceAlphaFormat:return m.LUMINANCE_ALPHA}return 0}
-var Q=this,m,T=[],X=null,M=null,W=!0,ha=null,ca=null,fa=null,ga=null,$=null,Y=null,P=null,ea=0,Z=0,da=0,ia=0,U=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],ja=new THREE.Matrix4,pa=new Float32Array(16),la=new Float32Array(16),ma=new THREE.Vector4,Fa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},ya=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
+f.opacity;else if(f instanceof THREE.MeshNormalMaterial)k.opacity.value=f.opacity;if(g.receiveShadow&&!f._shadowPass&&k.shadowMatrix){for(c=0;c<xa.length;c++)k.shadowMatrix.value[c]=xa[c],k.shadowMap.texture[c]=Q.shadowMap[c];k.shadowDarkness.value=Q.shadowMapDarkness;k.shadowBias.value=Q.shadowMapBias}for(var ja in k)if(m=h.uniforms[ja])if(e=k[ja],u=e.type,c=e.value,u=="i")n.uniform1i(m,c);else if(u=="f")n.uniform1f(m,c);else if(u=="v2")n.uniform2f(m,c.x,c.y);else if(u=="v3")n.uniform3f(m,c.x,c.y,
+c.z);else if(u=="v4")n.uniform4f(m,c.x,c.y,c.z,c.w);else if(u=="c")n.uniform3f(m,c.r,c.g,c.b);else if(u=="fv1")n.uniform1fv(m,c);else if(u=="fv")n.uniform3fv(m,c);else if(u=="v3v"){if(!e._array)e._array=new Float32Array(3*c.length);u=0;for(p=c.length;u<p;u++)v=u*3,e._array[v]=c[u].x,e._array[v+1]=c[u].y,e._array[v+2]=c[u].z;n.uniform3fv(m,e._array)}else if(u=="m4"){if(!e._array)e._array=new Float32Array(16);c.flattenToArray(e._array);n.uniformMatrix4fv(m,!1,e._array)}else if(u=="m4v"){if(!e._array)e._array=
+new Float32Array(16*c.length);u=0;for(p=c.length;u<p;u++)c[u].flattenToArrayOffset(e._array,u*16);n.uniformMatrix4fv(m,!1,e._array)}else if(u=="t"){if(n.uniform1i(m,c),m=e.texture)if(m.image instanceof Array&&m.image.length==6){if(e=m,e.image.length==6)if(e.needsUpdate){if(!e.image.__webglTextureCube)e.image.__webglTextureCube=n.createTexture();n.activeTexture(n.TEXTURE0+c);n.bindTexture(n.TEXTURE_CUBE_MAP,e.image.__webglTextureCube);for(c=0;c<6;c++)n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,
+n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e.image[c]);B(n.TEXTURE_CUBE_MAP,e,e.image[0]);e.needsUpdate=!1}else n.activeTexture(n.TEXTURE0+c),n.bindTexture(n.TEXTURE_CUBE_MAP,e.image.__webglTextureCube)}else m instanceof THREE.WebGLRenderTargetCube?(e=m,n.activeTexture(n.TEXTURE0+c),n.bindTexture(n.TEXTURE_CUBE_MAP,e.__webglTexture)):L(m,c)}else if(u=="tv"){if(!e._array){e._array=[];u=0;for(p=e.texture.length;u<p;u++)e._array[u]=c+u}n.uniform1iv(m,e._array);u=0;for(p=e.texture.length;u<p;u++)(m=e.texture[u])&&
+L(m,e._array[u])}n.uniformMatrix4fv(j.modelViewMatrix,!1,g._modelViewMatrixArray);n.uniformMatrix3fv(j.normalMatrix,!1,g._normalMatrixArray);(f instanceof THREE.MeshShaderMaterial||f instanceof THREE.MeshPhongMaterial||f.envMap)&&j.cameraPosition!==null&&n.uniform3f(j.cameraPosition,b.position.x,b.position.y,b.position.z);(f instanceof THREE.MeshShaderMaterial||f.envMap||f.skinning||g.receiveShadow)&&j.objectMatrix!==null&&n.uniformMatrix4fv(j.objectMatrix,!1,g._objectMatrixArray);(f instanceof THREE.MeshPhongMaterial||
+f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshShaderMaterial||f.skinning)&&j.viewMatrix!==null&&n.uniformMatrix4fv(j.viewMatrix,!1,la);f.skinning&&(n.uniformMatrix4fv(j.cameraInverseMatrix,!1,la),n.uniformMatrix4fv(j.boneGlobalMatrices,!1,g.boneMatrices));return h}function f(b,c,f,g,h,j){if(g.opacity!=0){var k,b=e(b,c,f,g,j).attributes;if(!g.morphTargets&&b.position>=0)n.bindBuffer(n.ARRAY_BUFFER,h.__webglVertexBuffer),n.vertexAttribPointer(b.position,3,n.FLOAT,!1,0,0);else if(j.morphTargetBase){c=
+g.program.attributes;j.morphTargetBase!==-1?(n.bindBuffer(n.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[j.morphTargetBase]),n.vertexAttribPointer(c.position,3,n.FLOAT,!1,0,0)):c.position>=0&&(n.bindBuffer(n.ARRAY_BUFFER,h.__webglVertexBuffer),n.vertexAttribPointer(c.position,3,n.FLOAT,!1,0,0));if(j.morphTargetForcedOrder.length)for(var f=0,m=j.morphTargetForcedOrder,t=j.morphTargetInfluences;f<g.numSupportedMorphTargets&&f<m.length;)n.bindBuffer(n.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[m[f]]),n.vertexAttribPointer(c["morphTarget"+
+f],3,n.FLOAT,!1,0,0),j.__webglMorphTargetInfluences[f]=t[m[f]],f++;else{var m=[],o=-1,u=0,t=j.morphTargetInfluences,p,v=t.length,f=0;for(j.morphTargetBase!==-1&&(m[j.morphTargetBase]=!0);f<g.numSupportedMorphTargets;){for(p=0;p<v;p++)!m[p]&&t[p]>o&&(u=p,o=t[u]);n.bindBuffer(n.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[u]);n.vertexAttribPointer(c["morphTarget"+f],3,n.FLOAT,!1,0,0);j.__webglMorphTargetInfluences[f]=o;m[u]=1;o=-1;f++}}g.program.uniforms.morphTargetInfluences!==null&&n.uniform1fv(g.program.uniforms.morphTargetInfluences,
+j.__webglMorphTargetInfluences)}if(h.__webglCustomAttributes)for(k in h.__webglCustomAttributes)b[k]>=0&&(c=h.__webglCustomAttributes[k],n.bindBuffer(n.ARRAY_BUFFER,c.buffer),n.vertexAttribPointer(b[k],c.size,n.FLOAT,!1,0,0));b.color>=0&&(n.bindBuffer(n.ARRAY_BUFFER,h.__webglColorBuffer),n.vertexAttribPointer(b.color,3,n.FLOAT,!1,0,0));b.normal>=0&&(n.bindBuffer(n.ARRAY_BUFFER,h.__webglNormalBuffer),n.vertexAttribPointer(b.normal,3,n.FLOAT,!1,0,0));b.tangent>=0&&(n.bindBuffer(n.ARRAY_BUFFER,h.__webglTangentBuffer),
+n.vertexAttribPointer(b.tangent,4,n.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(n.bindBuffer(n.ARRAY_BUFFER,h.__webglUVBuffer),n.vertexAttribPointer(b.uv,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(b.uv)):n.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(n.bindBuffer(n.ARRAY_BUFFER,h.__webglUV2Buffer),n.vertexAttribPointer(b.uv2,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(b.uv2)):n.disableVertexAttribArray(b.uv2));g.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=
+0&&(n.bindBuffer(n.ARRAY_BUFFER,h.__webglSkinVertexABuffer),n.vertexAttribPointer(b.skinVertexA,4,n.FLOAT,!1,0,0),n.bindBuffer(n.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),n.vertexAttribPointer(b.skinVertexB,4,n.FLOAT,!1,0,0),n.bindBuffer(n.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),n.vertexAttribPointer(b.skinIndex,4,n.FLOAT,!1,0,0),n.bindBuffer(n.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),n.vertexAttribPointer(b.skinWeight,4,n.FLOAT,!1,0,0));j instanceof THREE.Mesh?(g.wireframe?(n.lineWidth(g.wireframeLinewidth),
+n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),n.drawElements(n.LINES,h.__webglLineCount,n.UNSIGNED_SHORT,0)):(n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),n.drawElements(n.TRIANGLES,h.__webglFaceCount,n.UNSIGNED_SHORT,0)),Q.data.vertices+=h.__webglFaceCount,Q.data.faces+=h.__webglFaceCount/3,Q.data.drawCalls++):j instanceof THREE.Line?(j=j.type==THREE.LineStrip?n.LINE_STRIP:n.LINES,n.lineWidth(g.linewidth),n.drawArrays(j,0,h.__webglLineCount),Q.data.drawCalls++):j instanceof
+THREE.ParticleSystem?(n.drawArrays(n.POINTS,0,h.__webglParticleCount),Q.data.drawCalls++):j instanceof THREE.Ribbon&&(n.drawArrays(n.TRIANGLE_STRIP,0,h.__webglVertexCount),Q.data.drawCalls++)}}function g(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=n.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=n.createBuffer();b.hasPos&&(n.bindBuffer(n.ARRAY_BUFFER,b.__webglVertexBuffer),n.bufferData(n.ARRAY_BUFFER,b.positionArray,n.DYNAMIC_DRAW),n.enableVertexAttribArray(c.attributes.position),
+n.vertexAttribPointer(c.attributes.position,3,n.FLOAT,!1,0,0));if(b.hasNormal){n.bindBuffer(n.ARRAY_BUFFER,b.__webglNormalBuffer);if(e==THREE.FlatShading){var f,h,g,j,k,m,t,o,u,p,v=b.count*3;for(p=0;p<v;p+=9)e=b.normalArray,f=e[p],h=e[p+1],g=e[p+2],j=e[p+3],m=e[p+4],o=e[p+5],k=e[p+6],t=e[p+7],u=e[p+8],f=(f+j+k)/3,h=(h+m+t)/3,g=(g+o+u)/3,e[p]=f,e[p+1]=h,e[p+2]=g,e[p+3]=f,e[p+4]=h,e[p+5]=g,e[p+6]=f,e[p+7]=h,e[p+8]=g}n.bufferData(n.ARRAY_BUFFER,b.normalArray,n.DYNAMIC_DRAW);n.enableVertexAttribArray(c.attributes.normal);
+n.vertexAttribPointer(c.attributes.normal,3,n.FLOAT,!1,0,0)}n.drawArrays(n.TRIANGLES,0,b.count);b.count=0}function j(b){if(ha!=b.doubleSided)b.doubleSided?n.disable(n.CULL_FACE):n.enable(n.CULL_FACE),ha=b.doubleSided;if(ca!=b.flipSided)b.flipSided?n.frontFace(n.CW):n.frontFace(n.CCW),ca=b.flipSided}function h(b){ga!=b&&(b?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),ga=b)}function k(b,c,e){$!=b&&(b?n.enable(n.POLYGON_OFFSET_FILL):n.disable(n.POLYGON_OFFSET_FILL),$=b);if(b&&(Y!=c||P!=e))n.polygonOffset(c,
+e),Y=c,P=e}function m(b){U[0].set(b.n41-b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);U[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);U[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);U[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);U[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);U[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34);for(var c,b=0;b<6;b++)c=U[b],c.divideScalar(Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z))}function o(b){for(var c=b.matrixWorld,e=-b.geometry.boundingSphere.radius*
+Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)),f=0;f<6;f++)if(b=U[f].x*c.n14+U[f].y*c.n24+U[f].z*c.n34+U[f].w,b<=e)return!1;return!0}function p(b,c){b.list[b.count]=c;b.count+=1}function u(b){var c,e,f=b.object,h=b.opaque,g=b.transparent;g.count=0;b=h.count=0;for(c=f.materials.length;b<c;b++)e=f.materials[b],e.transparent?p(g,e):p(h,e)}function v(b){var c,e,f,h,g=b.object,j=b.buffer,k=b.opaque,n=b.transparent;n.count=0;b=k.count=0;for(f=g.materials.length;b<f;b++)if(c=g.materials[b],c instanceof
+THREE.MeshFaceMaterial){c=0;for(e=j.materials.length;c<e;c++)(h=j.materials[c])&&(h.transparent?p(n,h):p(k,h))}else(h=c)&&(h.transparent?p(n,h):p(k,h))}function t(b,c){return c.z-b.z}function x(b,c){var k,t,u,p=0,v,x,y,w,D=b.lights;aa||(aa=new THREE.Camera(Q.shadowCameraFov,c.aspect,Q.shadowCameraNear,Q.shadowCameraFar));k=0;for(t=D.length;k<t;k++)if(u=D[k],u instanceof THREE.SpotLight&&u.castShadow){Q.shadowMap[p]||(Q.shadowMap[p]=new THREE.WebGLRenderTarget(Q.shadowMapWidth,Q.shadowMapHeight,{minFilter:THREE.LinearFilter,
+magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));xa[p]||(xa[p]=new THREE.Matrix4);v=Q.shadowMap[p];x=xa[p];aa.position.copy(u.position);aa.target.position.copy(u.target.position);aa.update(void 0,!0);b.update(void 0,!1,aa);x.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);x.multiplySelf(aa.projectionMatrix);x.multiplySelf(aa.matrixWorldInverse);aa.matrixWorldInverse.flattenToArray(la);aa.projectionMatrix.flattenToArray(pa);ja.multiply(aa.projectionMatrix,aa.matrixWorldInverse);m(ja);Q.initWebGLObjects(b);
+E(v);n.clearColor(1,1,1,1);Q.clear();n.clearColor(ra.r,ra.g,ra.b,na);x=b.__webglObjects.length;u=b.__webglObjectsImmediate.length;for(v=0;v<x;v++)y=b.__webglObjects[v],w=y.object,w.visible&&w.castShadow?!(w instanceof THREE.Mesh)||o(w)?(w.matrixWorld.flattenToArray(w._objectMatrixArray),A(w,aa,!1),y.render=!0):y.render=!1:y.render=!1;h(!0);C(THREE.NormalBlending);for(v=0;v<x;v++)if(y=b.__webglObjects[v],y.render)w=y.object,buffer=y.buffer,j(w),y=w.customDepthMaterial?w.customDepthMaterial:w.geometry.morphTargets.length?
+Da:oa,f(aa,D,null,y,buffer,w);for(v=0;v<u;v++)y=b.__webglObjectsImmediate[v],w=y.object,w.visible&&w.castShadow&&(w.matrixAutoUpdate&&w.matrixWorld.flattenToArray(w._objectMatrixArray),A(w,aa,!1),j(w),program=e(aa,D,null,oa,w),w.render(function(b){g(b,program,oa.shading)}));p++}}function w(b,c){var e,f,h;e=R.attributes;var g=R.uniforms,j=ia/da,k,m=[],u=da*0.5,o=ia*0.5,p=!0;n.useProgram(R.program);X=R.program;ga=fa=-1;Aa||(n.enableVertexAttribArray(R.attributes.position),n.enableVertexAttribArray(R.attributes.uv),
+Aa=!0);n.disable(n.CULL_FACE);n.enable(n.BLEND);n.depthMask(!0);n.bindBuffer(n.ARRAY_BUFFER,R.vertexBuffer);n.vertexAttribPointer(e.position,2,n.FLOAT,!1,16,0);n.vertexAttribPointer(e.uv,2,n.FLOAT,!1,16,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,R.elementBuffer);n.uniformMatrix4fv(g.projectionMatrix,!1,pa);n.activeTexture(n.TEXTURE0);n.uniform1i(g.map,0);e=0;for(f=b.__webglSprites.length;e<f;e++)h=b.__webglSprites[e],h.useScreenCoordinates?h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,
+h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(t);e=0;for(f=b.__webglSprites.length;e<f;e++)h=b.__webglSprites[e],h.material===void 0&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(n.uniform1i(g.useScreenCoordinates,1),n.uniform3f(g.screenPosition,(h.position.x-u)/u,(o-h.position.y)/o,Math.max(0,Math.min(1,h.position.z)))):(n.uniform1i(g.useScreenCoordinates,0),n.uniform1i(g.affectedByDistance,h.affectedByDistance?1:0),n.uniformMatrix4fv(g.modelViewMatrix,
+!1,h._modelViewMatrixArray)),k=h.map.image.width/(h.scaleByViewport?ia:1),m[0]=k*j*h.scale.x,m[1]=k*h.scale.y,n.uniform2f(g.uvScale,h.uvScale.x,h.uvScale.y),n.uniform2f(g.uvOffset,h.uvOffset.x,h.uvOffset.y),n.uniform2f(g.alignment,h.alignment.x,h.alignment.y),n.uniform1f(g.opacity,h.opacity),n.uniform1f(g.rotation,h.rotation),n.uniform2fv(g.scale,m),h.mergeWith3D&&!p?(n.enable(n.DEPTH_TEST),p=!0):!h.mergeWith3D&&p&&(n.disable(n.DEPTH_TEST),p=!1),C(h.blending),L(h.map,0),n.drawElements(n.TRIANGLES,
+6,n.UNSIGNED_SHORT,0));n.enable(n.CULL_FACE);n.enable(n.DEPTH_TEST);n.depthMask(W)}function A(b,c,e){b._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);e&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}function y(b){var c,e,f,h;h=b.__materials;b=0;for(e=h.length;b<e;b++)if(f=h[b],f.attributes)for(c in f.attributes)if(f.attributes[c].needsUpdate)return!0;return!1}function G(b){var c,e,f,h;h=b.__materials;b=0;for(e=
+h.length;b<e;b++)if(f=h[b],f.attributes)for(c in f.attributes)f.attributes[c].needsUpdate=!1}function D(b,c){var e;for(e=b.length-1;e>=0;e--)b[e].object==c&&b.splice(e,1)}function I(b){function c(b){var h=[];e=0;for(f=b.length;e<f;e++)b[e]==void 0?h.push("undefined"):h.push(b[e].id);return h.join("_")}var e,f,h,g,j,k,n,m,t={},u=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};h=0;for(g=b.faces.length;h<g;h++)j=b.faces[h],k=j.materials,n=c(k),t[n]==void 0&&(t[n]={hash:n,counter:0}),
+m=t[n].hash+"_"+t[n].counter,b.geometryGroups[m]==void 0&&(b.geometryGroups[m]={faces:[],materials:k,vertices:0,numMorphTargets:u}),j=j instanceof THREE.Face3?3:4,b.geometryGroups[m].vertices+j>65535&&(t[n].counter+=1,m=t[n].hash+"_"+t[n].counter,b.geometryGroups[m]==void 0&&(b.geometryGroups[m]={faces:[],materials:k,vertices:0,numMorphTargets:u})),b.geometryGroups[m].faces.push(h),b.geometryGroups[m].vertices+=j}function J(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0},transparent:{list:[],
+count:0}})}function C(b){if(b!=fa){switch(b){case THREE.AdditiveBlending:n.blendEquation(n.FUNC_ADD);n.blendFunc(n.SRC_ALPHA,n.ONE);break;case THREE.SubtractiveBlending:n.blendEquation(n.FUNC_ADD);n.blendFunc(n.ZERO,n.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:n.blendEquation(n.FUNC_ADD);n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA)}fa=b}}function B(b,c,e){(e.width&
+e.width-1)==0&&(e.height&e.height-1)==0?(n.texParameteri(b,n.TEXTURE_WRAP_S,K(c.wrapS)),n.texParameteri(b,n.TEXTURE_WRAP_T,K(c.wrapT)),n.texParameteri(b,n.TEXTURE_MAG_FILTER,K(c.magFilter)),n.texParameteri(b,n.TEXTURE_MIN_FILTER,K(c.minFilter)),n.generateMipmap(b)):(n.texParameteri(b,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(b,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(b,n.TEXTURE_MAG_FILTER,S(c.magFilter)),n.texParameteri(b,n.TEXTURE_MIN_FILTER,S(c.minFilter)))}function L(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglTexture=
+n.createTexture(),b.__webglInit=!0;n.activeTexture(n.TEXTURE0+c);n.bindTexture(n.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?n.texImage2D(n.TEXTURE_2D,0,K(b.format),b.image.width,b.image.height,0,K(b.format),n.UNSIGNED_BYTE,b.image.data):n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,b.image);B(n.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else n.activeTexture(n.TEXTURE0+c),n.bindTexture(n.TEXTURE_2D,b.__webglTexture)}function E(b){var c=b instanceof THREE.WebGLRenderTargetCube;
+if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglRenderbuffer=n.createRenderbuffer();b.__webglTexture=n.createTexture();if(c){n.bindTexture(n.TEXTURE_CUBE_MAP,b.__webglTexture);B(n.TEXTURE_CUBE_MAP,b,b);b.__webglFramebuffer=[];for(var e=0;e<6;e++)b.__webglFramebuffer[e]=n.createFramebuffer(),n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,K(b.format),b.width,b.height,0,K(b.format),K(b.type),null)}else b.__webglFramebuffer=
+n.createFramebuffer(),n.bindTexture(n.TEXTURE_2D,b.__webglTexture),B(n.TEXTURE_2D,b,b),n.texImage2D(n.TEXTURE_2D,0,K(b.format),b.width,b.height,0,K(b.format),K(b.type),null);n.bindRenderbuffer(n.RENDERBUFFER,b.__webglRenderbuffer);if(c)for(e=0;e<6;++e)n.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer[e]),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+e,b.__webglTexture,0);else n.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,
+n.COLOR_ATTACHMENT0,n.TEXTURE_2D,b.__webglTexture,0);b.depthBuffer&&!b.stencilBuffer?(n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,b.width,b.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,b.__webglRenderbuffer)):b.depthBuffer&&b.stencilBuffer?(n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,b.width,b.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,b.__webglRenderbuffer)):n.renderbufferStorage(n.RENDERBUFFER,
+n.RGBA4,b.width,b.height);c?n.bindTexture(n.TEXTURE_CUBE_MAP,null):n.bindTexture(n.TEXTURE_2D,null);n.bindRenderbuffer(n.RENDERBUFFER,null);n.bindFramebuffer(n.FRAMEBUFFER,null)}var f,h;b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,e=b.width,b=b.height,h=f=0):(c=null,e=da,b=ia,f=ea,h=Z);c!=M&&(n.bindFramebuffer(n.FRAMEBUFFER,c),n.viewport(f,h,e,b),M=c)}function V(b){b instanceof THREE.WebGLRenderTargetCube?(n.bindTexture(n.TEXTURE_CUBE_MAP,b.__webglTexture),n.generateMipmap(n.TEXTURE_CUBE_MAP),
+n.bindTexture(n.TEXTURE_CUBE_MAP,null)):(n.bindTexture(n.TEXTURE_2D,b.__webglTexture),n.generateMipmap(n.TEXTURE_2D),n.bindTexture(n.TEXTURE_2D,null))}function H(b,c){var e;b=="fragment"?e=n.createShader(n.FRAGMENT_SHADER):b=="vertex"&&(e=n.createShader(n.VERTEX_SHADER));n.shaderSource(e,c);n.compileShader(e);if(!n.getShaderParameter(e,n.COMPILE_STATUS))return console.error(n.getShaderInfoLog(e)),console.error(c),null;return e}function S(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return n.NEAREST;
+default:return n.LINEAR}}function K(b){switch(b){case THREE.RepeatWrapping:return n.REPEAT;case THREE.ClampToEdgeWrapping:return n.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return n.MIRRORED_REPEAT;case THREE.NearestFilter:return n.NEAREST;case THREE.NearestMipMapNearestFilter:return n.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return n.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return n.LINEAR;case THREE.LinearMipMapNearestFilter:return n.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return n.LINEAR_MIPMAP_LINEAR;
+case THREE.ByteType:return n.BYTE;case THREE.UnsignedByteType:return n.UNSIGNED_BYTE;case THREE.ShortType:return n.SHORT;case THREE.UnsignedShortType:return n.UNSIGNED_SHORT;case THREE.IntType:return n.INT;case THREE.UnsignedShortType:return n.UNSIGNED_INT;case THREE.FloatType:return n.FLOAT;case THREE.AlphaFormat:return n.ALPHA;case THREE.RGBFormat:return n.RGB;case THREE.RGBAFormat:return n.RGBA;case THREE.LuminanceFormat:return n.LUMINANCE;case THREE.LuminanceAlphaFormat:return n.LUMINANCE_ALPHA}return 0}
+var Q=this,n,T=[],X=null,M=null,W=!0,ha=null,ca=null,fa=null,ga=null,$=null,Y=null,P=null,ea=0,Z=0,da=0,ia=0,U=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],ja=new THREE.Matrix4,pa=new Float32Array(16),la=new Float32Array(16),ma=new THREE.Vector4,Fa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},ya=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
 Ia=b.stencil!==void 0?b.stencil:!0,Ja=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,Ta=b.antialias!==void 0?b.antialias:!1,ra=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),na=b.clearAlpha!==void 0?b.clearAlpha:0;_maxLights=b.maxLights!==void 0?b.maxLights:4;this.data={vertices:0,faces:0,drawCalls:0};this.maxMorphTargets=8;this.domElement=ya;this.sortObjects=this.autoClear=!0;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=
 Ia=b.stencil!==void 0?b.stencil:!0,Ja=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,Ta=b.antialias!==void 0?b.antialias:!1,ra=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),na=b.clearAlpha!==void 0?b.clearAlpha:0;_maxLights=b.maxLights!==void 0?b.maxLights:4;this.data={vertices:0,faces:0,drawCalls:0};this.maxMorphTargets=8;this.domElement=ya;this.sortObjects=this.autoClear=!0;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=
-512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=!0;var aa,xa=[],b=THREE.ShaderLib.depthRGBA,va=THREE.UniformsUtils.clone(b.uniforms),oa=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:va}),Da=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:va,morphTargets:!0});oa._shadowPass=!0;Da._shadowPass=!0;try{if(!(m=
-ya.getContext("experimental-webgl",{antialias:Ta,stencil:Ia,preserveDrawingBuffer:Ja})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+m.getParameter(m.VERSION)+" | "+m.getParameter(m.VENDOR)+" | "+m.getParameter(m.RENDERER)+" | "+m.getParameter(m.SHADING_LANGUAGE_VERSION))}catch(Ga){console.error(Ga)}m.clearColor(0,0,0,1);m.clearDepth(1);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);
-m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.clearColor(ra.r,ra.g,ra.b,na);this.context=m;var sa=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,R={};R.vertices=new Float32Array(16);R.faces=new Uint16Array(6);i=0;R.vertices[i++]=-1;R.vertices[i++]=-1;R.vertices[i++]=0;R.vertices[i++]=1;R.vertices[i++]=1;R.vertices[i++]=-1;R.vertices[i++]=1;R.vertices[i++]=1;R.vertices[i++]=1;R.vertices[i++]=1;R.vertices[i++]=1;R.vertices[i++]=0;R.vertices[i++]=-1;R.vertices[i++]=1;R.vertices[i++]=0;i=R.vertices[i++]=
-0;R.faces[i++]=0;R.faces[i++]=1;R.faces[i++]=2;R.faces[i++]=0;R.faces[i++]=2;R.faces[i++]=3;R.vertexBuffer=m.createBuffer();R.elementBuffer=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,R.vertexBuffer);m.bufferData(m.ARRAY_BUFFER,R.vertices,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,R.elementBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,R.faces,m.STATIC_DRAW);R.program=m.createProgram();m.attachShader(R.program,H("fragment",THREE.ShaderLib.sprite.fragmentShader));m.attachShader(R.program,H("vertex",
-THREE.ShaderLib.sprite.vertexShader));m.linkProgram(R.program);R.attributes={};R.uniforms={};R.attributes.position=m.getAttribLocation(R.program,"position");R.attributes.uv=m.getAttribLocation(R.program,"uv");R.uniforms.uvOffset=m.getUniformLocation(R.program,"uvOffset");R.uniforms.uvScale=m.getUniformLocation(R.program,"uvScale");R.uniforms.rotation=m.getUniformLocation(R.program,"rotation");R.uniforms.scale=m.getUniformLocation(R.program,"scale");R.uniforms.alignment=m.getUniformLocation(R.program,
-"alignment");R.uniforms.map=m.getUniformLocation(R.program,"map");R.uniforms.opacity=m.getUniformLocation(R.program,"opacity");R.uniforms.useScreenCoordinates=m.getUniformLocation(R.program,"useScreenCoordinates");R.uniforms.affectedByDistance=m.getUniformLocation(R.program,"affectedByDistance");R.uniforms.screenPosition=m.getUniformLocation(R.program,"screenPosition");R.uniforms.modelViewMatrix=m.getUniformLocation(R.program,"modelViewMatrix");R.uniforms.projectionMatrix=m.getUniformLocation(R.program,
-"projectionMatrix");var Aa=!1;this.setSize=function(b,c){ya.width=b;ya.height=c;this.setViewport(0,0,ya.width,ya.height)};this.setViewport=function(b,c,e,f){ea=b;Z=c;da=e;ia=f;m.viewport(ea,Z,da,ia)};this.setScissor=function(b,c,e,f){m.scissor(b,c,e,f)};this.enableScissorTest=function(b){b?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.enableDepthBufferWrite=function(b){W=b;m.depthMask(b)};this.setClearColorHex=function(b,c){ra.setHex(b);na=c;m.clearColor(ra.r,ra.g,ra.b,na)};this.setClearColor=
-function(b,c){ra.copy(b);na=c;m.clearColor(ra.r,ra.g,ra.b,na)};this.clear=function(){m.clear(m.COLOR_BUFFER_BIT|m.DEPTH_BUFFER_BIT|m.STENCIL_BUFFER_BIT)};this.getContext=function(){return m};this.initMaterial=function(b,c,e,f){var h,g,j;b instanceof THREE.MeshDepthMaterial?j="depth":b instanceof THREE.MeshNormalMaterial?j="normal":b instanceof THREE.MeshBasicMaterial?j="basic":b instanceof THREE.MeshLambertMaterial?j="lambert":b instanceof THREE.MeshPhongMaterial?j="phong":b instanceof THREE.LineBasicMaterial?
-j="basic":b instanceof THREE.ParticleBasicMaterial&&(j="particle_basic");if(j){var k=THREE.ShaderLib[j];b.uniforms=THREE.UniformsUtils.clone(k.uniforms);b.vertexShader=k.vertexShader;b.fragmentShader=k.fragmentShader}var n,t,u;n=u=k=0;for(t=c.length;n<t;n++)g=c[n],g instanceof THREE.SpotLight&&u++,g instanceof THREE.DirectionalLight&&u++,g instanceof THREE.PointLight&&k++;k+u<=_maxLights?n=u:(n=Math.ceil(_maxLights*u/(k+u)),k=_maxLights-n);g={directional:n,point:k};k=u=0;for(n=c.length;k<n;k++)t=
-c[k],t instanceof THREE.SpotLight&&t.castShadow&&u++;var o=50;if(f!==void 0&&f instanceof THREE.SkinnedMesh)o=f.bones.length;var p;a:{n=b.fragmentShader;t=b.vertexShader;var k=b.uniforms,c=b.attributes,e={map:!!b.map,envMap:!!b.envMap,lightMap:!!b.lightMap,vertexColors:b.vertexColors,fog:e,sizeAttenuation:b.sizeAttenuation,skinning:b.skinning,morphTargets:b.morphTargets,maxMorphTargets:this.maxMorphTargets,maxDirLights:g.directional,maxPointLights:g.point,maxBones:o,shadowMapEnabled:this.shadowMapEnabled&&
-f.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:u,alphaTest:b.alphaTest},v,f=[];j?f.push(j):(f.push(n),f.push(t));for(v in e)f.push(v),f.push(e[v]);j=f.join();v=0;for(f=T.length;v<f;v++)if(T[v].code==j){p=T[v].program;break a}v=m.createProgram();f=[sa?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+
+512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=!0;var aa,xa=[],b=THREE.ShaderLib.depthRGBA,va=THREE.UniformsUtils.clone(b.uniforms),oa=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:va}),Da=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:va,morphTargets:!0});oa._shadowPass=!0;Da._shadowPass=!0;try{if(!(n=
+ya.getContext("experimental-webgl",{antialias:Ta,stencil:Ia,preserveDrawingBuffer:Ja})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+n.getParameter(n.VERSION)+" | "+n.getParameter(n.VENDOR)+" | "+n.getParameter(n.RENDERER)+" | "+n.getParameter(n.SHADING_LANGUAGE_VERSION))}catch(Ga){console.error(Ga)}n.clearColor(0,0,0,1);n.clearDepth(1);n.enable(n.DEPTH_TEST);n.depthFunc(n.LEQUAL);n.frontFace(n.CCW);n.cullFace(n.BACK);n.enable(n.CULL_FACE);n.enable(n.BLEND);n.blendEquation(n.FUNC_ADD);
+n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA);n.clearColor(ra.r,ra.g,ra.b,na);this.context=n;var sa=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,R={};R.vertices=new Float32Array(16);R.faces=new Uint16Array(6);i=0;R.vertices[i++]=-1;R.vertices[i++]=-1;R.vertices[i++]=0;R.vertices[i++]=1;R.vertices[i++]=1;R.vertices[i++]=-1;R.vertices[i++]=1;R.vertices[i++]=1;R.vertices[i++]=1;R.vertices[i++]=1;R.vertices[i++]=1;R.vertices[i++]=0;R.vertices[i++]=-1;R.vertices[i++]=1;R.vertices[i++]=0;i=R.vertices[i++]=
+0;R.faces[i++]=0;R.faces[i++]=1;R.faces[i++]=2;R.faces[i++]=0;R.faces[i++]=2;R.faces[i++]=3;R.vertexBuffer=n.createBuffer();R.elementBuffer=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,R.vertexBuffer);n.bufferData(n.ARRAY_BUFFER,R.vertices,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,R.elementBuffer);n.bufferData(n.ELEMENT_ARRAY_BUFFER,R.faces,n.STATIC_DRAW);R.program=n.createProgram();n.attachShader(R.program,H("fragment",THREE.ShaderLib.sprite.fragmentShader));n.attachShader(R.program,H("vertex",
+THREE.ShaderLib.sprite.vertexShader));n.linkProgram(R.program);R.attributes={};R.uniforms={};R.attributes.position=n.getAttribLocation(R.program,"position");R.attributes.uv=n.getAttribLocation(R.program,"uv");R.uniforms.uvOffset=n.getUniformLocation(R.program,"uvOffset");R.uniforms.uvScale=n.getUniformLocation(R.program,"uvScale");R.uniforms.rotation=n.getUniformLocation(R.program,"rotation");R.uniforms.scale=n.getUniformLocation(R.program,"scale");R.uniforms.alignment=n.getUniformLocation(R.program,
+"alignment");R.uniforms.map=n.getUniformLocation(R.program,"map");R.uniforms.opacity=n.getUniformLocation(R.program,"opacity");R.uniforms.useScreenCoordinates=n.getUniformLocation(R.program,"useScreenCoordinates");R.uniforms.affectedByDistance=n.getUniformLocation(R.program,"affectedByDistance");R.uniforms.screenPosition=n.getUniformLocation(R.program,"screenPosition");R.uniforms.modelViewMatrix=n.getUniformLocation(R.program,"modelViewMatrix");R.uniforms.projectionMatrix=n.getUniformLocation(R.program,
+"projectionMatrix");var Aa=!1;this.setSize=function(b,c){ya.width=b;ya.height=c;this.setViewport(0,0,ya.width,ya.height)};this.setViewport=function(b,c,e,f){ea=b;Z=c;da=e;ia=f;n.viewport(ea,Z,da,ia)};this.setScissor=function(b,c,e,f){n.scissor(b,c,e,f)};this.enableScissorTest=function(b){b?n.enable(n.SCISSOR_TEST):n.disable(n.SCISSOR_TEST)};this.enableDepthBufferWrite=function(b){W=b;n.depthMask(b)};this.setClearColorHex=function(b,c){ra.setHex(b);na=c;n.clearColor(ra.r,ra.g,ra.b,na)};this.setClearColor=
+function(b,c){ra.copy(b);na=c;n.clearColor(ra.r,ra.g,ra.b,na)};this.clear=function(){n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT|n.STENCIL_BUFFER_BIT)};this.getContext=function(){return n};this.initMaterial=function(b,c,e,f){var h,g,j;b instanceof THREE.MeshDepthMaterial?j="depth":b instanceof THREE.MeshNormalMaterial?j="normal":b instanceof THREE.MeshBasicMaterial?j="basic":b instanceof THREE.MeshLambertMaterial?j="lambert":b instanceof THREE.MeshPhongMaterial?j="phong":b instanceof THREE.LineBasicMaterial?
+j="basic":b instanceof THREE.ParticleBasicMaterial&&(j="particle_basic");if(j){var k=THREE.ShaderLib[j];b.uniforms=THREE.UniformsUtils.clone(k.uniforms);b.vertexShader=k.vertexShader;b.fragmentShader=k.fragmentShader}var m,t,u;m=u=k=0;for(t=c.length;m<t;m++)g=c[m],g instanceof THREE.SpotLight&&u++,g instanceof THREE.DirectionalLight&&u++,g instanceof THREE.PointLight&&k++;k+u<=_maxLights?m=u:(m=Math.ceil(_maxLights*u/(k+u)),k=_maxLights-m);g={directional:m,point:k};k=u=0;for(m=c.length;k<m;k++)t=
+c[k],t instanceof THREE.SpotLight&&t.castShadow&&u++;var o=50;if(f!==void 0&&f instanceof THREE.SkinnedMesh)o=f.bones.length;var p;a:{m=b.fragmentShader;t=b.vertexShader;var k=b.uniforms,c=b.attributes,e={map:!!b.map,envMap:!!b.envMap,lightMap:!!b.lightMap,vertexColors:b.vertexColors,fog:e,sizeAttenuation:b.sizeAttenuation,skinning:b.skinning,morphTargets:b.morphTargets,maxMorphTargets:this.maxMorphTargets,maxDirLights:g.directional,maxPointLights:g.point,maxBones:o,shadowMapEnabled:this.shadowMapEnabled&&
+f.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:u,alphaTest:b.alphaTest},v,f=[];j?f.push(j):(f.push(m),f.push(t));for(v in e)f.push(v),f.push(e[v]);j=f.join();v=0;for(f=T.length;v<f;v++)if(T[v].code==j){p=T[v].program;break a}v=n.createProgram();f=[sa?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+
 e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapSoft?"#define SHADOWMAP_SOFT":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
 e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapSoft?"#define SHADOWMAP_SOFT":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
 g=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",e.fog?"#define USE_FOG":"",e.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.vertexColors?"#define USE_COLOR":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapSoft?"#define SHADOWMAP_SOFT":
 g=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",e.fog?"#define USE_FOG":"",e.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.vertexColors?"#define USE_COLOR":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapSoft?"#define SHADOWMAP_SOFT":
-"",e.shadowMapSoft?"#define SHADOWMAP_WIDTH "+e.shadowMapWidth.toFixed(1):"",e.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+e.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");m.attachShader(v,H("fragment",g+n));m.attachShader(v,H("vertex",f+t));m.linkProgram(v);m.getProgramParameter(v,m.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+m.getProgramParameter(v,m.VALIDATE_STATUS)+", gl error ["+m.getError()+"]");v.uniforms=
-{};v.attributes={};var x,f=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(x in k)f.push(x);x=f;f=0;for(k=x.length;f<k;f++)n=x[f],v.uniforms[n]=m.getUniformLocation(v,n);f=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(x=0;x<e.maxMorphTargets;x++)f.push("morphTarget"+x);for(p in c)f.push(p);p=f;x=0;for(c=p.length;x<c;x++)e=
-p[x],v.attributes[e]=m.getAttribLocation(v,e);T.push({program:v,code:j});p=v}b.program=p;p=b.program.attributes;p.position>=0&&m.enableVertexAttribArray(p.position);p.color>=0&&m.enableVertexAttribArray(p.color);p.normal>=0&&m.enableVertexAttribArray(p.normal);p.tangent>=0&&m.enableVertexAttribArray(p.tangent);b.skinning&&p.skinVertexA>=0&&p.skinVertexB>=0&&p.skinIndex>=0&&p.skinWeight>=0&&(m.enableVertexAttribArray(p.skinVertexA),m.enableVertexAttribArray(p.skinVertexB),m.enableVertexAttribArray(p.skinIndex),
-m.enableVertexAttribArray(p.skinWeight));if(b.attributes)for(h in b.attributes)p[h]!==void 0&&p[h]>=0&&m.enableVertexAttribArray(p[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h<this.maxMorphTargets;h++)x="morphTarget"+h,p[x]>=0&&(m.enableVertexAttribArray(p[x]),b.numSupportedMorphTargets++)};this.render=function(b,c,m,p){var x,D,G,I,U,J,H,B,L=b.lights,P=b.fog;this.shadowMapEnabled&&y(b,c);Q.data.vertices=0;Q.data.faces=0;Q.data.drawCalls=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,
-!1,c);c.matrixWorldInverse.flattenToArray(la);c.projectionMatrix.flattenToArray(pa);ja.multiply(c.projectionMatrix,c.matrixWorldInverse);n(ja);this.initWebGLObjects(b);E(m);(this.autoClear||p)&&this.clear();U=b.__webglObjects.length;for(p=0;p<U;p++)if(x=b.__webglObjects[p],H=x.object,H.visible)if(!(H instanceof THREE.Mesh)||o(H)){if(H.matrixWorld.flattenToArray(H._objectMatrixArray),A(H,c,!0),v(x),x.render=!0,this.sortObjects)x.object.renderDepth?x.z=x.object.renderDepth:(ma.copy(H.position),ja.multiplyVector3(ma),
-x.z=ma.z)}else x.render=!1;else x.render=!1;this.sortObjects&&b.__webglObjects.sort(t);J=b.__webglObjectsImmediate.length;for(p=0;p<J;p++)x=b.__webglObjectsImmediate[p],H=x.object,H.visible&&(H.matrixAutoUpdate&&H.matrixWorld.flattenToArray(H._objectMatrixArray),A(H,c,!0),u(x));if(b.overrideMaterial){h(b.overrideMaterial.depthTest);C(b.overrideMaterial.blending);for(p=0;p<U;p++)if(x=b.__webglObjects[p],x.render)H=x.object,B=x.buffer,j(H),f(c,L,P,b.overrideMaterial,B,H);for(p=0;p<J;p++)x=b.__webglObjectsImmediate[p],
-H=x.object,H.visible&&(j(H),D=e(c,L,P,b.overrideMaterial,H),H.render(function(c){g(c,D,b.overrideMaterial.shading)}))}else{C(THREE.NormalBlending);for(p=U-1;p>=0;p--)if(x=b.__webglObjects[p],x.render){H=x.object;B=x.buffer;G=x.opaque;j(H);for(x=0;x<G.count;x++)I=G.list[x],h(I.depthTest),k(I.polygonOffset,I.polygonOffsetFactor,I.polygonOffsetUnits),f(c,L,P,I,B,H)}for(p=0;p<J;p++)if(x=b.__webglObjectsImmediate[p],H=x.object,H.visible){G=x.opaque;j(H);for(x=0;x<G.count;x++)I=G.list[x],h(I.depthTest),
-k(I.polygonOffset,I.polygonOffsetFactor,I.polygonOffsetUnits),D=e(c,L,P,I,H),H.render(function(b){g(b,D,I.shading)})}for(p=0;p<U;p++)if(x=b.__webglObjects[p],x.render){H=x.object;B=x.buffer;G=x.transparent;j(H);for(x=0;x<G.count;x++)I=G.list[x],C(I.blending),h(I.depthTest),k(I.polygonOffset,I.polygonOffsetFactor,I.polygonOffsetUnits),f(c,L,P,I,B,H)}for(p=0;p<J;p++)if(x=b.__webglObjectsImmediate[p],H=x.object,H.visible){G=x.transparent;j(H);for(x=0;x<G.count;x++)I=G.list[x],C(I.blending),h(I.depthTest),
-k(I.polygonOffset,I.polygonOffsetFactor,I.polygonOffsetUnits),D=e(c,L,P,I,H),H.render(function(b){g(b,D,I.shading)})}}b.__webglSprites.length&&w(b,c);m&&m.minFilter!==THREE.NearestFilter&&m.minFilter!==THREE.LinearFilter&&V(m)};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var e=b.__objectsAdded[0],f=b,h=void 0,g=void 0,j=void 0;if(e._modelViewMatrix==void 0)e._modelViewMatrix=new THREE.Matrix4,
-e._normalMatrixArray=new Float32Array(9),e._modelViewMatrixArray=new Float32Array(16),e._objectMatrixArray=new Float32Array(16),e.matrixWorld.flattenToArray(e._objectMatrixArray);if(e instanceof THREE.Mesh)for(h in g=e.geometry,g.geometryGroups==void 0&&I(g),g.geometryGroups){j=g.geometryGroups[h];if(!j.__webglVertexBuffer){var k=j;k.__webglVertexBuffer=m.createBuffer();k.__webglNormalBuffer=m.createBuffer();k.__webglTangentBuffer=m.createBuffer();k.__webglColorBuffer=m.createBuffer();k.__webglUVBuffer=
-m.createBuffer();k.__webglUV2Buffer=m.createBuffer();k.__webglSkinVertexABuffer=m.createBuffer();k.__webglSkinVertexBBuffer=m.createBuffer();k.__webglSkinIndicesBuffer=m.createBuffer();k.__webglSkinWeightsBuffer=m.createBuffer();k.__webglFaceBuffer=m.createBuffer();k.__webglLineBuffer=m.createBuffer();if(k.numMorphTargets){var n=void 0,t=void 0;k.__webglMorphTargetsBuffers=[];n=0;for(t=k.numMorphTargets;n<t;n++)k.__webglMorphTargetsBuffers.push(m.createBuffer())}for(var k=j,n=e,p=void 0,u=void 0,
-o=void 0,v=o=void 0,y=void 0,w=void 0,A=w=t=0,U=o=u=void 0,H=U=u=p=void 0,o=void 0,v=n.geometry,y=v.faces,U=k.faces,p=0,u=U.length;p<u;p++)o=U[p],o=y[o],o instanceof THREE.Face3?(t+=3,w+=1,A+=3):o instanceof THREE.Face4&&(t+=4,w+=2,A+=4);for(var p=k,u=n,C=U=y=void 0,E=void 0,C=void 0,o=[],y=0,U=u.materials.length;y<U;y++)if(C=u.materials[y],C instanceof THREE.MeshFaceMaterial){C=0;for(l=p.materials.length;C<l;C++)(E=p.materials[C])&&o.push(E)}else(E=C)&&o.push(E);p=o;k.__materials=p;a:{y=u=void 0;
-U=p.length;for(u=0;u<U;u++)if(y=p[u],y.map||y.lightMap||y instanceof THREE.MeshShaderMaterial){u=!0;break a}u=!1}a:{U=y=void 0;o=p.length;for(y=0;y<o;y++)if(U=p[y],!(U instanceof THREE.MeshBasicMaterial&&!U.envMap||U instanceof THREE.MeshDepthMaterial)){U=U&&U.shading!=void 0&&U.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}U=!1}a:{o=y=void 0;C=p.length;for(y=0;y<C;y++)if(o=p[y],o.vertexColors){o=o.vertexColors;break a}o=!1}k.__vertexArray=new Float32Array(t*3);if(U)k.__normalArray=
-new Float32Array(t*3);if(v.hasTangents)k.__tangentArray=new Float32Array(t*4);if(o)k.__colorArray=new Float32Array(t*3);if(u){if(v.faceUvs.length>0||v.faceVertexUvs.length>0)k.__uvArray=new Float32Array(t*2);if(v.faceUvs.length>1||v.faceVertexUvs.length>1)k.__uv2Array=new Float32Array(t*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)k.__skinVertexAArray=new Float32Array(t*4),k.__skinVertexBArray=new Float32Array(t*4),k.__skinIndexArray=new Float32Array(t*4),k.__skinWeightArray=
-new Float32Array(t*4);k.__faceArray=new Uint16Array(w*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));k.__lineArray=new Uint16Array(A*2);if(k.numMorphTargets){k.__morphTargetsArrays=[];v=0;for(y=k.numMorphTargets;v<y;v++)k.__morphTargetsArrays.push(new Float32Array(t*3))}k.__needsSmoothNormals=U==THREE.SmoothShading;k.__uvType=u;k.__vertexColorType=o;k.__normalType=U;k.__webglFaceCount=w*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0);k.__webglLineCount=A*2;v=0;for(y=p.length;v<
-y;v++)if(u=p[v],u.attributes){if(k.__webglCustomAttributes===void 0)k.__webglCustomAttributes={};for(a in u.attributes){o=u.attributes[a];U={};for(H in o)U[H]=o[H];if(!U.__webglInitialized||U.createUniqueBuffers)U.__webglInitialized=!0,w=1,U.type==="v2"?w=2:U.type==="v3"?w=3:U.type==="v4"?w=4:U.type==="c"&&(w=3),U.size=w,U.array=new Float32Array(t*w),U.buffer=m.createBuffer(),U.buffer.belongsToAttribute=a,o.needsUpdate=!0,U.__original=o;k.__webglCustomAttributes[a]=U}}k.__inittedArrays=!0;g.__dirtyVertices=
-!0;g.__dirtyMorphTargets=!0;g.__dirtyElements=!0;g.__dirtyUvs=!0;g.__dirtyNormals=!0;g.__dirtyTangents=!0;g.__dirtyColors=!0}J(f.__webglObjects,j,e)}else if(e instanceof THREE.Ribbon){g=e.geometry;if(!g.__webglVertexBuffer)h=g,h.__webglVertexBuffer=m.createBuffer(),h.__webglColorBuffer=m.createBuffer(),h=g,j=h.vertices.length,h.__vertexArray=new Float32Array(j*3),h.__colorArray=new Float32Array(j*3),h.__webglVertexCount=j,g.__dirtyVertices=!0,g.__dirtyColors=!0;J(f.__webglObjects,g,e)}else if(e instanceof
-THREE.Line){g=e.geometry;if(!g.__webglVertexBuffer)h=g,h.__webglVertexBuffer=m.createBuffer(),h.__webglColorBuffer=m.createBuffer(),h=g,j=h.vertices.length,h.__vertexArray=new Float32Array(j*3),h.__colorArray=new Float32Array(j*3),h.__webglLineCount=j,g.__dirtyVertices=!0,g.__dirtyColors=!0;J(f.__webglObjects,g,e)}else if(e instanceof THREE.ParticleSystem){g=e.geometry;if(!g.__webglVertexBuffer){h=g;h.__webglVertexBuffer=m.createBuffer();h.__webglColorBuffer=m.createBuffer();h=g;j=e;k=h.vertices.length;
-h.__vertexArray=new Float32Array(k*3);h.__colorArray=new Float32Array(k*3);h.__sortArray=[];h.__webglParticleCount=k;h.__materials=j.materials;H=t=n=void 0;n=0;for(t=j.materials.length;n<t;n++)if(H=j.materials[n],H.attributes){if(h.__webglCustomAttributes===void 0)h.__webglCustomAttributes={};for(a in H.attributes){originalAttribute=H.attributes[a];attribute={};for(property in originalAttribute)attribute[property]=originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=
-!0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=4:attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(k*size),attribute.buffer=m.createBuffer(),attribute.buffer.belongsToAttribute=a,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;h.__webglCustomAttributes[a]=attribute}}g.__dirtyVertices=!0;g.__dirtyColors=!0}J(f.__webglObjects,g,e)}else THREE.MarchingCubes!==void 0&&e instanceof THREE.MarchingCubes?
+"",e.shadowMapSoft?"#define SHADOWMAP_WIDTH "+e.shadowMapWidth.toFixed(1):"",e.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+e.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");n.attachShader(v,H("fragment",g+m));n.attachShader(v,H("vertex",f+t));n.linkProgram(v);n.getProgramParameter(v,n.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+n.getProgramParameter(v,n.VALIDATE_STATUS)+", gl error ["+n.getError()+"]");v.uniforms=
+{};v.attributes={};var x,f=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(x in k)f.push(x);x=f;f=0;for(k=x.length;f<k;f++)m=x[f],v.uniforms[m]=n.getUniformLocation(v,m);f=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(x=0;x<e.maxMorphTargets;x++)f.push("morphTarget"+x);for(p in c)f.push(p);p=f;x=0;for(c=p.length;x<c;x++)e=
+p[x],v.attributes[e]=n.getAttribLocation(v,e);T.push({program:v,code:j});p=v}b.program=p;p=b.program.attributes;p.position>=0&&n.enableVertexAttribArray(p.position);p.color>=0&&n.enableVertexAttribArray(p.color);p.normal>=0&&n.enableVertexAttribArray(p.normal);p.tangent>=0&&n.enableVertexAttribArray(p.tangent);b.skinning&&p.skinVertexA>=0&&p.skinVertexB>=0&&p.skinIndex>=0&&p.skinWeight>=0&&(n.enableVertexAttribArray(p.skinVertexA),n.enableVertexAttribArray(p.skinVertexB),n.enableVertexAttribArray(p.skinIndex),
+n.enableVertexAttribArray(p.skinWeight));if(b.attributes)for(h in b.attributes)p[h]!==void 0&&p[h]>=0&&n.enableVertexAttribArray(p[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h<this.maxMorphTargets;h++)x="morphTarget"+h,p[x]>=0&&(n.enableVertexAttribArray(p[x]),b.numSupportedMorphTargets++)};this.render=function(b,c,n,p){var y,D,G,I,U,J,H,B,L=b.lights,P=b.fog;this.shadowMapEnabled&&x(b,c);Q.data.vertices=0;Q.data.faces=0;Q.data.drawCalls=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,
+!1,c);c.matrixWorldInverse.flattenToArray(la);c.projectionMatrix.flattenToArray(pa);ja.multiply(c.projectionMatrix,c.matrixWorldInverse);m(ja);this.initWebGLObjects(b);E(n);(this.autoClear||p)&&this.clear();U=b.__webglObjects.length;for(p=0;p<U;p++)if(y=b.__webglObjects[p],H=y.object,H.visible)if(!(H instanceof THREE.Mesh)||o(H)){if(H.matrixWorld.flattenToArray(H._objectMatrixArray),A(H,c,!0),v(y),y.render=!0,this.sortObjects)y.object.renderDepth?y.z=y.object.renderDepth:(ma.copy(H.position),ja.multiplyVector3(ma),
+y.z=ma.z)}else y.render=!1;else y.render=!1;this.sortObjects&&b.__webglObjects.sort(t);J=b.__webglObjectsImmediate.length;for(p=0;p<J;p++)y=b.__webglObjectsImmediate[p],H=y.object,H.visible&&(H.matrixAutoUpdate&&H.matrixWorld.flattenToArray(H._objectMatrixArray),A(H,c,!0),u(y));if(b.overrideMaterial){h(b.overrideMaterial.depthTest);C(b.overrideMaterial.blending);for(p=0;p<U;p++)if(y=b.__webglObjects[p],y.render)H=y.object,B=y.buffer,j(H),f(c,L,P,b.overrideMaterial,B,H);for(p=0;p<J;p++)y=b.__webglObjectsImmediate[p],
+H=y.object,H.visible&&(j(H),D=e(c,L,P,b.overrideMaterial,H),H.render(function(c){g(c,D,b.overrideMaterial.shading)}))}else{C(THREE.NormalBlending);for(p=U-1;p>=0;p--)if(y=b.__webglObjects[p],y.render){H=y.object;B=y.buffer;G=y.opaque;j(H);for(y=0;y<G.count;y++)I=G.list[y],h(I.depthTest),k(I.polygonOffset,I.polygonOffsetFactor,I.polygonOffsetUnits),f(c,L,P,I,B,H)}for(p=0;p<J;p++)if(y=b.__webglObjectsImmediate[p],H=y.object,H.visible){G=y.opaque;j(H);for(y=0;y<G.count;y++)I=G.list[y],h(I.depthTest),
+k(I.polygonOffset,I.polygonOffsetFactor,I.polygonOffsetUnits),D=e(c,L,P,I,H),H.render(function(b){g(b,D,I.shading)})}for(p=0;p<U;p++)if(y=b.__webglObjects[p],y.render){H=y.object;B=y.buffer;G=y.transparent;j(H);for(y=0;y<G.count;y++)I=G.list[y],C(I.blending),h(I.depthTest),k(I.polygonOffset,I.polygonOffsetFactor,I.polygonOffsetUnits),f(c,L,P,I,B,H)}for(p=0;p<J;p++)if(y=b.__webglObjectsImmediate[p],H=y.object,H.visible){G=y.transparent;j(H);for(y=0;y<G.count;y++)I=G.list[y],C(I.blending),h(I.depthTest),
+k(I.polygonOffset,I.polygonOffsetFactor,I.polygonOffsetUnits),D=e(c,L,P,I,H),H.render(function(b){g(b,D,I.shading)})}}b.__webglSprites.length&&w(b,c);n&&n.minFilter!==THREE.NearestFilter&&n.minFilter!==THREE.LinearFilter&&V(n)};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var e=b.__objectsAdded[0],f=b,h=void 0,g=void 0,j=void 0;if(e._modelViewMatrix==void 0)e._modelViewMatrix=new THREE.Matrix4,
+e._normalMatrixArray=new Float32Array(9),e._modelViewMatrixArray=new Float32Array(16),e._objectMatrixArray=new Float32Array(16),e.matrixWorld.flattenToArray(e._objectMatrixArray);if(e instanceof THREE.Mesh)for(h in g=e.geometry,g.geometryGroups==void 0&&I(g),g.geometryGroups){j=g.geometryGroups[h];if(!j.__webglVertexBuffer){var k=j;k.__webglVertexBuffer=n.createBuffer();k.__webglNormalBuffer=n.createBuffer();k.__webglTangentBuffer=n.createBuffer();k.__webglColorBuffer=n.createBuffer();k.__webglUVBuffer=
+n.createBuffer();k.__webglUV2Buffer=n.createBuffer();k.__webglSkinVertexABuffer=n.createBuffer();k.__webglSkinVertexBBuffer=n.createBuffer();k.__webglSkinIndicesBuffer=n.createBuffer();k.__webglSkinWeightsBuffer=n.createBuffer();k.__webglFaceBuffer=n.createBuffer();k.__webglLineBuffer=n.createBuffer();if(k.numMorphTargets){var m=void 0,t=void 0;k.__webglMorphTargetsBuffers=[];m=0;for(t=k.numMorphTargets;m<t;m++)k.__webglMorphTargetsBuffers.push(n.createBuffer())}for(var k=j,m=e,p=void 0,u=void 0,
+o=void 0,v=o=void 0,x=void 0,w=void 0,A=w=t=0,U=o=u=void 0,H=U=u=p=void 0,o=void 0,v=m.geometry,x=v.faces,U=k.faces,p=0,u=U.length;p<u;p++)o=U[p],o=x[o],o instanceof THREE.Face3?(t+=3,w+=1,A+=3):o instanceof THREE.Face4&&(t+=4,w+=2,A+=4);for(var p=k,u=m,C=U=x=void 0,E=void 0,C=void 0,o=[],x=0,U=u.materials.length;x<U;x++)if(C=u.materials[x],C instanceof THREE.MeshFaceMaterial){C=0;for(l=p.materials.length;C<l;C++)(E=p.materials[C])&&o.push(E)}else(E=C)&&o.push(E);p=o;k.__materials=p;a:{x=u=void 0;
+U=p.length;for(u=0;u<U;u++)if(x=p[u],x.map||x.lightMap||x instanceof THREE.MeshShaderMaterial){u=!0;break a}u=!1}a:{U=x=void 0;o=p.length;for(x=0;x<o;x++)if(U=p[x],!(U instanceof THREE.MeshBasicMaterial&&!U.envMap||U instanceof THREE.MeshDepthMaterial)){U=U&&U.shading!=void 0&&U.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}U=!1}a:{o=x=void 0;C=p.length;for(x=0;x<C;x++)if(o=p[x],o.vertexColors){o=o.vertexColors;break a}o=!1}k.__vertexArray=new Float32Array(t*3);if(U)k.__normalArray=
+new Float32Array(t*3);if(v.hasTangents)k.__tangentArray=new Float32Array(t*4);if(o)k.__colorArray=new Float32Array(t*3);if(u){if(v.faceUvs.length>0||v.faceVertexUvs.length>0)k.__uvArray=new Float32Array(t*2);if(v.faceUvs.length>1||v.faceVertexUvs.length>1)k.__uv2Array=new Float32Array(t*2)}if(m.geometry.skinWeights.length&&m.geometry.skinIndices.length)k.__skinVertexAArray=new Float32Array(t*4),k.__skinVertexBArray=new Float32Array(t*4),k.__skinIndexArray=new Float32Array(t*4),k.__skinWeightArray=
+new Float32Array(t*4);k.__faceArray=new Uint16Array(w*3+(m.geometry.edgeFaces?m.geometry.edgeFaces.length*6:0));k.__lineArray=new Uint16Array(A*2);if(k.numMorphTargets){k.__morphTargetsArrays=[];v=0;for(x=k.numMorphTargets;v<x;v++)k.__morphTargetsArrays.push(new Float32Array(t*3))}k.__needsSmoothNormals=U==THREE.SmoothShading;k.__uvType=u;k.__vertexColorType=o;k.__normalType=U;k.__webglFaceCount=w*3+(m.geometry.edgeFaces?m.geometry.edgeFaces.length*6:0);k.__webglLineCount=A*2;v=0;for(x=p.length;v<
+x;v++)if(u=p[v],u.attributes){if(k.__webglCustomAttributes===void 0)k.__webglCustomAttributes={};for(a in u.attributes){o=u.attributes[a];U={};for(H in o)U[H]=o[H];if(!U.__webglInitialized||U.createUniqueBuffers)U.__webglInitialized=!0,w=1,U.type==="v2"?w=2:U.type==="v3"?w=3:U.type==="v4"?w=4:U.type==="c"&&(w=3),U.size=w,U.array=new Float32Array(t*w),U.buffer=n.createBuffer(),U.buffer.belongsToAttribute=a,o.needsUpdate=!0,U.__original=o;k.__webglCustomAttributes[a]=U}}k.__inittedArrays=!0;g.__dirtyVertices=
+!0;g.__dirtyMorphTargets=!0;g.__dirtyElements=!0;g.__dirtyUvs=!0;g.__dirtyNormals=!0;g.__dirtyTangents=!0;g.__dirtyColors=!0}J(f.__webglObjects,j,e)}else if(e instanceof THREE.Ribbon){g=e.geometry;if(!g.__webglVertexBuffer)h=g,h.__webglVertexBuffer=n.createBuffer(),h.__webglColorBuffer=n.createBuffer(),h=g,j=h.vertices.length,h.__vertexArray=new Float32Array(j*3),h.__colorArray=new Float32Array(j*3),h.__webglVertexCount=j,g.__dirtyVertices=!0,g.__dirtyColors=!0;J(f.__webglObjects,g,e)}else if(e instanceof
+THREE.Line){g=e.geometry;if(!g.__webglVertexBuffer)h=g,h.__webglVertexBuffer=n.createBuffer(),h.__webglColorBuffer=n.createBuffer(),h=g,j=h.vertices.length,h.__vertexArray=new Float32Array(j*3),h.__colorArray=new Float32Array(j*3),h.__webglLineCount=j,g.__dirtyVertices=!0,g.__dirtyColors=!0;J(f.__webglObjects,g,e)}else if(e instanceof THREE.ParticleSystem){g=e.geometry;if(!g.__webglVertexBuffer){h=g;h.__webglVertexBuffer=n.createBuffer();h.__webglColorBuffer=n.createBuffer();h=g;j=e;k=h.vertices.length;
+h.__vertexArray=new Float32Array(k*3);h.__colorArray=new Float32Array(k*3);h.__sortArray=[];h.__webglParticleCount=k;h.__materials=j.materials;H=t=m=void 0;m=0;for(t=j.materials.length;m<t;m++)if(H=j.materials[m],H.attributes){if(h.__webglCustomAttributes===void 0)h.__webglCustomAttributes={};for(a in H.attributes){originalAttribute=H.attributes[a];attribute={};for(property in originalAttribute)attribute[property]=originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=
+!0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=4:attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(k*size),attribute.buffer=n.createBuffer(),attribute.buffer.belongsToAttribute=a,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;h.__webglCustomAttributes[a]=attribute}}g.__dirtyVertices=!0;g.__dirtyColors=!0}J(f.__webglObjects,g,e)}else THREE.MarchingCubes!==void 0&&e instanceof THREE.MarchingCubes?
 f.__webglObjectsImmediate.push({object:e,opaque:{list:[],count:0},transparent:{list:[],count:0}}):e instanceof THREE.Sprite&&f.__webglSprites.push(e);b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;){f=b.__objectsRemoved[0];e=b;if(f instanceof THREE.Mesh||f instanceof THREE.ParticleSystem||f instanceof THREE.Ribbon||f instanceof THREE.Line)D(e.__webglObjects,f);else if(f instanceof THREE.Sprite){e=e.__webglSprites;g=void 0;for(g=e.length-1;g>=0;g--)e[g]==f&&e.splice(g,1)}else f instanceof
 f.__webglObjectsImmediate.push({object:e,opaque:{list:[],count:0},transparent:{list:[],count:0}}):e instanceof THREE.Sprite&&f.__webglSprites.push(e);b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;){f=b.__objectsRemoved[0];e=b;if(f instanceof THREE.Mesh||f instanceof THREE.ParticleSystem||f instanceof THREE.Ribbon||f instanceof THREE.Line)D(e.__webglObjects,f);else if(f instanceof THREE.Sprite){e=e.__webglSprites;g=void 0;for(g=e.length-1;g>=0;g--)e[g]==f&&e.splice(g,1)}else f instanceof
-THREE.MarchingCubes&&D(e.__webglObjectsImmediate,f);b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e<f;e++)if(h=b.__webglObjects[e].object,n=k=g=j=void 0,h instanceof THREE.Mesh){g=h.geometry;for(j in g.geometryGroups)if(k=g.geometryGroups[j],n=x(k),g.__dirtyVertices||g.__dirtyMorphTargets||g.__dirtyElements||g.__dirtyUvs||g.__dirtyNormals||g.__dirtyColors||g.__dirtyTangents||n)if(n=k,t=m.DYNAMIC_DRAW,H=!g.dynamic,n.__inittedArrays){var ja=A=w=void 0,B=void 0,L=ja=void 0,P=void 0,
-pa=void 0,K=void 0,M=E=C=o=U=y=u=p=v=void 0,F=B=K=B=pa=P=void 0,z=void 0,N=z=F=P=void 0,Q=void 0,S=N=z=F=ja=ja=L=K=B=N=z=F=Q=N=z=F=Q=N=z=F=void 0,la=0,R=0,ea=0,ca=0,V=0,T=0,Z=0,X=0,da=0,O=0,W=0,N=F=0,N=void 0,Y=n.__vertexArray,ga=n.__uvArray,ha=n.__uv2Array,fa=n.__normalArray,ma=n.__tangentArray,$=n.__colorArray,ia=n.__skinVertexAArray,aa=n.__skinVertexBArray,ta=n.__skinIndexArray,ua=n.__skinWeightArray,sa=n.__morphTargetsArrays,na=n.__webglCustomAttributes,z=void 0,ra=n.__faceArray,oa=n.__lineArray,
-ya=n.__needsSmoothNormals,p=n.__vertexColorType,v=n.__uvType,u=n.__normalType,wa=h.geometry,Fa=wa.__dirtyVertices,va=wa.__dirtyElements,xa=wa.__dirtyUvs,Aa=wa.__dirtyNormals,Ia=wa.__dirtyTangents,Ja=wa.__dirtyColors,Da=wa.__dirtyMorphTargets,Pa=wa.vertices,Ga=n.faces,Ta=wa.faces,ab=wa.faceVertexUvs[0],bb=wa.faceVertexUvs[1],Qa=wa.skinVerticesA,Ra=wa.skinVerticesB,Sa=wa.skinIndices,Ha=wa.skinWeights,Ea=wa.morphTargets;if(na)for(S in na)na[S].offset=0,na[S].offsetSrc=0;w=0;for(A=Ga.length;w<A;w++)if(ja=
-Ga[w],B=Ta[ja],ab&&(y=ab[ja]),bb&&(U=bb[ja]),ja=B.vertexNormals,L=B.normal,P=B.vertexColors,pa=B.color,K=B.vertexTangents,B instanceof THREE.Face3){if(Fa)o=Pa[B.a].position,C=Pa[B.b].position,E=Pa[B.c].position,Y[R]=o.x,Y[R+1]=o.y,Y[R+2]=o.z,Y[R+3]=C.x,Y[R+4]=C.y,Y[R+5]=C.z,Y[R+6]=E.x,Y[R+7]=E.y,Y[R+8]=E.z,R+=9;if(na)for(S in na)if(z=na[S],z.__original.needsUpdate)F=z.offset,N=z.offsetSrc,z.size===1?(z.boundTo===void 0||z.boundTo==="vertices"?(z.array[F]=z.value[B.a],z.array[F+1]=z.value[B.b],z.array[F+
+THREE.MarchingCubes&&D(e.__webglObjectsImmediate,f);b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e<f;e++)if(h=b.__webglObjects[e].object,m=k=g=j=void 0,h instanceof THREE.Mesh){g=h.geometry;for(j in g.geometryGroups)if(k=g.geometryGroups[j],m=y(k),g.__dirtyVertices||g.__dirtyMorphTargets||g.__dirtyElements||g.__dirtyUvs||g.__dirtyNormals||g.__dirtyColors||g.__dirtyTangents||m)if(m=k,t=n.DYNAMIC_DRAW,H=!g.dynamic,m.__inittedArrays){var ja=A=w=void 0,B=void 0,L=ja=void 0,P=void 0,
+pa=void 0,K=void 0,M=E=C=o=U=x=u=p=v=void 0,F=B=K=B=pa=P=void 0,z=void 0,N=z=F=P=void 0,Q=void 0,S=N=z=F=ja=ja=L=K=B=N=z=F=Q=N=z=F=Q=N=z=F=void 0,la=0,R=0,ea=0,ca=0,V=0,T=0,Z=0,X=0,da=0,O=0,W=0,N=F=0,N=void 0,Y=m.__vertexArray,ga=m.__uvArray,ha=m.__uv2Array,fa=m.__normalArray,ma=m.__tangentArray,$=m.__colorArray,ia=m.__skinVertexAArray,aa=m.__skinVertexBArray,ta=m.__skinIndexArray,ua=m.__skinWeightArray,sa=m.__morphTargetsArrays,na=m.__webglCustomAttributes,z=void 0,ra=m.__faceArray,oa=m.__lineArray,
+ya=m.__needsSmoothNormals,p=m.__vertexColorType,v=m.__uvType,u=m.__normalType,wa=h.geometry,Fa=wa.__dirtyVertices,va=wa.__dirtyElements,xa=wa.__dirtyUvs,Aa=wa.__dirtyNormals,Ia=wa.__dirtyTangents,Ja=wa.__dirtyColors,Da=wa.__dirtyMorphTargets,Pa=wa.vertices,Ga=m.faces,Ta=wa.faces,ab=wa.faceVertexUvs[0],bb=wa.faceVertexUvs[1],Qa=wa.skinVerticesA,Ra=wa.skinVerticesB,Sa=wa.skinIndices,Ha=wa.skinWeights,Ea=wa.morphTargets;if(na)for(S in na)na[S].offset=0,na[S].offsetSrc=0;w=0;for(A=Ga.length;w<A;w++)if(ja=
+Ga[w],B=Ta[ja],ab&&(x=ab[ja]),bb&&(U=bb[ja]),ja=B.vertexNormals,L=B.normal,P=B.vertexColors,pa=B.color,K=B.vertexTangents,B instanceof THREE.Face3){if(Fa)o=Pa[B.a].position,C=Pa[B.b].position,E=Pa[B.c].position,Y[R]=o.x,Y[R+1]=o.y,Y[R+2]=o.z,Y[R+3]=C.x,Y[R+4]=C.y,Y[R+5]=C.z,Y[R+6]=E.x,Y[R+7]=E.y,Y[R+8]=E.z,R+=9;if(na)for(S in na)if(z=na[S],z.__original.needsUpdate)F=z.offset,N=z.offsetSrc,z.size===1?(z.boundTo===void 0||z.boundTo==="vertices"?(z.array[F]=z.value[B.a],z.array[F+1]=z.value[B.b],z.array[F+
 2]=z.value[B.c]):z.boundTo==="faces"?(N=z.value[N],z.array[F]=N,z.array[F+1]=N,z.array[F+2]=N,z.offsetSrc++):z.boundTo==="faceVertices"&&(z.array[F]=z.value[N],z.array[F+1]=z.value[N+1],z.array[F+2]=z.value[N+2],z.offsetSrc+=3),z.offset+=3):(z.boundTo===void 0||z.boundTo==="vertices"?(o=z.value[B.a],C=z.value[B.b],E=z.value[B.c]):z.boundTo==="faces"?(E=C=o=N=z.value[N],z.offsetSrc++):z.boundTo==="faceVertices"&&(o=z.value[N],C=z.value[N+1],E=z.value[N+2],z.offsetSrc+=3),z.size===2?(z.array[F]=o.x,
 2]=z.value[B.c]):z.boundTo==="faces"?(N=z.value[N],z.array[F]=N,z.array[F+1]=N,z.array[F+2]=N,z.offsetSrc++):z.boundTo==="faceVertices"&&(z.array[F]=z.value[N],z.array[F+1]=z.value[N+1],z.array[F+2]=z.value[N+2],z.offsetSrc+=3),z.offset+=3):(z.boundTo===void 0||z.boundTo==="vertices"?(o=z.value[B.a],C=z.value[B.b],E=z.value[B.c]):z.boundTo==="faces"?(E=C=o=N=z.value[N],z.offsetSrc++):z.boundTo==="faceVertices"&&(o=z.value[N],C=z.value[N+1],E=z.value[N+2],z.offsetSrc+=3),z.size===2?(z.array[F]=o.x,
 z.array[F+1]=o.y,z.array[F+2]=C.x,z.array[F+3]=C.y,z.array[F+4]=E.x,z.array[F+5]=E.y,z.offset+=6):z.size===3?(z.type==="c"?(z.array[F]=o.r,z.array[F+1]=o.g,z.array[F+2]=o.b,z.array[F+3]=C.r,z.array[F+4]=C.g,z.array[F+5]=C.b,z.array[F+6]=E.r,z.array[F+7]=E.g,z.array[F+8]=E.b):(z.array[F]=o.x,z.array[F+1]=o.y,z.array[F+2]=o.z,z.array[F+3]=C.x,z.array[F+4]=C.y,z.array[F+5]=C.z,z.array[F+6]=E.x,z.array[F+7]=E.y,z.array[F+8]=E.z),z.offset+=9):(z.array[F]=o.x,z.array[F+1]=o.y,z.array[F+2]=o.z,z.array[F+
 z.array[F+1]=o.y,z.array[F+2]=C.x,z.array[F+3]=C.y,z.array[F+4]=E.x,z.array[F+5]=E.y,z.offset+=6):z.size===3?(z.type==="c"?(z.array[F]=o.r,z.array[F+1]=o.g,z.array[F+2]=o.b,z.array[F+3]=C.r,z.array[F+4]=C.g,z.array[F+5]=C.b,z.array[F+6]=E.r,z.array[F+7]=E.g,z.array[F+8]=E.b):(z.array[F]=o.x,z.array[F+1]=o.y,z.array[F+2]=o.z,z.array[F+3]=C.x,z.array[F+4]=C.y,z.array[F+5]=C.z,z.array[F+6]=E.x,z.array[F+7]=E.y,z.array[F+8]=E.z),z.offset+=9):(z.array[F]=o.x,z.array[F+1]=o.y,z.array[F+2]=o.z,z.array[F+
 3]=o.w,z.array[F+4]=C.x,z.array[F+5]=C.y,z.array[F+6]=C.z,z.array[F+7]=C.w,z.array[F+8]=E.x,z.array[F+9]=E.y,z.array[F+10]=E.z,z.array[F+11]=E.w,z.offset+=12));if(Da){F=0;for(z=Ea.length;F<z;F++)o=Ea[F].vertices[B.a].position,C=Ea[F].vertices[B.b].position,E=Ea[F].vertices[B.c].position,N=sa[F],N[W]=o.x,N[W+1]=o.y,N[W+2]=o.z,N[W+3]=C.x,N[W+4]=C.y,N[W+5]=C.z,N[W+6]=E.x,N[W+7]=E.y,N[W+8]=E.z;W+=9}if(Ha.length)F=Ha[B.a],z=Ha[B.b],N=Ha[B.c],ua[O]=F.x,ua[O+1]=F.y,ua[O+2]=F.z,ua[O+3]=F.w,ua[O+4]=z.x,ua[O+
 3]=o.w,z.array[F+4]=C.x,z.array[F+5]=C.y,z.array[F+6]=C.z,z.array[F+7]=C.w,z.array[F+8]=E.x,z.array[F+9]=E.y,z.array[F+10]=E.z,z.array[F+11]=E.w,z.offset+=12));if(Da){F=0;for(z=Ea.length;F<z;F++)o=Ea[F].vertices[B.a].position,C=Ea[F].vertices[B.b].position,E=Ea[F].vertices[B.c].position,N=sa[F],N[W]=o.x,N[W+1]=o.y,N[W+2]=o.z,N[W+3]=C.x,N[W+4]=C.y,N[W+5]=C.z,N[W+6]=E.x,N[W+7]=E.y,N[W+8]=E.z;W+=9}if(Ha.length)F=Ha[B.a],z=Ha[B.b],N=Ha[B.c],ua[O]=F.x,ua[O+1]=F.y,ua[O+2]=F.z,ua[O+3]=F.w,ua[O+4]=z.x,ua[O+
 5]=z.y,ua[O+6]=z.z,ua[O+7]=z.w,ua[O+8]=N.x,ua[O+9]=N.y,ua[O+10]=N.z,ua[O+11]=N.w,F=Sa[B.a],z=Sa[B.b],N=Sa[B.c],ta[O]=F.x,ta[O+1]=F.y,ta[O+2]=F.z,ta[O+3]=F.w,ta[O+4]=z.x,ta[O+5]=z.y,ta[O+6]=z.z,ta[O+7]=z.w,ta[O+8]=N.x,ta[O+9]=N.y,ta[O+10]=N.z,ta[O+11]=N.w,F=Qa[B.a],z=Qa[B.b],N=Qa[B.c],ia[O]=F.x,ia[O+1]=F.y,ia[O+2]=F.z,ia[O+3]=1,ia[O+4]=z.x,ia[O+5]=z.y,ia[O+6]=z.z,ia[O+7]=1,ia[O+8]=N.x,ia[O+9]=N.y,ia[O+10]=N.z,ia[O+11]=1,F=Ra[B.a],z=Ra[B.b],N=Ra[B.c],aa[O]=F.x,aa[O+1]=F.y,aa[O+2]=F.z,aa[O+3]=1,aa[O+
 5]=z.y,ua[O+6]=z.z,ua[O+7]=z.w,ua[O+8]=N.x,ua[O+9]=N.y,ua[O+10]=N.z,ua[O+11]=N.w,F=Sa[B.a],z=Sa[B.b],N=Sa[B.c],ta[O]=F.x,ta[O+1]=F.y,ta[O+2]=F.z,ta[O+3]=F.w,ta[O+4]=z.x,ta[O+5]=z.y,ta[O+6]=z.z,ta[O+7]=z.w,ta[O+8]=N.x,ta[O+9]=N.y,ta[O+10]=N.z,ta[O+11]=N.w,F=Qa[B.a],z=Qa[B.b],N=Qa[B.c],ia[O]=F.x,ia[O+1]=F.y,ia[O+2]=F.z,ia[O+3]=1,ia[O+4]=z.x,ia[O+5]=z.y,ia[O+6]=z.z,ia[O+7]=1,ia[O+8]=N.x,ia[O+9]=N.y,ia[O+10]=N.z,ia[O+11]=1,F=Ra[B.a],z=Ra[B.b],N=Ra[B.c],aa[O]=F.x,aa[O+1]=F.y,aa[O+2]=F.z,aa[O+3]=1,aa[O+
 4]=z.x,aa[O+5]=z.y,aa[O+6]=z.z,aa[O+7]=1,aa[O+8]=N.x,aa[O+9]=N.y,aa[O+10]=N.z,aa[O+11]=1,O+=12;if(Ja&&p)P.length==3&&p==THREE.VertexColors?(B=P[0],F=P[1],z=P[2]):z=F=B=pa,$[da]=B.r,$[da+1]=B.g,$[da+2]=B.b,$[da+3]=F.r,$[da+4]=F.g,$[da+5]=F.b,$[da+6]=z.r,$[da+7]=z.g,$[da+8]=z.b,da+=9;if(Ia&&wa.hasTangents)P=K[0],pa=K[1],B=K[2],ma[Z]=P.x,ma[Z+1]=P.y,ma[Z+2]=P.z,ma[Z+3]=P.w,ma[Z+4]=pa.x,ma[Z+5]=pa.y,ma[Z+6]=pa.z,ma[Z+7]=pa.w,ma[Z+8]=B.x,ma[Z+9]=B.y,ma[Z+10]=B.z,ma[Z+11]=B.w,Z+=12;if(Aa&&u)if(ja.length==
 4]=z.x,aa[O+5]=z.y,aa[O+6]=z.z,aa[O+7]=1,aa[O+8]=N.x,aa[O+9]=N.y,aa[O+10]=N.z,aa[O+11]=1,O+=12;if(Ja&&p)P.length==3&&p==THREE.VertexColors?(B=P[0],F=P[1],z=P[2]):z=F=B=pa,$[da]=B.r,$[da+1]=B.g,$[da+2]=B.b,$[da+3]=F.r,$[da+4]=F.g,$[da+5]=F.b,$[da+6]=z.r,$[da+7]=z.g,$[da+8]=z.b,da+=9;if(Ia&&wa.hasTangents)P=K[0],pa=K[1],B=K[2],ma[Z]=P.x,ma[Z+1]=P.y,ma[Z+2]=P.z,ma[Z+3]=P.w,ma[Z+4]=pa.x,ma[Z+5]=pa.y,ma[Z+6]=pa.z,ma[Z+7]=pa.w,ma[Z+8]=B.x,ma[Z+9]=B.y,ma[Z+10]=B.z,ma[Z+11]=B.w,Z+=12;if(Aa&&u)if(ja.length==
-3&&ya)for(K=0;K<3;K++)L=ja[K],fa[T]=L.x,fa[T+1]=L.y,fa[T+2]=L.z,T+=3;else for(K=0;K<3;K++)fa[T]=L.x,fa[T+1]=L.y,fa[T+2]=L.z,T+=3;if(xa&&y!==void 0&&v)for(K=0;K<3;K++)ja=y[K],ga[ea]=ja.u,ga[ea+1]=ja.v,ea+=2;if(xa&&U!==void 0&&v)for(K=0;K<3;K++)ja=U[K],ha[ca]=ja.u,ha[ca+1]=ja.v,ca+=2;va&&(ra[V]=la,ra[V+1]=la+1,ra[V+2]=la+2,V+=3,oa[X]=la,oa[X+1]=la+1,oa[X+2]=la,oa[X+3]=la+2,oa[X+4]=la+1,oa[X+5]=la+2,X+=6,la+=3)}else if(B instanceof THREE.Face4){if(Fa)o=Pa[B.a].position,C=Pa[B.b].position,E=Pa[B.c].position,
+3&&ya)for(K=0;K<3;K++)L=ja[K],fa[T]=L.x,fa[T+1]=L.y,fa[T+2]=L.z,T+=3;else for(K=0;K<3;K++)fa[T]=L.x,fa[T+1]=L.y,fa[T+2]=L.z,T+=3;if(xa&&x!==void 0&&v)for(K=0;K<3;K++)ja=x[K],ga[ea]=ja.u,ga[ea+1]=ja.v,ea+=2;if(xa&&U!==void 0&&v)for(K=0;K<3;K++)ja=U[K],ha[ca]=ja.u,ha[ca+1]=ja.v,ca+=2;va&&(ra[V]=la,ra[V+1]=la+1,ra[V+2]=la+2,V+=3,oa[X]=la,oa[X+1]=la+1,oa[X+2]=la,oa[X+3]=la+2,oa[X+4]=la+1,oa[X+5]=la+2,X+=6,la+=3)}else if(B instanceof THREE.Face4){if(Fa)o=Pa[B.a].position,C=Pa[B.b].position,E=Pa[B.c].position,
 M=Pa[B.d].position,Y[R]=o.x,Y[R+1]=o.y,Y[R+2]=o.z,Y[R+3]=C.x,Y[R+4]=C.y,Y[R+5]=C.z,Y[R+6]=E.x,Y[R+7]=E.y,Y[R+8]=E.z,Y[R+9]=M.x,Y[R+10]=M.y,Y[R+11]=M.z,R+=12;if(na)for(S in na)if(z=na[S],z.__original.needsUpdate)F=z.offset,N=z.offsetSrc,z.size===1?(z.boundTo===void 0||z.boundTo==="vertices"?(z.array[F]=z.value[B.a],z.array[F+1]=z.value[B.b],z.array[F+2]=z.value[B.c],z.array[F+3]=z.value[B.d]):z.boundTo==="faces"?(N=z.value[N],z.array[F]=N,z.array[F+1]=N,z.array[F+2]=N,z.array[F+3]=N,z.offsetSrc++):
 M=Pa[B.d].position,Y[R]=o.x,Y[R+1]=o.y,Y[R+2]=o.z,Y[R+3]=C.x,Y[R+4]=C.y,Y[R+5]=C.z,Y[R+6]=E.x,Y[R+7]=E.y,Y[R+8]=E.z,Y[R+9]=M.x,Y[R+10]=M.y,Y[R+11]=M.z,R+=12;if(na)for(S in na)if(z=na[S],z.__original.needsUpdate)F=z.offset,N=z.offsetSrc,z.size===1?(z.boundTo===void 0||z.boundTo==="vertices"?(z.array[F]=z.value[B.a],z.array[F+1]=z.value[B.b],z.array[F+2]=z.value[B.c],z.array[F+3]=z.value[B.d]):z.boundTo==="faces"?(N=z.value[N],z.array[F]=N,z.array[F+1]=N,z.array[F+2]=N,z.array[F+3]=N,z.offsetSrc++):
 z.boundTo==="faceVertices"&&(z.array[F]=z.value[N],z.array[F+1]=z.value[N+1],z.array[F+2]=z.value[N+2],z.array[F+3]=z.value[N+3],z.offsetSrc+=4),z.offset+=4):(z.boundTo===void 0||z.boundTo==="vertices"?(o=z.value[B.a],C=z.value[B.b],E=z.value[B.c],M=z.value[B.d]):z.boundTo==="faces"?(M=E=C=o=N=z.value[N],z.offsetSrc++):z.boundTo==="faceVertices"&&(o=z.value[N],C=z.value[N+1],E=z.value[N+2],M=z.value[N+3],z.offsetSrc+=4),z.size===2?(z.array[F]=o.x,z.array[F+1]=o.y,z.array[F+2]=C.x,z.array[F+3]=C.y,
 z.boundTo==="faceVertices"&&(z.array[F]=z.value[N],z.array[F+1]=z.value[N+1],z.array[F+2]=z.value[N+2],z.array[F+3]=z.value[N+3],z.offsetSrc+=4),z.offset+=4):(z.boundTo===void 0||z.boundTo==="vertices"?(o=z.value[B.a],C=z.value[B.b],E=z.value[B.c],M=z.value[B.d]):z.boundTo==="faces"?(M=E=C=o=N=z.value[N],z.offsetSrc++):z.boundTo==="faceVertices"&&(o=z.value[N],C=z.value[N+1],E=z.value[N+2],M=z.value[N+3],z.offsetSrc+=4),z.size===2?(z.array[F]=o.x,z.array[F+1]=o.y,z.array[F+2]=C.x,z.array[F+3]=C.y,
 z.array[F+4]=E.x,z.array[F+5]=E.y,z.array[F+6]=M.x,z.array[F+7]=M.y,z.offset+=8):z.size===3?(z.type==="c"?(z.array[F]=o.r,z.array[F+1]=o.g,z.array[F+2]=o.b,z.array[F+3]=C.r,z.array[F+4]=C.g,z.array[F+5]=C.b,z.array[F+6]=E.r,z.array[F+7]=E.g,z.array[F+8]=E.b,z.array[F+9]=M.r,z.array[F+10]=M.g,z.array[F+11]=M.b):(z.array[F]=o.x,z.array[F+1]=o.y,z.array[F+2]=o.z,z.array[F+3]=C.x,z.array[F+4]=C.y,z.array[F+5]=C.z,z.array[F+6]=E.x,z.array[F+7]=E.y,z.array[F+8]=E.z,z.array[F+9]=M.x,z.array[F+10]=M.y,z.array[F+
 z.array[F+4]=E.x,z.array[F+5]=E.y,z.array[F+6]=M.x,z.array[F+7]=M.y,z.offset+=8):z.size===3?(z.type==="c"?(z.array[F]=o.r,z.array[F+1]=o.g,z.array[F+2]=o.b,z.array[F+3]=C.r,z.array[F+4]=C.g,z.array[F+5]=C.b,z.array[F+6]=E.r,z.array[F+7]=E.g,z.array[F+8]=E.b,z.array[F+9]=M.r,z.array[F+10]=M.g,z.array[F+11]=M.b):(z.array[F]=o.x,z.array[F+1]=o.y,z.array[F+2]=o.z,z.array[F+3]=C.x,z.array[F+4]=C.y,z.array[F+5]=C.z,z.array[F+6]=E.x,z.array[F+7]=E.y,z.array[F+8]=E.z,z.array[F+9]=M.x,z.array[F+10]=M.y,z.array[F+
@@ -316,14 +318,14 @@ z.array[F+4]=E.x,z.array[F+5]=E.y,z.array[F+6]=M.x,z.array[F+7]=M.y,z.offset+=8)
 N[W+2]=o.z,N[W+3]=C.x,N[W+4]=C.y,N[W+5]=C.z,N[W+6]=E.x,N[W+7]=E.y,N[W+8]=E.z,N[W+9]=M.x,N[W+10]=M.y,N[W+11]=M.z;W+=12}if(Ha.length)F=Ha[B.a],z=Ha[B.b],N=Ha[B.c],Q=Ha[B.d],ua[O]=F.x,ua[O+1]=F.y,ua[O+2]=F.z,ua[O+3]=F.w,ua[O+4]=z.x,ua[O+5]=z.y,ua[O+6]=z.z,ua[O+7]=z.w,ua[O+8]=N.x,ua[O+9]=N.y,ua[O+10]=N.z,ua[O+11]=N.w,ua[O+12]=Q.x,ua[O+13]=Q.y,ua[O+14]=Q.z,ua[O+15]=Q.w,F=Sa[B.a],z=Sa[B.b],N=Sa[B.c],Q=Sa[B.d],ta[O]=F.x,ta[O+1]=F.y,ta[O+2]=F.z,ta[O+3]=F.w,ta[O+4]=z.x,ta[O+5]=z.y,ta[O+6]=z.z,ta[O+7]=z.w,
 N[W+2]=o.z,N[W+3]=C.x,N[W+4]=C.y,N[W+5]=C.z,N[W+6]=E.x,N[W+7]=E.y,N[W+8]=E.z,N[W+9]=M.x,N[W+10]=M.y,N[W+11]=M.z;W+=12}if(Ha.length)F=Ha[B.a],z=Ha[B.b],N=Ha[B.c],Q=Ha[B.d],ua[O]=F.x,ua[O+1]=F.y,ua[O+2]=F.z,ua[O+3]=F.w,ua[O+4]=z.x,ua[O+5]=z.y,ua[O+6]=z.z,ua[O+7]=z.w,ua[O+8]=N.x,ua[O+9]=N.y,ua[O+10]=N.z,ua[O+11]=N.w,ua[O+12]=Q.x,ua[O+13]=Q.y,ua[O+14]=Q.z,ua[O+15]=Q.w,F=Sa[B.a],z=Sa[B.b],N=Sa[B.c],Q=Sa[B.d],ta[O]=F.x,ta[O+1]=F.y,ta[O+2]=F.z,ta[O+3]=F.w,ta[O+4]=z.x,ta[O+5]=z.y,ta[O+6]=z.z,ta[O+7]=z.w,
 ta[O+8]=N.x,ta[O+9]=N.y,ta[O+10]=N.z,ta[O+11]=N.w,ta[O+12]=Q.x,ta[O+13]=Q.y,ta[O+14]=Q.z,ta[O+15]=Q.w,F=Qa[B.a],z=Qa[B.b],N=Qa[B.c],Q=Qa[B.d],ia[O]=F.x,ia[O+1]=F.y,ia[O+2]=F.z,ia[O+3]=1,ia[O+4]=z.x,ia[O+5]=z.y,ia[O+6]=z.z,ia[O+7]=1,ia[O+8]=N.x,ia[O+9]=N.y,ia[O+10]=N.z,ia[O+11]=1,ia[O+12]=Q.x,ia[O+13]=Q.y,ia[O+14]=Q.z,ia[O+15]=1,F=Ra[B.a],z=Ra[B.b],N=Ra[B.c],B=Ra[B.d],aa[O]=F.x,aa[O+1]=F.y,aa[O+2]=F.z,aa[O+3]=1,aa[O+4]=z.x,aa[O+5]=z.y,aa[O+6]=z.z,aa[O+7]=1,aa[O+8]=N.x,aa[O+9]=N.y,aa[O+10]=N.z,aa[O+
 ta[O+8]=N.x,ta[O+9]=N.y,ta[O+10]=N.z,ta[O+11]=N.w,ta[O+12]=Q.x,ta[O+13]=Q.y,ta[O+14]=Q.z,ta[O+15]=Q.w,F=Qa[B.a],z=Qa[B.b],N=Qa[B.c],Q=Qa[B.d],ia[O]=F.x,ia[O+1]=F.y,ia[O+2]=F.z,ia[O+3]=1,ia[O+4]=z.x,ia[O+5]=z.y,ia[O+6]=z.z,ia[O+7]=1,ia[O+8]=N.x,ia[O+9]=N.y,ia[O+10]=N.z,ia[O+11]=1,ia[O+12]=Q.x,ia[O+13]=Q.y,ia[O+14]=Q.z,ia[O+15]=1,F=Ra[B.a],z=Ra[B.b],N=Ra[B.c],B=Ra[B.d],aa[O]=F.x,aa[O+1]=F.y,aa[O+2]=F.z,aa[O+3]=1,aa[O+4]=z.x,aa[O+5]=z.y,aa[O+6]=z.z,aa[O+7]=1,aa[O+8]=N.x,aa[O+9]=N.y,aa[O+10]=N.z,aa[O+
 11]=1,aa[O+12]=B.x,aa[O+13]=B.y,aa[O+14]=B.z,aa[O+15]=1,O+=16;if(Ja&&p)P.length==4&&p==THREE.VertexColors?(B=P[0],F=P[1],z=P[2],P=P[3]):P=z=F=B=pa,$[da]=B.r,$[da+1]=B.g,$[da+2]=B.b,$[da+3]=F.r,$[da+4]=F.g,$[da+5]=F.b,$[da+6]=z.r,$[da+7]=z.g,$[da+8]=z.b,$[da+9]=P.r,$[da+10]=P.g,$[da+11]=P.b,da+=12;if(Ia&&wa.hasTangents)P=K[0],pa=K[1],B=K[2],K=K[3],ma[Z]=P.x,ma[Z+1]=P.y,ma[Z+2]=P.z,ma[Z+3]=P.w,ma[Z+4]=pa.x,ma[Z+5]=pa.y,ma[Z+6]=pa.z,ma[Z+7]=pa.w,ma[Z+8]=B.x,ma[Z+9]=B.y,ma[Z+10]=B.z,ma[Z+11]=B.w,ma[Z+
 11]=1,aa[O+12]=B.x,aa[O+13]=B.y,aa[O+14]=B.z,aa[O+15]=1,O+=16;if(Ja&&p)P.length==4&&p==THREE.VertexColors?(B=P[0],F=P[1],z=P[2],P=P[3]):P=z=F=B=pa,$[da]=B.r,$[da+1]=B.g,$[da+2]=B.b,$[da+3]=F.r,$[da+4]=F.g,$[da+5]=F.b,$[da+6]=z.r,$[da+7]=z.g,$[da+8]=z.b,$[da+9]=P.r,$[da+10]=P.g,$[da+11]=P.b,da+=12;if(Ia&&wa.hasTangents)P=K[0],pa=K[1],B=K[2],K=K[3],ma[Z]=P.x,ma[Z+1]=P.y,ma[Z+2]=P.z,ma[Z+3]=P.w,ma[Z+4]=pa.x,ma[Z+5]=pa.y,ma[Z+6]=pa.z,ma[Z+7]=pa.w,ma[Z+8]=B.x,ma[Z+9]=B.y,ma[Z+10]=B.z,ma[Z+11]=B.w,ma[Z+
-12]=K.x,ma[Z+13]=K.y,ma[Z+14]=K.z,ma[Z+15]=K.w,Z+=16;if(Aa&&u)if(ja.length==4&&ya)for(K=0;K<4;K++)L=ja[K],fa[T]=L.x,fa[T+1]=L.y,fa[T+2]=L.z,T+=3;else for(K=0;K<4;K++)fa[T]=L.x,fa[T+1]=L.y,fa[T+2]=L.z,T+=3;if(xa&&y!==void 0&&v)for(K=0;K<4;K++)ja=y[K],ga[ea]=ja.u,ga[ea+1]=ja.v,ea+=2;if(xa&&U!==void 0&&v)for(K=0;K<4;K++)ja=U[K],ha[ca]=ja.u,ha[ca+1]=ja.v,ca+=2;va&&(ra[V]=la,ra[V+1]=la+1,ra[V+2]=la+3,ra[V+3]=la+1,ra[V+4]=la+2,ra[V+5]=la+3,V+=6,oa[X]=la,oa[X+1]=la+1,oa[X+2]=la,oa[X+3]=la+3,oa[X+4]=la+1,
-oa[X+5]=la+2,oa[X+6]=la+2,oa[X+7]=la+3,X+=8,la+=4)}Fa&&(m.bindBuffer(m.ARRAY_BUFFER,n.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,Y,t));if(na)for(S in na)z=na[S],z.__original.needsUpdate&&(m.bindBuffer(m.ARRAY_BUFFER,z.buffer),m.bufferData(m.ARRAY_BUFFER,z.array,t));if(Da){F=0;for(z=Ea.length;F<z;F++)m.bindBuffer(m.ARRAY_BUFFER,n.__webglMorphTargetsBuffers[F]),m.bufferData(m.ARRAY_BUFFER,sa[F],t)}Ja&&da>0&&(m.bindBuffer(m.ARRAY_BUFFER,n.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,$,t));Aa&&
-(m.bindBuffer(m.ARRAY_BUFFER,n.__webglNormalBuffer),m.bufferData(m.ARRAY_BUFFER,fa,t));Ia&&wa.hasTangents&&(m.bindBuffer(m.ARRAY_BUFFER,n.__webglTangentBuffer),m.bufferData(m.ARRAY_BUFFER,ma,t));xa&&ea>0&&(m.bindBuffer(m.ARRAY_BUFFER,n.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,ga,t));xa&&ca>0&&(m.bindBuffer(m.ARRAY_BUFFER,n.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,ha,t));va&&(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,n.__webglFaceBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,ra,t),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
-n.__webglLineBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,oa,t));O>0&&(m.bindBuffer(m.ARRAY_BUFFER,n.__webglSkinVertexABuffer),m.bufferData(m.ARRAY_BUFFER,ia,t),m.bindBuffer(m.ARRAY_BUFFER,n.__webglSkinVertexBBuffer),m.bufferData(m.ARRAY_BUFFER,aa,t),m.bindBuffer(m.ARRAY_BUFFER,n.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,ta,t),m.bindBuffer(m.ARRAY_BUFFER,n.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,ua,t));H&&(delete n.__inittedArrays,delete n.__colorArray,delete n.__normalArray,
-delete n.__tangentArray,delete n.__uvArray,delete n.__uv2Array,delete n.__faceArray,delete n.__vertexArray,delete n.__lineArray,delete n.__skinVertexAArray,delete n.__skinVertexBArray,delete n.__skinIndexArray,delete n.__skinWeightArray)}g.__dirtyVertices=!1;g.__dirtyMorphTargets=!1;g.__dirtyElements=!1;g.__dirtyUvs=!1;g.__dirtyNormals=!1;g.__dirtyTangents=!1;g.__dirtyColors=!1;G(k)}else if(h instanceof THREE.Ribbon){g=h.geometry;if(g.__dirtyVertices||g.__dirtyColors){h=g;j=m.DYNAMIC_DRAW;k=A=w=w=
-void 0;v=h.vertices;n=h.colors;p=v.length;t=n.length;u=h.__vertexArray;H=h.__colorArray;y=h.__dirtyColors;if(h.__dirtyVertices){for(w=0;w<p;w++)A=v[w].position,k=w*3,u[k]=A.x,u[k+1]=A.y,u[k+2]=A.z;m.bindBuffer(m.ARRAY_BUFFER,h.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,u,j)}if(y){for(w=0;w<t;w++)color=n[w],k=w*3,H[k]=color.r,H[k+1]=color.g,H[k+2]=color.b;m.bindBuffer(m.ARRAY_BUFFER,h.__webglColorBuffer);m.bufferData(m.ARRAY_BUFFER,H,j)}}g.__dirtyVertices=!1;g.__dirtyColors=!1}else if(h instanceof
-THREE.Line){g=h.geometry;if(g.__dirtyVertices||g.__dirtyColors){h=g;j=m.DYNAMIC_DRAW;k=A=w=w=void 0;v=h.vertices;n=h.colors;p=v.length;t=n.length;u=h.__vertexArray;H=h.__colorArray;y=h.__dirtyColors;if(h.__dirtyVertices){for(w=0;w<p;w++)A=v[w].position,k=w*3,u[k]=A.x,u[k+1]=A.y,u[k+2]=A.z;m.bindBuffer(m.ARRAY_BUFFER,h.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,u,j)}if(y){for(w=0;w<t;w++)color=n[w],k=w*3,H[k]=color.r,H[k+1]=color.g,H[k+2]=color.b;m.bindBuffer(m.ARRAY_BUFFER,h.__webglColorBuffer);
-m.bufferData(m.ARRAY_BUFFER,H,j)}}g.__dirtyVertices=!1;g.__dirtyColors=!1}else if(h instanceof THREE.ParticleSystem)g=h.geometry,n=x(g),(g.__dirtyVertices||g.__dirtyColors||h.sortParticles||n)&&c(g,m.DYNAMIC_DRAW,h),g.__dirtyVertices=!1,g.__dirtyColors=!1,G(g)};this.setFaceCulling=function(b,c){b?(!c||c=="ccw"?m.frontFace(m.CCW):m.frontFace(m.CW),b=="back"?m.cullFace(m.BACK):b=="front"?m.cullFace(m.FRONT):m.cullFace(m.FRONT_AND_BACK),m.enable(m.CULL_FACE)):m.disable(m.CULL_FACE)};this.supportsVertexTextures=
+12]=K.x,ma[Z+13]=K.y,ma[Z+14]=K.z,ma[Z+15]=K.w,Z+=16;if(Aa&&u)if(ja.length==4&&ya)for(K=0;K<4;K++)L=ja[K],fa[T]=L.x,fa[T+1]=L.y,fa[T+2]=L.z,T+=3;else for(K=0;K<4;K++)fa[T]=L.x,fa[T+1]=L.y,fa[T+2]=L.z,T+=3;if(xa&&x!==void 0&&v)for(K=0;K<4;K++)ja=x[K],ga[ea]=ja.u,ga[ea+1]=ja.v,ea+=2;if(xa&&U!==void 0&&v)for(K=0;K<4;K++)ja=U[K],ha[ca]=ja.u,ha[ca+1]=ja.v,ca+=2;va&&(ra[V]=la,ra[V+1]=la+1,ra[V+2]=la+3,ra[V+3]=la+1,ra[V+4]=la+2,ra[V+5]=la+3,V+=6,oa[X]=la,oa[X+1]=la+1,oa[X+2]=la,oa[X+3]=la+3,oa[X+4]=la+1,
+oa[X+5]=la+2,oa[X+6]=la+2,oa[X+7]=la+3,X+=8,la+=4)}Fa&&(n.bindBuffer(n.ARRAY_BUFFER,m.__webglVertexBuffer),n.bufferData(n.ARRAY_BUFFER,Y,t));if(na)for(S in na)z=na[S],z.__original.needsUpdate&&(n.bindBuffer(n.ARRAY_BUFFER,z.buffer),n.bufferData(n.ARRAY_BUFFER,z.array,t));if(Da){F=0;for(z=Ea.length;F<z;F++)n.bindBuffer(n.ARRAY_BUFFER,m.__webglMorphTargetsBuffers[F]),n.bufferData(n.ARRAY_BUFFER,sa[F],t)}Ja&&da>0&&(n.bindBuffer(n.ARRAY_BUFFER,m.__webglColorBuffer),n.bufferData(n.ARRAY_BUFFER,$,t));Aa&&
+(n.bindBuffer(n.ARRAY_BUFFER,m.__webglNormalBuffer),n.bufferData(n.ARRAY_BUFFER,fa,t));Ia&&wa.hasTangents&&(n.bindBuffer(n.ARRAY_BUFFER,m.__webglTangentBuffer),n.bufferData(n.ARRAY_BUFFER,ma,t));xa&&ea>0&&(n.bindBuffer(n.ARRAY_BUFFER,m.__webglUVBuffer),n.bufferData(n.ARRAY_BUFFER,ga,t));xa&&ca>0&&(n.bindBuffer(n.ARRAY_BUFFER,m.__webglUV2Buffer),n.bufferData(n.ARRAY_BUFFER,ha,t));va&&(n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,m.__webglFaceBuffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,ra,t),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
+m.__webglLineBuffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,oa,t));O>0&&(n.bindBuffer(n.ARRAY_BUFFER,m.__webglSkinVertexABuffer),n.bufferData(n.ARRAY_BUFFER,ia,t),n.bindBuffer(n.ARRAY_BUFFER,m.__webglSkinVertexBBuffer),n.bufferData(n.ARRAY_BUFFER,aa,t),n.bindBuffer(n.ARRAY_BUFFER,m.__webglSkinIndicesBuffer),n.bufferData(n.ARRAY_BUFFER,ta,t),n.bindBuffer(n.ARRAY_BUFFER,m.__webglSkinWeightsBuffer),n.bufferData(n.ARRAY_BUFFER,ua,t));H&&(delete m.__inittedArrays,delete m.__colorArray,delete m.__normalArray,
+delete m.__tangentArray,delete m.__uvArray,delete m.__uv2Array,delete m.__faceArray,delete m.__vertexArray,delete m.__lineArray,delete m.__skinVertexAArray,delete m.__skinVertexBArray,delete m.__skinIndexArray,delete m.__skinWeightArray)}g.__dirtyVertices=!1;g.__dirtyMorphTargets=!1;g.__dirtyElements=!1;g.__dirtyUvs=!1;g.__dirtyNormals=!1;g.__dirtyTangents=!1;g.__dirtyColors=!1;G(k)}else if(h instanceof THREE.Ribbon){g=h.geometry;if(g.__dirtyVertices||g.__dirtyColors){h=g;j=n.DYNAMIC_DRAW;k=A=w=w=
+void 0;v=h.vertices;m=h.colors;p=v.length;t=m.length;u=h.__vertexArray;H=h.__colorArray;x=h.__dirtyColors;if(h.__dirtyVertices){for(w=0;w<p;w++)A=v[w].position,k=w*3,u[k]=A.x,u[k+1]=A.y,u[k+2]=A.z;n.bindBuffer(n.ARRAY_BUFFER,h.__webglVertexBuffer);n.bufferData(n.ARRAY_BUFFER,u,j)}if(x){for(w=0;w<t;w++)color=m[w],k=w*3,H[k]=color.r,H[k+1]=color.g,H[k+2]=color.b;n.bindBuffer(n.ARRAY_BUFFER,h.__webglColorBuffer);n.bufferData(n.ARRAY_BUFFER,H,j)}}g.__dirtyVertices=!1;g.__dirtyColors=!1}else if(h instanceof
+THREE.Line){g=h.geometry;if(g.__dirtyVertices||g.__dirtyColors){h=g;j=n.DYNAMIC_DRAW;k=A=w=w=void 0;v=h.vertices;m=h.colors;p=v.length;t=m.length;u=h.__vertexArray;H=h.__colorArray;x=h.__dirtyColors;if(h.__dirtyVertices){for(w=0;w<p;w++)A=v[w].position,k=w*3,u[k]=A.x,u[k+1]=A.y,u[k+2]=A.z;n.bindBuffer(n.ARRAY_BUFFER,h.__webglVertexBuffer);n.bufferData(n.ARRAY_BUFFER,u,j)}if(x){for(w=0;w<t;w++)color=m[w],k=w*3,H[k]=color.r,H[k+1]=color.g,H[k+2]=color.b;n.bindBuffer(n.ARRAY_BUFFER,h.__webglColorBuffer);
+n.bufferData(n.ARRAY_BUFFER,H,j)}}g.__dirtyVertices=!1;g.__dirtyColors=!1}else if(h instanceof THREE.ParticleSystem)g=h.geometry,m=y(g),(g.__dirtyVertices||g.__dirtyColors||h.sortParticles||m)&&c(g,n.DYNAMIC_DRAW,h),g.__dirtyVertices=!1,g.__dirtyColors=!1,G(g)};this.setFaceCulling=function(b,c){b?(!c||c=="ccw"?n.frontFace(n.CCW):n.frontFace(n.CW),b=="back"?n.cullFace(n.BACK):b=="front"?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK),n.enable(n.CULL_FACE)):n.disable(n.CULL_FACE)};this.supportsVertexTextures=
 function(){return sa}};
 function(){return sa}};
 THREE.WebGLRenderTarget=function(b,c,e){this.width=b;this.height=c;e=e||{};this.wrapS=e.wrapS!==void 0?e.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=e.wrapT!==void 0?e.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=e.magFilter!==void 0?e.magFilter:THREE.LinearFilter;this.minFilter=e.minFilter!==void 0?e.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=e.format!==void 0?e.format:THREE.RGBAFormat;this.type=e.type!==void 0?e.type:
 THREE.WebGLRenderTarget=function(b,c,e){this.width=b;this.height=c;e=e||{};this.wrapS=e.wrapS!==void 0?e.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=e.wrapT!==void 0?e.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=e.magFilter!==void 0?e.magFilter:THREE.LinearFilter;this.minFilter=e.minFilter!==void 0?e.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=e.format!==void 0?e.format:THREE.RGBAFormat;this.type=e.type!==void 0?e.type:
 THREE.UnsignedByteType;this.depthBuffer=e.depthBuffer!==void 0?e.depthBuffer:!0;this.stencilBuffer=e.stencilBuffer!==void 0?e.stencilBuffer:!0};THREE.WebGLRenderTargetCube=function(b,c,e){THREE.WebGLRenderTarget.call(this,b,c,e);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=new THREE.WebGLRenderTarget;THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
 THREE.UnsignedByteType;this.depthBuffer=e.depthBuffer!==void 0?e.depthBuffer:!0;this.stencilBuffer=e.stencilBuffer!==void 0?e.stencilBuffer:!0};THREE.WebGLRenderTargetCube=function(b,c,e){THREE.WebGLRenderTarget.call(this,b,c,e);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=new THREE.WebGLRenderTarget;THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
@@ -333,18 +335,18 @@ THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new
 THREE.RenderableObject=function(){this.z=this.object=null};THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.materials=null};
 THREE.RenderableObject=function(){this.z=this.object=null};THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.materials=null};
 THREE.ColorUtils={adjustHSV:function(b,c,e,f){var g=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,g);g.h=THREE.ColorUtils.clamp(g.h+c,0,1);g.s=THREE.ColorUtils.clamp(g.s+e,0,1);g.v=THREE.ColorUtils.clamp(g.v+f,0,1);b.setHSV(g.h,g.s,g.v)},rgbToHsv:function(b,c){var e=b.r,f=b.g,g=b.b,j=Math.max(Math.max(e,f),g),h=Math.min(Math.min(e,f),g);if(h==j)h=e=0;else{var k=j-h,h=k/j,e=e==j?(f-g)/k:f==j?2+(g-e)/k:4+(e-f)/k;e/=6;e<0&&(e+=1);e>1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=h;c.v=j;return c},
 THREE.ColorUtils={adjustHSV:function(b,c,e,f){var g=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,g);g.h=THREE.ColorUtils.clamp(g.h+c,0,1);g.s=THREE.ColorUtils.clamp(g.s+e,0,1);g.v=THREE.ColorUtils.clamp(g.v+f,0,1);b.setHSV(g.h,g.s,g.v)},rgbToHsv:function(b,c){var e=b.r,f=b.g,g=b.b,j=Math.max(Math.max(e,f),g),h=Math.min(Math.min(e,f),g);if(h==j)h=e=0;else{var k=j-h,h=k/j,e=e==j?(f-g)/k:f==j?2+(g-e)/k:4+(e-f)/k;e/=6;e<0&&(e+=1);e>1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=h;c.v=j;return c},
 clamp:function(b,c,e){return b<c?c:b>e?e:b}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
 clamp:function(b,c,e){return b<c?c:b>e?e:b}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
-THREE.GeometryUtils={merge:function(b,c){var e=c instanceof THREE.Mesh,f=b.vertices.length,g=e?c.geometry:c,j=b.vertices,h=g.vertices,k=b.faces,n=g.faces,o=b.faceVertexUvs[0],g=g.faceVertexUvs[0];e&&c.matrixAutoUpdate&&c.updateMatrix();for(var p=0,u=h.length;p<u;p++){var v=new THREE.Vertex(h[p].position.clone());e&&c.matrix.multiplyVector3(v.position);j.push(v)}p=0;for(u=n.length;p<u;p++){var h=n[p],t,y,w=h.vertexNormals,v=h.vertexColors;h instanceof THREE.Face3?t=new THREE.Face3(h.a+f,h.b+f,h.c+
-f):h instanceof THREE.Face4&&(t=new THREE.Face4(h.a+f,h.b+f,h.c+f,h.d+f));t.normal.copy(h.normal);e=0;for(j=w.length;e<j;e++)y=w[e],t.vertexNormals.push(y.clone());t.color.copy(h.color);e=0;for(j=v.length;e<j;e++)y=v[e],t.vertexColors.push(y.clone());t.materials=h.materials.slice();t.centroid.copy(h.centroid);k.push(t)}p=0;for(u=g.length;p<u;p++){f=g[p];k=[];e=0;for(j=f.length;e<j;e++)k.push(new THREE.UV(f[e].u,f[e].v));o.push(k)}},clone:function(b){var c=new THREE.Geometry,e,f=b.vertices,g=b.faces,
-j=b.faceVertexUvs[0],b=0;for(e=f.length;b<e;b++){var h=new THREE.Vertex(f[b].position.clone());c.vertices.push(h)}b=0;for(e=g.length;b<e;b++){var k=g[b],n,o,p=k.vertexNormals,u=k.vertexColors;k instanceof THREE.Face3?n=new THREE.Face3(k.a,k.b,k.c):k instanceof THREE.Face4&&(n=new THREE.Face4(k.a,k.b,k.c,k.d));n.normal.copy(k.normal);f=0;for(h=p.length;f<h;f++)o=p[f],n.vertexNormals.push(o.clone());n.color.copy(k.color);f=0;for(h=u.length;f<h;f++)o=u[f],n.vertexColors.push(o.clone());n.materials=k.materials.slice();
-n.centroid.copy(k.centroid);c.faces.push(n)}b=0;for(e=j.length;b<e;b++){g=j[b];n=[];f=0;for(h=g.length;f<h;f++)n.push(new THREE.UV(g[f].u,g[f].v));c.faceVertexUvs[0].push(n)}return c},randomPointInTriangle:function(b,c,e){var f,g,j,h=new THREE.Vector3,k=THREE.GeometryUtils.__v1;f=THREE.GeometryUtils.random();g=THREE.GeometryUtils.random();f+g>1&&(f=1-f,g=1-g);j=1-f-g;h.copy(b);h.multiplyScalar(f);k.copy(c);k.multiplyScalar(g);h.addSelf(k);k.copy(e);k.multiplyScalar(j);h.addSelf(k);return h},randomPointInFace:function(b,
+THREE.GeometryUtils={merge:function(b,c){var e=c instanceof THREE.Mesh,f=b.vertices.length,g=e?c.geometry:c,j=b.vertices,h=g.vertices,k=b.faces,m=g.faces,o=b.faceVertexUvs[0],g=g.faceVertexUvs[0];e&&c.matrixAutoUpdate&&c.updateMatrix();for(var p=0,u=h.length;p<u;p++){var v=new THREE.Vertex(h[p].position.clone());e&&c.matrix.multiplyVector3(v.position);j.push(v)}p=0;for(u=m.length;p<u;p++){var h=m[p],t,x,w=h.vertexNormals,v=h.vertexColors;h instanceof THREE.Face3?t=new THREE.Face3(h.a+f,h.b+f,h.c+
+f):h instanceof THREE.Face4&&(t=new THREE.Face4(h.a+f,h.b+f,h.c+f,h.d+f));t.normal.copy(h.normal);e=0;for(j=w.length;e<j;e++)x=w[e],t.vertexNormals.push(x.clone());t.color.copy(h.color);e=0;for(j=v.length;e<j;e++)x=v[e],t.vertexColors.push(x.clone());t.materials=h.materials.slice();t.centroid.copy(h.centroid);k.push(t)}p=0;for(u=g.length;p<u;p++){f=g[p];k=[];e=0;for(j=f.length;e<j;e++)k.push(new THREE.UV(f[e].u,f[e].v));o.push(k)}},clone:function(b){var c=new THREE.Geometry,e,f=b.vertices,g=b.faces,
+j=b.faceVertexUvs[0],b=0;for(e=f.length;b<e;b++){var h=new THREE.Vertex(f[b].position.clone());c.vertices.push(h)}b=0;for(e=g.length;b<e;b++){var k=g[b],m,o,p=k.vertexNormals,u=k.vertexColors;k instanceof THREE.Face3?m=new THREE.Face3(k.a,k.b,k.c):k instanceof THREE.Face4&&(m=new THREE.Face4(k.a,k.b,k.c,k.d));m.normal.copy(k.normal);f=0;for(h=p.length;f<h;f++)o=p[f],m.vertexNormals.push(o.clone());m.color.copy(k.color);f=0;for(h=u.length;f<h;f++)o=u[f],m.vertexColors.push(o.clone());m.materials=k.materials.slice();
+m.centroid.copy(k.centroid);c.faces.push(m)}b=0;for(e=j.length;b<e;b++){g=j[b];m=[];f=0;for(h=g.length;f<h;f++)m.push(new THREE.UV(g[f].u,g[f].v));c.faceVertexUvs[0].push(m)}return c},randomPointInTriangle:function(b,c,e){var f,g,j,h=new THREE.Vector3,k=THREE.GeometryUtils.__v1;f=THREE.GeometryUtils.random();g=THREE.GeometryUtils.random();f+g>1&&(f=1-f,g=1-g);j=1-f-g;h.copy(b);h.multiplyScalar(f);k.copy(c);k.multiplyScalar(g);h.addSelf(k);k.copy(e);k.multiplyScalar(j);h.addSelf(k);return h},randomPointInFace:function(b,
 c,e){var f,g,j;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,g=c.vertices[b.b].position,j=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,g,j);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;g=c.vertices[b.b].position;j=c.vertices[b.c].position;var c=c.vertices[b.d].position,h;e?b._area1&&b._area2?(e=b._area1,h=b._area2):(e=THREE.GeometryUtils.triangleArea(f,g,c),h=THREE.GeometryUtils.triangleArea(g,j,c),b._area1=e,b._area2=h):(e=THREE.GeometryUtils.triangleArea(f,
 c,e){var f,g,j;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,g=c.vertices[b.b].position,j=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,g,j);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;g=c.vertices[b.b].position;j=c.vertices[b.c].position;var c=c.vertices[b.d].position,h;e?b._area1&&b._area2?(e=b._area1,h=b._area2):(e=THREE.GeometryUtils.triangleArea(f,g,c),h=THREE.GeometryUtils.triangleArea(g,j,c),b._area1=e,b._area2=h):(e=THREE.GeometryUtils.triangleArea(f,
-g,c),h=THREE.GeometryUtils.triangleArea(g,j,c));return THREE.GeometryUtils.random()*(e+h)<e?THREE.GeometryUtils.randomPointInTriangle(f,g,c):THREE.GeometryUtils.randomPointInTriangle(g,j,c)}},randomPointsInGeometry:function(b,c){function e(b){function c(e,f){if(f<e)return e;var h=e+Math.floor((f-e)/2);return o[h]>b?c(e,h-1):o[h]<b?c(h+1,f):h}return c(0,o.length-1)}var f,g,j=b.faces,h=b.vertices,k=j.length,n=0,o=[],p,u,v,t;for(g=0;g<k;g++){f=j[g];if(f instanceof THREE.Face3)p=h[f.a].position,u=h[f.b].position,
-v=h[f.c].position,f._area=THREE.GeometryUtils.triangleArea(p,u,v);else if(f instanceof THREE.Face4)p=h[f.a].position,u=h[f.b].position,v=h[f.c].position,t=h[f.d].position,f._area1=THREE.GeometryUtils.triangleArea(p,u,t),f._area2=THREE.GeometryUtils.triangleArea(u,v,t),f._area=f._area1+f._area2;n+=f._area;o[g]=n}f=[];h={};for(g=0;g<c;g++)k=THREE.GeometryUtils.random()*n,k=e(k),f[g]=THREE.GeometryUtils.randomPointInFace(j[k],b,!0),h[k]?h[k]+=1:h[k]=1;return f},triangleArea:function(b,c,e){var f,g=THREE.GeometryUtils.__v1;
+g,c),h=THREE.GeometryUtils.triangleArea(g,j,c));return THREE.GeometryUtils.random()*(e+h)<e?THREE.GeometryUtils.randomPointInTriangle(f,g,c):THREE.GeometryUtils.randomPointInTriangle(g,j,c)}},randomPointsInGeometry:function(b,c){function e(b){function c(e,f){if(f<e)return e;var h=e+Math.floor((f-e)/2);return o[h]>b?c(e,h-1):o[h]<b?c(h+1,f):h}return c(0,o.length-1)}var f,g,j=b.faces,h=b.vertices,k=j.length,m=0,o=[],p,u,v,t;for(g=0;g<k;g++){f=j[g];if(f instanceof THREE.Face3)p=h[f.a].position,u=h[f.b].position,
+v=h[f.c].position,f._area=THREE.GeometryUtils.triangleArea(p,u,v);else if(f instanceof THREE.Face4)p=h[f.a].position,u=h[f.b].position,v=h[f.c].position,t=h[f.d].position,f._area1=THREE.GeometryUtils.triangleArea(p,u,t),f._area2=THREE.GeometryUtils.triangleArea(u,v,t),f._area=f._area1+f._area2;m+=f._area;o[g]=m}f=[];h={};for(g=0;g<c;g++)k=THREE.GeometryUtils.random()*m,k=e(k),f[g]=THREE.GeometryUtils.randomPointInFace(j[k],b,!0),h[k]?h[k]+=1:h[k]=1;return f},triangleArea:function(b,c,e){var f,g=THREE.GeometryUtils.__v1;
 g.sub(b,c);f=g.length();g.sub(b,e);b=g.length();g.sub(c,e);e=g.length();c=0.5*(f+b+e);return Math.sqrt(c*(c-f)*(c-b)*(c-e))},random16:function(){return(65280*Math.random()+255*Math.random())/65535}};THREE.GeometryUtils.random=THREE.GeometryUtils.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;
 g.sub(b,c);f=g.length();g.sub(b,e);b=g.length();g.sub(c,e);e=g.length();c=0.5*(f+b+e);return Math.sqrt(c*(c-f)*(c-b)*(c-e))},random16:function(){return(65280*Math.random()+255*Math.random())/65535}};THREE.GeometryUtils.random=THREE.GeometryUtils.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;
 THREE.ImageUtils={loadTexture:function(b,c,e){var f=new Image,g=new THREE.Texture(f,c);f.onload=function(){g.needsUpdate=!0;e&&e(this)};f.crossOrigin="";f.src=b;return g},loadTextureCube:function(b,c,e){var f,g=[],j=new THREE.Texture(g,c),c=g.loadCount=0;for(f=b.length;c<f;++c)g[c]=new Image,g[c].onload=function(){g.loadCount+=1;if(g.loadCount==6)j.needsUpdate=!0;e&&e(this)},g[c].crossOrigin="",g[c].src=b[c];return j},getNormalMap:function(b,c){var e=function(b){var c=Math.sqrt(b[0]*b[0]+b[1]*b[1]+
 THREE.ImageUtils={loadTexture:function(b,c,e){var f=new Image,g=new THREE.Texture(f,c);f.onload=function(){g.needsUpdate=!0;e&&e(this)};f.crossOrigin="";f.src=b;return g},loadTextureCube:function(b,c,e){var f,g=[],j=new THREE.Texture(g,c),c=g.loadCount=0;for(f=b.length;c<f;++c)g[c]=new Image,g[c].onload=function(){g.loadCount+=1;if(g.loadCount==6)j.needsUpdate=!0;e&&e(this)},g[c].crossOrigin="",g[c].src=b[c];return j},getNormalMap:function(b,c){var e=function(b){var c=Math.sqrt(b[0]*b[0]+b[1]*b[1]+
-b[2]*b[2]);return[b[0]/c,b[1]/c,b[2]/c]};c|=1;var f=b.width,g=b.height,j=document.createElement("canvas");j.width=f;j.height=g;var h=j.getContext("2d");h.drawImage(b,0,0);for(var k=h.getImageData(0,0,f,g).data,n=h.createImageData(f,g),o=n.data,p=0;p<f;p++)for(var u=1;u<g;u++){var v=u-1<0?g-1:u-1,t=(u+1)%g,y=p-1<0?f-1:p-1,w=(p+1)%f,A=[],x=[0,0,k[(u*f+p)*4]/255*c];A.push([-1,0,k[(u*f+y)*4]/255*c]);A.push([-1,-1,k[(v*f+y)*4]/255*c]);A.push([0,-1,k[(v*f+p)*4]/255*c]);A.push([1,-1,k[(v*f+w)*4]/255*c]);
-A.push([1,0,k[(u*f+w)*4]/255*c]);A.push([1,1,k[(t*f+w)*4]/255*c]);A.push([0,1,k[(t*f+p)*4]/255*c]);A.push([-1,1,k[(t*f+y)*4]/255*c]);v=[];y=A.length;for(t=0;t<y;t++){var w=A[t],G=A[(t+1)%y],w=[w[0]-x[0],w[1]-x[1],w[2]-x[2]],G=[G[0]-x[0],G[1]-x[1],G[2]-x[2]];v.push(e([w[1]*G[2]-w[2]*G[1],w[2]*G[0]-w[0]*G[2],w[0]*G[1]-w[1]*G[0]]))}A=[0,0,0];for(t=0;t<v.length;t++)A[0]+=v[t][0],A[1]+=v[t][1],A[2]+=v[t][2];A[0]/=v.length;A[1]/=v.length;A[2]/=v.length;x=(u*f+p)*4;o[x]=(A[0]+1)/2*255|0;o[x+1]=(A[1]+0.5)*
-255|0;o[x+2]=A[2]*255|0;o[x+3]=255}h.putImageData(n,0,0);return j}};THREE.SceneUtils={showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var e,f,g=b.children.length;for(f=0;f<g;f++)e=b.children[f],c(e),THREE.SceneUtils.traverseHierarchy(e,c)}};
+b[2]*b[2]);return[b[0]/c,b[1]/c,b[2]/c]};c|=1;var f=b.width,g=b.height,j=document.createElement("canvas");j.width=f;j.height=g;var h=j.getContext("2d");h.drawImage(b,0,0);for(var k=h.getImageData(0,0,f,g).data,m=h.createImageData(f,g),o=m.data,p=0;p<f;p++)for(var u=1;u<g;u++){var v=u-1<0?g-1:u-1,t=(u+1)%g,x=p-1<0?f-1:p-1,w=(p+1)%f,A=[],y=[0,0,k[(u*f+p)*4]/255*c];A.push([-1,0,k[(u*f+x)*4]/255*c]);A.push([-1,-1,k[(v*f+x)*4]/255*c]);A.push([0,-1,k[(v*f+p)*4]/255*c]);A.push([1,-1,k[(v*f+w)*4]/255*c]);
+A.push([1,0,k[(u*f+w)*4]/255*c]);A.push([1,1,k[(t*f+w)*4]/255*c]);A.push([0,1,k[(t*f+p)*4]/255*c]);A.push([-1,1,k[(t*f+x)*4]/255*c]);v=[];x=A.length;for(t=0;t<x;t++){var w=A[t],G=A[(t+1)%x],w=[w[0]-y[0],w[1]-y[1],w[2]-y[2]],G=[G[0]-y[0],G[1]-y[1],G[2]-y[2]];v.push(e([w[1]*G[2]-w[2]*G[1],w[2]*G[0]-w[0]*G[2],w[0]*G[1]-w[1]*G[0]]))}A=[0,0,0];for(t=0;t<v.length;t++)A[0]+=v[t][0],A[1]+=v[t][1],A[2]+=v[t][2];A[0]/=v.length;A[1]/=v.length;A[2]/=v.length;y=(u*f+p)*4;o[y]=(A[0]+1)/2*255|0;o[y+1]=(A[1]+0.5)*
+255|0;o[y+2]=A[2]*255|0;o[y+3]=255}h.putImageData(m,0,0);return j}};THREE.SceneUtils={showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var e,f,g=b.children.length;for(f=0;f<g;f++)e=b.children[f],c(e),THREE.SceneUtils.traverseHierarchy(e,c)}};
 if(THREE.WebGLRenderer)THREE.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}",
 if(THREE.WebGLRenderer)THREE.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}"},
 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:THREE.UniformsUtils.merge([THREE.UniformsLib.fog,THREE.UniformsLib.lights,{enableAO:{type:"i",value:0},enableDiffuse:{type:"i",value:0},enableSpecular:{type:"i",value:0},tDiffuse:{type:"t",value:0,texture:null},tNormal:{type:"t",value:2,texture:null},tSpecular:{type:"t",value:3,texture:null},tAO:{type:"t",value:4,texture:null},uNormalScale:{type:"f",value:1},tDisplacement:{type:"t",value:5,texture:null},uDisplacementBias:{type:"f",value:0},uDisplacementScale:{type:"f",value:1},uDiffuseColor:{type:"c",
 normal:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.fog,THREE.UniformsLib.lights,{enableAO:{type:"i",value:0},enableDiffuse:{type:"i",value:0},enableSpecular:{type:"i",value:0},tDiffuse:{type:"t",value:0,texture:null},tNormal:{type:"t",value:2,texture:null},tSpecular:{type:"t",value:3,texture:null},tAO:{type:"t",value:4,texture:null},uNormalScale:{type:"f",value:1},tDisplacement:{type:"t",value:5,texture:null},uDisplacementBias:{type:"f",value:0},uDisplacementScale:{type:"f",value:1},uDiffuseColor:{type:"c",
@@ -354,23 +356,26 @@ THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:"attribute vec4 tang
 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",
 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}"},
 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}"},
 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}"},
+sepia:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},amount:{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:"uniform float amount;\nvarying vec2 vUv;\nuniform sampler2D tDiffuse;\nvoid main() {\nvec4 color = texture2D( tDiffuse, vUv );\nvec3 c = color.rgb;\ncolor.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );\ncolor.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );\ncolor.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );\ngl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );\n}"},
+dotscreen:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},tSize:{type:"v2",value:new THREE.Vector2(256,256)},center:{type:"v2",value:new THREE.Vector2(0.5,0.5)},angle:{type:"f",value:1.57},scale:{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:"uniform vec2 center;\nuniform float angle;\nuniform float scale;\nuniform vec2 tSize;\nvarying vec2 vUv;\nuniform sampler2D tDiffuse;\nfloat pattern() {\nfloat s = sin( angle ), c = cos( angle );\nvec2 tex = vUv * tSize - center;\nvec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;\nreturn ( sin( point.x ) * sin( point.y ) ) * 4.0;\n}\nvoid main() {\nvec4 color = texture2D( tDiffuse, vUv );\nfloat average = ( color.r + color.g + color.b ) / 3.0;\ngl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );\n}"},
+vignette:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},offset:{type:"f",value:1},darkness:{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:"uniform float offset;\nuniform float darkness;\nvarying vec2 vUv;\nuniform sampler2D tDiffuse;\nvoid main() {\nvec4 texel = texture2D( tDiffuse, vUv );\nvec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );\ngl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.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}",
 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(b){var c,e,f,g,j=2*Math.ceil(b*3)+1;j>25&&(j=25);g=(j-1)*0.5;e=Array(j);for(c=f=0;c<j;++c)e[c]=Math.exp(-((c-g)*(c-g))/(2*b*b)),f+=e[c];for(c=0;c<j;++c)e[c]/=f;return e}};
 fragmentShader:"void main() {\ngl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );\n}"}},buildKernel:function(b){var c,e,f,g,j=2*Math.ceil(b*3)+1;j>25&&(j=25);g=(j-1)*0.5;e=Array(j);for(c=f=0;c<j;++c)e[c]=Math.exp(-((c-g)*(c-g))/(2*b*b)),f+=e[c];for(c=0;c<j;++c)e[c]/=f;return e}};
 THREE.AnimationHandler=function(){var b=[],c={},e={update:function(c){for(var e=0;e<b.length;e++)b[e].update(c)},addToUpdate:function(c){b.indexOf(c)===-1&&b.push(c)},removeFromUpdate:function(c){c=b.indexOf(c);c!==-1&&b.splice(c,1)},add:function(b){c[b.name]!==void 0&&console.log("THREE.AnimationHandler.add: Warning! "+b.name+" already exists in library. Overwriting.");c[b.name]=b;if(b.initialized!==!0){for(var e=0;e<b.hierarchy.length;e++){for(var f=0;f<b.hierarchy[e].keys.length;f++){if(b.hierarchy[e].keys[f].time<
 THREE.AnimationHandler=function(){var b=[],c={},e={update:function(c){for(var e=0;e<b.length;e++)b[e].update(c)},addToUpdate:function(c){b.indexOf(c)===-1&&b.push(c)},removeFromUpdate:function(c){c=b.indexOf(c);c!==-1&&b.splice(c,1)},add:function(b){c[b.name]!==void 0&&console.log("THREE.AnimationHandler.add: Warning! "+b.name+" already exists in library. Overwriting.");c[b.name]=b;if(b.initialized!==!0){for(var e=0;e<b.hierarchy.length;e++){for(var f=0;f<b.hierarchy[e].keys.length;f++){if(b.hierarchy[e].keys[f].time<
-0)b.hierarchy[e].keys[f].time=0;if(b.hierarchy[e].keys[f].rot!==void 0&&!(b.hierarchy[e].keys[f].rot instanceof THREE.Quaternion)){var k=b.hierarchy[e].keys[f].rot;b.hierarchy[e].keys[f].rot=new THREE.Quaternion(k[0],k[1],k[2],k[3])}}if(b.hierarchy[e].keys[0].morphTargets!==void 0){k={};for(f=0;f<b.hierarchy[e].keys.length;f++)for(var n=0;n<b.hierarchy[e].keys[f].morphTargets.length;n++){var o=b.hierarchy[e].keys[f].morphTargets[n];k[o]=-1}b.hierarchy[e].usedMorphTargets=k;for(f=0;f<b.hierarchy[e].keys.length;f++){var p=
-{};for(o in k){for(n=0;n<b.hierarchy[e].keys[f].morphTargets.length;n++)if(b.hierarchy[e].keys[f].morphTargets[n]===o){p[o]=b.hierarchy[e].keys[f].morphTargetsInfluences[n];break}n===b.hierarchy[e].keys[f].morphTargets.length&&(p[o]=0)}b.hierarchy[e].keys[f].morphTargetsInfluences=p}}for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].time===b.hierarchy[e].keys[f-1].time&&(b.hierarchy[e].keys.splice(f,1),f--);for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].index=f}f=parseInt(b.length*
+0)b.hierarchy[e].keys[f].time=0;if(b.hierarchy[e].keys[f].rot!==void 0&&!(b.hierarchy[e].keys[f].rot instanceof THREE.Quaternion)){var k=b.hierarchy[e].keys[f].rot;b.hierarchy[e].keys[f].rot=new THREE.Quaternion(k[0],k[1],k[2],k[3])}}if(b.hierarchy[e].keys[0].morphTargets!==void 0){k={};for(f=0;f<b.hierarchy[e].keys.length;f++)for(var m=0;m<b.hierarchy[e].keys[f].morphTargets.length;m++){var o=b.hierarchy[e].keys[f].morphTargets[m];k[o]=-1}b.hierarchy[e].usedMorphTargets=k;for(f=0;f<b.hierarchy[e].keys.length;f++){var p=
+{};for(o in k){for(m=0;m<b.hierarchy[e].keys[f].morphTargets.length;m++)if(b.hierarchy[e].keys[f].morphTargets[m]===o){p[o]=b.hierarchy[e].keys[f].morphTargetsInfluences[m];break}m===b.hierarchy[e].keys[f].morphTargets.length&&(p[o]=0)}b.hierarchy[e].keys[f].morphTargetsInfluences=p}}for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].time===b.hierarchy[e].keys[f-1].time&&(b.hierarchy[e].keys.splice(f,1),f--);for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].index=f}f=parseInt(b.length*
 b.fps,10);b.JIT={};b.JIT.hierarchy=[];for(e=0;e<b.hierarchy.length;e++)b.JIT.hierarchy.push(Array(f));b.initialized=!0}},get:function(b){if(typeof b==="string")return c[b]?c[b]:(console.log("THREE.AnimationHandler.get: Couldn't find animation "+b),null)},parse:function(b){var e=[];if(b instanceof THREE.SkinnedMesh)for(var c=0;c<b.bones.length;c++)e.push(b.bones[c]);else f(b,e);return e}},f=function(b,e){e.push(b);for(var c=0;c<b.children.length;c++)f(b.children[c],e)};e.LINEAR=0;e.CATMULLROM=1;e.CATMULLROM_FORWARD=
 b.fps,10);b.JIT={};b.JIT.hierarchy=[];for(e=0;e<b.hierarchy.length;e++)b.JIT.hierarchy.push(Array(f));b.initialized=!0}},get:function(b){if(typeof b==="string")return c[b]?c[b]:(console.log("THREE.AnimationHandler.get: Couldn't find animation "+b),null)},parse:function(b){var e=[];if(b instanceof THREE.SkinnedMesh)for(var c=0;c<b.bones.length;c++)e.push(b.bones[c]);else f(b,e);return e}},f=function(b,e){e.push(b);for(var c=0;c<b.children.length;c++)f(b.children[c],e)};e.LINEAR=0;e.CATMULLROM=1;e.CATMULLROM_FORWARD=
 2;return e}();THREE.Animation=function(b,c,e,f){this.root=b;this.data=THREE.AnimationHandler.get(c);this.hierarchy=THREE.AnimationHandler.parse(b);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=e!==void 0?e:THREE.AnimationHandler.LINEAR;this.JITCompile=f!==void 0?f:!0;this.points=[];this.target=new THREE.Vector3};
 2;return e}();THREE.Animation=function(b,c,e,f){this.root=b;this.data=THREE.AnimationHandler.get(c);this.hierarchy=THREE.AnimationHandler.parse(b);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=e!==void 0?e:THREE.AnimationHandler.LINEAR;this.JITCompile=f!==void 0?f:!0;this.points=[];this.target=new THREE.Vector3};
 THREE.Animation.prototype.play=function(b,c){if(!this.isPlaying){this.isPlaying=!0;this.loop=b!==void 0?b:!0;this.currentTime=c!==void 0?c:0;var e,f=this.hierarchy.length,g;for(e=0;e<f;e++){g=this.hierarchy[e];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)g.useQuaternion=!0;g.matrixAutoUpdate=!0;if(g.animationCache===void 0)g.animationCache={},g.animationCache.prevKey={pos:0,rot:0,scl:0},g.animationCache.nextKey={pos:0,rot:0,scl:0},g.animationCache.originalMatrix=g instanceof
 THREE.Animation.prototype.play=function(b,c){if(!this.isPlaying){this.isPlaying=!0;this.loop=b!==void 0?b:!0;this.currentTime=c!==void 0?c:0;var e,f=this.hierarchy.length,g;for(e=0;e<f;e++){g=this.hierarchy[e];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)g.useQuaternion=!0;g.matrixAutoUpdate=!0;if(g.animationCache===void 0)g.animationCache={},g.animationCache.prevKey={pos:0,rot:0,scl:0},g.animationCache.nextKey={pos:0,rot:0,scl:0},g.animationCache.originalMatrix=g instanceof
 THREE.Bone?g.skinMatrix:g.matrix;var j=g.animationCache.prevKey;g=g.animationCache.nextKey;j.pos=this.data.hierarchy[e].keys[0];j.rot=this.data.hierarchy[e].keys[0];j.scl=this.data.hierarchy[e].keys[0];g.pos=this.getNextKeyWith("pos",e,1);g.rot=this.getNextKeyWith("rot",e,1);g.scl=this.getNextKeyWith("scl",e,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Bone?g.skinMatrix:g.matrix;var j=g.animationCache.prevKey;g=g.animationCache.nextKey;j.pos=this.data.hierarchy[e].keys[0];j.rot=this.data.hierarchy[e].keys[0];j.scl=this.data.hierarchy[e].keys[0];g.pos=this.getNextKeyWith("pos",e,1);g.rot=this.getNextKeyWith("rot",e,1);g.scl=this.getNextKeyWith("scl",e,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var b=0;b<this.hierarchy.length;b++)if(this.hierarchy[b].animationCache!==void 0)this.hierarchy[b]instanceof THREE.Bone?this.hierarchy[b].skinMatrix=this.hierarchy[b].animationCache.originalMatrix:this.hierarchy[b].matrix=this.hierarchy[b].animationCache.originalMatrix,delete this.hierarchy[b].animationCache};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var b=0;b<this.hierarchy.length;b++)if(this.hierarchy[b].animationCache!==void 0)this.hierarchy[b]instanceof THREE.Bone?this.hierarchy[b].skinMatrix=this.hierarchy[b].animationCache.originalMatrix:this.hierarchy[b].matrix=this.hierarchy[b].animationCache.originalMatrix,delete this.hierarchy[b].animationCache};
-THREE.Animation.prototype.update=function(b){if(this.isPlaying){var c=["pos","rot","scl"],e,f,g,j,h,k,n,o,p=this.data.JIT.hierarchy,u,v;this.currentTime+=b*this.timeScale;v=this.currentTime;u=this.currentTime%=this.data.length;o=parseInt(Math.min(u*this.data.fps,this.data.length*this.data.fps),10);for(var t=0,y=this.hierarchy.length;t<y;t++)if(b=this.hierarchy[t],n=b.animationCache,this.JITCompile&&p[t][o]!==void 0)b instanceof THREE.Bone?(b.skinMatrix=p[t][o],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=
-!1):(b.matrix=p[t][o],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)b instanceof THREE.Bone?b.skinMatrix=b.animationCache.originalMatrix:b.matrix=b.animationCache.originalMatrix;for(var w=0;w<3;w++){e=c[w];h=n.prevKey[e];k=n.nextKey[e];if(k.time<=v){if(u<v)if(this.loop){h=this.data.hierarchy[t].keys[0];for(k=this.getNextKeyWith(e,t,1);k.time<u;)h=k,k=this.getNextKeyWith(e,t,k.index+1)}else{this.stop();return}else{do h=k,k=this.getNextKeyWith(e,t,k.index+1);while(k.time<
-u)}n.prevKey[e]=h;n.nextKey[e]=k}b.matrixAutoUpdate=!0;b.matrixWorldNeedsUpdate=!0;f=(u-h.time)/(k.time-h.time);g=h[e];j=k[e];if(f<0||f>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+t),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=g[0]+(j[0]-g[0])*f,e.y=g[1]+(j[1]-g[1])*f,e.z=g[2]+(j[2]-g[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
+THREE.Animation.prototype.update=function(b){if(this.isPlaying){var c=["pos","rot","scl"],e,f,g,j,h,k,m,o,p=this.data.JIT.hierarchy,u,v;this.currentTime+=b*this.timeScale;v=this.currentTime;u=this.currentTime%=this.data.length;o=parseInt(Math.min(u*this.data.fps,this.data.length*this.data.fps),10);for(var t=0,x=this.hierarchy.length;t<x;t++)if(b=this.hierarchy[t],m=b.animationCache,this.JITCompile&&p[t][o]!==void 0)b instanceof THREE.Bone?(b.skinMatrix=p[t][o],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=
+!1):(b.matrix=p[t][o],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)b instanceof THREE.Bone?b.skinMatrix=b.animationCache.originalMatrix:b.matrix=b.animationCache.originalMatrix;for(var w=0;w<3;w++){e=c[w];h=m.prevKey[e];k=m.nextKey[e];if(k.time<=v){if(u<v)if(this.loop){h=this.data.hierarchy[t].keys[0];for(k=this.getNextKeyWith(e,t,1);k.time<u;)h=k,k=this.getNextKeyWith(e,t,k.index+1)}else{this.stop();return}else{do h=k,k=this.getNextKeyWith(e,t,k.index+1);while(k.time<
+u)}m.prevKey[e]=h;m.nextKey[e]=k}b.matrixAutoUpdate=!0;b.matrixWorldNeedsUpdate=!0;f=(u-h.time)/(k.time-h.time);g=h[e];j=k[e];if(f<0||f>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+t),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=g[0]+(j[0]-g[0])*f,e.y=g[1]+(j[1]-g[1])*f,e.z=g[2]+(j[2]-g[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
 this.getPrevKeyWith("pos",t,h.index-1).pos,this.points[1]=g,this.points[2]=j,this.points[3]=this.getNextKeyWith("pos",t,k.index+1).pos,f=f*0.33+0.33,g=this.interpolateCatmullRom(this.points,f),e.x=g[0],e.y=g[1],e.z=g[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e===
 this.getPrevKeyWith("pos",t,h.index-1).pos,this.points[1]=g,this.points[2]=j,this.points[3]=this.getNextKeyWith("pos",t,k.index+1).pos,f=f*0.33+0.33,g=this.interpolateCatmullRom(this.points,f),e.x=g[0],e.y=g[1],e.z=g[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e===
 "rot")THREE.Quaternion.slerp(g,j,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=g[0]+(j[0]-g[0])*f,e.y=g[1]+(j[1]-g[1])*f,e.z=g[2]+(j[2]-g[2])*f}}if(this.JITCompile&&p[0][o]===void 0){this.hierarchy[0].update(void 0,!0);for(t=0;t<this.hierarchy.length;t++)p[t][o]=this.hierarchy[t]instanceof THREE.Bone?this.hierarchy[t].skinMatrix.clone():this.hierarchy[t].matrix.clone()}}};
 "rot")THREE.Quaternion.slerp(g,j,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=g[0]+(j[0]-g[0])*f,e.y=g[1]+(j[1]-g[1])*f,e.z=g[2]+(j[2]-g[2])*f}}if(this.JITCompile&&p[0][o]===void 0){this.hierarchy[0].update(void 0,!0);for(t=0;t<this.hierarchy.length;t++)p[t][o]=this.hierarchy[t]instanceof THREE.Bone?this.hierarchy[t].skinMatrix.clone():this.hierarchy[t].matrix.clone()}}};
-THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var e=[],f=[],g,j,h,k,n,o;g=(b.length-1)*c;j=Math.floor(g);g-=j;e[0]=j==0?j:j-1;e[1]=j;e[2]=j>b.length-2?j:j+1;e[3]=j>b.length-3?j:j+2;j=b[e[0]];k=b[e[1]];n=b[e[2]];o=b[e[3]];e=g*g;h=g*e;f[0]=this.interpolate(j[0],k[0],n[0],o[0],g,e,h);f[1]=this.interpolate(j[1],k[1],n[1],o[1],g,e,h);f[2]=this.interpolate(j[2],k[2],n[2],o[2],g,e,h);return f};
+THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var e=[],f=[],g,j,h,k,m,o;g=(b.length-1)*c;j=Math.floor(g);g-=j;e[0]=j==0?j:j-1;e[1]=j;e[2]=j>b.length-2?j:j+1;e[3]=j>b.length-3?j:j+2;j=b[e[0]];k=b[e[1]];m=b[e[2]];o=b[e[3]];e=g*g;h=g*e;f[0]=this.interpolate(j[0],k[0],m[0],o[0],g,e,h);f[1]=this.interpolate(j[1],k[1],m[1],o[1],g,e,h);f[2]=this.interpolate(j[2],k[2],m[2],o[2],g,e,h);return f};
 THREE.Animation.prototype.interpolate=function(b,c,e,f,g,j,h){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*h+(-3*(c-e)-2*b-f)*j+b*g+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,e){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e=e<f.length-1?e:f.length-1:e%=f.length;e<f.length;e++)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[0]};
 THREE.Animation.prototype.interpolate=function(b,c,e,f,g,j,h){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*h+(-3*(c-e)-2*b-f)*j+b*g+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,e){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e=e<f.length-1?e:f.length-1:e%=f.length;e<f.length;e++)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(b,c,e){for(var f=this.data.hierarchy[c].keys,e=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e>0?e:0:e>=0?e:e+f.length;e>=0;e--)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[f.length-1]};
 THREE.Animation.prototype.getPrevKeyWith=function(b,c,e){for(var f=this.data.hierarchy[c].keys,e=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e>0?e:0:e>=0?e:e+f.length;e>=0;e--)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[f.length-1]};
 THREE.FirstPersonCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=
 THREE.FirstPersonCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=
@@ -383,14 +388,14 @@ this.moveRight&&this.translateX(c);this.moveUp&&this.translateY(c);this.moveDown
 1;this.constrainVertical&&(b=3.14/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c*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;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax-this.verticalMin)/3.14+this.verticalMin;b=this.target.position;g=this.position;b.x=g.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=g.y+100*Math.cos(this.phi);b.z=g.z+100*Math.sin(this.phi)*
 1;this.constrainVertical&&(b=3.14/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c*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;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax-this.verticalMin)/3.14+this.verticalMin;b=this.target.position;g=this.position;b.x=g.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=g.y+100*Math.cos(this.phi);b.z=g.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",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};
 Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};
 THREE.FirstPersonCamera.prototype=new THREE.Camera;THREE.FirstPersonCamera.prototype.constructor=THREE.FirstPersonCamera;THREE.FirstPersonCamera.prototype.supr=THREE.Camera.prototype;THREE.FirstPersonCamera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(b));this.target.position.addSelf(c.multiplyScalar(b))};
 THREE.FirstPersonCamera.prototype=new THREE.Camera;THREE.FirstPersonCamera.prototype.constructor=THREE.FirstPersonCamera;THREE.FirstPersonCamera.prototype.supr=THREE.Camera.prototype;THREE.FirstPersonCamera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(b));this.target.position.addSelf(c.multiplyScalar(b))};
-THREE.PathCamera=function(b){function c(b,c,e,f){var h={name:e,fps:0.6,length:f,hierarchy:[]},g,j=c.getControlPointsArray(),k=c.getLength(),n=j.length,G=0;g=n-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:j[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[g]={time:f,pos:j[g],rot:[0,0,0,1],scl:[1,1,1]};for(g=1;g<n-1;g++)G=f*k.chunks[g]/k.total,c.keys[g]={time:G,pos:j[g]};h.hierarchy[0]=c;THREE.AnimationHandler.add(h);return new THREE.Animation(b,e,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function e(b,c){var e,
+THREE.PathCamera=function(b){function c(b,c,e,f){var h={name:e,fps:0.6,length:f,hierarchy:[]},g,j=c.getControlPointsArray(),k=c.getLength(),m=j.length,G=0;g=m-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:j[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[g]={time:f,pos:j[g],rot:[0,0,0,1],scl:[1,1,1]};for(g=1;g<m-1;g++)G=f*k.chunks[g]/k.total,c.keys[g]={time:G,pos:j[g]};h.hierarchy[0]=c;THREE.AnimationHandler.add(h);return new THREE.Animation(b,e,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function e(b,c){var e,
 f,h=new THREE.Geometry;for(e=0;e<b.points.length*c;e++)f=e/(b.points.length*c),f=b.getPoint(f),h.vertices[e]=new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z));return h}function f(b,c){var f=e(c,10),h=e(c,10),g=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(f,g);particleObj=new THREE.ParticleSystem(h,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.addChild(lineObj);particleObj.scale.set(1,1,1);b.addChild(particleObj);h=new THREE.SphereGeometry(1,
 f,h=new THREE.Geometry;for(e=0;e<b.points.length*c;e++)f=e/(b.points.length*c),f=b.getPoint(f),h.vertices[e]=new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z));return h}function f(b,c){var f=e(c,10),h=e(c,10),g=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(f,g);particleObj=new THREE.ParticleSystem(h,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.addChild(lineObj);particleObj.scale.set(1,1,1);b.addChild(particleObj);h=new THREE.SphereGeometry(1,
 16,8);g=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)f=new THREE.Mesh(h,g),f.position.copy(c.points[i]),f.updateMatrix(),b.addChild(f)}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.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.0050;this.lookHorizontal=
 16,8);g=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)f=new THREE.Mesh(h,g),f.position.copy(c.points[i]),f.updateMatrix(),b.addChild(f)}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.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.0050;this.lookHorizontal=
 this.lookVertical=!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(b){if(b.duration!==void 0)this.duration=b.duration*1E3;if(b.waypoints!==void 0)this.waypoints=b.waypoints;if(b.useConstantSpeed!==void 0)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==void 0)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==void 0)this.createDebugPath=b.createDebugPath;if(b.createDebugDummy!==
 this.lookVertical=!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(b){if(b.duration!==void 0)this.duration=b.duration*1E3;if(b.waypoints!==void 0)this.waypoints=b.waypoints;if(b.useConstantSpeed!==void 0)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==void 0)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==void 0)this.createDebugPath=b.createDebugPath;if(b.createDebugDummy!==
 void 0)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==void 0)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==void 0)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==void 0)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
 void 0)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==void 0)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==void 0)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==void 0)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==void 0)this.domElement=b.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 g=Math.PI*2,j=Math.PI/180;this.update=function(b,c,e){var f,h;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)*j;this.theta=this.lon*j;f=this.phi%g;this.phi=f>=0?f:f+g;f=this.verticalAngleMap.srcRange;h=this.verticalAngleMap.dstRange;var k=h[1]-h[0];this.phi=
 window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var g=Math.PI*2,j=Math.PI/180;this.update=function(b,c,e){var f,h;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)*j;this.theta=this.lon*j;f=this.phi%g;this.phi=f>=0?f:f+g;f=this.verticalAngleMap.srcRange;h=this.verticalAngleMap.dstRange;var k=h[1]-h[0];this.phi=
 TWEEN.Easing.Quadratic.EaseInOut(((this.phi-f[0])*(h[1]-h[0])/(f[1]-f[0])+h[0]-h[0])/k)*k+h[0];f=this.horizontalAngleMap.srcRange;h=this.horizontalAngleMap.dstRange;k=h[1]-h[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-f[0])*(h[1]-h[0])/(f[1]-f[0])+h[0]-h[0])/k)*k+h[0];f=this.target.position;f.x=100*Math.sin(this.phi)*Math.cos(this.theta);f.y=100*Math.cos(this.phi);f.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,b,c,e)};this.onMouseMove=function(b){this.mouseX=
 TWEEN.Easing.Quadratic.EaseInOut(((this.phi-f[0])*(h[1]-h[0])/(f[1]-f[0])+h[0]-h[0])/k)*k+h[0];f=this.horizontalAngleMap.srcRange;h=this.horizontalAngleMap.dstRange;k=h[1]-h[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-f[0])*(h[1]-h[0])/(f[1]-f[0])+h[0]-h[0])/k)*k+h[0];f=this.target.position;f.x=100*Math.sin(this.phi)*Math.cos(this.theta);f.y=100*Math.cos(this.phi);f.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,b,c,e)};this.onMouseMove=function(b){this.mouseX=
-b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),h=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.CubeGeometry(10,10,20),n=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(k,b);b=new THREE.Mesh(n,h);b.position.set(0,10,0);this.animation=
+b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),h=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(k,b);b=new THREE.Mesh(m,h);b.position.set(0,10,0);this.animation=
 c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(b)}else this.animation=c(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&f(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(b,c){return function(){c.apply(b,arguments)}}(this,this.onMouseMove),
 c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(b)}else this.animation=c(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&f(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(b,c){return function(){c.apply(b,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;
 !1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
 THREE.FlyCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.domElement=document;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=b.movementSpeed;if(b.rollSpeed!==void 0)this.rollSpeed=b.rollSpeed;if(b.dragToLook!==void 0)this.dragToLook=b.dragToLook;if(b.autoForward!==void 0)this.autoForward=
 THREE.FlyCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.domElement=document;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=b.movementSpeed;if(b.rollSpeed!==void 0)this.rollSpeed=b.rollSpeed;if(b.dragToLook!==void 0)this.dragToLook=b.dragToLook;if(b.autoForward!==void 0)this.autoForward=
@@ -403,27 +408,27 @@ this.rollSpeed;this.translateX(this.moveVector.x*b);this.translateY(this.moveVec
 this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=
 this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=
 document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,this.mouseup),!1);window.addEventListener("keydown",c(this,this.keydown),!1);window.addEventListener("keyup",c(this,
 document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,this.mouseup),!1);window.addEventListener("keydown",c(this,this.keydown),!1);window.addEventListener("keyup",c(this,
 this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};THREE.FlyCamera.prototype=new THREE.Camera;THREE.FlyCamera.prototype.constructor=THREE.FlyCamera;THREE.FlyCamera.prototype.supr=THREE.Camera.prototype;
 this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};THREE.FlyCamera.prototype=new THREE.Camera;THREE.FlyCamera.prototype.constructor=THREE.FlyCamera;THREE.FlyCamera.prototype.supr=THREE.Camera.prototype;
-THREE.RollCamera=function(b,c,e,f){THREE.Camera.call(this,b,c,e,f);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.matrixAutoUpdate=this.useTarget=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var g=new THREE.Vector3,j=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Matrix4,n=!1,o=1,p=0,u=0,v=0,t=0,y=0,w=window.innerWidth/2,A=window.innerHeight/2;this.update=
-function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.delta=(b-this.lastUpdate)/1E3;this.lastUpdate=b;this.mouseLook&&(b=this.delta*this.lookSpeed,this.rotateHorizontally(b*t),this.rotateVertically(b*y));b=this.delta*this.movementSpeed;this.translateZ(b*(p>0||this.autoForward&&!(p<0)?1:p));this.translateX(b*u);this.translateY(b*v);n&&(this.roll+=this.rollSpeed*this.delta*o);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();
+THREE.RollCamera=function(b,c,e,f){THREE.Camera.call(this,b,c,e,f);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.matrixAutoUpdate=this.useTarget=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var g=new THREE.Vector3,j=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Matrix4,m=!1,o=1,p=0,u=0,v=0,t=0,x=0,w=window.innerWidth/2,A=window.innerHeight/2;this.update=
+function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.delta=(b-this.lastUpdate)/1E3;this.lastUpdate=b;this.mouseLook&&(b=this.delta*this.lookSpeed,this.rotateHorizontally(b*t),this.rotateVertically(b*x));b=this.delta*this.movementSpeed;this.translateZ(b*(p>0||this.autoForward&&!(p<0)?1:p));this.translateX(b*u);this.translateY(b*v);m&&(this.roll+=this.rollSpeed*this.delta*o);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();
 else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();h.copy(this.forward);j.set(0,1,0);g.cross(j,h).normalize();j.cross(h,g).normalize();this.matrix.n11=g.x;this.matrix.n12=j.x;this.matrix.n13=h.x;this.matrix.n21=g.y;this.matrix.n22=j.y;this.matrix.n23=h.y;this.matrix.n31=g.z;this.matrix.n32=j.z;this.matrix.n33=h.z;k.identity();k.n11=Math.cos(this.roll);k.n12=-Math.sin(this.roll);k.n21=Math.sin(this.roll);k.n22=Math.cos(this.roll);this.matrix.multiplySelf(k);
 else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();h.copy(this.forward);j.set(0,1,0);g.cross(j,h).normalize();j.cross(h,g).normalize();this.matrix.n11=g.x;this.matrix.n12=j.x;this.matrix.n13=h.x;this.matrix.n21=g.y;this.matrix.n22=j.y;this.matrix.n23=h.y;this.matrix.n31=g.z;this.matrix.n32=j.z;this.matrix.n33=h.z;k.identity();k.n11=Math.cos(this.roll);k.n12=-Math.sin(this.roll);k.n21=Math.sin(this.roll);k.n22=Math.cos(this.roll);this.matrix.multiplySelf(k);
 this.matrixWorldNeedsUpdate=!0;this.matrix.n14=this.position.x;this.matrix.n24=this.position.y;this.matrix.n34=this.position.z;this.supr.update.call(this)};this.translateX=function(b){this.position.x+=this.matrix.n11*b;this.position.y+=this.matrix.n21*b;this.position.z+=this.matrix.n31*b};this.translateY=function(b){this.position.x+=this.matrix.n12*b;this.position.y+=this.matrix.n22*b;this.position.z+=this.matrix.n32*b};this.translateZ=function(b){this.position.x-=this.matrix.n13*b;this.position.y-=
 this.matrixWorldNeedsUpdate=!0;this.matrix.n14=this.position.x;this.matrix.n24=this.position.y;this.matrix.n34=this.position.z;this.supr.update.call(this)};this.translateX=function(b){this.position.x+=this.matrix.n11*b;this.position.y+=this.matrix.n21*b;this.position.z+=this.matrix.n31*b};this.translateY=function(b){this.position.x+=this.matrix.n12*b;this.position.y+=this.matrix.n22*b;this.position.z+=this.matrix.n32*b};this.translateZ=function(b){this.position.x-=this.matrix.n13*b;this.position.y-=
 this.matrix.n23*b;this.position.z-=this.matrix.n33*b};this.rotateHorizontally=function(b){g.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);g.multiplyScalar(b);this.forward.subSelf(g);this.forward.normalize()};this.rotateVertically=function(b){j.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);j.multiplyScalar(b);this.forward.addSelf(j);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
 this.matrix.n23*b;this.position.z-=this.matrix.n33*b};this.rotateHorizontally=function(b){g.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);g.multiplyScalar(b);this.forward.subSelf(g);this.forward.normalize()};this.rotateVertically=function(b){j.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);j.multiplyScalar(b);this.forward.addSelf(j);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
-function(b){t=(b.clientX-w)/window.innerWidth;y=(b.clientY-A)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:p=1;break;case 2:p=-1}},!1);this.domElement.addEventListener("mouseup",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:p=0;break;case 2:p=0}},!1);this.domElement.addEventListener("keydown",function(b){switch(b.keyCode){case 38:case 87:p=1;break;case 37:case 65:u=-1;break;
-case 40:case 83:p=-1;break;case 39:case 68:u=1;break;case 81:n=!0;o=1;break;case 69:n=!0;o=-1;break;case 82:v=1;break;case 70:v=-1}},!1);this.domElement.addEventListener("keyup",function(b){switch(b.keyCode){case 38:case 87:p=0;break;case 37:case 65:u=0;break;case 40:case 83:p=0;break;case 39:case 68:u=0;break;case 81:n=!1;break;case 69:n=!1;break;case 82:v=0;break;case 70:v=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
+function(b){t=(b.clientX-w)/window.innerWidth;x=(b.clientY-A)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:p=1;break;case 2:p=-1}},!1);this.domElement.addEventListener("mouseup",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:p=0;break;case 2:p=0}},!1);this.domElement.addEventListener("keydown",function(b){switch(b.keyCode){case 38:case 87:p=1;break;case 37:case 65:u=-1;break;
+case 40:case 83:p=-1;break;case 39:case 68:u=1;break;case 81:m=!0;o=1;break;case 69:m=!0;o=-1;break;case 82:v=1;break;case 70:v=-1}},!1);this.domElement.addEventListener("keyup",function(b){switch(b.keyCode){case 38:case 87:p=0;break;case 37:case 65:u=0;break;case 40:case 83:p=0;break;case 39:case 68:u=0;break;case 81:m=!1;break;case 69:m=!1;break;case 82:v=0;break;case 70:v=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
 THREE.RollCamera.prototype.supr=THREE.Camera.prototype;
 THREE.RollCamera.prototype.supr=THREE.Camera.prototype;
 THREE.TrackballCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}b=b||{};THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.domElement=b.domElement||document;this.screen=b.screen||{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=b.radius||(this.screen.width+this.screen.height)/4;this.rotateSpeed=b.rotateSpeed||1;this.zoomSpeed=b.zoomSpeed||1.2;this.panSpeed=b.panSpeed||0.3;this.noZoom=b.noZoom||!1;this.noPan=b.noPan||
 THREE.TrackballCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}b=b||{};THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.domElement=b.domElement||document;this.screen=b.screen||{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=b.radius||(this.screen.width+this.screen.height)/4;this.rotateSpeed=b.rotateSpeed||1;this.zoomSpeed=b.zoomSpeed||1.2;this.panSpeed=b.panSpeed||0.3;this.noZoom=b.noZoom||!1;this.noPan=b.noPan||
-!1;this.staticMoving=b.staticMoving||!1;this.dynamicDampingFactor=b.dynamicDampingFactor||0.2;this.minDistance=b.minDistance||0;this.maxDistance=b.maxDistance||Infinity;this.keys=b.keys||[65,83,68];this.useTarget=!0;var e=!1,f=this.STATE.NONE,g=new THREE.Vector3,j=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector2,n=new THREE.Vector2,o=new THREE.Vector2,p=new THREE.Vector2;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.getMouseOnScreen=function(b,c){return new THREE.Vector2((b-
+!1;this.staticMoving=b.staticMoving||!1;this.dynamicDampingFactor=b.dynamicDampingFactor||0.2;this.minDistance=b.minDistance||0;this.maxDistance=b.maxDistance||Infinity;this.keys=b.keys||[65,83,68];this.useTarget=!0;var e=!1,f=this.STATE.NONE,g=new THREE.Vector3,j=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector2,m=new THREE.Vector2,o=new THREE.Vector2,p=new THREE.Vector2;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.getMouseOnScreen=function(b,c){return new THREE.Vector2((b-
 this.screen.offsetLeft)/this.radius*0.5,(c-this.screen.offsetTop)/this.radius*0.5)};this.getMouseProjectionOnBall=function(b,c){var e=new THREE.Vector3((b-this.screen.width*0.5-this.screen.offsetLeft)/this.radius,(this.screen.height*0.5+this.screen.offsetTop-c)/this.radius,0),f=e.length();f>1?e.normalize():e.z=Math.sqrt(1-f*f);g=this.position.clone().subSelf(this.target.position);f=this.up.clone().setLength(e.y);f.addSelf(this.up.clone().crossSelf(g).setLength(e.x));f.addSelf(g.setLength(e.z));return f};
 this.screen.offsetLeft)/this.radius*0.5,(c-this.screen.offsetTop)/this.radius*0.5)};this.getMouseProjectionOnBall=function(b,c){var e=new THREE.Vector3((b-this.screen.width*0.5-this.screen.offsetLeft)/this.radius,(this.screen.height*0.5+this.screen.offsetTop-c)/this.radius,0),f=e.length();f>1?e.normalize():e.z=Math.sqrt(1-f*f);g=this.position.clone().subSelf(this.target.position);f=this.up.clone().setLength(e.y);f.addSelf(this.up.clone().crossSelf(g).setLength(e.x));f.addSelf(g.setLength(e.z));return f};
-this.rotateCamera=function(){var b=Math.acos(j.dot(h)/j.length()/h.length());if(b){var c=(new THREE.Vector3).cross(j,h).normalize(),e=new THREE.Quaternion;b*=this.rotateSpeed;e.setFromAxisAngle(c,-b);e.multiplyVector3(g);e.multiplyVector3(this.up);e.multiplyVector3(h);this.staticMoving?j=h:(e.setFromAxisAngle(c,b*(this.dynamicDampingFactor-1)),e.multiplyVector3(j))}};this.zoomCamera=function(){var b=1+(n.y-k.y)*this.zoomSpeed;b!==1&&b>0&&(g.multiplyScalar(b),this.staticMoving?k=n:k.y+=(n.y-k.y)*this.dynamicDampingFactor)};
+this.rotateCamera=function(){var b=Math.acos(j.dot(h)/j.length()/h.length());if(b){var c=(new THREE.Vector3).cross(j,h).normalize(),e=new THREE.Quaternion;b*=this.rotateSpeed;e.setFromAxisAngle(c,-b);e.multiplyVector3(g);e.multiplyVector3(this.up);e.multiplyVector3(h);this.staticMoving?j=h:(e.setFromAxisAngle(c,b*(this.dynamicDampingFactor-1)),e.multiplyVector3(j))}};this.zoomCamera=function(){var b=1+(m.y-k.y)*this.zoomSpeed;b!==1&&b>0&&(g.multiplyScalar(b),this.staticMoving?k=m:k.y+=(m.y-k.y)*this.dynamicDampingFactor)};
 this.panCamera=function(){var b=p.clone().subSelf(o);if(b.lengthSq()){b.multiplyScalar(g.length()*this.panSpeed);var c=g.clone().crossSelf(this.up).setLength(b.x);c.addSelf(this.up.clone().setLength(b.y));this.position.addSelf(c);this.target.position.addSelf(c);this.staticMoving?o=p:o.addSelf(b.sub(p,o).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.position.lengthSq()>this.maxDistance*this.maxDistance&&this.position.setLength(this.maxDistance),
 this.panCamera=function(){var b=p.clone().subSelf(o);if(b.lengthSq()){b.multiplyScalar(g.length()*this.panSpeed);var c=g.clone().crossSelf(this.up).setLength(b.x);c.addSelf(this.up.clone().setLength(b.y));this.position.addSelf(c);this.target.position.addSelf(c);this.staticMoving?o=p:o.addSelf(b.sub(p,o).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.position.lengthSq()>this.maxDistance*this.maxDistance&&this.position.setLength(this.maxDistance),
 g.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.position,g.setLength(this.minDistance))};this.update=function(b,c,e){g=this.position.clone().subSelf(this.target.position);this.rotateCamera();this.noZoom||this.zoomCamera();this.noPan||this.panCamera();this.position.add(this.target.position,g);this.checkDistances();this.supr.update.call(this,b,c,e)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
 g.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.position,g.setLength(this.minDistance))};this.update=function(b,c,e){g=this.position.clone().subSelf(this.target.position);this.rotateCamera();this.noZoom||this.zoomCamera();this.noPan||this.panCamera();this.position.add(this.target.position,g);this.checkDistances();this.supr.update.call(this,b,c,e)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
-c(this,function(b){e&&(j=h=this.getMouseProjectionOnBall(b.clientX,b.clientY),k=n=this.getMouseOnScreen(b.clientX,b.clientY),o=p=this.getMouseOnScreen(b.clientX,b.clientY),e=!1);f!==this.STATE.NONE&&(f===this.STATE.ROTATE?h=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?n=this.getMouseOnScreen(b.clientX,b.clientY):f===this.STATE.PAN&&!this.noPan&&(p=this.getMouseOnScreen(b.clientX,b.clientY)))}),!1);this.domElement.addEventListener("mousedown",c(this,function(b){b.preventDefault();
-b.stopPropagation();if(f===this.STATE.NONE)f=b.button,f===this.STATE.ROTATE?j=h=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?k=n=this.getMouseOnScreen(b.clientX,b.clientY):this.noPan||(o=p=this.getMouseOnScreen(b.clientX,b.clientY))}),!1);this.domElement.addEventListener("mouseup",c(this,function(b){b.preventDefault();b.stopPropagation();f=this.STATE.NONE}),!1);window.addEventListener("keydown",c(this,function(b){if(f===this.STATE.NONE){if(b.keyCode===this.keys[this.STATE.ROTATE])f=
+c(this,function(b){e&&(j=h=this.getMouseProjectionOnBall(b.clientX,b.clientY),k=m=this.getMouseOnScreen(b.clientX,b.clientY),o=p=this.getMouseOnScreen(b.clientX,b.clientY),e=!1);f!==this.STATE.NONE&&(f===this.STATE.ROTATE?h=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?m=this.getMouseOnScreen(b.clientX,b.clientY):f===this.STATE.PAN&&!this.noPan&&(p=this.getMouseOnScreen(b.clientX,b.clientY)))}),!1);this.domElement.addEventListener("mousedown",c(this,function(b){b.preventDefault();
+b.stopPropagation();if(f===this.STATE.NONE)f=b.button,f===this.STATE.ROTATE?j=h=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?k=m=this.getMouseOnScreen(b.clientX,b.clientY):this.noPan||(o=p=this.getMouseOnScreen(b.clientX,b.clientY))}),!1);this.domElement.addEventListener("mouseup",c(this,function(b){b.preventDefault();b.stopPropagation();f=this.STATE.NONE}),!1);window.addEventListener("keydown",c(this,function(b){if(f===this.STATE.NONE){if(b.keyCode===this.keys[this.STATE.ROTATE])f=
 this.STATE.ROTATE;else if(b.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)f=this.STATE.ZOOM;else if(b.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)f=this.STATE.PAN;f!==this.STATE.NONE&&(e=!0)}}),!1);window.addEventListener("keyup",c(this,function(){if(f!==this.STATE.NONE)f=this.STATE.NONE}),!1)};THREE.TrackballCamera.prototype=new THREE.Camera;THREE.TrackballCamera.prototype.constructor=THREE.TrackballCamera;THREE.TrackballCamera.prototype.supr=THREE.Camera.prototype;
 this.STATE.ROTATE;else if(b.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)f=this.STATE.ZOOM;else if(b.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)f=this.STATE.PAN;f!==this.STATE.NONE&&(e=!0)}}),!1);window.addEventListener("keyup",c(this,function(){if(f!==this.STATE.NONE)f=this.STATE.NONE}),!1)};THREE.TrackballCamera.prototype=new THREE.Camera;THREE.TrackballCamera.prototype.constructor=THREE.TrackballCamera;THREE.TrackballCamera.prototype.supr=THREE.Camera.prototype;
 THREE.TrackballCamera.prototype.STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2};THREE.QuakeCamera=THREE.FirstPersonCamera;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(b){return this.getPoint(this.getUtoTmapping(b))};THREE.Curve.prototype.getPoints=function(b){b||(b=5);var c,e=[];for(c=0;c<=b;c++)e.push(this.getPoint(c/b));return e};
 THREE.TrackballCamera.prototype.STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2};THREE.QuakeCamera=THREE.FirstPersonCamera;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(b){return this.getPoint(this.getUtoTmapping(b))};THREE.Curve.prototype.getPoints=function(b){b||(b=5);var c,e=[];for(c=0;c<=b;c++)e.push(this.getPoint(c/b));return e};
 THREE.Curve.prototype.getSpacedPoints=function(b){b||(b=5);var c,e=[];for(c=0;c<=b;c++)e.push(this.getPointAt(c/b));return e};THREE.Curve.prototype.getLength=function(){var b=this.getLengths();return b[b.length-1]};
 THREE.Curve.prototype.getSpacedPoints=function(b){b||(b=5);var c,e=[];for(c=0;c<=b;c++)e.push(this.getPointAt(c/b));return e};THREE.Curve.prototype.getLength=function(){var b=this.getLengths();return b[b.length-1]};
 THREE.Curve.prototype.getLengths=function(b){b||(b=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==b+1)return this.cacheArcLengths;var c=[],e,f=this.getPoint(0),g,j=0;c.push(0);for(g=1;g<=b;g++)e=this.getPoint(g/b),j+=e.distanceTo(f),c.push(j),f=e;return this.cacheArcLengths=c};
 THREE.Curve.prototype.getLengths=function(b){b||(b=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==b+1)return this.cacheArcLengths;var c=[],e,f=this.getPoint(0),g,j=0;c.push(0);for(g=1;g<=b;g++)e=this.getPoint(g/b),j+=e.distanceTo(f),c.push(j),f=e;return this.cacheArcLengths=c};
-THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,g=e.length,j;j=c?c:b*e[g-1];time=Date.now();for(var h=0,k=g-1,n;h<=k;)if(f=Math.floor(h+(k-h)/2),n=e[f]-j,n<0)h=f+1;else if(n>0)k=f-1;else{k=f;break}f=k;if(e[f]==j)return f/(g-1);h=e[f];return e=(f+(j-h)/(e[f+1]-h))/(g-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)};
+THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,g=e.length,j;j=c?c:b*e[g-1];time=Date.now();for(var h=0,k=g-1,m;h<=k;)if(f=Math.floor(h+(k-h)/2),m=e[f]-j,m<0)h=f+1;else if(m>0)k=f-1;else{k=f;break}f=k;if(e[f]==j)return f/(g-1);h=e[f];return e=(f+(j-h)/(e[f+1]-h))/(g-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)};
 THREE.Curve.prototype.getTangent=function(b){var c=b-1.0E-4;b+=1.0E-4;c<0&&(c=0);b>1&&(b=1);var c=this.getPoint(c),b=this.getPoint(b),e=new THREE.Vector2;e.sub(b,c);return e.unit()};THREE.LineCurve=function(b,c){b instanceof THREE.Vector2?(this.v1=b,this.v2=c):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(b,c,e,f){this.constructor(new THREE.Vector2(b,c),new THREE.Vector2(e,f))};THREE.LineCurve.prototype=new THREE.Curve;
 THREE.Curve.prototype.getTangent=function(b){var c=b-1.0E-4;b+=1.0E-4;c<0&&(c=0);b>1&&(b=1);var c=this.getPoint(c),b=this.getPoint(b),e=new THREE.Vector2;e.sub(b,c);return e.unit()};THREE.LineCurve=function(b,c){b instanceof THREE.Vector2?(this.v1=b,this.v2=c):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(b,c,e,f){this.constructor(new THREE.Vector2(b,c),new THREE.Vector2(e,f))};THREE.LineCurve.prototype=new THREE.Curve;
 THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2;c.sub(this.v2,this.v1);c.multiplyScalar(b).addSelf(this.v1);return c};THREE.LineCurve.prototype.getPointAt=function(b){return this.getPoint(b)};THREE.LineCurve.prototype.getTangent=function(){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.normalize();return b};
 THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2;c.sub(this.v2,this.v1);c.multiplyScalar(b).addSelf(this.v1);return c};THREE.LineCurve.prototype.getPointAt=function(b){return this.getPoint(b)};THREE.LineCurve.prototype.getTangent=function(){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.normalize();return b};
 THREE.QuadraticBezierCurve=function(b,c,e){if(!(c instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),b=new THREE.Vector2(f[0],f[1]),c=new THREE.Vector2(f[2],f[3]),e=new THREE.Vector2(f[4],f[5]);this.v0=b;this.v1=c;this.v2=e};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
 THREE.QuadraticBezierCurve=function(b,c,e){if(!(c instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),b=new THREE.Vector2(f[0],f[1]),c=new THREE.Vector2(f[2],f[3]),e=new THREE.Vector2(f[4],f[5]);this.v0=b;this.v1=c;this.v2=e};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
@@ -438,142 +443,142 @@ THREE.Curve.create=function(b,c){b.prototype=new THREE.Curve;b.prototype.constru
 THREE.QuadraticBezierCurve3=THREE.Curve.create(function(b,c,e){this.v0=b;this.v1=c;this.v2=e},function(b){var c,e;c=THREE.Shape.Utils.b2(b,this.v0.x,this.v1.x,this.v2.x);e=THREE.Shape.Utils.b2(b,this.v0.y,this.v1.y,this.v2.y);b=THREE.Shape.Utils.b2(b,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(c,e,b)});THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(b){this.curves.push(b)};
 THREE.QuadraticBezierCurve3=THREE.Curve.create(function(b,c,e){this.v0=b;this.v1=c;this.v2=e},function(b){var c,e;c=THREE.Shape.Utils.b2(b,this.v0.x,this.v1.x,this.v2.x);e=THREE.Shape.Utils.b2(b,this.v0.y,this.v1.y,this.v2.y);b=THREE.Shape.Utils.b2(b,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(c,e,b)});THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(b){this.curves.push(b)};
 THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){};THREE.CurvePath.prototype.getPoint=function(b){for(var c=b*this.getLength(),e=this.getCurveLengths(),b=0;b<e.length;){if(e[b]>=c)return c=e[b]-c,b=this.curves[b],c=1-c/b.getLength(),b.getPointAt(c);b++}return null};THREE.CurvePath.prototype.getLength=function(){var b=this.getCurveLengths();return b[b.length-1]};
 THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){};THREE.CurvePath.prototype.getPoint=function(b){for(var c=b*this.getLength(),e=this.getCurveLengths(),b=0;b<e.length;){if(e[b]>=c)return c=e[b]-c,b=this.curves[b],c=1-c/b.getLength(),b.getPointAt(c);b++}return null};THREE.CurvePath.prototype.getLength=function(){var b=this.getCurveLengths();return b[b.length-1]};
 THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var b=[],c=0,e,f=this.curves.length;for(e=0;e<f;e++)c+=this.curves[e].getLength(),b.push(c);return this.cacheLengths=b};
 THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var b=[],c=0,e,f=this.curves.length;for(e=0;e<f;e++)c+=this.curves[e].getLength(),b.push(c);return this.cacheLengths=b};
-THREE.CurvePath.prototype.getBoundingBox=function(){var b=this.getPoints(),c,e,f,g;c=e=Number.NEGATIVE_INFINITY;f=g=Number.POSITIVE_INFINITY;var j,h,k,n;n=new THREE.Vector2;h=0;for(k=b.length;h<k;h++){j=b[h];if(j.x>c)c=j.x;else if(j.x<f)f=j.x;if(j.y>e)e=j.y;else if(j.y<e)g=j.y;n.addSelf(j.x,j.y)}return{minX:f,minY:g,maxX:c,maxY:e,centroid:n.divideScalar(k)}};THREE.CurvePath.prototype.createPointsGeometry=function(b){return this.createGeometry(this.getPoints(b,!0))};
+THREE.CurvePath.prototype.getBoundingBox=function(){var b=this.getPoints(),c,e,f,g;c=e=Number.NEGATIVE_INFINITY;f=g=Number.POSITIVE_INFINITY;var j,h,k,m;m=new THREE.Vector2;h=0;for(k=b.length;h<k;h++){j=b[h];if(j.x>c)c=j.x;else if(j.x<f)f=j.x;if(j.y>e)e=j.y;else if(j.y<e)g=j.y;m.addSelf(j.x,j.y)}return{minX:f,minY:g,maxX:c,maxY:e,centroid:m.divideScalar(k)}};THREE.CurvePath.prototype.createPointsGeometry=function(b){return this.createGeometry(this.getPoints(b,!0))};
 THREE.CurvePath.prototype.createSpacedPointsGeometry=function(b){return this.createGeometry(this.getSpacedPoints(b,!0))};THREE.CurvePath.prototype.createGeometry=function(b){for(var c=new THREE.Geometry,e=0;e<b.length;e++)c.vertices.push(new THREE.Vertex(new THREE.Vector3(b[e].x,b[e].y,0)));return c};THREE.CurvePath.prototype.addWrapPath=function(b){this.bends.push(b)};
 THREE.CurvePath.prototype.createSpacedPointsGeometry=function(b){return this.createGeometry(this.getSpacedPoints(b,!0))};THREE.CurvePath.prototype.createGeometry=function(b){for(var c=new THREE.Geometry,e=0;e<b.length;e++)c.vertices.push(new THREE.Vertex(new THREE.Vector3(b[e].x,b[e].y,0)));return c};THREE.CurvePath.prototype.addWrapPath=function(b){this.bends.push(b)};
 THREE.CurvePath.prototype.getTransformedPoints=function(b,c){var e=this.getPoints(b),f,g;if(!c)c=this.bends;f=0;for(g=c.length;f<g;f++)e=this.getWrapPoints(e,c[f]);return e};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(b,c){var e=this.getSpacedPoints(b),f,g;if(!c)c=this.bends;f=0;for(g=c.length;f<g;f++)e=this.getWrapPoints(e,c[f]);return e};
 THREE.CurvePath.prototype.getTransformedPoints=function(b,c){var e=this.getPoints(b),f,g;if(!c)c=this.bends;f=0;for(g=c.length;f<g;f++)e=this.getWrapPoints(e,c[f]);return e};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(b,c){var e=this.getSpacedPoints(b),f,g;if(!c)c=this.bends;f=0;for(g=c.length;f<g;f++)e=this.getWrapPoints(e,c[f]);return e};
-THREE.CurvePath.prototype.getWrapPoints=function(b,c){var e=this.getBoundingBox(),f,g,j,h,k,n;f=0;for(g=b.length;f<g;f++)j=b[f],h=j.x,k=j.y,n=h/e.maxX,n=c.getUtoTmapping(n,h),h=c.getPoint(n),k=c.getNormalVector(n).multiplyScalar(k),j.x=h.x+k.x,j.y=h.y+k.y;return b};THREE.Path=function(b){THREE.CurvePath.call(this);this.actions=[];b&&this.fromPoints(b)};THREE.Path.prototype=new THREE.CurvePath;THREE.Path.prototype.constructor=THREE.Path;
+THREE.CurvePath.prototype.getWrapPoints=function(b,c){var e=this.getBoundingBox(),f,g,j,h,k,m;f=0;for(g=b.length;f<g;f++)j=b[f],h=j.x,k=j.y,m=h/e.maxX,m=c.getUtoTmapping(m,h),h=c.getPoint(m),k=c.getNormalVector(m).multiplyScalar(k),j.x=h.x+k.x,j.y=h.y+k.y;return b};THREE.Path=function(b){THREE.CurvePath.call(this);this.actions=[];b&&this.fromPoints(b)};THREE.Path.prototype=new THREE.CurvePath;THREE.Path.prototype.constructor=THREE.Path;
 THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc"};THREE.Path.prototype.fromPoints=function(b){this.moveTo(b[0].x,b[0].y);var c,e=b.length;for(c=1;c<e;c++)this.lineTo(b[c].x,b[c].y)};THREE.Path.prototype.moveTo=function(){var b=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:b})};
 THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc"};THREE.Path.prototype.fromPoints=function(b){this.moveTo(b[0].x,b[0].y);var c,e=b.length;for(c=1;c<e;c++)this.lineTo(b[c].x,b[c].y)};THREE.Path.prototype.moveTo=function(){var b=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:b})};
 THREE.Path.prototype.lineTo=function(b,c){var e=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args;this.curves.push(new THREE.LineCurve(new THREE.Vector2(f[f.length-2],f[f.length-1]),new THREE.Vector2(b,c)));this.actions.push({action:THREE.PathActions.LINE_TO,args:e})};
 THREE.Path.prototype.lineTo=function(b,c){var e=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args;this.curves.push(new THREE.LineCurve(new THREE.Vector2(f[f.length-2],f[f.length-1]),new THREE.Vector2(b,c)));this.actions.push({action:THREE.PathActions.LINE_TO,args:e})};
 THREE.Path.prototype.quadraticCurveTo=function(b,c,e,f){var g=Array.prototype.slice.call(arguments),j=this.actions[this.actions.length-1].args;this.curves.push(new THREE.QuadraticBezierCurve(new THREE.Vector2(j[j.length-2],j[j.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f)));this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:g})};
 THREE.Path.prototype.quadraticCurveTo=function(b,c,e,f){var g=Array.prototype.slice.call(arguments),j=this.actions[this.actions.length-1].args;this.curves.push(new THREE.QuadraticBezierCurve(new THREE.Vector2(j[j.length-2],j[j.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f)));this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:g})};
 THREE.Path.prototype.bezierCurveTo=function(b,c,e,f,g,j){var h=Array.prototype.slice.call(arguments),k=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(k[k.length-2],k[k.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f),new THREE.Vector2(g,j)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:h})};
 THREE.Path.prototype.bezierCurveTo=function(b,c,e,f,g,j){var h=Array.prototype.slice.call(arguments),k=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(k[k.length-2],k[k.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f),new THREE.Vector2(g,j)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:h})};
 THREE.Path.prototype.splineThru=function(b){var c=Array.prototype.slice.call(arguments),e=this.actions[this.actions.length-1].args,e=[new THREE.Vector2(e[e.length-2],e[e.length-1])],e=e.concat(b);this.curves.push(new THREE.SplineCurve(e));this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:c})};THREE.Path.prototype.arc=function(b,c,e,f,g,j){var h=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(b,c,e,f,g,j));this.actions.push({action:THREE.PathActions.ARC,args:h})};
 THREE.Path.prototype.splineThru=function(b){var c=Array.prototype.slice.call(arguments),e=this.actions[this.actions.length-1].args,e=[new THREE.Vector2(e[e.length-2],e[e.length-1])],e=e.concat(b);this.curves.push(new THREE.SplineCurve(e));this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:c})};THREE.Path.prototype.arc=function(b,c,e,f,g,j){var h=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(b,c,e,f,g,j));this.actions.push({action:THREE.PathActions.ARC,args:h})};
 THREE.Path.prototype.getSpacedPoints=function(b){b||(b=40);for(var c=[],e=0;e<b;e++)c.push(this.getPoint(e/b));return c};
 THREE.Path.prototype.getSpacedPoints=function(b){b||(b=40);for(var c=[],e=0;e<b;e++)c.push(this.getPoint(e/b));return c};
-THREE.Path.prototype.getPoints=function(b,c){var b=b||12,e=[],f,g,j,h,k,n,o,p,u,v,t,y,w;f=0;for(g=this.actions.length;f<g;f++)switch(j=this.actions[f],h=j.action,j=j.args,h){case THREE.PathActions.LINE_TO:e.push(new THREE.Vector2(j[0],j[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:k=j[2];n=j[3];u=j[0];v=j[1];e.length>0?(h=e[e.length-1],t=h.x,y=h.y):(h=this.actions[f-1].args,t=h[h.length-2],y=h[h.length-1]);for(h=1;h<=b;h++)w=h/b,j=THREE.Shape.Utils.b2(w,t,u,k),w=THREE.Shape.Utils.b2(w,y,v,
-n),e.push(new THREE.Vector2(j,w));break;case THREE.PathActions.BEZIER_CURVE_TO:k=j[4];n=j[5];u=j[0];v=j[1];o=j[2];p=j[3];e.length>0?(h=e[e.length-1],t=h.x,y=h.y):(h=this.actions[f-1].args,t=h[h.length-2],y=h[h.length-1]);for(h=1;h<=b;h++)w=h/b,j=THREE.Shape.Utils.b3(w,t,u,o,k),w=THREE.Shape.Utils.b3(w,y,v,p,n),e.push(new THREE.Vector2(j,w));break;case THREE.PathActions.CSPLINE_THRU:h=this.actions[f-1].args;h=[new THREE.Vector2(h[h.length-2],h[h.length-1])];w=b*j[0].length;h=h.concat(j[0]);j=new THREE.SplineCurve(h);
-for(h=1;h<=w;h++)e.push(j.getPointAt(h/w));break;case THREE.PathActions.ARC:h=this.actions[f-1].args;k=j[0];n=j[1];o=j[2];u=j[3];w=j[4];v=!!j[5];p=h[h.length-2];t=h[h.length-1];h.length==0&&(p=t=0);y=w-u;var A=b*2;for(h=1;h<=A;h++)w=h/A,v||(w=1-w),w=u+w*y,j=p+k+o*Math.cos(w),w=t+n+o*Math.sin(w),e.push(new THREE.Vector2(j,w))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)};
-THREE.Path.prototype.nltransform=function(b,c,e,f,g,j){var h=this.getPoints(),k,n,o,p,u;k=0;for(n=h.length;k<n;k++)o=h[k],p=o.x,u=o.y,o.x=b*p+c*u+e,o.y=f*u+g*p+j;return h};
+THREE.Path.prototype.getPoints=function(b,c){var b=b||12,e=[],f,g,j,h,k,m,o,p,u,v,t,x,w;f=0;for(g=this.actions.length;f<g;f++)switch(j=this.actions[f],h=j.action,j=j.args,h){case THREE.PathActions.LINE_TO:e.push(new THREE.Vector2(j[0],j[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:k=j[2];m=j[3];u=j[0];v=j[1];e.length>0?(h=e[e.length-1],t=h.x,x=h.y):(h=this.actions[f-1].args,t=h[h.length-2],x=h[h.length-1]);for(h=1;h<=b;h++)w=h/b,j=THREE.Shape.Utils.b2(w,t,u,k),w=THREE.Shape.Utils.b2(w,x,v,
+m),e.push(new THREE.Vector2(j,w));break;case THREE.PathActions.BEZIER_CURVE_TO:k=j[4];m=j[5];u=j[0];v=j[1];o=j[2];p=j[3];e.length>0?(h=e[e.length-1],t=h.x,x=h.y):(h=this.actions[f-1].args,t=h[h.length-2],x=h[h.length-1]);for(h=1;h<=b;h++)w=h/b,j=THREE.Shape.Utils.b3(w,t,u,o,k),w=THREE.Shape.Utils.b3(w,x,v,p,m),e.push(new THREE.Vector2(j,w));break;case THREE.PathActions.CSPLINE_THRU:h=this.actions[f-1].args;h=[new THREE.Vector2(h[h.length-2],h[h.length-1])];w=b*j[0].length;h=h.concat(j[0]);j=new THREE.SplineCurve(h);
+for(h=1;h<=w;h++)e.push(j.getPointAt(h/w));break;case THREE.PathActions.ARC:h=this.actions[f-1].args;k=j[0];m=j[1];o=j[2];u=j[3];w=j[4];v=!!j[5];p=h[h.length-2];t=h[h.length-1];h.length==0&&(p=t=0);x=w-u;var A=b*2;for(h=1;h<=A;h++)w=h/A,v||(w=1-w),w=u+w*x,j=p+k+o*Math.cos(w),w=t+m+o*Math.sin(w),e.push(new THREE.Vector2(j,w))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)};
+THREE.Path.prototype.nltransform=function(b,c,e,f,g,j){var h=this.getPoints(),k,m,o,p,u;k=0;for(m=h.length;k<m;k++)o=h[k],p=o.x,u=o.y,o.x=b*p+c*u+e,o.y=f*u+g*p+j;return h};
 THREE.Path.prototype.debug=function(b){var c=this.getBoundingBox();b||(b=document.createElement("canvas"),b.setAttribute("width",c.maxX+100),b.setAttribute("height",c.maxY+100),document.body.appendChild(b));c=b.getContext("2d");c.fillStyle="white";c.fillRect(0,0,b.width,b.height);c.strokeStyle="black";c.beginPath();var e,f,g,b=0;for(e=this.actions.length;b<e;b++)f=this.actions[b],g=f.args,f=f.action,f!=THREE.PathActions.CSPLINE_THRU&&c[f].apply(c,g);c.stroke();c.closePath();c.strokeStyle="red";f=
 THREE.Path.prototype.debug=function(b){var c=this.getBoundingBox();b||(b=document.createElement("canvas"),b.setAttribute("width",c.maxX+100),b.setAttribute("height",c.maxY+100),document.body.appendChild(b));c=b.getContext("2d");c.fillStyle="white";c.fillRect(0,0,b.width,b.height);c.strokeStyle="black";c.beginPath();var e,f,g,b=0;for(e=this.actions.length;b<e;b++)f=this.actions[b],g=f.args,f=f.action,f!=THREE.PathActions.CSPLINE_THRU&&c[f].apply(c,g);c.stroke();c.closePath();c.strokeStyle="red";f=
 this.getPoints();b=0;for(e=f.length;b<e;b++)g=f[b],c.beginPath(),c.arc(g.x,g.y,1.5,0,Math.PI*2,!1),c.stroke(),c.closePath()};
 this.getPoints();b=0;for(e=f.length;b<e;b++)g=f[b],c.beginPath(),c.arc(g.x,g.y,1.5,0,Math.PI*2,!1),c.stroke(),c.closePath()};
 THREE.Path.prototype.toShapes=function(){var b,c,e,f,g=[],j=new THREE.Path;b=0;for(c=this.actions.length;b<c;b++)e=this.actions[b],f=e.args,e=e.action,e==THREE.PathActions.MOVE_TO&&j.actions.length!=0&&(g.push(j),j=new THREE.Path),j[e].apply(j,f);j.actions.length!=0&&g.push(j);if(g.length==0)return[];var h,j=[];if(THREE.Shape.Utils.isClockWise(g[0].getPoints())){b=0;for(c=g.length;b<c;b++)f=g[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(h&&j.push(h),h=new THREE.Shape,h.actions=f.actions,h.curves=
 THREE.Path.prototype.toShapes=function(){var b,c,e,f,g=[],j=new THREE.Path;b=0;for(c=this.actions.length;b<c;b++)e=this.actions[b],f=e.args,e=e.action,e==THREE.PathActions.MOVE_TO&&j.actions.length!=0&&(g.push(j),j=new THREE.Path),j[e].apply(j,f);j.actions.length!=0&&g.push(j);if(g.length==0)return[];var h,j=[];if(THREE.Shape.Utils.isClockWise(g[0].getPoints())){b=0;for(c=g.length;b<c;b++)f=g[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(h&&j.push(h),h=new THREE.Shape,h.actions=f.actions,h.curves=
 f.curves):h.holes.push(f);j.push(h)}else{h=new THREE.Shape;b=0;for(c=g.length;b<c;b++)f=g[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(h.actions=f.actions,h.curves=f.curves,j.push(h),h=new THREE.Shape):h.holes.push(f)}return j};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;THREE.Shape.prototype.extrude=function(b){return new THREE.ExtrudeGeometry(this,b)};
 f.curves):h.holes.push(f);j.push(h)}else{h=new THREE.Shape;b=0;for(c=g.length;b<c;b++)f=g[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(h.actions=f.actions,h.curves=f.curves,j.push(h),h=new THREE.Shape):h.holes.push(f)}return j};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;THREE.Shape.prototype.extrude=function(b){return new THREE.ExtrudeGeometry(this,b)};
 THREE.Shape.prototype.getPointsHoles=function(b){var c,e=this.holes.length,f=[];for(c=0;c<e;c++)f[c]=this.holes[c].getTransformedPoints(b,this.bends);return f};THREE.Shape.prototype.getSpacedPointsHoles=function(b){var c,e=this.holes.length,f=[];for(c=0;c<e;c++)f[c]=this.holes[c].getTransformedSpacedPoints(b,this.bends);return f};THREE.Shape.prototype.extractAllPoints=function(b){return{shape:this.getTransformedPoints(b),holes:this.getPointsHoles(b)}};
 THREE.Shape.prototype.getPointsHoles=function(b){var c,e=this.holes.length,f=[];for(c=0;c<e;c++)f[c]=this.holes[c].getTransformedPoints(b,this.bends);return f};THREE.Shape.prototype.getSpacedPointsHoles=function(b){var c,e=this.holes.length,f=[];for(c=0;c<e;c++)f[c]=this.holes[c].getTransformedSpacedPoints(b,this.bends);return f};THREE.Shape.prototype.extractAllPoints=function(b){return{shape:this.getTransformedPoints(b),holes:this.getPointsHoles(b)}};
 THREE.Shape.prototype.extractAllSpacedPoints=function(b){return{shape:this.getTransformedSpacedPoints(b),holes:this.getSpacedPointsHoles(b)}};
 THREE.Shape.prototype.extractAllSpacedPoints=function(b){return{shape:this.getTransformedSpacedPoints(b),holes:this.getSpacedPointsHoles(b)}};
-THREE.Shape.Utils={removeHoles:function(b,c){var e=b.concat(),f=e.concat(),g,j,h,k,n,o,p,u,v,t,y=[];for(n=0;n<c.length;n++){o=c[n];f=f.concat(o);j=Number.POSITIVE_INFINITY;for(g=0;g<o.length;g++){v=o[g];t=[];for(u=0;u<e.length;u++)p=e[u],p=v.distanceToSquared(p),t.push(p),p<j&&(j=p,h=g,k=u)}g=k-1>=0?k-1:e.length-1;j=h-1>=0?h-1:o.length-1;var w=[o[h],e[k],e[g]];u=THREE.FontUtils.Triangulate.area(w);var A=[o[h],o[j],e[k]];v=THREE.FontUtils.Triangulate.area(A);t=k;p=h;k+=1;h+=-1;k<0&&(k+=e.length);k%=
-e.length;h<0&&(h+=o.length);h%=o.length;g=k-1>=0?k-1:e.length-1;j=h-1>=0?h-1:o.length-1;w=[o[h],e[k],e[g]];w=THREE.FontUtils.Triangulate.area(w);A=[o[h],o[j],e[k]];A=THREE.FontUtils.Triangulate.area(A);u+v>w+A&&(k=t,h=p,k<0&&(k+=e.length),k%=e.length,h<0&&(h+=o.length),h%=o.length,g=k-1>=0?k-1:e.length-1,j=h-1>=0?h-1:o.length-1);u=e.slice(0,k);v=e.slice(k);t=o.slice(h);p=o.slice(0,h);j=[o[h],o[j],e[k]];y.push([o[h],e[k],e[g]]);y.push(j);e=u.concat(t).concat(p).concat(v)}return{shape:e,isolatedPts:y,
-allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,g=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),j,h,k,n,o={};j=0;for(h=f.length;j<h;j++)n=f[j].x+":"+f[j].y,o[n]!==void 0&&console.log("Duplicate point",n),o[n]=j;j=0;for(h=e.length;j<h;j++){k=e[j];for(f=0;f<3;f++)n=k[f].x+":"+k[f].y,n=o[n],n!==void 0&&(k[f]=n)}j=0;for(h=g.length;j<h;j++){k=g[j];for(f=0;f<3;f++)n=k[f].x+":"+k[f].y,n=o[n],n!==void 0&&(k[f]=n)}return e.concat(g)},isClockWise:function(b){return THREE.FontUtils.Triangulate.area(b)<
+THREE.Shape.Utils={removeHoles:function(b,c){var e=b.concat(),f=e.concat(),g,j,h,k,m,o,p,u,v,t,x=[];for(m=0;m<c.length;m++){o=c[m];f=f.concat(o);j=Number.POSITIVE_INFINITY;for(g=0;g<o.length;g++){v=o[g];t=[];for(u=0;u<e.length;u++)p=e[u],p=v.distanceToSquared(p),t.push(p),p<j&&(j=p,h=g,k=u)}g=k-1>=0?k-1:e.length-1;j=h-1>=0?h-1:o.length-1;var w=[o[h],e[k],e[g]];u=THREE.FontUtils.Triangulate.area(w);var A=[o[h],o[j],e[k]];v=THREE.FontUtils.Triangulate.area(A);t=k;p=h;k+=1;h+=-1;k<0&&(k+=e.length);k%=
+e.length;h<0&&(h+=o.length);h%=o.length;g=k-1>=0?k-1:e.length-1;j=h-1>=0?h-1:o.length-1;w=[o[h],e[k],e[g]];w=THREE.FontUtils.Triangulate.area(w);A=[o[h],o[j],e[k]];A=THREE.FontUtils.Triangulate.area(A);u+v>w+A&&(k=t,h=p,k<0&&(k+=e.length),k%=e.length,h<0&&(h+=o.length),h%=o.length,g=k-1>=0?k-1:e.length-1,j=h-1>=0?h-1:o.length-1);u=e.slice(0,k);v=e.slice(k);t=o.slice(h);p=o.slice(0,h);j=[o[h],o[j],e[k]];x.push([o[h],e[k],e[g]]);x.push(j);e=u.concat(t).concat(p).concat(v)}return{shape:e,isolatedPts:x,
+allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,g=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),j,h,k,m,o={};j=0;for(h=f.length;j<h;j++)m=f[j].x+":"+f[j].y,o[m]!==void 0&&console.log("Duplicate point",m),o[m]=j;j=0;for(h=e.length;j<h;j++){k=e[j];for(f=0;f<3;f++)m=k[f].x+":"+k[f].y,m=o[m],m!==void 0&&(k[f]=m)}j=0;for(h=g.length;j<h;j++){k=g[j];for(f=0;f<3;f++)m=k[f].x+":"+k[f].y,m=o[m],m!==void 0&&(k[f]=m)}return e.concat(g)},isClockWise:function(b){return THREE.FontUtils.Triangulate.area(b)<
 0},b2p0:function(b,c){var e=1-b;return e*e*c},b2p1:function(b,c){return 2*(1-b)*b*c},b2p2:function(b,c){return b*b*c},b2:function(b,c,e,f){return this.b2p0(b,c)+this.b2p1(b,e)+this.b2p2(b,f)},b3p0:function(b,c){var e=1-b;return e*e*e*c},b3p1:function(b,c){var e=1-b;return 3*e*e*b*c},b3p2:function(b,c){return 3*(1-b)*b*b*c},b3p3:function(b,c){return b*b*b*c},b3:function(b,c,e,f,g){return this.b3p0(b,c)+this.b3p1(b,e)+this.b3p2(b,f)+this.b3p3(b,g)}};
 0},b2p0:function(b,c){var e=1-b;return e*e*c},b2p1:function(b,c){return 2*(1-b)*b*c},b2p2:function(b,c){return b*b*c},b2:function(b,c,e,f){return this.b2p0(b,c)+this.b2p1(b,e)+this.b2p2(b,f)},b3p0:function(b,c){var e=1-b;return e*e*e*c},b3p1:function(b,c){var e=1-b;return 3*e*e*b*c},b3p2:function(b,c){return 3*(1-b)*b*b*c},b3p3:function(b,c){return b*b*b*c},b3:function(b,c,e,f,g){return this.b3p0(b,c)+this.b3p1(b,e)+this.b3p2(b,f)+this.b3p3(b,g)}};
 THREE.TextPath=function(b,c){THREE.Path.call(this);this.parameters=c||{};this.set(b)};THREE.TextPath.prototype.set=function(b,c){this.text=b;var c=c||this.parameters,e=c.curveSegments!==void 0?c.curveSegments:4,f=c.font!==void 0?c.font:"helvetiker",g=c.weight!==void 0?c.weight:"normal",j=c.style!==void 0?c.style:"normal";THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=e;THREE.FontUtils.face=f;THREE.FontUtils.weight=g;THREE.FontUtils.style=j};
 THREE.TextPath=function(b,c){THREE.Path.call(this);this.parameters=c||{};this.set(b)};THREE.TextPath.prototype.set=function(b,c){this.text=b;var c=c||this.parameters,e=c.curveSegments!==void 0?c.curveSegments:4,f=c.font!==void 0?c.font:"helvetiker",g=c.weight!==void 0?c.weight:"normal",j=c.style!==void 0?c.style:"normal";THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=e;THREE.FontUtils.face=f;THREE.FontUtils.weight=g;THREE.FontUtils.style=j};
 THREE.TextPath.prototype.toShapes=function(){for(var b=THREE.FontUtils.drawText(this.text).paths,c=[],e=0,f=b.length;e<f;e++)c=c.concat(b[e].toShapes());return c};
 THREE.TextPath.prototype.toShapes=function(){for(var b=THREE.FontUtils.drawText(this.text).paths,c=[],e=0,f=b.length;e<f;e++)c=c.concat(b[e].toShapes());return c};
-THREE.CubeGeometry=function(b,c,e,f,g,j,h,k,n){function o(b,c,e,h,k,n,o,t){var u,v,w=f||1,y=g||1,S=k/2,K=n/2,Q=p.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")u="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")u="y",y=j||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")u="x",w=j||1;var m=w+1,T=y+1;k/=w;var X=n/y;for(v=0;v<T;v++)for(n=0;n<m;n++){var M=new THREE.Vector3;M[b]=(n*k-S)*e;M[c]=(v*X-K)*h;M[u]=o;p.vertices.push(new THREE.Vertex(M))}for(v=0;v<y;v++)for(n=0;n<w;n++)p.faces.push(new THREE.Face4(n+m*v+
-Q,n+m*(v+1)+Q,n+1+m*(v+1)+Q,n+1+m*v+Q,null,null,t)),p.faceVertexUvs[0].push([new THREE.UV(n/w,v/y),new THREE.UV(n/w,(v+1)/y),new THREE.UV((n+1)/w,(v+1)/y),new THREE.UV((n+1)/w,v/y)])}THREE.Geometry.call(this);var p=this,u=b/2,v=c/2,t=e/2,k=k?-1:1;if(h!==void 0)if(h instanceof Array)this.materials=h;else{this.materials=[];for(var y=0;y<6;y++)this.materials.push([h])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(n!=void 0)for(var w in n)this.sides[w]!=void 0&&(this.sides[w]=
-n[w]);this.sides.px&&o("z","y",1*k,-1,e,c,-u,this.materials[0]);this.sides.nx&&o("z","y",-1*k,-1,e,c,u,this.materials[1]);this.sides.py&&o("x","z",1*k,1,b,e,v,this.materials[2]);this.sides.ny&&o("x","z",1*k,-1,b,e,-v,this.materials[3]);this.sides.pz&&o("x","y",1*k,-1,b,c,t,this.materials[4]);this.sides.nz&&o("x","y",-1*k,-1,b,c,-t,this.materials[5]);(function(){for(var b=[],c=[],e=0,f=p.vertices.length;e<f;e++){for(var h=p.vertices[e],g=!1,j=0,k=b.length;j<k;j++){var n=b[j];if(h.position.x==n.position.x&&
-h.position.y==n.position.y&&h.position.z==n.position.z){c[e]=j;g=!0;break}}if(!g)c[e]=b.length,b.push(new THREE.Vertex(h.position.clone()))}e=0;for(f=p.faces.length;e<f;e++)h=p.faces[e],h.a=c[h.a],h.b=c[h.b],h.c=c[h.c],h.d=c[h.d];p.vertices=b})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
-THREE.CylinderGeometry=function(b,c,e,f,g,j){function h(b,c,e){k.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}THREE.Geometry.call(this);var k=this,n,o=Math.PI*2,p=f/2;for(n=0;n<b;n++)h(Math.sin(o*n/b)*c,Math.cos(o*n/b)*c,-p);for(n=0;n<b;n++)h(Math.sin(o*n/b)*e,Math.cos(o*n/b)*e,p);var u,v,t,y,w=c-e;for(n=0;n<b;n++)u=new THREE.Vector3,u.copy(k.vertices[n].position),u.z=w,u.normalize(),v=new THREE.Vector3,v.copy(k.vertices[n+b].position),v.z=w,v.normalize(),t=new THREE.Vector3,t.copy(k.vertices[b+
-(n+1)%b].position),t.z=w,t.normalize(),y=new THREE.Vector3,y.copy(k.vertices[(n+1)%b].position),y.z=w,y.normalize(),k.faces.push(new THREE.Face4(n,n+b,b+(n+1)%b,(n+1)%b,[u,v,t,y]));if(e>0){e=new THREE.Vector3(0,0,-1);h(0,0,-p-(j||0));for(n=b;n<b+b/2;n++)k.faces.push(new THREE.Face4(2*b,(2*n-2*b)%b,(2*n-2*b+1)%b,(2*n-2*b+2)%b,[e,e,e,e]))}if(c>0){c=new THREE.Vector3(0,0,1);h(0,0,p+(g||0));for(n=b+b/2;n<2*b;n++)k.faces.push(new THREE.Face4(2*b+1,(2*n-2*b+2)%b+b,(2*n-2*b+1)%b+b,(2*n-2*b)%b+b,[c,c,c,c]))}n=
-0;for(b=this.faces.length;n<b;n++)g=[],p=this.faces[n],c=this.vertices[p.a],j=this.vertices[p.b],e=this.vertices[p.c],u=this.vertices[p.d],g.push(new THREE.UV(0.5+Math.atan2(c.position.x,c.position.y)/o,0.5+c.position.z/f)),g.push(new THREE.UV(0.5+Math.atan2(j.position.x,j.position.y)/o,0.5+j.position.z/f)),g.push(new THREE.UV(0.5+Math.atan2(e.position.x,e.position.y)/o,0.5+e.position.z/f)),p instanceof THREE.Face4&&g.push(new THREE.UV(0.5+Math.atan2(u.position.x,u.position.y)/o,0.5+u.position.z/
+THREE.CubeGeometry=function(b,c,e,f,g,j,h,k,m){function o(b,c,e,h,k,m,o,t){var u,v,x=f||1,w=g||1,S=k/2,K=m/2,Q=p.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")u="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")u="y",w=j||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")u="x",x=j||1;var n=x+1,T=w+1;k/=x;var X=m/w;for(v=0;v<T;v++)for(m=0;m<n;m++){var M=new THREE.Vector3;M[b]=(m*k-S)*e;M[c]=(v*X-K)*h;M[u]=o;p.vertices.push(new THREE.Vertex(M))}for(v=0;v<w;v++)for(m=0;m<x;m++)p.faces.push(new THREE.Face4(m+n*v+
+Q,m+n*(v+1)+Q,m+1+n*(v+1)+Q,m+1+n*v+Q,null,null,t)),p.faceVertexUvs[0].push([new THREE.UV(m/x,v/w),new THREE.UV(m/x,(v+1)/w),new THREE.UV((m+1)/x,(v+1)/w),new THREE.UV((m+1)/x,v/w)])}THREE.Geometry.call(this);var p=this,u=b/2,v=c/2,t=e/2,k=k?-1:1;if(h!==void 0)if(h instanceof Array)this.materials=h;else{this.materials=[];for(var x=0;x<6;x++)this.materials.push([h])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(m!=void 0)for(var w in m)this.sides[w]!=void 0&&(this.sides[w]=
+m[w]);this.sides.px&&o("z","y",1*k,-1,e,c,-u,this.materials[0]);this.sides.nx&&o("z","y",-1*k,-1,e,c,u,this.materials[1]);this.sides.py&&o("x","z",1*k,1,b,e,v,this.materials[2]);this.sides.ny&&o("x","z",1*k,-1,b,e,-v,this.materials[3]);this.sides.pz&&o("x","y",1*k,-1,b,c,t,this.materials[4]);this.sides.nz&&o("x","y",-1*k,-1,b,c,-t,this.materials[5]);(function(){for(var b=[],c=[],e=0,f=p.vertices.length;e<f;e++){for(var h=p.vertices[e],g=!1,j=0,k=b.length;j<k;j++){var m=b[j];if(h.position.x==m.position.x&&
+h.position.y==m.position.y&&h.position.z==m.position.z){c[e]=j;g=!0;break}}if(!g)c[e]=b.length,b.push(new THREE.Vertex(h.position.clone()))}e=0;for(f=p.faces.length;e<f;e++)h=p.faces[e],h.a=c[h.a],h.b=c[h.b],h.c=c[h.c],h.d=c[h.d];p.vertices=b})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
+THREE.CylinderGeometry=function(b,c,e,f,g,j){function h(b,c,e){k.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}THREE.Geometry.call(this);var k=this,m,o=Math.PI*2,p=f/2;for(m=0;m<b;m++)h(Math.sin(o*m/b)*c,Math.cos(o*m/b)*c,-p);for(m=0;m<b;m++)h(Math.sin(o*m/b)*e,Math.cos(o*m/b)*e,p);var u,v,t,x,w=c-e;for(m=0;m<b;m++)u=new THREE.Vector3,u.copy(k.vertices[m].position),u.z=w,u.normalize(),v=new THREE.Vector3,v.copy(k.vertices[m+b].position),v.z=w,v.normalize(),t=new THREE.Vector3,t.copy(k.vertices[b+
+(m+1)%b].position),t.z=w,t.normalize(),x=new THREE.Vector3,x.copy(k.vertices[(m+1)%b].position),x.z=w,x.normalize(),k.faces.push(new THREE.Face4(m,m+b,b+(m+1)%b,(m+1)%b,[u,v,t,x]));if(e>0){e=new THREE.Vector3(0,0,-1);h(0,0,-p-(j||0));for(m=b;m<b+b/2;m++)k.faces.push(new THREE.Face4(2*b,(2*m-2*b)%b,(2*m-2*b+1)%b,(2*m-2*b+2)%b,[e,e,e,e]))}if(c>0){c=new THREE.Vector3(0,0,1);h(0,0,p+(g||0));for(m=b+b/2;m<2*b;m++)k.faces.push(new THREE.Face4(2*b+1,(2*m-2*b+2)%b+b,(2*m-2*b+1)%b+b,(2*m-2*b)%b+b,[c,c,c,c]))}m=
+0;for(b=this.faces.length;m<b;m++)g=[],p=this.faces[m],c=this.vertices[p.a],j=this.vertices[p.b],e=this.vertices[p.c],u=this.vertices[p.d],g.push(new THREE.UV(0.5+Math.atan2(c.position.x,c.position.y)/o,0.5+c.position.z/f)),g.push(new THREE.UV(0.5+Math.atan2(j.position.x,j.position.y)/o,0.5+j.position.z/f)),g.push(new THREE.UV(0.5+Math.atan2(e.position.x,e.position.y)/o,0.5+e.position.z/f)),p instanceof THREE.Face4&&g.push(new THREE.UV(0.5+Math.atan2(u.position.x,u.position.y)/o,0.5+u.position.z/
 f)),this.faceVertexUvs[0].push(g);this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.ExtrudeGeometry=function(b,c){if(typeof b!="undefined"){THREE.Geometry.call(this);var b=b instanceof Array?b:[b],e,f=b.length,g;this.shapebb=b[f-1].getBoundingBox();for(e=0;e<f;e++)g=b[e],this.addShape(g,c);this.computeCentroids();this.computeFaceNormals()}};
 f)),this.faceVertexUvs[0].push(g);this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.ExtrudeGeometry=function(b,c){if(typeof b!="undefined"){THREE.Geometry.call(this);var b=b instanceof Array?b:[b],e,f=b.length,g;this.shapebb=b[f-1].getBoundingBox();for(e=0;e<f;e++)g=b[e],this.addShape(g,c);this.computeCentroids();this.computeFaceNormals()}};
 THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
 THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
-THREE.ExtrudeGeometry.prototype.addShape=function(b,c){function e(b,c,e){c||console.log("die");return c.clone().multiplyScalar(e).addSelf(b)}function f(b,c,e){var f=THREE.ExtrudeGeometry.__v1,h=THREE.ExtrudeGeometry.__v2,g=THREE.ExtrudeGeometry.__v3,j=THREE.ExtrudeGeometry.__v4,k=THREE.ExtrudeGeometry.__v5,n=THREE.ExtrudeGeometry.__v6;f.set(b.x-c.x,b.y-c.y);h.set(b.x-e.x,b.y-e.y);f=f.normalize();h=h.normalize();g.set(-f.y,f.x);j.set(h.y,-h.x);k.copy(b).addSelf(g);n.copy(b).addSelf(j);if(k.equals(n))return j.clone();
-k.copy(c).addSelf(g);n.copy(e).addSelf(j);g=f.dot(j);j=n.subSelf(k).dot(j);g==0&&(console.log("Either infinite or no solutions!"),j==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));j/=g;if(j<0)return c=Math.atan2(c.y-b.y,c.x-b.x),b=Math.atan2(e.y-b.y,e.x-b.x),c>b&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(j).addSelf(k).subSelf(b).clone()}function g(b){for(H=b.length;--H>=0;){ga=H;$=H-1;$<0&&($=b.length-
-1);for(var c=0,e=t+p*2,c=0;c<e;c++){var f=X*c,h=X*(c+1),g=Y+ga+f,j=Y+ga+h,m=g,f=Y+$+f,h=Y+$+h,o=j;m+=V;f+=V;h+=V;o+=V;E.faces.push(new THREE.Face4(m,f,h,o,null,null,I));I&&(m=c/e,f=(c+1)/e,h=k+n*2,g=(E.vertices[g].position.z+n)/h,j=(E.vertices[j].position.z+n)/h,E.faceVertexUvs[0].push([new THREE.UV(g,m),new THREE.UV(j,m),new THREE.UV(j,f),new THREE.UV(g,f)]))}}}function j(b,c,e){E.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}function h(b,c,e){b+=V;c+=V;e+=V;E.faces.push(new THREE.Face3(b,
-c,e,null,null,D));if(D){var f=J.maxY,h=J.maxX,g=E.vertices[c].position.x,c=E.vertices[c].position.y,j=E.vertices[e].position.x,e=E.vertices[e].position.y;E.faceVertexUvs[0].push([new THREE.UV(E.vertices[b].position.x/h,E.vertices[b].position.y/f),new THREE.UV(g/h,c/f),new THREE.UV(j/h,e/f)])}}var k=c.amount!==void 0?c.amount:100,n=c.bevelThickness!==void 0?c.bevelThickness:6,o=c.bevelSize!==void 0?c.bevelSize:n-2,p=c.bevelSegments!==void 0?c.bevelSegments:3,u=c.bevelEnabled!==void 0?c.bevelEnabled:
-!0,v=c.curveSegments!==void 0?c.curveSegments:12,t=c.steps!==void 0?c.steps:1,y=c.bendPath,w=c.extrudePath,A,x=!1,G=c.useSpacedPoints!==void 0?c.useSpacedPoints:!1,D=c.material,I=c.extrudeMaterial,J=this.shapebb;if(w)A=w.getPoints(v),t=A.length,x=!0,u=!1;u||(o=n=p=0);var C,B,L,E=this,V=this.vertices.length;y&&b.addWrapPath(y);v=G?b.extractAllSpacedPoints(v):b.extractAllPoints(v);y=v.shape;v=v.holes;if(w=!THREE.Shape.Utils.isClockWise(y)){y=y.reverse();B=0;for(L=v.length;B<L;B++)C=v[B],THREE.Shape.Utils.isClockWise(C)&&
-(v[B]=C.reverse());w=!1}w=THREE.Shape.Utils.triangulateShape(y,v);G=y;B=0;for(L=v.length;B<L;B++)C=v[B],y=y.concat(C);var H,S,K,Q,m,T,X=y.length,M=w.length,W=[];H=0;S=G.length;ga=S-1;for($=H+1;H<S;H++,ga++,$++)ga==S&&(ga=0),$==S&&($=0),W[H]=f(G[H],G[ga],G[$]);var ha=[],ca,fa=W.concat();B=0;for(L=v.length;B<L;B++){C=v[B];ca=[];H=0;S=C.length;ga=S-1;for($=H+1;H<S;H++,ga++,$++)ga==S&&(ga=0),$==S&&($=0),ca[H]=f(C[H],C[ga],C[$]);ha.push(ca);fa=fa.concat(ca)}for(K=0;K<p;K++){Q=K/p;m=n*(1-Q);Q=o*Math.sin(Q*
-Math.PI/2);H=0;for(S=G.length;H<S;H++)T=e(G[H],W[H],Q),j(T.x,T.y,-m);B=0;for(L=v.length;B<L;B++){C=v[B];ca=ha[B];H=0;for(S=C.length;H<S;H++)T=e(C[H],ca[H],Q),j(T.x,T.y,-m)}}Q=o;for(H=0;H<X;H++)T=u?e(y[H],fa[H],Q):y[H],x?j(T.x,T.y+A[0].y,A[0].x):j(T.x,T.y,0);for(K=1;K<=t;K++)for(H=0;H<X;H++)T=u?e(y[H],fa[H],Q):y[H],x?j(T.x,T.y+A[K-1].y,A[K-1].x):j(T.x,T.y,k/t*K);for(K=p-1;K>=0;K--){Q=K/p;m=n*(1-Q);Q=o*Math.sin(Q*Math.PI/2);H=0;for(S=G.length;H<S;H++)T=e(G[H],W[H],Q),j(T.x,T.y,k+m);B=0;for(L=v.length;B<
-L;B++){C=v[B];ca=ha[B];H=0;for(S=C.length;H<S;H++)T=e(C[H],ca[H],Q),x?j(T.x,T.y+A[t-1].y,A[t-1].x+m):j(T.x,T.y,k+m)}}if(u){u=X*0;for(H=0;H<M;H++)o=w[H],h(o[2]+u,o[1]+u,o[0]+u);u=X*(t+p*2);for(H=0;H<M;H++)o=w[H],h(o[0]+u,o[1]+u,o[2]+u)}else{for(H=0;H<M;H++)o=w[H],h(o[2],o[1],o[0]);for(H=0;H<M;H++)o=w[H],h(o[0]+X*t,o[1]+X*t,o[2]+X*t)}var ga,$,Y=0;g(G);Y+=G.length;B=0;for(L=v.length;B<L;B++)C=v[B],g(C),Y+=C.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;
+THREE.ExtrudeGeometry.prototype.addShape=function(b,c){function e(b,c,e){c||console.log("die");return c.clone().multiplyScalar(e).addSelf(b)}function f(b,c,e){var f=THREE.ExtrudeGeometry.__v1,h=THREE.ExtrudeGeometry.__v2,g=THREE.ExtrudeGeometry.__v3,j=THREE.ExtrudeGeometry.__v4,k=THREE.ExtrudeGeometry.__v5,m=THREE.ExtrudeGeometry.__v6;f.set(b.x-c.x,b.y-c.y);h.set(b.x-e.x,b.y-e.y);f=f.normalize();h=h.normalize();g.set(-f.y,f.x);j.set(h.y,-h.x);k.copy(b).addSelf(g);m.copy(b).addSelf(j);if(k.equals(m))return j.clone();
+k.copy(c).addSelf(g);m.copy(e).addSelf(j);g=f.dot(j);j=m.subSelf(k).dot(j);g==0&&(console.log("Either infinite or no solutions!"),j==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));j/=g;if(j<0)return c=Math.atan2(c.y-b.y,c.x-b.x),b=Math.atan2(e.y-b.y,e.x-b.x),c>b&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(j).addSelf(k).subSelf(b).clone()}function g(b){for(H=b.length;--H>=0;){ga=H;$=H-1;$<0&&($=b.length-
+1);for(var c=0,e=t+p*2,c=0;c<e;c++){var f=X*c,h=X*(c+1),g=Y+ga+f,j=Y+ga+h,n=g,f=Y+$+f,h=Y+$+h,o=j;n+=V;f+=V;h+=V;o+=V;E.faces.push(new THREE.Face4(n,f,h,o,null,null,I));I&&(n=c/e,f=(c+1)/e,h=k+m*2,g=(E.vertices[g].position.z+m)/h,j=(E.vertices[j].position.z+m)/h,E.faceVertexUvs[0].push([new THREE.UV(g,n),new THREE.UV(j,n),new THREE.UV(j,f),new THREE.UV(g,f)]))}}}function j(b,c,e){E.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}function h(b,c,e){b+=V;c+=V;e+=V;E.faces.push(new THREE.Face3(b,
+c,e,null,null,D));if(D){var f=J.maxY,h=J.maxX,g=E.vertices[c].position.x,c=E.vertices[c].position.y,j=E.vertices[e].position.x,e=E.vertices[e].position.y;E.faceVertexUvs[0].push([new THREE.UV(E.vertices[b].position.x/h,E.vertices[b].position.y/f),new THREE.UV(g/h,c/f),new THREE.UV(j/h,e/f)])}}var k=c.amount!==void 0?c.amount:100,m=c.bevelThickness!==void 0?c.bevelThickness:6,o=c.bevelSize!==void 0?c.bevelSize:m-2,p=c.bevelSegments!==void 0?c.bevelSegments:3,u=c.bevelEnabled!==void 0?c.bevelEnabled:
+!0,v=c.curveSegments!==void 0?c.curveSegments:12,t=c.steps!==void 0?c.steps:1,x=c.bendPath,w=c.extrudePath,A,y=!1,G=c.useSpacedPoints!==void 0?c.useSpacedPoints:!1,D=c.material,I=c.extrudeMaterial,J=this.shapebb;if(w)A=w.getPoints(v),t=A.length,y=!0,u=!1;u||(o=m=p=0);var C,B,L,E=this,V=this.vertices.length;x&&b.addWrapPath(x);v=G?b.extractAllSpacedPoints(v):b.extractAllPoints(v);x=v.shape;v=v.holes;if(w=!THREE.Shape.Utils.isClockWise(x)){x=x.reverse();B=0;for(L=v.length;B<L;B++)C=v[B],THREE.Shape.Utils.isClockWise(C)&&
+(v[B]=C.reverse());w=!1}w=THREE.Shape.Utils.triangulateShape(x,v);G=x;B=0;for(L=v.length;B<L;B++)C=v[B],x=x.concat(C);var H,S,K,Q,n,T,X=x.length,M=w.length,W=[];H=0;S=G.length;ga=S-1;for($=H+1;H<S;H++,ga++,$++)ga==S&&(ga=0),$==S&&($=0),W[H]=f(G[H],G[ga],G[$]);var ha=[],ca,fa=W.concat();B=0;for(L=v.length;B<L;B++){C=v[B];ca=[];H=0;S=C.length;ga=S-1;for($=H+1;H<S;H++,ga++,$++)ga==S&&(ga=0),$==S&&($=0),ca[H]=f(C[H],C[ga],C[$]);ha.push(ca);fa=fa.concat(ca)}for(K=0;K<p;K++){Q=K/p;n=m*(1-Q);Q=o*Math.sin(Q*
+Math.PI/2);H=0;for(S=G.length;H<S;H++)T=e(G[H],W[H],Q),j(T.x,T.y,-n);B=0;for(L=v.length;B<L;B++){C=v[B];ca=ha[B];H=0;for(S=C.length;H<S;H++)T=e(C[H],ca[H],Q),j(T.x,T.y,-n)}}Q=o;for(H=0;H<X;H++)T=u?e(x[H],fa[H],Q):x[H],y?j(T.x,T.y+A[0].y,A[0].x):j(T.x,T.y,0);for(K=1;K<=t;K++)for(H=0;H<X;H++)T=u?e(x[H],fa[H],Q):x[H],y?j(T.x,T.y+A[K-1].y,A[K-1].x):j(T.x,T.y,k/t*K);for(K=p-1;K>=0;K--){Q=K/p;n=m*(1-Q);Q=o*Math.sin(Q*Math.PI/2);H=0;for(S=G.length;H<S;H++)T=e(G[H],W[H],Q),j(T.x,T.y,k+n);B=0;for(L=v.length;B<
+L;B++){C=v[B];ca=ha[B];H=0;for(S=C.length;H<S;H++)T=e(C[H],ca[H],Q),y?j(T.x,T.y+A[t-1].y,A[t-1].x+n):j(T.x,T.y,k+n)}}if(u){u=X*0;for(H=0;H<M;H++)o=w[H],h(o[2]+u,o[1]+u,o[0]+u);u=X*(t+p*2);for(H=0;H<M;H++)o=w[H],h(o[0]+u,o[1]+u,o[2]+u)}else{for(H=0;H<M;H++)o=w[H],h(o[2],o[1],o[0]);for(H=0;H<M;H++)o=w[H],h(o[0]+X*t,o[1]+X*t,o[2]+X*t)}var ga,$,Y=0;g(G);Y+=G.length;B=0;for(L=v.length;B<L;B++)C=v[B],g(C),Y+=C.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
 THREE.IcosahedronGeometry=function(b){function c(b,c,e){var f=Math.sqrt(b*b+c*c+e*e);return g.vertices.push(new THREE.Vertex(new THREE.Vector3(b/f,c/f,e/f)))-1}function e(b,c,e,f){f.faces.push(new THREE.Face3(b,c,e))}function f(b,e){var f=g.vertices[b].position,h=g.vertices[e].position;return c((f.x+h.x)/2,(f.y+h.y)/2,(f.z+h.z)/2)}var g=this,j=new THREE.Geometry;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;c(-1,b,0);c(1,b,0);c(-1,-b,0);c(1,-b,0);c(0,-1,b);c(0,1,b);c(0,-1,
 THREE.IcosahedronGeometry=function(b){function c(b,c,e){var f=Math.sqrt(b*b+c*c+e*e);return g.vertices.push(new THREE.Vertex(new THREE.Vector3(b/f,c/f,e/f)))-1}function e(b,c,e,f){f.faces.push(new THREE.Face3(b,c,e))}function f(b,e){var f=g.vertices[b].position,h=g.vertices[e].position;return c((f.x+h.x)/2,(f.y+h.y)/2,(f.z+h.z)/2)}var g=this,j=new THREE.Geometry;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;c(-1,b,0);c(1,b,0);c(-1,-b,0);c(1,-b,0);c(0,-1,b);c(0,1,b);c(0,-1,
--b);c(0,1,-b);c(b,0,-1);c(b,0,1);c(-b,0,-1);c(-b,0,1);e(0,11,5,j);e(0,5,1,j);e(0,1,7,j);e(0,7,10,j);e(0,10,11,j);e(1,5,9,j);e(5,11,4,j);e(11,10,2,j);e(10,7,6,j);e(7,1,8,j);e(3,9,4,j);e(3,4,2,j);e(3,2,6,j);e(3,6,8,j);e(3,8,9,j);e(4,9,5,j);e(2,4,11,j);e(6,2,10,j);e(8,6,7,j);e(9,8,1,j);for(var h=0;h<this.subdivisions;h++){var b=new THREE.Geometry,k;for(k in j.faces){var n=f(j.faces[k].a,j.faces[k].b),o=f(j.faces[k].b,j.faces[k].c),p=f(j.faces[k].c,j.faces[k].a);e(j.faces[k].a,n,p,b);e(j.faces[k].b,o,
-n,b);e(j.faces[k].c,p,o,b);e(n,o,p,b)}j.faces=b.faces}g.faces=j.faces;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
-THREE.LatheGeometry=function(b,c,e){THREE.Geometry.call(this);this.steps=c||12;this.angle=e||2*Math.PI;for(var c=this.angle/this.steps,e=[],f=[],g=[],j=[],h=(new THREE.Matrix4).setRotationZ(c),k=0;k<b.length;k++)this.vertices.push(new THREE.Vertex(b[k])),e[k]=b[k].clone(),f[k]=this.vertices.length-1;for(var n=0;n<=this.angle+0.0010;n+=c){for(k=0;k<e.length;k++)n<this.angle?(e[k]=h.multiplyVector3(e[k].clone()),this.vertices.push(new THREE.Vertex(e[k])),g[k]=this.vertices.length-1):g=j;n==0&&(j=f);
-for(k=0;k<f.length-1;k++)this.faces.push(new THREE.Face4(g[k],g[k+1],f[k+1],f[k])),this.faceVertexUvs[0].push([new THREE.UV(1-n/this.angle,k/b.length),new THREE.UV(1-n/this.angle,(k+1)/b.length),new THREE.UV(1-(n-c)/this.angle,(k+1)/b.length),new THREE.UV(1-(n-c)/this.angle,k/b.length)]);f=g;g=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
-THREE.PlaneGeometry=function(b,c,e,f){THREE.Geometry.call(this);var g,j=b/2,h=c/2,e=e||1,f=f||1,k=e+1,n=f+1;b/=e;var o=c/f;for(g=0;g<n;g++)for(c=0;c<k;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-j,-(g*o-h),0)));for(g=0;g<f;g++)for(c=0;c<e;c++)this.faces.push(new THREE.Face4(c+k*g,c+k*(g+1),c+1+k*(g+1),c+1+k*g)),this.faceVertexUvs[0].push([new THREE.UV(c/e,g/f),new THREE.UV(c/e,(g+1)/f),new THREE.UV((c+1)/e,(g+1)/f),new THREE.UV((c+1)/e,g/f)]);this.computeCentroids();this.computeFaceNormals()};
+-b);c(0,1,-b);c(b,0,-1);c(b,0,1);c(-b,0,-1);c(-b,0,1);e(0,11,5,j);e(0,5,1,j);e(0,1,7,j);e(0,7,10,j);e(0,10,11,j);e(1,5,9,j);e(5,11,4,j);e(11,10,2,j);e(10,7,6,j);e(7,1,8,j);e(3,9,4,j);e(3,4,2,j);e(3,2,6,j);e(3,6,8,j);e(3,8,9,j);e(4,9,5,j);e(2,4,11,j);e(6,2,10,j);e(8,6,7,j);e(9,8,1,j);for(var h=0;h<this.subdivisions;h++){var b=new THREE.Geometry,k;for(k in j.faces){var m=f(j.faces[k].a,j.faces[k].b),o=f(j.faces[k].b,j.faces[k].c),p=f(j.faces[k].c,j.faces[k].a);e(j.faces[k].a,m,p,b);e(j.faces[k].b,o,
+m,b);e(j.faces[k].c,p,o,b);e(m,o,p,b)}j.faces=b.faces}g.faces=j.faces;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
+THREE.LatheGeometry=function(b,c,e){THREE.Geometry.call(this);this.steps=c||12;this.angle=e||2*Math.PI;for(var c=this.angle/this.steps,e=[],f=[],g=[],j=[],h=(new THREE.Matrix4).setRotationZ(c),k=0;k<b.length;k++)this.vertices.push(new THREE.Vertex(b[k])),e[k]=b[k].clone(),f[k]=this.vertices.length-1;for(var m=0;m<=this.angle+0.0010;m+=c){for(k=0;k<e.length;k++)m<this.angle?(e[k]=h.multiplyVector3(e[k].clone()),this.vertices.push(new THREE.Vertex(e[k])),g[k]=this.vertices.length-1):g=j;m==0&&(j=f);
+for(k=0;k<f.length-1;k++)this.faces.push(new THREE.Face4(g[k],g[k+1],f[k+1],f[k])),this.faceVertexUvs[0].push([new THREE.UV(1-m/this.angle,k/b.length),new THREE.UV(1-m/this.angle,(k+1)/b.length),new THREE.UV(1-(m-c)/this.angle,(k+1)/b.length),new THREE.UV(1-(m-c)/this.angle,k/b.length)]);f=g;g=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.PlaneGeometry=function(b,c,e,f){THREE.Geometry.call(this);var g,j=b/2,h=c/2,e=e||1,f=f||1,k=e+1,m=f+1;b/=e;var o=c/f;for(g=0;g<m;g++)for(c=0;c<k;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-j,-(g*o-h),0)));for(g=0;g<f;g++)for(c=0;c<e;c++)this.faces.push(new THREE.Face4(c+k*g,c+k*(g+1),c+1+k*(g+1),c+1+k*g)),this.faceVertexUvs[0].push([new THREE.UV(c/e,g/f),new THREE.UV(c/e,(g+1)/f),new THREE.UV((c+1)/e,(g+1)/f),new THREE.UV((c+1)/e,g/f)]);this.computeCentroids();this.computeFaceNormals()};
 THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
 THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f,g=Math.PI,j=Math.max(3,c||8),h=Math.max(2,e||6),c=[],e=0;e<h+1;e++){f=e/h;var k=b*Math.cos(f*g),n=b*Math.sin(f*g),o=[],p=0;for(f=0;f<j;f++){var u=2*f/j,v=n*Math.sin(u*g),u=n*Math.cos(u*g);(e==0||e==h)&&f>0||(p=this.vertices.push(new THREE.Vertex(new THREE.Vector3(u,k,v)))-1);o.push(p)}c.push(o)}for(var t,y,w,g=c.length,e=0;e<g;e++)if(j=c[e].length,e>0)for(f=0;f<j;f++){o=f==j-1;h=c[e][o?0:f+1];k=c[e][o?j-1:f];n=c[e-1][o?
-j-1:f];o=c[e-1][o?0:f+1];v=e/(g-1);t=(e-1)/(g-1);y=(f+1)/j;var u=f/j,p=new THREE.UV(1-y,v),v=new THREE.UV(1-u,v),u=new THREE.UV(1-u,t),A=new THREE.UV(1-y,t);e<c.length-1&&(t=this.vertices[h].position.clone(),y=this.vertices[k].position.clone(),w=this.vertices[n].position.clone(),t.normalize(),y.normalize(),w.normalize(),this.faces.push(new THREE.Face3(h,k,n,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(w.x,w.y,w.z)])),this.faceVertexUvs[0].push([p,v,u]));e>1&&(t=
-this.vertices[h].position.clone(),y=this.vertices[n].position.clone(),w=this.vertices[o].position.clone(),t.normalize(),y.normalize(),w.normalize(),this.faces.push(new THREE.Face3(h,n,o,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(w.x,w.y,w.z)])),this.faceVertexUvs[0].push([p,u,A]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;
+THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f,g=Math.PI,j=Math.max(3,c||8),h=Math.max(2,e||6),c=[],e=0;e<h+1;e++){f=e/h;var k=b*Math.cos(f*g),m=b*Math.sin(f*g),o=[],p=0;for(f=0;f<j;f++){var u=2*f/j,v=m*Math.sin(u*g),u=m*Math.cos(u*g);(e==0||e==h)&&f>0||(p=this.vertices.push(new THREE.Vertex(new THREE.Vector3(u,k,v)))-1);o.push(p)}c.push(o)}for(var t,x,w,g=c.length,e=0;e<g;e++)if(j=c[e].length,e>0)for(f=0;f<j;f++){o=f==j-1;h=c[e][o?0:f+1];k=c[e][o?j-1:f];m=c[e-1][o?
+j-1:f];o=c[e-1][o?0:f+1];v=e/(g-1);t=(e-1)/(g-1);x=(f+1)/j;var u=f/j,p=new THREE.UV(1-x,v),v=new THREE.UV(1-u,v),u=new THREE.UV(1-u,t),A=new THREE.UV(1-x,t);e<c.length-1&&(t=this.vertices[h].position.clone(),x=this.vertices[k].position.clone(),w=this.vertices[m].position.clone(),t.normalize(),x.normalize(),w.normalize(),this.faces.push(new THREE.Face3(h,k,m,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(x.x,x.y,x.z),new THREE.Vector3(w.x,w.y,w.z)])),this.faceVertexUvs[0].push([p,v,u]));e>1&&(t=
+this.vertices[h].position.clone(),x=this.vertices[m].position.clone(),w=this.vertices[o].position.clone(),t.normalize(),x.normalize(),w.normalize(),this.faces.push(new THREE.Face3(h,m,o,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(x.x,x.y,x.z),new THREE.Vector3(w.x,w.y,w.z)])),this.faceVertexUvs[0].push([p,u,A]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;
 THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 THREE.TextGeometry=function(b,c){var e=(new THREE.TextPath(b,c)).toShapes();c.amount=c.height!==void 0?c.height:50;if(c.bevelThickness===void 0)c.bevelThickness=10;if(c.bevelSize===void 0)c.bevelSize=8;if(c.bevelEnabled===void 0)c.bevelEnabled=!1;if(c.bend){var f=e[e.length-1].getBoundingBox().maxX;c.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(f/2,120),new THREE.Vector2(f,0))}THREE.ExtrudeGeometry.call(this,e,c)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
 THREE.TextGeometry=function(b,c){var e=(new THREE.TextPath(b,c)).toShapes();c.amount=c.height!==void 0?c.height:50;if(c.bevelThickness===void 0)c.bevelThickness=10;if(c.bevelSize===void 0)c.bevelSize=8;if(c.bevelEnabled===void 0)c.bevelEnabled=!1;if(c.bend){var f=e[e.length-1].getBoundingBox().maxX;c.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(f/2,120),new THREE.Vector2(f,0))}THREE.ExtrudeGeometry.call(this,e,c)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(b,c){return(new TextPath(b,c)).toShapes()},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var c=
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(b,c){return(new TextPath(b,c)).toShapes()},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var c=
-this.getFace(),e=this.size/c.resolution,f=0,g=String(b).split(""),j=g.length,h=[],b=0;b<j;b++){var k=new THREE.Path,k=this.extractGlyphPoints(g[b],c,e,f,k);f+=k.offset;h.push(k.path)}return{paths:h,offset:f/2}},extractGlyphPoints:function(b,c,e,f,g){var j=[],h,k,n,o,p,u,v,t,y,w,A=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(A){if(A.o){c=A._cachedOutline||(A._cachedOutline=A.o.split(" "));n=c.length;for(b=0;b<n;)switch(k=c[b++],k){case "m":k=c[b++]*e+f;o=c[b++]*e;j.push(new THREE.Vector2(k,
-o));g.moveTo(k,o);break;case "l":k=c[b++]*e+f;o=c[b++]*e;j.push(new THREE.Vector2(k,o));g.lineTo(k,o);break;case "q":k=c[b++]*e+f;o=c[b++]*e;v=c[b++]*e+f;t=c[b++]*e;g.quadraticCurveTo(v,t,k,o);if(h=j[j.length-1]){p=h.x;u=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++){var x=h/divisions,G=THREE.Shape.Utils.b2(x,p,v,k),x=THREE.Shape.Utils.b2(x,u,t,o);j.push(new THREE.Vector2(G,x))}}break;case "b":if(k=c[b++]*e+f,o=c[b++]*e,v=c[b++]*e+f,t=c[b++]*-e,y=c[b++]*e+f,w=c[b++]*-e,g.bezierCurveTo(k,o,
-v,t,y,w),h=j[j.length-1]){p=h.x;u=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++)x=h/divisions,G=THREE.Shape.Utils.b3(x,p,v,y,k),x=THREE.Shape.Utils.b3(x,u,t,w,o),j.push(new THREE.Vector2(G,x))}}}return{offset:A.ha*e,points:j,path:g}}}};
-(function(b){var c=function(b){for(var c=b.length,g=0,j=c-1,h=0;h<c;j=h++)g+=b[j].x*b[h].y-b[h].x*b[j].y;return g*0.5};b.Triangulate=function(b,f){var g=b.length;if(g<3)return null;var j=[],h=[],k=[],n,o,p;if(c(b)>0)for(o=0;o<g;o++)h[o]=o;else for(o=0;o<g;o++)h[o]=g-1-o;var u=2*g;for(o=g-1;g>2;){if(u--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return k;return j}n=o;g<=n&&(n=0);o=n+1;g<=o&&(o=0);p=o+1;g<=p&&(p=0);var v;a:{v=b;var t=n,y=o,w=p,A=g,x=h,G=void 0,D=void 0,I=void 0,
-J=void 0,C=void 0,B=void 0,L=void 0,E=void 0,V=void 0,D=v[x[t]].x,I=v[x[t]].y,J=v[x[y]].x,C=v[x[y]].y,B=v[x[w]].x,L=v[x[w]].y;if(1.0E-10>(J-D)*(L-I)-(C-I)*(B-D))v=!1;else{for(G=0;G<A;G++)if(!(G==t||G==y||G==w)){var E=v[x[G]].x,V=v[x[G]].y,H=void 0,S=void 0,K=void 0,Q=void 0,m=void 0,T=void 0,X=void 0,M=void 0,W=void 0,ha=void 0,ca=void 0,fa=void 0,H=K=m=void 0,H=B-J,S=L-C,K=D-B,Q=I-L,m=J-D,T=C-I,X=E-D,M=V-I,W=E-J,ha=V-C,ca=E-B,fa=V-L,H=H*ha-S*W,m=m*M-T*X,K=K*fa-Q*ca;if(H>=0&&K>=0&&m>=0){v=!1;break a}}v=
-!0}}if(v){j.push([b[h[n]],b[h[o]],b[h[p]]]);k.push([h[n],h[o],h[p]]);n=o;for(p=o+1;p<g;n++,p++)h[n]=h[p];g--;u=2*g}}if(f)return k;return j};b.Triangulate.area=c;return b})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
-THREE.TorusGeometry=function(b,c,e,f,g){THREE.Geometry.call(this);this.radius=b||100;this.tube=c||40;this.segmentsR=e||8;this.segmentsT=f||6;this.arc=g||2*Math.PI;b=[];for(c=0;c<=this.segmentsR;++c)for(e=0;e<=this.segmentsT;++e)f=e/this.segmentsT*this.arc,g=c/this.segmentsR*2*Math.PI,this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(g))*Math.cos(f),(this.radius+this.tube*Math.cos(g))*Math.sin(f),this.tube*Math.sin(g)))),b.push([e/this.segmentsT,1-c/this.segmentsR]);
-for(c=1;c<=this.segmentsR;++c)for(e=1;e<=this.segmentsT;++e){var f=(this.segmentsT+1)*c+e,g=(this.segmentsT+1)*c+e-1,j=(this.segmentsT+1)*(c-1)+e-1,h=(this.segmentsT+1)*(c-1)+e;this.faces.push(new THREE.Face4(f,g,j,h));this.faceVertexUvs[0].push([new THREE.UV(b[f][0],b[f][1]),new THREE.UV(b[g][0],b[g][1]),new THREE.UV(b[j][0],b[j][1]),new THREE.UV(b[h][0],b[h][1])])}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusGeometry.prototype=new THREE.Geometry;
-THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
+this.getFace(),e=this.size/c.resolution,f=0,g=String(b).split(""),j=g.length,h=[],b=0;b<j;b++){var k=new THREE.Path,k=this.extractGlyphPoints(g[b],c,e,f,k);f+=k.offset;h.push(k.path)}return{paths:h,offset:f/2}},extractGlyphPoints:function(b,c,e,f,g){var j=[],h,k,m,o,p,u,v,t,x,w,A=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(A){if(A.o){c=A._cachedOutline||(A._cachedOutline=A.o.split(" "));m=c.length;for(b=0;b<m;)switch(k=c[b++],k){case "m":k=c[b++]*e+f;o=c[b++]*e;j.push(new THREE.Vector2(k,
+o));g.moveTo(k,o);break;case "l":k=c[b++]*e+f;o=c[b++]*e;j.push(new THREE.Vector2(k,o));g.lineTo(k,o);break;case "q":k=c[b++]*e+f;o=c[b++]*e;v=c[b++]*e+f;t=c[b++]*e;g.quadraticCurveTo(v,t,k,o);if(h=j[j.length-1]){p=h.x;u=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++){var y=h/divisions,G=THREE.Shape.Utils.b2(y,p,v,k),y=THREE.Shape.Utils.b2(y,u,t,o);j.push(new THREE.Vector2(G,y))}}break;case "b":if(k=c[b++]*e+f,o=c[b++]*e,v=c[b++]*e+f,t=c[b++]*-e,x=c[b++]*e+f,w=c[b++]*-e,g.bezierCurveTo(k,o,
+v,t,x,w),h=j[j.length-1]){p=h.x;u=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++)y=h/divisions,G=THREE.Shape.Utils.b3(y,p,v,x,k),y=THREE.Shape.Utils.b3(y,u,t,w,o),j.push(new THREE.Vector2(G,y))}}}return{offset:A.ha*e,points:j,path:g}}}};
+(function(b){var c=function(b){for(var c=b.length,g=0,j=c-1,h=0;h<c;j=h++)g+=b[j].x*b[h].y-b[h].x*b[j].y;return g*0.5};b.Triangulate=function(b,f){var g=b.length;if(g<3)return null;var j=[],h=[],k=[],m,o,p;if(c(b)>0)for(o=0;o<g;o++)h[o]=o;else for(o=0;o<g;o++)h[o]=g-1-o;var u=2*g;for(o=g-1;g>2;){if(u--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return k;return j}m=o;g<=m&&(m=0);o=m+1;g<=o&&(o=0);p=o+1;g<=p&&(p=0);var v;a:{v=b;var t=m,x=o,w=p,A=g,y=h,G=void 0,D=void 0,I=void 0,
+J=void 0,C=void 0,B=void 0,L=void 0,E=void 0,V=void 0,D=v[y[t]].x,I=v[y[t]].y,J=v[y[x]].x,C=v[y[x]].y,B=v[y[w]].x,L=v[y[w]].y;if(1.0E-10>(J-D)*(L-I)-(C-I)*(B-D))v=!1;else{for(G=0;G<A;G++)if(!(G==t||G==x||G==w)){var E=v[y[G]].x,V=v[y[G]].y,H=void 0,S=void 0,K=void 0,Q=void 0,n=void 0,T=void 0,X=void 0,M=void 0,W=void 0,ha=void 0,ca=void 0,fa=void 0,H=K=n=void 0,H=B-J,S=L-C,K=D-B,Q=I-L,n=J-D,T=C-I,X=E-D,M=V-I,W=E-J,ha=V-C,ca=E-B,fa=V-L,H=H*ha-S*W,n=n*M-T*X,K=K*fa-Q*ca;if(H>=0&&K>=0&&n>=0){v=!1;break a}}v=
+!0}}if(v){j.push([b[h[m]],b[h[o]],b[h[p]]]);k.push([h[m],h[o],h[p]]);m=o;for(p=o+1;p<g;m++,p++)h[m]=h[p];g--;u=2*g}}if(f)return k;return j};b.Triangulate.area=c;return b})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
+THREE.TorusGeometry=function(b,c,e,f,g){THREE.Geometry.call(this);this.radius=b||100;this.tube=c||40;this.segmentsR=e||8;this.segmentsT=f||6;this.arc=g||Math.PI*2;g=new THREE.Vector3;b=[];c=[];for(e=0;e<=this.segmentsR;e++)for(f=0;f<=this.segmentsT;f++){var j=f/this.segmentsT*this.arc,h=e/this.segmentsR*Math.PI*2;g.x=this.radius*Math.cos(j);g.y=this.radius*Math.sin(j);var k=new THREE.Vector3;k.x=(this.radius+this.tube*Math.cos(h))*Math.cos(j);k.y=(this.radius+this.tube*Math.cos(h))*Math.sin(j);k.z=
+this.tube*Math.sin(h);this.vertices.push(new THREE.Vertex(k));b.push(new THREE.UV(f/this.segmentsT,1-e/this.segmentsR));c.push(k.clone().subSelf(g).normalize())}for(e=1;e<=this.segmentsR;e++)for(f=1;f<=this.segmentsT;f++){var g=(this.segmentsT+1)*e+f-1,j=(this.segmentsT+1)*(e-1)+f-1,h=(this.segmentsT+1)*(e-1)+f,k=(this.segmentsT+1)*e+f,m=new THREE.Face4(g,j,h,k,[c[g],c[j],c[h],c[k]]);m.normal.addSelf(c[g]);m.normal.addSelf(c[j]);m.normal.addSelf(c[h]);m.normal.addSelf(c[k]);m.normal.normalize();this.faces.push(m);
+this.faceVertexUvs[0].push([b[g].clone(),b[j].clone(),b[h].clone(),b[k].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
 THREE.TorusKnotGeometry=function(b,c,e,f,g,j,h){function k(b,c,e,f,h,g){c=e/f*b;e=Math.cos(c);return new THREE.Vector3(h*(2+e)*0.5*Math.cos(b),h*(2+e)*Math.sin(b)*0.5,g*h*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=b||200;this.tube=c||40;this.segmentsR=e||64;this.segmentsT=f||8;this.p=g||2;this.q=j||3;this.heightScale=h||1;this.grid=Array(this.segmentsR);e=new THREE.Vector3;f=new THREE.Vector3;j=new THREE.Vector3;for(b=0;b<this.segmentsR;++b){this.grid[b]=Array(this.segmentsT);for(c=0;c<
 THREE.TorusKnotGeometry=function(b,c,e,f,g,j,h){function k(b,c,e,f,h,g){c=e/f*b;e=Math.cos(c);return new THREE.Vector3(h*(2+e)*0.5*Math.cos(b),h*(2+e)*Math.sin(b)*0.5,g*h*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=b||200;this.tube=c||40;this.segmentsR=e||64;this.segmentsT=f||8;this.p=g||2;this.q=j||3;this.heightScale=h||1;this.grid=Array(this.segmentsR);e=new THREE.Vector3;f=new THREE.Vector3;j=new THREE.Vector3;for(b=0;b<this.segmentsR;++b){this.grid[b]=Array(this.segmentsT);for(c=0;c<
-this.segmentsT;++c){var n=b/this.segmentsR*2*this.p*Math.PI,h=c/this.segmentsT*2*Math.PI,g=k(n,h,this.q,this.p,this.radius,this.heightScale),n=k(n+0.01,h,this.q,this.p,this.radius,this.heightScale);e.x=n.x-g.x;e.y=n.y-g.y;e.z=n.z-g.z;f.x=n.x+g.x;f.y=n.y+g.y;f.z=n.z+g.z;j.cross(e,f);f.cross(j,e);j.normalize();f.normalize();n=-this.tube*Math.cos(h);h=this.tube*Math.sin(h);g.x+=n*f.x+h*j.x;g.y+=n*f.y+h*j.y;g.z+=n*f.z+h*j.z;this.grid[b][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(g.x,g.y,
-g.z)))-1}}for(b=0;b<this.segmentsR;++b)for(c=0;c<this.segmentsT;++c){var f=(b+1)%this.segmentsR,j=(c+1)%this.segmentsT,g=this.grid[b][c],e=this.grid[f][c],f=this.grid[f][j],j=this.grid[b][j],h=new THREE.UV(b/this.segmentsR,c/this.segmentsT),n=new THREE.UV((b+1)/this.segmentsR,c/this.segmentsT),o=new THREE.UV((b+1)/this.segmentsR,(c+1)/this.segmentsT),p=new THREE.UV(b/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(g,e,f,j));this.faceVertexUvs[0].push([h,n,o,p])}this.computeCentroids();
+this.segmentsT;++c){var m=b/this.segmentsR*2*this.p*Math.PI,h=c/this.segmentsT*2*Math.PI,g=k(m,h,this.q,this.p,this.radius,this.heightScale),m=k(m+0.01,h,this.q,this.p,this.radius,this.heightScale);e.x=m.x-g.x;e.y=m.y-g.y;e.z=m.z-g.z;f.x=m.x+g.x;f.y=m.y+g.y;f.z=m.z+g.z;j.cross(e,f);f.cross(j,e);j.normalize();f.normalize();m=-this.tube*Math.cos(h);h=this.tube*Math.sin(h);g.x+=m*f.x+h*j.x;g.y+=m*f.y+h*j.y;g.z+=m*f.z+h*j.z;this.grid[b][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(g.x,g.y,
+g.z)))-1}}for(b=0;b<this.segmentsR;++b)for(c=0;c<this.segmentsT;++c){var f=(b+1)%this.segmentsR,j=(c+1)%this.segmentsT,g=this.grid[b][c],e=this.grid[f][c],f=this.grid[f][j],j=this.grid[b][j],h=new THREE.UV(b/this.segmentsR,c/this.segmentsT),m=new THREE.UV((b+1)/this.segmentsR,c/this.segmentsT),o=new THREE.UV((b+1)/this.segmentsR,(c+1)/this.segmentsT),p=new THREE.UV(b/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(g,e,f,j));this.faceVertexUvs[0].push([h,m,o,p])}this.computeCentroids();
 this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;THREE.Loader=function(b){this.statusDomElement=(this.showStatus=b)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;THREE.Loader=function(b){this.statusDomElement=(this.showStatus=b)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={addStatusElement:function(){var b=document.createElement("div");b.style.position="absolute";b.style.right="0px";b.style.top="0px";b.style.fontSize="0.8em";b.style.textAlign="left";b.style.background="rgba(0,0,0,0.25)";b.style.color="#fff";b.style.width="120px";b.style.padding="0.5em 0.5em 0.5em 0.5em";b.style.zIndex=1E3;b.innerHTML="Loading ...";return b},updateProgress:function(b){var c="Loaded ";c+=b.total?(100*b.loaded/b.total).toFixed(0)+"%":(b.loaded/1E3).toFixed(2)+" KB";
 THREE.Loader.prototype={addStatusElement:function(){var b=document.createElement("div");b.style.position="absolute";b.style.right="0px";b.style.top="0px";b.style.fontSize="0.8em";b.style.textAlign="left";b.style.background="rgba(0,0,0,0.25)";b.style.color="#fff";b.style.width="120px";b.style.padding="0.5em 0.5em 0.5em 0.5em";b.style.zIndex=1E3;b.innerHTML="Loading ...";return b},updateProgress:function(b){var c="Loaded ";c+=b.total?(100*b.loaded/b.total).toFixed(0)+"%":(b.loaded/1E3).toFixed(2)+" KB";
 this.statusDomElement.innerHTML=c},extractUrlbase:function(b){b=b.split("/");b.pop();return b.join("/")},init_materials:function(b,c,e){b.materials=[];for(var f=0;f<c.length;++f)b.materials[f]=[THREE.Loader.prototype.createMaterial(c[f],e)]},hasNormals:function(b){var c,e,f=b.materials.length;for(e=0;e<f;e++)if(c=b.materials[e][0],c instanceof THREE.MeshShaderMaterial)return!0;return!1},createMaterial:function(b,c){function e(b){b=Math.log(b)/Math.LN2;return Math.floor(b)==b}function f(b,c){var f=
 this.statusDomElement.innerHTML=c},extractUrlbase:function(b){b=b.split("/");b.pop();return b.join("/")},init_materials:function(b,c,e){b.materials=[];for(var f=0;f<c.length;++f)b.materials[f]=[THREE.Loader.prototype.createMaterial(c[f],e)]},hasNormals:function(b){var c,e,f=b.materials.length;for(e=0;e<f;e++)if(c=b.materials[e][0],c instanceof THREE.MeshShaderMaterial)return!0;return!1},createMaterial:function(b,c){function e(b){b=Math.log(b)/Math.LN2;return Math.floor(b)==b}function f(b,c){var f=
-new Image;f.onload=function(){if(!e(this.width)||!e(this.height)){var c=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),f=Math.pow(2,Math.round(Math.log(this.height)/Math.LN2));b.image.width=c;b.image.height=f;b.image.getContext("2d").drawImage(this,0,0,c,f)}else b.image=this;b.needsUpdate=!0};f.src=c}function g(b,e,h,g,j,k){var n=document.createElement("canvas");b[e]=new THREE.Texture(n);b[e].sourceFile=h;if(g){b[e].repeat.set(g[0],g[1]);if(g[0]!=1)b[e].wrapS=THREE.RepeatWrapping;if(g[1]!=
-1)b[e].wrapT=THREE.RepeatWrapping}j&&b[e].offset.set(j[0],j[1]);if(k){g={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(g[k[0]]!==void 0)b[e].wrapS=g[k[0]];if(g[k[1]]!==void 0)b[e].wrapT=g[k[1]]}f(b[e],c+"/"+h)}function j(b){return(b[0]*255<<16)+(b[1]*255<<8)+b[2]*255}var h,k,n;k="MeshLambertMaterial";h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:b.wireframe};b.shading&&(b.shading=="Phong"?k="MeshPhongMaterial":b.shading=="Basic"&&(k="MeshBasicMaterial"));
+new Image;f.onload=function(){if(!e(this.width)||!e(this.height)){var c=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),f=Math.pow(2,Math.round(Math.log(this.height)/Math.LN2));b.image.width=c;b.image.height=f;b.image.getContext("2d").drawImage(this,0,0,c,f)}else b.image=this;b.needsUpdate=!0};f.src=c}function g(b,e,h,g,j,k){var m=document.createElement("canvas");b[e]=new THREE.Texture(m);b[e].sourceFile=h;if(g){b[e].repeat.set(g[0],g[1]);if(g[0]!=1)b[e].wrapS=THREE.RepeatWrapping;if(g[1]!=
+1)b[e].wrapT=THREE.RepeatWrapping}j&&b[e].offset.set(j[0],j[1]);if(k){g={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(g[k[0]]!==void 0)b[e].wrapS=g[k[0]];if(g[k[1]]!==void 0)b[e].wrapT=g[k[1]]}f(b[e],c+"/"+h)}function j(b){return(b[0]*255<<16)+(b[1]*255<<8)+b[2]*255}var h,k,m;k="MeshLambertMaterial";h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:b.wireframe};b.shading&&(b.shading=="Phong"?k="MeshPhongMaterial":b.shading=="Basic"&&(k="MeshBasicMaterial"));
 if(b.blending)if(b.blending=="Additive")h.blending=THREE.AdditiveBlending;else if(b.blending=="Subtractive")h.blending=THREE.SubtractiveBlending;else if(b.blending=="Multiply")h.blending=THREE.MultiplyBlending;if(b.transparent!==void 0||b.opacity<1)h.transparent=b.transparent;if(b.depthTest!==void 0)h.depthTest=b.depthTest;if(b.vertexColors!==void 0)if(b.vertexColors=="face")h.vertexColors=THREE.FaceColors;else if(b.vertexColors)h.vertexColors=THREE.VertexColors;if(b.colorDiffuse)h.color=j(b.colorDiffuse);
 if(b.blending)if(b.blending=="Additive")h.blending=THREE.AdditiveBlending;else if(b.blending=="Subtractive")h.blending=THREE.SubtractiveBlending;else if(b.blending=="Multiply")h.blending=THREE.MultiplyBlending;if(b.transparent!==void 0||b.opacity<1)h.transparent=b.transparent;if(b.depthTest!==void 0)h.depthTest=b.depthTest;if(b.vertexColors!==void 0)if(b.vertexColors=="face")h.vertexColors=THREE.FaceColors;else if(b.vertexColors)h.vertexColors=THREE.VertexColors;if(b.colorDiffuse)h.color=j(b.colorDiffuse);
 else if(b.DbgColor)h.color=b.DbgColor;if(b.colorSpecular)h.specular=j(b.colorSpecular);if(b.colorAmbient)h.ambient=j(b.colorAmbient);if(b.transparency)h.opacity=b.transparency;if(b.specularCoef)h.shininess=b.specularCoef;b.mapDiffuse&&c&&g(h,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap);b.mapLight&&c&&g(h,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap);b.mapNormal&&c&&g(h,"normalMap",b.mapNormal,b.mapNormalRepeat,b.mapNormalOffset,b.mapNormalWrap);
 else if(b.DbgColor)h.color=b.DbgColor;if(b.colorSpecular)h.specular=j(b.colorSpecular);if(b.colorAmbient)h.ambient=j(b.colorAmbient);if(b.transparency)h.opacity=b.transparency;if(b.specularCoef)h.shininess=b.specularCoef;b.mapDiffuse&&c&&g(h,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap);b.mapLight&&c&&g(h,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap);b.mapNormal&&c&&g(h,"normalMap",b.mapNormal,b.mapNormalRepeat,b.mapNormalOffset,b.mapNormalWrap);
-b.mapSpecular&&c&&g(h,"specularMap",b.mapSpecular,b.mapSpecularRepeat,b.mapSpecularOffset,b.mapSpecularWrap);if(b.mapNormal){var o=THREE.ShaderUtils.lib.normal,p=THREE.UniformsUtils.clone(o.uniforms),u=h.color;k=h.specular;n=h.ambient;var v=h.shininess;p.tNormal.texture=h.normalMap;if(b.mapNormalFactor)p.uNormalScale.value=b.mapNormalFactor;if(h.map)p.tDiffuse.texture=h.map,p.enableDiffuse.value=!0;if(h.specularMap)p.tSpecular.texture=h.specularMap,p.enableSpecular.value=!0;if(h.lightMap)p.tAO.texture=
-h.lightMap,p.enableAO.value=!0;p.uDiffuseColor.value.setHex(u);p.uSpecularColor.value.setHex(k);p.uAmbientColor.value.setHex(n);p.uShininess.value=v;if(h.opacity)p.uOpacity.value=h.opacity;h=new THREE.MeshShaderMaterial({fragmentShader:o.fragmentShader,vertexShader:o.vertexShader,uniforms:p,lights:!0,fog:!0})}else h=new THREE[k](h);return h},constructor:THREE.Loader};THREE.JSONLoader=function(b){THREE.Loader.call(this,b)};THREE.JSONLoader.prototype=new THREE.Loader;
+b.mapSpecular&&c&&g(h,"specularMap",b.mapSpecular,b.mapSpecularRepeat,b.mapSpecularOffset,b.mapSpecularWrap);if(b.mapNormal){var o=THREE.ShaderUtils.lib.normal,p=THREE.UniformsUtils.clone(o.uniforms),u=h.color;k=h.specular;m=h.ambient;var v=h.shininess;p.tNormal.texture=h.normalMap;if(b.mapNormalFactor)p.uNormalScale.value=b.mapNormalFactor;if(h.map)p.tDiffuse.texture=h.map,p.enableDiffuse.value=!0;if(h.specularMap)p.tSpecular.texture=h.specularMap,p.enableSpecular.value=!0;if(h.lightMap)p.tAO.texture=
+h.lightMap,p.enableAO.value=!0;p.uDiffuseColor.value.setHex(u);p.uSpecularColor.value.setHex(k);p.uAmbientColor.value.setHex(m);p.uShininess.value=v;if(h.opacity)p.uOpacity.value=h.opacity;h=new THREE.MeshShaderMaterial({fragmentShader:o.fragmentShader,vertexShader:o.vertexShader,uniforms:p,lights:!0,fog:!0})}else h=new THREE[k](h);return h},constructor:THREE.Loader};THREE.JSONLoader=function(b){THREE.Loader.call(this,b)};THREE.JSONLoader.prototype=new THREE.Loader;
 THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(b){var c=this,e=b.model,f=b.callback,g=b.texture_path?b.texture_path:this.extractUrlbase(e),b=new Worker(e);b.onmessage=function(b){c.createModel(b.data,f,g);c.onLoadComplete()};this.onLoadStart();b.postMessage((new Date).getTime())};
 THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(b){var c=this,e=b.model,f=b.callback,g=b.texture_path?b.texture_path:this.extractUrlbase(e),b=new Worker(e);b.onmessage=function(b){c.createModel(b.data,f,g);c.onLoadComplete()};this.onLoadStart();b.postMessage((new Date).getTime())};
-THREE.JSONLoader.prototype.createModel=function(b,c,e){var f=new THREE.Geometry,g=b.scale!==void 0?1/b.scale:1;this.init_materials(f,b.materials,e);(function(c){if(b.version===void 0||b.version!=2)console.error("Deprecated file format.");else{var e,g,n,o,p,u,v,t,y,w,A,x,G,D,I=b.faces;u=b.vertices;var J=b.normals,C=b.colors,B=0;for(e=0;e<b.uvs.length;e++)b.uvs[e].length&&B++;for(e=0;e<B;e++)f.faceUvs[e]=[],f.faceVertexUvs[e]=[];o=0;for(p=u.length;o<p;)v=new THREE.Vertex,v.position.x=u[o++]*c,v.position.y=
-u[o++]*c,v.position.z=u[o++]*c,f.vertices.push(v);o=0;for(p=I.length;o<p;){c=I[o++];u=c&1;n=c&2;e=c&4;g=c&8;t=c&16;v=c&32;w=c&64;c&=128;u?(A=new THREE.Face4,A.a=I[o++],A.b=I[o++],A.c=I[o++],A.d=I[o++],u=4):(A=new THREE.Face3,A.a=I[o++],A.b=I[o++],A.c=I[o++],u=3);if(n)n=I[o++],A.materials=f.materials[n];n=f.faces.length;if(e)for(e=0;e<B;e++)x=b.uvs[e],y=I[o++],D=x[y*2],y=x[y*2+1],f.faceUvs[e][n]=new THREE.UV(D,y);if(g)for(e=0;e<B;e++){x=b.uvs[e];G=[];for(g=0;g<u;g++)y=I[o++],D=x[y*2],y=x[y*2+1],G[g]=
-new THREE.UV(D,y);f.faceVertexUvs[e][n]=G}if(t)t=I[o++]*3,g=new THREE.Vector3,g.x=J[t++],g.y=J[t++],g.z=J[t],A.normal=g;if(v)for(e=0;e<u;e++)t=I[o++]*3,g=new THREE.Vector3,g.x=J[t++],g.y=J[t++],g.z=J[t],A.vertexNormals.push(g);if(w)v=I[o++],v=new THREE.Color(C[v]),A.color=v;if(c)for(e=0;e<u;e++)v=I[o++],v=new THREE.Color(C[v]),A.vertexColors.push(v);f.faces.push(A)}}})(g);(function(){var c,e,g,n;if(b.skinWeights){c=0;for(e=b.skinWeights.length;c<e;c+=2)g=b.skinWeights[c],n=b.skinWeights[c+1],f.skinWeights.push(new THREE.Vector4(g,
-n,0,0))}if(b.skinIndices){c=0;for(e=b.skinIndices.length;c<e;c+=2)g=b.skinIndices[c],n=b.skinIndices[c+1],f.skinIndices.push(new THREE.Vector4(g,n,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var e,g,n,o,p,u,v,t,y;e=0;for(g=b.morphTargets.length;e<g;e++){f.morphTargets[e]={};f.morphTargets[e].name=b.morphTargets[e].name;f.morphTargets[e].vertices=[];t=f.morphTargets[e].vertices;y=b.morphTargets[e].vertices;n=0;for(o=y.length;n<o;n+=3)p=y[n]*c,u=y[n+1]*
-c,v=y[n+2]*c,t.push(new THREE.Vertex(new THREE.Vector3(p,u,v)))}}if(b.morphColors!==void 0){e=0;for(g=b.morphColors.length;e<g;e++){f.morphColors[e]={};f.morphColors[e].name=b.morphColors[e].name;f.morphColors[e].colors=[];o=f.morphColors[e].colors;p=b.morphColors[e].colors;c=0;for(n=p.length;c<n;c+=3)u=new THREE.Color(16755200),u.setRGB(p[c],p[c+1],p[c+2]),o.push(u)}}})(g);(function(){if(b.edges!==void 0){var c,e,g;for(c=0;c<b.edges.length;c+=2)e=b.edges[c],g=b.edges[c+1],f.edges.push(new THREE.Edge(f.vertices[e],
+THREE.JSONLoader.prototype.createModel=function(b,c,e){var f=new THREE.Geometry,g=b.scale!==void 0?1/b.scale:1;this.init_materials(f,b.materials,e);(function(c){if(b.version===void 0||b.version!=2)console.error("Deprecated file format.");else{var e,g,m,o,p,u,v,t,x,w,A,y,G,D,I=b.faces;u=b.vertices;var J=b.normals,C=b.colors,B=0;for(e=0;e<b.uvs.length;e++)b.uvs[e].length&&B++;for(e=0;e<B;e++)f.faceUvs[e]=[],f.faceVertexUvs[e]=[];o=0;for(p=u.length;o<p;)v=new THREE.Vertex,v.position.x=u[o++]*c,v.position.y=
+u[o++]*c,v.position.z=u[o++]*c,f.vertices.push(v);o=0;for(p=I.length;o<p;){c=I[o++];u=c&1;m=c&2;e=c&4;g=c&8;t=c&16;v=c&32;w=c&64;c&=128;u?(A=new THREE.Face4,A.a=I[o++],A.b=I[o++],A.c=I[o++],A.d=I[o++],u=4):(A=new THREE.Face3,A.a=I[o++],A.b=I[o++],A.c=I[o++],u=3);if(m)m=I[o++],A.materials=f.materials[m];m=f.faces.length;if(e)for(e=0;e<B;e++)y=b.uvs[e],x=I[o++],D=y[x*2],x=y[x*2+1],f.faceUvs[e][m]=new THREE.UV(D,x);if(g)for(e=0;e<B;e++){y=b.uvs[e];G=[];for(g=0;g<u;g++)x=I[o++],D=y[x*2],x=y[x*2+1],G[g]=
+new THREE.UV(D,x);f.faceVertexUvs[e][m]=G}if(t)t=I[o++]*3,g=new THREE.Vector3,g.x=J[t++],g.y=J[t++],g.z=J[t],A.normal=g;if(v)for(e=0;e<u;e++)t=I[o++]*3,g=new THREE.Vector3,g.x=J[t++],g.y=J[t++],g.z=J[t],A.vertexNormals.push(g);if(w)v=I[o++],v=new THREE.Color(C[v]),A.color=v;if(c)for(e=0;e<u;e++)v=I[o++],v=new THREE.Color(C[v]),A.vertexColors.push(v);f.faces.push(A)}}})(g);(function(){var c,e,g,m;if(b.skinWeights){c=0;for(e=b.skinWeights.length;c<e;c+=2)g=b.skinWeights[c],m=b.skinWeights[c+1],f.skinWeights.push(new THREE.Vector4(g,
+m,0,0))}if(b.skinIndices){c=0;for(e=b.skinIndices.length;c<e;c+=2)g=b.skinIndices[c],m=b.skinIndices[c+1],f.skinIndices.push(new THREE.Vector4(g,m,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var e,g,m,o,p,u,v,t,x;e=0;for(g=b.morphTargets.length;e<g;e++){f.morphTargets[e]={};f.morphTargets[e].name=b.morphTargets[e].name;f.morphTargets[e].vertices=[];t=f.morphTargets[e].vertices;x=b.morphTargets[e].vertices;m=0;for(o=x.length;m<o;m+=3)p=x[m]*c,u=x[m+1]*
+c,v=x[m+2]*c,t.push(new THREE.Vertex(new THREE.Vector3(p,u,v)))}}if(b.morphColors!==void 0){e=0;for(g=b.morphColors.length;e<g;e++){f.morphColors[e]={};f.morphColors[e].name=b.morphColors[e].name;f.morphColors[e].colors=[];o=f.morphColors[e].colors;p=b.morphColors[e].colors;c=0;for(m=p.length;c<m;c+=3)u=new THREE.Color(16755200),u.setRGB(p[c],p[c+1],p[c+2]),o.push(u)}}})(g);(function(){if(b.edges!==void 0){var c,e,g;for(c=0;c<b.edges.length;c+=2)e=b.edges[c],g=b.edges[c+1],f.edges.push(new THREE.Edge(f.vertices[e],
 f.vertices[g],e,g))}})();f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
 f.vertices[g],e,g))}})();f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
 THREE.BinaryLoader.prototype={load:function(b){var c=b.model,e=b.callback,f=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(c),g=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(c),b=(new Date).getTime(),c=new Worker(c),j=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,e,g,f,j)};c.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};
 THREE.BinaryLoader.prototype={load:function(b){var c=b.model,e=b.callback,f=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(c),g=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(c),b=(new Date).getTime(),c=new Worker(c),j=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,e,g,f,j)};c.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};
-c.postMessage(b)},loadAjaxBuffers:function(b,c,e,f,g,j){var h=new XMLHttpRequest,k=f+"/"+b,n=0;h.onreadystatechange=function(){h.readyState==4?h.status==200||h.status==0?THREE.BinaryLoader.prototype.createBinModel(h.responseText,e,g,c):alert("Couldn't load ["+k+"] ["+h.status+"]"):h.readyState==3?j&&(n==0&&(n=h.getResponseHeader("Content-Length")),j({total:n,loaded:h.responseText.length})):h.readyState==2&&(n=h.getResponseHeader("Content-Length"))};h.open("GET",k,!0);h.overrideMimeType("text/plain; charset=x-user-defined");
-h.setRequestHeader("Content-Type","text/plain");h.send(null)},createBinModel:function(b,c,e,f){var g=function(c){function e(b,c){var f=p(b,c),g=p(b,c+1),h=p(b,c+2),j=p(b,c+3),k=(j<<1&255|h>>7)-127;f|=(h&127)<<16|g<<8;if(f==0&&k==-127)return 0;return(1-2*(j>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,k)}function g(b,c){var e=p(b,c),f=p(b,c+1),h=p(b,c+2);return(p(b,c+3)<<24)+(h<<16)+(f<<8)+e}function n(b,c){var e=p(b,c);return(p(b,c+1)<<8)+e}function o(b,c){var e=p(b,c);return e>127?e-256:e}function p(b,
-c){return b.charCodeAt(c)&255}function u(c){var e,f,h;e=g(b,c);f=g(b,c+C);h=g(b,c+B);c=n(b,c+L);THREE.BinaryLoader.prototype.f3(x,e,f,h,c)}function v(c){var e,f,h,j,m,o;e=g(b,c);f=g(b,c+C);h=g(b,c+B);j=n(b,c+L);m=g(b,c+E);o=g(b,c+V);c=g(b,c+H);THREE.BinaryLoader.prototype.f3n(x,I,e,f,h,j,m,o,c)}function t(c){var e,f,h,j;e=g(b,c);f=g(b,c+S);h=g(b,c+K);j=g(b,c+Q);c=n(b,c+m);THREE.BinaryLoader.prototype.f4(x,e,f,h,j,c)}function y(c){var e,f,h,j,o,p,t,u;e=g(b,c);f=g(b,c+S);h=g(b,c+K);j=g(b,c+Q);o=n(b,
-c+m);p=g(b,c+T);t=g(b,c+X);u=g(b,c+M);c=g(b,c+W);THREE.BinaryLoader.prototype.f4n(x,I,e,f,h,j,o,p,t,u,c)}function w(c){var e,f;e=g(b,c);f=g(b,c+ha);c=g(b,c+ca);THREE.BinaryLoader.prototype.uv3(x.faceVertexUvs[0],J[e*2],J[e*2+1],J[f*2],J[f*2+1],J[c*2],J[c*2+1])}function A(c){var e,f,h;e=g(b,c);f=g(b,c+fa);h=g(b,c+ga);c=g(b,c+$);THREE.BinaryLoader.prototype.uv4(x.faceVertexUvs[0],J[e*2],J[e*2+1],J[f*2],J[f*2+1],J[h*2],J[h*2+1],J[c*2],J[c*2+1])}var x=this,G=0,D,I=[],J=[],C,B,L,E,V,H,S,K,Q,m,T,X,M,W,
-ha,ca,fa,ga,$,Y,P,ea,Z,da,ia;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(x,f,c);D={signature:b.substr(G,8),header_bytes:p(b,G+8),vertex_coordinate_bytes:p(b,G+9),normal_coordinate_bytes:p(b,G+10),uv_coordinate_bytes:p(b,G+11),vertex_index_bytes:p(b,G+12),normal_index_bytes:p(b,G+13),uv_index_bytes:p(b,G+14),material_index_bytes:p(b,G+15),nvertices:g(b,G+16),nnormals:g(b,G+16+4),nuvs:g(b,G+16+8),ntri_flat:g(b,G+16+12),ntri_smooth:g(b,G+16+16),ntri_flat_uv:g(b,G+16+20),ntri_smooth_uv:g(b,
-G+16+24),nquad_flat:g(b,G+16+28),nquad_smooth:g(b,G+16+32),nquad_flat_uv:g(b,G+16+36),nquad_smooth_uv:g(b,G+16+40)};G+=D.header_bytes;C=D.vertex_index_bytes;B=D.vertex_index_bytes*2;L=D.vertex_index_bytes*3;E=D.vertex_index_bytes*3+D.material_index_bytes;V=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes;H=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*2;S=D.vertex_index_bytes;K=D.vertex_index_bytes*2;Q=D.vertex_index_bytes*3;m=D.vertex_index_bytes*4;T=D.vertex_index_bytes*
+c.postMessage(b)},loadAjaxBuffers:function(b,c,e,f,g,j){var h=new XMLHttpRequest,k=f+"/"+b,m=0;h.onreadystatechange=function(){h.readyState==4?h.status==200||h.status==0?THREE.BinaryLoader.prototype.createBinModel(h.responseText,e,g,c):alert("Couldn't load ["+k+"] ["+h.status+"]"):h.readyState==3?j&&(m==0&&(m=h.getResponseHeader("Content-Length")),j({total:m,loaded:h.responseText.length})):h.readyState==2&&(m=h.getResponseHeader("Content-Length"))};h.open("GET",k,!0);h.overrideMimeType("text/plain; charset=x-user-defined");
+h.setRequestHeader("Content-Type","text/plain");h.send(null)},createBinModel:function(b,c,e,f){var g=function(c){function e(b,c){var f=p(b,c),g=p(b,c+1),h=p(b,c+2),j=p(b,c+3),k=(j<<1&255|h>>7)-127;f|=(h&127)<<16|g<<8;if(f==0&&k==-127)return 0;return(1-2*(j>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,k)}function g(b,c){var e=p(b,c),f=p(b,c+1),h=p(b,c+2);return(p(b,c+3)<<24)+(h<<16)+(f<<8)+e}function m(b,c){var e=p(b,c);return(p(b,c+1)<<8)+e}function o(b,c){var e=p(b,c);return e>127?e-256:e}function p(b,
+c){return b.charCodeAt(c)&255}function u(c){var e,f,h;e=g(b,c);f=g(b,c+C);h=g(b,c+B);c=m(b,c+L);THREE.BinaryLoader.prototype.f3(y,e,f,h,c)}function v(c){var e,f,h,j,n,o;e=g(b,c);f=g(b,c+C);h=g(b,c+B);j=m(b,c+L);n=g(b,c+E);o=g(b,c+V);c=g(b,c+H);THREE.BinaryLoader.prototype.f3n(y,I,e,f,h,j,n,o,c)}function t(c){var e,f,h,j;e=g(b,c);f=g(b,c+S);h=g(b,c+K);j=g(b,c+Q);c=m(b,c+n);THREE.BinaryLoader.prototype.f4(y,e,f,h,j,c)}function x(c){var e,f,h,j,o,p,t,u;e=g(b,c);f=g(b,c+S);h=g(b,c+K);j=g(b,c+Q);o=m(b,
+c+n);p=g(b,c+T);t=g(b,c+X);u=g(b,c+M);c=g(b,c+W);THREE.BinaryLoader.prototype.f4n(y,I,e,f,h,j,o,p,t,u,c)}function w(c){var e,f;e=g(b,c);f=g(b,c+ha);c=g(b,c+ca);THREE.BinaryLoader.prototype.uv3(y.faceVertexUvs[0],J[e*2],J[e*2+1],J[f*2],J[f*2+1],J[c*2],J[c*2+1])}function A(c){var e,f,h;e=g(b,c);f=g(b,c+fa);h=g(b,c+ga);c=g(b,c+$);THREE.BinaryLoader.prototype.uv4(y.faceVertexUvs[0],J[e*2],J[e*2+1],J[f*2],J[f*2+1],J[h*2],J[h*2+1],J[c*2],J[c*2+1])}var y=this,G=0,D,I=[],J=[],C,B,L,E,V,H,S,K,Q,n,T,X,M,W,
+ha,ca,fa,ga,$,Y,P,ea,Z,da,ia;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(y,f,c);D={signature:b.substr(G,8),header_bytes:p(b,G+8),vertex_coordinate_bytes:p(b,G+9),normal_coordinate_bytes:p(b,G+10),uv_coordinate_bytes:p(b,G+11),vertex_index_bytes:p(b,G+12),normal_index_bytes:p(b,G+13),uv_index_bytes:p(b,G+14),material_index_bytes:p(b,G+15),nvertices:g(b,G+16),nnormals:g(b,G+16+4),nuvs:g(b,G+16+8),ntri_flat:g(b,G+16+12),ntri_smooth:g(b,G+16+16),ntri_flat_uv:g(b,G+16+20),ntri_smooth_uv:g(b,
+G+16+24),nquad_flat:g(b,G+16+28),nquad_smooth:g(b,G+16+32),nquad_flat_uv:g(b,G+16+36),nquad_smooth_uv:g(b,G+16+40)};G+=D.header_bytes;C=D.vertex_index_bytes;B=D.vertex_index_bytes*2;L=D.vertex_index_bytes*3;E=D.vertex_index_bytes*3+D.material_index_bytes;V=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes;H=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*2;S=D.vertex_index_bytes;K=D.vertex_index_bytes*2;Q=D.vertex_index_bytes*3;n=D.vertex_index_bytes*4;T=D.vertex_index_bytes*
 4+D.material_index_bytes;X=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes;M=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*2;W=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*3;ha=D.uv_index_bytes;ca=D.uv_index_bytes*2;fa=D.uv_index_bytes;ga=D.uv_index_bytes*2;$=D.uv_index_bytes*3;c=D.vertex_index_bytes*3+D.material_index_bytes;ia=D.vertex_index_bytes*4+D.material_index_bytes;Y=D.ntri_flat*c;P=D.ntri_smooth*(c+D.normal_index_bytes*3);ea=D.ntri_flat_uv*
 4+D.material_index_bytes;X=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes;M=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*2;W=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*3;ha=D.uv_index_bytes;ca=D.uv_index_bytes*2;fa=D.uv_index_bytes;ga=D.uv_index_bytes*2;$=D.uv_index_bytes*3;c=D.vertex_index_bytes*3+D.material_index_bytes;ia=D.vertex_index_bytes*4+D.material_index_bytes;Y=D.ntri_flat*c;P=D.ntri_smooth*(c+D.normal_index_bytes*3);ea=D.ntri_flat_uv*
-(c+D.uv_index_bytes*3);Z=D.ntri_smooth_uv*(c+D.normal_index_bytes*3+D.uv_index_bytes*3);da=D.nquad_flat*ia;c=D.nquad_smooth*(ia+D.normal_index_bytes*4);ia=D.nquad_flat_uv*(ia+D.uv_index_bytes*4);G+=function(c){for(var f,g,j,k=D.vertex_coordinate_bytes*3,m=c+D.nvertices*k;c<m;c+=k)f=e(b,c),g=e(b,c+D.vertex_coordinate_bytes),j=e(b,c+D.vertex_coordinate_bytes*2),THREE.BinaryLoader.prototype.v(x,f,g,j);return D.nvertices*k}(G);G+=function(c){for(var e,f,g,h=D.normal_coordinate_bytes*3,j=c+D.nnormals*
+(c+D.uv_index_bytes*3);Z=D.ntri_smooth_uv*(c+D.normal_index_bytes*3+D.uv_index_bytes*3);da=D.nquad_flat*ia;c=D.nquad_smooth*(ia+D.normal_index_bytes*4);ia=D.nquad_flat_uv*(ia+D.uv_index_bytes*4);G+=function(c){for(var f,g,j,k=D.vertex_coordinate_bytes*3,m=c+D.nvertices*k;c<m;c+=k)f=e(b,c),g=e(b,c+D.vertex_coordinate_bytes),j=e(b,c+D.vertex_coordinate_bytes*2),THREE.BinaryLoader.prototype.v(y,f,g,j);return D.nvertices*k}(G);G+=function(c){for(var e,f,g,h=D.normal_coordinate_bytes*3,j=c+D.nnormals*
 h;c<j;c+=h)e=o(b,c),f=o(b,c+D.normal_coordinate_bytes),g=o(b,c+D.normal_coordinate_bytes*2),I.push(e/127,f/127,g/127);return D.nnormals*h}(G);G+=function(c){for(var f,g,j=D.uv_coordinate_bytes*2,k=c+D.nuvs*j;c<k;c+=j)f=e(b,c),g=e(b,c+D.uv_coordinate_bytes),J.push(f,g);return D.nuvs*j}(G);Y=G+Y;P=Y+P;ea=P+ea;Z=ea+Z;da=Z+da;c=da+c;ia=c+ia;(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes,f=e+D.uv_index_bytes*3,g=b+D.ntri_flat_uv*f;for(c=b;c<g;c+=f)u(c),w(c+e);return g-b})(P);(function(b){var c,
 h;c<j;c+=h)e=o(b,c),f=o(b,c+D.normal_coordinate_bytes),g=o(b,c+D.normal_coordinate_bytes*2),I.push(e/127,f/127,g/127);return D.nnormals*h}(G);G+=function(c){for(var f,g,j=D.uv_coordinate_bytes*2,k=c+D.nuvs*j;c<k;c+=j)f=e(b,c),g=e(b,c+D.uv_coordinate_bytes),J.push(f,g);return D.nuvs*j}(G);Y=G+Y;P=Y+P;ea=P+ea;Z=ea+Z;da=Z+da;c=da+c;ia=c+ia;(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes,f=e+D.uv_index_bytes*3,g=b+D.ntri_flat_uv*f;for(c=b;c<g;c+=f)u(c),w(c+e);return g-b})(P);(function(b){var c,
-e=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,f=e+D.uv_index_bytes*3,g=b+D.ntri_smooth_uv*f;for(c=b;c<g;c+=f)v(c),w(c+e);return g-b})(ea);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes,f=e+D.uv_index_bytes*4,g=b+D.nquad_flat_uv*f;for(c=b;c<g;c+=f)t(c),A(c+e);return g-b})(c);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*4,f=e+D.uv_index_bytes*4,g=b+D.nquad_smooth_uv*f;for(c=b;c<g;c+=f)y(c),A(c+e);return g-b})(ia);
+e=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,f=e+D.uv_index_bytes*3,g=b+D.ntri_smooth_uv*f;for(c=b;c<g;c+=f)v(c),w(c+e);return g-b})(ea);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes,f=e+D.uv_index_bytes*4,g=b+D.nquad_flat_uv*f;for(c=b;c<g;c+=f)t(c),A(c+e);return g-b})(c);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*4,f=e+D.uv_index_bytes*4,g=b+D.nquad_smooth_uv*f;for(c=b;c<g;c+=f)x(c),A(c+e);return g-b})(ia);
 (function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes,f=b+D.ntri_flat*e;for(c=b;c<f;c+=e)u(c);return f-b})(G);(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,f=b+D.ntri_smooth*e;for(c=b;c<f;c+=e)v(c);return f-b})(Y);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes,f=b+D.nquad_flat*e;for(c=b;c<f;c+=e)t(c);return f-b})(Z);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*4,f=b+D.nquad_smooth*
 (function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes,f=b+D.ntri_flat*e;for(c=b;c<f;c+=e)u(c);return f-b})(G);(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,f=b+D.ntri_smooth*e;for(c=b;c<f;c+=e)v(c);return f-b})(Y);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes,f=b+D.nquad_flat*e;for(c=b;c<f;c+=e)t(c);return f-b})(Z);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*4,f=b+D.nquad_smooth*
-e;for(c=b;c<f;c+=e)y(c);return f-b})(da);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};g.prototype=new THREE.Geometry;g.prototype.constructor=g;c(new g(e))},v:function(b,c,e,f){b.vertices.push(new THREE.Vertex(new THREE.Vector3(c,e,f)))},f3:function(b,c,e,f,g){b.faces.push(new THREE.Face3(c,e,f,null,null,b.materials[g]))},f4:function(b,c,e,f,g,j){b.faces.push(new THREE.Face4(c,e,f,g,null,null,b.materials[j]))},f3n:function(b,c,e,
-f,g,j,h,k,n){var j=b.materials[j],o=c[k*3],p=c[k*3+1],k=c[k*3+2],u=c[n*3],v=c[n*3+1],n=c[n*3+2];b.faces.push(new THREE.Face3(e,f,g,[new THREE.Vector3(c[h*3],c[h*3+1],c[h*3+2]),new THREE.Vector3(o,p,k),new THREE.Vector3(u,v,n)],null,j))},f4n:function(b,c,e,f,g,j,h,k,n,o,p){var h=b.materials[h],u=c[n*3],v=c[n*3+1],n=c[n*3+2],t=c[o*3],y=c[o*3+1],o=c[o*3+2],w=c[p*3],A=c[p*3+1],p=c[p*3+2];b.faces.push(new THREE.Face4(e,f,g,j,[new THREE.Vector3(c[k*3],c[k*3+1],c[k*3+2]),new THREE.Vector3(u,v,n),new THREE.Vector3(t,
-y,o),new THREE.Vector3(w,A,p)],null,h))},uv3:function(b,c,e,f,g,j,h){var k=[];k.push(new THREE.UV(c,e));k.push(new THREE.UV(f,g));k.push(new THREE.UV(j,h));b.push(k)},uv4:function(b,c,e,f,g,j,h,k,n){var o=[];o.push(new THREE.UV(c,e));o.push(new THREE.UV(f,g));o.push(new THREE.UV(j,h));o.push(new THREE.UV(k,n));b.push(o)},constructor:THREE.BinaryLoader};
+e;for(c=b;c<f;c+=e)x(c);return f-b})(da);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};g.prototype=new THREE.Geometry;g.prototype.constructor=g;c(new g(e))},v:function(b,c,e,f){b.vertices.push(new THREE.Vertex(new THREE.Vector3(c,e,f)))},f3:function(b,c,e,f,g){b.faces.push(new THREE.Face3(c,e,f,null,null,b.materials[g]))},f4:function(b,c,e,f,g,j){b.faces.push(new THREE.Face4(c,e,f,g,null,null,b.materials[j]))},f3n:function(b,c,e,
+f,g,j,h,k,m){var j=b.materials[j],o=c[k*3],p=c[k*3+1],k=c[k*3+2],u=c[m*3],v=c[m*3+1],m=c[m*3+2];b.faces.push(new THREE.Face3(e,f,g,[new THREE.Vector3(c[h*3],c[h*3+1],c[h*3+2]),new THREE.Vector3(o,p,k),new THREE.Vector3(u,v,m)],null,j))},f4n:function(b,c,e,f,g,j,h,k,m,o,p){var h=b.materials[h],u=c[m*3],v=c[m*3+1],m=c[m*3+2],t=c[o*3],x=c[o*3+1],o=c[o*3+2],w=c[p*3],A=c[p*3+1],p=c[p*3+2];b.faces.push(new THREE.Face4(e,f,g,j,[new THREE.Vector3(c[k*3],c[k*3+1],c[k*3+2]),new THREE.Vector3(u,v,m),new THREE.Vector3(t,
+x,o),new THREE.Vector3(w,A,p)],null,h))},uv3:function(b,c,e,f,g,j,h){var k=[];k.push(new THREE.UV(c,e));k.push(new THREE.UV(f,g));k.push(new THREE.UV(j,h));b.push(k)},uv4:function(b,c,e,f,g,j,h,k,m){var o=[];o.push(new THREE.UV(c,e));o.push(new THREE.UV(f,g));o.push(new THREE.UV(j,h));o.push(new THREE.UV(k,m));b.push(o)},constructor:THREE.BinaryLoader};
 THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
 THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
 THREE.SceneLoader.prototype={load:function(b,c){var e=this,f=new Worker(b);f.postMessage(0);var g=THREE.Loader.prototype.extractUrlbase(b);f.onmessage=function(b){function f(b,c){return c=="relativeToHTML"?b:g+"/"+b}function k(){for(t in S.objects)if(!M.objects[t])if(G=S.objects[t],G.geometry!==void 0){if(C=M.geometries[G.geometry]){var b=!1;V=[];for(ha=0;ha<G.materials.length;ha++)V[ha]=M.materials[G.materials[ha]],b=V[ha]instanceof THREE.MeshShaderMaterial;b&&C.computeTangents();D=G.position;r=
 THREE.SceneLoader.prototype={load:function(b,c){var e=this,f=new Worker(b);f.postMessage(0);var g=THREE.Loader.prototype.extractUrlbase(b);f.onmessage=function(b){function f(b,c){return c=="relativeToHTML"?b:g+"/"+b}function k(){for(t in S.objects)if(!M.objects[t])if(G=S.objects[t],G.geometry!==void 0){if(C=M.geometries[G.geometry]){var b=!1;V=[];for(ha=0;ha<G.materials.length;ha++)V[ha]=M.materials[G.materials[ha]],b=V[ha]instanceof THREE.MeshShaderMaterial;b&&C.computeTangents();D=G.position;r=
 G.rotation;q=G.quaternion;s=G.scale;q=0;V.length==0&&(V[0]=new THREE.MeshFaceMaterial);V.length>1&&(V=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(C,V);object.name=t;object.position.set(D[0],D[1],D[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=G.visible;M.scene.addObject(object);M.objects[t]=object;G.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),M.scene.collisions.colliders.push(b));
 G.rotation;q=G.quaternion;s=G.scale;q=0;V.length==0&&(V[0]=new THREE.MeshFaceMaterial);V.length>1&&(V=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(C,V);object.name=t;object.position.set(D[0],D[1],D[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=G.visible;M.scene.addObject(object);M.objects[t]=object;G.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),M.scene.collisions.colliders.push(b));
 if(G.castsShadow)b=new THREE.ShadowVolume(C),M.scene.addChild(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;G.trigger&&G.trigger.toLowerCase()!="none"&&(b={type:G.trigger,object:G},M.triggers[object.name]=b)}}else D=G.position,r=G.rotation,q=G.quaternion,s=G.scale,q=0,object=new THREE.Object3D,object.name=t,object.position.set(D[0],D[1],D[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],
 if(G.castsShadow)b=new THREE.ShadowVolume(C),M.scene.addChild(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;G.trigger&&G.trigger.toLowerCase()!="none"&&(b={type:G.trigger,object:G},M.triggers[object.name]=b)}}else D=G.position,r=G.rotation,q=G.quaternion,s=G.scale,q=0,object=new THREE.Object3D,object.name=t,object.position.set(D[0],D[1],D[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],
-s[1],s[2]),object.visible=G.visible!==void 0?G.visible:!1,M.scene.addObject(object),M.objects[t]=object,M.empties[t]=object,G.trigger&&G.trigger.toLowerCase()!="none"&&(b={type:G.trigger,object:G},M.triggers[object.name]=b)}function n(b){return function(c){M.geometries[b]=c;k();Q-=1;e.onLoadComplete();p()}}function o(b){return function(c){M.geometries[b]=c}}function p(){e.callbackProgress({totalModels:T,totalTextures:X,loadedModels:T-Q,loadedTextures:X-m},M);e.onLoadProgress();Q==0&&m==0&&c(M)}var u,
-v,t,y,w,A,x,G,D,I,J,C,B,L,E,V,H,S,K,Q,m,T,X,M;S=b.data;E=new THREE.BinaryLoader;K=new THREE.JSONLoader;m=Q=0;M={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(t in S.objects)if(G=S.objects[t],G.meshCollider){b=!0;break}if(b)M.scene.collisions=new THREE.CollisionSystem;if(S.transform){b=S.transform.position;I=S.transform.rotation;var W=S.transform.scale;b&&M.scene.position.set(b[0],b[1],b[2]);I&&M.scene.rotation.set(I[0],
-I[1],I[2]);W&&M.scene.scale.set(W[0],W[1],W[2]);(b||I||W)&&M.scene.updateMatrix()}b=function(){m-=1;p();e.onLoadComplete()};for(w in S.cameras){I=S.cameras[w];if(I.type=="perspective")B=new THREE.Camera(I.fov,I.aspect,I.near,I.far);else if(I.type=="ortho")B=new THREE.Camera,B.projectionMatrix=THREE.Matrix4.makeOrtho(I.left,I.right,I.top,I.bottom,I.near,I.far);D=I.position;I=I.target;B.position.set(D[0],D[1],D[2]);B.target.position.set(I[0],I[1],I[2]);M.cameras[w]=B}for(y in S.lights)w=S.lights[y],
-B=w.color!==void 0?w.color:16777215,I=w.intensity!==void 0?w.intensity:1,w.type=="directional"?(D=w.direction,H=new THREE.DirectionalLight(B,I),H.position.set(D[0],D[1],D[2]),H.position.normalize()):w.type=="point"?(D=w.position,d=w.distance,H=new THREE.PointLight(B,I,d),H.position.set(D[0],D[1],D[2])):w.type=="ambient"&&(H=new THREE.AmbientLight(B)),M.scene.addLight(H),M.lights[y]=H;for(A in S.fogs)y=S.fogs[A],y.type=="linear"?L=new THREE.Fog(0,y.near,y.far):y.type=="exp2"&&(L=new THREE.FogExp2(0,
-y.density)),I=y.color,L.color.setRGB(I[0],I[1],I[2]),M.fogs[A]=L;if(M.cameras&&S.defaults.camera)M.currentCamera=M.cameras[S.defaults.camera];if(M.fogs&&S.defaults.fog)M.scene.fog=M.fogs[S.defaults.fog];I=S.defaults.bgcolor;M.bgColor=new THREE.Color;M.bgColor.setRGB(I[0],I[1],I[2]);M.bgColorAlpha=S.defaults.bgalpha;for(u in S.geometries)if(A=S.geometries[u],A.type=="bin_mesh"||A.type=="ascii_mesh")Q+=1,e.onLoadStart();T=Q;for(u in S.geometries)A=S.geometries[u],A.type=="cube"?(C=new THREE.CubeGeometry(A.width,
+s[1],s[2]),object.visible=G.visible!==void 0?G.visible:!1,M.scene.addObject(object),M.objects[t]=object,M.empties[t]=object,G.trigger&&G.trigger.toLowerCase()!="none"&&(b={type:G.trigger,object:G},M.triggers[object.name]=b)}function m(b){return function(c){M.geometries[b]=c;k();Q-=1;e.onLoadComplete();p()}}function o(b){return function(c){M.geometries[b]=c}}function p(){e.callbackProgress({totalModels:T,totalTextures:X,loadedModels:T-Q,loadedTextures:X-n},M);e.onLoadProgress();Q==0&&n==0&&c(M)}var u,
+v,t,x,w,A,y,G,D,I,J,C,B,L,E,V,H,S,K,Q,n,T,X,M;S=b.data;E=new THREE.BinaryLoader;K=new THREE.JSONLoader;n=Q=0;M={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(t in S.objects)if(G=S.objects[t],G.meshCollider){b=!0;break}if(b)M.scene.collisions=new THREE.CollisionSystem;if(S.transform){b=S.transform.position;I=S.transform.rotation;var W=S.transform.scale;b&&M.scene.position.set(b[0],b[1],b[2]);I&&M.scene.rotation.set(I[0],
+I[1],I[2]);W&&M.scene.scale.set(W[0],W[1],W[2]);(b||I||W)&&M.scene.updateMatrix()}b=function(){n-=1;p();e.onLoadComplete()};for(w in S.cameras){I=S.cameras[w];if(I.type=="perspective")B=new THREE.Camera(I.fov,I.aspect,I.near,I.far);else if(I.type=="ortho")B=new THREE.Camera,B.projectionMatrix=THREE.Matrix4.makeOrtho(I.left,I.right,I.top,I.bottom,I.near,I.far);D=I.position;I=I.target;B.position.set(D[0],D[1],D[2]);B.target.position.set(I[0],I[1],I[2]);M.cameras[w]=B}for(x in S.lights)w=S.lights[x],
+B=w.color!==void 0?w.color:16777215,I=w.intensity!==void 0?w.intensity:1,w.type=="directional"?(D=w.direction,H=new THREE.DirectionalLight(B,I),H.position.set(D[0],D[1],D[2]),H.position.normalize()):w.type=="point"?(D=w.position,d=w.distance,H=new THREE.PointLight(B,I,d),H.position.set(D[0],D[1],D[2])):w.type=="ambient"&&(H=new THREE.AmbientLight(B)),M.scene.addLight(H),M.lights[x]=H;for(A in S.fogs)x=S.fogs[A],x.type=="linear"?L=new THREE.Fog(0,x.near,x.far):x.type=="exp2"&&(L=new THREE.FogExp2(0,
+x.density)),I=x.color,L.color.setRGB(I[0],I[1],I[2]),M.fogs[A]=L;if(M.cameras&&S.defaults.camera)M.currentCamera=M.cameras[S.defaults.camera];if(M.fogs&&S.defaults.fog)M.scene.fog=M.fogs[S.defaults.fog];I=S.defaults.bgcolor;M.bgColor=new THREE.Color;M.bgColor.setRGB(I[0],I[1],I[2]);M.bgColorAlpha=S.defaults.bgalpha;for(u in S.geometries)if(A=S.geometries[u],A.type=="bin_mesh"||A.type=="ascii_mesh")Q+=1,e.onLoadStart();T=Q;for(u in S.geometries)A=S.geometries[u],A.type=="cube"?(C=new THREE.CubeGeometry(A.width,
 A.height,A.depth,A.segmentsWidth,A.segmentsHeight,A.segmentsDepth,null,A.flipped,A.sides),M.geometries[u]=C):A.type=="plane"?(C=new THREE.PlaneGeometry(A.width,A.height,A.segmentsWidth,A.segmentsHeight),M.geometries[u]=C):A.type=="sphere"?(C=new THREE.SphereGeometry(A.radius,A.segmentsWidth,A.segmentsHeight),M.geometries[u]=C):A.type=="cylinder"?(C=new THREE.CylinderGeometry(A.numSegs,A.topRad,A.botRad,A.height,A.topOffset,A.botOffset),M.geometries[u]=C):A.type=="torus"?(C=new THREE.TorusGeometry(A.radius,
 A.height,A.depth,A.segmentsWidth,A.segmentsHeight,A.segmentsDepth,null,A.flipped,A.sides),M.geometries[u]=C):A.type=="plane"?(C=new THREE.PlaneGeometry(A.width,A.height,A.segmentsWidth,A.segmentsHeight),M.geometries[u]=C):A.type=="sphere"?(C=new THREE.SphereGeometry(A.radius,A.segmentsWidth,A.segmentsHeight),M.geometries[u]=C):A.type=="cylinder"?(C=new THREE.CylinderGeometry(A.numSegs,A.topRad,A.botRad,A.height,A.topOffset,A.botOffset),M.geometries[u]=C):A.type=="torus"?(C=new THREE.TorusGeometry(A.radius,
-A.tube,A.segmentsR,A.segmentsT),M.geometries[u]=C):A.type=="icosahedron"?(C=new THREE.IcosahedronGeometry(A.subdivisions),M.geometries[u]=C):A.type=="bin_mesh"?E.load({model:f(A.url,S.urlBaseType),callback:n(u)}):A.type=="ascii_mesh"?K.load({model:f(A.url,S.urlBaseType),callback:n(u)}):A.type=="embedded_mesh"&&(A=S.embeds[A.id])&&K.createModel(A,o(u),"");for(x in S.textures)if(u=S.textures[x],u.url instanceof Array){m+=u.url.length;for(E=0;E<u.url.length;E++)e.onLoadStart()}else m+=1,e.onLoadStart();
-X=m;for(x in S.textures){u=S.textures[x];if(u.mapping!=void 0&&THREE[u.mapping]!=void 0)u.mapping=new THREE[u.mapping];if(u.url instanceof Array){E=[];for(var ha=0;ha<u.url.length;ha++)E[ha]=f(u.url[ha],S.urlBaseType);E=THREE.ImageUtils.loadTextureCube(E,u.mapping,b)}else{E=THREE.ImageUtils.loadTexture(f(u.url,S.urlBaseType),u.mapping,b);if(THREE[u.minFilter]!=void 0)E.minFilter=THREE[u.minFilter];if(THREE[u.magFilter]!=void 0)E.magFilter=THREE[u.magFilter];if(u.repeat){E.repeat.set(u.repeat[0],u.repeat[1]);
-if(u.repeat[0]!=1)E.wrapS=THREE.RepeatWrapping;if(u.repeat[1]!=1)E.wrapT=THREE.RepeatWrapping}u.offset&&E.offset.set(u.offset[0],u.offset[1]);if(u.wrap){K={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(K[u.wrap[0]]!==void 0)E.wrapS=K[u.wrap[0]];if(K[u.wrap[1]]!==void 0)E.wrapT=K[u.wrap[1]]}}M.textures[x]=E}for(v in S.materials){x=S.materials[v];for(J in x.parameters)if(J=="envMap"||J=="map"||J=="lightMap")x.parameters[J]=M.textures[x.parameters[J]];else if(J=="shading")x.parameters[J]=
-x.parameters[J]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(J=="blending")x.parameters[J]=THREE[x.parameters[J]]?THREE[x.parameters[J]]:THREE.NormalBlending;else if(J=="combine")x.parameters[J]=x.parameters[J]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(J=="vertexColors")if(x.parameters[J]=="face")x.parameters[J]=THREE.FaceColors;else if(x.parameters[J])x.parameters[J]=THREE.VertexColors;if(x.parameters.opacity!==void 0&&x.parameters.opacity<1)x.parameters.transparent=
-!0;if(x.parameters.normalMap){u=THREE.ShaderUtils.lib.normal;b=THREE.UniformsUtils.clone(u.uniforms);E=x.parameters.color;K=x.parameters.specular;A=x.parameters.ambient;L=x.parameters.shininess;b.tNormal.texture=M.textures[x.parameters.normalMap];if(x.parameters.normalMapFactor)b.uNormalScale.value=x.parameters.normalMapFactor;if(x.parameters.map)b.tDiffuse.texture=x.parameters.map,b.enableDiffuse.value=!0;if(x.parameters.lightMap)b.tAO.texture=x.parameters.lightMap,b.enableAO.value=!0;if(x.parameters.specularMap)b.tSpecular.texture=
-M.textures[x.parameters.specularMap],b.enableSpecular.value=!0;b.uDiffuseColor.value.setHex(E);b.uSpecularColor.value.setHex(K);b.uAmbientColor.value.setHex(A);b.uShininess.value=L;if(x.parameters.opacity)b.uOpacity.value=x.parameters.opacity;x=new THREE.MeshShaderMaterial({fragmentShader:u.fragmentShader,vertexShader:u.vertexShader,uniforms:b,lights:!0,fog:!0})}else x=new THREE[x.type](x.parameters);M.materials[v]=x}k();e.callbackSync(M)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};
+A.tube,A.segmentsR,A.segmentsT),M.geometries[u]=C):A.type=="icosahedron"?(C=new THREE.IcosahedronGeometry(A.subdivisions),M.geometries[u]=C):A.type=="bin_mesh"?E.load({model:f(A.url,S.urlBaseType),callback:m(u)}):A.type=="ascii_mesh"?K.load({model:f(A.url,S.urlBaseType),callback:m(u)}):A.type=="embedded_mesh"&&(A=S.embeds[A.id])&&K.createModel(A,o(u),"");for(y in S.textures)if(u=S.textures[y],u.url instanceof Array){n+=u.url.length;for(E=0;E<u.url.length;E++)e.onLoadStart()}else n+=1,e.onLoadStart();
+X=n;for(y in S.textures){u=S.textures[y];if(u.mapping!=void 0&&THREE[u.mapping]!=void 0)u.mapping=new THREE[u.mapping];if(u.url instanceof Array){E=[];for(var ha=0;ha<u.url.length;ha++)E[ha]=f(u.url[ha],S.urlBaseType);E=THREE.ImageUtils.loadTextureCube(E,u.mapping,b)}else{E=THREE.ImageUtils.loadTexture(f(u.url,S.urlBaseType),u.mapping,b);if(THREE[u.minFilter]!=void 0)E.minFilter=THREE[u.minFilter];if(THREE[u.magFilter]!=void 0)E.magFilter=THREE[u.magFilter];if(u.repeat){E.repeat.set(u.repeat[0],u.repeat[1]);
+if(u.repeat[0]!=1)E.wrapS=THREE.RepeatWrapping;if(u.repeat[1]!=1)E.wrapT=THREE.RepeatWrapping}u.offset&&E.offset.set(u.offset[0],u.offset[1]);if(u.wrap){K={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(K[u.wrap[0]]!==void 0)E.wrapS=K[u.wrap[0]];if(K[u.wrap[1]]!==void 0)E.wrapT=K[u.wrap[1]]}}M.textures[y]=E}for(v in S.materials){y=S.materials[v];for(J in y.parameters)if(J=="envMap"||J=="map"||J=="lightMap")y.parameters[J]=M.textures[y.parameters[J]];else if(J=="shading")y.parameters[J]=
+y.parameters[J]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(J=="blending")y.parameters[J]=THREE[y.parameters[J]]?THREE[y.parameters[J]]:THREE.NormalBlending;else if(J=="combine")y.parameters[J]=y.parameters[J]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(J=="vertexColors")if(y.parameters[J]=="face")y.parameters[J]=THREE.FaceColors;else if(y.parameters[J])y.parameters[J]=THREE.VertexColors;if(y.parameters.opacity!==void 0&&y.parameters.opacity<1)y.parameters.transparent=
+!0;if(y.parameters.normalMap){u=THREE.ShaderUtils.lib.normal;b=THREE.UniformsUtils.clone(u.uniforms);E=y.parameters.color;K=y.parameters.specular;A=y.parameters.ambient;L=y.parameters.shininess;b.tNormal.texture=M.textures[y.parameters.normalMap];if(y.parameters.normalMapFactor)b.uNormalScale.value=y.parameters.normalMapFactor;if(y.parameters.map)b.tDiffuse.texture=y.parameters.map,b.enableDiffuse.value=!0;if(y.parameters.lightMap)b.tAO.texture=y.parameters.lightMap,b.enableAO.value=!0;if(y.parameters.specularMap)b.tSpecular.texture=
+M.textures[y.parameters.specularMap],b.enableSpecular.value=!0;b.uDiffuseColor.value.setHex(E);b.uSpecularColor.value.setHex(K);b.uAmbientColor.value.setHex(A);b.uShininess.value=L;if(y.parameters.opacity)b.uOpacity.value=y.parameters.opacity;y=new THREE.MeshShaderMaterial({fragmentShader:u.fragmentShader,vertexShader:u.vertexShader,uniforms:b,lights:!0,fog:!0})}else y=new THREE[y.type](y.parameters);M.materials[v]=y}k();e.callbackSync(M)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};
 THREE.UTF8Loader.prototype=new THREE.UTF8Loader;THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
 THREE.UTF8Loader.prototype=new THREE.UTF8Loader;THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
 THREE.UTF8Loader.prototype={load:function(b){var c=new XMLHttpRequest,e=b.model,f=b.callback,g=b.scale!==void 0?b.scale:1,j=b.offsetX!==void 0?b.offsetX:0,h=b.offsetY!==void 0?b.offsetY:0,k=b.offsetZ!==void 0?b.offsetZ:0;c.onreadystatechange=function(){c.readyState==4?c.status==200||c.status==0?THREE.UTF8Loader.prototype.createModel(c.responseText,f,g,j,h,k):alert("Couldn't load ["+e+"] ["+c.status+"]"):c.readyState!=3&&c.readyState==2&&c.getResponseHeader("Content-Length")};c.open("GET",e,!0);c.send(null)},
 THREE.UTF8Loader.prototype={load:function(b){var c=new XMLHttpRequest,e=b.model,f=b.callback,g=b.scale!==void 0?b.scale:1,j=b.offsetX!==void 0?b.offsetX:0,h=b.offsetY!==void 0?b.offsetY:0,k=b.offsetZ!==void 0?b.offsetZ:0;c.onreadystatechange=function(){c.readyState==4?c.status==200||c.status==0?THREE.UTF8Loader.prototype.createModel(c.responseText,f,g,j,h,k):alert("Couldn't load ["+e+"] ["+c.status+"]"):c.readyState!=3&&c.readyState==2&&c.getResponseHeader("Content-Length")};c.open("GET",e,!0);c.send(null)},
-decompressMesh:function(b){var c=b.charCodeAt(0);c>=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,g=0;g<8;g++){for(var j=0,h=0;h<c;++h){var k=b.charCodeAt(h+f);j+=k>>1^-(k&1);e[8*h+g]=j}f+=c}c=b.length-f;j=new Uint16Array(c);for(g=h=0;g<c;g++)k=b.charCodeAt(g+f),j[g]=h-k,k==0&&h++;return[e,j]},createModel:function(b,c,e,f,g,j){var h=function(){var c=this;c.materials=[];THREE.Geometry.call(this);var h=THREE.UTF8Loader.prototype.decompressMesh(b),o=[],p=[];(function(b,h,n){for(var o,p,A,
-x=b.length;n<x;n+=h)o=b[n],p=b[n+1],A=b[n+2],o=o/16383*e,p=p/16383*e,A=A/16383*e,o+=f,p+=g,A+=j,THREE.UTF8Loader.prototype.v(c,o,p,A)})(h[0],8,0);(function(b,c,e){for(var f,g,h=b.length;e<h;e+=c)f=b[e],g=b[e+1],f/=1023,g/=1023,p.push(f,g)})(h[0],8,3);(function(b,c,e){for(var f,g,h,j=b.length;e<j;e+=c)f=b[e],g=b[e+1],h=b[e+2],f=(f-512)/511,g=(g-512)/511,h=(h-512)/511,o.push(f,g,h)})(h[0],8,5);(function(b){var e,f,g,h,j,n,G,D=b.length;for(e=0;e<D;e+=3)f=b[e],g=b[e+1],h=b[e+2],THREE.UTF8Loader.prototype.f3n(c,
-o,f,g,h,0,f,g,h),j=p[f*2],f=p[f*2+1],n=p[g*2],g=p[g*2+1],G=p[h*2],h=p[h*2+1],THREE.UTF8Loader.prototype.uv3(c.faceVertexUvs[0],j,f,n,g,G,h)})(h[1]);this.computeCentroids();this.computeFaceNormals()};h.prototype=new THREE.Geometry;h.prototype.constructor=h;c(new h)},v:function(b,c,e,f){b.vertices.push(new THREE.Vertex(new THREE.Vector3(c,e,f)))},f3n:function(b,c,e,f,g,j,h,k,n){var j=b.materials[j],o=c[k*3],p=c[k*3+1],k=c[k*3+2],u=c[n*3],v=c[n*3+1],n=c[n*3+2],h=new THREE.Vector3(c[h*3],c[h*3+1],c[h*
-3+2]),k=new THREE.Vector3(o,p,k),n=new THREE.Vector3(u,v,n);b.faces.push(new THREE.Face3(e,f,g,[h,k,n],null,j))},uv3:function(b,c,e,f,g,j,h){var k=[];k.push(new THREE.UV(c,e));k.push(new THREE.UV(f,g));k.push(new THREE.UV(j,h));b.push(k)},constructor:THREE.UTF8Loader};
+decompressMesh:function(b){var c=b.charCodeAt(0);c>=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,g=0;g<8;g++){for(var j=0,h=0;h<c;++h){var k=b.charCodeAt(h+f);j+=k>>1^-(k&1);e[8*h+g]=j}f+=c}c=b.length-f;j=new Uint16Array(c);for(g=h=0;g<c;g++)k=b.charCodeAt(g+f),j[g]=h-k,k==0&&h++;return[e,j]},createModel:function(b,c,e,f,g,j){var h=function(){var c=this;c.materials=[];THREE.Geometry.call(this);var h=THREE.UTF8Loader.prototype.decompressMesh(b),o=[],p=[];(function(b,h,m){for(var o,p,A,
+y=b.length;m<y;m+=h)o=b[m],p=b[m+1],A=b[m+2],o=o/16383*e,p=p/16383*e,A=A/16383*e,o+=f,p+=g,A+=j,THREE.UTF8Loader.prototype.v(c,o,p,A)})(h[0],8,0);(function(b,c,e){for(var f,g,h=b.length;e<h;e+=c)f=b[e],g=b[e+1],f/=1023,g/=1023,p.push(f,g)})(h[0],8,3);(function(b,c,e){for(var f,g,h,j=b.length;e<j;e+=c)f=b[e],g=b[e+1],h=b[e+2],f=(f-512)/511,g=(g-512)/511,h=(h-512)/511,o.push(f,g,h)})(h[0],8,5);(function(b){var e,f,g,h,j,m,G,D=b.length;for(e=0;e<D;e+=3)f=b[e],g=b[e+1],h=b[e+2],THREE.UTF8Loader.prototype.f3n(c,
+o,f,g,h,0,f,g,h),j=p[f*2],f=p[f*2+1],m=p[g*2],g=p[g*2+1],G=p[h*2],h=p[h*2+1],THREE.UTF8Loader.prototype.uv3(c.faceVertexUvs[0],j,f,m,g,G,h)})(h[1]);this.computeCentroids();this.computeFaceNormals()};h.prototype=new THREE.Geometry;h.prototype.constructor=h;c(new h)},v:function(b,c,e,f){b.vertices.push(new THREE.Vertex(new THREE.Vector3(c,e,f)))},f3n:function(b,c,e,f,g,j,h,k,m){var j=b.materials[j],o=c[k*3],p=c[k*3+1],k=c[k*3+2],u=c[m*3],v=c[m*3+1],m=c[m*3+2],h=new THREE.Vector3(c[h*3],c[h*3+1],c[h*
+3+2]),k=new THREE.Vector3(o,p,k),m=new THREE.Vector3(u,v,m);b.faces.push(new THREE.Face3(e,f,g,[h,k,m],null,j))},uv3:function(b,c,e,f,g,j,h){var k=[];k.push(new THREE.UV(c,e));k.push(new THREE.UV(f,g));k.push(new THREE.UV(j,h));b.push(k)},constructor:THREE.UTF8Loader};
 THREE.MarchingCubes=function(b,c){THREE.Object3D.call(this);this.materials=c instanceof Array?c:[c];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=
 THREE.MarchingCubes=function(b,c){THREE.Object3D.call(this);this.materials=c instanceof Array?c:[c];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.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,c,g){return b+(c-b)*g};this.VIntX=function(b,c,g,j,h,k,n,o,p,u){h=(h-p)/(u-p);p=this.normal_cache;c[j]=k+h*this.delta;c[j+1]=n;c[j+2]=o;g[j]=this.lerp(p[b],p[b+3],h);g[j+1]=this.lerp(p[b+1],p[b+4],h);g[j+2]=this.lerp(p[b+2],p[b+5],h)};this.VIntY=function(b,c,g,j,h,k,n,o,p,u){h=(h-p)/(u-p);p=this.normal_cache;c[j]=k;c[j+1]=n+h*this.delta;c[j+
-2]=o;c=b+this.yd*3;g[j]=this.lerp(p[b],p[c],h);g[j+1]=this.lerp(p[b+1],p[c+1],h);g[j+2]=this.lerp(p[b+2],p[c+2],h)};this.VIntZ=function(b,c,g,j,h,k,n,o,p,u){h=(h-p)/(u-p);p=this.normal_cache;c[j]=k;c[j+1]=n;c[j+2]=o+h*this.delta;c=b+this.zd*3;g[j]=this.lerp(p[b],p[c],h);g[j+1]=this.lerp(p[b+1],p[c+1],h);g[j+2]=this.lerp(p[b+2],p[c+2],h)};this.compNorm=function(b){var c=b*3;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,g,j,h,k){var n=j+1,o=j+this.yd,p=j+this.zd,u=n+this.yd,v=n+this.zd,t=j+this.yd+this.zd,y=n+this.yd+this.zd,w=0,A=this.field[j],x=this.field[n],G=this.field[o],D=this.field[u],I=this.field[p],J=this.field[v],C=this.field[t],B=this.field[y];A<h&&(w|=1);x<h&&(w|=2);G<h&&(w|=8);D<h&&(w|=4);I<h&&(w|=16);J<h&&(w|=32);C<h&&(w|=128);B<h&&(w|=64);var L=THREE.edgeTable[w];if(L==0)return 0;var E=this.delta,
-V=b+E,H=c+E,E=g+E;L&1&&(this.compNorm(j),this.compNorm(n),this.VIntX(j*3,this.vlist,this.nlist,0,h,b,c,g,A,x));L&2&&(this.compNorm(n),this.compNorm(u),this.VIntY(n*3,this.vlist,this.nlist,3,h,V,c,g,x,D));L&4&&(this.compNorm(o),this.compNorm(u),this.VIntX(o*3,this.vlist,this.nlist,6,h,b,H,g,G,D));L&8&&(this.compNorm(j),this.compNorm(o),this.VIntY(j*3,this.vlist,this.nlist,9,h,b,c,g,A,G));L&16&&(this.compNorm(p),this.compNorm(v),this.VIntX(p*3,this.vlist,this.nlist,12,h,b,c,E,I,J));L&32&&(this.compNorm(v),
-this.compNorm(y),this.VIntY(v*3,this.vlist,this.nlist,15,h,V,c,E,J,B));L&64&&(this.compNorm(t),this.compNorm(y),this.VIntX(t*3,this.vlist,this.nlist,18,h,b,H,E,C,B));L&128&&(this.compNorm(p),this.compNorm(t),this.VIntY(p*3,this.vlist,this.nlist,21,h,b,c,E,I,C));L&256&&(this.compNorm(j),this.compNorm(p),this.VIntZ(j*3,this.vlist,this.nlist,24,h,b,c,g,A,I));L&512&&(this.compNorm(n),this.compNorm(v),this.VIntZ(n*3,this.vlist,this.nlist,27,h,V,c,g,x,J));L&1024&&(this.compNorm(u),this.compNorm(y),this.VIntZ(u*
-3,this.vlist,this.nlist,30,h,V,H,g,D,B));L&2048&&(this.compNorm(o),this.compNorm(t),this.VIntZ(o*3,this.vlist,this.nlist,33,h,b,H,g,G,C));w<<=4;for(h=j=0;THREE.triTable[w+h]!=-1;)b=w+h,c=b+1,g=b+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[c],3*THREE.triTable[g],k),h+=3,j++;return j};this.posnormtriv=function(b,c,g,j,h,k){var n=this.count*3;this.positionArray[n]=b[g];this.positionArray[n+1]=b[g+1];this.positionArray[n+2]=b[g+2];this.positionArray[n+3]=b[j];this.positionArray[n+
-4]=b[j+1];this.positionArray[n+5]=b[j+2];this.positionArray[n+6]=b[h];this.positionArray[n+7]=b[h+1];this.positionArray[n+8]=b[h+2];this.normalArray[n]=c[g];this.normalArray[n+1]=c[g+1];this.normalArray[n+2]=c[g+2];this.normalArray[n+3]=c[j];this.normalArray[n+4]=c[j+1];this.normalArray[n+5]=c[j+2];this.normalArray[n+6]=c[h];this.normalArray[n+7]=c[h+1];this.normalArray[n+8]=c[h+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&k(this)};this.begin=function(){this.count=0;
-this.hasNormal=this.hasPos=!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,g,j,h){var k=this.size*Math.sqrt(j/h),n=g*this.size,o=c*this.size,p=b*this.size,u=Math.floor(n-k);u<1&&(u=1);n=Math.floor(n+k);n>this.size-1&&(n=this.size-1);var v=Math.floor(o-k);v<1&&(v=1);o=Math.floor(o+k);o>this.size-1&&(o=this.size-1);var t=Math.floor(p-k);t<1&&(t=1);k=Math.floor(p+k);k>this.size-1&&(k=this.size-
-1);for(var y,w,A,x,G,D;u<n;u++){p=this.size2*u;w=u/this.size-g;G=w*w;for(w=v;w<o;w++){A=p+this.size*w;y=w/this.size-c;D=y*y;for(y=t;y<k;y++)x=y/this.size-b,x=j/(1.0E-6+x*x+D+G)-h,x>0&&(this.field[A+y]+=x)}}};this.addPlaneX=function(b,c){var g,j,h,k,n,o=this.size,p=this.yd,u=this.zd,v=this.field,t=o*Math.sqrt(b/c);t>o&&(t=o);for(g=0;g<t;g++)if(j=g/o,j*=j,k=b/(1.0E-4+j)-c,k>0)for(j=0;j<o;j++){n=g+j*p;for(h=0;h<o;h++)v[u*h+n]+=k}};this.addPlaneY=function(b,c){var g,j,h,k,n,o,p=this.size,u=this.yd,v=
-this.zd,t=this.field,y=p*Math.sqrt(b/c);y>p&&(y=p);for(j=0;j<y;j++)if(g=j/p,g*=g,k=b/(1.0E-4+g)-c,k>0){n=j*u;for(g=0;g<p;g++){o=n+g;for(h=0;h<p;h++)t[v*h+o]+=k}}};this.addPlaneZ=function(b,c){var g,j,h,k,n,o;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/c);dist>size&&(dist=size);for(h=0;h<dist;h++)if(g=h/size,g*=g,k=b/(1.0E-4+g)-c,k>0){n=zd*h;for(j=0;j<size;j++){o=n+j*yd;for(g=0;g<size;g++)field[o+g]+=k}}};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,g,j,h,k,n,o,p,u,v=this.size-2;for(h=1;h<v;h++){u=this.size2*h;o=(h-this.halfsize)/this.halfsize;for(j=1;j<v;j++){p=u+this.size*j;n=(j-this.halfsize)/this.halfsize;for(g=1;g<v;g++)k=(g-this.halfsize)/this.halfsize,c=p+g,this.polygonize(k,n,o,c,this.isolation,b)}}this.end(b)};this.generateGeometry=function(){var b=0,c=new THREE.Geometry,g=[];this.render(function(j){var h,k,n,o,p,u,v,t;for(h=0;h<j.count;h++)v=h*3,p=v+1,t=v+2,k=j.positionArray[v],
-n=j.positionArray[p],o=j.positionArray[t],u=new THREE.Vector3(k,n,o),k=j.normalArray[v],n=j.normalArray[p],o=j.normalArray[t],v=new THREE.Vector3(k,n,o),v.normalize(),p=new THREE.Vertex(u),c.vertices.push(p),g.push(v);nfaces=j.count/3;for(h=0;h<nfaces;h++)v=(b+h)*3,p=v+1,t=v+2,u=g[v],k=g[p],n=g[t],v=new THREE.Face3(v,p,t,[u,k,n]),c.faces.push(v);b+=nfaces;j.count=0});return c};this.init(b)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
+0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,c,g){return b+(c-b)*g};this.VIntX=function(b,c,g,j,h,k,m,o,p,u){h=(h-p)/(u-p);p=this.normal_cache;c[j]=k+h*this.delta;c[j+1]=m;c[j+2]=o;g[j]=this.lerp(p[b],p[b+3],h);g[j+1]=this.lerp(p[b+1],p[b+4],h);g[j+2]=this.lerp(p[b+2],p[b+5],h)};this.VIntY=function(b,c,g,j,h,k,m,o,p,u){h=(h-p)/(u-p);p=this.normal_cache;c[j]=k;c[j+1]=m+h*this.delta;c[j+
+2]=o;c=b+this.yd*3;g[j]=this.lerp(p[b],p[c],h);g[j+1]=this.lerp(p[b+1],p[c+1],h);g[j+2]=this.lerp(p[b+2],p[c+2],h)};this.VIntZ=function(b,c,g,j,h,k,m,o,p,u){h=(h-p)/(u-p);p=this.normal_cache;c[j]=k;c[j+1]=m;c[j+2]=o+h*this.delta;c=b+this.zd*3;g[j]=this.lerp(p[b],p[c],h);g[j+1]=this.lerp(p[b+1],p[c+1],h);g[j+2]=this.lerp(p[b+2],p[c+2],h)};this.compNorm=function(b){var c=b*3;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,g,j,h,k){var m=j+1,o=j+this.yd,p=j+this.zd,u=m+this.yd,v=m+this.zd,t=j+this.yd+this.zd,x=m+this.yd+this.zd,w=0,A=this.field[j],y=this.field[m],G=this.field[o],D=this.field[u],I=this.field[p],J=this.field[v],C=this.field[t],B=this.field[x];A<h&&(w|=1);y<h&&(w|=2);G<h&&(w|=8);D<h&&(w|=4);I<h&&(w|=16);J<h&&(w|=32);C<h&&(w|=128);B<h&&(w|=64);var L=THREE.edgeTable[w];if(L==0)return 0;var E=this.delta,
+V=b+E,H=c+E,E=g+E;L&1&&(this.compNorm(j),this.compNorm(m),this.VIntX(j*3,this.vlist,this.nlist,0,h,b,c,g,A,y));L&2&&(this.compNorm(m),this.compNorm(u),this.VIntY(m*3,this.vlist,this.nlist,3,h,V,c,g,y,D));L&4&&(this.compNorm(o),this.compNorm(u),this.VIntX(o*3,this.vlist,this.nlist,6,h,b,H,g,G,D));L&8&&(this.compNorm(j),this.compNorm(o),this.VIntY(j*3,this.vlist,this.nlist,9,h,b,c,g,A,G));L&16&&(this.compNorm(p),this.compNorm(v),this.VIntX(p*3,this.vlist,this.nlist,12,h,b,c,E,I,J));L&32&&(this.compNorm(v),
+this.compNorm(x),this.VIntY(v*3,this.vlist,this.nlist,15,h,V,c,E,J,B));L&64&&(this.compNorm(t),this.compNorm(x),this.VIntX(t*3,this.vlist,this.nlist,18,h,b,H,E,C,B));L&128&&(this.compNorm(p),this.compNorm(t),this.VIntY(p*3,this.vlist,this.nlist,21,h,b,c,E,I,C));L&256&&(this.compNorm(j),this.compNorm(p),this.VIntZ(j*3,this.vlist,this.nlist,24,h,b,c,g,A,I));L&512&&(this.compNorm(m),this.compNorm(v),this.VIntZ(m*3,this.vlist,this.nlist,27,h,V,c,g,y,J));L&1024&&(this.compNorm(u),this.compNorm(x),this.VIntZ(u*
+3,this.vlist,this.nlist,30,h,V,H,g,D,B));L&2048&&(this.compNorm(o),this.compNorm(t),this.VIntZ(o*3,this.vlist,this.nlist,33,h,b,H,g,G,C));w<<=4;for(h=j=0;THREE.triTable[w+h]!=-1;)b=w+h,c=b+1,g=b+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[c],3*THREE.triTable[g],k),h+=3,j++;return j};this.posnormtriv=function(b,c,g,j,h,k){var m=this.count*3;this.positionArray[m]=b[g];this.positionArray[m+1]=b[g+1];this.positionArray[m+2]=b[g+2];this.positionArray[m+3]=b[j];this.positionArray[m+
+4]=b[j+1];this.positionArray[m+5]=b[j+2];this.positionArray[m+6]=b[h];this.positionArray[m+7]=b[h+1];this.positionArray[m+8]=b[h+2];this.normalArray[m]=c[g];this.normalArray[m+1]=c[g+1];this.normalArray[m+2]=c[g+2];this.normalArray[m+3]=c[j];this.normalArray[m+4]=c[j+1];this.normalArray[m+5]=c[j+2];this.normalArray[m+6]=c[h];this.normalArray[m+7]=c[h+1];this.normalArray[m+8]=c[h+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&k(this)};this.begin=function(){this.count=0;
+this.hasNormal=this.hasPos=!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,g,j,h){var k=this.size*Math.sqrt(j/h),m=g*this.size,o=c*this.size,p=b*this.size,u=Math.floor(m-k);u<1&&(u=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var v=Math.floor(o-k);v<1&&(v=1);o=Math.floor(o+k);o>this.size-1&&(o=this.size-1);var t=Math.floor(p-k);t<1&&(t=1);k=Math.floor(p+k);k>this.size-1&&(k=this.size-
+1);for(var x,w,A,y,G,D;u<m;u++){p=this.size2*u;w=u/this.size-g;G=w*w;for(w=v;w<o;w++){A=p+this.size*w;x=w/this.size-c;D=x*x;for(x=t;x<k;x++)y=x/this.size-b,y=j/(1.0E-6+y*y+D+G)-h,y>0&&(this.field[A+x]+=y)}}};this.addPlaneX=function(b,c){var g,j,h,k,m,o=this.size,p=this.yd,u=this.zd,v=this.field,t=o*Math.sqrt(b/c);t>o&&(t=o);for(g=0;g<t;g++)if(j=g/o,j*=j,k=b/(1.0E-4+j)-c,k>0)for(j=0;j<o;j++){m=g+j*p;for(h=0;h<o;h++)v[u*h+m]+=k}};this.addPlaneY=function(b,c){var g,j,h,k,m,o,p=this.size,u=this.yd,v=
+this.zd,t=this.field,x=p*Math.sqrt(b/c);x>p&&(x=p);for(j=0;j<x;j++)if(g=j/p,g*=g,k=b/(1.0E-4+g)-c,k>0){m=j*u;for(g=0;g<p;g++){o=m+g;for(h=0;h<p;h++)t[v*h+o]+=k}}};this.addPlaneZ=function(b,c){var g,j,h,k,m,o;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/c);dist>size&&(dist=size);for(h=0;h<dist;h++)if(g=h/size,g*=g,k=b/(1.0E-4+g)-c,k>0){m=zd*h;for(j=0;j<size;j++){o=m+j*yd;for(g=0;g<size;g++)field[o+g]+=k}}};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,g,j,h,k,m,o,p,u,v=this.size-2;for(h=1;h<v;h++){u=this.size2*h;o=(h-this.halfsize)/this.halfsize;for(j=1;j<v;j++){p=u+this.size*j;m=(j-this.halfsize)/this.halfsize;for(g=1;g<v;g++)k=(g-this.halfsize)/this.halfsize,c=p+g,this.polygonize(k,m,o,c,this.isolation,b)}}this.end(b)};this.generateGeometry=function(){var b=0,c=new THREE.Geometry,g=[];this.render(function(j){var h,k,m,o,p,u,v,t;for(h=0;h<j.count;h++)v=h*3,p=v+1,t=v+2,k=j.positionArray[v],
+m=j.positionArray[p],o=j.positionArray[t],u=new THREE.Vector3(k,m,o),k=j.normalArray[v],m=j.normalArray[p],o=j.normalArray[t],v=new THREE.Vector3(k,m,o),v.normalize(),p=new THREE.Vertex(u),c.vertices.push(p),g.push(v);nfaces=j.count/3;for(h=0;h<nfaces;h++)v=(b+h)*3,p=v+1,t=v+2,u=g[v],k=g[p],m=g[t],v=new THREE.Face3(v,p,t,[u,k,m]),c.faces.push(v);b+=nfaces;j.count=0});return c};this.init(b)};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,
 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,
 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]);
 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]);
@@ -605,20 +610,20 @@ THREE.MeshCollider=function(b,c){this.mesh=b;this.box=c;this.numFaces=this.mesh.
 THREE.CollisionSystem.prototype.rayCastAll=function(b){b.direction.normalize();this.hits.length=0;var c,e,f,g,j=0;c=0;for(e=this.colliders.length;c<e;c++)if(g=this.colliders[c],f=this.rayCast(b,g),f<Number.MAX_VALUE)g.distance=f,f>j?this.hits.push(g):this.hits.unshift(g),j=f;return this.hits};
 THREE.CollisionSystem.prototype.rayCastAll=function(b){b.direction.normalize();this.hits.length=0;var c,e,f,g,j=0;c=0;for(e=this.colliders.length;c<e;c++)if(g=this.colliders[c],f=this.rayCast(b,g),f<Number.MAX_VALUE)g.distance=f,f>j?this.hits.push(g):this.hits.unshift(g),j=f;return this.hits};
 THREE.CollisionSystem.prototype.rayCastNearest=function(b){var c=this.rayCastAll(b);if(c.length==0)return null;for(var e=0;c[e]instanceof THREE.MeshCollider;){var f=this.rayMesh(b,c[e]);if(f.dist<Number.MAX_VALUE){c[e].distance=f.dist;c[e].faceIndex=f.faceIndex;break}e++}if(e>c.length)return null;return c[e]};
 THREE.CollisionSystem.prototype.rayCastNearest=function(b){var c=this.rayCastAll(b);if(c.length==0)return null;for(var e=0;c[e]instanceof THREE.MeshCollider;){var f=this.rayMesh(b,c[e]);if(f.dist<Number.MAX_VALUE){c[e].distance=f.dist;c[e].faceIndex=f.faceIndex;break}e++}if(e>c.length)return null;return c[e]};
 THREE.CollisionSystem.prototype.rayCast=function(b,c){if(c instanceof THREE.PlaneCollider)return this.rayPlane(b,c);else if(c instanceof THREE.SphereCollider)return this.raySphere(b,c);else if(c instanceof THREE.BoxCollider)return this.rayBox(b,c);else if(c instanceof THREE.MeshCollider&&c.box)return this.rayBox(b,c.box)};
 THREE.CollisionSystem.prototype.rayCast=function(b,c){if(c instanceof THREE.PlaneCollider)return this.rayPlane(b,c);else if(c instanceof THREE.SphereCollider)return this.raySphere(b,c);else if(c instanceof THREE.BoxCollider)return this.rayBox(b,c);else if(c instanceof THREE.MeshCollider&&c.box)return this.rayBox(b,c.box)};
-THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,g,j=0;j<c.numFaces;j++){var h=c.mesh.geometry.faces[j],k=c.mesh.geometry.vertices[h.a].position,n=c.mesh.geometry.vertices[h.b].position,o=c.mesh.geometry.vertices[h.c].position,p=h instanceof THREE.Face4?c.mesh.geometry.vertices[h.d].position:null;h instanceof THREE.Face3?(h=this.rayTriangle(e,k,n,o,f,this.collisionNormal,c.mesh),h<f&&(f=h,g=j,c.normal.copy(this.collisionNormal),c.normal.normalize())):
-h instanceof THREE.Face4&&(h=this.rayTriangle(e,k,n,p,f,this.collisionNormal,c.mesh),h<f&&(f=h,g=j,c.normal.copy(this.collisionNormal),c.normal.normalize()),h=this.rayTriangle(e,n,o,p,f,this.collisionNormal,c.mesh),h<f&&(f=h,g=j,c.normal.copy(this.collisionNormal),c.normal.normalize()))}return{dist:f,faceIndex:g}};
-THREE.CollisionSystem.prototype.rayTriangle=function(b,c,e,f,g,j,h){var k=THREE.CollisionSystem.__v1,n=THREE.CollisionSystem.__v2;j.set(0,0,0);k.sub(e,c);n.sub(f,e);j.cross(k,n);k=j.dot(b.direction);if(!(k<0))if(h.doubleSided||h.flipSided)j.multiplyScalar(-1),k*=-1;else return Number.MAX_VALUE;h=j.dot(c)-j.dot(b.origin);if(!(h<=0))return Number.MAX_VALUE;if(!(h>=k*g))return Number.MAX_VALUE;h/=k;k=THREE.CollisionSystem.__v3;k.copy(b.direction);k.multiplyScalar(h);k.addSelf(b.origin);Math.abs(j.x)>
+THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,g,j=0;j<c.numFaces;j++){var h=c.mesh.geometry.faces[j],k=c.mesh.geometry.vertices[h.a].position,m=c.mesh.geometry.vertices[h.b].position,o=c.mesh.geometry.vertices[h.c].position,p=h instanceof THREE.Face4?c.mesh.geometry.vertices[h.d].position:null;h instanceof THREE.Face3?(h=this.rayTriangle(e,k,m,o,f,this.collisionNormal,c.mesh),h<f&&(f=h,g=j,c.normal.copy(this.collisionNormal),c.normal.normalize())):
+h instanceof THREE.Face4&&(h=this.rayTriangle(e,k,m,p,f,this.collisionNormal,c.mesh),h<f&&(f=h,g=j,c.normal.copy(this.collisionNormal),c.normal.normalize()),h=this.rayTriangle(e,m,o,p,f,this.collisionNormal,c.mesh),h<f&&(f=h,g=j,c.normal.copy(this.collisionNormal),c.normal.normalize()))}return{dist:f,faceIndex:g}};
+THREE.CollisionSystem.prototype.rayTriangle=function(b,c,e,f,g,j,h){var k=THREE.CollisionSystem.__v1,m=THREE.CollisionSystem.__v2;j.set(0,0,0);k.sub(e,c);m.sub(f,e);j.cross(k,m);k=j.dot(b.direction);if(!(k<0))if(h.doubleSided||h.flipSided)j.multiplyScalar(-1),k*=-1;else return Number.MAX_VALUE;h=j.dot(c)-j.dot(b.origin);if(!(h<=0))return Number.MAX_VALUE;if(!(h>=k*g))return Number.MAX_VALUE;h/=k;k=THREE.CollisionSystem.__v3;k.copy(b.direction);k.multiplyScalar(h);k.addSelf(b.origin);Math.abs(j.x)>
 Math.abs(j.y)?Math.abs(j.x)>Math.abs(j.z)?(b=k.y-c.y,j=e.y-c.y,g=f.y-c.y,k=k.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=k.x-c.x,j=e.x-c.x,g=f.x-c.x,k=k.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(j.y)>Math.abs(j.z)?(b=k.x-c.x,j=e.x-c.x,g=f.x-c.x,k=k.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=k.x-c.x,j=e.x-c.x,g=f.x-c.x,k=k.y-c.y,e=e.y-c.y,f=f.y-c.y);c=j*f-e*g;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-k*g)*c;if(!(f>=0))return Number.MAX_VALUE;c*=j*k-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return h};
 Math.abs(j.y)?Math.abs(j.x)>Math.abs(j.z)?(b=k.y-c.y,j=e.y-c.y,g=f.y-c.y,k=k.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=k.x-c.x,j=e.x-c.x,g=f.x-c.x,k=k.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(j.y)>Math.abs(j.z)?(b=k.x-c.x,j=e.x-c.x,g=f.x-c.x,k=k.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=k.x-c.x,j=e.x-c.x,g=f.x-c.x,k=k.y-c.y,e=e.y-c.y,f=f.y-c.y);c=j*f-e*g;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-k*g)*c;if(!(f>=0))return Number.MAX_VALUE;c*=j*k-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return h};
 THREE.CollisionSystem.prototype.makeRayLocal=function(b,c){var e=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(c.matrixWorld,e);var f=THREE.CollisionSystem.__r;f.origin.copy(b.origin);f.direction.copy(b.direction);e.multiplyVector3(f.origin);e.rotateAxis(f.direction);f.direction.normalize();return f};
 THREE.CollisionSystem.prototype.makeRayLocal=function(b,c){var e=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(c.matrixWorld,e);var f=THREE.CollisionSystem.__r;f.origin.copy(b.origin);f.direction.copy(b.direction);e.multiplyVector3(f.origin);e.rotateAxis(f.direction);f.direction.normalize();return f};
-THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,g=0,j=0,h=0,k=0,n=0,o=!0;e.origin.x<c.min.x?(f=c.min.x-e.origin.x,f/=e.direction.x,o=!1,h=-1):e.origin.x>c.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,o=!1,h=1);e.origin.y<c.min.y?(g=c.min.y-e.origin.y,g/=e.direction.y,o=!1,k=-1):e.origin.y>c.max.y&&(g=c.max.y-e.origin.y,g/=e.direction.y,
-o=!1,k=1);e.origin.z<c.min.z?(j=c.min.z-e.origin.z,j/=e.direction.z,o=!1,n=-1):e.origin.z>c.max.z&&(j=c.max.z-e.origin.z,j/=e.direction.z,o=!1,n=1);if(o)return-1;o=0;g>f&&(o=1,f=g);j>f&&(o=2,f=j);switch(o){case 0:k=e.origin.y+e.direction.y*f;if(k<c.min.y||k>c.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(h,0,0);break;case 1:h=e.origin.x+e.direction.x*f;if(h<c.min.x||h>c.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*
-f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(0,k,0);break;case 2:h=e.origin.x+e.direction.x*f;if(h<c.min.x||h>c.max.x)return Number.MAX_VALUE;k=e.origin.y+e.direction.y*f;if(k<c.min.y||k>c.max.y)return Number.MAX_VALUE;c.normal.set(0,0,n)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE};
+THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,g=0,j=0,h=0,k=0,m=0,o=!0;e.origin.x<c.min.x?(f=c.min.x-e.origin.x,f/=e.direction.x,o=!1,h=-1):e.origin.x>c.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,o=!1,h=1);e.origin.y<c.min.y?(g=c.min.y-e.origin.y,g/=e.direction.y,o=!1,k=-1):e.origin.y>c.max.y&&(g=c.max.y-e.origin.y,g/=e.direction.y,
+o=!1,k=1);e.origin.z<c.min.z?(j=c.min.z-e.origin.z,j/=e.direction.z,o=!1,m=-1):e.origin.z>c.max.z&&(j=c.max.z-e.origin.z,j/=e.direction.z,o=!1,m=1);if(o)return-1;o=0;g>f&&(o=1,f=g);j>f&&(o=2,f=j);switch(o){case 0:k=e.origin.y+e.direction.y*f;if(k<c.min.y||k>c.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(h,0,0);break;case 1:h=e.origin.x+e.direction.x*f;if(h<c.min.x||h>c.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*
+f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(0,k,0);break;case 2:h=e.origin.x+e.direction.x*f;if(h<c.min.x||h>c.max.x)return Number.MAX_VALUE;k=e.origin.y+e.direction.y*f;if(k<c.min.y||k>c.max.y)return Number.MAX_VALUE;c.normal.set(0,0,m)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE};
 THREE.CollisionSystem.prototype.raySphere=function(b,c){var e=c.center.clone().subSelf(b.origin);if(e.lengthSq<c.radiusSq)return-1;var f=e.dot(b.direction.clone());if(f<=0)return Number.MAX_VALUE;e=c.radiusSq-(e.lengthSq()-f*f);if(e>=0)return Math.abs(f)-Math.sqrt(e);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4;
 THREE.CollisionSystem.prototype.raySphere=function(b,c){var e=c.center.clone().subSelf(b.origin);if(e.lengthSq<c.radiusSq)return-1;var f=e.dot(b.direction.clone());if(f<=0)return Number.MAX_VALUE;e=c.radiusSq-(e.lengthSq()-f*f);if(e>=0)return Math.abs(f)-Math.sqrt(e);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4;
 THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(b){b.geometry.computeBoundingBox();var c=b.geometry.boundingBox,e=new THREE.Vector3(c.x[0],c.y[0],c.z[0]),c=new THREE.Vector3(c.x[1],c.y[1],c.z[1]),e=new THREE.BoxCollider(e,c);e.mesh=b;return e};THREE.CollisionUtils.MeshAABB=function(b){var c=THREE.CollisionUtils.MeshOBB(b);c.min.addSelf(b.position);c.max.addSelf(b.position);c.dynamic=!1;return c};
 THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(b){b.geometry.computeBoundingBox();var c=b.geometry.boundingBox,e=new THREE.Vector3(c.x[0],c.y[0],c.z[0]),c=new THREE.Vector3(c.x[1],c.y[1],c.z[1]),e=new THREE.BoxCollider(e,c);e.mesh=b;return e};THREE.CollisionUtils.MeshAABB=function(b){var c=THREE.CollisionUtils.MeshOBB(b);c.min.addSelf(b.position);c.max.addSelf(b.position);c.dynamic=!1;return c};
 THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))};
 THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))};
-if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,g=new THREE.Camera,j=new THREE.Camera,h=new THREE.Matrix4,k=new THREE.Matrix4,n,o,p;g.useTarget=j.useTarget=!1;g.matrixAutoUpdate=j.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},u=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.WebGLRenderTarget(512,512,b),t=new THREE.Camera(53,1,1,1E4);t.position.z=
+if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,g=new THREE.Camera,j=new THREE.Camera,h=new THREE.Matrix4,k=new THREE.Matrix4,m,o,p;g.useTarget=j.useTarget=!1;g.matrixAutoUpdate=j.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},u=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.WebGLRenderTarget(512,512,b),t=new THREE.Camera(53,1,1,1E4);t.position.z=
 2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:u},mapRight:{type:"t",value:1,texture:v}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});
 2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:u},mapRight:{type:"t",value:1,texture:v}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});
-var y=new THREE.Scene;y.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);u.width=b;u.height=f;v.width=b;v.height=f};this.render=function(b,e){e.update(null,!0);if(n!==e.aspect||o!==e.near||p!==e.fov){n=e.aspect;o=e.near;p=e.fov;var x=e.projectionMatrix.clone(),G=125/30*0.5,D=G*o/125,I=o*Math.tan(p*Math.PI/360),J;h.n14=G;k.n14=-G;G=-I*n+D;J=I*n+D;x.n11=2*o/(J-G);x.n13=(J+G)/(J-G);g.projectionMatrix=x.clone();G=-I*n-D;J=I*n-D;x.n11=2*o/(J-G);
-x.n13=(J+G)/(J-G);j.projectionMatrix=x.clone()}g.matrix=e.matrixWorld.clone().multiplySelf(k);g.update(null,!0);g.position.copy(e.position);g.near=o;g.far=e.far;f.call(c,b,g,u,!0);j.matrix=e.matrixWorld.clone().multiplySelf(h);j.update(null,!0);j.position.copy(e.position);j.near=o;j.far=e.far;f.call(c,b,j,v,!0);f.call(c,y,t)}};
+var x=new THREE.Scene;x.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);u.width=b;u.height=f;v.width=b;v.height=f};this.render=function(b,e){e.update(null,!0);if(m!==e.aspect||o!==e.near||p!==e.fov){m=e.aspect;o=e.near;p=e.fov;var y=e.projectionMatrix.clone(),G=125/30*0.5,D=G*o/125,I=o*Math.tan(p*Math.PI/360),J;h.n14=G;k.n14=-G;G=-I*m+D;J=I*m+D;y.n11=2*o/(J-G);y.n13=(J+G)/(J-G);g.projectionMatrix=y.clone();G=-I*m-D;J=I*m-D;y.n11=2*o/(J-G);
+y.n13=(J+G)/(J-G);j.projectionMatrix=y.clone()}g.matrix=e.matrixWorld.clone().multiplySelf(k);g.update(null,!0);g.position.copy(e.position);g.near=o;g.far=e.far;f.call(c,b,g,u,!0);j.matrix=e.matrixWorld.clone().multiplySelf(h);j.update(null,!0);j.position.copy(e.position);j.near=o;j.far=e.far;f.call(c,b,j,v,!0);f.call(c,x,t)}};
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,g,j,h=new THREE.Camera,k=new THREE.Camera;c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(b,f){e.call(c,b,f);g=b/2;j=f};this.render=function(b,e){this.clear();h.fov=e.fov;h.aspect=0.5*e.aspect;h.near=e.near;h.far=e.far;
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,g,j,h=new THREE.Camera,k=new THREE.Camera;c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(b,f){e.call(c,b,f);g=b/2;j=f};this.render=function(b,e){this.clear();h.fov=e.fov;h.aspect=0.5*e.aspect;h.near=e.near;h.far=e.far;
 h.updateProjectionMatrix();h.position.copy(e.position);h.target.position.copy(e.target.position);h.translateX(c.separation);k.projectionMatrix=h.projectionMatrix;k.position.copy(e.position);k.target.position.copy(e.target.position);k.translateX(-c.separation);this.setViewport(0,0,g,j);f.call(c,b,h);this.setViewport(g,0,g,j);f.call(c,b,k,!1)}};
 h.updateProjectionMatrix();h.position.copy(e.position);h.target.position.copy(e.target.position);h.translateX(c.separation);k.projectionMatrix=h.projectionMatrix;k.position.copy(e.position);k.target.position.copy(e.target.position);k.translateX(-c.separation);this.setViewport(0,0,g,j);f.call(c,b,h);this.setViewport(g,0,g,j);f.call(c,b,k,!1)}};

+ 78 - 76
build/custom/ThreeCanvas.js

@@ -1,51 +1,51 @@
-// ThreeCanvas.js r43 - http://github.com/mrdoob/three.js
+// ThreeCanvas.js r44dev - http://github.com/mrdoob/three.js
 var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this};
 var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this};
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,g;if(c==0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),e=a*6-d,a=c*(1-b),g=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,g;if(c==0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),e=a*6-d,a=c*(1-b),g=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=
 c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=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},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
 c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=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},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
-THREE.Vector2=function(a,b){this.set(a||0,b||0)};
+THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},
 divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},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.lengthSq())},normalize:function(){return this.divideScalar(this.length())},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},setLength:function(a){return this.normalize().multiplyScalar(a)},
 divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},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.lengthSq())},normalize:function(){return this.divideScalar(this.length())},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},setLength:function(a){return this.normalize().multiplyScalar(a)},
-unit:function(){return this.normalize()},equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)};
+equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0};
 THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){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},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=
 THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){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},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=
-a.z-b.z;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){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},divideSelf:function(a){return this.divide(this,a)},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},
+a.z-b.z;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){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},divideSelf:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},
 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.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){return this.set(this.y*
 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.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){return this.set(this.y*
 a.z-this.z*a.y,this.z*a.x-this.x*a.z,this.x*a.y-this.y*a.x)},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this,a).lengthSq()},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},isZero:function(){return this.lengthSq()<
 a.z-this.z*a.y,this.z*a.x-this.x*a.z,this.x*a.y-this.y*a.x)},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this,a).lengthSq()},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},isZero:function(){return this.lengthSq()<
-1.0E-4}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)};
-THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){return this.set(a.x,a.y,a.z,a.w||1)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add: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},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub: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},
-subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a,this.w/=a):this.set(0,0,0,1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},
-setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf: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}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
-THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d=[];b=0;for(c=a.length;b<c;b++)d=d.concat(this.intersectObject(a[b]));d.sort(function(a,b){return a.distance-b.distance});return d},intersectObject:function(a){function b(a,b,c){var d,c=c.matrixWorld.getPosition();d=c.clone().subSelf(a).dot(b);a=a.clone().addSelf(b.clone().multiplyScalar(d));return c.distanceTo(a)}function c(a,b,c,d){var d=d.clone().subSelf(b),
-c=c.clone().subSelf(b),e=a.clone().subSelf(b),a=d.dot(d),b=d.dot(c),d=d.dot(e),f=c.dot(c),c=c.dot(e),e=1/(a*f-b*b),f=(f*d-b*c)*e,a=(a*c-b*d)*e;return f>0&&a>0&&f+a<1}if(a instanceof THREE.Particle){var d=b(this.origin,this.direction,a);if(!d||d>a.scale.x)return[];return[{distance:d,point:a.position,face:null,object:a}]}else if(a instanceof THREE.Mesh){d=b(this.origin,this.direction,a);if(!d||d>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return[];var e,g,f,h,
-j,l,m,i,n,k,p=a.geometry,q=p.vertices,v=[],d=0;for(e=p.faces.length;d<e;d++)if(g=p.faces[d],n=this.origin.clone(),k=this.direction.clone(),l=a.matrixWorld,f=l.multiplyVector3(q[g.a].position.clone()),h=l.multiplyVector3(q[g.b].position.clone()),j=l.multiplyVector3(q[g.c].position.clone()),l=g instanceof THREE.Face4?l.multiplyVector3(q[g.d].position.clone()):null,m=a.matrixRotationWorld.multiplyVector3(g.normal.clone()),i=k.dot(m),a.doubleSided||(a.flipSided?i>0:i<0))if(m=m.dot((new THREE.Vector3).sub(f,
-n))/i,n=n.addSelf(k.multiplyScalar(m)),g instanceof THREE.Face3)c(n,f,h,j)&&(g={distance:this.origin.distanceTo(n),point:n,face:g,object:a},v.push(g));else if(g instanceof THREE.Face4&&(c(n,f,h,l)||c(n,h,j,l)))g={distance:this.origin.distanceTo(n),point:n,face:g,object:a},v.push(g);return v}else return[]}};
-THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return f};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(f,g,m,i){h=!1;b=f;c=g;d=m;e=i;a()};this.addPoint=function(f,g){h?(h=!1,b=f,c=g,d=f,e=g):(b=b<f?b:f,c=c<g?c:g,d=d>f?d:f,e=e>g?e:g);a()};this.add3Points=
-function(f,g,m,i,n,k){h?(h=!1,b=f<m?f<n?f:n:m<n?m:n,c=g<i?g<k?g:k:i<k?i:k,d=f>m?f>n?f:n:m>n?m:n,e=g>i?g>k?g:k:i>k?i:k):(b=f<m?f<n?f<b?f:b:n<b?n:b:m<n?m<b?m:b:n<b?n:b,c=g<i?g<k?g<c?g:c:k<c?k:c:i<k?i<c?i:c:k<c?k:c,d=f>m?f>n?f>d?f:d:n>d?n:d:m>n?m>d?m:d:n>d?n:d,e=g>i?g>k?g>e?g:e:k>e?k:e:i>k?i>e?i:e:k>e?k:e);a()};this.addRectangle=function(f){h?(h=!1,b=f.getLeft(),c=f.getTop(),d=f.getRight(),e=f.getBottom()):(b=b<f.getLeft()?b:f.getLeft(),c=c<f.getTop()?c:f.getTop(),d=d>f.getRight()?d:f.getRight(),e=e>
+1.0E-4}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d||1};
+THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add: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},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub: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},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a,this.w/=a):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
+normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf: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}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
+THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d=[];b=0;for(c=a.length;b<c;b++)d=d.concat(this.intersectObject(a[b]));d.sort(function(a,b){return a.distance-b.distance});return d},intersectObject:function(a){function b(a,b,c){var d;d=c.clone().subSelf(a).dot(b);if(d<=0)return null;a=a.clone().addSelf(b.clone().multiplyScalar(d));return c.distanceTo(a)}function c(a,b,c,d){var d=d.clone().subSelf(b),
+c=c.clone().subSelf(b),e=a.clone().subSelf(b),a=d.dot(d),b=d.dot(c),d=d.dot(e),f=c.dot(c),c=c.dot(e),e=1/(a*f-b*b),f=(f*d-b*c)*e,a=(a*c-b*d)*e;return f>0&&a>0&&f+a<1}if(a instanceof THREE.Particle){var d=b(this.origin,this.direction,a.matrixWorld.getPosition());if(d==null||d>a.scale.x)return[];return[{distance:d,point:a.position,face:null,object:a}]}else if(a instanceof THREE.Mesh){d=b(this.origin,this.direction,a.matrixWorld.getPosition());if(d==null||d>a.geometry.boundingSphere.radius*Math.max(a.scale.x,
+Math.max(a.scale.y,a.scale.z)))return[];var e,g,f,h,i,l,n,j,m,k,p=a.geometry,q=p.vertices,u=[],d=0;for(e=p.faces.length;d<e;d++)if(g=p.faces[d],m=this.origin.clone(),k=this.direction.clone(),l=a.matrixWorld,f=l.multiplyVector3(g.centroid.clone()).subSelf(m),j=f.dot(k),!(j<=0)&&(f=l.multiplyVector3(q[g.a].position.clone()),h=l.multiplyVector3(q[g.b].position.clone()),i=l.multiplyVector3(q[g.c].position.clone()),l=g instanceof THREE.Face4?l.multiplyVector3(q[g.d].position.clone()):null,n=a.matrixRotationWorld.multiplyVector3(g.normal.clone()),
+j=k.dot(n),a.doubleSided||(a.flipSided?j>0:j<0)))if(j=n.dot((new THREE.Vector3).sub(f,m))/j,m=m.addSelf(k.multiplyScalar(j)),g instanceof THREE.Face3)c(m,f,h,i)&&(g={distance:this.origin.distanceTo(m),point:m,face:g,object:a},u.push(g));else if(g instanceof THREE.Face4&&(c(m,f,h,l)||c(m,h,i,l)))g={distance:this.origin.distanceTo(m),point:m,face:g,object:a},u.push(g);u.sort(function(a,b){return a.distance-b.distance});return u}else return[]}};
+THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return f};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(f,g,n,j){h=!1;b=f;c=g;d=n;e=j;a()};this.addPoint=function(f,g){h?(h=!1,b=f,c=g,d=f,e=g):(b=b<f?b:f,c=c<g?c:g,d=d>f?d:f,e=e>g?e:g);a()};this.add3Points=
+function(f,g,n,j,m,k){h?(h=!1,b=f<n?f<m?f:m:n<m?n:m,c=g<j?g<k?g:k:j<k?j:k,d=f>n?f>m?f:m:n>m?n:m,e=g>j?g>k?g:k:j>k?j:k):(b=f<n?f<m?f<b?f:b:m<b?m:b:n<m?n<b?n:b:m<b?m:b,c=g<j?g<k?g<c?g:c:k<c?k:c:j<k?j<c?j:c:k<c?k:c,d=f>n?f>m?f>d?f:d:m>d?m:d:n>m?n>d?n:d:m>d?m:d,e=g>j?g>k?g>e?g:e:k>e?k:e:j>k?j>e?j:e:k>e?k:e);a()};this.addRectangle=function(f){h?(h=!1,b=f.getLeft(),c=f.getTop(),d=f.getRight(),e=f.getBottom()):(b=b<f.getLeft()?b:f.getLeft(),c=c<f.getTop()?c:f.getTop(),d=d>f.getRight()?d:f.getRight(),e=e>
 f.getBottom()?e:f.getBottom());a()};this.inflate=function(f){b-=f;c-=f;d+=f;e+=f;a()};this.minSelf=function(f){b=b>f.getLeft()?b:f.getLeft();c=c>f.getTop()?c:f.getTop();d=d<f.getRight()?d:f.getRight();e=e<f.getBottom()?e:f.getBottom();a()};this.instersects=function(a){return Math.min(d,a.getRight())-Math.max(b,a.getLeft())>=0&&Math.min(e,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){h=!0;e=d=c=b=0;a()};this.isEmpty=function(){return h}};THREE.Matrix3=function(){this.m=[]};
 f.getBottom()?e:f.getBottom());a()};this.inflate=function(f){b-=f;c-=f;d+=f;e+=f;a()};this.minSelf=function(f){b=b>f.getLeft()?b:f.getLeft();c=c>f.getTop()?c:f.getTop();d=d<f.getRight()?d:f.getRight();e=e<f.getBottom()?e:f.getBottom();a()};this.instersects=function(a){return Math.min(d,a.getRight())-Math.max(b,a.getLeft())>=0&&Math.min(e,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){h=!0;e=d=c=b=0;a()};this.isEmpty=function(){return h}};THREE.Matrix3=function(){this.m=[]};
-THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};THREE.Matrix4=function(a,b,c,d,e,g,f,h,j,l,m,i,n,k,p,q){this.set(a||1,b||0,c||0,d||0,e||0,g||1,f||0,h||0,j||0,l||0,m||1,i||0,n||0,k||0,p||0,q||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,j,l,m,i,n,k,p,q){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=g;this.n23=f;this.n24=h;this.n31=j;this.n32=l;this.n33=m;this.n34=i;this.n41=n;this.n42=k;this.n43=p;this.n44=q;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
+THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};THREE.Matrix4=function(a,b,c,d,e,g,f,h,i,l,n,j,m,k,p,q){this.set(a||1,b||0,c||0,d||0,e||0,g||1,f||0,h||0,i||0,l||0,n||1,j||0,m||0,k||0,p||0,q||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,i,l,n,j,m,k,p,q){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=g;this.n23=f;this.n24=h;this.n31=i;this.n32=l;this.n33=n;this.n34=j;this.n41=m;this.n42=k;this.n43=p;this.n44=q;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
 b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;d.cross(c,g).normalize();d.length()===0&&(g.x+=1.0E-4,d.cross(c,g).normalize());e.cross(g,d).normalize();this.n11=d.x;this.n12=e.x;this.n13=g.x;this.n21=d.y;this.n22=e.y;this.n23=g.y;this.n31=d.z;this.n32=e.z;this.n33=g.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,d=a.z,e=1/(this.n41*b+this.n42*c+this.n43*d+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*d+this.n14)*e;
 b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;d.cross(c,g).normalize();d.length()===0&&(g.x+=1.0E-4,d.cross(c,g).normalize());e.cross(g,d).normalize();this.n11=d.x;this.n12=e.x;this.n13=g.x;this.n21=d.y;this.n22=e.y;this.n23=g.y;this.n31=d.z;this.n32=e.z;this.n33=g.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,d=a.z,e=1/(this.n41*b+this.n42*c+this.n43*d+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*d+this.n14)*e;
 a.y=(this.n21*b+this.n22*c+this.n23*d+this.n24)*e;a.z=(this.n31*b+this.n32*c+this.n33*d+this.n34)*e;return a},multiplyVector4:function(a){var b=a.x,c=a.y,d=a.z,e=a.w;a.x=this.n11*b+this.n12*c+this.n13*d+this.n14*e;a.y=this.n21*b+this.n22*c+this.n23*d+this.n24*e;a.z=this.n31*b+this.n32*c+this.n33*d+this.n34*e;a.w=this.n41*b+this.n42*c+this.n43*d+this.n44*e;return a},rotateAxis:function(a){var b=a.x,c=a.y,d=a.z;a.x=b*this.n11+c*this.n12+d*this.n13;a.y=b*this.n21+c*this.n22+d*this.n23;a.z=b*this.n31+
 a.y=(this.n21*b+this.n22*c+this.n23*d+this.n24)*e;a.z=(this.n31*b+this.n32*c+this.n33*d+this.n34)*e;return a},multiplyVector4:function(a){var b=a.x,c=a.y,d=a.z,e=a.w;a.x=this.n11*b+this.n12*c+this.n13*d+this.n14*e;a.y=this.n21*b+this.n22*c+this.n23*d+this.n24*e;a.z=this.n31*b+this.n32*c+this.n33*d+this.n34*e;a.w=this.n41*b+this.n42*c+this.n43*d+this.n44*e;return a},rotateAxis:function(a){var b=a.x,c=a.y,d=a.z;a.x=b*this.n11+c*this.n12+d*this.n13;a.y=b*this.n21+c*this.n22+d*this.n23;a.z=b*this.n31+
-c*this.n32+d*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,j=a.n23,l=a.n24,m=a.n31,i=a.n32,n=a.n33,k=a.n34,p=a.n41,q=a.n42,v=a.n43,s=a.n44,O=b.n11,P=b.n12,
-y=b.n13,B=b.n14,o=b.n21,t=b.n22,r=b.n23,x=b.n24,E=b.n31,Z=b.n32,$=b.n33,I=b.n34,D=b.n41,J=b.n42,M=b.n43,F=b.n44;this.n11=c*O+d*o+e*E+g*D;this.n12=c*P+d*t+e*Z+g*J;this.n13=c*y+d*r+e*$+g*M;this.n14=c*B+d*x+e*I+g*F;this.n21=f*O+h*o+j*E+l*D;this.n22=f*P+h*t+j*Z+l*J;this.n23=f*y+h*r+j*$+l*M;this.n24=f*B+h*x+j*I+l*F;this.n31=m*O+i*o+n*E+k*D;this.n32=m*P+i*t+n*Z+k*J;this.n33=m*y+i*r+n*$+k*M;this.n34=m*B+i*x+n*I+k*F;this.n41=p*O+q*o+v*E+s*D;this.n42=p*P+q*t+v*Z+s*J;this.n43=p*y+q*r+v*$+s*M;this.n44=p*B+q*
-x+v*I+s*F;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=
-a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,j=this.n31,l=this.n32,m=this.n33,i=this.n34,n=this.n41,k=this.n42,p=this.n43,q=this.n44;return d*f*l*n-c*h*l*n-d*g*m*n+b*h*m*n+c*g*i*n-b*f*i*n-d*f*j*k+c*h*j*k+d*e*m*k-a*h*m*k-c*e*i*k+a*f*i*k+d*g*j*p-b*h*j*p-d*e*l*p+a*h*l*p+b*e*i*p-a*g*i*p-c*g*j*q+b*f*j*q+c*e*l*q-a*f*l*q-b*e*m*q+a*g*m*q},
+c*this.n32+d*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,i=a.n23,l=a.n24,n=a.n31,j=a.n32,m=a.n33,k=a.n34,p=a.n41,q=a.n42,u=a.n43,s=a.n44,O=b.n11,P=b.n12,
+y=b.n13,B=b.n14,o=b.n21,t=b.n22,r=b.n23,x=b.n24,E=b.n31,Z=b.n32,$=b.n33,I=b.n34,D=b.n41,J=b.n42,M=b.n43,F=b.n44;this.n11=c*O+d*o+e*E+g*D;this.n12=c*P+d*t+e*Z+g*J;this.n13=c*y+d*r+e*$+g*M;this.n14=c*B+d*x+e*I+g*F;this.n21=f*O+h*o+i*E+l*D;this.n22=f*P+h*t+i*Z+l*J;this.n23=f*y+h*r+i*$+l*M;this.n24=f*B+h*x+i*I+l*F;this.n31=n*O+j*o+m*E+k*D;this.n32=n*P+j*t+m*Z+k*J;this.n33=n*y+j*r+m*$+k*M;this.n34=n*B+j*x+m*I+k*F;this.n41=p*O+q*o+u*E+s*D;this.n42=p*P+q*t+u*Z+s*J;this.n43=p*y+q*r+u*$+s*M;this.n44=p*B+q*
+x+u*I+s*F;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=
+a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,i=this.n31,l=this.n32,n=this.n33,j=this.n34,m=this.n41,k=this.n42,p=this.n43,q=this.n44;return d*f*l*m-c*h*l*m-d*g*n*m+b*h*n*m+c*g*j*m-b*f*j*m-d*f*i*k+c*h*i*k+d*e*n*k-a*h*n*k-c*e*j*k+a*f*j*k+d*g*i*p-b*h*i*p-d*e*l*p+a*h*l*p+b*e*j*p-a*g*j*p-c*g*i*q+b*f*i*q+c*e*l*q-a*f*l*q-b*e*n*q+a*g*n*q},
 transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;
 transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;
 a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=this.n11;
 a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=this.n11;
 a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;
 a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;
 a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,
 a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,
-0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,j=e*g,l=e*f;this.set(j*g+c,j*f-d*h,j*h+d*f,0,j*f+d*h,l*f+c,l*h-d*g,0,j*h-d*f,l*h+d*g,e*h*h+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
-new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);switch(b){case "YXZ":var j=
-f*h,l=f*e,m=d*h,i=d*e;this.n11=j+i*c;this.n12=m*c-l;this.n13=g*d;this.n21=g*e;this.n22=g*h;this.n23=-c;this.n31=l*c-m;this.n32=i+j*c;this.n33=g*f;break;case "ZXY":j=f*h;l=f*e;m=d*h;i=d*e;this.n11=j-i*c;this.n12=-g*e;this.n13=m+l*c;this.n21=l+m*c;this.n22=g*h;this.n23=i-j*c;this.n31=-g*d;this.n32=c;this.n33=g*f;break;case "ZYX":j=g*h;l=g*e;m=c*h;i=c*e;this.n11=f*h;this.n12=m*d-l;this.n13=j*d+i;this.n21=f*e;this.n22=i*d+j;this.n23=l*d-m;this.n31=-d;this.n32=c*f;this.n33=g*f;break;case "YZX":j=g*f;l=
-g*d;m=c*f;i=c*d;this.n11=f*h;this.n12=i-j*e;this.n13=m*e+l;this.n21=e;this.n22=g*h;this.n23=-c*h;this.n31=-d*h;this.n32=l*e+m;this.n33=j-i*e;break;case "XZY":j=g*f;l=g*d;m=c*f;i=c*d;this.n11=f*h;this.n12=-e;this.n13=d*h;this.n21=j*e+i;this.n22=g*h;this.n23=l*e-m;this.n31=m*e-l;this.n32=c*h;this.n33=i*e+j;break;default:j=g*h,l=g*e,m=c*h,i=c*e,this.n11=f*h,this.n12=-f*e,this.n13=d,this.n21=l+m*d,this.n22=j-i*d,this.n23=-c*f,this.n31=i-j*d,this.n32=m+l*d,this.n33=g*f}return this},setRotationFromQuaternion:function(a){var b=
-a.x,c=a.y,d=a.z,e=a.w,g=b+b,f=c+c,h=d+d,a=b*g,j=b*f;b*=h;var l=c*f;c*=h;d*=h;g*=e;f*=e;e*=h;this.n11=1-(l+d);this.n12=j-e;this.n13=b+f;this.n21=j+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+l);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,e=THREE.Matrix4.__m2;
+0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,i=e*g,l=e*f;this.set(i*g+c,i*f-d*h,i*h+d*f,0,i*f+d*h,l*f+c,l*h-d*g,0,i*h-d*f,l*h+d*g,e*h*h+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
+new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);switch(b){case "YXZ":var i=
+f*h,l=f*e,n=d*h,j=d*e;this.n11=i+j*c;this.n12=n*c-l;this.n13=g*d;this.n21=g*e;this.n22=g*h;this.n23=-c;this.n31=l*c-n;this.n32=j+i*c;this.n33=g*f;break;case "ZXY":i=f*h;l=f*e;n=d*h;j=d*e;this.n11=i-j*c;this.n12=-g*e;this.n13=n+l*c;this.n21=l+n*c;this.n22=g*h;this.n23=j-i*c;this.n31=-g*d;this.n32=c;this.n33=g*f;break;case "ZYX":i=g*h;l=g*e;n=c*h;j=c*e;this.n11=f*h;this.n12=n*d-l;this.n13=i*d+j;this.n21=f*e;this.n22=j*d+i;this.n23=l*d-n;this.n31=-d;this.n32=c*f;this.n33=g*f;break;case "YZX":i=g*f;l=
+g*d;n=c*f;j=c*d;this.n11=f*h;this.n12=j-i*e;this.n13=n*e+l;this.n21=e;this.n22=g*h;this.n23=-c*h;this.n31=-d*h;this.n32=l*e+n;this.n33=i-j*e;break;case "XZY":i=g*f;l=g*d;n=c*f;j=c*d;this.n11=f*h;this.n12=-e;this.n13=d*h;this.n21=i*e+j;this.n22=g*h;this.n23=l*e-n;this.n31=n*e-l;this.n32=c*h;this.n33=j*e+i;break;default:i=g*h,l=g*e,n=c*h,j=c*e,this.n11=f*h,this.n12=-f*e,this.n13=d,this.n21=l+n*d,this.n22=i-j*d,this.n23=-c*f,this.n31=j-i*d,this.n32=n+l*d,this.n33=g*f}return this},setRotationFromQuaternion:function(a){var b=
+a.x,c=a.y,d=a.z,e=a.w,g=b+b,f=c+c,h=d+d,a=b*g,i=b*f;b*=h;var l=c*f;c*=h;d*=h;g*=e;f*=e;e*=h;this.n11=1-(l+d);this.n12=i-e;this.n13=b+f;this.n21=i+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+l);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,e=THREE.Matrix4.__m2;
 d.identity();d.setRotationFromQuaternion(b);e.setScale(c.x,c.y,c.z);this.multiply(d,e);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);e.set(this.n12,this.n22,this.n32);g.set(this.n13,this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=d.length();
 d.identity();d.setRotationFromQuaternion(b);e.setScale(c.x,c.y,c.z);this.multiply(d,e);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);e.set(this.n12,this.n22,this.n32);g.set(this.n13,this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=d.length();
 c.y=e.length();c.z=g.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=c.x;d.n21/=c.x;d.n31/=c.x;d.n12/=c.y;d.n22/=c.y;d.n32/=c.y;d.n13/=c.z;d.n23/=c.z;d.n33/=c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,d=1/b.y,e=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*d;this.n22=a.n22*d;this.n32=a.n32*d;this.n13=a.n13*e;this.n23=
 c.y=e.length();c.z=g.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=c.x;d.n21/=c.x;d.n31/=c.x;d.n12/=c.y;d.n22/=c.y;d.n32/=c.y;d.n13/=c.z;d.n23/=c.z;d.n33/=c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,d=1/b.y,e=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*d;this.n22=a.n22*d;this.n32=a.n32*d;this.n13=a.n13*e;this.n23=
 a.n23*e;this.n33=a.n33*e}};
 a.n23*e;this.n33=a.n33*e}};
-THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,j=a.n23,l=a.n24,m=a.n31,i=a.n32,n=a.n33,k=a.n34,p=a.n41,q=a.n42,v=a.n43,s=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=j*k*q-l*n*q+l*i*v-h*k*v-j*i*s+h*n*s;b.n12=g*n*q-e*k*q-g*i*v+d*k*v+e*i*s-d*n*s;b.n13=e*l*q-g*j*q+g*h*v-d*l*v-e*h*s+d*j*s;b.n14=g*j*i-e*l*i-g*h*n+d*l*n+e*h*k-d*j*k;b.n21=l*n*p-j*k*p-l*m*v+f*k*v+j*m*s-f*n*s;b.n22=e*k*p-g*n*p+g*m*v-c*k*v-e*m*s+c*n*s;b.n23=g*j*p-e*l*p-g*f*v+c*l*v+e*f*s-c*j*s;b.n24=
-e*l*m-g*j*m+g*f*n-c*l*n-e*f*k+c*j*k;b.n31=h*k*p-l*i*p+l*m*q-f*k*q-h*m*s+f*i*s;b.n32=g*i*p-d*k*p-g*m*q+c*k*q+d*m*s-c*i*s;b.n33=e*l*p-g*h*p+g*f*q-c*l*q-d*f*s+c*h*s;b.n34=g*h*m-d*l*m-g*f*i+c*l*i+d*f*k-c*h*k;b.n41=j*i*p-h*n*p-j*m*q+f*n*q+h*m*v-f*i*v;b.n42=d*n*p-e*i*p+e*m*q-c*n*q-d*m*v+c*i*v;b.n43=e*h*p-d*j*p-e*f*q+c*j*q+d*f*v-c*h*v;b.n44=d*j*m-e*h*m+e*f*i-c*j*i-d*f*n+c*h*n;b.multiplyScalar(1/a.determinant());return b};
-THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,j=-a.n32*a.n11+a.n31*a.n12,l=a.n23*a.n12-a.n22*a.n13,m=-a.n23*a.n11+a.n21*a.n13,i=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*l;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*g;c[3]=a*f;c[4]=a*h;c[5]=a*j;c[6]=a*l;c[7]=a*m;c[8]=a*i;return b};
+THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,i=a.n23,l=a.n24,n=a.n31,j=a.n32,m=a.n33,k=a.n34,p=a.n41,q=a.n42,u=a.n43,s=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=i*k*q-l*m*q+l*j*u-h*k*u-i*j*s+h*m*s;b.n12=g*m*q-e*k*q-g*j*u+d*k*u+e*j*s-d*m*s;b.n13=e*l*q-g*i*q+g*h*u-d*l*u-e*h*s+d*i*s;b.n14=g*i*j-e*l*j-g*h*m+d*l*m+e*h*k-d*i*k;b.n21=l*m*p-i*k*p-l*n*u+f*k*u+i*n*s-f*m*s;b.n22=e*k*p-g*m*p+g*n*u-c*k*u-e*n*s+c*m*s;b.n23=g*i*p-e*l*p-g*f*u+c*l*u+e*f*s-c*i*s;b.n24=
+e*l*n-g*i*n+g*f*m-c*l*m-e*f*k+c*i*k;b.n31=h*k*p-l*j*p+l*n*q-f*k*q-h*n*s+f*j*s;b.n32=g*j*p-d*k*p-g*n*q+c*k*q+d*n*s-c*j*s;b.n33=e*l*p-g*h*p+g*f*q-c*l*q-d*f*s+c*h*s;b.n34=g*h*n-d*l*n-g*f*j+c*l*j+d*f*k-c*h*k;b.n41=i*j*p-h*m*p-i*n*q+f*m*q+h*n*u-f*j*u;b.n42=d*m*p-e*j*p+e*n*q-c*m*q-d*n*u+c*j*u;b.n43=e*h*p-d*i*p-e*f*q+c*i*q+d*f*u-c*h*u;b.n44=d*i*n-e*h*n+e*f*j-c*i*j-d*f*m+c*h*m;b.multiplyScalar(1/a.determinant());return b};
+THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,i=-a.n32*a.n11+a.n31*a.n12,l=a.n23*a.n12-a.n22*a.n13,n=-a.n23*a.n11+a.n21*a.n13,j=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*l;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*g;c[3]=a*f;c[4]=a*h;c[5]=a*i;c[6]=a*l;c[7]=a*n;c[8]=a*j;return b};
 THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=2*e/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*e/(d-c);f.n23=(d+c)/(d-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+e)/(g-e);f.n34=-2*g*e/(g-e);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,d){var e,a=c*Math.tan(a*Math.PI/360);e=-a;return THREE.Matrix4.makeFrustum(e*b,a*b,e,a,c,d)};
 THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=2*e/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*e/(d-c);f.n23=(d+c)/(d-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+e)/(g-e);f.n34=-2*g*e/(g-e);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,d){var e,a=c*Math.tan(a*Math.PI/360);e=-a;return THREE.Matrix4.makeFrustum(e*b,a*b,e,a,c,d)};
-THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,j,l;f=new THREE.Matrix4;h=b-a;j=c-d;l=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/j;f.n23=0;f.n24=-((c+d)/j);f.n31=0;f.n32=0;f.n33=-2/l;f.n34=-((g+e)/l);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
+THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,i,l;f=new THREE.Matrix4;h=b-a;i=c-d;l=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/i;f.n23=0;f.n24=-((c+d)/i);f.n31=0;f.n32=0;f.n33=-2/l;f.n34=-((g+e)/l);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;
 THREE.Object3D=function(){this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;
 this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this._vector=new THREE.Vector3;this.name=""};
 this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this._vector=new THREE.Vector3;this.name=""};
 THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(a){if(this.children.indexOf(a)===
 THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(a){if(this.children.indexOf(a)===
@@ -55,17 +55,18 @@ this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matri
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),g=Math.cos(c),c=Math.sin(c),f=a*b,h=d*e;this.w=f*g-h*c;this.x=f*c+h*g;this.y=d*b*g+a*e*c;this.z=a*e*g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),g=Math.cos(c),c=Math.sin(c),f=a*b,h=d*e;this.w=f*g-h*c;this.x=f*c+h*g;this.y=d*b*g+a*e*c;this.z=a*e*g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);
 this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},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=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},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=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=
-this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,j=this.w,l=j*c+f*e-h*d,m=j*d+h*c-g*e,i=j*e+g*d-f*c,c=-g*
-c-f*d-h*e;b.x=l*j+c*-g+m*-h-i*-f;b.y=m*j+c*-f+i*-g-l*-h;b.z=i*j+c*-h+l*-f-m*-g;return b}};THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};
+this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,i=this.w,l=i*c+f*e-h*d,n=i*d+h*c-g*e,j=i*e+g*d-f*c,c=-g*
+c-f*d-h*e;b.x=l*i+c*-g+n*-h-j*-f;b.y=n*i+c*-f+j*-g-l*-h;b.z=j*i+c*-h+l*-f-n*-g;return b}};THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};
 THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
-THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
-THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
+THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
+THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
+THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
 THREE.Geometry.prototype={constructor:THREE.Geometry,computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.centroid.set(0,0,0),c instanceof THREE.Face3?(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.divideScalar(3)):c instanceof THREE.Face4&&(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),
 THREE.Geometry.prototype={constructor:THREE.Geometry,computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.centroid.set(0,0,0),c instanceof THREE.Face3?(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.divideScalar(3)):c instanceof THREE.Face4&&(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),
-c.centroid.addSelf(this.vertices[c.d].position),c.centroid.divideScalar(4))},computeFaceNormals:function(a){var b,c,d,e,g,f,h=new THREE.Vector3,j=new THREE.Vector3;d=0;for(e=this.faces.length;d<e;d++){g=this.faces[d];if(a&&g.vertexNormals.length){h.set(0,0,0);b=0;for(c=g.vertexNormals.length;b<c;b++)h.addSelf(g.vertexNormals[b]);h.divideScalar(3)}else b=this.vertices[g.a],c=this.vertices[g.b],f=this.vertices[g.c],h.sub(f.position,c.position),j.sub(b.position,c.position),h.crossSelf(j);h.isZero()||
+c.centroid.addSelf(this.vertices[c.d].position),c.centroid.divideScalar(4))},computeFaceNormals:function(a){var b,c,d,e,g,f,h=new THREE.Vector3,i=new THREE.Vector3;d=0;for(e=this.faces.length;d<e;d++){g=this.faces[d];if(a&&g.vertexNormals.length){h.set(0,0,0);b=0;for(c=g.vertexNormals.length;b<c;b++)h.addSelf(g.vertexNormals[b]);h.divideScalar(3)}else b=this.vertices[g.a],c=this.vertices[g.b],f=this.vertices[g.c],h.sub(f.position,c.position),i.sub(b.position,c.position),h.crossSelf(i);h.isZero()||
 h.normalize();g.normal.copy(h)}},computeVertexNormals:function(){var a,b,c,d;if(this.__tmpVertices==void 0){d=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)d[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)if(c=this.faces[a],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{d=
 h.normalize();g.normal.copy(h)}},computeVertexNormals:function(){var a,b,c,d;if(this.__tmpVertices==void 0){d=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)d[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)if(c=this.faces[a],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{d=
 this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)d[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal)):c instanceof THREE.Face4&&(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal),d[c.d].addSelf(c.normal));a=0;for(b=this.vertices.length;a<b;a++)d[a].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(c.vertexNormals[0].copy(d[c.a]),
 this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)d[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal)):c instanceof THREE.Face4&&(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal),d[c.d].addSelf(c.normal));a=0;for(b=this.vertices.length;a<b;a++)d[a].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(c.vertexNormals[0].copy(d[c.a]),
-c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c])):c instanceof THREE.Face4&&(c.vertexNormals[0].copy(d[c.a]),c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c]),c.vertexNormals[3].copy(d[c.d]))},computeTangents:function(){function a(a,b,c,d,e,g,r){h=a.vertices[b].position;j=a.vertices[c].position;l=a.vertices[d].position;m=f[e];i=f[g];n=f[r];k=j.x-h.x;p=l.x-h.x;q=j.y-h.y;v=l.y-h.y;s=j.z-h.z;O=l.z-h.z;P=i.u-m.u;y=n.u-m.u;B=i.v-m.v;o=n.v-m.v;t=1/(P*o-y*B);Z.set((o*k-B*p)*
-t,(o*q-B*v)*t,(o*s-B*O)*t);$.set((P*p-y*k)*t,(P*v-y*q)*t,(P*O-y*s)*t);x[b].addSelf(Z);x[c].addSelf(Z);x[d].addSelf(Z);E[b].addSelf($);E[c].addSelf($);E[d].addSelf($)}var b,c,d,e,g,f,h,j,l,m,i,n,k,p,q,v,s,O,P,y,B,o,t,r,x=[],E=[],Z=new THREE.Vector3,$=new THREE.Vector3,I=new THREE.Vector3,D=new THREE.Vector3,J=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)x[b]=new THREE.Vector3,E[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)g=this.faces[b],f=this.faceVertexUvs[0][b],g instanceof
+c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c])):c instanceof THREE.Face4&&(c.vertexNormals[0].copy(d[c.a]),c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c]),c.vertexNormals[3].copy(d[c.d]))},computeTangents:function(){function a(a,b,c,d,e,g,r){h=a.vertices[b].position;i=a.vertices[c].position;l=a.vertices[d].position;n=f[e];j=f[g];m=f[r];k=i.x-h.x;p=l.x-h.x;q=i.y-h.y;u=l.y-h.y;s=i.z-h.z;O=l.z-h.z;P=j.u-n.u;y=m.u-n.u;B=j.v-n.v;o=m.v-n.v;t=1/(P*o-y*B);Z.set((o*k-B*p)*
+t,(o*q-B*u)*t,(o*s-B*O)*t);$.set((P*p-y*k)*t,(P*u-y*q)*t,(P*O-y*s)*t);x[b].addSelf(Z);x[c].addSelf(Z);x[d].addSelf(Z);E[b].addSelf($);E[c].addSelf($);E[d].addSelf($)}var b,c,d,e,g,f,h,i,l,n,j,m,k,p,q,u,s,O,P,y,B,o,t,r,x=[],E=[],Z=new THREE.Vector3,$=new THREE.Vector3,I=new THREE.Vector3,D=new THREE.Vector3,J=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)x[b]=new THREE.Vector3,E[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)g=this.faces[b],f=this.faceVertexUvs[0][b],g instanceof
 THREE.Face3?a(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(a(this,g.a,g.b,g.c,0,1,2),a(this,g.a,g.b,g.d,0,1,3));var M=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){g=this.faces[b];for(d=0;d<g.vertexNormals.length;d++)J.copy(g.vertexNormals[d]),e=g[M[d]],r=x[e],I.copy(r),I.subSelf(J.multiplyScalar(J.dot(r))).normalize(),D.cross(g.vertexNormals[d],r),e=D.dot(E[e]),e=e<0?-1:1,g.vertexTangents[d]=new THREE.Vector4(I.x,I.y,I.z,e)}this.hasTangents=!0},computeBoundingBox:function(){var a;
 THREE.Face3?a(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(a(this,g.a,g.b,g.c,0,1,2),a(this,g.a,g.b,g.d,0,1,3));var M=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){g=this.faces[b];for(d=0;d<g.vertexNormals.length;d++)J.copy(g.vertexNormals[d]),e=g[M[d]],r=x[e],I.copy(r),I.subSelf(J.multiplyScalar(J.dot(r))).normalize(),D.cross(g.vertexNormals[d],r),e=D.dot(E[e]),e=e<0?-1:1,g.vertexTangents[d]=new THREE.Vector4(I.x,I.y,I.z,e)}this.hasTangents=!0},computeBoundingBox:function(){var a;
 if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;b<c;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;
 if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;b<c;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;
 else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},computeEdgeFaces:function(){function a(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}function b(a,b,c){a[b]===
 else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},computeEdgeFaces:function(){function a(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}function b(a,b,c){a[b]===
@@ -75,13 +76,13 @@ THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.tran
 THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.Camera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};
 THREE.Camera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};
 THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),b=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
 THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),b=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
-!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;
+!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};THREE.OrthoCamera=function(a,b,c,d,e,g,f){THREE.Camera.call(this,45,1,e,g,f);this.left=a;this.right=b;this.top=c;this.bottom=d;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
+THREE.OrthoCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b,c,d){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0;this.castShadow=d!==void 0?d:!1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1;this.distance=c||0};
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b,c,d){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0;this.castShadow=d!==void 0?d:!1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1;this.distance=c||0};
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
 THREE.Material=function(a){this.id=THREE.MaterialCount++;a=a||{};this.opacity=a.opacity!==void 0?a.opacity:1;this.transparent=a.transparent!==void 0?a.transparent:!1;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.depthTest=a.depthTest!==void 0?a.depthTest:!0;this.polygonOffset=a.polygonOffset!==void 0?a.polygonOffset:!1;this.polygonOffsetFactor=a.polygonOffsetFactor!==void 0?a.polygonOffsetFactor:0;this.polygonOffsetUnits=a.polygonOffsetUnits!==void 0?a.polygonOffsetUnits:
 THREE.Material=function(a){this.id=THREE.MaterialCount++;a=a||{};this.opacity=a.opacity!==void 0?a.opacity:1;this.transparent=a.transparent!==void 0?a.transparent:!1;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.depthTest=a.depthTest!==void 0?a.depthTest:!0;this.polygonOffset=a.polygonOffset!==void 0?a.polygonOffset:!1;this.polygonOffsetFactor=a.polygonOffsetFactor!==void 0?a.polygonOffsetFactor:0;this.polygonOffsetUnits=a.polygonOffsetUnits!==void 0?a.polygonOffsetUnits:
-0;this.alphaTest=a.alphaTest!==void 0?a.alphaTest:0};THREE.MaterialCount=0;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.AdditiveAlphaBlending=4;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
-THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.LineBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.linewidth=a.linewidth!==void 0?a.linewidth:1;this.linecap=a.linecap!==void 0?a.linecap:"round";this.linejoin=a.linejoin!==void 0?a.linejoin:"round";this.vertexColors=a.vertexColors?a.vertexColors:!1};
-THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
+0;this.alphaTest=a.alphaTest!==void 0?a.alphaTest:0};THREE.MaterialCount=0;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.AdditiveAlphaBlending=4;
+THREE.LineBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.linewidth=a.linewidth!==void 0?a.linewidth:1;this.linecap=a.linecap!==void 0?a.linecap:"round";this.linejoin=a.linejoin!==void 0?a.linejoin:"round";this.vertexColors=a.vertexColors?a.vertexColors:!1};THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
 THREE.MeshBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:null;this.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.shading=a.shading!==
 THREE.MeshBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:null;this.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.shading=a.shading!==
 void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};
 void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};
 THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
 THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
@@ -96,9 +97,10 @@ THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.sh
 THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:null;this.size=a.size!==void 0?a.size:1;this.sizeAttenuation=a.sizeAttenuation!==void 0?a.sizeAttenuation:!0;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
 THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:null;this.size=a.size!==void 0?a.size:1;this.sizeAttenuation=a.sizeAttenuation!==void 0?a.sizeAttenuation:!0;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
 THREE.ParticleCanvasMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.program=a.program!==void 0?a.program:function(){}};THREE.ParticleCanvasMaterial.prototype=new THREE.Material;THREE.ParticleCanvasMaterial.prototype.constructor=THREE.ParticleCanvasMaterial;
 THREE.ParticleCanvasMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.program=a.program!==void 0?a.program:function(){}};THREE.ParticleCanvasMaterial.prototype=new THREE.Material;THREE.ParticleCanvasMaterial.prototype.constructor=THREE.ParticleCanvasMaterial;
 THREE.Texture=function(a,b,c,d,e,g){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=d!==void 0?d:THREE.ClampToEdgeWrapping;this.magFilter=e!==void 0?e:THREE.LinearFilter;this.minFilter=g!==void 0?g:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
 THREE.Texture=function(a,b,c,d,e,g){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=d!==void 0?d:THREE.ClampToEdgeWrapping;this.magFilter=e!==void 0?e:THREE.LinearFilter;this.minFilter=g!==void 0?g:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
-THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;
-THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a]};THREE.Particle.prototype=new THREE.Object3D;
-THREE.Particle.prototype.constructor=THREE.Particle;THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.type=c!=void 0?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
+THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
+THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;
+THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.type=c!=void 0?c:THREE.LineStrip};
+THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
 THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b&&b.length?b:[b];this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=a.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[c].name]=
 THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b&&b.length?b:[b];this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=a.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[c].name]=
 c}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 c}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
 THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
@@ -107,43 +109,43 @@ b,c)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1
 THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1)this.objects.push(a),this.__objectsAdded.push(a);for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
 THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1)this.objects.push(a),this.__objectsAdded.push(a);for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
 THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a)));for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;
 THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a)));for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;
 THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;
 THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;
-THREE.Projector=function(){function a(){var a=j[h]=j[h]||new THREE.RenderableVertex;h++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;return e>=0&&f>=0&&g>=0&&h>=0?!0:e<0&&f<0||g<0&&h<0?!1:(e<0?c=Math.max(c,e/(e-f)):f<0&&(d=Math.min(d,e/(e-f))),g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var d,e,g=[],f,h,j=[],l,m,i=[],n,k=[],p,q,v=[],s,O,P=[],y=new THREE.Vector4,B=new THREE.Vector4,
-o=new THREE.Matrix4,t=new THREE.Matrix4,r=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],x=new THREE.Vector4,E=new THREE.Vector4;this.projectVector=function(a,b){o.multiply(b.projectionMatrix,b.matrixWorldInverse);o.multiplyVector3(a);return a};this.unprojectVector=function(a,b){o.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));o.multiplyVector3(a);return a};this.projectObjects=function(a,c,f){var c=[],h,k,l;e=0;k=
-a.objects;a=0;for(h=k.length;a<h;a++){l=k[a];var i;if(!(i=!l.visible))if(i=l instanceof THREE.Mesh){a:{i=void 0;for(var j=l.matrixWorld,n=-l.geometry.boundingSphere.radius*Math.max(l.scale.x,Math.max(l.scale.y,l.scale.z)),m=0;m<6;m++)if(i=r[m].x*j.n14+r[m].y*j.n24+r[m].z*j.n34+r[m].w,i<=n){i=!1;break a}i=!0}i=!i}if(!i)i=g[e]=g[e]||new THREE.RenderableObject,e++,d=i,y.copy(l.position),o.multiplyVector3(y),d.object=l,d.z=y.z,c.push(d)}f&&c.sort(b);return c};this.projectScene=function(d,e,g){var D=[],
-J=e.near,M=e.far,F,K,G,Q,w,N,L,y,C,u,A,H,S,la,V,ca,W;O=q=n=m=0;e.matrixAutoUpdate&&e.update(void 0,!0);d.update(void 0,!1,e);o.multiply(e.projectionMatrix,e.matrixWorldInverse);r[0].set(o.n41-o.n11,o.n42-o.n12,o.n43-o.n13,o.n44-o.n14);r[1].set(o.n41+o.n11,o.n42+o.n12,o.n43+o.n13,o.n44+o.n14);r[2].set(o.n41+o.n21,o.n42+o.n22,o.n43+o.n23,o.n44+o.n24);r[3].set(o.n41-o.n21,o.n42-o.n22,o.n43-o.n23,o.n44-o.n24);r[4].set(o.n41-o.n31,o.n42-o.n32,o.n43-o.n33,o.n44-o.n34);r[5].set(o.n41+o.n31,o.n42+o.n32,o.n43+
-o.n33,o.n44+o.n34);for(F=0;F<6;F++)C=r[F],C.divideScalar(Math.sqrt(C.x*C.x+C.y*C.y+C.z*C.z));C=this.projectObjects(d,e,!0);d=0;for(F=C.length;d<F;d++)if(u=C[d].object,u.visible)if(A=u.matrixWorld,H=u.matrixRotationWorld,S=u.materials,la=u.overdraw,h=0,u instanceof THREE.Mesh){V=u.geometry;Q=V.vertices;ca=V.faces;V=V.faceVertexUvs;K=0;for(G=Q.length;K<G;K++)f=a(),f.positionWorld.copy(Q[K].position),A.multiplyVector3(f.positionWorld),f.positionScreen.copy(f.positionWorld),o.multiplyVector4(f.positionScreen),
-f.positionScreen.x/=f.positionScreen.w,f.positionScreen.y/=f.positionScreen.w,f.visible=f.positionScreen.z>J&&f.positionScreen.z<M;Q=0;for(K=ca.length;Q<K;Q++){G=ca[Q];if(G instanceof THREE.Face3)if(w=j[G.a],N=j[G.b],L=j[G.c],w.visible&&N.visible&&L.visible&&(u.doubleSided||u.flipSided!=(L.positionScreen.x-w.positionScreen.x)*(N.positionScreen.y-w.positionScreen.y)-(L.positionScreen.y-w.positionScreen.y)*(N.positionScreen.x-w.positionScreen.x)<0))y=i[m]=i[m]||new THREE.RenderableFace3,m++,l=y,l.v1.copy(w),
-l.v2.copy(N),l.v3.copy(L);else continue;else if(G instanceof THREE.Face4)if(w=j[G.a],N=j[G.b],L=j[G.c],y=j[G.d],w.visible&&N.visible&&L.visible&&y.visible&&(u.doubleSided||u.flipSided!=((y.positionScreen.x-w.positionScreen.x)*(N.positionScreen.y-w.positionScreen.y)-(y.positionScreen.y-w.positionScreen.y)*(N.positionScreen.x-w.positionScreen.x)<0||(N.positionScreen.x-L.positionScreen.x)*(y.positionScreen.y-L.positionScreen.y)-(N.positionScreen.y-L.positionScreen.y)*(y.positionScreen.x-L.positionScreen.x)<
-0)))W=k[n]=k[n]||new THREE.RenderableFace4,n++,l=W,l.v1.copy(w),l.v2.copy(N),l.v3.copy(L),l.v4.copy(y);else continue;l.normalWorld.copy(G.normal);H.multiplyVector3(l.normalWorld);l.centroidWorld.copy(G.centroid);A.multiplyVector3(l.centroidWorld);l.centroidScreen.copy(l.centroidWorld);o.multiplyVector3(l.centroidScreen);L=G.vertexNormals;w=0;for(N=L.length;w<N;w++)y=l.vertexNormalsWorld[w],y.copy(L[w]),H.multiplyVector3(y);w=0;for(N=V.length;w<N;w++)if(W=V[w][Q]){L=0;for(y=W.length;L<y;L++)l.uvs[w][L]=
-W[L]}l.meshMaterials=S;l.faceMaterials=G.materials;l.overdraw=la;l.z=l.centroidScreen.z;D.push(l)}}else if(u instanceof THREE.Line){t.multiply(o,A);Q=u.geometry.vertices;w=a();w.positionScreen.copy(Q[0].position);t.multiplyVector4(w.positionScreen);K=1;for(G=Q.length;K<G;K++)if(w=a(),w.positionScreen.copy(Q[K].position),t.multiplyVector4(w.positionScreen),N=j[h-2],x.copy(w.positionScreen),E.copy(N.positionScreen),c(x,E))x.multiplyScalar(1/x.w),E.multiplyScalar(1/E.w),A=v[q]=v[q]||new THREE.RenderableLine,
-q++,p=A,p.v1.positionScreen.copy(x),p.v2.positionScreen.copy(E),p.z=Math.max(x.z,E.z),p.materials=u.materials,D.push(p)}else if(u instanceof THREE.Particle&&(B.set(u.matrixWorld.n14,u.matrixWorld.n24,u.matrixWorld.n34,1),o.multiplyVector4(B),B.z/=B.w,B.z>0&&B.z<1))A=P[O]=P[O]||new THREE.RenderableParticle,O++,s=A,s.x=B.x/B.w,s.y=B.y/B.w,s.z=B.z,s.rotation=u.rotation.z,s.scale.x=u.scale.x*Math.abs(s.x-(B.x+e.projectionMatrix.n11)/(B.w+e.projectionMatrix.n14)),s.scale.y=u.scale.y*Math.abs(s.y-(B.y+
-e.projectionMatrix.n22)/(B.w+e.projectionMatrix.n24)),s.materials=u.materials,D.push(s);g&&D.sort(b);return D}};
-THREE.CanvasRenderer=function(a){function b(a){if(v!=a)k.globalAlpha=v=a}function c(a){if(s!=a){switch(a){case THREE.NormalBlending:k.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:k.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:k.globalCompositeOperation="darker"}s=a}}function d(a){if(O!=a)k.strokeStyle=O=a}function e(a){if(P!=a)k.fillStyle=P=a}var g=this,f=null,h=new THREE.Projector,a=a||{},j=a.canvas!==void 0?a.canvas:document.createElement("canvas"),
-l,m,i,n,k=j.getContext("2d"),p=new THREE.Color(0),q=0,v=1,s=0,O=null,P=null,y=null,B=null,o=null,t,r,x,E,Z=new THREE.RenderableVertex,$=new THREE.RenderableVertex,I,D,J,M,F,K,G,Q,w,N,L,pa,C=new THREE.Color(0),u=new THREE.Color(0),A=new THREE.Color(0),H=new THREE.Color(0),S=new THREE.Color(0),la=[],V,ca,W,aa,Da,Ea,Fa,Ga,Ha,Ia,ja=new THREE.Rectangle,X=new THREE.Rectangle,U=new THREE.Rectangle,za=!1,ba=new THREE.Color,Y=new THREE.Color,ta=new THREE.Color,ua=new THREE.Color,R=new THREE.Vector3,qa,ra,
-Aa,da,sa,va,a=16;qa=document.createElement("canvas");qa.width=qa.height=2;ra=qa.getContext("2d");ra.fillStyle="rgba(0,0,0,1)";ra.fillRect(0,0,2,2);Aa=ra.getImageData(0,0,2,2);da=Aa.data;sa=document.createElement("canvas");sa.width=sa.height=a;va=sa.getContext("2d");va.translate(-a/2,-a/2);va.scale(a,a);a--;this.domElement=j;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setSize=function(a,b){l=a;m=b;i=Math.floor(l/2);n=Math.floor(m/2);j.width=l;j.height=m;
-ja.set(-i,-n,i,n);X.set(-i,-n,i,n);v=1;s=0;o=B=y=P=O=null};this.setClearColor=function(a,b){p.copy(a);q=b;X.set(-i,-n,i,n)};this.setClearColorHex=function(a,b){p.setHex(a);q=b;X.set(-i,-n,i,n)};this.clear=function(){k.setTransform(1,0,0,-1,i,n);X.isEmpty()||(X.minSelf(ja),X.inflate(2),q<1&&k.clearRect(Math.floor(X.getX()),Math.floor(X.getY()),Math.floor(X.getWidth()),Math.floor(X.getHeight())),q>0&&(c(THREE.NormalBlending),b(1),e("rgba("+Math.floor(p.r*255)+","+Math.floor(p.g*255)+","+Math.floor(p.b*
-255)+","+q+")"),k.fillRect(Math.floor(X.getX()),Math.floor(X.getY()),Math.floor(X.getWidth()),Math.floor(X.getHeight()))),X.empty())};this.render=function(a,l){function j(a){var b,c,d,e=a.lights;Y.setRGB(0,0,0);ta.setRGB(0,0,0);ua.setRGB(0,0,0);a=0;for(b=e.length;a<b;a++)c=e[a],d=c.color,c instanceof THREE.AmbientLight?(Y.r+=d.r,Y.g+=d.g,Y.b+=d.b):c instanceof THREE.DirectionalLight?(ta.r+=d.r,ta.g+=d.g,ta.b+=d.b):c instanceof THREE.PointLight&&(ua.r+=d.r,ua.g+=d.g,ua.b+=d.b)}function m(a,b,c,d){var e,
-f,g,h,l=a.lights,a=0;for(e=l.length;a<e;a++)f=l[a],g=f.color,f instanceof THREE.DirectionalLight?(h=c.dot(f.position),h<=0||(h*=f.intensity,d.r+=g.r*h,d.g+=g.g*h,d.b+=g.b*h)):f instanceof THREE.PointLight&&(h=c.dot(R.sub(f.position,b).normalize()),h<=0||(h*=f.distance==0?1:1-Math.min(b.distanceTo(f.position)/f.distance,1),h!=0&&(h*=f.intensity,d.r+=g.r*h,d.g+=g.g*h,d.b+=g.b*h)))}function p(a,f,g){b(g.opacity);c(g.blending);var h,l,m,j,Ba,o;if(g instanceof THREE.ParticleBasicMaterial){if(g.map)j=g.map.image,
-Ba=j.width>>1,o=j.height>>1,g=f.scale.x*i,m=f.scale.y*n,h=g*Ba,l=m*o,U.set(a.x-h,a.y-l,a.x+h,a.y+l),ja.instersects(U)&&(k.save(),k.translate(a.x,a.y),k.rotate(-f.rotation),k.scale(g,-m),k.translate(-Ba,-o),k.drawImage(j,0,0),k.restore())}else g instanceof THREE.ParticleCanvasMaterial&&(h=f.scale.x*i,l=f.scale.y*n,U.set(a.x-h,a.y-l,a.x+h,a.y+l),ja.instersects(U)&&(d(g.color.getContextStyle()),e(g.color.getContextStyle()),k.save(),k.translate(a.x,a.y),k.rotate(-f.rotation),k.scale(h,l),g.program(k),
-k.restore()))}function q(a,e,f,g){b(g.opacity);c(g.blending);k.beginPath();k.moveTo(a.positionScreen.x,a.positionScreen.y);k.lineTo(e.positionScreen.x,e.positionScreen.y);k.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(y!=a)k.lineWidth=y=a;a=g.linecap;if(B!=a)k.lineCap=B=a;a=g.linejoin;if(o!=a)k.lineJoin=o=a;d(g.color.getContextStyle());k.stroke();U.inflate(g.linewidth*2)}}function s(a,d,e,f,h,k,i,j,n){g.data.vertices+=3;g.data.faces++;b(j.opacity);c(j.blending);I=a.positionScreen.x;
-D=a.positionScreen.y;J=d.positionScreen.x;M=d.positionScreen.y;F=e.positionScreen.x;K=e.positionScreen.y;O(I,D,J,M,F,K);if(j instanceof THREE.MeshBasicMaterial)if(j.map)j.map.mapping instanceof THREE.UVMapping&&(aa=i.uvs[0],Ca(I,D,J,M,F,K,aa[f].u,aa[f].v,aa[h].u,aa[h].v,aa[k].u,aa[k].v,j.map));else if(j.envMap){if(j.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=l.matrixWorldInverse,R.copy(i.vertexNormalsWorld[0]),Da=(R.x*a.n11+R.y*a.n12+R.z*a.n13)*0.5+0.5,Ea=-(R.x*a.n21+R.y*a.n22+R.z*
-a.n23)*0.5+0.5,R.copy(i.vertexNormalsWorld[1]),Fa=(R.x*a.n11+R.y*a.n12+R.z*a.n13)*0.5+0.5,Ga=-(R.x*a.n21+R.y*a.n22+R.z*a.n23)*0.5+0.5,R.copy(i.vertexNormalsWorld[2]),Ha=(R.x*a.n11+R.y*a.n12+R.z*a.n13)*0.5+0.5,Ia=-(R.x*a.n21+R.y*a.n22+R.z*a.n23)*0.5+0.5,Ca(I,D,J,M,F,K,Da,Ea,Fa,Ga,Ha,Ia,j.envMap)}else j.wireframe?fa(j.color,j.wireframeLinewidth,j.wireframeLinecap,j.wireframeLinejoin):ga(j.color);else if(j instanceof THREE.MeshLambertMaterial)j.map&&!j.wireframe&&(j.map.mapping instanceof THREE.UVMapping&&
-(aa=i.uvs[0],Ca(I,D,J,M,F,K,aa[f].u,aa[f].v,aa[h].u,aa[h].v,aa[k].u,aa[k].v,j.map)),c(THREE.SubtractiveBlending)),za?!j.wireframe&&j.shading==THREE.SmoothShading&&i.vertexNormalsWorld.length==3?(u.r=A.r=H.r=Y.r,u.g=A.g=H.g=Y.g,u.b=A.b=H.b=Y.b,m(n,i.v1.positionWorld,i.vertexNormalsWorld[0],u),m(n,i.v2.positionWorld,i.vertexNormalsWorld[1],A),m(n,i.v3.positionWorld,i.vertexNormalsWorld[2],H),S.r=(A.r+H.r)*0.5,S.g=(A.g+H.g)*0.5,S.b=(A.b+H.b)*0.5,W=wa(u,A,H,S),ma(I,D,J,M,F,K,0,0,1,0,0,1,W)):(ba.r=Y.r,
-ba.g=Y.g,ba.b=Y.b,m(n,i.centroidWorld,i.normalWorld,ba),C.r=Math.max(0,Math.min(j.color.r*ba.r,1)),C.g=Math.max(0,Math.min(j.color.g*ba.g,1)),C.b=Math.max(0,Math.min(j.color.b*ba.b,1)),j.wireframe?fa(C,j.wireframeLinewidth,j.wireframeLinecap,j.wireframeLinejoin):ga(C)):j.wireframe?fa(j.color,j.wireframeLinewidth,j.wireframeLinecap,j.wireframeLinejoin):ga(j.color);else if(j instanceof THREE.MeshDepthMaterial)V=l.near,ca=l.far,u.r=u.g=u.b=1-ka(a.positionScreen.z,V,ca),A.r=A.g=A.b=1-ka(d.positionScreen.z,
-V,ca),H.r=H.g=H.b=1-ka(e.positionScreen.z,V,ca),S.r=(A.r+H.r)*0.5,S.g=(A.g+H.g)*0.5,S.b=(A.b+H.b)*0.5,W=wa(u,A,H,S),ma(I,D,J,M,F,K,0,0,1,0,0,1,W);else if(j instanceof THREE.MeshNormalMaterial)C.r=na(i.normalWorld.x),C.g=na(i.normalWorld.y),C.b=na(i.normalWorld.z),j.wireframe?fa(C,j.wireframeLinewidth,j.wireframeLinecap,j.wireframeLinejoin):ga(C)}function v(a,d,e,f,h,j,i,k,n){g.data.vertices+=4;g.data.faces++;b(k.opacity);c(k.blending);if(k.map||k.envMap)s(a,d,f,0,1,3,i,k,n),s(h,e,j,1,2,3,i,k,n);else if(I=
-a.positionScreen.x,D=a.positionScreen.y,J=d.positionScreen.x,M=d.positionScreen.y,F=e.positionScreen.x,K=e.positionScreen.y,G=f.positionScreen.x,Q=f.positionScreen.y,w=h.positionScreen.x,N=h.positionScreen.y,L=j.positionScreen.x,pa=j.positionScreen.y,k instanceof THREE.MeshBasicMaterial)P(I,D,J,M,F,K,G,Q),k.wireframe?fa(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(k.color);else if(k instanceof THREE.MeshLambertMaterial)za?!k.wireframe&&k.shading==THREE.SmoothShading&&i.vertexNormalsWorld.length==
-4?(u.r=A.r=H.r=S.r=Y.r,u.g=A.g=H.g=S.g=Y.g,u.b=A.b=H.b=S.b=Y.b,m(n,i.v1.positionWorld,i.vertexNormalsWorld[0],u),m(n,i.v2.positionWorld,i.vertexNormalsWorld[1],A),m(n,i.v4.positionWorld,i.vertexNormalsWorld[3],H),m(n,i.v3.positionWorld,i.vertexNormalsWorld[2],S),W=wa(u,A,H,S),O(I,D,J,M,G,Q),ma(I,D,J,M,G,Q,0,0,1,0,0,1,W),O(w,N,F,K,L,pa),ma(w,N,F,K,L,pa,1,0,1,1,0,1,W)):(ba.r=Y.r,ba.g=Y.g,ba.b=Y.b,m(n,i.centroidWorld,i.normalWorld,ba),C.r=Math.max(0,Math.min(k.color.r*ba.r,1)),C.g=Math.max(0,Math.min(k.color.g*
-ba.g,1)),C.b=Math.max(0,Math.min(k.color.b*ba.b,1)),P(I,D,J,M,F,K,G,Q),k.wireframe?fa(C,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(C)):(P(I,D,J,M,F,K,G,Q),k.wireframe?fa(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(k.color));else if(k instanceof THREE.MeshNormalMaterial)C.r=na(i.normalWorld.x),C.g=na(i.normalWorld.y),C.b=na(i.normalWorld.z),P(I,D,J,M,F,K,G,Q),k.wireframe?fa(C,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(C);else if(k instanceof
-THREE.MeshDepthMaterial)V=l.near,ca=l.far,u.r=u.g=u.b=1-ka(a.positionScreen.z,V,ca),A.r=A.g=A.b=1-ka(d.positionScreen.z,V,ca),H.r=H.g=H.b=1-ka(f.positionScreen.z,V,ca),S.r=S.g=S.b=1-ka(e.positionScreen.z,V,ca),W=wa(u,A,H,S),O(I,D,J,M,G,Q),ma(I,D,J,M,G,Q,0,0,1,0,0,1,W),O(w,N,F,K,L,pa),ma(w,N,F,K,L,pa,1,0,1,1,0,1,W)}function O(a,b,c,d,e,f){k.beginPath();k.moveTo(a,b);k.lineTo(c,d);k.lineTo(e,f);k.lineTo(a,b);k.closePath()}function P(a,b,c,d,e,f,g,h){k.beginPath();k.moveTo(a,b);k.lineTo(c,d);k.lineTo(e,
+THREE.Projector=function(){function a(){var a=i[h]=i[h]||new THREE.RenderableVertex;h++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;return e>=0&&f>=0&&g>=0&&h>=0?!0:e<0&&f<0||g<0&&h<0?!1:(e<0?c=Math.max(c,e/(e-f)):f<0&&(d=Math.min(d,e/(e-f))),g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var d,e,g=[],f,h,i=[],l,n,j=[],m,k=[],p,q,u=[],s,O,P=[],y=new THREE.Vector4,B=new THREE.Vector4,
+o=new THREE.Matrix4,t=new THREE.Matrix4,r=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],x=new THREE.Vector4,E=new THREE.Vector4;this.projectVector=function(a,b){o.multiply(b.projectionMatrix,b.matrixWorldInverse);o.multiplyVector3(a);return a};this.unprojectVector=function(a,b){o.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));o.multiplyVector3(a);return a};this.projectObjects=function(a,c,f){var c=[],h,k,j;e=0;k=
+a.objects;a=0;for(h=k.length;a<h;a++){j=k[a];var l;if(!(l=!j.visible))if(l=j instanceof THREE.Mesh){a:{l=void 0;for(var i=j.matrixWorld,m=-j.geometry.boundingSphere.radius*Math.max(j.scale.x,Math.max(j.scale.y,j.scale.z)),n=0;n<6;n++)if(l=r[n].x*i.n14+r[n].y*i.n24+r[n].z*i.n34+r[n].w,l<=m){l=!1;break a}l=!0}l=!l}if(!l)l=g[e]=g[e]||new THREE.RenderableObject,e++,d=l,y.copy(j.position),o.multiplyVector3(y),d.object=j,d.z=y.z,c.push(d)}f&&c.sort(b);return c};this.projectScene=function(d,e,g){var D=[],
+J=e.near,M=e.far,F,K,G,Q,w,N,L,y,C,v,A,H,S,la,V,ca,W;O=q=m=n=0;e.matrixAutoUpdate&&e.update(void 0,!0);d.update(void 0,!1,e);o.multiply(e.projectionMatrix,e.matrixWorldInverse);r[0].set(o.n41-o.n11,o.n42-o.n12,o.n43-o.n13,o.n44-o.n14);r[1].set(o.n41+o.n11,o.n42+o.n12,o.n43+o.n13,o.n44+o.n14);r[2].set(o.n41+o.n21,o.n42+o.n22,o.n43+o.n23,o.n44+o.n24);r[3].set(o.n41-o.n21,o.n42-o.n22,o.n43-o.n23,o.n44-o.n24);r[4].set(o.n41-o.n31,o.n42-o.n32,o.n43-o.n33,o.n44-o.n34);r[5].set(o.n41+o.n31,o.n42+o.n32,o.n43+
+o.n33,o.n44+o.n34);for(F=0;F<6;F++)C=r[F],C.divideScalar(Math.sqrt(C.x*C.x+C.y*C.y+C.z*C.z));C=this.projectObjects(d,e,!0);d=0;for(F=C.length;d<F;d++)if(v=C[d].object,v.visible)if(A=v.matrixWorld,H=v.matrixRotationWorld,S=v.materials,la=v.overdraw,h=0,v instanceof THREE.Mesh){V=v.geometry;Q=V.vertices;ca=V.faces;V=V.faceVertexUvs;K=0;for(G=Q.length;K<G;K++)f=a(),f.positionWorld.copy(Q[K].position),A.multiplyVector3(f.positionWorld),f.positionScreen.copy(f.positionWorld),o.multiplyVector4(f.positionScreen),
+f.positionScreen.x/=f.positionScreen.w,f.positionScreen.y/=f.positionScreen.w,f.visible=f.positionScreen.z>J&&f.positionScreen.z<M;Q=0;for(K=ca.length;Q<K;Q++){G=ca[Q];if(G instanceof THREE.Face3)if(w=i[G.a],N=i[G.b],L=i[G.c],w.visible&&N.visible&&L.visible&&(v.doubleSided||v.flipSided!=(L.positionScreen.x-w.positionScreen.x)*(N.positionScreen.y-w.positionScreen.y)-(L.positionScreen.y-w.positionScreen.y)*(N.positionScreen.x-w.positionScreen.x)<0))y=j[n]=j[n]||new THREE.RenderableFace3,n++,l=y,l.v1.copy(w),
+l.v2.copy(N),l.v3.copy(L);else continue;else if(G instanceof THREE.Face4)if(w=i[G.a],N=i[G.b],L=i[G.c],y=i[G.d],w.visible&&N.visible&&L.visible&&y.visible&&(v.doubleSided||v.flipSided!=((y.positionScreen.x-w.positionScreen.x)*(N.positionScreen.y-w.positionScreen.y)-(y.positionScreen.y-w.positionScreen.y)*(N.positionScreen.x-w.positionScreen.x)<0||(N.positionScreen.x-L.positionScreen.x)*(y.positionScreen.y-L.positionScreen.y)-(N.positionScreen.y-L.positionScreen.y)*(y.positionScreen.x-L.positionScreen.x)<
+0)))W=k[m]=k[m]||new THREE.RenderableFace4,m++,l=W,l.v1.copy(w),l.v2.copy(N),l.v3.copy(L),l.v4.copy(y);else continue;l.normalWorld.copy(G.normal);H.multiplyVector3(l.normalWorld);l.centroidWorld.copy(G.centroid);A.multiplyVector3(l.centroidWorld);l.centroidScreen.copy(l.centroidWorld);o.multiplyVector3(l.centroidScreen);L=G.vertexNormals;w=0;for(N=L.length;w<N;w++)y=l.vertexNormalsWorld[w],y.copy(L[w]),H.multiplyVector3(y);w=0;for(N=V.length;w<N;w++)if(W=V[w][Q]){L=0;for(y=W.length;L<y;L++)l.uvs[w][L]=
+W[L]}l.meshMaterials=S;l.faceMaterials=G.materials;l.overdraw=la;l.z=l.centroidScreen.z;D.push(l)}}else if(v instanceof THREE.Line){t.multiply(o,A);Q=v.geometry.vertices;w=a();w.positionScreen.copy(Q[0].position);t.multiplyVector4(w.positionScreen);K=1;for(G=Q.length;K<G;K++)if(w=a(),w.positionScreen.copy(Q[K].position),t.multiplyVector4(w.positionScreen),N=i[h-2],x.copy(w.positionScreen),E.copy(N.positionScreen),c(x,E))x.multiplyScalar(1/x.w),E.multiplyScalar(1/E.w),A=u[q]=u[q]||new THREE.RenderableLine,
+q++,p=A,p.v1.positionScreen.copy(x),p.v2.positionScreen.copy(E),p.z=Math.max(x.z,E.z),p.materials=v.materials,D.push(p)}else if(v instanceof THREE.Particle&&(B.set(v.matrixWorld.n14,v.matrixWorld.n24,v.matrixWorld.n34,1),o.multiplyVector4(B),B.z/=B.w,B.z>0&&B.z<1))A=P[O]=P[O]||new THREE.RenderableParticle,O++,s=A,s.x=B.x/B.w,s.y=B.y/B.w,s.z=B.z,s.rotation=v.rotation.z,s.scale.x=v.scale.x*Math.abs(s.x-(B.x+e.projectionMatrix.n11)/(B.w+e.projectionMatrix.n14)),s.scale.y=v.scale.y*Math.abs(s.y-(B.y+
+e.projectionMatrix.n22)/(B.w+e.projectionMatrix.n24)),s.materials=v.materials,D.push(s);g&&D.sort(b);return D}};
+THREE.CanvasRenderer=function(a){function b(a){if(u!=a)k.globalAlpha=u=a}function c(a){if(s!=a){switch(a){case THREE.NormalBlending:k.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:k.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:k.globalCompositeOperation="darker"}s=a}}function d(a){if(O!=a)k.strokeStyle=O=a}function e(a){if(P!=a)k.fillStyle=P=a}var g=this,f=null,h=new THREE.Projector,a=a||{},i=a.canvas!==void 0?a.canvas:document.createElement("canvas"),
+l,n,j,m,k=i.getContext("2d"),p=new THREE.Color(0),q=0,u=1,s=0,O=null,P=null,y=null,B=null,o=null,t,r,x,E,Z=new THREE.RenderableVertex,$=new THREE.RenderableVertex,I,D,J,M,F,K,G,Q,w,N,L,pa,C=new THREE.Color(0),v=new THREE.Color(0),A=new THREE.Color(0),H=new THREE.Color(0),S=new THREE.Color(0),la=[],V,ca,W,aa,Da,Ea,Fa,Ga,Ha,Ia,ja=new THREE.Rectangle,X=new THREE.Rectangle,U=new THREE.Rectangle,za=!1,ba=new THREE.Color,Y=new THREE.Color,ta=new THREE.Color,ua=new THREE.Color,R=new THREE.Vector3,qa,ra,
+Aa,da,sa,va,a=16;qa=document.createElement("canvas");qa.width=qa.height=2;ra=qa.getContext("2d");ra.fillStyle="rgba(0,0,0,1)";ra.fillRect(0,0,2,2);Aa=ra.getImageData(0,0,2,2);da=Aa.data;sa=document.createElement("canvas");sa.width=sa.height=a;va=sa.getContext("2d");va.translate(-a/2,-a/2);va.scale(a,a);a--;this.domElement=i;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setSize=function(a,b){l=a;n=b;j=Math.floor(l/2);m=Math.floor(n/2);i.width=l;i.height=n;
+ja.set(-j,-m,j,m);X.set(-j,-m,j,m);u=1;s=0;o=B=y=P=O=null};this.setClearColor=function(a,b){p.copy(a);q=b;X.set(-j,-m,j,m)};this.setClearColorHex=function(a,b){p.setHex(a);q=b;X.set(-j,-m,j,m)};this.clear=function(){k.setTransform(1,0,0,-1,j,m);X.isEmpty()||(X.minSelf(ja),X.inflate(2),q<1&&k.clearRect(Math.floor(X.getX()),Math.floor(X.getY()),Math.floor(X.getWidth()),Math.floor(X.getHeight())),q>0&&(c(THREE.NormalBlending),b(1),e("rgba("+Math.floor(p.r*255)+","+Math.floor(p.g*255)+","+Math.floor(p.b*
+255)+","+q+")"),k.fillRect(Math.floor(X.getX()),Math.floor(X.getY()),Math.floor(X.getWidth()),Math.floor(X.getHeight()))),X.empty())};this.render=function(a,l){function i(a){var b,c,d,e=a.lights;Y.setRGB(0,0,0);ta.setRGB(0,0,0);ua.setRGB(0,0,0);a=0;for(b=e.length;a<b;a++)c=e[a],d=c.color,c instanceof THREE.AmbientLight?(Y.r+=d.r,Y.g+=d.g,Y.b+=d.b):c instanceof THREE.DirectionalLight?(ta.r+=d.r,ta.g+=d.g,ta.b+=d.b):c instanceof THREE.PointLight&&(ua.r+=d.r,ua.g+=d.g,ua.b+=d.b)}function n(a,b,c,d){var e,
+f,g,h,l=a.lights,a=0;for(e=l.length;a<e;a++)f=l[a],g=f.color,f instanceof THREE.DirectionalLight?(h=c.dot(f.position),h<=0||(h*=f.intensity,d.r+=g.r*h,d.g+=g.g*h,d.b+=g.b*h)):f instanceof THREE.PointLight&&(h=c.dot(R.sub(f.position,b).normalize()),h<=0||(h*=f.distance==0?1:1-Math.min(b.distanceTo(f.position)/f.distance,1),h!=0&&(h*=f.intensity,d.r+=g.r*h,d.g+=g.g*h,d.b+=g.b*h)))}function p(a,f,g){b(g.opacity);c(g.blending);var h,l,n,i,Ba,o;if(g instanceof THREE.ParticleBasicMaterial){if(g.map)i=g.map.image,
+Ba=i.width>>1,o=i.height>>1,g=f.scale.x*j,n=f.scale.y*m,h=g*Ba,l=n*o,U.set(a.x-h,a.y-l,a.x+h,a.y+l),ja.instersects(U)&&(k.save(),k.translate(a.x,a.y),k.rotate(-f.rotation),k.scale(g,-n),k.translate(-Ba,-o),k.drawImage(i,0,0),k.restore())}else g instanceof THREE.ParticleCanvasMaterial&&(h=f.scale.x*j,l=f.scale.y*m,U.set(a.x-h,a.y-l,a.x+h,a.y+l),ja.instersects(U)&&(d(g.color.getContextStyle()),e(g.color.getContextStyle()),k.save(),k.translate(a.x,a.y),k.rotate(-f.rotation),k.scale(h,l),g.program(k),
+k.restore()))}function q(a,e,f,g){b(g.opacity);c(g.blending);k.beginPath();k.moveTo(a.positionScreen.x,a.positionScreen.y);k.lineTo(e.positionScreen.x,e.positionScreen.y);k.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(y!=a)k.lineWidth=y=a;a=g.linecap;if(B!=a)k.lineCap=B=a;a=g.linejoin;if(o!=a)k.lineJoin=o=a;d(g.color.getContextStyle());k.stroke();U.inflate(g.linewidth*2)}}function s(a,d,e,f,h,k,j,i,m){g.data.vertices+=3;g.data.faces++;b(i.opacity);c(i.blending);I=a.positionScreen.x;
+D=a.positionScreen.y;J=d.positionScreen.x;M=d.positionScreen.y;F=e.positionScreen.x;K=e.positionScreen.y;O(I,D,J,M,F,K);if(i instanceof THREE.MeshBasicMaterial)if(i.map)i.map.mapping instanceof THREE.UVMapping&&(aa=j.uvs[0],Ca(I,D,J,M,F,K,aa[f].u,aa[f].v,aa[h].u,aa[h].v,aa[k].u,aa[k].v,i.map));else if(i.envMap){if(i.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=l.matrixWorldInverse,R.copy(j.vertexNormalsWorld[0]),Da=(R.x*a.n11+R.y*a.n12+R.z*a.n13)*0.5+0.5,Ea=-(R.x*a.n21+R.y*a.n22+R.z*
+a.n23)*0.5+0.5,R.copy(j.vertexNormalsWorld[1]),Fa=(R.x*a.n11+R.y*a.n12+R.z*a.n13)*0.5+0.5,Ga=-(R.x*a.n21+R.y*a.n22+R.z*a.n23)*0.5+0.5,R.copy(j.vertexNormalsWorld[2]),Ha=(R.x*a.n11+R.y*a.n12+R.z*a.n13)*0.5+0.5,Ia=-(R.x*a.n21+R.y*a.n22+R.z*a.n23)*0.5+0.5,Ca(I,D,J,M,F,K,Da,Ea,Fa,Ga,Ha,Ia,i.envMap)}else i.wireframe?fa(i.color,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):ga(i.color);else if(i instanceof THREE.MeshLambertMaterial)i.map&&!i.wireframe&&(i.map.mapping instanceof THREE.UVMapping&&
+(aa=j.uvs[0],Ca(I,D,J,M,F,K,aa[f].u,aa[f].v,aa[h].u,aa[h].v,aa[k].u,aa[k].v,i.map)),c(THREE.SubtractiveBlending)),za?!i.wireframe&&i.shading==THREE.SmoothShading&&j.vertexNormalsWorld.length==3?(v.r=A.r=H.r=Y.r,v.g=A.g=H.g=Y.g,v.b=A.b=H.b=Y.b,n(m,j.v1.positionWorld,j.vertexNormalsWorld[0],v),n(m,j.v2.positionWorld,j.vertexNormalsWorld[1],A),n(m,j.v3.positionWorld,j.vertexNormalsWorld[2],H),S.r=(A.r+H.r)*0.5,S.g=(A.g+H.g)*0.5,S.b=(A.b+H.b)*0.5,W=wa(v,A,H,S),ma(I,D,J,M,F,K,0,0,1,0,0,1,W)):(ba.r=Y.r,
+ba.g=Y.g,ba.b=Y.b,n(m,j.centroidWorld,j.normalWorld,ba),C.r=Math.max(0,Math.min(i.color.r*ba.r,1)),C.g=Math.max(0,Math.min(i.color.g*ba.g,1)),C.b=Math.max(0,Math.min(i.color.b*ba.b,1)),i.wireframe?fa(C,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):ga(C)):i.wireframe?fa(i.color,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):ga(i.color);else if(i instanceof THREE.MeshDepthMaterial)V=l.near,ca=l.far,v.r=v.g=v.b=1-ka(a.positionScreen.z,V,ca),A.r=A.g=A.b=1-ka(d.positionScreen.z,
+V,ca),H.r=H.g=H.b=1-ka(e.positionScreen.z,V,ca),S.r=(A.r+H.r)*0.5,S.g=(A.g+H.g)*0.5,S.b=(A.b+H.b)*0.5,W=wa(v,A,H,S),ma(I,D,J,M,F,K,0,0,1,0,0,1,W);else if(i instanceof THREE.MeshNormalMaterial)C.r=na(j.normalWorld.x),C.g=na(j.normalWorld.y),C.b=na(j.normalWorld.z),i.wireframe?fa(C,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):ga(C)}function u(a,d,e,f,h,i,j,k,m){g.data.vertices+=4;g.data.faces++;b(k.opacity);c(k.blending);if(k.map||k.envMap)s(a,d,f,0,1,3,j,k,m),s(h,e,i,1,2,3,j,k,m);else if(I=
+a.positionScreen.x,D=a.positionScreen.y,J=d.positionScreen.x,M=d.positionScreen.y,F=e.positionScreen.x,K=e.positionScreen.y,G=f.positionScreen.x,Q=f.positionScreen.y,w=h.positionScreen.x,N=h.positionScreen.y,L=i.positionScreen.x,pa=i.positionScreen.y,k instanceof THREE.MeshBasicMaterial)P(I,D,J,M,F,K,G,Q),k.wireframe?fa(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(k.color);else if(k instanceof THREE.MeshLambertMaterial)za?!k.wireframe&&k.shading==THREE.SmoothShading&&j.vertexNormalsWorld.length==
+4?(v.r=A.r=H.r=S.r=Y.r,v.g=A.g=H.g=S.g=Y.g,v.b=A.b=H.b=S.b=Y.b,n(m,j.v1.positionWorld,j.vertexNormalsWorld[0],v),n(m,j.v2.positionWorld,j.vertexNormalsWorld[1],A),n(m,j.v4.positionWorld,j.vertexNormalsWorld[3],H),n(m,j.v3.positionWorld,j.vertexNormalsWorld[2],S),W=wa(v,A,H,S),O(I,D,J,M,G,Q),ma(I,D,J,M,G,Q,0,0,1,0,0,1,W),O(w,N,F,K,L,pa),ma(w,N,F,K,L,pa,1,0,1,1,0,1,W)):(ba.r=Y.r,ba.g=Y.g,ba.b=Y.b,n(m,j.centroidWorld,j.normalWorld,ba),C.r=Math.max(0,Math.min(k.color.r*ba.r,1)),C.g=Math.max(0,Math.min(k.color.g*
+ba.g,1)),C.b=Math.max(0,Math.min(k.color.b*ba.b,1)),P(I,D,J,M,F,K,G,Q),k.wireframe?fa(C,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(C)):(P(I,D,J,M,F,K,G,Q),k.wireframe?fa(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(k.color));else if(k instanceof THREE.MeshNormalMaterial)C.r=na(j.normalWorld.x),C.g=na(j.normalWorld.y),C.b=na(j.normalWorld.z),P(I,D,J,M,F,K,G,Q),k.wireframe?fa(C,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(C);else if(k instanceof
+THREE.MeshDepthMaterial)V=l.near,ca=l.far,v.r=v.g=v.b=1-ka(a.positionScreen.z,V,ca),A.r=A.g=A.b=1-ka(d.positionScreen.z,V,ca),H.r=H.g=H.b=1-ka(f.positionScreen.z,V,ca),S.r=S.g=S.b=1-ka(e.positionScreen.z,V,ca),W=wa(v,A,H,S),O(I,D,J,M,G,Q),ma(I,D,J,M,G,Q,0,0,1,0,0,1,W),O(w,N,F,K,L,pa),ma(w,N,F,K,L,pa,1,0,1,1,0,1,W)}function O(a,b,c,d,e,f){k.beginPath();k.moveTo(a,b);k.lineTo(c,d);k.lineTo(e,f);k.lineTo(a,b);k.closePath()}function P(a,b,c,d,e,f,g,h){k.beginPath();k.moveTo(a,b);k.lineTo(c,d);k.lineTo(e,
 f);k.lineTo(g,h);k.lineTo(a,b);k.closePath()}function fa(a,b,c,e){if(y!=b)k.lineWidth=y=b;if(B!=c)k.lineCap=B=c;if(o!=e)k.lineJoin=o=e;d(a.getContextStyle());k.stroke();U.inflate(b*2)}function ga(a){e(a.getContextStyle());k.fill()}function Ca(a,b,c,d,f,g,h,j,i,l,m,n,o){if(o.image.width!=0){if(o.needsUpdate==!0||la[o.id]==void 0){var p=o.wrapS==THREE.RepeatWrapping,q=o.wrapT==THREE.RepeatWrapping;la[o.id]=k.createPattern(o.image,p&&q?"repeat":p&&!q?"repeat-x":!p&&q?"repeat-y":"no-repeat");o.needsUpdate=
 f);k.lineTo(g,h);k.lineTo(a,b);k.closePath()}function fa(a,b,c,e){if(y!=b)k.lineWidth=y=b;if(B!=c)k.lineCap=B=c;if(o!=e)k.lineJoin=o=e;d(a.getContextStyle());k.stroke();U.inflate(b*2)}function ga(a){e(a.getContextStyle());k.fill()}function Ca(a,b,c,d,f,g,h,j,i,l,m,n,o){if(o.image.width!=0){if(o.needsUpdate==!0||la[o.id]==void 0){var p=o.wrapS==THREE.RepeatWrapping,q=o.wrapT==THREE.RepeatWrapping;la[o.id]=k.createPattern(o.image,p&&q?"repeat":p&&!q?"repeat-x":!p&&q?"repeat-y":"no-repeat");o.needsUpdate=
 !1}e(la[o.id]);var p=o.offset.x/o.repeat.x,q=o.offset.y/o.repeat.y,r=(o.image.width-1)*o.repeat.x,o=(o.image.height-1)*o.repeat.y,h=(h+p)*r,j=(j+q)*o,i=(i+p)*r,l=(l+q)*o,m=(m+p)*r,n=(n+q)*o;c-=a;d-=b;f-=a;g-=b;i-=h;l-=j;m-=h;n-=j;p=1/(i*n-m*l);o=(n*c-l*f)*p;l=(n*d-l*g)*p;c=(i*f-m*c)*p;d=(i*g-m*d)*p;a=a-o*h-c*j;b=b-l*h-d*j;k.save();k.transform(o,l,c,d,a,b);k.fill();k.restore()}}function ma(a,b,c,d,e,f,g,h,j,i,l,m,n){var o,p;o=n.width-1;p=n.height-1;g*=o;h*=p;j*=o;i*=p;l*=o;m*=p;c-=a;d-=b;e-=a;f-=b;
 !1}e(la[o.id]);var p=o.offset.x/o.repeat.x,q=o.offset.y/o.repeat.y,r=(o.image.width-1)*o.repeat.x,o=(o.image.height-1)*o.repeat.y,h=(h+p)*r,j=(j+q)*o,i=(i+p)*r,l=(l+q)*o,m=(m+p)*r,n=(n+q)*o;c-=a;d-=b;f-=a;g-=b;i-=h;l-=j;m-=h;n-=j;p=1/(i*n-m*l);o=(n*c-l*f)*p;l=(n*d-l*g)*p;c=(i*f-m*c)*p;d=(i*g-m*d)*p;a=a-o*h-c*j;b=b-l*h-d*j;k.save();k.transform(o,l,c,d,a,b);k.fill();k.restore()}}function ma(a,b,c,d,e,f,g,h,j,i,l,m,n){var o,p;o=n.width-1;p=n.height-1;g*=o;h*=p;j*=o;i*=p;l*=o;m*=p;c-=a;d-=b;e-=a;f-=b;
 j-=g;i-=h;l-=g;m-=h;p=1/(j*m-l*i);o=(m*c-i*e)*p;i=(m*d-i*f)*p;c=(j*e-l*c)*p;d=(j*f-l*d)*p;a=a-o*g-c*h;b=b-i*g-d*h;k.save();k.transform(o,i,c,d,a,b);k.clip();k.drawImage(n,0,0);k.restore()}function wa(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),i=~~(c.r*255),j=~~(c.g*255),c=~~(c.b*255),k=~~(d.r*255),l=~~(d.g*255),d=~~(d.b*255);da[0]=e<0?0:e>255?255:e;da[1]=f<0?0:f>255?255:f;da[2]=a<0?0:a>255?255:a;da[4]=g<0?0:g>255?255:g;da[5]=h<0?0:h>255?255:h;
 j-=g;i-=h;l-=g;m-=h;p=1/(j*m-l*i);o=(m*c-i*e)*p;i=(m*d-i*f)*p;c=(j*e-l*c)*p;d=(j*f-l*d)*p;a=a-o*g-c*h;b=b-i*g-d*h;k.save();k.transform(o,i,c,d,a,b);k.clip();k.drawImage(n,0,0);k.restore()}function wa(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),i=~~(c.r*255),j=~~(c.g*255),c=~~(c.b*255),k=~~(d.r*255),l=~~(d.g*255),d=~~(d.b*255);da[0]=e<0?0:e>255?255:e;da[1]=f<0?0:f>255?255:f;da[2]=a<0?0:a>255?255:a;da[4]=g<0?0:g>255?255:g;da[5]=h<0?0:h>255?255:h;
 da[6]=b<0?0:b>255?255:b;da[8]=i<0?0:i>255?255:i;da[9]=j<0?0:j>255?255:j;da[10]=c<0?0:c>255?255:c;da[12]=k<0?0:k>255?255:k;da[13]=l<0?0:l>255?255:l;da[14]=d<0?0:d>255?255:d;ra.putImageData(Aa,0,0);va.drawImage(qa,0,0);return sa}function ka(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function na(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function ha(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;e!=0&&(e=1/Math.sqrt(e),c*=e,d*=e,b.x+=c,b.y+=d,a.x-=c,a.y-=d)}var xa,Ja,z,ea,ia,oa,ya,T;this.autoClear?this.clear():k.setTransform(1,
 da[6]=b<0?0:b>255?255:b;da[8]=i<0?0:i>255?255:i;da[9]=j<0?0:j>255?255:j;da[10]=c<0?0:c>255?255:c;da[12]=k<0?0:k>255?255:k;da[13]=l<0?0:l>255?255:l;da[14]=d<0?0:d>255?255:d;ra.putImageData(Aa,0,0);va.drawImage(qa,0,0);return sa}function ka(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function na(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function ha(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;e!=0&&(e=1/Math.sqrt(e),c*=e,d*=e,b.x+=c,b.y+=d,a.x-=c,a.y-=d)}var xa,Ja,z,ea,ia,oa,ya,T;this.autoClear?this.clear():k.setTransform(1,
-0,0,-1,i,n);g.data.vertices=0;g.data.faces=0;f=h.projectScene(a,l,this.sortElements);(za=a.lights.length>0)&&j(a);xa=0;for(Ja=f.length;xa<Ja;xa++){z=f[xa];U.empty();if(z instanceof THREE.RenderableParticle){t=z;t.x*=i;t.y*=n;ea=0;for(ia=z.materials.length;ea<ia;)T=z.materials[ea++],T.opacity!=0&&p(t,z,T,a)}else if(z instanceof THREE.RenderableLine){if(t=z.v1,r=z.v2,t.positionScreen.x*=i,t.positionScreen.y*=n,r.positionScreen.x*=i,r.positionScreen.y*=n,U.addPoint(t.positionScreen.x,t.positionScreen.y),
-U.addPoint(r.positionScreen.x,r.positionScreen.y),ja.instersects(U)){ea=0;for(ia=z.materials.length;ea<ia;)T=z.materials[ea++],T.opacity!=0&&q(t,r,z,T,a)}}else if(z instanceof THREE.RenderableFace3){if(t=z.v1,r=z.v2,x=z.v3,t.positionScreen.x*=i,t.positionScreen.y*=n,r.positionScreen.x*=i,r.positionScreen.y*=n,x.positionScreen.x*=i,x.positionScreen.y*=n,z.overdraw&&(ha(t.positionScreen,r.positionScreen),ha(r.positionScreen,x.positionScreen),ha(x.positionScreen,t.positionScreen)),U.add3Points(t.positionScreen.x,
-t.positionScreen.y,r.positionScreen.x,r.positionScreen.y,x.positionScreen.x,x.positionScreen.y),ja.instersects(U)){ea=0;for(ia=z.meshMaterials.length;ea<ia;)if(T=z.meshMaterials[ea++],T instanceof THREE.MeshFaceMaterial){oa=0;for(ya=z.faceMaterials.length;oa<ya;)(T=z.faceMaterials[oa++])&&T.opacity!=0&&s(t,r,x,0,1,2,z,T,a)}else T.opacity!=0&&s(t,r,x,0,1,2,z,T,a)}}else if(z instanceof THREE.RenderableFace4&&(t=z.v1,r=z.v2,x=z.v3,E=z.v4,t.positionScreen.x*=i,t.positionScreen.y*=n,r.positionScreen.x*=
-i,r.positionScreen.y*=n,x.positionScreen.x*=i,x.positionScreen.y*=n,E.positionScreen.x*=i,E.positionScreen.y*=n,Z.positionScreen.copy(r.positionScreen),$.positionScreen.copy(E.positionScreen),z.overdraw&&(ha(t.positionScreen,r.positionScreen),ha(r.positionScreen,E.positionScreen),ha(E.positionScreen,t.positionScreen),ha(x.positionScreen,Z.positionScreen),ha(x.positionScreen,$.positionScreen)),U.addPoint(t.positionScreen.x,t.positionScreen.y),U.addPoint(r.positionScreen.x,r.positionScreen.y),U.addPoint(x.positionScreen.x,
-x.positionScreen.y),U.addPoint(E.positionScreen.x,E.positionScreen.y),ja.instersects(U))){ea=0;for(ia=z.meshMaterials.length;ea<ia;)if(T=z.meshMaterials[ea++],T instanceof THREE.MeshFaceMaterial){oa=0;for(ya=z.faceMaterials.length;oa<ya;)(T=z.faceMaterials[oa++])&&T.opacity!=0&&v(t,r,x,E,Z,$,z,T,a)}else T.opacity!=0&&v(t,r,x,E,Z,$,z,T,a)}X.addRectangle(U)}k.setTransform(1,0,0,1,0,0)}};
+0,0,-1,j,m);g.data.vertices=0;g.data.faces=0;f=h.projectScene(a,l,this.sortElements);(za=a.lights.length>0)&&i(a);xa=0;for(Ja=f.length;xa<Ja;xa++){z=f[xa];U.empty();if(z instanceof THREE.RenderableParticle){t=z;t.x*=j;t.y*=m;ea=0;for(ia=z.materials.length;ea<ia;)T=z.materials[ea++],T.opacity!=0&&p(t,z,T,a)}else if(z instanceof THREE.RenderableLine){if(t=z.v1,r=z.v2,t.positionScreen.x*=j,t.positionScreen.y*=m,r.positionScreen.x*=j,r.positionScreen.y*=m,U.addPoint(t.positionScreen.x,t.positionScreen.y),
+U.addPoint(r.positionScreen.x,r.positionScreen.y),ja.instersects(U)){ea=0;for(ia=z.materials.length;ea<ia;)T=z.materials[ea++],T.opacity!=0&&q(t,r,z,T,a)}}else if(z instanceof THREE.RenderableFace3){if(t=z.v1,r=z.v2,x=z.v3,t.positionScreen.x*=j,t.positionScreen.y*=m,r.positionScreen.x*=j,r.positionScreen.y*=m,x.positionScreen.x*=j,x.positionScreen.y*=m,z.overdraw&&(ha(t.positionScreen,r.positionScreen),ha(r.positionScreen,x.positionScreen),ha(x.positionScreen,t.positionScreen)),U.add3Points(t.positionScreen.x,
+t.positionScreen.y,r.positionScreen.x,r.positionScreen.y,x.positionScreen.x,x.positionScreen.y),ja.instersects(U)){ea=0;for(ia=z.meshMaterials.length;ea<ia;)if(T=z.meshMaterials[ea++],T instanceof THREE.MeshFaceMaterial){oa=0;for(ya=z.faceMaterials.length;oa<ya;)(T=z.faceMaterials[oa++])&&T.opacity!=0&&s(t,r,x,0,1,2,z,T,a)}else T.opacity!=0&&s(t,r,x,0,1,2,z,T,a)}}else if(z instanceof THREE.RenderableFace4&&(t=z.v1,r=z.v2,x=z.v3,E=z.v4,t.positionScreen.x*=j,t.positionScreen.y*=m,r.positionScreen.x*=
+j,r.positionScreen.y*=m,x.positionScreen.x*=j,x.positionScreen.y*=m,E.positionScreen.x*=j,E.positionScreen.y*=m,Z.positionScreen.copy(r.positionScreen),$.positionScreen.copy(E.positionScreen),z.overdraw&&(ha(t.positionScreen,r.positionScreen),ha(r.positionScreen,E.positionScreen),ha(E.positionScreen,t.positionScreen),ha(x.positionScreen,Z.positionScreen),ha(x.positionScreen,$.positionScreen)),U.addPoint(t.positionScreen.x,t.positionScreen.y),U.addPoint(r.positionScreen.x,r.positionScreen.y),U.addPoint(x.positionScreen.x,
+x.positionScreen.y),U.addPoint(E.positionScreen.x,E.positionScreen.y),ja.instersects(U))){ea=0;for(ia=z.meshMaterials.length;ea<ia;)if(T=z.meshMaterials[ea++],T instanceof THREE.MeshFaceMaterial){oa=0;for(ya=z.faceMaterials.length;oa<ya;)(T=z.faceMaterials[oa++])&&T.opacity!=0&&u(t,r,x,E,Z,$,z,T,a)}else T.opacity!=0&&u(t,r,x,E,Z,$,z,T,a)}X.addRectangle(U)}k.setTransform(1,0,0,1,0,0)}};
 THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
 THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
 THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};

+ 39 - 38
build/custom/ThreeDOM.js

@@ -1,49 +1,49 @@
-// ThreeDOM.js r43 - http://github.com/mrdoob/three.js
+// ThreeDOM.js r44dev - http://github.com/mrdoob/three.js
 var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this};
 var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this};
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,g;if(c==0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),e=a*6-d,a=c*(1-b),g=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,g;if(c==0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),e=a*6-d,a=c*(1-b),g=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=
 c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=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},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
 c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=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},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
-THREE.Vector2=function(a,b){this.set(a||0,b||0)};
+THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},
 divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},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.lengthSq())},normalize:function(){return this.divideScalar(this.length())},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},setLength:function(a){return this.normalize().multiplyScalar(a)},
 divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},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.lengthSq())},normalize:function(){return this.divideScalar(this.length())},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},setLength:function(a){return this.normalize().multiplyScalar(a)},
-unit:function(){return this.normalize()},equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)};
+equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0};
 THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){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},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=
 THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){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},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=
-a.z-b.z;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){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},divideSelf:function(a){return this.divide(this,a)},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},
+a.z-b.z;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){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},divideSelf:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},
 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.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){return this.set(this.y*
 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.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){return this.set(this.y*
 a.z-this.z*a.y,this.z*a.x-this.x*a.z,this.x*a.y-this.y*a.x)},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this,a).lengthSq()},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},isZero:function(){return this.lengthSq()<
 a.z-this.z*a.y,this.z*a.x-this.x*a.z,this.x*a.y-this.y*a.x)},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this,a).lengthSq()},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},isZero:function(){return this.lengthSq()<
-1.0E-4}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)};
-THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){return this.set(a.x,a.y,a.z,a.w||1)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add: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},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub: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},
-subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a,this.w/=a):this.set(0,0,0,1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},
-setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf: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}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
-THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d=[];b=0;for(c=a.length;b<c;b++)d=d.concat(this.intersectObject(a[b]));d.sort(function(a,b){return a.distance-b.distance});return d},intersectObject:function(a){function b(a,b,c){var d,c=c.matrixWorld.getPosition();d=c.clone().subSelf(a).dot(b);a=a.clone().addSelf(b.clone().multiplyScalar(d));return c.distanceTo(a)}function c(a,b,c,d){var d=d.clone().subSelf(b),
-c=c.clone().subSelf(b),e=a.clone().subSelf(b),a=d.dot(d),b=d.dot(c),d=d.dot(e),f=c.dot(c),c=c.dot(e),e=1/(a*f-b*b),f=(f*d-b*c)*e,a=(a*c-b*d)*e;return f>0&&a>0&&f+a<1}if(a instanceof THREE.Particle){var d=b(this.origin,this.direction,a);if(!d||d>a.scale.x)return[];return[{distance:d,point:a.position,face:null,object:a}]}else if(a instanceof THREE.Mesh){d=b(this.origin,this.direction,a);if(!d||d>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return[];var e,g,f,h,
-j,i,k,l,m,n,p=a.geometry,q=p.vertices,t=[],d=0;for(e=p.faces.length;d<e;d++)if(g=p.faces[d],m=this.origin.clone(),n=this.direction.clone(),i=a.matrixWorld,f=i.multiplyVector3(q[g.a].position.clone()),h=i.multiplyVector3(q[g.b].position.clone()),j=i.multiplyVector3(q[g.c].position.clone()),i=g instanceof THREE.Face4?i.multiplyVector3(q[g.d].position.clone()):null,k=a.matrixRotationWorld.multiplyVector3(g.normal.clone()),l=n.dot(k),a.doubleSided||(a.flipSided?l>0:l<0))if(k=k.dot((new THREE.Vector3).sub(f,
-m))/l,m=m.addSelf(n.multiplyScalar(k)),g instanceof THREE.Face3)c(m,f,h,j)&&(g={distance:this.origin.distanceTo(m),point:m,face:g,object:a},t.push(g));else if(g instanceof THREE.Face4&&(c(m,f,h,i)||c(m,h,j,i)))g={distance:this.origin.distanceTo(m),point:m,face:g,object:a},t.push(g);return t}else return[]}};
-THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return f};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(f,g,k,l){h=!1;b=f;c=g;d=k;e=l;a()};this.addPoint=function(f,g){h?(h=!1,b=f,c=g,d=f,e=g):(b=b<f?b:f,c=c<g?c:g,d=d>f?d:f,e=e>g?e:g);a()};this.add3Points=
-function(f,g,k,l,m,n){h?(h=!1,b=f<k?f<m?f:m:k<m?k:m,c=g<l?g<n?g:n:l<n?l:n,d=f>k?f>m?f:m:k>m?k:m,e=g>l?g>n?g:n:l>n?l:n):(b=f<k?f<m?f<b?f:b:m<b?m:b:k<m?k<b?k:b:m<b?m:b,c=g<l?g<n?g<c?g:c:n<c?n:c:l<n?l<c?l:c:n<c?n:c,d=f>k?f>m?f>d?f:d:m>d?m:d:k>m?k>d?k:d:m>d?m:d,e=g>l?g>n?g>e?g:e:n>e?n:e:l>n?l>e?l:e:n>e?n:e);a()};this.addRectangle=function(f){h?(h=!1,b=f.getLeft(),c=f.getTop(),d=f.getRight(),e=f.getBottom()):(b=b<f.getLeft()?b:f.getLeft(),c=c<f.getTop()?c:f.getTop(),d=d>f.getRight()?d:f.getRight(),e=e>
+1.0E-4}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d||1};
+THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add: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},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub: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},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a,this.w/=a):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
+normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf: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}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
+THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d=[];b=0;for(c=a.length;b<c;b++)d=d.concat(this.intersectObject(a[b]));d.sort(function(a,b){return a.distance-b.distance});return d},intersectObject:function(a){function b(a,b,c){var d;d=c.clone().subSelf(a).dot(b);if(d<=0)return null;a=a.clone().addSelf(b.clone().multiplyScalar(d));return c.distanceTo(a)}function c(a,b,c,d){var d=d.clone().subSelf(b),
+c=c.clone().subSelf(b),e=a.clone().subSelf(b),a=d.dot(d),b=d.dot(c),d=d.dot(e),f=c.dot(c),c=c.dot(e),e=1/(a*f-b*b),f=(f*d-b*c)*e,a=(a*c-b*d)*e;return f>0&&a>0&&f+a<1}if(a instanceof THREE.Particle){var d=b(this.origin,this.direction,a.matrixWorld.getPosition());if(d==null||d>a.scale.x)return[];return[{distance:d,point:a.position,face:null,object:a}]}else if(a instanceof THREE.Mesh){d=b(this.origin,this.direction,a.matrixWorld.getPosition());if(d==null||d>a.geometry.boundingSphere.radius*Math.max(a.scale.x,
+Math.max(a.scale.y,a.scale.z)))return[];var e,g,f,h,j,i,l,k,m,n,p=a.geometry,q=p.vertices,s=[],d=0;for(e=p.faces.length;d<e;d++)if(g=p.faces[d],m=this.origin.clone(),n=this.direction.clone(),i=a.matrixWorld,f=i.multiplyVector3(g.centroid.clone()).subSelf(m),k=f.dot(n),!(k<=0)&&(f=i.multiplyVector3(q[g.a].position.clone()),h=i.multiplyVector3(q[g.b].position.clone()),j=i.multiplyVector3(q[g.c].position.clone()),i=g instanceof THREE.Face4?i.multiplyVector3(q[g.d].position.clone()):null,l=a.matrixRotationWorld.multiplyVector3(g.normal.clone()),
+k=n.dot(l),a.doubleSided||(a.flipSided?k>0:k<0)))if(k=l.dot((new THREE.Vector3).sub(f,m))/k,m=m.addSelf(n.multiplyScalar(k)),g instanceof THREE.Face3)c(m,f,h,j)&&(g={distance:this.origin.distanceTo(m),point:m,face:g,object:a},s.push(g));else if(g instanceof THREE.Face4&&(c(m,f,h,i)||c(m,h,j,i)))g={distance:this.origin.distanceTo(m),point:m,face:g,object:a},s.push(g);s.sort(function(a,b){return a.distance-b.distance});return s}else return[]}};
+THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return f};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(f,g,l,k){h=!1;b=f;c=g;d=l;e=k;a()};this.addPoint=function(f,g){h?(h=!1,b=f,c=g,d=f,e=g):(b=b<f?b:f,c=c<g?c:g,d=d>f?d:f,e=e>g?e:g);a()};this.add3Points=
+function(f,g,l,k,m,n){h?(h=!1,b=f<l?f<m?f:m:l<m?l:m,c=g<k?g<n?g:n:k<n?k:n,d=f>l?f>m?f:m:l>m?l:m,e=g>k?g>n?g:n:k>n?k:n):(b=f<l?f<m?f<b?f:b:m<b?m:b:l<m?l<b?l:b:m<b?m:b,c=g<k?g<n?g<c?g:c:n<c?n:c:k<n?k<c?k:c:n<c?n:c,d=f>l?f>m?f>d?f:d:m>d?m:d:l>m?l>d?l:d:m>d?m:d,e=g>k?g>n?g>e?g:e:n>e?n:e:k>n?k>e?k:e:n>e?n:e);a()};this.addRectangle=function(f){h?(h=!1,b=f.getLeft(),c=f.getTop(),d=f.getRight(),e=f.getBottom()):(b=b<f.getLeft()?b:f.getLeft(),c=c<f.getTop()?c:f.getTop(),d=d>f.getRight()?d:f.getRight(),e=e>
 f.getBottom()?e:f.getBottom());a()};this.inflate=function(f){b-=f;c-=f;d+=f;e+=f;a()};this.minSelf=function(f){b=b>f.getLeft()?b:f.getLeft();c=c>f.getTop()?c:f.getTop();d=d<f.getRight()?d:f.getRight();e=e<f.getBottom()?e:f.getBottom();a()};this.instersects=function(a){return Math.min(d,a.getRight())-Math.max(b,a.getLeft())>=0&&Math.min(e,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){h=!0;e=d=c=b=0;a()};this.isEmpty=function(){return h}};THREE.Matrix3=function(){this.m=[]};
 f.getBottom()?e:f.getBottom());a()};this.inflate=function(f){b-=f;c-=f;d+=f;e+=f;a()};this.minSelf=function(f){b=b>f.getLeft()?b:f.getLeft();c=c>f.getTop()?c:f.getTop();d=d<f.getRight()?d:f.getRight();e=e<f.getBottom()?e:f.getBottom();a()};this.instersects=function(a){return Math.min(d,a.getRight())-Math.max(b,a.getLeft())>=0&&Math.min(e,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){h=!0;e=d=c=b=0;a()};this.isEmpty=function(){return h}};THREE.Matrix3=function(){this.m=[]};
-THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};THREE.Matrix4=function(a,b,c,d,e,g,f,h,j,i,k,l,m,n,p,q){this.set(a||1,b||0,c||0,d||0,e||0,g||1,f||0,h||0,j||0,i||0,k||1,l||0,m||0,n||0,p||0,q||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,j,i,k,l,m,n,p,q){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=g;this.n23=f;this.n24=h;this.n31=j;this.n32=i;this.n33=k;this.n34=l;this.n41=m;this.n42=n;this.n43=p;this.n44=q;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
+THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};THREE.Matrix4=function(a,b,c,d,e,g,f,h,j,i,l,k,m,n,p,q){this.set(a||1,b||0,c||0,d||0,e||0,g||1,f||0,h||0,j||0,i||0,l||1,k||0,m||0,n||0,p||0,q||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,j,i,l,k,m,n,p,q){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=g;this.n23=f;this.n24=h;this.n31=j;this.n32=i;this.n33=l;this.n34=k;this.n41=m;this.n42=n;this.n43=p;this.n44=q;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
 b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;d.cross(c,g).normalize();d.length()===0&&(g.x+=1.0E-4,d.cross(c,g).normalize());e.cross(g,d).normalize();this.n11=d.x;this.n12=e.x;this.n13=g.x;this.n21=d.y;this.n22=e.y;this.n23=g.y;this.n31=d.z;this.n32=e.z;this.n33=g.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,d=a.z,e=1/(this.n41*b+this.n42*c+this.n43*d+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*d+this.n14)*e;
 b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;d.cross(c,g).normalize();d.length()===0&&(g.x+=1.0E-4,d.cross(c,g).normalize());e.cross(g,d).normalize();this.n11=d.x;this.n12=e.x;this.n13=g.x;this.n21=d.y;this.n22=e.y;this.n23=g.y;this.n31=d.z;this.n32=e.z;this.n33=g.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,d=a.z,e=1/(this.n41*b+this.n42*c+this.n43*d+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*d+this.n14)*e;
 a.y=(this.n21*b+this.n22*c+this.n23*d+this.n24)*e;a.z=(this.n31*b+this.n32*c+this.n33*d+this.n34)*e;return a},multiplyVector4:function(a){var b=a.x,c=a.y,d=a.z,e=a.w;a.x=this.n11*b+this.n12*c+this.n13*d+this.n14*e;a.y=this.n21*b+this.n22*c+this.n23*d+this.n24*e;a.z=this.n31*b+this.n32*c+this.n33*d+this.n34*e;a.w=this.n41*b+this.n42*c+this.n43*d+this.n44*e;return a},rotateAxis:function(a){var b=a.x,c=a.y,d=a.z;a.x=b*this.n11+c*this.n12+d*this.n13;a.y=b*this.n21+c*this.n22+d*this.n23;a.z=b*this.n31+
 a.y=(this.n21*b+this.n22*c+this.n23*d+this.n24)*e;a.z=(this.n31*b+this.n32*c+this.n33*d+this.n34)*e;return a},multiplyVector4:function(a){var b=a.x,c=a.y,d=a.z,e=a.w;a.x=this.n11*b+this.n12*c+this.n13*d+this.n14*e;a.y=this.n21*b+this.n22*c+this.n23*d+this.n24*e;a.z=this.n31*b+this.n32*c+this.n33*d+this.n34*e;a.w=this.n41*b+this.n42*c+this.n43*d+this.n44*e;return a},rotateAxis:function(a){var b=a.x,c=a.y,d=a.z;a.x=b*this.n11+c*this.n12+d*this.n13;a.y=b*this.n21+c*this.n22+d*this.n23;a.z=b*this.n31+
-c*this.n32+d*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,j=a.n23,i=a.n24,k=a.n31,l=a.n32,m=a.n33,n=a.n34,p=a.n41,q=a.n42,t=a.n43,r=a.n44,J=b.n11,M=b.n12,
-G=b.n13,v=b.n14,o=b.n21,K=b.n22,z=b.n23,C=b.n24,D=b.n31,Q=b.n32,R=b.n33,S=b.n34,H=b.n41,T=b.n42,O=b.n43,E=b.n44;this.n11=c*J+d*o+e*D+g*H;this.n12=c*M+d*K+e*Q+g*T;this.n13=c*G+d*z+e*R+g*O;this.n14=c*v+d*C+e*S+g*E;this.n21=f*J+h*o+j*D+i*H;this.n22=f*M+h*K+j*Q+i*T;this.n23=f*G+h*z+j*R+i*O;this.n24=f*v+h*C+j*S+i*E;this.n31=k*J+l*o+m*D+n*H;this.n32=k*M+l*K+m*Q+n*T;this.n33=k*G+l*z+m*R+n*O;this.n34=k*v+l*C+m*S+n*E;this.n41=p*J+q*o+t*D+r*H;this.n42=p*M+q*K+t*Q+r*T;this.n43=p*G+q*z+t*R+r*O;this.n44=p*v+q*
-C+t*S+r*E;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=
-a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,j=this.n31,i=this.n32,k=this.n33,l=this.n34,m=this.n41,n=this.n42,p=this.n43,q=this.n44;return d*f*i*m-c*h*i*m-d*g*k*m+b*h*k*m+c*g*l*m-b*f*l*m-d*f*j*n+c*h*j*n+d*e*k*n-a*h*k*n-c*e*l*n+a*f*l*n+d*g*j*p-b*h*j*p-d*e*i*p+a*h*i*p+b*e*l*p-a*g*l*p-c*g*j*q+b*f*j*q+c*e*i*q-a*f*i*q-b*e*k*q+a*g*k*q},
+c*this.n32+d*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,j=a.n23,i=a.n24,l=a.n31,k=a.n32,m=a.n33,n=a.n34,p=a.n41,q=a.n42,s=a.n43,r=a.n44,J=b.n11,M=b.n12,
+G=b.n13,v=b.n14,o=b.n21,K=b.n22,z=b.n23,C=b.n24,D=b.n31,Q=b.n32,R=b.n33,S=b.n34,H=b.n41,T=b.n42,O=b.n43,E=b.n44;this.n11=c*J+d*o+e*D+g*H;this.n12=c*M+d*K+e*Q+g*T;this.n13=c*G+d*z+e*R+g*O;this.n14=c*v+d*C+e*S+g*E;this.n21=f*J+h*o+j*D+i*H;this.n22=f*M+h*K+j*Q+i*T;this.n23=f*G+h*z+j*R+i*O;this.n24=f*v+h*C+j*S+i*E;this.n31=l*J+k*o+m*D+n*H;this.n32=l*M+k*K+m*Q+n*T;this.n33=l*G+k*z+m*R+n*O;this.n34=l*v+k*C+m*S+n*E;this.n41=p*J+q*o+s*D+r*H;this.n42=p*M+q*K+s*Q+r*T;this.n43=p*G+q*z+s*R+r*O;this.n44=p*v+q*
+C+s*S+r*E;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=
+a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,j=this.n31,i=this.n32,l=this.n33,k=this.n34,m=this.n41,n=this.n42,p=this.n43,q=this.n44;return d*f*i*m-c*h*i*m-d*g*l*m+b*h*l*m+c*g*k*m-b*f*k*m-d*f*j*n+c*h*j*n+d*e*l*n-a*h*l*n-c*e*k*n+a*f*k*n+d*g*j*p-b*h*j*p-d*e*i*p+a*h*i*p+b*e*k*p-a*g*k*p-c*g*j*q+b*f*j*q+c*e*i*q-a*f*i*q-b*e*l*q+a*g*l*q},
 transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;
 transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;
 a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=this.n11;
 a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=this.n11;
 a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;
 a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;
 a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,
 a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,
 0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,j=e*g,i=e*f;this.set(j*g+c,j*f-d*h,j*h+d*f,0,j*f+d*h,i*f+c,i*h-d*g,0,j*h-d*f,i*h+d*g,e*h*h+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
 0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,j=e*g,i=e*f;this.set(j*g+c,j*f-d*h,j*h+d*f,0,j*f+d*h,i*f+c,i*h-d*g,0,j*h-d*f,i*h+d*g,e*h*h+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
 new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);switch(b){case "YXZ":var j=
 new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);switch(b){case "YXZ":var j=
-f*h,i=f*e,k=d*h,l=d*e;this.n11=j+l*c;this.n12=k*c-i;this.n13=g*d;this.n21=g*e;this.n22=g*h;this.n23=-c;this.n31=i*c-k;this.n32=l+j*c;this.n33=g*f;break;case "ZXY":j=f*h;i=f*e;k=d*h;l=d*e;this.n11=j-l*c;this.n12=-g*e;this.n13=k+i*c;this.n21=i+k*c;this.n22=g*h;this.n23=l-j*c;this.n31=-g*d;this.n32=c;this.n33=g*f;break;case "ZYX":j=g*h;i=g*e;k=c*h;l=c*e;this.n11=f*h;this.n12=k*d-i;this.n13=j*d+l;this.n21=f*e;this.n22=l*d+j;this.n23=i*d-k;this.n31=-d;this.n32=c*f;this.n33=g*f;break;case "YZX":j=g*f;i=
-g*d;k=c*f;l=c*d;this.n11=f*h;this.n12=l-j*e;this.n13=k*e+i;this.n21=e;this.n22=g*h;this.n23=-c*h;this.n31=-d*h;this.n32=i*e+k;this.n33=j-l*e;break;case "XZY":j=g*f;i=g*d;k=c*f;l=c*d;this.n11=f*h;this.n12=-e;this.n13=d*h;this.n21=j*e+l;this.n22=g*h;this.n23=i*e-k;this.n31=k*e-i;this.n32=c*h;this.n33=l*e+j;break;default:j=g*h,i=g*e,k=c*h,l=c*e,this.n11=f*h,this.n12=-f*e,this.n13=d,this.n21=i+k*d,this.n22=j-l*d,this.n23=-c*f,this.n31=l-j*d,this.n32=k+i*d,this.n33=g*f}return this},setRotationFromQuaternion:function(a){var b=
+f*h,i=f*e,l=d*h,k=d*e;this.n11=j+k*c;this.n12=l*c-i;this.n13=g*d;this.n21=g*e;this.n22=g*h;this.n23=-c;this.n31=i*c-l;this.n32=k+j*c;this.n33=g*f;break;case "ZXY":j=f*h;i=f*e;l=d*h;k=d*e;this.n11=j-k*c;this.n12=-g*e;this.n13=l+i*c;this.n21=i+l*c;this.n22=g*h;this.n23=k-j*c;this.n31=-g*d;this.n32=c;this.n33=g*f;break;case "ZYX":j=g*h;i=g*e;l=c*h;k=c*e;this.n11=f*h;this.n12=l*d-i;this.n13=j*d+k;this.n21=f*e;this.n22=k*d+j;this.n23=i*d-l;this.n31=-d;this.n32=c*f;this.n33=g*f;break;case "YZX":j=g*f;i=
+g*d;l=c*f;k=c*d;this.n11=f*h;this.n12=k-j*e;this.n13=l*e+i;this.n21=e;this.n22=g*h;this.n23=-c*h;this.n31=-d*h;this.n32=i*e+l;this.n33=j-k*e;break;case "XZY":j=g*f;i=g*d;l=c*f;k=c*d;this.n11=f*h;this.n12=-e;this.n13=d*h;this.n21=j*e+k;this.n22=g*h;this.n23=i*e-l;this.n31=l*e-i;this.n32=c*h;this.n33=k*e+j;break;default:j=g*h,i=g*e,l=c*h,k=c*e,this.n11=f*h,this.n12=-f*e,this.n13=d,this.n21=i+l*d,this.n22=j-k*d,this.n23=-c*f,this.n31=k-j*d,this.n32=l+i*d,this.n33=g*f}return this},setRotationFromQuaternion:function(a){var b=
 a.x,c=a.y,d=a.z,e=a.w,g=b+b,f=c+c,h=d+d,a=b*g,j=b*f;b*=h;var i=c*f;c*=h;d*=h;g*=e;f*=e;e*=h;this.n11=1-(i+d);this.n12=j-e;this.n13=b+f;this.n21=j+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+i);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,e=THREE.Matrix4.__m2;
 a.x,c=a.y,d=a.z,e=a.w,g=b+b,f=c+c,h=d+d,a=b*g,j=b*f;b*=h;var i=c*f;c*=h;d*=h;g*=e;f*=e;e*=h;this.n11=1-(i+d);this.n12=j-e;this.n13=b+f;this.n21=j+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+i);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,e=THREE.Matrix4.__m2;
 d.identity();d.setRotationFromQuaternion(b);e.setScale(c.x,c.y,c.z);this.multiply(d,e);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);e.set(this.n12,this.n22,this.n32);g.set(this.n13,this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=d.length();
 d.identity();d.setRotationFromQuaternion(b);e.setScale(c.x,c.y,c.z);this.multiply(d,e);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);e.set(this.n12,this.n22,this.n32);g.set(this.n13,this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=d.length();
 c.y=e.length();c.z=g.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=c.x;d.n21/=c.x;d.n31/=c.x;d.n12/=c.y;d.n22/=c.y;d.n32/=c.y;d.n13/=c.z;d.n23/=c.z;d.n33/=c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,d=1/b.y,e=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*d;this.n22=a.n22*d;this.n32=a.n32*d;this.n13=a.n13*e;this.n23=
 c.y=e.length();c.z=g.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=c.x;d.n21/=c.x;d.n31/=c.x;d.n12/=c.y;d.n22/=c.y;d.n32/=c.y;d.n13/=c.z;d.n23/=c.z;d.n33/=c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,d=1/b.y,e=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*d;this.n22=a.n22*d;this.n32=a.n32*d;this.n13=a.n13*e;this.n23=
 a.n23*e;this.n33=a.n33*e}};
 a.n23*e;this.n33=a.n33*e}};
-THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,j=a.n23,i=a.n24,k=a.n31,l=a.n32,m=a.n33,n=a.n34,p=a.n41,q=a.n42,t=a.n43,r=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=j*n*q-i*m*q+i*l*t-h*n*t-j*l*r+h*m*r;b.n12=g*m*q-e*n*q-g*l*t+d*n*t+e*l*r-d*m*r;b.n13=e*i*q-g*j*q+g*h*t-d*i*t-e*h*r+d*j*r;b.n14=g*j*l-e*i*l-g*h*m+d*i*m+e*h*n-d*j*n;b.n21=i*m*p-j*n*p-i*k*t+f*n*t+j*k*r-f*m*r;b.n22=e*n*p-g*m*p+g*k*t-c*n*t-e*k*r+c*m*r;b.n23=g*j*p-e*i*p-g*f*t+c*i*t+e*f*r-c*j*r;b.n24=
-e*i*k-g*j*k+g*f*m-c*i*m-e*f*n+c*j*n;b.n31=h*n*p-i*l*p+i*k*q-f*n*q-h*k*r+f*l*r;b.n32=g*l*p-d*n*p-g*k*q+c*n*q+d*k*r-c*l*r;b.n33=e*i*p-g*h*p+g*f*q-c*i*q-d*f*r+c*h*r;b.n34=g*h*k-d*i*k-g*f*l+c*i*l+d*f*n-c*h*n;b.n41=j*l*p-h*m*p-j*k*q+f*m*q+h*k*t-f*l*t;b.n42=d*m*p-e*l*p+e*k*q-c*m*q-d*k*t+c*l*t;b.n43=e*h*p-d*j*p-e*f*q+c*j*q+d*f*t-c*h*t;b.n44=d*j*k-e*h*k+e*f*l-c*j*l-d*f*m+c*h*m;b.multiplyScalar(1/a.determinant());return b};
-THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,j=-a.n32*a.n11+a.n31*a.n12,i=a.n23*a.n12-a.n22*a.n13,k=-a.n23*a.n11+a.n21*a.n13,l=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*i;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*g;c[3]=a*f;c[4]=a*h;c[5]=a*j;c[6]=a*i;c[7]=a*k;c[8]=a*l;return b};
+THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,j=a.n23,i=a.n24,l=a.n31,k=a.n32,m=a.n33,n=a.n34,p=a.n41,q=a.n42,s=a.n43,r=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=j*n*q-i*m*q+i*k*s-h*n*s-j*k*r+h*m*r;b.n12=g*m*q-e*n*q-g*k*s+d*n*s+e*k*r-d*m*r;b.n13=e*i*q-g*j*q+g*h*s-d*i*s-e*h*r+d*j*r;b.n14=g*j*k-e*i*k-g*h*m+d*i*m+e*h*n-d*j*n;b.n21=i*m*p-j*n*p-i*l*s+f*n*s+j*l*r-f*m*r;b.n22=e*n*p-g*m*p+g*l*s-c*n*s-e*l*r+c*m*r;b.n23=g*j*p-e*i*p-g*f*s+c*i*s+e*f*r-c*j*r;b.n24=
+e*i*l-g*j*l+g*f*m-c*i*m-e*f*n+c*j*n;b.n31=h*n*p-i*k*p+i*l*q-f*n*q-h*l*r+f*k*r;b.n32=g*k*p-d*n*p-g*l*q+c*n*q+d*l*r-c*k*r;b.n33=e*i*p-g*h*p+g*f*q-c*i*q-d*f*r+c*h*r;b.n34=g*h*l-d*i*l-g*f*k+c*i*k+d*f*n-c*h*n;b.n41=j*k*p-h*m*p-j*l*q+f*m*q+h*l*s-f*k*s;b.n42=d*m*p-e*k*p+e*l*q-c*m*q-d*l*s+c*k*s;b.n43=e*h*p-d*j*p-e*f*q+c*j*q+d*f*s-c*h*s;b.n44=d*j*l-e*h*l+e*f*k-c*j*k-d*f*m+c*h*m;b.multiplyScalar(1/a.determinant());return b};
+THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,j=-a.n32*a.n11+a.n31*a.n12,i=a.n23*a.n12-a.n22*a.n13,l=-a.n23*a.n11+a.n21*a.n13,k=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*i;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*g;c[3]=a*f;c[4]=a*h;c[5]=a*j;c[6]=a*i;c[7]=a*l;c[8]=a*k;return b};
 THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=2*e/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*e/(d-c);f.n23=(d+c)/(d-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+e)/(g-e);f.n34=-2*g*e/(g-e);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,d){var e,a=c*Math.tan(a*Math.PI/360);e=-a;return THREE.Matrix4.makeFrustum(e*b,a*b,e,a,c,d)};
 THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=2*e/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*e/(d-c);f.n23=(d+c)/(d-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+e)/(g-e);f.n34=-2*g*e/(g-e);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,d){var e,a=c*Math.tan(a*Math.PI/360);e=-a;return THREE.Matrix4.makeFrustum(e*b,a*b,e,a,c,d)};
 THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,j,i;f=new THREE.Matrix4;h=b-a;j=c-d;i=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/j;f.n23=0;f.n24=-((c+d)/j);f.n31=0;f.n32=0;f.n33=-2/i;f.n34=-((g+e)/i);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,j,i;f=new THREE.Matrix4;h=b-a;j=c-d;i=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/j;f.n23=0;f.n24=-((c+d)/j);f.n31=0;f.n32=0;f.n33=-2/i;f.n34=-((g+e)/i);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;
 THREE.Object3D=function(){this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;
@@ -55,32 +55,33 @@ this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matri
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),g=Math.cos(c),c=Math.sin(c),f=a*b,h=d*e;this.w=f*g-h*c;this.x=f*c+h*g;this.y=d*b*g+a*e*c;this.z=a*e*g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),g=Math.cos(c),c=Math.sin(c),f=a*b,h=d*e;this.w=f*g-h*c;this.x=f*c+h*g;this.y=d*b*g+a*e*c;this.z=a*e*g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);
 this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},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=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},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=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=
-this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,j=this.w,i=j*c+f*e-h*d,k=j*d+h*c-g*e,l=j*e+g*d-f*c,c=-g*
-c-f*d-h*e;b.x=i*j+c*-g+k*-h-l*-f;b.y=k*j+c*-f+l*-g-i*-h;b.z=l*j+c*-h+i*-f-k*-g;return b}};THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};
+this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,j=this.w,i=j*c+f*e-h*d,l=j*d+h*c-g*e,k=j*e+g*d-f*c,c=-g*
+c-f*d-h*e;b.x=i*j+c*-g+l*-h-k*-f;b.y=l*j+c*-f+k*-g-i*-h;b.z=k*j+c*-h+i*-f-l*-g;return b}};THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};
 THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
-THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
-THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=d||2E3;this.target=e||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;
-THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);b.multiplyScalar(a);this.position.addSelf(b);this.target.position.addSelf(b)};
+THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
+THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=d||2E3;this.target=e||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;
+THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);b.multiplyScalar(a);this.position.addSelf(b);this.target.position.addSelf(b)};
 THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.Camera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};
 THREE.Camera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};
 THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),b=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
 THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),b=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
-!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};THREE.ParticleDOMMaterial=function(a){THREE.Material.call(this);this.domElement=a};THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
+!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};THREE.OrthoCamera=function(a,b,c,d,e,g,f){THREE.Camera.call(this,45,1,e,g,f);this.left=a;this.right=b;this.top=c;this.bottom=d;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
+THREE.OrthoCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.ParticleDOMMaterial=function(a){THREE.Material.call(this);this.domElement=a};THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
 THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
 THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
 THREE.Bone.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;var d,e=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(d=0;d<e;d++)a=this.children[d],a instanceof THREE.Bone?a.update(this.skinMatrix,b,c):a.update(this.matrixWorld,!0,c)}else for(d=0;d<e;d++)this.children[d].update(this.skinMatrix,
 THREE.Bone.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;var d,e=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(d=0;d<e;d++)a=this.children[d],a instanceof THREE.Bone?a.update(this.skinMatrix,b,c):a.update(this.matrixWorld,!0,c)}else for(d=0;d<e;d++)this.children[d].update(this.skinMatrix,
 b,c)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1&&(a.parent!==void 0&&a.parent.removeChild(a),a.parent=this,this.children.push(a),!(a instanceof THREE.Bone)))this.hasNoneBoneChildren=!0};THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.collisions=this.overrideMaterial=this.fog=null;this.objects=[];this.lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;
 b,c)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1&&(a.parent!==void 0&&a.parent.removeChild(a),a.parent=this,this.children.push(a),!(a instanceof THREE.Bone)))this.hasNoneBoneChildren=!0};THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.collisions=this.overrideMaterial=this.fog=null;this.objects=[];this.lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;
 THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1)this.objects.push(a),this.__objectsAdded.push(a);for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
 THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1)this.objects.push(a),this.__objectsAdded.push(a);for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
 THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a)));for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;
 THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a)));for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;
 THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;
 THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;
-THREE.Projector=function(){function a(){var a=j[h]=j[h]||new THREE.RenderableVertex;h++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,f=a.z+a.w,e=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;return f>=0&&e>=0&&g>=0&&h>=0?!0:f<0&&e<0||g<0&&h<0?!1:(f<0?c=Math.max(c,f/(f-e)):e<0&&(d=Math.min(d,f/(f-e))),g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var d,e,g=[],f,h,j=[],i,k,l=[],m,n=[],p,q,t=[],r,J,M=[],G=new THREE.Vector4,v=new THREE.Vector4,
+THREE.Projector=function(){function a(){var a=j[h]=j[h]||new THREE.RenderableVertex;h++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,f=a.z+a.w,e=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;return f>=0&&e>=0&&g>=0&&h>=0?!0:f<0&&e<0||g<0&&h<0?!1:(f<0?c=Math.max(c,f/(f-e)):e<0&&(d=Math.min(d,f/(f-e))),g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var d,e,g=[],f,h,j=[],i,l,k=[],m,n=[],p,q,s=[],r,J,M=[],G=new THREE.Vector4,v=new THREE.Vector4,
 o=new THREE.Matrix4,K=new THREE.Matrix4,z=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],C=new THREE.Vector4,D=new THREE.Vector4;this.projectVector=function(a,b){o.multiply(b.projectionMatrix,b.matrixWorldInverse);o.multiplyVector3(a);return a};this.unprojectVector=function(a,b){o.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));o.multiplyVector3(a);return a};this.projectObjects=function(a,c,f){var c=[],h,i,j;e=0;i=
 o=new THREE.Matrix4,K=new THREE.Matrix4,z=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],C=new THREE.Vector4,D=new THREE.Vector4;this.projectVector=function(a,b){o.multiply(b.projectionMatrix,b.matrixWorldInverse);o.multiplyVector3(a);return a};this.unprojectVector=function(a,b){o.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));o.multiplyVector3(a);return a};this.projectObjects=function(a,c,f){var c=[],h,i,j;e=0;i=
 a.objects;a=0;for(h=i.length;a<h;a++){j=i[a];var k;if(!(k=!j.visible))if(k=j instanceof THREE.Mesh){a:{k=void 0;for(var l=j.matrixWorld,m=-j.geometry.boundingSphere.radius*Math.max(j.scale.x,Math.max(j.scale.y,j.scale.z)),n=0;n<6;n++)if(k=z[n].x*l.n14+z[n].y*l.n24+z[n].z*l.n34+z[n].w,k<=m){k=!1;break a}k=!0}k=!k}if(!k)k=g[e]=g[e]||new THREE.RenderableObject,e++,d=k,G.copy(j.position),o.multiplyVector3(G),d.object=j,d.z=G.z,c.push(d)}f&&c.sort(b);return c};this.projectScene=function(d,e,g){var H=[],
 a.objects;a=0;for(h=i.length;a<h;a++){j=i[a];var k;if(!(k=!j.visible))if(k=j instanceof THREE.Mesh){a:{k=void 0;for(var l=j.matrixWorld,m=-j.geometry.boundingSphere.radius*Math.max(j.scale.x,Math.max(j.scale.y,j.scale.z)),n=0;n<6;n++)if(k=z[n].x*l.n14+z[n].y*l.n24+z[n].z*l.n34+z[n].w,k<=m){k=!1;break a}k=!0}k=!k}if(!k)k=g[e]=g[e]||new THREE.RenderableObject,e++,d=k,G.copy(j.position),o.multiplyVector3(G),d.object=j,d.z=G.z,c.push(d)}f&&c.sort(b);return c};this.projectScene=function(d,e,g){var H=[],
-G=e.near,O=e.far,E,I,x,B,s,y,w,A,F,u,L,U,W,X,N,V,P;J=q=m=k=0;e.matrixAutoUpdate&&e.update(void 0,!0);d.update(void 0,!1,e);o.multiply(e.projectionMatrix,e.matrixWorldInverse);z[0].set(o.n41-o.n11,o.n42-o.n12,o.n43-o.n13,o.n44-o.n14);z[1].set(o.n41+o.n11,o.n42+o.n12,o.n43+o.n13,o.n44+o.n14);z[2].set(o.n41+o.n21,o.n42+o.n22,o.n43+o.n23,o.n44+o.n24);z[3].set(o.n41-o.n21,o.n42-o.n22,o.n43-o.n23,o.n44-o.n24);z[4].set(o.n41-o.n31,o.n42-o.n32,o.n43-o.n33,o.n44-o.n34);z[5].set(o.n41+o.n31,o.n42+o.n32,o.n43+
+G=e.near,O=e.far,E,I,x,B,t,y,w,A,F,u,L,U,W,X,N,V,P;J=q=m=l=0;e.matrixAutoUpdate&&e.update(void 0,!0);d.update(void 0,!1,e);o.multiply(e.projectionMatrix,e.matrixWorldInverse);z[0].set(o.n41-o.n11,o.n42-o.n12,o.n43-o.n13,o.n44-o.n14);z[1].set(o.n41+o.n11,o.n42+o.n12,o.n43+o.n13,o.n44+o.n14);z[2].set(o.n41+o.n21,o.n42+o.n22,o.n43+o.n23,o.n44+o.n24);z[3].set(o.n41-o.n21,o.n42-o.n22,o.n43-o.n23,o.n44-o.n24);z[4].set(o.n41-o.n31,o.n42-o.n32,o.n43-o.n33,o.n44-o.n34);z[5].set(o.n41+o.n31,o.n42+o.n32,o.n43+
 o.n33,o.n44+o.n34);for(E=0;E<6;E++)F=z[E],F.divideScalar(Math.sqrt(F.x*F.x+F.y*F.y+F.z*F.z));F=this.projectObjects(d,e,!0);d=0;for(E=F.length;d<E;d++)if(u=F[d].object,u.visible)if(L=u.matrixWorld,U=u.matrixRotationWorld,W=u.materials,X=u.overdraw,h=0,u instanceof THREE.Mesh){N=u.geometry;B=N.vertices;V=N.faces;N=N.faceVertexUvs;I=0;for(x=B.length;I<x;I++)f=a(),f.positionWorld.copy(B[I].position),L.multiplyVector3(f.positionWorld),f.positionScreen.copy(f.positionWorld),o.multiplyVector4(f.positionScreen),
 o.n33,o.n44+o.n34);for(E=0;E<6;E++)F=z[E],F.divideScalar(Math.sqrt(F.x*F.x+F.y*F.y+F.z*F.z));F=this.projectObjects(d,e,!0);d=0;for(E=F.length;d<E;d++)if(u=F[d].object,u.visible)if(L=u.matrixWorld,U=u.matrixRotationWorld,W=u.materials,X=u.overdraw,h=0,u instanceof THREE.Mesh){N=u.geometry;B=N.vertices;V=N.faces;N=N.faceVertexUvs;I=0;for(x=B.length;I<x;I++)f=a(),f.positionWorld.copy(B[I].position),L.multiplyVector3(f.positionWorld),f.positionScreen.copy(f.positionWorld),o.multiplyVector4(f.positionScreen),
-f.positionScreen.x/=f.positionScreen.w,f.positionScreen.y/=f.positionScreen.w,f.visible=f.positionScreen.z>G&&f.positionScreen.z<O;B=0;for(I=V.length;B<I;B++){x=V[B];if(x instanceof THREE.Face3)if(s=j[x.a],y=j[x.b],w=j[x.c],s.visible&&y.visible&&w.visible&&(u.doubleSided||u.flipSided!=(w.positionScreen.x-s.positionScreen.x)*(y.positionScreen.y-s.positionScreen.y)-(w.positionScreen.y-s.positionScreen.y)*(y.positionScreen.x-s.positionScreen.x)<0))A=l[k]=l[k]||new THREE.RenderableFace3,k++,i=A,i.v1.copy(s),
-i.v2.copy(y),i.v3.copy(w);else continue;else if(x instanceof THREE.Face4)if(s=j[x.a],y=j[x.b],w=j[x.c],A=j[x.d],s.visible&&y.visible&&w.visible&&A.visible&&(u.doubleSided||u.flipSided!=((A.positionScreen.x-s.positionScreen.x)*(y.positionScreen.y-s.positionScreen.y)-(A.positionScreen.y-s.positionScreen.y)*(y.positionScreen.x-s.positionScreen.x)<0||(y.positionScreen.x-w.positionScreen.x)*(A.positionScreen.y-w.positionScreen.y)-(y.positionScreen.y-w.positionScreen.y)*(A.positionScreen.x-w.positionScreen.x)<
-0)))P=n[m]=n[m]||new THREE.RenderableFace4,m++,i=P,i.v1.copy(s),i.v2.copy(y),i.v3.copy(w),i.v4.copy(A);else continue;i.normalWorld.copy(x.normal);U.multiplyVector3(i.normalWorld);i.centroidWorld.copy(x.centroid);L.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);o.multiplyVector3(i.centroidScreen);w=x.vertexNormals;s=0;for(y=w.length;s<y;s++)A=i.vertexNormalsWorld[s],A.copy(w[s]),U.multiplyVector3(A);s=0;for(y=N.length;s<y;s++)if(P=N[s][B]){w=0;for(A=P.length;w<A;w++)i.uvs[s][w]=
-P[w]}i.meshMaterials=W;i.faceMaterials=x.materials;i.overdraw=X;i.z=i.centroidScreen.z;H.push(i)}}else if(u instanceof THREE.Line){K.multiply(o,L);B=u.geometry.vertices;s=a();s.positionScreen.copy(B[0].position);K.multiplyVector4(s.positionScreen);I=1;for(x=B.length;I<x;I++)if(s=a(),s.positionScreen.copy(B[I].position),K.multiplyVector4(s.positionScreen),y=j[h-2],C.copy(s.positionScreen),D.copy(y.positionScreen),c(C,D))C.multiplyScalar(1/C.w),D.multiplyScalar(1/D.w),L=t[q]=t[q]||new THREE.RenderableLine,
+f.positionScreen.x/=f.positionScreen.w,f.positionScreen.y/=f.positionScreen.w,f.visible=f.positionScreen.z>G&&f.positionScreen.z<O;B=0;for(I=V.length;B<I;B++){x=V[B];if(x instanceof THREE.Face3)if(t=j[x.a],y=j[x.b],w=j[x.c],t.visible&&y.visible&&w.visible&&(u.doubleSided||u.flipSided!=(w.positionScreen.x-t.positionScreen.x)*(y.positionScreen.y-t.positionScreen.y)-(w.positionScreen.y-t.positionScreen.y)*(y.positionScreen.x-t.positionScreen.x)<0))A=k[l]=k[l]||new THREE.RenderableFace3,l++,i=A,i.v1.copy(t),
+i.v2.copy(y),i.v3.copy(w);else continue;else if(x instanceof THREE.Face4)if(t=j[x.a],y=j[x.b],w=j[x.c],A=j[x.d],t.visible&&y.visible&&w.visible&&A.visible&&(u.doubleSided||u.flipSided!=((A.positionScreen.x-t.positionScreen.x)*(y.positionScreen.y-t.positionScreen.y)-(A.positionScreen.y-t.positionScreen.y)*(y.positionScreen.x-t.positionScreen.x)<0||(y.positionScreen.x-w.positionScreen.x)*(A.positionScreen.y-w.positionScreen.y)-(y.positionScreen.y-w.positionScreen.y)*(A.positionScreen.x-w.positionScreen.x)<
+0)))P=n[m]=n[m]||new THREE.RenderableFace4,m++,i=P,i.v1.copy(t),i.v2.copy(y),i.v3.copy(w),i.v4.copy(A);else continue;i.normalWorld.copy(x.normal);U.multiplyVector3(i.normalWorld);i.centroidWorld.copy(x.centroid);L.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);o.multiplyVector3(i.centroidScreen);w=x.vertexNormals;t=0;for(y=w.length;t<y;t++)A=i.vertexNormalsWorld[t],A.copy(w[t]),U.multiplyVector3(A);t=0;for(y=N.length;t<y;t++)if(P=N[t][B]){w=0;for(A=P.length;w<A;w++)i.uvs[t][w]=
+P[w]}i.meshMaterials=W;i.faceMaterials=x.materials;i.overdraw=X;i.z=i.centroidScreen.z;H.push(i)}}else if(u instanceof THREE.Line){K.multiply(o,L);B=u.geometry.vertices;t=a();t.positionScreen.copy(B[0].position);K.multiplyVector4(t.positionScreen);I=1;for(x=B.length;I<x;I++)if(t=a(),t.positionScreen.copy(B[I].position),K.multiplyVector4(t.positionScreen),y=j[h-2],C.copy(t.positionScreen),D.copy(y.positionScreen),c(C,D))C.multiplyScalar(1/C.w),D.multiplyScalar(1/D.w),L=s[q]=s[q]||new THREE.RenderableLine,
 q++,p=L,p.v1.positionScreen.copy(C),p.v2.positionScreen.copy(D),p.z=Math.max(C.z,D.z),p.materials=u.materials,H.push(p)}else if(u instanceof THREE.Particle&&(v.set(u.matrixWorld.n14,u.matrixWorld.n24,u.matrixWorld.n34,1),o.multiplyVector4(v),v.z/=v.w,v.z>0&&v.z<1))L=M[J]=M[J]||new THREE.RenderableParticle,J++,r=L,r.x=v.x/v.w,r.y=v.y/v.w,r.z=v.z,r.rotation=u.rotation.z,r.scale.x=u.scale.x*Math.abs(r.x-(v.x+e.projectionMatrix.n11)/(v.w+e.projectionMatrix.n14)),r.scale.y=u.scale.y*Math.abs(r.y-(v.y+
 q++,p=L,p.v1.positionScreen.copy(C),p.v2.positionScreen.copy(D),p.z=Math.max(C.z,D.z),p.materials=u.materials,H.push(p)}else if(u instanceof THREE.Particle&&(v.set(u.matrixWorld.n14,u.matrixWorld.n24,u.matrixWorld.n34,1),o.multiplyVector4(v),v.z/=v.w,v.z>0&&v.z<1))L=M[J]=M[J]||new THREE.RenderableParticle,J++,r=L,r.x=v.x/v.w,r.y=v.y/v.w,r.z=v.z,r.rotation=u.rotation.z,r.scale.x=u.scale.x*Math.abs(r.x-(v.x+e.projectionMatrix.n11)/(v.w+e.projectionMatrix.n14)),r.scale.y=u.scale.y*Math.abs(r.y-(v.y+
 e.projectionMatrix.n22)/(v.w+e.projectionMatrix.n24)),r.materials=u.materials,H.push(r);g&&H.sort(b);return H}};
 e.projectionMatrix.n22)/(v.w+e.projectionMatrix.n24)),r.materials=u.materials,H.push(r);g&&H.sort(b);return H}};
-THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,b=new THREE.Projector,c,d,e,g;this.domElement=document.createElement("div");this.setSize=function(a,b){c=a;d=b;e=c/2;g=d/2};this.render=function(c,d){var j,i,k,l,m,n,p,q;a=b.projectScene(c,d);j=0;for(i=a.length;j<i;j++)if(m=a[j],m instanceof THREE.RenderableParticle){p=m.x*e+e;q=m.y*g+g;k=0;for(l=m.material.length;k<l;k++)if(n=m.material[k],n instanceof THREE.ParticleDOMMaterial)n=n.domElement,n.style.left=p+"px",n.style.top=q+"px"}}};
+THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,b=new THREE.Projector,c,d,e,g;this.domElement=document.createElement("div");this.setSize=function(a,b){c=a;d=b;e=c/2;g=d/2};this.render=function(c,d){var j,i,l,k,m,n,p,q;a=b.projectScene(c,d);j=0;for(i=a.length;j<i;j++)if(m=a[j],m instanceof THREE.RenderableParticle){p=m.x*e+e;q=m.y*g+g;l=0;for(k=m.material.length;l<k;l++)if(n=m.material[l],n instanceof THREE.ParticleDOMMaterial)n=n.domElement,n.style.left=p+"px",n.style.top=q+"px"}}};
 THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};
 THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};

+ 7 - 4
build/custom/ThreeExtras.js

@@ -1,4 +1,4 @@
-// ThreeExtras.js r43 - http://github.com/mrdoob/three.js
+// ThreeExtras.js r44dev - http://github.com/mrdoob/three.js
 THREE.ColorUtils={adjustHSV:function(a,b,c,e){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.ColorUtils.clamp(f.h+b,0,1);f.s=THREE.ColorUtils.clamp(f.s+c,0,1);f.v=THREE.ColorUtils.clamp(f.v+e,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,b){var c=a.r,e=a.g,f=a.b,h=Math.max(Math.max(c,e),f),g=Math.min(Math.min(c,e),f);if(g==h)g=c=0;else{var j=h-g,g=j/h,c=c==h?(e-f)/j:e==h?2+(f-c)/j:4+(c-e)/j;c/=6;c<0&&(c+=1);c>1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=g;b.v=h;return b},
 THREE.ColorUtils={adjustHSV:function(a,b,c,e){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.ColorUtils.clamp(f.h+b,0,1);f.s=THREE.ColorUtils.clamp(f.s+c,0,1);f.v=THREE.ColorUtils.clamp(f.v+e,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,b){var c=a.r,e=a.g,f=a.b,h=Math.max(Math.max(c,e),f),g=Math.min(Math.min(c,e),f);if(g==h)g=c=0;else{var j=h-g,g=j/h,c=c==h?(e-f)/j:e==h?2+(f-c)/j:4+(c-e)/j;c/=6;c<0&&(c+=1);c>1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=g;b.v=h;return b},
 clamp:function(a,b,c){return a<b?b:a>c?c:a}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
 clamp:function(a,b,c){return a<b?b:a>c?c:a}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
 THREE.GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,e=a.vertices.length,f=c?b.geometry:b,h=a.vertices,g=f.vertices,j=a.faces,k=f.faces,l=a.faceVertexUvs[0],f=f.faceVertexUvs[0];c&&b.matrixAutoUpdate&&b.updateMatrix();for(var m=0,n=g.length;m<n;m++){var o=new THREE.Vertex(g[m].position.clone());c&&b.matrix.multiplyVector3(o.position);h.push(o)}m=0;for(n=k.length;m<n;m++){var g=k[m],p,v,t=g.vertexNormals,o=g.vertexColors;g instanceof THREE.Face3?p=new THREE.Face3(g.a+e,g.b+e,g.c+
 THREE.GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,e=a.vertices.length,f=c?b.geometry:b,h=a.vertices,g=f.vertices,j=a.faces,k=f.faces,l=a.faceVertexUvs[0],f=f.faceVertexUvs[0];c&&b.matrixAutoUpdate&&b.updateMatrix();for(var m=0,n=g.length;m<n;m++){var o=new THREE.Vertex(g[m].position.clone());c&&b.matrix.multiplyVector3(o.position);h.push(o)}m=0;for(n=k.length;m<n;m++){var g=k[m],p,v,t=g.vertexNormals,o=g.vertexColors;g instanceof THREE.Face3?p=new THREE.Face3(g.a+e,g.b+e,g.c+
@@ -22,6 +22,9 @@ THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:"attribute vec4 tang
 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",
 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}"},
 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}"},
 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}"},
+sepia:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},amount:{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:"uniform float amount;\nvarying vec2 vUv;\nuniform sampler2D tDiffuse;\nvoid main() {\nvec4 color = texture2D( tDiffuse, vUv );\nvec3 c = color.rgb;\ncolor.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );\ncolor.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );\ncolor.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );\ngl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );\n}"},
+dotscreen:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},tSize:{type:"v2",value:new THREE.Vector2(256,256)},center:{type:"v2",value:new THREE.Vector2(0.5,0.5)},angle:{type:"f",value:1.57},scale:{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:"uniform vec2 center;\nuniform float angle;\nuniform float scale;\nuniform vec2 tSize;\nvarying vec2 vUv;\nuniform sampler2D tDiffuse;\nfloat pattern() {\nfloat s = sin( angle ), c = cos( angle );\nvec2 tex = vUv * tSize - center;\nvec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;\nreturn ( sin( point.x ) * sin( point.y ) ) * 4.0;\n}\nvoid main() {\nvec4 color = texture2D( tDiffuse, vUv );\nfloat average = ( color.r + color.g + color.b ) / 3.0;\ngl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );\n}"},
+vignette:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},offset:{type:"f",value:1},darkness:{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:"uniform float offset;\nuniform float darkness;\nvarying vec2 vUv;\nuniform sampler2D tDiffuse;\nvoid main() {\nvec4 texel = texture2D( tDiffuse, vUv );\nvec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );\ngl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.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}",
 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 b,c,e,f,h=2*Math.ceil(a*3)+1;h>25&&(h=25);f=(h-1)*0.5;c=Array(h);for(b=e=0;b<h;++b)c[b]=Math.exp(-((b-f)*(b-f))/(2*a*a)),e+=c[b];for(b=0;b<h;++b)c[b]/=e;return c}};
 fragmentShader:"void main() {\ngl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );\n}"}},buildKernel:function(a){var b,c,e,f,h=2*Math.ceil(a*3)+1;h>25&&(h=25);f=(h-1)*0.5;c=Array(h);for(b=e=0;b<h;++b)c[b]=Math.exp(-((b-f)*(b-f))/(2*a*a)),e+=c[b];for(b=0;b<h;++b)c[b]/=e;return c}};
 THREE.AnimationHandler=function(){var a=[],b={},c={update:function(c){for(var b=0;b<a.length;b++)a[b].update(c)},addToUpdate:function(c){a.indexOf(c)===-1&&a.push(c)},removeFromUpdate:function(c){c=a.indexOf(c);c!==-1&&a.splice(c,1)},add:function(a){b[a.name]!==void 0&&console.log("THREE.AnimationHandler.add: Warning! "+a.name+" already exists in library. Overwriting.");b[a.name]=a;if(a.initialized!==!0){for(var c=0;c<a.hierarchy.length;c++){for(var e=0;e<a.hierarchy[c].keys.length;e++){if(a.hierarchy[c].keys[e].time<
 THREE.AnimationHandler=function(){var a=[],b={},c={update:function(c){for(var b=0;b<a.length;b++)a[b].update(c)},addToUpdate:function(c){a.indexOf(c)===-1&&a.push(c)},removeFromUpdate:function(c){c=a.indexOf(c);c!==-1&&a.splice(c,1)},add:function(a){b[a.name]!==void 0&&console.log("THREE.AnimationHandler.add: Warning! "+a.name+" already exists in library. Overwriting.");b[a.name]=a;if(a.initialized!==!0){for(var c=0;c<a.hierarchy.length;c++){for(var e=0;e<a.hierarchy[c].keys.length;e++){if(a.hierarchy[c].keys[e].time<
@@ -170,9 +173,9 @@ o,p,v,t),g=h[h.length-1]){m=g.x;n=g.y;g=1;for(divisions=this.divisions;g<=divisi
 (function(a){var b=function(a){for(var b=a.length,f=0,h=b-1,g=0;g<b;h=g++)f+=a[h].x*a[g].y-a[g].x*a[h].y;return f*0.5};a.Triangulate=function(a,e){var f=a.length;if(f<3)return null;var h=[],g=[],j=[],k,l,m;if(b(a)>0)for(l=0;l<f;l++)g[l]=l;else for(l=0;l<f;l++)g[l]=f-1-l;var n=2*f;for(l=f-1;f>2;){if(n--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return j;return h}k=l;f<=k&&(k=0);l=k+1;f<=l&&(l=0);m=l+1;f<=m&&(m=0);var o;a:{o=a;var p=k,v=l,t=m,w=f,y=g,x=void 0,u=void 0,A=void 0,
 (function(a){var b=function(a){for(var b=a.length,f=0,h=b-1,g=0;g<b;h=g++)f+=a[h].x*a[g].y-a[g].x*a[h].y;return f*0.5};a.Triangulate=function(a,e){var f=a.length;if(f<3)return null;var h=[],g=[],j=[],k,l,m;if(b(a)>0)for(l=0;l<f;l++)g[l]=l;else for(l=0;l<f;l++)g[l]=f-1-l;var n=2*f;for(l=f-1;f>2;){if(n--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return j;return h}k=l;f<=k&&(k=0);l=k+1;f<=l&&(l=0);m=l+1;f<=m&&(m=0);var o;a:{o=a;var p=k,v=l,t=m,w=f,y=g,x=void 0,u=void 0,A=void 0,
 B=void 0,F=void 0,E=void 0,H=void 0,G=void 0,M=void 0,u=o[y[p]].x,A=o[y[p]].y,B=o[y[v]].x,F=o[y[v]].y,E=o[y[t]].x,H=o[y[t]].y;if(1.0E-10>(B-u)*(H-A)-(F-A)*(E-u))o=!1;else{for(x=0;x<w;x++)if(!(x==p||x==v||x==t)){var G=o[y[x]].x,M=o[y[x]].y,z=void 0,C=void 0,I=void 0,K=void 0,L=void 0,J=void 0,N=void 0,D=void 0,R=void 0,O=void 0,S=void 0,U=void 0,z=I=L=void 0,z=E-B,C=H-F,I=u-E,K=A-H,L=B-u,J=F-A,N=G-u,D=M-A,R=G-B,O=M-F,S=G-E,U=M-H,z=z*O-C*R,L=L*D-J*N,I=I*U-K*S;if(z>=0&&I>=0&&L>=0){o=!1;break a}}o=!0}}if(o){h.push([a[g[k]],
 B=void 0,F=void 0,E=void 0,H=void 0,G=void 0,M=void 0,u=o[y[p]].x,A=o[y[p]].y,B=o[y[v]].x,F=o[y[v]].y,E=o[y[t]].x,H=o[y[t]].y;if(1.0E-10>(B-u)*(H-A)-(F-A)*(E-u))o=!1;else{for(x=0;x<w;x++)if(!(x==p||x==v||x==t)){var G=o[y[x]].x,M=o[y[x]].y,z=void 0,C=void 0,I=void 0,K=void 0,L=void 0,J=void 0,N=void 0,D=void 0,R=void 0,O=void 0,S=void 0,U=void 0,z=I=L=void 0,z=E-B,C=H-F,I=u-E,K=A-H,L=B-u,J=F-A,N=G-u,D=M-A,R=G-B,O=M-F,S=G-E,U=M-H,z=z*O-C*R,L=L*D-J*N,I=I*U-K*S;if(z>=0&&I>=0&&L>=0){o=!1;break a}}o=!0}}if(o){h.push([a[g[k]],
 a[g[l]],a[g[m]]]);j.push([g[k],g[l],g[m]]);k=l;for(m=l+1;m<f;k++,m++)g[k]=g[m];f--;n=2*f}}if(e)return j;return h};a.Triangulate.area=b;return a})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 a[g[l]],a[g[m]]]);j.push([g[k],g[l],g[m]]);k=l;for(m=l+1;m<f;k++,m++)g[k]=g[m];f--;n=2*f}}if(e)return j;return h};a.Triangulate.area=b;return a})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
-THREE.TorusGeometry=function(a,b,c,e,f){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=e||6;this.arc=f||2*Math.PI;a=[];for(b=0;b<=this.segmentsR;++b)for(c=0;c<=this.segmentsT;++c)e=c/this.segmentsT*this.arc,f=b/this.segmentsR*2*Math.PI,this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(f))*Math.cos(e),(this.radius+this.tube*Math.cos(f))*Math.sin(e),this.tube*Math.sin(f)))),a.push([c/this.segmentsT,1-b/this.segmentsR]);
-for(b=1;b<=this.segmentsR;++b)for(c=1;c<=this.segmentsT;++c){var e=(this.segmentsT+1)*b+c,f=(this.segmentsT+1)*b+c-1,h=(this.segmentsT+1)*(b-1)+c-1,g=(this.segmentsT+1)*(b-1)+c;this.faces.push(new THREE.Face4(e,f,h,g));this.faceVertexUvs[0].push([new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[h][0],a[h][1]),new THREE.UV(a[g][0],a[g][1])])}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusGeometry.prototype=new THREE.Geometry;
-THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
+THREE.TorusGeometry=function(a,b,c,e,f){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=e||6;this.arc=f||Math.PI*2;f=new THREE.Vector3;a=[];b=[];for(c=0;c<=this.segmentsR;c++)for(e=0;e<=this.segmentsT;e++){var h=e/this.segmentsT*this.arc,g=c/this.segmentsR*Math.PI*2;f.x=this.radius*Math.cos(h);f.y=this.radius*Math.sin(h);var j=new THREE.Vector3;j.x=(this.radius+this.tube*Math.cos(g))*Math.cos(h);j.y=(this.radius+this.tube*Math.cos(g))*Math.sin(h);j.z=
+this.tube*Math.sin(g);this.vertices.push(new THREE.Vertex(j));a.push(new THREE.UV(e/this.segmentsT,1-c/this.segmentsR));b.push(j.clone().subSelf(f).normalize())}for(c=1;c<=this.segmentsR;c++)for(e=1;e<=this.segmentsT;e++){var f=(this.segmentsT+1)*c+e-1,h=(this.segmentsT+1)*(c-1)+e-1,g=(this.segmentsT+1)*(c-1)+e,j=(this.segmentsT+1)*c+e,k=new THREE.Face4(f,h,g,j,[b[f],b[h],b[g],b[j]]);k.normal.addSelf(b[f]);k.normal.addSelf(b[h]);k.normal.addSelf(b[g]);k.normal.addSelf(b[j]);k.normal.normalize();this.faces.push(k);
+this.faceVertexUvs[0].push([a[f].clone(),a[h].clone(),a[g].clone(),a[j].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
 THREE.TorusKnotGeometry=function(a,b,c,e,f,h,g){function j(a,b,c,e,g,h){b=c/e*a;c=Math.cos(b);return new THREE.Vector3(g*(2+c)*0.5*Math.cos(a),g*(2+c)*Math.sin(a)*0.5,h*g*Math.sin(b)*0.5)}THREE.Geometry.call(this);this.radius=a||200;this.tube=b||40;this.segmentsR=c||64;this.segmentsT=e||8;this.p=f||2;this.q=h||3;this.heightScale=g||1;this.grid=Array(this.segmentsR);c=new THREE.Vector3;e=new THREE.Vector3;h=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=Array(this.segmentsT);for(b=0;b<
 THREE.TorusKnotGeometry=function(a,b,c,e,f,h,g){function j(a,b,c,e,g,h){b=c/e*a;c=Math.cos(b);return new THREE.Vector3(g*(2+c)*0.5*Math.cos(a),g*(2+c)*Math.sin(a)*0.5,h*g*Math.sin(b)*0.5)}THREE.Geometry.call(this);this.radius=a||200;this.tube=b||40;this.segmentsR=c||64;this.segmentsT=e||8;this.p=f||2;this.q=h||3;this.heightScale=g||1;this.grid=Array(this.segmentsR);c=new THREE.Vector3;e=new THREE.Vector3;h=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=Array(this.segmentsT);for(b=0;b<
 this.segmentsT;++b){var k=a/this.segmentsR*2*this.p*Math.PI,g=b/this.segmentsT*2*Math.PI,f=j(k,g,this.q,this.p,this.radius,this.heightScale),k=j(k+0.01,g,this.q,this.p,this.radius,this.heightScale);c.x=k.x-f.x;c.y=k.y-f.y;c.z=k.z-f.z;e.x=k.x+f.x;e.y=k.y+f.y;e.z=k.z+f.z;h.cross(c,e);e.cross(h,c);h.normalize();e.normalize();k=-this.tube*Math.cos(g);g=this.tube*Math.sin(g);f.x+=k*e.x+g*h.x;f.y+=k*e.y+g*h.y;f.z+=k*e.z+g*h.z;this.grid[a][b]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(f.x,f.y,
 this.segmentsT;++b){var k=a/this.segmentsR*2*this.p*Math.PI,g=b/this.segmentsT*2*Math.PI,f=j(k,g,this.q,this.p,this.radius,this.heightScale),k=j(k+0.01,g,this.q,this.p,this.radius,this.heightScale);c.x=k.x-f.x;c.y=k.y-f.y;c.z=k.z-f.z;e.x=k.x+f.x;e.y=k.y+f.y;e.z=k.z+f.z;h.cross(c,e);e.cross(h,c);h.normalize();e.normalize();k=-this.tube*Math.cos(g);g=this.tube*Math.sin(g);f.x+=k*e.x+g*h.x;f.y+=k*e.y+g*h.y;f.z+=k*e.z+g*h.z;this.grid[a][b]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(f.x,f.y,
 f.z)))-1}}for(a=0;a<this.segmentsR;++a)for(b=0;b<this.segmentsT;++b){var e=(a+1)%this.segmentsR,h=(b+1)%this.segmentsT,f=this.grid[a][b],c=this.grid[e][b],e=this.grid[e][h],h=this.grid[a][h],g=new THREE.UV(a/this.segmentsR,b/this.segmentsT),k=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT),l=new THREE.UV((a+1)/this.segmentsR,(b+1)/this.segmentsT),m=new THREE.UV(a/this.segmentsR,(b+1)/this.segmentsT);this.faces.push(new THREE.Face4(f,c,e,h));this.faceVertexUvs[0].push([g,k,l,m])}this.computeCentroids();
 f.z)))-1}}for(a=0;a<this.segmentsR;++a)for(b=0;b<this.segmentsT;++b){var e=(a+1)%this.segmentsR,h=(b+1)%this.segmentsT,f=this.grid[a][b],c=this.grid[e][b],e=this.grid[e][h],h=this.grid[a][h],g=new THREE.UV(a/this.segmentsR,b/this.segmentsT),k=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT),l=new THREE.UV((a+1)/this.segmentsR,(b+1)/this.segmentsT),m=new THREE.UV(a/this.segmentsR,(b+1)/this.segmentsT);this.faces.push(new THREE.Face4(f,c,e,h));this.faceVertexUvs[0].push([g,k,l,m])}this.computeCentroids();

+ 54 - 52
build/custom/ThreeSVG.js

@@ -1,51 +1,51 @@
-// ThreeSVG.js r43 - http://github.com/mrdoob/three.js
+// ThreeSVG.js r44dev - http://github.com/mrdoob/three.js
 var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this};
 var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this};
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,g;if(c==0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),e=a*6-d,a=c*(1-b),g=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,g;if(c==0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),e=a*6-d,a=c*(1-b),g=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=
 c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=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},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
 c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=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},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
-THREE.Vector2=function(a,b){this.set(a||0,b||0)};
+THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},
 divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},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.lengthSq())},normalize:function(){return this.divideScalar(this.length())},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},setLength:function(a){return this.normalize().multiplyScalar(a)},
 divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},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.lengthSq())},normalize:function(){return this.divideScalar(this.length())},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},setLength:function(a){return this.normalize().multiplyScalar(a)},
-unit:function(){return this.normalize()},equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)};
+equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0};
 THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){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},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=
 THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){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},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=
-a.z-b.z;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){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},divideSelf:function(a){return this.divide(this,a)},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},
+a.z-b.z;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){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},divideSelf:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},
 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.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){return this.set(this.y*
 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.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){return this.set(this.y*
 a.z-this.z*a.y,this.z*a.x-this.x*a.z,this.x*a.y-this.y*a.x)},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this,a).lengthSq()},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},isZero:function(){return this.lengthSq()<
 a.z-this.z*a.y,this.z*a.x-this.x*a.z,this.x*a.y-this.y*a.x)},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this,a).lengthSq()},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},isZero:function(){return this.lengthSq()<
-1.0E-4}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)};
-THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){return this.set(a.x,a.y,a.z,a.w||1)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add: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},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub: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},
-subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a,this.w/=a):this.set(0,0,0,1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},
-setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf: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}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
-THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d=[];b=0;for(c=a.length;b<c;b++)d=d.concat(this.intersectObject(a[b]));d.sort(function(a,b){return a.distance-b.distance});return d},intersectObject:function(a){function b(a,b,c){var d,c=c.matrixWorld.getPosition();d=c.clone().subSelf(a).dot(b);a=a.clone().addSelf(b.clone().multiplyScalar(d));return c.distanceTo(a)}function c(a,b,c,d){var d=d.clone().subSelf(b),
-c=c.clone().subSelf(b),e=a.clone().subSelf(b),a=d.dot(d),b=d.dot(c),d=d.dot(e),f=c.dot(c),c=c.dot(e),e=1/(a*f-b*b),f=(f*d-b*c)*e,a=(a*c-b*d)*e;return f>0&&a>0&&f+a<1}if(a instanceof THREE.Particle){var d=b(this.origin,this.direction,a);if(!d||d>a.scale.x)return[];return[{distance:d,point:a.position,face:null,object:a}]}else if(a instanceof THREE.Mesh){d=b(this.origin,this.direction,a);if(!d||d>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return[];var e,g,f,h,
-l,i,k,j,n,m,p=a.geometry,q=p.vertices,w=[],d=0;for(e=p.faces.length;d<e;d++)if(g=p.faces[d],n=this.origin.clone(),m=this.direction.clone(),i=a.matrixWorld,f=i.multiplyVector3(q[g.a].position.clone()),h=i.multiplyVector3(q[g.b].position.clone()),l=i.multiplyVector3(q[g.c].position.clone()),i=g instanceof THREE.Face4?i.multiplyVector3(q[g.d].position.clone()):null,k=a.matrixRotationWorld.multiplyVector3(g.normal.clone()),j=m.dot(k),a.doubleSided||(a.flipSided?j>0:j<0))if(k=k.dot((new THREE.Vector3).sub(f,
-n))/j,n=n.addSelf(m.multiplyScalar(k)),g instanceof THREE.Face3)c(n,f,h,l)&&(g={distance:this.origin.distanceTo(n),point:n,face:g,object:a},w.push(g));else if(g instanceof THREE.Face4&&(c(n,f,h,i)||c(n,h,l,i)))g={distance:this.origin.distanceTo(n),point:n,face:g,object:a},w.push(g);return w}else return[]}};
-THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return f};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(f,g,k,j){h=!1;b=f;c=g;d=k;e=j;a()};this.addPoint=function(f,g){h?(h=!1,b=f,c=g,d=f,e=g):(b=b<f?b:f,c=c<g?c:g,d=d>f?d:f,e=e>g?e:g);a()};this.add3Points=
-function(f,g,k,j,n,m){h?(h=!1,b=f<k?f<n?f:n:k<n?k:n,c=g<j?g<m?g:m:j<m?j:m,d=f>k?f>n?f:n:k>n?k:n,e=g>j?g>m?g:m:j>m?j:m):(b=f<k?f<n?f<b?f:b:n<b?n:b:k<n?k<b?k:b:n<b?n:b,c=g<j?g<m?g<c?g:c:m<c?m:c:j<m?j<c?j:c:m<c?m:c,d=f>k?f>n?f>d?f:d:n>d?n:d:k>n?k>d?k:d:n>d?n:d,e=g>j?g>m?g>e?g:e:m>e?m:e:j>m?j>e?j:e:m>e?m:e);a()};this.addRectangle=function(f){h?(h=!1,b=f.getLeft(),c=f.getTop(),d=f.getRight(),e=f.getBottom()):(b=b<f.getLeft()?b:f.getLeft(),c=c<f.getTop()?c:f.getTop(),d=d>f.getRight()?d:f.getRight(),e=e>
+1.0E-4}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d||1};
+THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add: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},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub: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},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a,this.w/=a):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
+normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf: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}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
+THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d=[];b=0;for(c=a.length;b<c;b++)d=d.concat(this.intersectObject(a[b]));d.sort(function(a,b){return a.distance-b.distance});return d},intersectObject:function(a){function b(a,b,c){var d;d=c.clone().subSelf(a).dot(b);if(d<=0)return null;a=a.clone().addSelf(b.clone().multiplyScalar(d));return c.distanceTo(a)}function c(a,b,c,d){var d=d.clone().subSelf(b),
+c=c.clone().subSelf(b),e=a.clone().subSelf(b),a=d.dot(d),b=d.dot(c),d=d.dot(e),f=c.dot(c),c=c.dot(e),e=1/(a*f-b*b),f=(f*d-b*c)*e,a=(a*c-b*d)*e;return f>0&&a>0&&f+a<1}if(a instanceof THREE.Particle){var d=b(this.origin,this.direction,a.matrixWorld.getPosition());if(d==null||d>a.scale.x)return[];return[{distance:d,point:a.position,face:null,object:a}]}else if(a instanceof THREE.Mesh){d=b(this.origin,this.direction,a.matrixWorld.getPosition());if(d==null||d>a.geometry.boundingSphere.radius*Math.max(a.scale.x,
+Math.max(a.scale.y,a.scale.z)))return[];var e,g,f,h,k,i,l,j,n,m,p=a.geometry,q=p.vertices,w=[],d=0;for(e=p.faces.length;d<e;d++)if(g=p.faces[d],n=this.origin.clone(),m=this.direction.clone(),i=a.matrixWorld,f=i.multiplyVector3(g.centroid.clone()).subSelf(n),j=f.dot(m),!(j<=0)&&(f=i.multiplyVector3(q[g.a].position.clone()),h=i.multiplyVector3(q[g.b].position.clone()),k=i.multiplyVector3(q[g.c].position.clone()),i=g instanceof THREE.Face4?i.multiplyVector3(q[g.d].position.clone()):null,l=a.matrixRotationWorld.multiplyVector3(g.normal.clone()),
+j=m.dot(l),a.doubleSided||(a.flipSided?j>0:j<0)))if(j=l.dot((new THREE.Vector3).sub(f,n))/j,n=n.addSelf(m.multiplyScalar(j)),g instanceof THREE.Face3)c(n,f,h,k)&&(g={distance:this.origin.distanceTo(n),point:n,face:g,object:a},w.push(g));else if(g instanceof THREE.Face4&&(c(n,f,h,i)||c(n,h,k,i)))g={distance:this.origin.distanceTo(n),point:n,face:g,object:a},w.push(g);w.sort(function(a,b){return a.distance-b.distance});return w}else return[]}};
+THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return f};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(f,g,l,j){h=!1;b=f;c=g;d=l;e=j;a()};this.addPoint=function(f,g){h?(h=!1,b=f,c=g,d=f,e=g):(b=b<f?b:f,c=c<g?c:g,d=d>f?d:f,e=e>g?e:g);a()};this.add3Points=
+function(f,g,l,j,n,m){h?(h=!1,b=f<l?f<n?f:n:l<n?l:n,c=g<j?g<m?g:m:j<m?j:m,d=f>l?f>n?f:n:l>n?l:n,e=g>j?g>m?g:m:j>m?j:m):(b=f<l?f<n?f<b?f:b:n<b?n:b:l<n?l<b?l:b:n<b?n:b,c=g<j?g<m?g<c?g:c:m<c?m:c:j<m?j<c?j:c:m<c?m:c,d=f>l?f>n?f>d?f:d:n>d?n:d:l>n?l>d?l:d:n>d?n:d,e=g>j?g>m?g>e?g:e:m>e?m:e:j>m?j>e?j:e:m>e?m:e);a()};this.addRectangle=function(f){h?(h=!1,b=f.getLeft(),c=f.getTop(),d=f.getRight(),e=f.getBottom()):(b=b<f.getLeft()?b:f.getLeft(),c=c<f.getTop()?c:f.getTop(),d=d>f.getRight()?d:f.getRight(),e=e>
 f.getBottom()?e:f.getBottom());a()};this.inflate=function(f){b-=f;c-=f;d+=f;e+=f;a()};this.minSelf=function(f){b=b>f.getLeft()?b:f.getLeft();c=c>f.getTop()?c:f.getTop();d=d<f.getRight()?d:f.getRight();e=e<f.getBottom()?e:f.getBottom();a()};this.instersects=function(a){return Math.min(d,a.getRight())-Math.max(b,a.getLeft())>=0&&Math.min(e,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){h=!0;e=d=c=b=0;a()};this.isEmpty=function(){return h}};THREE.Matrix3=function(){this.m=[]};
 f.getBottom()?e:f.getBottom());a()};this.inflate=function(f){b-=f;c-=f;d+=f;e+=f;a()};this.minSelf=function(f){b=b>f.getLeft()?b:f.getLeft();c=c>f.getTop()?c:f.getTop();d=d<f.getRight()?d:f.getRight();e=e<f.getBottom()?e:f.getBottom();a()};this.instersects=function(a){return Math.min(d,a.getRight())-Math.max(b,a.getLeft())>=0&&Math.min(e,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){h=!0;e=d=c=b=0;a()};this.isEmpty=function(){return h}};THREE.Matrix3=function(){this.m=[]};
-THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};THREE.Matrix4=function(a,b,c,d,e,g,f,h,l,i,k,j,n,m,p,q){this.set(a||1,b||0,c||0,d||0,e||0,g||1,f||0,h||0,l||0,i||0,k||1,j||0,n||0,m||0,p||0,q||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,l,i,k,j,n,m,p,q){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=g;this.n23=f;this.n24=h;this.n31=l;this.n32=i;this.n33=k;this.n34=j;this.n41=n;this.n42=m;this.n43=p;this.n44=q;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
+THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};THREE.Matrix4=function(a,b,c,d,e,g,f,h,k,i,l,j,n,m,p,q){this.set(a||1,b||0,c||0,d||0,e||0,g||1,f||0,h||0,k||0,i||0,l||1,j||0,n||0,m||0,p||0,q||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,k,i,l,j,n,m,p,q){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=g;this.n23=f;this.n24=h;this.n31=k;this.n32=i;this.n33=l;this.n34=j;this.n41=n;this.n42=m;this.n43=p;this.n44=q;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
 b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;d.cross(c,g).normalize();d.length()===0&&(g.x+=1.0E-4,d.cross(c,g).normalize());e.cross(g,d).normalize();this.n11=d.x;this.n12=e.x;this.n13=g.x;this.n21=d.y;this.n22=e.y;this.n23=g.y;this.n31=d.z;this.n32=e.z;this.n33=g.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,d=a.z,e=1/(this.n41*b+this.n42*c+this.n43*d+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*d+this.n14)*e;
 b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;d.cross(c,g).normalize();d.length()===0&&(g.x+=1.0E-4,d.cross(c,g).normalize());e.cross(g,d).normalize();this.n11=d.x;this.n12=e.x;this.n13=g.x;this.n21=d.y;this.n22=e.y;this.n23=g.y;this.n31=d.z;this.n32=e.z;this.n33=g.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,d=a.z,e=1/(this.n41*b+this.n42*c+this.n43*d+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*d+this.n14)*e;
 a.y=(this.n21*b+this.n22*c+this.n23*d+this.n24)*e;a.z=(this.n31*b+this.n32*c+this.n33*d+this.n34)*e;return a},multiplyVector4:function(a){var b=a.x,c=a.y,d=a.z,e=a.w;a.x=this.n11*b+this.n12*c+this.n13*d+this.n14*e;a.y=this.n21*b+this.n22*c+this.n23*d+this.n24*e;a.z=this.n31*b+this.n32*c+this.n33*d+this.n34*e;a.w=this.n41*b+this.n42*c+this.n43*d+this.n44*e;return a},rotateAxis:function(a){var b=a.x,c=a.y,d=a.z;a.x=b*this.n11+c*this.n12+d*this.n13;a.y=b*this.n21+c*this.n22+d*this.n23;a.z=b*this.n31+
 a.y=(this.n21*b+this.n22*c+this.n23*d+this.n24)*e;a.z=(this.n31*b+this.n32*c+this.n33*d+this.n34)*e;return a},multiplyVector4:function(a){var b=a.x,c=a.y,d=a.z,e=a.w;a.x=this.n11*b+this.n12*c+this.n13*d+this.n14*e;a.y=this.n21*b+this.n22*c+this.n23*d+this.n24*e;a.z=this.n31*b+this.n32*c+this.n33*d+this.n34*e;a.w=this.n41*b+this.n42*c+this.n43*d+this.n44*e;return a},rotateAxis:function(a){var b=a.x,c=a.y,d=a.z;a.x=b*this.n11+c*this.n12+d*this.n13;a.y=b*this.n21+c*this.n22+d*this.n23;a.z=b*this.n31+
-c*this.n32+d*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,l=a.n23,i=a.n24,k=a.n31,j=a.n32,n=a.n33,m=a.n34,p=a.n41,q=a.n42,w=a.n43,v=a.n44,A=b.n11,H=b.n12,
-s=b.n13,r=b.n14,o=b.n21,E=b.n22,B=b.n23,x=b.n24,C=b.n31,I=b.n32,J=b.n33,z=b.n34,O=b.n41,L=b.n42,M=b.n43,P=b.n44;this.n11=c*A+d*o+e*C+g*O;this.n12=c*H+d*E+e*I+g*L;this.n13=c*s+d*B+e*J+g*M;this.n14=c*r+d*x+e*z+g*P;this.n21=f*A+h*o+l*C+i*O;this.n22=f*H+h*E+l*I+i*L;this.n23=f*s+h*B+l*J+i*M;this.n24=f*r+h*x+l*z+i*P;this.n31=k*A+j*o+n*C+m*O;this.n32=k*H+j*E+n*I+m*L;this.n33=k*s+j*B+n*J+m*M;this.n34=k*r+j*x+n*z+m*P;this.n41=p*A+q*o+w*C+v*O;this.n42=p*H+q*E+w*I+v*L;this.n43=p*s+q*B+w*J+v*M;this.n44=p*r+q*
+c*this.n32+d*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,k=a.n23,i=a.n24,l=a.n31,j=a.n32,n=a.n33,m=a.n34,p=a.n41,q=a.n42,w=a.n43,v=a.n44,A=b.n11,H=b.n12,
+s=b.n13,r=b.n14,o=b.n21,E=b.n22,B=b.n23,x=b.n24,C=b.n31,I=b.n32,J=b.n33,z=b.n34,O=b.n41,L=b.n42,M=b.n43,P=b.n44;this.n11=c*A+d*o+e*C+g*O;this.n12=c*H+d*E+e*I+g*L;this.n13=c*s+d*B+e*J+g*M;this.n14=c*r+d*x+e*z+g*P;this.n21=f*A+h*o+k*C+i*O;this.n22=f*H+h*E+k*I+i*L;this.n23=f*s+h*B+k*J+i*M;this.n24=f*r+h*x+k*z+i*P;this.n31=l*A+j*o+n*C+m*O;this.n32=l*H+j*E+n*I+m*L;this.n33=l*s+j*B+n*J+m*M;this.n34=l*r+j*x+n*z+m*P;this.n41=p*A+q*o+w*C+v*O;this.n42=p*H+q*E+w*I+v*L;this.n43=p*s+q*B+w*J+v*M;this.n44=p*r+q*
 x+w*z+v*P;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=
 x+w*z+v*P;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=
-a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,l=this.n31,i=this.n32,k=this.n33,j=this.n34,n=this.n41,m=this.n42,p=this.n43,q=this.n44;return d*f*i*n-c*h*i*n-d*g*k*n+b*h*k*n+c*g*j*n-b*f*j*n-d*f*l*m+c*h*l*m+d*e*k*m-a*h*k*m-c*e*j*m+a*f*j*m+d*g*l*p-b*h*l*p-d*e*i*p+a*h*i*p+b*e*j*p-a*g*j*p-c*g*l*q+b*f*l*q+c*e*i*q-a*f*i*q-b*e*k*q+a*g*k*q},
+a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,k=this.n31,i=this.n32,l=this.n33,j=this.n34,n=this.n41,m=this.n42,p=this.n43,q=this.n44;return d*f*i*n-c*h*i*n-d*g*l*n+b*h*l*n+c*g*j*n-b*f*j*n-d*f*k*m+c*h*k*m+d*e*l*m-a*h*l*m-c*e*j*m+a*f*j*m+d*g*k*p-b*h*k*p-d*e*i*p+a*h*i*p+b*e*j*p-a*g*j*p-c*g*k*q+b*f*k*q+c*e*i*q-a*f*i*q-b*e*l*q+a*g*l*q},
 transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;
 transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;
 a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=this.n11;
 a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=this.n11;
 a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;
 a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;
 a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,
 a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,
-0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,l=e*g,i=e*f;this.set(l*g+c,l*f-d*h,l*h+d*f,0,l*f+d*h,i*f+c,i*h-d*g,0,l*h-d*f,i*h+d*g,e*h*h+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
-new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);switch(b){case "YXZ":var l=
-f*h,i=f*e,k=d*h,j=d*e;this.n11=l+j*c;this.n12=k*c-i;this.n13=g*d;this.n21=g*e;this.n22=g*h;this.n23=-c;this.n31=i*c-k;this.n32=j+l*c;this.n33=g*f;break;case "ZXY":l=f*h;i=f*e;k=d*h;j=d*e;this.n11=l-j*c;this.n12=-g*e;this.n13=k+i*c;this.n21=i+k*c;this.n22=g*h;this.n23=j-l*c;this.n31=-g*d;this.n32=c;this.n33=g*f;break;case "ZYX":l=g*h;i=g*e;k=c*h;j=c*e;this.n11=f*h;this.n12=k*d-i;this.n13=l*d+j;this.n21=f*e;this.n22=j*d+l;this.n23=i*d-k;this.n31=-d;this.n32=c*f;this.n33=g*f;break;case "YZX":l=g*f;i=
-g*d;k=c*f;j=c*d;this.n11=f*h;this.n12=j-l*e;this.n13=k*e+i;this.n21=e;this.n22=g*h;this.n23=-c*h;this.n31=-d*h;this.n32=i*e+k;this.n33=l-j*e;break;case "XZY":l=g*f;i=g*d;k=c*f;j=c*d;this.n11=f*h;this.n12=-e;this.n13=d*h;this.n21=l*e+j;this.n22=g*h;this.n23=i*e-k;this.n31=k*e-i;this.n32=c*h;this.n33=j*e+l;break;default:l=g*h,i=g*e,k=c*h,j=c*e,this.n11=f*h,this.n12=-f*e,this.n13=d,this.n21=i+k*d,this.n22=l-j*d,this.n23=-c*f,this.n31=j-l*d,this.n32=k+i*d,this.n33=g*f}return this},setRotationFromQuaternion:function(a){var b=
-a.x,c=a.y,d=a.z,e=a.w,g=b+b,f=c+c,h=d+d,a=b*g,l=b*f;b*=h;var i=c*f;c*=h;d*=h;g*=e;f*=e;e*=h;this.n11=1-(i+d);this.n12=l-e;this.n13=b+f;this.n21=l+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+i);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,e=THREE.Matrix4.__m2;
+0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,k=e*g,i=e*f;this.set(k*g+c,k*f-d*h,k*h+d*f,0,k*f+d*h,i*f+c,i*h-d*g,0,k*h-d*f,i*h+d*g,e*h*h+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
+new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);switch(b){case "YXZ":var k=
+f*h,i=f*e,l=d*h,j=d*e;this.n11=k+j*c;this.n12=l*c-i;this.n13=g*d;this.n21=g*e;this.n22=g*h;this.n23=-c;this.n31=i*c-l;this.n32=j+k*c;this.n33=g*f;break;case "ZXY":k=f*h;i=f*e;l=d*h;j=d*e;this.n11=k-j*c;this.n12=-g*e;this.n13=l+i*c;this.n21=i+l*c;this.n22=g*h;this.n23=j-k*c;this.n31=-g*d;this.n32=c;this.n33=g*f;break;case "ZYX":k=g*h;i=g*e;l=c*h;j=c*e;this.n11=f*h;this.n12=l*d-i;this.n13=k*d+j;this.n21=f*e;this.n22=j*d+k;this.n23=i*d-l;this.n31=-d;this.n32=c*f;this.n33=g*f;break;case "YZX":k=g*f;i=
+g*d;l=c*f;j=c*d;this.n11=f*h;this.n12=j-k*e;this.n13=l*e+i;this.n21=e;this.n22=g*h;this.n23=-c*h;this.n31=-d*h;this.n32=i*e+l;this.n33=k-j*e;break;case "XZY":k=g*f;i=g*d;l=c*f;j=c*d;this.n11=f*h;this.n12=-e;this.n13=d*h;this.n21=k*e+j;this.n22=g*h;this.n23=i*e-l;this.n31=l*e-i;this.n32=c*h;this.n33=j*e+k;break;default:k=g*h,i=g*e,l=c*h,j=c*e,this.n11=f*h,this.n12=-f*e,this.n13=d,this.n21=i+l*d,this.n22=k-j*d,this.n23=-c*f,this.n31=j-k*d,this.n32=l+i*d,this.n33=g*f}return this},setRotationFromQuaternion:function(a){var b=
+a.x,c=a.y,d=a.z,e=a.w,g=b+b,f=c+c,h=d+d,a=b*g,k=b*f;b*=h;var i=c*f;c*=h;d*=h;g*=e;f*=e;e*=h;this.n11=1-(i+d);this.n12=k-e;this.n13=b+f;this.n21=k+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+i);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,e=THREE.Matrix4.__m2;
 d.identity();d.setRotationFromQuaternion(b);e.setScale(c.x,c.y,c.z);this.multiply(d,e);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);e.set(this.n12,this.n22,this.n32);g.set(this.n13,this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=d.length();
 d.identity();d.setRotationFromQuaternion(b);e.setScale(c.x,c.y,c.z);this.multiply(d,e);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);e.set(this.n12,this.n22,this.n32);g.set(this.n13,this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=d.length();
 c.y=e.length();c.z=g.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=c.x;d.n21/=c.x;d.n31/=c.x;d.n12/=c.y;d.n22/=c.y;d.n32/=c.y;d.n13/=c.z;d.n23/=c.z;d.n33/=c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,d=1/b.y,e=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*d;this.n22=a.n22*d;this.n32=a.n32*d;this.n13=a.n13*e;this.n23=
 c.y=e.length();c.z=g.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=c.x;d.n21/=c.x;d.n31/=c.x;d.n12/=c.y;d.n22/=c.y;d.n32/=c.y;d.n13/=c.z;d.n23/=c.z;d.n33/=c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,d=1/b.y,e=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*d;this.n22=a.n22*d;this.n32=a.n32*d;this.n13=a.n13*e;this.n23=
 a.n23*e;this.n33=a.n33*e}};
 a.n23*e;this.n33=a.n33*e}};
-THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,l=a.n23,i=a.n24,k=a.n31,j=a.n32,n=a.n33,m=a.n34,p=a.n41,q=a.n42,w=a.n43,v=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=l*m*q-i*n*q+i*j*w-h*m*w-l*j*v+h*n*v;b.n12=g*n*q-e*m*q-g*j*w+d*m*w+e*j*v-d*n*v;b.n13=e*i*q-g*l*q+g*h*w-d*i*w-e*h*v+d*l*v;b.n14=g*l*j-e*i*j-g*h*n+d*i*n+e*h*m-d*l*m;b.n21=i*n*p-l*m*p-i*k*w+f*m*w+l*k*v-f*n*v;b.n22=e*m*p-g*n*p+g*k*w-c*m*w-e*k*v+c*n*v;b.n23=g*l*p-e*i*p-g*f*w+c*i*w+e*f*v-c*l*v;b.n24=
-e*i*k-g*l*k+g*f*n-c*i*n-e*f*m+c*l*m;b.n31=h*m*p-i*j*p+i*k*q-f*m*q-h*k*v+f*j*v;b.n32=g*j*p-d*m*p-g*k*q+c*m*q+d*k*v-c*j*v;b.n33=e*i*p-g*h*p+g*f*q-c*i*q-d*f*v+c*h*v;b.n34=g*h*k-d*i*k-g*f*j+c*i*j+d*f*m-c*h*m;b.n41=l*j*p-h*n*p-l*k*q+f*n*q+h*k*w-f*j*w;b.n42=d*n*p-e*j*p+e*k*q-c*n*q-d*k*w+c*j*w;b.n43=e*h*p-d*l*p-e*f*q+c*l*q+d*f*w-c*h*w;b.n44=d*l*k-e*h*k+e*f*j-c*l*j-d*f*n+c*h*n;b.multiplyScalar(1/a.determinant());return b};
-THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,l=-a.n32*a.n11+a.n31*a.n12,i=a.n23*a.n12-a.n22*a.n13,k=-a.n23*a.n11+a.n21*a.n13,j=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*i;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*g;c[3]=a*f;c[4]=a*h;c[5]=a*l;c[6]=a*i;c[7]=a*k;c[8]=a*j;return b};
+THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,k=a.n23,i=a.n24,l=a.n31,j=a.n32,n=a.n33,m=a.n34,p=a.n41,q=a.n42,w=a.n43,v=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=k*m*q-i*n*q+i*j*w-h*m*w-k*j*v+h*n*v;b.n12=g*n*q-e*m*q-g*j*w+d*m*w+e*j*v-d*n*v;b.n13=e*i*q-g*k*q+g*h*w-d*i*w-e*h*v+d*k*v;b.n14=g*k*j-e*i*j-g*h*n+d*i*n+e*h*m-d*k*m;b.n21=i*n*p-k*m*p-i*l*w+f*m*w+k*l*v-f*n*v;b.n22=e*m*p-g*n*p+g*l*w-c*m*w-e*l*v+c*n*v;b.n23=g*k*p-e*i*p-g*f*w+c*i*w+e*f*v-c*k*v;b.n24=
+e*i*l-g*k*l+g*f*n-c*i*n-e*f*m+c*k*m;b.n31=h*m*p-i*j*p+i*l*q-f*m*q-h*l*v+f*j*v;b.n32=g*j*p-d*m*p-g*l*q+c*m*q+d*l*v-c*j*v;b.n33=e*i*p-g*h*p+g*f*q-c*i*q-d*f*v+c*h*v;b.n34=g*h*l-d*i*l-g*f*j+c*i*j+d*f*m-c*h*m;b.n41=k*j*p-h*n*p-k*l*q+f*n*q+h*l*w-f*j*w;b.n42=d*n*p-e*j*p+e*l*q-c*n*q-d*l*w+c*j*w;b.n43=e*h*p-d*k*p-e*f*q+c*k*q+d*f*w-c*h*w;b.n44=d*k*l-e*h*l+e*f*j-c*k*j-d*f*n+c*h*n;b.multiplyScalar(1/a.determinant());return b};
+THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,k=-a.n32*a.n11+a.n31*a.n12,i=a.n23*a.n12-a.n22*a.n13,l=-a.n23*a.n11+a.n21*a.n13,j=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*i;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*g;c[3]=a*f;c[4]=a*h;c[5]=a*k;c[6]=a*i;c[7]=a*l;c[8]=a*j;return b};
 THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=2*e/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*e/(d-c);f.n23=(d+c)/(d-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+e)/(g-e);f.n34=-2*g*e/(g-e);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,d){var e,a=c*Math.tan(a*Math.PI/360);e=-a;return THREE.Matrix4.makeFrustum(e*b,a*b,e,a,c,d)};
 THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=2*e/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*e/(d-c);f.n23=(d+c)/(d-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+e)/(g-e);f.n34=-2*g*e/(g-e);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,d){var e,a=c*Math.tan(a*Math.PI/360);e=-a;return THREE.Matrix4.makeFrustum(e*b,a*b,e,a,c,d)};
-THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,l,i;f=new THREE.Matrix4;h=b-a;l=c-d;i=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/l;f.n23=0;f.n24=-((c+d)/l);f.n31=0;f.n32=0;f.n33=-2/i;f.n34=-((g+e)/i);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
+THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,k,i;f=new THREE.Matrix4;h=b-a;k=c-d;i=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/k;f.n23=0;f.n24=-((c+d)/k);f.n31=0;f.n32=0;f.n33=-2/i;f.n34=-((g+e)/i);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;
 THREE.Object3D=function(){this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;
 this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this._vector=new THREE.Vector3;this.name=""};
 this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this._vector=new THREE.Vector3;this.name=""};
 THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(a){if(this.children.indexOf(a)===
 THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(a){if(this.children.indexOf(a)===
@@ -55,17 +55,18 @@ this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matri
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),g=Math.cos(c),c=Math.sin(c),f=a*b,h=d*e;this.w=f*g-h*c;this.x=f*c+h*g;this.y=d*b*g+a*e*c;this.z=a*e*g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),g=Math.cos(c),c=Math.sin(c),f=a*b,h=d*e;this.w=f*g-h*c;this.x=f*c+h*g;this.y=d*b*g+a*e*c;this.z=a*e*g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);
 this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},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=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},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=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=
-this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,l=this.w,i=l*c+f*e-h*d,k=l*d+h*c-g*e,j=l*e+g*d-f*c,c=-g*
-c-f*d-h*e;b.x=i*l+c*-g+k*-h-j*-f;b.y=k*l+c*-f+j*-g-i*-h;b.z=j*l+c*-h+i*-f-k*-g;return b}};THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};
+this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,k=this.w,i=k*c+f*e-h*d,l=k*d+h*c-g*e,j=k*e+g*d-f*c,c=-g*
+c-f*d-h*e;b.x=i*k+c*-g+l*-h-j*-f;b.y=l*k+c*-f+j*-g-i*-h;b.z=j*k+c*-h+i*-f-l*-g;return b}};THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};
 THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
-THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
-THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
+THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
+THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
+THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
 THREE.Geometry.prototype={constructor:THREE.Geometry,computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.centroid.set(0,0,0),c instanceof THREE.Face3?(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.divideScalar(3)):c instanceof THREE.Face4&&(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),
 THREE.Geometry.prototype={constructor:THREE.Geometry,computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.centroid.set(0,0,0),c instanceof THREE.Face3?(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.divideScalar(3)):c instanceof THREE.Face4&&(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),
-c.centroid.addSelf(this.vertices[c.d].position),c.centroid.divideScalar(4))},computeFaceNormals:function(a){var b,c,d,e,g,f,h=new THREE.Vector3,l=new THREE.Vector3;d=0;for(e=this.faces.length;d<e;d++){g=this.faces[d];if(a&&g.vertexNormals.length){h.set(0,0,0);b=0;for(c=g.vertexNormals.length;b<c;b++)h.addSelf(g.vertexNormals[b]);h.divideScalar(3)}else b=this.vertices[g.a],c=this.vertices[g.b],f=this.vertices[g.c],h.sub(f.position,c.position),l.sub(b.position,c.position),h.crossSelf(l);h.isZero()||
+c.centroid.addSelf(this.vertices[c.d].position),c.centroid.divideScalar(4))},computeFaceNormals:function(a){var b,c,d,e,g,f,h=new THREE.Vector3,k=new THREE.Vector3;d=0;for(e=this.faces.length;d<e;d++){g=this.faces[d];if(a&&g.vertexNormals.length){h.set(0,0,0);b=0;for(c=g.vertexNormals.length;b<c;b++)h.addSelf(g.vertexNormals[b]);h.divideScalar(3)}else b=this.vertices[g.a],c=this.vertices[g.b],f=this.vertices[g.c],h.sub(f.position,c.position),k.sub(b.position,c.position),h.crossSelf(k);h.isZero()||
 h.normalize();g.normal.copy(h)}},computeVertexNormals:function(){var a,b,c,d;if(this.__tmpVertices==void 0){d=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)d[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)if(c=this.faces[a],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{d=
 h.normalize();g.normal.copy(h)}},computeVertexNormals:function(){var a,b,c,d;if(this.__tmpVertices==void 0){d=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)d[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)if(c=this.faces[a],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{d=
 this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)d[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal)):c instanceof THREE.Face4&&(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal),d[c.d].addSelf(c.normal));a=0;for(b=this.vertices.length;a<b;a++)d[a].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(c.vertexNormals[0].copy(d[c.a]),
 this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)d[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal)):c instanceof THREE.Face4&&(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal),d[c.d].addSelf(c.normal));a=0;for(b=this.vertices.length;a<b;a++)d[a].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(c.vertexNormals[0].copy(d[c.a]),
-c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c])):c instanceof THREE.Face4&&(c.vertexNormals[0].copy(d[c.a]),c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c]),c.vertexNormals[3].copy(d[c.d]))},computeTangents:function(){function a(a,b,c,d,e,g,D){h=a.vertices[b].position;l=a.vertices[c].position;i=a.vertices[d].position;k=f[e];j=f[g];n=f[D];m=l.x-h.x;p=i.x-h.x;q=l.y-h.y;w=i.y-h.y;v=l.z-h.z;A=i.z-h.z;H=j.u-k.u;s=n.u-k.u;r=j.v-k.v;o=n.v-k.v;E=1/(H*o-s*r);I.set((o*m-r*p)*
-E,(o*q-r*w)*E,(o*v-r*A)*E);J.set((H*p-s*m)*E,(H*w-s*q)*E,(H*A-s*v)*E);x[b].addSelf(I);x[c].addSelf(I);x[d].addSelf(I);C[b].addSelf(J);C[c].addSelf(J);C[d].addSelf(J)}var b,c,d,e,g,f,h,l,i,k,j,n,m,p,q,w,v,A,H,s,r,o,E,B,x=[],C=[],I=new THREE.Vector3,J=new THREE.Vector3,z=new THREE.Vector3,O=new THREE.Vector3,L=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)x[b]=new THREE.Vector3,C[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)g=this.faces[b],f=this.faceVertexUvs[0][b],g instanceof
+c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c])):c instanceof THREE.Face4&&(c.vertexNormals[0].copy(d[c.a]),c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c]),c.vertexNormals[3].copy(d[c.d]))},computeTangents:function(){function a(a,b,c,d,e,g,D){h=a.vertices[b].position;k=a.vertices[c].position;i=a.vertices[d].position;l=f[e];j=f[g];n=f[D];m=k.x-h.x;p=i.x-h.x;q=k.y-h.y;w=i.y-h.y;v=k.z-h.z;A=i.z-h.z;H=j.u-l.u;s=n.u-l.u;r=j.v-l.v;o=n.v-l.v;E=1/(H*o-s*r);I.set((o*m-r*p)*
+E,(o*q-r*w)*E,(o*v-r*A)*E);J.set((H*p-s*m)*E,(H*w-s*q)*E,(H*A-s*v)*E);x[b].addSelf(I);x[c].addSelf(I);x[d].addSelf(I);C[b].addSelf(J);C[c].addSelf(J);C[d].addSelf(J)}var b,c,d,e,g,f,h,k,i,l,j,n,m,p,q,w,v,A,H,s,r,o,E,B,x=[],C=[],I=new THREE.Vector3,J=new THREE.Vector3,z=new THREE.Vector3,O=new THREE.Vector3,L=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)x[b]=new THREE.Vector3,C[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)g=this.faces[b],f=this.faceVertexUvs[0][b],g instanceof
 THREE.Face3?a(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(a(this,g.a,g.b,g.c,0,1,2),a(this,g.a,g.b,g.d,0,1,3));var M=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){g=this.faces[b];for(d=0;d<g.vertexNormals.length;d++)L.copy(g.vertexNormals[d]),e=g[M[d]],B=x[e],z.copy(B),z.subSelf(L.multiplyScalar(L.dot(B))).normalize(),O.cross(g.vertexNormals[d],B),e=O.dot(C[e]),e=e<0?-1:1,g.vertexTangents[d]=new THREE.Vector4(z.x,z.y,z.z,e)}this.hasTangents=!0},computeBoundingBox:function(){var a;
 THREE.Face3?a(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(a(this,g.a,g.b,g.c,0,1,2),a(this,g.a,g.b,g.d,0,1,3));var M=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){g=this.faces[b];for(d=0;d<g.vertexNormals.length;d++)L.copy(g.vertexNormals[d]),e=g[M[d]],B=x[e],z.copy(B),z.subSelf(L.multiplyScalar(L.dot(B))).normalize(),O.cross(g.vertexNormals[d],B),e=O.dot(C[e]),e=e<0?-1:1,g.vertexTangents[d]=new THREE.Vector4(z.x,z.y,z.z,e)}this.hasTangents=!0},computeBoundingBox:function(){var a;
 if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;b<c;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;
 if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;b<c;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;
 else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},computeEdgeFaces:function(){function a(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}function b(a,b,c){a[b]===
 else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},computeEdgeFaces:function(){function a(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}function b(a,b,c){a[b]===
@@ -75,7 +76,8 @@ THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.tran
 THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.Camera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};
 THREE.Camera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};
 THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),b=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
 THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),b=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
-!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;
+!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};THREE.OrthoCamera=function(a,b,c,d,e,g,f){THREE.Camera.call(this,45,1,e,g,f);this.left=a;this.right=b;this.top=c;this.bottom=d;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
+THREE.OrthoCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b,c,d){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0;this.castShadow=d!==void 0?d:!1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1;this.distance=c||0};
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b,c,d){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0;this.castShadow=d!==void 0?d:!1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1;this.distance=c||0};
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
 THREE.Material=function(a){this.id=THREE.MaterialCount++;a=a||{};this.opacity=a.opacity!==void 0?a.opacity:1;this.transparent=a.transparent!==void 0?a.transparent:!1;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.depthTest=a.depthTest!==void 0?a.depthTest:!0;this.polygonOffset=a.polygonOffset!==void 0?a.polygonOffset:!1;this.polygonOffsetFactor=a.polygonOffsetFactor!==void 0?a.polygonOffsetFactor:0;this.polygonOffsetUnits=a.polygonOffsetUnits!==void 0?a.polygonOffsetUnits:
 THREE.Material=function(a){this.id=THREE.MaterialCount++;a=a||{};this.opacity=a.opacity!==void 0?a.opacity:1;this.transparent=a.transparent!==void 0?a.transparent:!1;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.depthTest=a.depthTest!==void 0?a.depthTest:!0;this.polygonOffset=a.polygonOffset!==void 0?a.polygonOffset:!1;this.polygonOffsetFactor=a.polygonOffsetFactor!==void 0?a.polygonOffsetFactor:0;this.polygonOffsetUnits=a.polygonOffsetUnits!==void 0?a.polygonOffsetUnits:
@@ -102,30 +104,30 @@ b,c)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1
 THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1)this.objects.push(a),this.__objectsAdded.push(a);for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
 THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1)this.objects.push(a),this.__objectsAdded.push(a);for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
 THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a)));for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;
 THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a)));for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;
 THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;
 THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;
-THREE.Projector=function(){function a(){var a=l[h]=l[h]||new THREE.RenderableVertex;h++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;return e>=0&&f>=0&&g>=0&&h>=0?!0:e<0&&f<0||g<0&&h<0?!1:(e<0?c=Math.max(c,e/(e-f)):f<0&&(d=Math.min(d,e/(e-f))),g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var d,e,g=[],f,h,l=[],i,k,j=[],n,m=[],p,q,w=[],v,A,H=[],s=new THREE.Vector4,r=new THREE.Vector4,
-o=new THREE.Matrix4,E=new THREE.Matrix4,B=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],x=new THREE.Vector4,C=new THREE.Vector4;this.projectVector=function(a,b){o.multiply(b.projectionMatrix,b.matrixWorldInverse);o.multiplyVector3(a);return a};this.unprojectVector=function(a,b){o.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));o.multiplyVector3(a);return a};this.projectObjects=function(a,c,f){var c=[],h,i,l;e=0;i=
-a.objects;a=0;for(h=i.length;a<h;a++){l=i[a];var j;if(!(j=!l.visible))if(j=l instanceof THREE.Mesh){a:{j=void 0;for(var k=l.matrixWorld,n=-l.geometry.boundingSphere.radius*Math.max(l.scale.x,Math.max(l.scale.y,l.scale.z)),m=0;m<6;m++)if(j=B[m].x*k.n14+B[m].y*k.n24+B[m].z*k.n34+B[m].w,j<=n){j=!1;break a}j=!0}j=!j}if(!j)j=g[e]=g[e]||new THREE.RenderableObject,e++,d=j,s.copy(l.position),o.multiplyVector3(s),d.object=l,d.z=s.z,c.push(d)}f&&c.sort(b);return c};this.projectScene=function(d,e,g){var s=[],
-L=e.near,M=e.far,P,Q,F,N,y,G,D,K,u,t,R,U,W,X,S,V,T;A=q=n=k=0;e.matrixAutoUpdate&&e.update(void 0,!0);d.update(void 0,!1,e);o.multiply(e.projectionMatrix,e.matrixWorldInverse);B[0].set(o.n41-o.n11,o.n42-o.n12,o.n43-o.n13,o.n44-o.n14);B[1].set(o.n41+o.n11,o.n42+o.n12,o.n43+o.n13,o.n44+o.n14);B[2].set(o.n41+o.n21,o.n42+o.n22,o.n43+o.n23,o.n44+o.n24);B[3].set(o.n41-o.n21,o.n42-o.n22,o.n43-o.n23,o.n44-o.n24);B[4].set(o.n41-o.n31,o.n42-o.n32,o.n43-o.n33,o.n44-o.n34);B[5].set(o.n41+o.n31,o.n42+o.n32,o.n43+
+THREE.Projector=function(){function a(){var a=k[h]=k[h]||new THREE.RenderableVertex;h++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;return e>=0&&f>=0&&g>=0&&h>=0?!0:e<0&&f<0||g<0&&h<0?!1:(e<0?c=Math.max(c,e/(e-f)):f<0&&(d=Math.min(d,e/(e-f))),g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var d,e,g=[],f,h,k=[],i,l,j=[],n,m=[],p,q,w=[],v,A,H=[],s=new THREE.Vector4,r=new THREE.Vector4,
+o=new THREE.Matrix4,E=new THREE.Matrix4,B=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],x=new THREE.Vector4,C=new THREE.Vector4;this.projectVector=function(a,b){o.multiply(b.projectionMatrix,b.matrixWorldInverse);o.multiplyVector3(a);return a};this.unprojectVector=function(a,b){o.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));o.multiplyVector3(a);return a};this.projectObjects=function(a,c,f){var c=[],h,i,k;e=0;i=
+a.objects;a=0;for(h=i.length;a<h;a++){k=i[a];var j;if(!(j=!k.visible))if(j=k instanceof THREE.Mesh){a:{j=void 0;for(var l=k.matrixWorld,n=-k.geometry.boundingSphere.radius*Math.max(k.scale.x,Math.max(k.scale.y,k.scale.z)),m=0;m<6;m++)if(j=B[m].x*l.n14+B[m].y*l.n24+B[m].z*l.n34+B[m].w,j<=n){j=!1;break a}j=!0}j=!j}if(!j)j=g[e]=g[e]||new THREE.RenderableObject,e++,d=j,s.copy(k.position),o.multiplyVector3(s),d.object=k,d.z=s.z,c.push(d)}f&&c.sort(b);return c};this.projectScene=function(d,e,g){var s=[],
+L=e.near,M=e.far,P,Q,F,N,y,G,D,K,u,t,R,U,W,X,S,V,T;A=q=n=l=0;e.matrixAutoUpdate&&e.update(void 0,!0);d.update(void 0,!1,e);o.multiply(e.projectionMatrix,e.matrixWorldInverse);B[0].set(o.n41-o.n11,o.n42-o.n12,o.n43-o.n13,o.n44-o.n14);B[1].set(o.n41+o.n11,o.n42+o.n12,o.n43+o.n13,o.n44+o.n14);B[2].set(o.n41+o.n21,o.n42+o.n22,o.n43+o.n23,o.n44+o.n24);B[3].set(o.n41-o.n21,o.n42-o.n22,o.n43-o.n23,o.n44-o.n24);B[4].set(o.n41-o.n31,o.n42-o.n32,o.n43-o.n33,o.n44-o.n34);B[5].set(o.n41+o.n31,o.n42+o.n32,o.n43+
 o.n33,o.n44+o.n34);for(P=0;P<6;P++)u=B[P],u.divideScalar(Math.sqrt(u.x*u.x+u.y*u.y+u.z*u.z));u=this.projectObjects(d,e,!0);d=0;for(P=u.length;d<P;d++)if(t=u[d].object,t.visible)if(R=t.matrixWorld,U=t.matrixRotationWorld,W=t.materials,X=t.overdraw,h=0,t instanceof THREE.Mesh){S=t.geometry;N=S.vertices;V=S.faces;S=S.faceVertexUvs;Q=0;for(F=N.length;Q<F;Q++)f=a(),f.positionWorld.copy(N[Q].position),R.multiplyVector3(f.positionWorld),f.positionScreen.copy(f.positionWorld),o.multiplyVector4(f.positionScreen),
 o.n33,o.n44+o.n34);for(P=0;P<6;P++)u=B[P],u.divideScalar(Math.sqrt(u.x*u.x+u.y*u.y+u.z*u.z));u=this.projectObjects(d,e,!0);d=0;for(P=u.length;d<P;d++)if(t=u[d].object,t.visible)if(R=t.matrixWorld,U=t.matrixRotationWorld,W=t.materials,X=t.overdraw,h=0,t instanceof THREE.Mesh){S=t.geometry;N=S.vertices;V=S.faces;S=S.faceVertexUvs;Q=0;for(F=N.length;Q<F;Q++)f=a(),f.positionWorld.copy(N[Q].position),R.multiplyVector3(f.positionWorld),f.positionScreen.copy(f.positionWorld),o.multiplyVector4(f.positionScreen),
-f.positionScreen.x/=f.positionScreen.w,f.positionScreen.y/=f.positionScreen.w,f.visible=f.positionScreen.z>L&&f.positionScreen.z<M;N=0;for(Q=V.length;N<Q;N++){F=V[N];if(F instanceof THREE.Face3)if(y=l[F.a],G=l[F.b],D=l[F.c],y.visible&&G.visible&&D.visible&&(t.doubleSided||t.flipSided!=(D.positionScreen.x-y.positionScreen.x)*(G.positionScreen.y-y.positionScreen.y)-(D.positionScreen.y-y.positionScreen.y)*(G.positionScreen.x-y.positionScreen.x)<0))K=j[k]=j[k]||new THREE.RenderableFace3,k++,i=K,i.v1.copy(y),
-i.v2.copy(G),i.v3.copy(D);else continue;else if(F instanceof THREE.Face4)if(y=l[F.a],G=l[F.b],D=l[F.c],K=l[F.d],y.visible&&G.visible&&D.visible&&K.visible&&(t.doubleSided||t.flipSided!=((K.positionScreen.x-y.positionScreen.x)*(G.positionScreen.y-y.positionScreen.y)-(K.positionScreen.y-y.positionScreen.y)*(G.positionScreen.x-y.positionScreen.x)<0||(G.positionScreen.x-D.positionScreen.x)*(K.positionScreen.y-D.positionScreen.y)-(G.positionScreen.y-D.positionScreen.y)*(K.positionScreen.x-D.positionScreen.x)<
+f.positionScreen.x/=f.positionScreen.w,f.positionScreen.y/=f.positionScreen.w,f.visible=f.positionScreen.z>L&&f.positionScreen.z<M;N=0;for(Q=V.length;N<Q;N++){F=V[N];if(F instanceof THREE.Face3)if(y=k[F.a],G=k[F.b],D=k[F.c],y.visible&&G.visible&&D.visible&&(t.doubleSided||t.flipSided!=(D.positionScreen.x-y.positionScreen.x)*(G.positionScreen.y-y.positionScreen.y)-(D.positionScreen.y-y.positionScreen.y)*(G.positionScreen.x-y.positionScreen.x)<0))K=j[l]=j[l]||new THREE.RenderableFace3,l++,i=K,i.v1.copy(y),
+i.v2.copy(G),i.v3.copy(D);else continue;else if(F instanceof THREE.Face4)if(y=k[F.a],G=k[F.b],D=k[F.c],K=k[F.d],y.visible&&G.visible&&D.visible&&K.visible&&(t.doubleSided||t.flipSided!=((K.positionScreen.x-y.positionScreen.x)*(G.positionScreen.y-y.positionScreen.y)-(K.positionScreen.y-y.positionScreen.y)*(G.positionScreen.x-y.positionScreen.x)<0||(G.positionScreen.x-D.positionScreen.x)*(K.positionScreen.y-D.positionScreen.y)-(G.positionScreen.y-D.positionScreen.y)*(K.positionScreen.x-D.positionScreen.x)<
 0)))T=m[n]=m[n]||new THREE.RenderableFace4,n++,i=T,i.v1.copy(y),i.v2.copy(G),i.v3.copy(D),i.v4.copy(K);else continue;i.normalWorld.copy(F.normal);U.multiplyVector3(i.normalWorld);i.centroidWorld.copy(F.centroid);R.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);o.multiplyVector3(i.centroidScreen);D=F.vertexNormals;y=0;for(G=D.length;y<G;y++)K=i.vertexNormalsWorld[y],K.copy(D[y]),U.multiplyVector3(K);y=0;for(G=S.length;y<G;y++)if(T=S[y][N]){D=0;for(K=T.length;D<K;D++)i.uvs[y][D]=
 0)))T=m[n]=m[n]||new THREE.RenderableFace4,n++,i=T,i.v1.copy(y),i.v2.copy(G),i.v3.copy(D),i.v4.copy(K);else continue;i.normalWorld.copy(F.normal);U.multiplyVector3(i.normalWorld);i.centroidWorld.copy(F.centroid);R.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);o.multiplyVector3(i.centroidScreen);D=F.vertexNormals;y=0;for(G=D.length;y<G;y++)K=i.vertexNormalsWorld[y],K.copy(D[y]),U.multiplyVector3(K);y=0;for(G=S.length;y<G;y++)if(T=S[y][N]){D=0;for(K=T.length;D<K;D++)i.uvs[y][D]=
-T[D]}i.meshMaterials=W;i.faceMaterials=F.materials;i.overdraw=X;i.z=i.centroidScreen.z;s.push(i)}}else if(t instanceof THREE.Line){E.multiply(o,R);N=t.geometry.vertices;y=a();y.positionScreen.copy(N[0].position);E.multiplyVector4(y.positionScreen);Q=1;for(F=N.length;Q<F;Q++)if(y=a(),y.positionScreen.copy(N[Q].position),E.multiplyVector4(y.positionScreen),G=l[h-2],x.copy(y.positionScreen),C.copy(G.positionScreen),c(x,C))x.multiplyScalar(1/x.w),C.multiplyScalar(1/C.w),R=w[q]=w[q]||new THREE.RenderableLine,
+T[D]}i.meshMaterials=W;i.faceMaterials=F.materials;i.overdraw=X;i.z=i.centroidScreen.z;s.push(i)}}else if(t instanceof THREE.Line){E.multiply(o,R);N=t.geometry.vertices;y=a();y.positionScreen.copy(N[0].position);E.multiplyVector4(y.positionScreen);Q=1;for(F=N.length;Q<F;Q++)if(y=a(),y.positionScreen.copy(N[Q].position),E.multiplyVector4(y.positionScreen),G=k[h-2],x.copy(y.positionScreen),C.copy(G.positionScreen),c(x,C))x.multiplyScalar(1/x.w),C.multiplyScalar(1/C.w),R=w[q]=w[q]||new THREE.RenderableLine,
 q++,p=R,p.v1.positionScreen.copy(x),p.v2.positionScreen.copy(C),p.z=Math.max(x.z,C.z),p.materials=t.materials,s.push(p)}else if(t instanceof THREE.Particle&&(r.set(t.matrixWorld.n14,t.matrixWorld.n24,t.matrixWorld.n34,1),o.multiplyVector4(r),r.z/=r.w,r.z>0&&r.z<1))R=H[A]=H[A]||new THREE.RenderableParticle,A++,v=R,v.x=r.x/r.w,v.y=r.y/r.w,v.z=r.z,v.rotation=t.rotation.z,v.scale.x=t.scale.x*Math.abs(v.x-(r.x+e.projectionMatrix.n11)/(r.w+e.projectionMatrix.n14)),v.scale.y=t.scale.y*Math.abs(v.y-(r.y+
 q++,p=R,p.v1.positionScreen.copy(x),p.v2.positionScreen.copy(C),p.z=Math.max(x.z,C.z),p.materials=t.materials,s.push(p)}else if(t instanceof THREE.Particle&&(r.set(t.matrixWorld.n14,t.matrixWorld.n24,t.matrixWorld.n34,1),o.multiplyVector4(r),r.z/=r.w,r.z>0&&r.z<1))R=H[A]=H[A]||new THREE.RenderableParticle,A++,v=R,v.x=r.x/r.w,v.y=r.y/r.w,v.z=r.z,v.rotation=t.rotation.z,v.scale.x=t.scale.x*Math.abs(v.x-(r.x+e.projectionMatrix.n11)/(r.w+e.projectionMatrix.n14)),v.scale.y=t.scale.y*Math.abs(v.y-(r.y+
 e.projectionMatrix.n22)/(r.w+e.projectionMatrix.n24)),v.materials=t.materials,s.push(v);g&&s.sort(b);return s}};
 e.projectionMatrix.n22)/(r.w+e.projectionMatrix.n24)),v.materials=t.materials,s.push(v);g&&s.sort(b);return s}};
 THREE.SVGRenderer=function(){function a(a,b,c){var d,e,f,g;d=0;for(e=a.lights.length;d<e;d++)f=a.lights[d],f instanceof THREE.DirectionalLight?(g=b.normalWorld.dot(f.position)*f.intensity,g>0&&(c.r+=f.color.r*g,c.g+=f.color.g*g,c.b+=f.color.b*g)):f instanceof THREE.PointLight&&(C.sub(f.position,b.centroidWorld),C.normalize(),g=b.normalWorld.dot(C)*f.intensity,g>0&&(c.r+=f.color.r*g,c.g+=f.color.g*g,c.b+=f.color.b*g))}function b(b,c,f,h,i,j){g.data.vertices+=3;g.data.faces++;z=d(O++);z.setAttribute("d",
 THREE.SVGRenderer=function(){function a(a,b,c){var d,e,f,g;d=0;for(e=a.lights.length;d<e;d++)f=a.lights[d],f instanceof THREE.DirectionalLight?(g=b.normalWorld.dot(f.position)*f.intensity,g>0&&(c.r+=f.color.r*g,c.g+=f.color.g*g,c.b+=f.color.b*g)):f instanceof THREE.PointLight&&(C.sub(f.position,b.centroidWorld),C.normalize(),g=b.normalWorld.dot(C)*f.intensity,g>0&&(c.r+=f.color.r*g,c.g+=f.color.g*g,c.b+=f.color.b*g))}function b(b,c,f,h,i,j){g.data.vertices+=3;g.data.faces++;z=d(O++);z.setAttribute("d",
 "M "+b.positionScreen.x+" "+b.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+f.positionScreen.x+","+f.positionScreen.y+"z");i instanceof THREE.MeshBasicMaterial?s.copy(i.color):i instanceof THREE.MeshLambertMaterial?H?(r.r=o.r,r.g=o.g,r.b=o.b,a(j,h,r),s.r=Math.max(0,Math.min(i.color.r*r.r,1)),s.g=Math.max(0,Math.min(i.color.g*r.g,1)),s.b=Math.max(0,Math.min(i.color.b*r.b,1))):s.copy(i.color):i instanceof THREE.MeshDepthMaterial?(x=1-i.__2near/(i.__farPlusNear-h.z*i.__farMinusNear),
 "M "+b.positionScreen.x+" "+b.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+f.positionScreen.x+","+f.positionScreen.y+"z");i instanceof THREE.MeshBasicMaterial?s.copy(i.color):i instanceof THREE.MeshLambertMaterial?H?(r.r=o.r,r.g=o.g,r.b=o.b,a(j,h,r),s.r=Math.max(0,Math.min(i.color.r*r.r,1)),s.g=Math.max(0,Math.min(i.color.g*r.g,1)),s.b=Math.max(0,Math.min(i.color.b*r.b,1))):s.copy(i.color):i instanceof THREE.MeshDepthMaterial?(x=1-i.__2near/(i.__farPlusNear-h.z*i.__farMinusNear),
-s.setRGB(x,x,x)):i instanceof THREE.MeshNormalMaterial&&s.setRGB(e(h.normalWorld.x),e(h.normalWorld.y),e(h.normalWorld.z));i.wireframe?z.setAttribute("style","fill: none; stroke: "+s.getContextStyle()+"; stroke-width: "+i.wireframeLinewidth+"; stroke-opacity: "+i.opacity+"; stroke-linecap: "+i.wireframeLinecap+"; stroke-linejoin: "+i.wireframeLinejoin):z.setAttribute("style","fill: "+s.getContextStyle()+"; fill-opacity: "+i.opacity);l.appendChild(z)}function c(b,c,f,h,i,j,k){g.data.vertices+=4;g.data.faces++;
-z=d(O++);z.setAttribute("d","M "+b.positionScreen.x+" "+b.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+f.positionScreen.x+","+f.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+"z");j instanceof THREE.MeshBasicMaterial?s.copy(j.color):j instanceof THREE.MeshLambertMaterial?H?(r.r=o.r,r.g=o.g,r.b=o.b,a(k,i,r),s.r=Math.max(0,Math.min(j.color.r*r.r,1)),s.g=Math.max(0,Math.min(j.color.g*r.g,1)),s.b=Math.max(0,Math.min(j.color.b*r.b,1))):s.copy(j.color):j instanceof
+s.setRGB(x,x,x)):i instanceof THREE.MeshNormalMaterial&&s.setRGB(e(h.normalWorld.x),e(h.normalWorld.y),e(h.normalWorld.z));i.wireframe?z.setAttribute("style","fill: none; stroke: "+s.getContextStyle()+"; stroke-width: "+i.wireframeLinewidth+"; stroke-opacity: "+i.opacity+"; stroke-linecap: "+i.wireframeLinecap+"; stroke-linejoin: "+i.wireframeLinejoin):z.setAttribute("style","fill: "+s.getContextStyle()+"; fill-opacity: "+i.opacity);k.appendChild(z)}function c(b,c,f,h,i,j,l){g.data.vertices+=4;g.data.faces++;
+z=d(O++);z.setAttribute("d","M "+b.positionScreen.x+" "+b.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+f.positionScreen.x+","+f.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+"z");j instanceof THREE.MeshBasicMaterial?s.copy(j.color):j instanceof THREE.MeshLambertMaterial?H?(r.r=o.r,r.g=o.g,r.b=o.b,a(l,i,r),s.r=Math.max(0,Math.min(j.color.r*r.r,1)),s.g=Math.max(0,Math.min(j.color.g*r.g,1)),s.b=Math.max(0,Math.min(j.color.b*r.b,1))):s.copy(j.color):j instanceof
 THREE.MeshDepthMaterial?(x=1-j.__2near/(j.__farPlusNear-i.z*j.__farMinusNear),s.setRGB(x,x,x)):j instanceof THREE.MeshNormalMaterial&&s.setRGB(e(i.normalWorld.x),e(i.normalWorld.y),e(i.normalWorld.z));j.wireframe?z.setAttribute("style","fill: none; stroke: "+s.getContextStyle()+"; stroke-width: "+j.wireframeLinewidth+"; stroke-opacity: "+j.opacity+"; stroke-linecap: "+j.wireframeLinecap+"; stroke-linejoin: "+j.wireframeLinejoin):z.setAttribute("style","fill: "+s.getContextStyle()+"; fill-opacity: "+
 THREE.MeshDepthMaterial?(x=1-j.__2near/(j.__farPlusNear-i.z*j.__farMinusNear),s.setRGB(x,x,x)):j instanceof THREE.MeshNormalMaterial&&s.setRGB(e(i.normalWorld.x),e(i.normalWorld.y),e(i.normalWorld.z));j.wireframe?z.setAttribute("style","fill: none; stroke: "+s.getContextStyle()+"; stroke-width: "+j.wireframeLinewidth+"; stroke-opacity: "+j.opacity+"; stroke-linecap: "+j.wireframeLinecap+"; stroke-linejoin: "+j.wireframeLinejoin):z.setAttribute("style","fill: "+s.getContextStyle()+"; fill-opacity: "+
-j.opacity);l.appendChild(z)}function d(a){I[a]==null&&(I[a]=document.createElementNS("http://www.w3.org/2000/svg","path"),M==0&&I[a].setAttribute("shape-rendering","crispEdges"));return I[a]}function e(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}var g=this,f=null,h=new THREE.Projector,l=document.createElementNS("http://www.w3.org/2000/svg","svg"),i,k,j,n,m,p,q,w,v=new THREE.Rectangle,A=new THREE.Rectangle,H=!1,s=new THREE.Color(16777215),r=new THREE.Color(16777215),o=new THREE.Color(0),E=new THREE.Color(0),
-B=new THREE.Color(0),x,C=new THREE.Vector3,I=[],J=[],z,O,L,M=1;this.domElement=l;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setQuality=function(a){switch(a){case "high":M=1;break;case "low":M=0}};this.setSize=function(a,b){i=a;k=b;j=i/2;n=k/2;l.setAttribute("viewBox",-j+" "+-n+" "+i+" "+k);l.setAttribute("width",i);l.setAttribute("height",k);v.set(-j,-n,j,n)};this.clear=function(){for(;l.childNodes.length>0;)l.removeChild(l.childNodes[0])};this.render=
-function(a,d){var e,i,k,r,s,x,u,t;this.autoClear&&this.clear();g.data.vertices=0;g.data.faces=0;f=h.projectScene(a,d,this.sortElements);L=O=0;if(H=a.lights.length>0){u=a.lights;o.setRGB(0,0,0);E.setRGB(0,0,0);B.setRGB(0,0,0);e=0;for(i=u.length;e<i;e++)k=u[e],r=k.color,k instanceof THREE.AmbientLight?(o.r+=r.r,o.g+=r.g,o.b+=r.b):k instanceof THREE.DirectionalLight?(E.r+=r.r,E.g+=r.g,E.b+=r.b):k instanceof THREE.PointLight&&(B.r+=r.r,B.g+=r.g,B.b+=r.b)}e=0;for(i=f.length;e<i;e++)if(u=f[e],A.empty(),
-u instanceof THREE.RenderableParticle){m=u;m.x*=j;m.y*=-n;k=0;for(r=u.materials.length;k<r;)k++}else if(u instanceof THREE.RenderableLine){if(m=u.v1,p=u.v2,m.positionScreen.x*=j,m.positionScreen.y*=-n,p.positionScreen.x*=j,p.positionScreen.y*=-n,A.addPoint(m.positionScreen.x,m.positionScreen.y),A.addPoint(p.positionScreen.x,p.positionScreen.y),v.instersects(A)){k=0;for(r=u.materials.length;k<r;)if((t=u.materials[k++])&&t.opacity!=0){s=m;x=p;var C=L++;J[C]==null&&(J[C]=document.createElementNS("http://www.w3.org/2000/svg",
-"line"),M==0&&J[C].setAttribute("shape-rendering","crispEdges"));z=J[C];z.setAttribute("x1",s.positionScreen.x);z.setAttribute("y1",s.positionScreen.y);z.setAttribute("x2",x.positionScreen.x);z.setAttribute("y2",x.positionScreen.y);t instanceof THREE.LineBasicMaterial&&(z.setAttribute("style","fill: none; stroke: "+t.color.getContextStyle()+"; stroke-width: "+t.linewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.linecap+"; stroke-linejoin: "+t.linejoin),l.appendChild(z))}}}else if(u instanceof
-THREE.RenderableFace3){if(m=u.v1,p=u.v2,q=u.v3,m.positionScreen.x*=j,m.positionScreen.y*=-n,p.positionScreen.x*=j,p.positionScreen.y*=-n,q.positionScreen.x*=j,q.positionScreen.y*=-n,A.addPoint(m.positionScreen.x,m.positionScreen.y),A.addPoint(p.positionScreen.x,p.positionScreen.y),A.addPoint(q.positionScreen.x,q.positionScreen.y),v.instersects(A)){k=0;for(r=u.meshMaterials.length;k<r;)if(t=u.meshMaterials[k++],t instanceof THREE.MeshFaceMaterial){s=0;for(x=u.faceMaterials.length;s<x;)(t=u.faceMaterials[s++])&&
+j.opacity);k.appendChild(z)}function d(a){I[a]==null&&(I[a]=document.createElementNS("http://www.w3.org/2000/svg","path"),M==0&&I[a].setAttribute("shape-rendering","crispEdges"));return I[a]}function e(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}var g=this,f=null,h=new THREE.Projector,k=document.createElementNS("http://www.w3.org/2000/svg","svg"),i,l,j,n,m,p,q,w,v=new THREE.Rectangle,A=new THREE.Rectangle,H=!1,s=new THREE.Color(16777215),r=new THREE.Color(16777215),o=new THREE.Color(0),E=new THREE.Color(0),
+B=new THREE.Color(0),x,C=new THREE.Vector3,I=[],J=[],z,O,L,M=1;this.domElement=k;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setQuality=function(a){switch(a){case "high":M=1;break;case "low":M=0}};this.setSize=function(a,b){i=a;l=b;j=i/2;n=l/2;k.setAttribute("viewBox",-j+" "+-n+" "+i+" "+l);k.setAttribute("width",i);k.setAttribute("height",l);v.set(-j,-n,j,n)};this.clear=function(){for(;k.childNodes.length>0;)k.removeChild(k.childNodes[0])};this.render=
+function(a,d){var e,i,l,r,s,x,u,t;this.autoClear&&this.clear();g.data.vertices=0;g.data.faces=0;f=h.projectScene(a,d,this.sortElements);L=O=0;if(H=a.lights.length>0){u=a.lights;o.setRGB(0,0,0);E.setRGB(0,0,0);B.setRGB(0,0,0);e=0;for(i=u.length;e<i;e++)l=u[e],r=l.color,l instanceof THREE.AmbientLight?(o.r+=r.r,o.g+=r.g,o.b+=r.b):l instanceof THREE.DirectionalLight?(E.r+=r.r,E.g+=r.g,E.b+=r.b):l instanceof THREE.PointLight&&(B.r+=r.r,B.g+=r.g,B.b+=r.b)}e=0;for(i=f.length;e<i;e++)if(u=f[e],A.empty(),
+u instanceof THREE.RenderableParticle){m=u;m.x*=j;m.y*=-n;l=0;for(r=u.materials.length;l<r;)l++}else if(u instanceof THREE.RenderableLine){if(m=u.v1,p=u.v2,m.positionScreen.x*=j,m.positionScreen.y*=-n,p.positionScreen.x*=j,p.positionScreen.y*=-n,A.addPoint(m.positionScreen.x,m.positionScreen.y),A.addPoint(p.positionScreen.x,p.positionScreen.y),v.instersects(A)){l=0;for(r=u.materials.length;l<r;)if((t=u.materials[l++])&&t.opacity!=0){s=m;x=p;var C=L++;J[C]==null&&(J[C]=document.createElementNS("http://www.w3.org/2000/svg",
+"line"),M==0&&J[C].setAttribute("shape-rendering","crispEdges"));z=J[C];z.setAttribute("x1",s.positionScreen.x);z.setAttribute("y1",s.positionScreen.y);z.setAttribute("x2",x.positionScreen.x);z.setAttribute("y2",x.positionScreen.y);t instanceof THREE.LineBasicMaterial&&(z.setAttribute("style","fill: none; stroke: "+t.color.getContextStyle()+"; stroke-width: "+t.linewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.linecap+"; stroke-linejoin: "+t.linejoin),k.appendChild(z))}}}else if(u instanceof
+THREE.RenderableFace3){if(m=u.v1,p=u.v2,q=u.v3,m.positionScreen.x*=j,m.positionScreen.y*=-n,p.positionScreen.x*=j,p.positionScreen.y*=-n,q.positionScreen.x*=j,q.positionScreen.y*=-n,A.addPoint(m.positionScreen.x,m.positionScreen.y),A.addPoint(p.positionScreen.x,p.positionScreen.y),A.addPoint(q.positionScreen.x,q.positionScreen.y),v.instersects(A)){l=0;for(r=u.meshMaterials.length;l<r;)if(t=u.meshMaterials[l++],t instanceof THREE.MeshFaceMaterial){s=0;for(x=u.faceMaterials.length;s<x;)(t=u.faceMaterials[s++])&&
 t.opacity!=0&&b(m,p,q,u,t,a)}else t&&t.opacity!=0&&b(m,p,q,u,t,a)}}else if(u instanceof THREE.RenderableFace4&&(m=u.v1,p=u.v2,q=u.v3,w=u.v4,m.positionScreen.x*=j,m.positionScreen.y*=-n,p.positionScreen.x*=j,p.positionScreen.y*=-n,q.positionScreen.x*=j,q.positionScreen.y*=-n,w.positionScreen.x*=j,w.positionScreen.y*=-n,A.addPoint(m.positionScreen.x,m.positionScreen.y),A.addPoint(p.positionScreen.x,p.positionScreen.y),A.addPoint(q.positionScreen.x,q.positionScreen.y),A.addPoint(w.positionScreen.x,w.positionScreen.y),
 t.opacity!=0&&b(m,p,q,u,t,a)}else t&&t.opacity!=0&&b(m,p,q,u,t,a)}}else if(u instanceof THREE.RenderableFace4&&(m=u.v1,p=u.v2,q=u.v3,w=u.v4,m.positionScreen.x*=j,m.positionScreen.y*=-n,p.positionScreen.x*=j,p.positionScreen.y*=-n,q.positionScreen.x*=j,q.positionScreen.y*=-n,w.positionScreen.x*=j,w.positionScreen.y*=-n,A.addPoint(m.positionScreen.x,m.positionScreen.y),A.addPoint(p.positionScreen.x,p.positionScreen.y),A.addPoint(q.positionScreen.x,q.positionScreen.y),A.addPoint(w.positionScreen.x,w.positionScreen.y),
-v.instersects(A))){k=0;for(r=u.meshMaterials.length;k<r;)if(t=u.meshMaterials[k++],t instanceof THREE.MeshFaceMaterial){s=0;for(x=u.faceMaterials.length;s<x;)(t=u.faceMaterials[s++])&&t.opacity!=0&&c(m,p,q,w,u,t,a)}else t&&t.opacity!=0&&c(m,p,q,w,u,t,a)}}};THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
+v.instersects(A))){l=0;for(r=u.meshMaterials.length;l<r;)if(t=u.meshMaterials[l++],t instanceof THREE.MeshFaceMaterial){s=0;for(x=u.faceMaterials.length;s<x;)(t=u.faceMaterials[s++])&&t.opacity!=0&&c(m,p,q,w,u,t,a)}else t&&t.opacity!=0&&c(m,p,q,w,u,t,a)}}};THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
 THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableObject=function(){this.z=this.object=null};THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.materials=null};
 THREE.RenderableObject=function(){this.z=this.object=null};THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.materials=null};

+ 122 - 121
build/custom/ThreeWebGL.js

@@ -1,51 +1,51 @@
-// ThreeWebGL.js r43 - http://github.com/mrdoob/three.js
+// ThreeWebGL.js r44dev - http://github.com/mrdoob/three.js
 var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this};
 var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this};
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,d){this.r=b;this.g=c;this.b=d;return this},setHSV:function(b,c,d){var e,h,g;if(d==0)this.r=this.g=this.b=0;else switch(e=Math.floor(b*6),h=b*6-e,b=d*(1-c),g=d*(1-c*h),c=d*(1-c*(1-h)),e){case 1:this.r=g;this.g=d;this.b=b;break;case 2:this.r=b;this.g=d;this.b=c;break;case 3:this.r=b;this.g=g;this.b=d;break;case 4:this.r=c;this.g=b;this.b=d;break;case 5:this.r=
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,d){this.r=b;this.g=c;this.b=d;return this},setHSV:function(b,c,d){var e,h,g;if(d==0)this.r=this.g=this.b=0;else switch(e=Math.floor(b*6),h=b*6-e,b=d*(1-c),g=d*(1-c*h),c=d*(1-c*(1-h)),e){case 1:this.r=g;this.g=d;this.b=b;break;case 2:this.r=b;this.g=d;this.b=c;break;case 3:this.r=b;this.g=g;this.b=d;break;case 4:this.r=c;this.g=b;this.b=d;break;case 5:this.r=
 d;this.g=b;this.b=g;break;case 6:case 0:this.r=d,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
 d;this.g=b;this.b=g;break;case 6:case 0:this.r=d,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
-THREE.Vector2=function(b,c){this.set(b||0,c||0)};
+THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0};
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this},
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this},
 divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var c=this.x-b.x,b=this.y-b.y;return c*c+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)},
 divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var c=this.x-b.x,b=this.y-b.y;return c*c+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)},
-unit:function(){return this.normalize()},equals:function(b){return b.x==this.x&&b.y==this.y}};THREE.Vector3=function(b,c,d){this.set(b||0,c||0,d||0)};
+equals:function(b){return b.x==this.x&&b.y==this.y}};THREE.Vector3=function(b,c,d){this.x=b||0;this.y=c||0;this.z=d||0};
 THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(b,c,d){this.x=b;this.y=c;this.z=d;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;return this},addScalar:function(b){this.x+=b;this.y+=b;this.z+=b;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=
 THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(b,c,d){this.x=b;this.y=c;this.z=d;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;return this},addScalar:function(b){this.x+=b;this.y+=b;this.z+=b;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=
-b.z-c.z;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;return this},multiply:function(b,c){this.x=b.x*c.x;this.y=b.y*c.y;this.z=b.z*c.z;return this},multiplySelf:function(b){this.x*=b.x;this.y*=b.y;this.z*=b.z;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;return this},divideSelf:function(b){return this.divide(this,b)},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},
+b.z-c.z;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;return this},multiply:function(b,c){this.x=b.x*c.x;this.y=b.y*c.y;this.z=b.z*c.z;return this},multiplySelf:function(b){this.x*=b.x;this.y*=b.y;this.z*=b.z;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;return this},divideSelf:function(b){this.x/=b.x;this.y/=b.y;this.z/=b.z;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},
 dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},cross:function(b,c){this.x=b.y*c.z-b.z*c.y;this.y=b.z*c.x-b.x*c.z;this.z=b.x*c.y-b.y*c.x;return this},crossSelf:function(b){return this.set(this.y*
 dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},cross:function(b,c){this.x=b.y*c.z-b.z*c.y;this.y=b.z*c.x-b.x*c.z;this.z=b.x*c.y-b.y*c.x;return this},crossSelf:function(b){return this.set(this.y*
 b.z-this.z*b.y,this.z*b.x-this.x*b.z,this.x*b.y-this.y*b.x)},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){return(new THREE.Vector3).sub(this,b).lengthSq()},setPositionFromMatrix:function(b){this.x=b.n14;this.y=b.n24;this.z=b.n34},setRotationFromMatrix:function(b){var c=Math.cos(this.y);this.y=Math.asin(b.n13);Math.abs(c)>1.0E-5?(this.x=Math.atan2(-b.n23/c,b.n33/c),this.z=Math.atan2(-b.n12/c,b.n11/c)):(this.x=0,this.z=Math.atan2(b.n21,b.n22))},isZero:function(){return this.lengthSq()<
 b.z-this.z*b.y,this.z*b.x-this.x*b.z,this.x*b.y-this.y*b.x)},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){return(new THREE.Vector3).sub(this,b).lengthSq()},setPositionFromMatrix:function(b){this.x=b.n14;this.y=b.n24;this.z=b.n34},setRotationFromMatrix:function(b){var c=Math.cos(this.y);this.y=Math.asin(b.n13);Math.abs(c)>1.0E-5?(this.x=Math.atan2(-b.n23/c,b.n33/c),this.z=Math.atan2(-b.n12/c,b.n11/c)):(this.x=0,this.z=Math.atan2(b.n21,b.n22))},isZero:function(){return this.lengthSq()<
-1.0E-4}};THREE.Vector4=function(b,c,d,e){this.set(b||0,c||0,d||0,e||1)};
-THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,c,d,e){this.x=b;this.y=c;this.z=d;this.w=e;return this},copy:function(b){return this.set(b.x,b.y,b.z,b.w||1)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;this.w=b.w+c.w;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;this.w+=b.w;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=b.z-c.z;this.w=b.w-c.w;return this},
-subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;this.w-=b.w;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;this.w*=b;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b,this.w/=b):this.set(0,0,0,1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z+this.w*b.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},
-setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3};
-THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,d,e=[];c=0;for(d=b.length;c<d;c++)e=e.concat(this.intersectObject(b[c]));e.sort(function(b,c){return b.distance-c.distance});return e},intersectObject:function(b){function c(b,c,d){var e,d=d.matrixWorld.getPosition();e=d.clone().subSelf(b).dot(c);b=b.clone().addSelf(c.clone().multiplyScalar(e));return d.distanceTo(b)}function d(b,c,d,e){var e=e.clone().subSelf(c),
-d=d.clone().subSelf(c),h=b.clone().subSelf(c),b=e.dot(e),c=e.dot(d),e=e.dot(h),g=d.dot(d),d=d.dot(h),h=1/(b*g-c*c),g=(g*e-c*d)*h,b=(b*d-c*e)*h;return g>0&&b>0&&g+b<1}if(b instanceof THREE.Particle){var e=c(this.origin,this.direction,b);if(!e||e>b.scale.x)return[];return[{distance:e,point:b.position,face:null,object:b}]}else if(b instanceof THREE.Mesh){e=c(this.origin,this.direction,b);if(!e||e>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return[];var h,g,j,k,
-o,m,p,r,q,v,C=b.geometry,x=C.vertices,E=[],e=0;for(h=C.faces.length;e<h;e++)if(g=C.faces[e],q=this.origin.clone(),v=this.direction.clone(),m=b.matrixWorld,j=m.multiplyVector3(x[g.a].position.clone()),k=m.multiplyVector3(x[g.b].position.clone()),o=m.multiplyVector3(x[g.c].position.clone()),m=g instanceof THREE.Face4?m.multiplyVector3(x[g.d].position.clone()):null,p=b.matrixRotationWorld.multiplyVector3(g.normal.clone()),r=v.dot(p),b.doubleSided||(b.flipSided?r>0:r<0))if(p=p.dot((new THREE.Vector3).sub(j,
-q))/r,q=q.addSelf(v.multiplyScalar(p)),g instanceof THREE.Face3)d(q,j,k,o)&&(g={distance:this.origin.distanceTo(q),point:q,face:g,object:b},E.push(g));else if(g instanceof THREE.Face4&&(d(q,j,k,m)||d(q,k,o,m)))g={distance:this.origin.distanceTo(q),point:q,face:g,object:b},E.push(g);return E}else return[]}};
-THREE.Rectangle=function(){function b(){g=e-c;j=h-d}var c,d,e,h,g,j,k=!0;this.getX=function(){return c};this.getY=function(){return d};this.getWidth=function(){return g};this.getHeight=function(){return j};this.getLeft=function(){return c};this.getTop=function(){return d};this.getRight=function(){return e};this.getBottom=function(){return h};this.set=function(g,j,p,r){k=!1;c=g;d=j;e=p;h=r;b()};this.addPoint=function(g,j){k?(k=!1,c=g,d=j,e=g,h=j):(c=c<g?c:g,d=d<j?d:j,e=e>g?e:g,h=h>j?h:j);b()};this.add3Points=
-function(g,j,p,r,q,v){k?(k=!1,c=g<p?g<q?g:q:p<q?p:q,d=j<r?j<v?j:v:r<v?r:v,e=g>p?g>q?g:q:p>q?p:q,h=j>r?j>v?j:v:r>v?r:v):(c=g<p?g<q?g<c?g:c:q<c?q:c:p<q?p<c?p:c:q<c?q:c,d=j<r?j<v?j<d?j:d:v<d?v:d:r<v?r<d?r:d:v<d?v:d,e=g>p?g>q?g>e?g:e:q>e?q:e:p>q?p>e?p:e:q>e?q:e,h=j>r?j>v?j>h?j:h:v>h?v:h:r>v?r>h?r:h:v>h?v:h);b()};this.addRectangle=function(g){k?(k=!1,c=g.getLeft(),d=g.getTop(),e=g.getRight(),h=g.getBottom()):(c=c<g.getLeft()?c:g.getLeft(),d=d<g.getTop()?d:g.getTop(),e=e>g.getRight()?e:g.getRight(),h=h>
+1.0E-4}};THREE.Vector4=function(b,c,d,e){this.x=b||0;this.y=c||0;this.z=d||0;this.w=e||1};
+THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,c,d,e){this.x=b;this.y=c;this.z=d;this.w=e;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w||1},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;this.w=b.w+c.w;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;this.w+=b.w;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=b.z-c.z;this.w=
+b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;this.w-=b.w;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;this.w*=b;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b,this.w/=b):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z+this.w*b.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
+normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3};
+THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,d,e=[];c=0;for(d=b.length;c<d;c++)e=e.concat(this.intersectObject(b[c]));e.sort(function(b,c){return b.distance-c.distance});return e},intersectObject:function(b){function c(b,c,d){var e;e=d.clone().subSelf(b).dot(c);if(e<=0)return null;b=b.clone().addSelf(c.clone().multiplyScalar(e));return d.distanceTo(b)}function d(b,c,d,e){var e=e.clone().subSelf(c),
+d=d.clone().subSelf(c),h=b.clone().subSelf(c),b=e.dot(e),c=e.dot(d),e=e.dot(h),g=d.dot(d),d=d.dot(h),h=1/(b*g-c*c),g=(g*e-c*d)*h,b=(b*d-c*e)*h;return g>0&&b>0&&g+b<1}if(b instanceof THREE.Particle){var e=c(this.origin,this.direction,b.matrixWorld.getPosition());if(e==null||e>b.scale.x)return[];return[{distance:e,point:b.position,face:null,object:b}]}else if(b instanceof THREE.Mesh){e=c(this.origin,this.direction,b.matrixWorld.getPosition());if(e==null||e>b.geometry.boundingSphere.radius*Math.max(b.scale.x,
+Math.max(b.scale.y,b.scale.z)))return[];var h,g,j,k,p,o,m,r,q,v,C=b.geometry,x=C.vertices,E=[],e=0;for(h=C.faces.length;e<h;e++)if(g=C.faces[e],q=this.origin.clone(),v=this.direction.clone(),o=b.matrixWorld,j=o.multiplyVector3(g.centroid.clone()).subSelf(q),r=j.dot(v),!(r<=0)&&(j=o.multiplyVector3(x[g.a].position.clone()),k=o.multiplyVector3(x[g.b].position.clone()),p=o.multiplyVector3(x[g.c].position.clone()),o=g instanceof THREE.Face4?o.multiplyVector3(x[g.d].position.clone()):null,m=b.matrixRotationWorld.multiplyVector3(g.normal.clone()),
+r=v.dot(m),b.doubleSided||(b.flipSided?r>0:r<0)))if(r=m.dot((new THREE.Vector3).sub(j,q))/r,q=q.addSelf(v.multiplyScalar(r)),g instanceof THREE.Face3)d(q,j,k,p)&&(g={distance:this.origin.distanceTo(q),point:q,face:g,object:b},E.push(g));else if(g instanceof THREE.Face4&&(d(q,j,k,o)||d(q,k,p,o)))g={distance:this.origin.distanceTo(q),point:q,face:g,object:b},E.push(g);E.sort(function(b,c){return b.distance-c.distance});return E}else return[]}};
+THREE.Rectangle=function(){function b(){g=e-c;j=h-d}var c,d,e,h,g,j,k=!0;this.getX=function(){return c};this.getY=function(){return d};this.getWidth=function(){return g};this.getHeight=function(){return j};this.getLeft=function(){return c};this.getTop=function(){return d};this.getRight=function(){return e};this.getBottom=function(){return h};this.set=function(g,j,m,r){k=!1;c=g;d=j;e=m;h=r;b()};this.addPoint=function(g,j){k?(k=!1,c=g,d=j,e=g,h=j):(c=c<g?c:g,d=d<j?d:j,e=e>g?e:g,h=h>j?h:j);b()};this.add3Points=
+function(g,j,m,r,q,v){k?(k=!1,c=g<m?g<q?g:q:m<q?m:q,d=j<r?j<v?j:v:r<v?r:v,e=g>m?g>q?g:q:m>q?m:q,h=j>r?j>v?j:v:r>v?r:v):(c=g<m?g<q?g<c?g:c:q<c?q:c:m<q?m<c?m:c:q<c?q:c,d=j<r?j<v?j<d?j:d:v<d?v:d:r<v?r<d?r:d:v<d?v:d,e=g>m?g>q?g>e?g:e:q>e?q:e:m>q?m>e?m:e:q>e?q:e,h=j>r?j>v?j>h?j:h:v>h?v:h:r>v?r>h?r:h:v>h?v:h);b()};this.addRectangle=function(g){k?(k=!1,c=g.getLeft(),d=g.getTop(),e=g.getRight(),h=g.getBottom()):(c=c<g.getLeft()?c:g.getLeft(),d=d<g.getTop()?d:g.getTop(),e=e>g.getRight()?e:g.getRight(),h=h>
 g.getBottom()?h:g.getBottom());b()};this.inflate=function(g){c-=g;d-=g;e+=g;h+=g;b()};this.minSelf=function(g){c=c>g.getLeft()?c:g.getLeft();d=d>g.getTop()?d:g.getTop();e=e<g.getRight()?e:g.getRight();h=h<g.getBottom()?h:g.getBottom();b()};this.instersects=function(b){return Math.min(e,b.getRight())-Math.max(c,b.getLeft())>=0&&Math.min(h,b.getBottom())-Math.max(d,b.getTop())>=0};this.empty=function(){k=!0;h=e=d=c=0;b()};this.isEmpty=function(){return k}};THREE.Matrix3=function(){this.m=[]};
 g.getBottom()?h:g.getBottom());b()};this.inflate=function(g){c-=g;d-=g;e+=g;h+=g;b()};this.minSelf=function(g){c=c>g.getLeft()?c:g.getLeft();d=d>g.getTop()?d:g.getTop();e=e<g.getRight()?e:g.getRight();h=h<g.getBottom()?h:g.getBottom();b()};this.instersects=function(b){return Math.min(e,b.getRight())-Math.max(c,b.getLeft())>=0&&Math.min(h,b.getBottom())-Math.max(d,b.getTop())>=0};this.empty=function(){k=!0;h=e=d=c=0;b()};this.isEmpty=function(){return k}};THREE.Matrix3=function(){this.m=[]};
-THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}};THREE.Matrix4=function(b,c,d,e,h,g,j,k,o,m,p,r,q,v,C,x){this.set(b||1,c||0,d||0,e||0,h||0,g||1,j||0,k||0,o||0,m||0,p||1,r||0,q||0,v||0,C||0,x||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,d,e,h,g,j,k,o,m,p,r,q,v,C,x){this.n11=b;this.n12=c;this.n13=d;this.n14=e;this.n21=h;this.n22=g;this.n23=j;this.n24=k;this.n31=o;this.n32=m;this.n33=p;this.n34=r;this.n41=q;this.n42=v;this.n43=C;this.n44=x;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b,
+THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}};THREE.Matrix4=function(b,c,d,e,h,g,j,k,p,o,m,r,q,v,C,x){this.set(b||1,c||0,d||0,e||0,h||0,g||1,j||0,k||0,p||0,o||0,m||1,r||0,q||0,v||0,C||0,x||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,d,e,h,g,j,k,p,o,m,r,q,v,C,x){this.n11=b;this.n12=c;this.n13=d;this.n14=e;this.n21=h;this.n22=g;this.n23=j;this.n24=k;this.n31=p;this.n32=o;this.n33=m;this.n34=r;this.n41=q;this.n42=v;this.n43=C;this.n44=x;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b,
 c,d){var e=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(b,c).normalize();if(g.length()===0)g.z=1;e.cross(d,g).normalize();e.length()===0&&(g.x+=1.0E-4,e.cross(d,g).normalize());h.cross(g,e).normalize();this.n11=e.x;this.n12=h.x;this.n13=g.x;this.n21=e.y;this.n22=h.y;this.n23=g.y;this.n31=e.z;this.n32=h.z;this.n33=g.z;return this},multiplyVector3:function(b){var c=b.x,d=b.y,e=b.z,h=1/(this.n41*c+this.n42*d+this.n43*e+this.n44);b.x=(this.n11*c+this.n12*d+this.n13*e+this.n14)*h;
 c,d){var e=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(b,c).normalize();if(g.length()===0)g.z=1;e.cross(d,g).normalize();e.length()===0&&(g.x+=1.0E-4,e.cross(d,g).normalize());h.cross(g,e).normalize();this.n11=e.x;this.n12=h.x;this.n13=g.x;this.n21=e.y;this.n22=h.y;this.n23=g.y;this.n31=e.z;this.n32=h.z;this.n33=g.z;return this},multiplyVector3:function(b){var c=b.x,d=b.y,e=b.z,h=1/(this.n41*c+this.n42*d+this.n43*e+this.n44);b.x=(this.n11*c+this.n12*d+this.n13*e+this.n14)*h;
 b.y=(this.n21*c+this.n22*d+this.n23*e+this.n24)*h;b.z=(this.n31*c+this.n32*d+this.n33*e+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,d=b.y,e=b.z,h=b.w;b.x=this.n11*c+this.n12*d+this.n13*e+this.n14*h;b.y=this.n21*c+this.n22*d+this.n23*e+this.n24*h;b.z=this.n31*c+this.n32*d+this.n33*e+this.n34*h;b.w=this.n41*c+this.n42*d+this.n43*e+this.n44*h;return b},rotateAxis:function(b){var c=b.x,d=b.y,e=b.z;b.x=c*this.n11+d*this.n12+e*this.n13;b.y=c*this.n21+d*this.n22+e*this.n23;b.z=c*this.n31+
 b.y=(this.n21*c+this.n22*d+this.n23*e+this.n24)*h;b.z=(this.n31*c+this.n32*d+this.n33*e+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,d=b.y,e=b.z,h=b.w;b.x=this.n11*c+this.n12*d+this.n13*e+this.n14*h;b.y=this.n21*c+this.n22*d+this.n23*e+this.n24*h;b.z=this.n31*c+this.n32*d+this.n33*e+this.n34*h;b.w=this.n41*c+this.n42*d+this.n43*e+this.n44*h;return b},rotateAxis:function(b){var c=b.x,d=b.y,e=b.z;b.x=c*this.n11+d*this.n12+e*this.n13;b.y=c*this.n21+d*this.n22+e*this.n23;b.z=c*this.n31+
-d*this.n32+e*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var d=b.n11,e=b.n12,h=b.n13,g=b.n14,j=b.n21,k=b.n22,o=b.n23,m=b.n24,p=b.n31,r=b.n32,q=b.n33,v=b.n34,C=b.n41,x=b.n42,E=b.n43,K=b.n44,ya=c.n11,za=
-c.n12,ta=c.n13,U=c.n14,t=c.n21,Y=c.n22,L=c.n23,P=c.n24,Q=c.n31,ha=c.n32,qa=c.n33,S=c.n34,J=c.n41,f=c.n42,Ba=c.n43,ra=c.n44;this.n11=d*ya+e*t+h*Q+g*J;this.n12=d*za+e*Y+h*ha+g*f;this.n13=d*ta+e*L+h*qa+g*Ba;this.n14=d*U+e*P+h*S+g*ra;this.n21=j*ya+k*t+o*Q+m*J;this.n22=j*za+k*Y+o*ha+m*f;this.n23=j*ta+k*L+o*qa+m*Ba;this.n24=j*U+k*P+o*S+m*ra;this.n31=p*ya+r*t+q*Q+v*J;this.n32=p*za+r*Y+q*ha+v*f;this.n33=p*ta+r*L+q*qa+v*Ba;this.n34=p*U+r*P+q*S+v*ra;this.n41=C*ya+x*t+E*Q+K*J;this.n42=C*za+x*Y+E*ha+K*f;this.n43=
+d*this.n32+e*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var d=b.n11,e=b.n12,h=b.n13,g=b.n14,j=b.n21,k=b.n22,p=b.n23,o=b.n24,m=b.n31,r=b.n32,q=b.n33,v=b.n34,C=b.n41,x=b.n42,E=b.n43,K=b.n44,ya=c.n11,za=
+c.n12,ta=c.n13,U=c.n14,t=c.n21,Y=c.n22,L=c.n23,P=c.n24,Q=c.n31,ha=c.n32,qa=c.n33,S=c.n34,J=c.n41,f=c.n42,Ba=c.n43,ra=c.n44;this.n11=d*ya+e*t+h*Q+g*J;this.n12=d*za+e*Y+h*ha+g*f;this.n13=d*ta+e*L+h*qa+g*Ba;this.n14=d*U+e*P+h*S+g*ra;this.n21=j*ya+k*t+p*Q+o*J;this.n22=j*za+k*Y+p*ha+o*f;this.n23=j*ta+k*L+p*qa+o*Ba;this.n24=j*U+k*P+p*S+o*ra;this.n31=m*ya+r*t+q*Q+v*J;this.n32=m*za+r*Y+q*ha+v*f;this.n33=m*ta+r*L+q*qa+v*Ba;this.n34=m*U+r*P+q*S+v*ra;this.n41=C*ya+x*t+E*Q+K*J;this.n42=C*za+x*Y+E*ha+K*f;this.n43=
 C*ta+x*L+E*qa+K*Ba;this.n44=C*U+x*P+E*S+K*ra;return this},multiplyToArray:function(b,c,d){this.multiply(b,c);d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34;d[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=
 C*ta+x*L+E*qa+K*Ba;this.n44=C*U+x*P+E*S+K*ra;return this},multiplyToArray:function(b,c,d){this.multiply(b,c);d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34;d[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=
-b;this.n23*=b;this.n24*=b;this.n31*=b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,d=this.n13,e=this.n14,h=this.n21,g=this.n22,j=this.n23,k=this.n24,o=this.n31,m=this.n32,p=this.n33,r=this.n34,q=this.n41,v=this.n42,C=this.n43,x=this.n44;return e*j*m*q-d*k*m*q-e*g*p*q+c*k*p*q+d*g*r*q-c*j*r*q-e*j*o*v+d*k*o*v+e*h*p*v-b*k*p*v-d*h*r*v+b*j*r*v+e*g*o*C-c*k*o*C-e*h*m*C+b*k*m*C+c*h*r*C-b*g*r*C-d*g*o*x+c*j*
-o*x+d*h*m*x-b*j*m*x-c*h*p*x+b*g*p*x},transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32;
+b;this.n23*=b;this.n24*=b;this.n31*=b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,d=this.n13,e=this.n14,h=this.n21,g=this.n22,j=this.n23,k=this.n24,p=this.n31,o=this.n32,m=this.n33,r=this.n34,q=this.n41,v=this.n42,C=this.n43,x=this.n44;return e*j*o*q-d*k*o*q-e*g*m*q+c*k*m*q+d*g*r*q-c*j*r*q-e*j*p*v+d*k*p*v+e*h*m*v-b*k*m*v-d*h*r*v+b*j*r*v+e*g*p*C-c*k*p*C-e*h*o*C+b*k*o*C+c*h*r*C-b*g*r*C-d*g*p*x+c*j*
+p*x+d*h*o*x-b*j*o*x-c*h*m*x+b*g*m*x},transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32;
 b.n33=this.n33;b.n34=this.n34;b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]=
 b.n33=this.n33;b.n34=this.n34;b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]=
 this.n11;b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=
 this.n11;b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=
 this.n34;b[c+15]=this.n44;return b},setTranslation:function(b,c,d){this.set(1,0,0,b,0,1,0,c,0,0,1,d,0,0,0,1);return this},setScale:function(b,c,d){this.set(b,0,0,0,0,c,0,0,0,0,d,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,-b,0,
 this.n34;b[c+15]=this.n44;return b},setTranslation:function(b,c,d){this.set(1,0,0,b,0,1,0,c,0,0,1,d,0,0,0,1);return this},setScale:function(b,c,d){this.set(b,0,0,0,0,c,0,0,0,0,d,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,-b,0,
-0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var d=Math.cos(c),e=Math.sin(c),h=1-d,g=b.x,j=b.y,k=b.z,o=h*g,m=h*j;this.set(o*g+d,o*j-e*k,o*k+e*j,0,o*j+e*k,m*j+d,m*k-e*g,0,o*k-e*j,m*k+e*g,h*k*k+d,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
-new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var d=b.x,e=b.y,h=b.z,g=Math.cos(d),d=Math.sin(d),j=Math.cos(e),e=Math.sin(e),k=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var o=
-j*k,m=j*h,p=e*k,r=e*h;this.n11=o+r*d;this.n12=p*d-m;this.n13=g*e;this.n21=g*h;this.n22=g*k;this.n23=-d;this.n31=m*d-p;this.n32=r+o*d;this.n33=g*j;break;case "ZXY":o=j*k;m=j*h;p=e*k;r=e*h;this.n11=o-r*d;this.n12=-g*h;this.n13=p+m*d;this.n21=m+p*d;this.n22=g*k;this.n23=r-o*d;this.n31=-g*e;this.n32=d;this.n33=g*j;break;case "ZYX":o=g*k;m=g*h;p=d*k;r=d*h;this.n11=j*k;this.n12=p*e-m;this.n13=o*e+r;this.n21=j*h;this.n22=r*e+o;this.n23=m*e-p;this.n31=-e;this.n32=d*j;this.n33=g*j;break;case "YZX":o=g*j;m=
-g*e;p=d*j;r=d*e;this.n11=j*k;this.n12=r-o*h;this.n13=p*h+m;this.n21=h;this.n22=g*k;this.n23=-d*k;this.n31=-e*k;this.n32=m*h+p;this.n33=o-r*h;break;case "XZY":o=g*j;m=g*e;p=d*j;r=d*e;this.n11=j*k;this.n12=-h;this.n13=e*k;this.n21=o*h+r;this.n22=g*k;this.n23=m*h-p;this.n31=p*h-m;this.n32=d*k;this.n33=r*h+o;break;default:o=g*k,m=g*h,p=d*k,r=d*h,this.n11=j*k,this.n12=-j*h,this.n13=e,this.n21=m+p*e,this.n22=o-r*e,this.n23=-d*j,this.n31=r-o*e,this.n32=p+m*e,this.n33=g*j}return this},setRotationFromQuaternion:function(b){var c=
-b.x,d=b.y,e=b.z,h=b.w,g=c+c,j=d+d,k=e+e,b=c*g,o=c*j;c*=k;var m=d*j;d*=k;e*=k;g*=h;j*=h;h*=k;this.n11=1-(m+e);this.n12=o-h;this.n13=c+j;this.n21=o+h;this.n22=1-(b+e);this.n23=d-g;this.n31=c-j;this.n32=d+g;this.n33=1-(b+m);return this},scale:function(b){var c=b.x,d=b.y,b=b.z;this.n11*=c;this.n12*=d;this.n13*=b;this.n21*=c;this.n22*=d;this.n23*=b;this.n31*=c;this.n32*=d;this.n33*=b;this.n41*=c;this.n42*=d;this.n43*=b;return this},compose:function(b,c,d){var e=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2;
+0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var d=Math.cos(c),e=Math.sin(c),h=1-d,g=b.x,j=b.y,k=b.z,p=h*g,o=h*j;this.set(p*g+d,p*j-e*k,p*k+e*j,0,p*j+e*k,o*j+d,o*k-e*g,0,p*k-e*j,o*k+e*g,h*k*k+d,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
+new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var d=b.x,e=b.y,h=b.z,g=Math.cos(d),d=Math.sin(d),j=Math.cos(e),e=Math.sin(e),k=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var p=
+j*k,o=j*h,m=e*k,r=e*h;this.n11=p+r*d;this.n12=m*d-o;this.n13=g*e;this.n21=g*h;this.n22=g*k;this.n23=-d;this.n31=o*d-m;this.n32=r+p*d;this.n33=g*j;break;case "ZXY":p=j*k;o=j*h;m=e*k;r=e*h;this.n11=p-r*d;this.n12=-g*h;this.n13=m+o*d;this.n21=o+m*d;this.n22=g*k;this.n23=r-p*d;this.n31=-g*e;this.n32=d;this.n33=g*j;break;case "ZYX":p=g*k;o=g*h;m=d*k;r=d*h;this.n11=j*k;this.n12=m*e-o;this.n13=p*e+r;this.n21=j*h;this.n22=r*e+p;this.n23=o*e-m;this.n31=-e;this.n32=d*j;this.n33=g*j;break;case "YZX":p=g*j;o=
+g*e;m=d*j;r=d*e;this.n11=j*k;this.n12=r-p*h;this.n13=m*h+o;this.n21=h;this.n22=g*k;this.n23=-d*k;this.n31=-e*k;this.n32=o*h+m;this.n33=p-r*h;break;case "XZY":p=g*j;o=g*e;m=d*j;r=d*e;this.n11=j*k;this.n12=-h;this.n13=e*k;this.n21=p*h+r;this.n22=g*k;this.n23=o*h-m;this.n31=m*h-o;this.n32=d*k;this.n33=r*h+p;break;default:p=g*k,o=g*h,m=d*k,r=d*h,this.n11=j*k,this.n12=-j*h,this.n13=e,this.n21=o+m*e,this.n22=p-r*e,this.n23=-d*j,this.n31=r-p*e,this.n32=m+o*e,this.n33=g*j}return this},setRotationFromQuaternion:function(b){var c=
+b.x,d=b.y,e=b.z,h=b.w,g=c+c,j=d+d,k=e+e,b=c*g,p=c*j;c*=k;var o=d*j;d*=k;e*=k;g*=h;j*=h;h*=k;this.n11=1-(o+e);this.n12=p-h;this.n13=c+j;this.n21=p+h;this.n22=1-(b+e);this.n23=d-g;this.n31=c-j;this.n32=d+g;this.n33=1-(b+o);return this},scale:function(b){var c=b.x,d=b.y,b=b.z;this.n11*=c;this.n12*=d;this.n13*=b;this.n21*=c;this.n22*=d;this.n23*=b;this.n31*=c;this.n32*=d;this.n33*=b;this.n41*=c;this.n42*=d;this.n43*=b;return this},compose:function(b,c,d){var e=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2;
 e.identity();e.setRotationFromQuaternion(c);h.setScale(d.x,d.y,d.z);this.multiply(e,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,d){var e=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;e.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);g.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;d=d instanceof THREE.Vector3?d:new THREE.Vector3;d.x=e.length();
 e.identity();e.setRotationFromQuaternion(c);h.setScale(d.x,d.y,d.z);this.multiply(e,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,d){var e=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;e.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);g.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;d=d instanceof THREE.Vector3?d:new THREE.Vector3;d.x=e.length();
 d.y=h.length();d.z=g.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;e=THREE.Matrix4.__m1;e.copy(this);e.n11/=d.x;e.n21/=d.x;e.n31/=d.x;e.n12/=d.y;e.n22/=d.y;e.n32/=d.y;e.n13/=d.z;e.n23/=d.z;e.n33/=d.z;c.setFromRotationMatrix(e);return[b,c,d]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var d=1/c.x,e=1/c.y,h=1/c.z;this.n11=b.n11*d;this.n21=b.n21*d;this.n31=b.n31*d;this.n12=b.n12*e;this.n22=b.n22*e;this.n32=b.n32*e;this.n13=b.n13*h;this.n23=
 d.y=h.length();d.z=g.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;e=THREE.Matrix4.__m1;e.copy(this);e.n11/=d.x;e.n21/=d.x;e.n31/=d.x;e.n12/=d.y;e.n22/=d.y;e.n32/=d.y;e.n13/=d.z;e.n23/=d.z;e.n33/=d.z;c.setFromRotationMatrix(e);return[b,c,d]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var d=1/c.x,e=1/c.y,h=1/c.z;this.n11=b.n11*d;this.n21=b.n21*d;this.n31=b.n31*d;this.n12=b.n12*e;this.n22=b.n22*e;this.n32=b.n32*e;this.n13=b.n13*h;this.n23=
 b.n23*h;this.n33=b.n33*h}};
 b.n23*h;this.n33=b.n33*h}};
-THREE.Matrix4.makeInvert=function(b,c){var d=b.n11,e=b.n12,h=b.n13,g=b.n14,j=b.n21,k=b.n22,o=b.n23,m=b.n24,p=b.n31,r=b.n32,q=b.n33,v=b.n34,C=b.n41,x=b.n42,E=b.n43,K=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=o*v*x-m*q*x+m*r*E-k*v*E-o*r*K+k*q*K;c.n12=g*q*x-h*v*x-g*r*E+e*v*E+h*r*K-e*q*K;c.n13=h*m*x-g*o*x+g*k*E-e*m*E-h*k*K+e*o*K;c.n14=g*o*r-h*m*r-g*k*q+e*m*q+h*k*v-e*o*v;c.n21=m*q*C-o*v*C-m*p*E+j*v*E+o*p*K-j*q*K;c.n22=h*v*C-g*q*C+g*p*E-d*v*E-h*p*K+d*q*K;c.n23=g*o*C-h*m*C-g*j*E+d*m*E+h*j*K-d*o*K;c.n24=
-h*m*p-g*o*p+g*j*q-d*m*q-h*j*v+d*o*v;c.n31=k*v*C-m*r*C+m*p*x-j*v*x-k*p*K+j*r*K;c.n32=g*r*C-e*v*C-g*p*x+d*v*x+e*p*K-d*r*K;c.n33=h*m*C-g*k*C+g*j*x-d*m*x-e*j*K+d*k*K;c.n34=g*k*p-e*m*p-g*j*r+d*m*r+e*j*v-d*k*v;c.n41=o*r*C-k*q*C-o*p*x+j*q*x+k*p*E-j*r*E;c.n42=e*q*C-h*r*C+h*p*x-d*q*x-e*p*E+d*r*E;c.n43=h*k*C-e*o*C-h*j*x+d*o*x+e*j*E-d*k*E;c.n44=e*o*p-h*k*p+h*j*r-d*o*r-e*j*q+d*k*q;c.multiplyScalar(1/b.determinant());return c};
-THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,d=c.m,e=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,g=b.n32*b.n21-b.n31*b.n22,j=-b.n33*b.n12+b.n32*b.n13,k=b.n33*b.n11-b.n31*b.n13,o=-b.n32*b.n11+b.n31*b.n12,m=b.n23*b.n12-b.n22*b.n13,p=-b.n23*b.n11+b.n21*b.n13,r=b.n22*b.n11-b.n21*b.n12,b=b.n11*e+b.n21*j+b.n31*m;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;d[0]=b*e;d[1]=b*h;d[2]=b*g;d[3]=b*j;d[4]=b*k;d[5]=b*o;d[6]=b*m;d[7]=b*p;d[8]=b*r;return c};
+THREE.Matrix4.makeInvert=function(b,c){var d=b.n11,e=b.n12,h=b.n13,g=b.n14,j=b.n21,k=b.n22,p=b.n23,o=b.n24,m=b.n31,r=b.n32,q=b.n33,v=b.n34,C=b.n41,x=b.n42,E=b.n43,K=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=p*v*x-o*q*x+o*r*E-k*v*E-p*r*K+k*q*K;c.n12=g*q*x-h*v*x-g*r*E+e*v*E+h*r*K-e*q*K;c.n13=h*o*x-g*p*x+g*k*E-e*o*E-h*k*K+e*p*K;c.n14=g*p*r-h*o*r-g*k*q+e*o*q+h*k*v-e*p*v;c.n21=o*q*C-p*v*C-o*m*E+j*v*E+p*m*K-j*q*K;c.n22=h*v*C-g*q*C+g*m*E-d*v*E-h*m*K+d*q*K;c.n23=g*p*C-h*o*C-g*j*E+d*o*E+h*j*K-d*p*K;c.n24=
+h*o*m-g*p*m+g*j*q-d*o*q-h*j*v+d*p*v;c.n31=k*v*C-o*r*C+o*m*x-j*v*x-k*m*K+j*r*K;c.n32=g*r*C-e*v*C-g*m*x+d*v*x+e*m*K-d*r*K;c.n33=h*o*C-g*k*C+g*j*x-d*o*x-e*j*K+d*k*K;c.n34=g*k*m-e*o*m-g*j*r+d*o*r+e*j*v-d*k*v;c.n41=p*r*C-k*q*C-p*m*x+j*q*x+k*m*E-j*r*E;c.n42=e*q*C-h*r*C+h*m*x-d*q*x-e*m*E+d*r*E;c.n43=h*k*C-e*p*C-h*j*x+d*p*x+e*j*E-d*k*E;c.n44=e*p*m-h*k*m+h*j*r-d*p*r-e*j*q+d*k*q;c.multiplyScalar(1/b.determinant());return c};
+THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,d=c.m,e=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,g=b.n32*b.n21-b.n31*b.n22,j=-b.n33*b.n12+b.n32*b.n13,k=b.n33*b.n11-b.n31*b.n13,p=-b.n32*b.n11+b.n31*b.n12,o=b.n23*b.n12-b.n22*b.n13,m=-b.n23*b.n11+b.n21*b.n13,r=b.n22*b.n11-b.n21*b.n12,b=b.n11*e+b.n21*j+b.n31*o;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;d[0]=b*e;d[1]=b*h;d[2]=b*g;d[3]=b*j;d[4]=b*k;d[5]=b*p;d[6]=b*o;d[7]=b*m;d[8]=b*r;return c};
 THREE.Matrix4.makeFrustum=function(b,c,d,e,h,g){var j;j=new THREE.Matrix4;j.n11=2*h/(c-b);j.n12=0;j.n13=(c+b)/(c-b);j.n14=0;j.n21=0;j.n22=2*h/(e-d);j.n23=(e+d)/(e-d);j.n24=0;j.n31=0;j.n32=0;j.n33=-(g+h)/(g-h);j.n34=-2*g*h/(g-h);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};THREE.Matrix4.makePerspective=function(b,c,d,e){var h,b=d*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,d,e)};
 THREE.Matrix4.makeFrustum=function(b,c,d,e,h,g){var j;j=new THREE.Matrix4;j.n11=2*h/(c-b);j.n12=0;j.n13=(c+b)/(c-b);j.n14=0;j.n21=0;j.n22=2*h/(e-d);j.n23=(e+d)/(e-d);j.n24=0;j.n31=0;j.n32=0;j.n33=-(g+h)/(g-h);j.n34=-2*g*h/(g-h);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};THREE.Matrix4.makePerspective=function(b,c,d,e){var h,b=d*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,d,e)};
-THREE.Matrix4.makeOrtho=function(b,c,d,e,h,g){var j,k,o,m;j=new THREE.Matrix4;k=c-b;o=d-e;m=g-h;j.n11=2/k;j.n12=0;j.n13=0;j.n14=-((c+b)/k);j.n21=0;j.n22=2/o;j.n23=0;j.n24=-((d+e)/o);j.n31=0;j.n32=0;j.n33=-2/m;j.n34=-((g+h)/m);j.n41=0;j.n42=0;j.n43=0;j.n44=1;return j};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
+THREE.Matrix4.makeOrtho=function(b,c,d,e,h,g){var j,k,p,o;j=new THREE.Matrix4;k=c-b;p=d-e;o=g-h;j.n11=2/k;j.n12=0;j.n13=0;j.n14=-((c+b)/k);j.n21=0;j.n22=2/p;j.n23=0;j.n24=-((d+e)/p);j.n31=0;j.n32=0;j.n33=-2/o;j.n34=-((g+h)/o);j.n41=0;j.n42=0;j.n43=0;j.n44=1;return j};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;
 THREE.Object3D=function(){this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;
 this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this._vector=new THREE.Vector3;this.name=""};
 this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this._vector=new THREE.Vector3;this.name=""};
 THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(b){if(this.children.indexOf(b)===
 THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(b){if(this.children.indexOf(b)===
@@ -55,37 +55,38 @@ this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matri
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,d,e){this.x=b;this.y=c;this.z=d;this.w=e;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=0.5*Math.PI/360,d=b.x*c,e=b.y*c,h=b.z*c,b=Math.cos(e),e=Math.sin(e),c=Math.cos(-h),h=Math.sin(-h),g=Math.cos(d),d=Math.sin(d),j=b*c,k=e*h;this.w=j*g-k*d;this.x=j*d+k*g;this.y=e*c*g+b*h*d;this.z=b*h*g-e*c*d;return this},setFromAxisAngle:function(b,c){var d=c/2,e=Math.sin(d);
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,d,e){this.x=b;this.y=c;this.z=d;this.w=e;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=0.5*Math.PI/360,d=b.x*c,e=b.y*c,h=b.z*c,b=Math.cos(e),e=Math.sin(e),c=Math.cos(-h),h=Math.sin(-h),g=Math.cos(d),d=Math.sin(d),j=b*c,k=e*h;this.w=j*g-k*d;this.x=j*d+k*g;this.y=e*c*g+b*h*d;this.z=b*h*g-e*c*d;return this},setFromAxisAngle:function(b,c){var d=c/2,e=Math.sin(d);
 this.x=b.x*e;this.y=b.y*e;this.z=b.z*e;this.w=Math.cos(d);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.x=b.x*e;this.y=b.y*e;this.z=b.z*e;this.w=Math.cos(d);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c=
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c=
-this.x,d=this.y,e=this.z,h=this.w,g=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+h*g+d*k-e*j;this.y=d*b+h*j+e*g-c*k;this.z=e*b+h*k+c*j-d*g;this.w=h*b-c*g-d*j-e*k;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var d=b.x,e=b.y,h=b.z,g=this.x,j=this.y,k=this.z,o=this.w,m=o*d+j*h-k*e,p=o*e+k*d-g*h,r=o*h+g*e-j*d,d=-g*
-d-j*e-k*h;c.x=m*o+d*-g+p*-k-r*-j;c.y=p*o+d*-j+r*-g-m*-k;c.z=r*o+d*-k+m*-j-p*-g;return c}};THREE.Quaternion.slerp=function(b,c,d,e){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return d.w=b.w,d.x=b.x,d.y=b.y,d.z=b.z,d;var g=Math.acos(h),j=Math.sqrt(1-h*h);if(Math.abs(j)<0.0010)return d.w=0.5*(b.w+c.w),d.x=0.5*(b.x+c.x),d.y=0.5*(b.y+c.y),d.z=0.5*(b.z+c.z),d;h=Math.sin((1-e)*g)/j;e=Math.sin(e*g)/j;d.w=b.w*h+c.w*e;d.x=b.x*h+c.x*e;d.y=b.y*h+c.y*e;d.z=b.z*h+c.z*e;return d};
+this.x,d=this.y,e=this.z,h=this.w,g=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+h*g+d*k-e*j;this.y=d*b+h*j+e*g-c*k;this.z=e*b+h*k+c*j-d*g;this.w=h*b-c*g-d*j-e*k;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var d=b.x,e=b.y,h=b.z,g=this.x,j=this.y,k=this.z,p=this.w,o=p*d+j*h-k*e,m=p*e+k*d-g*h,r=p*h+g*e-j*d,d=-g*
+d-j*e-k*h;c.x=o*p+d*-g+m*-k-r*-j;c.y=m*p+d*-j+r*-g-o*-k;c.z=r*p+d*-k+o*-j-m*-g;return c}};THREE.Quaternion.slerp=function(b,c,d,e){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return d.w=b.w,d.x=b.x,d.y=b.y,d.z=b.z,d;var g=Math.acos(h),j=Math.sqrt(1-h*h);if(Math.abs(j)<0.0010)return d.w=0.5*(b.w+c.w),d.x=0.5*(b.x+c.x),d.y=0.5*(b.y+c.y),d.z=0.5*(b.z+c.z),d;h=Math.sin((1-e)*g)/j;e=Math.sin(e*g)/j;d.w=b.w*h+c.w*e;d.x=b.x*h+c.x*e;d.y=b.y*h+c.y*e;d.z=b.z*h+c.z*e;return d};
 THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,d,e,h,g){this.a=b;this.b=c;this.c=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,d,e,h,g){this.a=b;this.b=c;this.c=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
-THREE.Face4=function(b,c,d,e,h,g,j){this.a=b;this.b=c;this.c=d;this.d=e;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.set(b||0,c||0)};
-THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.set(b.u,b.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
+THREE.Face4=function(b,c,d,e,h,g,j){this.a=b;this.b=c;this.c=d;this.d=e;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0};
+THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
+THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
 THREE.Geometry.prototype={constructor:THREE.Geometry,computeCentroids:function(){var b,c,d;b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d.centroid.set(0,0,0),d instanceof THREE.Face3?(d.centroid.addSelf(this.vertices[d.a].position),d.centroid.addSelf(this.vertices[d.b].position),d.centroid.addSelf(this.vertices[d.c].position),d.centroid.divideScalar(3)):d instanceof THREE.Face4&&(d.centroid.addSelf(this.vertices[d.a].position),d.centroid.addSelf(this.vertices[d.b].position),d.centroid.addSelf(this.vertices[d.c].position),
 THREE.Geometry.prototype={constructor:THREE.Geometry,computeCentroids:function(){var b,c,d;b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d.centroid.set(0,0,0),d instanceof THREE.Face3?(d.centroid.addSelf(this.vertices[d.a].position),d.centroid.addSelf(this.vertices[d.b].position),d.centroid.addSelf(this.vertices[d.c].position),d.centroid.divideScalar(3)):d instanceof THREE.Face4&&(d.centroid.addSelf(this.vertices[d.a].position),d.centroid.addSelf(this.vertices[d.b].position),d.centroid.addSelf(this.vertices[d.c].position),
-d.centroid.addSelf(this.vertices[d.d].position),d.centroid.divideScalar(4))},computeFaceNormals:function(b){var c,d,e,h,g,j,k=new THREE.Vector3,o=new THREE.Vector3;e=0;for(h=this.faces.length;e<h;e++){g=this.faces[e];if(b&&g.vertexNormals.length){k.set(0,0,0);c=0;for(d=g.vertexNormals.length;c<d;c++)k.addSelf(g.vertexNormals[c]);k.divideScalar(3)}else c=this.vertices[g.a],d=this.vertices[g.b],j=this.vertices[g.c],k.sub(j.position,d.position),o.sub(c.position,d.position),k.crossSelf(o);k.isZero()||
+d.centroid.addSelf(this.vertices[d.d].position),d.centroid.divideScalar(4))},computeFaceNormals:function(b){var c,d,e,h,g,j,k=new THREE.Vector3,p=new THREE.Vector3;e=0;for(h=this.faces.length;e<h;e++){g=this.faces[e];if(b&&g.vertexNormals.length){k.set(0,0,0);c=0;for(d=g.vertexNormals.length;c<d;c++)k.addSelf(g.vertexNormals[c]);k.divideScalar(3)}else c=this.vertices[g.a],d=this.vertices[g.b],j=this.vertices[g.c],k.sub(j.position,d.position),p.sub(c.position,d.position),k.crossSelf(p);k.isZero()||
 k.normalize();g.normal.copy(k)}},computeVertexNormals:function(){var b,c,d,e;if(this.__tmpVertices==void 0){e=this.__tmpVertices=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)e[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)if(d=this.faces[b],d instanceof THREE.Face3)d.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(d instanceof THREE.Face4)d.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{e=
 k.normalize();g.normal.copy(k)}},computeVertexNormals:function(){var b,c,d,e;if(this.__tmpVertices==void 0){e=this.__tmpVertices=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)e[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)if(d=this.faces[b],d instanceof THREE.Face3)d.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(d instanceof THREE.Face4)d.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{e=
 this.__tmpVertices;b=0;for(c=this.vertices.length;b<c;b++)e[b].set(0,0,0)}b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d instanceof THREE.Face3?(e[d.a].addSelf(d.normal),e[d.b].addSelf(d.normal),e[d.c].addSelf(d.normal)):d instanceof THREE.Face4&&(e[d.a].addSelf(d.normal),e[d.b].addSelf(d.normal),e[d.c].addSelf(d.normal),e[d.d].addSelf(d.normal));b=0;for(c=this.vertices.length;b<c;b++)e[b].normalize();b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d instanceof THREE.Face3?(d.vertexNormals[0].copy(e[d.a]),
 this.__tmpVertices;b=0;for(c=this.vertices.length;b<c;b++)e[b].set(0,0,0)}b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d instanceof THREE.Face3?(e[d.a].addSelf(d.normal),e[d.b].addSelf(d.normal),e[d.c].addSelf(d.normal)):d instanceof THREE.Face4&&(e[d.a].addSelf(d.normal),e[d.b].addSelf(d.normal),e[d.c].addSelf(d.normal),e[d.d].addSelf(d.normal));b=0;for(c=this.vertices.length;b<c;b++)e[b].normalize();b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d instanceof THREE.Face3?(d.vertexNormals[0].copy(e[d.a]),
-d.vertexNormals[1].copy(e[d.b]),d.vertexNormals[2].copy(e[d.c])):d instanceof THREE.Face4&&(d.vertexNormals[0].copy(e[d.a]),d.vertexNormals[1].copy(e[d.b]),d.vertexNormals[2].copy(e[d.c]),d.vertexNormals[3].copy(e[d.d]))},computeTangents:function(){function b(b,f,c,d,e,h,g){k=b.vertices[f].position;o=b.vertices[c].position;m=b.vertices[d].position;p=j[e];r=j[h];q=j[g];v=o.x-k.x;C=m.x-k.x;x=o.y-k.y;E=m.y-k.y;K=o.z-k.z;ya=m.z-k.z;za=r.u-p.u;ta=q.u-p.u;U=r.v-p.v;t=q.v-p.v;Y=1/(za*t-ta*U);ha.set((t*v-
-U*C)*Y,(t*x-U*E)*Y,(t*K-U*ya)*Y);qa.set((za*C-ta*v)*Y,(za*E-ta*x)*Y,(za*ya-ta*K)*Y);P[f].addSelf(ha);P[c].addSelf(ha);P[d].addSelf(ha);Q[f].addSelf(qa);Q[c].addSelf(qa);Q[d].addSelf(qa)}var c,d,e,h,g,j,k,o,m,p,r,q,v,C,x,E,K,ya,za,ta,U,t,Y,L,P=[],Q=[],ha=new THREE.Vector3,qa=new THREE.Vector3,S=new THREE.Vector3,J=new THREE.Vector3,f=new THREE.Vector3;c=0;for(d=this.vertices.length;c<d;c++)P[c]=new THREE.Vector3,Q[c]=new THREE.Vector3;c=0;for(d=this.faces.length;c<d;c++)g=this.faces[c],j=this.faceVertexUvs[0][c],
+d.vertexNormals[1].copy(e[d.b]),d.vertexNormals[2].copy(e[d.c])):d instanceof THREE.Face4&&(d.vertexNormals[0].copy(e[d.a]),d.vertexNormals[1].copy(e[d.b]),d.vertexNormals[2].copy(e[d.c]),d.vertexNormals[3].copy(e[d.d]))},computeTangents:function(){function b(b,f,c,d,e,h,g){k=b.vertices[f].position;p=b.vertices[c].position;o=b.vertices[d].position;m=j[e];r=j[h];q=j[g];v=p.x-k.x;C=o.x-k.x;x=p.y-k.y;E=o.y-k.y;K=p.z-k.z;ya=o.z-k.z;za=r.u-m.u;ta=q.u-m.u;U=r.v-m.v;t=q.v-m.v;Y=1/(za*t-ta*U);ha.set((t*v-
+U*C)*Y,(t*x-U*E)*Y,(t*K-U*ya)*Y);qa.set((za*C-ta*v)*Y,(za*E-ta*x)*Y,(za*ya-ta*K)*Y);P[f].addSelf(ha);P[c].addSelf(ha);P[d].addSelf(ha);Q[f].addSelf(qa);Q[c].addSelf(qa);Q[d].addSelf(qa)}var c,d,e,h,g,j,k,p,o,m,r,q,v,C,x,E,K,ya,za,ta,U,t,Y,L,P=[],Q=[],ha=new THREE.Vector3,qa=new THREE.Vector3,S=new THREE.Vector3,J=new THREE.Vector3,f=new THREE.Vector3;c=0;for(d=this.vertices.length;c<d;c++)P[c]=new THREE.Vector3,Q[c]=new THREE.Vector3;c=0;for(d=this.faces.length;c<d;c++)g=this.faces[c],j=this.faceVertexUvs[0][c],
 g instanceof THREE.Face3?b(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(b(this,g.a,g.b,g.c,0,1,2),b(this,g.a,g.b,g.d,0,1,3));var Ba=["a","b","c","d"];c=0;for(d=this.faces.length;c<d;c++){g=this.faces[c];for(e=0;e<g.vertexNormals.length;e++)f.copy(g.vertexNormals[e]),h=g[Ba[e]],L=P[h],S.copy(L),S.subSelf(f.multiplyScalar(f.dot(L))).normalize(),J.cross(g.vertexNormals[e],L),h=J.dot(Q[h]),h=h<0?-1:1,g.vertexTangents[e]=new THREE.Vector4(S.x,S.y,S.z,h)}this.hasTangents=!0},computeBoundingBox:function(){var b;
 g instanceof THREE.Face3?b(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(b(this,g.a,g.b,g.c,0,1,2),b(this,g.a,g.b,g.d,0,1,3));var Ba=["a","b","c","d"];c=0;for(d=this.faces.length;c<d;c++){g=this.faces[c];for(e=0;e<g.vertexNormals.length;e++)f.copy(g.vertexNormals[e]),h=g[Ba[e]],L=P[h],S.copy(L),S.subSelf(f.multiplyScalar(f.dot(L))).normalize(),J.cross(g.vertexNormals[e],L),h=J.dot(Q[h]),h=h<0?-1:1,g.vertexTangents[e]=new THREE.Vector4(S.x,S.y,S.z,h)}this.hasTangents=!0},computeBoundingBox:function(){var b;
 if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,d=this.vertices.length;c<d;c++){b=this.vertices[c];if(b.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=b.position.x;else if(b.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=b.position.y;
 if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,d=this.vertices.length;c<d;c++){b=this.vertices[c];if(b.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=b.position.x;else if(b.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=b.position.y;
 else if(b.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=b.position.z;else if(b.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,d=this.vertices.length;c<d;c++)b=Math.max(b,this.vertices[c].position.length());this.boundingSphere={radius:b}},computeEdgeFaces:function(){function b(b,c){return Math.min(b,c)+"_"+Math.max(b,c)}function c(b,c,d){b[c]===
 else if(b.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=b.position.z;else if(b.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,d=this.vertices.length;c<d;c++)b=Math.max(b,this.vertices[c].position.length());this.boundingSphere={radius:b}},computeEdgeFaces:function(){function b(b,c){return Math.min(b,c)+"_"+Math.max(b,c)}function c(b,c,d){b[c]===
 void 0?(b[c]={set:{},array:[]},b[c].set[d]=1,b[c].array.push(d)):b[c].set[d]===void 0&&(b[c].set[d]=1,b[c].array.push(d))}var d,e,h,g,j,k={};d=0;for(e=this.faces.length;d<e;d++)j=this.faces[d],j instanceof THREE.Face3?(h=b(j.a,j.b),c(k,h,d),h=b(j.b,j.c),c(k,h,d),h=b(j.a,j.c),c(k,h,d)):j instanceof THREE.Face4&&(h=b(j.b,j.d),c(k,h,d),h=b(j.a,j.b),c(k,h,d),h=b(j.a,j.d),c(k,h,d),h=b(j.b,j.c),c(k,h,d),h=b(j.c,j.d),c(k,h,d));d=0;for(e=this.edges.length;d<e;d++){j=this.edges[d];h=j.vertexIndices[0];g=j.vertexIndices[1];
 void 0?(b[c]={set:{},array:[]},b[c].set[d]=1,b[c].array.push(d)):b[c].set[d]===void 0&&(b[c].set[d]=1,b[c].array.push(d))}var d,e,h,g,j,k={};d=0;for(e=this.faces.length;d<e;d++)j=this.faces[d],j instanceof THREE.Face3?(h=b(j.a,j.b),c(k,h,d),h=b(j.b,j.c),c(k,h,d),h=b(j.a,j.c),c(k,h,d)):j instanceof THREE.Face4&&(h=b(j.b,j.d),c(k,h,d),h=b(j.a,j.b),c(k,h,d),h=b(j.a,j.d),c(k,h,d),h=b(j.b,j.c),c(k,h,d),h=b(j.c,j.d),c(k,h,d));d=0;for(e=this.edges.length;d<e;d++){j=this.edges[d];h=j.vertexIndices[0];g=j.vertexIndices[1];
 j.faceIndices=k[b(h,g)].array;for(h=0;h<j.faceIndices.length;h++)g=j.faceIndices[h],j.faces.push(this.faces[g])}}};THREE.GeometryIdCounter=0;
 j.faceIndices=k[b(h,g)].array;for(h=0;h<j.faceIndices.length;h++)g=j.faceIndices[h],j.faces.push(this.faces[g])}}};THREE.GeometryIdCounter=0;
-THREE.Spline=function(b){function c(b,c,d,e,h,g,j){b=(d-b)*0.5;e=(e-c)*0.5;return(2*(c-d)+b+e)*j+(-3*(c-d)-2*b-e)*g+b*h+c}this.points=b;var d=[],e={x:0,y:0,z:0},h,g,j,k,o,m,p,r,q;this.initFromArray=function(b){this.points=[];for(var c=0;c<b.length;c++)this.points[c]={x:b[c][0],y:b[c][1],z:b[c][2]}};this.getPoint=function(b){h=(this.points.length-1)*b;g=Math.floor(h);j=h-g;d[0]=g==0?g:g-1;d[1]=g;d[2]=g>this.points.length-2?g:g+1;d[3]=g>this.points.length-3?g:g+2;m=this.points[d[0]];p=this.points[d[1]];
-r=this.points[d[2]];q=this.points[d[3]];k=j*j;o=j*k;e.x=c(m.x,p.x,r.x,q.x,j,k,o);e.y=c(m.y,p.y,r.y,q.y,j,k,o);e.z=c(m.z,p.z,r.z,q.z,j,k,o);return e};this.getControlPointsArray=function(){var b,c,d=this.points.length,e=[];for(b=0;b<d;b++)c=this.points[b],e[b]=[c.x,c.y,c.z];return e};this.getLength=function(b){var c,d,e=c=c=0,h=new THREE.Vector3,g=new THREE.Vector3,j=[],k=0;j[0]=0;b||(b=100);d=this.points.length*b;h.copy(this.points[0]);for(b=1;b<d;b++)c=b/d,position=this.getPoint(c),g.copy(position),
-k+=g.distanceTo(h),h.copy(position),c*=this.points.length-1,c=Math.floor(c),c!=e&&(j[c]=k,e=c);j[j.length]=k;return{chunks:j,total:k}};this.reparametrizeByArcLength=function(b){var c,d,e,h,g,j,k=[],m=new THREE.Vector3,o=this.getLength();k.push(m.copy(this.points[0]).clone());for(c=1;c<this.points.length;c++){d=o.chunks[c]-o.chunks[c-1];j=Math.ceil(b*d/o.total);h=(c-1)/(this.points.length-1);g=c/(this.points.length-1);for(d=1;d<j-1;d++)e=h+d*(1/j)*(g-h),position=this.getPoint(e),k.push(m.copy(position).clone());
-k.push(m.copy(this.points[c]).clone())}this.points=k}};THREE.Edge=function(b,c,d,e){this.vertices=[b,c];this.vertexIndices=[d,e];this.faces=[];this.faceIndices=[]};THREE.Camera=function(b,c,d,e,h){THREE.Object3D.call(this);this.fov=b||50;this.aspect=c||1;this.near=d||0.1;this.far=e||2E3;this.target=h||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;
+THREE.Spline=function(b){function c(b,c,d,e,h,g,j){b=(d-b)*0.5;e=(e-c)*0.5;return(2*(c-d)+b+e)*j+(-3*(c-d)-2*b-e)*g+b*h+c}this.points=b;var d=[],e={x:0,y:0,z:0},h,g,j,k,p,o,m,r,q;this.initFromArray=function(b){this.points=[];for(var c=0;c<b.length;c++)this.points[c]={x:b[c][0],y:b[c][1],z:b[c][2]}};this.getPoint=function(b){h=(this.points.length-1)*b;g=Math.floor(h);j=h-g;d[0]=g==0?g:g-1;d[1]=g;d[2]=g>this.points.length-2?g:g+1;d[3]=g>this.points.length-3?g:g+2;o=this.points[d[0]];m=this.points[d[1]];
+r=this.points[d[2]];q=this.points[d[3]];k=j*j;p=j*k;e.x=c(o.x,m.x,r.x,q.x,j,k,p);e.y=c(o.y,m.y,r.y,q.y,j,k,p);e.z=c(o.z,m.z,r.z,q.z,j,k,p);return e};this.getControlPointsArray=function(){var b,c,d=this.points.length,e=[];for(b=0;b<d;b++)c=this.points[b],e[b]=[c.x,c.y,c.z];return e};this.getLength=function(b){var c,d,e=c=c=0,h=new THREE.Vector3,g=new THREE.Vector3,j=[],k=0;j[0]=0;b||(b=100);d=this.points.length*b;h.copy(this.points[0]);for(b=1;b<d;b++)c=b/d,position=this.getPoint(c),g.copy(position),
+k+=g.distanceTo(h),h.copy(position),c*=this.points.length-1,c=Math.floor(c),c!=e&&(j[c]=k,e=c);j[j.length]=k;return{chunks:j,total:k}};this.reparametrizeByArcLength=function(b){var c,d,e,h,g,j,k=[],o=new THREE.Vector3,p=this.getLength();k.push(o.copy(this.points[0]).clone());for(c=1;c<this.points.length;c++){d=p.chunks[c]-p.chunks[c-1];j=Math.ceil(b*d/p.total);h=(c-1)/(this.points.length-1);g=c/(this.points.length-1);for(d=1;d<j-1;d++)e=h+d*(1/j)*(g-h),position=this.getPoint(e),k.push(o.copy(position).clone());
+k.push(o.copy(this.points[c]).clone())}this.points=k}};THREE.Edge=function(b,c,d,e){this.vertices=[b,c];this.vertexIndices=[d,e];this.faces=[];this.faceIndices=[]};THREE.Camera=function(b,c,d,e,h){THREE.Object3D.call(this);this.fov=b||50;this.aspect=c||1;this.near=d||0.1;this.far=e||2E3;this.target=h||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;
 THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);c.multiplyScalar(b);this.position.addSelf(c);this.target.position.addSelf(c)};
 THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);c.multiplyScalar(b);this.position.addSelf(c);this.target.position.addSelf(c)};
 THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var b=this.fullWidth/this.fullHeight,c=Math.tan(this.fov*Math.PI/360)*this.near,d=-c,e=b*d,b=Math.abs(b*c-e),d=Math.abs(c-d);this.projectionMatrix=THREE.Matrix4.makeFrustum(e+this.x*b/this.fullWidth,e+(this.x+this.width)*b/this.fullWidth,c-(this.y+this.height)*d/this.fullHeight,c-this.y*d/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var b=this.fullWidth/this.fullHeight,c=Math.tan(this.fov*Math.PI/360)*this.near,d=-c,e=b*d,b=Math.abs(b*c-e),d=Math.abs(c-d);this.projectionMatrix=THREE.Matrix4.makeFrustum(e+this.x*b/this.fullWidth,e+(this.x+this.width)*b/this.fullWidth,c-(this.y+this.height)*d/this.fullHeight,c-this.y*d/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.Camera.prototype.setViewOffset=function(b,c,d,e,h,g){this.fullWidth=b;this.fullHeight=c;this.x=d;this.y=e;this.width=h;this.height=g;this.updateProjectionMatrix()};
 THREE.Camera.prototype.setViewOffset=function(b,c,d,e,h,g){this.fullWidth=b;this.fullHeight=c;this.x=d;this.y=e;this.width=h;this.height=g;this.updateProjectionMatrix()};
 THREE.Camera.prototype.update=function(b,c,d){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),c=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
 THREE.Camera.prototype.update=function(b,c,d){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),c=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
-!1,c=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,d)};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;
+!1,c=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,d)};THREE.OrthoCamera=function(b,c,d,e,h,g,j){THREE.Camera.call(this,45,1,h,g,j);this.left=b;this.right=c;this.top=d;this.bottom=e;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
+THREE.OrthoCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(b,c,d,e){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.intensity=c||1;this.distance=d||0;this.castShadow=e!==void 0?e:!1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(b,c,d){THREE.Light.call(this,b);this.position=new THREE.Vector3;this.intensity=c||1;this.distance=d||0};
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(b,c,d,e){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.intensity=c||1;this.distance=d||0;this.castShadow=e!==void 0?e:!1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(b,c,d){THREE.Light.call(this,b);this.position=new THREE.Vector3;this.intensity=c||1;this.distance=d||0};
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.SpotLight=function(b,c,d,e){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=c||1;this.distance=d||0;this.castShadow=e!==void 0?e:!1};THREE.SpotLight.prototype=new THREE.Light;THREE.SpotLight.prototype.constructor=THREE.SpotLight;
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.SpotLight=function(b,c,d,e){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=c||1;this.distance=d||0;this.castShadow=e!==void 0?e:!1};THREE.SpotLight.prototype=new THREE.Light;THREE.SpotLight.prototype.constructor=THREE.SpotLight;
 THREE.Material=function(b){this.id=THREE.MaterialCount++;b=b||{};this.opacity=b.opacity!==void 0?b.opacity:1;this.transparent=b.transparent!==void 0?b.transparent:!1;this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.depthTest=b.depthTest!==void 0?b.depthTest:!0;this.polygonOffset=b.polygonOffset!==void 0?b.polygonOffset:!1;this.polygonOffsetFactor=b.polygonOffsetFactor!==void 0?b.polygonOffsetFactor:0;this.polygonOffsetUnits=b.polygonOffsetUnits!==void 0?b.polygonOffsetUnits:
 THREE.Material=function(b){this.id=THREE.MaterialCount++;b=b||{};this.opacity=b.opacity!==void 0?b.opacity:1;this.transparent=b.transparent!==void 0?b.transparent:!1;this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.depthTest=b.depthTest!==void 0?b.depthTest:!0;this.polygonOffset=b.polygonOffset!==void 0?b.polygonOffset:!1;this.polygonOffsetFactor=b.polygonOffsetFactor!==void 0?b.polygonOffsetFactor:0;this.polygonOffsetUnits=b.polygonOffsetUnits!==void 0?b.polygonOffsetUnits:
-0;this.alphaTest=b.alphaTest!==void 0?b.alphaTest:0};THREE.MaterialCount=0;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.AdditiveAlphaBlending=4;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
-THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.LineBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.linewidth=b.linewidth!==void 0?b.linewidth:1;this.linecap=b.linecap!==void 0?b.linecap:"round";this.linejoin=b.linejoin!==void 0?b.linejoin:"round";this.vertexColors=b.vertexColors?b.vertexColors:!1};
-THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
+0;this.alphaTest=b.alphaTest!==void 0?b.alphaTest:0};THREE.MaterialCount=0;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.AdditiveAlphaBlending=4;
+THREE.LineBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.linewidth=b.linewidth!==void 0?b.linewidth:1;this.linecap=b.linecap!==void 0?b.linecap:"round";this.linejoin=b.linejoin!==void 0?b.linejoin:"round";this.vertexColors=b.vertexColors?b.vertexColors:!1};THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
 THREE.MeshBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.lightMap=b.lightMap!==void 0?b.lightMap:null;this.envMap=b.envMap!==void 0?b.envMap:null;this.combine=b.combine!==void 0?b.combine:THREE.MultiplyOperation;this.reflectivity=b.reflectivity!==void 0?b.reflectivity:1;this.refractionRatio=b.refractionRatio!==void 0?b.refractionRatio:0.98;this.shading=b.shading!==
 THREE.MeshBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.lightMap=b.lightMap!==void 0?b.lightMap:null;this.envMap=b.envMap!==void 0?b.envMap:null;this.combine=b.combine!==void 0?b.combine:THREE.MultiplyOperation;this.reflectivity=b.reflectivity!==void 0?b.reflectivity:1;this.refractionRatio=b.refractionRatio!==void 0?b.refractionRatio:0.98;this.shading=b.shading!==
 void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.wireframeLinecap=b.wireframeLinecap!==void 0?b.wireframeLinecap:"round";this.wireframeLinejoin=b.wireframeLinejoin!==void 0?b.wireframeLinejoin:"round";this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};
 void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.wireframeLinecap=b.wireframeLinecap!==void 0?b.wireframeLinecap:"round";this.wireframeLinejoin=b.wireframeLinejoin!==void 0?b.wireframeLinejoin:"round";this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};
 THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
 THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
@@ -101,10 +102,10 @@ THREE.MeshShaderMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.fr
 b.fog!==void 0?b.fog:!1;this.lights=b.lights!==void 0?b.lights:!1;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};THREE.MeshShaderMaterial.prototype=new THREE.Material;THREE.MeshShaderMaterial.prototype.constructor=THREE.MeshShaderMaterial;
 b.fog!==void 0?b.fog:!1;this.lights=b.lights!==void 0?b.lights:!1;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};THREE.MeshShaderMaterial.prototype=new THREE.Material;THREE.MeshShaderMaterial.prototype.constructor=THREE.MeshShaderMaterial;
 THREE.ParticleBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.size=b.size!==void 0?b.size:1;this.sizeAttenuation=b.sizeAttenuation!==void 0?b.sizeAttenuation:!0;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
 THREE.ParticleBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.size=b.size!==void 0?b.size:1;this.sizeAttenuation=b.sizeAttenuation!==void 0?b.sizeAttenuation:!0;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
 THREE.Texture=function(b,c,d,e,h,g){this.id=THREE.TextureCount++;this.image=b;this.mapping=c!==void 0?c:new THREE.UVMapping;this.wrapS=d!==void 0?d:THREE.ClampToEdgeWrapping;this.wrapT=e!==void 0?e:THREE.ClampToEdgeWrapping;this.magFilter=h!==void 0?h:THREE.LinearFilter;this.minFilter=g!==void 0?g:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
 THREE.Texture=function(b,c,d,e,h,g){this.id=THREE.TextureCount++;this.image=b;this.mapping=c!==void 0?c:new THREE.UVMapping;this.wrapS=d!==void 0?d:THREE.ClampToEdgeWrapping;this.wrapT=e!==void 0?e:THREE.ClampToEdgeWrapping;this.magFilter=h!==void 0?h:THREE.LinearFilter;this.minFilter=g!==void 0?g:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
-THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var b=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;
-THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.Particle=function(b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b]};THREE.Particle.prototype=new THREE.Object3D;
-THREE.Particle.prototype.constructor=THREE.Particle;THREE.ParticleSystem=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(b,c,d){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.type=d!=void 0?d:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;
-THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
+THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var b=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
+THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;
+THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.Particle=function(b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;THREE.ParticleSystem=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.sortParticles=!1};
+THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(b,c,d){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.type=d!=void 0?d:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
 THREE.Mesh=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c&&c.length?c:[c];this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=b.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var d=0;d<this.geometry.morphTargets.length;d++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[d].name]=
 THREE.Mesh=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c&&c.length?c:[c];this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=b.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var d=0;d<this.geometry.morphTargets.length;d++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[d].name]=
 d}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(b){if(this.morphTargetDictionary[b]!==void 0)return this.morphTargetDictionary[b];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+b+" does not exist. Returning 0.");return 0};
 d}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(b){if(this.morphTargetDictionary[b]!==void 0)return this.morphTargetDictionary[b];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+b+" does not exist. Returning 0.");return 0};
 THREE.Bone=function(b){THREE.Object3D.call(this);this.skin=b;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
 THREE.Bone=function(b){THREE.Object3D.call(this);this.skin=b;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
@@ -127,15 +128,15 @@ THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.c
 THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1)this.objects.push(b),this.__objectsAdded.push(b);for(var c=0;c<b.children.length;c++)this.addChildRecurse(b.children[c])};THREE.Scene.prototype.removeChild=function(b){this.supr.removeChild.call(this,b);this.removeChildRecurse(b)};
 THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1)this.objects.push(b),this.__objectsAdded.push(b);for(var c=0;c<b.children.length;c++)this.addChildRecurse(b.children[c])};THREE.Scene.prototype.removeChild=function(b){this.supr.removeChild.call(this,b);this.removeChildRecurse(b)};
 THREE.Scene.prototype.removeChildRecurse=function(b){if(b instanceof THREE.Light){var c=this.lights.indexOf(b);c!==-1&&this.lights.splice(c,1)}else b instanceof THREE.Camera||(c=this.objects.indexOf(b),c!==-1&&(this.objects.splice(c,1),this.__objectsRemoved.push(b)));for(c=0;c<b.children.length;c++)this.removeChildRecurse(b.children[c])};THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;
 THREE.Scene.prototype.removeChildRecurse=function(b){if(b instanceof THREE.Light){var c=this.lights.indexOf(b);c!==-1&&this.lights.splice(c,1)}else b instanceof THREE.Camera||(c=this.objects.indexOf(b),c!==-1&&(this.objects.splice(c,1),this.__objectsRemoved.push(b)));for(c=0;c<b.children.length;c++)this.removeChildRecurse(b.children[c])};THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;
 THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(b,c,d){this.color=new THREE.Color(b);this.near=c||1;this.far=d||1E3};THREE.FogExp2=function(b,c){this.color=new THREE.Color(b);this.density=c!==void 0?c:2.5E-4};
 THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(b,c,d){this.color=new THREE.Color(b);this.near=c||1;this.far=d||1E3};THREE.FogExp2=function(b,c){this.color=new THREE.Color(b);this.density=c!==void 0?c:2.5E-4};
-THREE.Projector=function(){function b(){var b=o[k]=o[k]||new THREE.RenderableVertex;k++;return b}function c(b,c){return c.z-b.z}function d(b,c){var d=0,e=1,f=b.z+b.w,h=c.z+c.w,g=-b.z+b.w,j=-c.z+c.w;return f>=0&&h>=0&&g>=0&&j>=0?!0:f<0&&h<0||g<0&&j<0?!1:(f<0?d=Math.max(d,f/(f-h)):h<0&&(e=Math.min(e,f/(f-h))),g<0?d=Math.max(d,g/(g-j)):j<0&&(e=Math.min(e,g/(g-j))),e<d?!1:(b.lerpSelf(c,d),c.lerpSelf(b,1-e),!0))}var e,h,g=[],j,k,o=[],m,p,r=[],q,v=[],C,x,E=[],K,ya,za=[],ta=new THREE.Vector4,U=new THREE.Vector4,
-t=new THREE.Matrix4,Y=new THREE.Matrix4,L=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],P=new THREE.Vector4,Q=new THREE.Vector4;this.projectVector=function(b,c){t.multiply(c.projectionMatrix,c.matrixWorldInverse);t.multiplyVector3(b);return b};this.unprojectVector=function(b,c){t.multiply(c.matrixWorld,THREE.Matrix4.makeInvert(c.projectionMatrix));t.multiplyVector3(b);return b};this.projectObjects=function(b,d,j){var d=[],k,f,m;h=0;f=
-b.objects;b=0;for(k=f.length;b<k;b++){m=f[b];var o;if(!(o=!m.visible))if(o=m instanceof THREE.Mesh){a:{o=void 0;for(var p=m.matrixWorld,r=-m.geometry.boundingSphere.radius*Math.max(m.scale.x,Math.max(m.scale.y,m.scale.z)),q=0;q<6;q++)if(o=L[q].x*p.n14+L[q].y*p.n24+L[q].z*p.n34+L[q].w,o<=r){o=!1;break a}o=!0}o=!o}if(!o)o=g[h]=g[h]||new THREE.RenderableObject,h++,e=o,ta.copy(m.position),t.multiplyVector3(ta),e.object=m,e.z=ta.z,d.push(e)}j&&d.sort(c);return d};this.projectScene=function(e,h,g){var J=
-[],f=h.near,ta=h.far,ra,va,T,Z,F,V,N,la,wa,O,Aa,Ia,Fa,xa,ia,Ca,Ea;ya=x=q=p=0;h.matrixAutoUpdate&&h.update(void 0,!0);e.update(void 0,!1,h);t.multiply(h.projectionMatrix,h.matrixWorldInverse);L[0].set(t.n41-t.n11,t.n42-t.n12,t.n43-t.n13,t.n44-t.n14);L[1].set(t.n41+t.n11,t.n42+t.n12,t.n43+t.n13,t.n44+t.n14);L[2].set(t.n41+t.n21,t.n42+t.n22,t.n43+t.n23,t.n44+t.n24);L[3].set(t.n41-t.n21,t.n42-t.n22,t.n43-t.n23,t.n44-t.n24);L[4].set(t.n41-t.n31,t.n42-t.n32,t.n43-t.n33,t.n44-t.n34);L[5].set(t.n41+t.n31,
+THREE.Projector=function(){function b(){var b=p[k]=p[k]||new THREE.RenderableVertex;k++;return b}function c(b,c){return c.z-b.z}function d(b,c){var d=0,e=1,f=b.z+b.w,h=c.z+c.w,g=-b.z+b.w,j=-c.z+c.w;return f>=0&&h>=0&&g>=0&&j>=0?!0:f<0&&h<0||g<0&&j<0?!1:(f<0?d=Math.max(d,f/(f-h)):h<0&&(e=Math.min(e,f/(f-h))),g<0?d=Math.max(d,g/(g-j)):j<0&&(e=Math.min(e,g/(g-j))),e<d?!1:(b.lerpSelf(c,d),c.lerpSelf(b,1-e),!0))}var e,h,g=[],j,k,p=[],o,m,r=[],q,v=[],C,x,E=[],K,ya,za=[],ta=new THREE.Vector4,U=new THREE.Vector4,
+t=new THREE.Matrix4,Y=new THREE.Matrix4,L=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],P=new THREE.Vector4,Q=new THREE.Vector4;this.projectVector=function(b,c){t.multiply(c.projectionMatrix,c.matrixWorldInverse);t.multiplyVector3(b);return b};this.unprojectVector=function(b,c){t.multiply(c.matrixWorld,THREE.Matrix4.makeInvert(c.projectionMatrix));t.multiplyVector3(b);return b};this.projectObjects=function(b,d,j){var d=[],k,f,o;h=0;f=
+b.objects;b=0;for(k=f.length;b<k;b++){o=f[b];var p;if(!(p=!o.visible))if(p=o instanceof THREE.Mesh){a:{p=void 0;for(var m=o.matrixWorld,r=-o.geometry.boundingSphere.radius*Math.max(o.scale.x,Math.max(o.scale.y,o.scale.z)),q=0;q<6;q++)if(p=L[q].x*m.n14+L[q].y*m.n24+L[q].z*m.n34+L[q].w,p<=r){p=!1;break a}p=!0}p=!p}if(!p)p=g[h]=g[h]||new THREE.RenderableObject,h++,e=p,ta.copy(o.position),t.multiplyVector3(ta),e.object=o,e.z=ta.z,d.push(e)}j&&d.sort(c);return d};this.projectScene=function(e,h,g){var J=
+[],f=h.near,ta=h.far,ra,va,T,Z,F,V,N,la,wa,O,Aa,Ia,Fa,xa,ia,Ca,Ea;ya=x=q=m=0;h.matrixAutoUpdate&&h.update(void 0,!0);e.update(void 0,!1,h);t.multiply(h.projectionMatrix,h.matrixWorldInverse);L[0].set(t.n41-t.n11,t.n42-t.n12,t.n43-t.n13,t.n44-t.n14);L[1].set(t.n41+t.n11,t.n42+t.n12,t.n43+t.n13,t.n44+t.n14);L[2].set(t.n41+t.n21,t.n42+t.n22,t.n43+t.n23,t.n44+t.n24);L[3].set(t.n41-t.n21,t.n42-t.n22,t.n43-t.n23,t.n44-t.n24);L[4].set(t.n41-t.n31,t.n42-t.n32,t.n43-t.n33,t.n44-t.n34);L[5].set(t.n41+t.n31,
 t.n42+t.n32,t.n43+t.n33,t.n44+t.n34);for(ra=0;ra<6;ra++)wa=L[ra],wa.divideScalar(Math.sqrt(wa.x*wa.x+wa.y*wa.y+wa.z*wa.z));wa=this.projectObjects(e,h,!0);e=0;for(ra=wa.length;e<ra;e++)if(O=wa[e].object,O.visible)if(Aa=O.matrixWorld,Ia=O.matrixRotationWorld,Fa=O.materials,xa=O.overdraw,k=0,O instanceof THREE.Mesh){ia=O.geometry;Z=ia.vertices;Ca=ia.faces;ia=ia.faceVertexUvs;va=0;for(T=Z.length;va<T;va++)j=b(),j.positionWorld.copy(Z[va].position),Aa.multiplyVector3(j.positionWorld),j.positionScreen.copy(j.positionWorld),
 t.n42+t.n32,t.n43+t.n33,t.n44+t.n34);for(ra=0;ra<6;ra++)wa=L[ra],wa.divideScalar(Math.sqrt(wa.x*wa.x+wa.y*wa.y+wa.z*wa.z));wa=this.projectObjects(e,h,!0);e=0;for(ra=wa.length;e<ra;e++)if(O=wa[e].object,O.visible)if(Aa=O.matrixWorld,Ia=O.matrixRotationWorld,Fa=O.materials,xa=O.overdraw,k=0,O instanceof THREE.Mesh){ia=O.geometry;Z=ia.vertices;Ca=ia.faces;ia=ia.faceVertexUvs;va=0;for(T=Z.length;va<T;va++)j=b(),j.positionWorld.copy(Z[va].position),Aa.multiplyVector3(j.positionWorld),j.positionScreen.copy(j.positionWorld),
-t.multiplyVector4(j.positionScreen),j.positionScreen.x/=j.positionScreen.w,j.positionScreen.y/=j.positionScreen.w,j.visible=j.positionScreen.z>f&&j.positionScreen.z<ta;Z=0;for(va=Ca.length;Z<va;Z++){T=Ca[Z];if(T instanceof THREE.Face3)if(F=o[T.a],V=o[T.b],N=o[T.c],F.visible&&V.visible&&N.visible&&(O.doubleSided||O.flipSided!=(N.positionScreen.x-F.positionScreen.x)*(V.positionScreen.y-F.positionScreen.y)-(N.positionScreen.y-F.positionScreen.y)*(V.positionScreen.x-F.positionScreen.x)<0))la=r[p]=r[p]||
-new THREE.RenderableFace3,p++,m=la,m.v1.copy(F),m.v2.copy(V),m.v3.copy(N);else continue;else if(T instanceof THREE.Face4)if(F=o[T.a],V=o[T.b],N=o[T.c],la=o[T.d],F.visible&&V.visible&&N.visible&&la.visible&&(O.doubleSided||O.flipSided!=((la.positionScreen.x-F.positionScreen.x)*(V.positionScreen.y-F.positionScreen.y)-(la.positionScreen.y-F.positionScreen.y)*(V.positionScreen.x-F.positionScreen.x)<0||(V.positionScreen.x-N.positionScreen.x)*(la.positionScreen.y-N.positionScreen.y)-(V.positionScreen.y-
-N.positionScreen.y)*(la.positionScreen.x-N.positionScreen.x)<0)))Ea=v[q]=v[q]||new THREE.RenderableFace4,q++,m=Ea,m.v1.copy(F),m.v2.copy(V),m.v3.copy(N),m.v4.copy(la);else continue;m.normalWorld.copy(T.normal);Ia.multiplyVector3(m.normalWorld);m.centroidWorld.copy(T.centroid);Aa.multiplyVector3(m.centroidWorld);m.centroidScreen.copy(m.centroidWorld);t.multiplyVector3(m.centroidScreen);N=T.vertexNormals;F=0;for(V=N.length;F<V;F++)la=m.vertexNormalsWorld[F],la.copy(N[F]),Ia.multiplyVector3(la);F=0;
-for(V=ia.length;F<V;F++)if(Ea=ia[F][Z]){N=0;for(la=Ea.length;N<la;N++)m.uvs[F][N]=Ea[N]}m.meshMaterials=Fa;m.faceMaterials=T.materials;m.overdraw=xa;m.z=m.centroidScreen.z;J.push(m)}}else if(O instanceof THREE.Line){Y.multiply(t,Aa);Z=O.geometry.vertices;F=b();F.positionScreen.copy(Z[0].position);Y.multiplyVector4(F.positionScreen);va=1;for(T=Z.length;va<T;va++)if(F=b(),F.positionScreen.copy(Z[va].position),Y.multiplyVector4(F.positionScreen),V=o[k-2],P.copy(F.positionScreen),Q.copy(V.positionScreen),
+t.multiplyVector4(j.positionScreen),j.positionScreen.x/=j.positionScreen.w,j.positionScreen.y/=j.positionScreen.w,j.visible=j.positionScreen.z>f&&j.positionScreen.z<ta;Z=0;for(va=Ca.length;Z<va;Z++){T=Ca[Z];if(T instanceof THREE.Face3)if(F=p[T.a],V=p[T.b],N=p[T.c],F.visible&&V.visible&&N.visible&&(O.doubleSided||O.flipSided!=(N.positionScreen.x-F.positionScreen.x)*(V.positionScreen.y-F.positionScreen.y)-(N.positionScreen.y-F.positionScreen.y)*(V.positionScreen.x-F.positionScreen.x)<0))la=r[m]=r[m]||
+new THREE.RenderableFace3,m++,o=la,o.v1.copy(F),o.v2.copy(V),o.v3.copy(N);else continue;else if(T instanceof THREE.Face4)if(F=p[T.a],V=p[T.b],N=p[T.c],la=p[T.d],F.visible&&V.visible&&N.visible&&la.visible&&(O.doubleSided||O.flipSided!=((la.positionScreen.x-F.positionScreen.x)*(V.positionScreen.y-F.positionScreen.y)-(la.positionScreen.y-F.positionScreen.y)*(V.positionScreen.x-F.positionScreen.x)<0||(V.positionScreen.x-N.positionScreen.x)*(la.positionScreen.y-N.positionScreen.y)-(V.positionScreen.y-
+N.positionScreen.y)*(la.positionScreen.x-N.positionScreen.x)<0)))Ea=v[q]=v[q]||new THREE.RenderableFace4,q++,o=Ea,o.v1.copy(F),o.v2.copy(V),o.v3.copy(N),o.v4.copy(la);else continue;o.normalWorld.copy(T.normal);Ia.multiplyVector3(o.normalWorld);o.centroidWorld.copy(T.centroid);Aa.multiplyVector3(o.centroidWorld);o.centroidScreen.copy(o.centroidWorld);t.multiplyVector3(o.centroidScreen);N=T.vertexNormals;F=0;for(V=N.length;F<V;F++)la=o.vertexNormalsWorld[F],la.copy(N[F]),Ia.multiplyVector3(la);F=0;
+for(V=ia.length;F<V;F++)if(Ea=ia[F][Z]){N=0;for(la=Ea.length;N<la;N++)o.uvs[F][N]=Ea[N]}o.meshMaterials=Fa;o.faceMaterials=T.materials;o.overdraw=xa;o.z=o.centroidScreen.z;J.push(o)}}else if(O instanceof THREE.Line){Y.multiply(t,Aa);Z=O.geometry.vertices;F=b();F.positionScreen.copy(Z[0].position);Y.multiplyVector4(F.positionScreen);va=1;for(T=Z.length;va<T;va++)if(F=b(),F.positionScreen.copy(Z[va].position),Y.multiplyVector4(F.positionScreen),V=p[k-2],P.copy(F.positionScreen),Q.copy(V.positionScreen),
 d(P,Q))P.multiplyScalar(1/P.w),Q.multiplyScalar(1/Q.w),Aa=E[x]=E[x]||new THREE.RenderableLine,x++,C=Aa,C.v1.positionScreen.copy(P),C.v2.positionScreen.copy(Q),C.z=Math.max(P.z,Q.z),C.materials=O.materials,J.push(C)}else if(O instanceof THREE.Particle&&(U.set(O.matrixWorld.n14,O.matrixWorld.n24,O.matrixWorld.n34,1),t.multiplyVector4(U),U.z/=U.w,U.z>0&&U.z<1))Aa=za[ya]=za[ya]||new THREE.RenderableParticle,ya++,K=Aa,K.x=U.x/U.w,K.y=U.y/U.w,K.z=U.z,K.rotation=O.rotation.z,K.scale.x=O.scale.x*Math.abs(K.x-
 d(P,Q))P.multiplyScalar(1/P.w),Q.multiplyScalar(1/Q.w),Aa=E[x]=E[x]||new THREE.RenderableLine,x++,C=Aa,C.v1.positionScreen.copy(P),C.v2.positionScreen.copy(Q),C.z=Math.max(P.z,Q.z),C.materials=O.materials,J.push(C)}else if(O instanceof THREE.Particle&&(U.set(O.matrixWorld.n14,O.matrixWorld.n24,O.matrixWorld.n34,1),t.multiplyVector4(U),U.z/=U.w,U.z>0&&U.z<1))Aa=za[ya]=za[ya]||new THREE.RenderableParticle,ya++,K=Aa,K.x=U.x/U.w,K.y=U.y/U.w,K.z=U.z,K.rotation=O.rotation.z,K.scale.x=O.scale.x*Math.abs(K.x-
 (U.x+h.projectionMatrix.n11)/(U.w+h.projectionMatrix.n14)),K.scale.y=O.scale.y*Math.abs(K.y-(U.y+h.projectionMatrix.n22)/(U.w+h.projectionMatrix.n24)),K.materials=O.materials,J.push(K);g&&J.sort(c);return J}};
 (U.x+h.projectionMatrix.n11)/(U.w+h.projectionMatrix.n14)),K.scale.y=O.scale.y*Math.abs(K.y-(U.y+h.projectionMatrix.n22)/(U.w+h.projectionMatrix.n24)),K.materials=O.materials,J.push(K);g&&J.sort(c);return J}};
 THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform int combine;\n#endif",
 THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform int combine;\n#endif",
@@ -173,52 +174,52 @@ THREE.ShaderChunk.lights_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderCh
 "void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",
 "void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",
 THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},depthRGBA:{uniforms:{},fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask  = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}",vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,
 THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},depthRGBA:{uniforms:{},fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask  = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}",vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,
 "void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")}};
 "void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")}};
-THREE.WebGLRenderer=function(b){function c(b,c,d){var e,h,g,j=b.vertices,A=j.length,k=b.colors,R=k.length,B=b.__vertexArray,D=b.__colorArray,m=b.__sortArray,o=b.__dirtyVertices,p=b.__dirtyColors,r=b.__webglCustomAttributes,q,t;if(r)for(q in r)r[q].offset=0;if(d.sortParticles){Ca.multiplySelf(d.matrixWorld);for(e=0;e<A;e++)h=j[e].position,Ja.copy(h),Ca.multiplyVector3(Ja),m[e]=[Ja.z,e];m.sort(function(b,c){return c[0]-b[0]});for(e=0;e<A;e++)h=j[m[e][1]].position,g=e*3,B[g]=h.x,B[g+1]=h.y,B[g+2]=h.z;
-for(e=0;e<R;e++)g=e*3,color=k[m[e][1]],D[g]=color.r,D[g+1]=color.g,D[g+2]=color.b;if(r)for(q in r){e=r[q];k=e.value.length;for(g=0;g<k;g++){index=m[g][1];R=e.offset;if(e.size===1){if(e.boundTo===void 0||e.boundTo==="vertices")e.array[R]=e.value[index]}else{if(e.boundTo===void 0||e.boundTo==="vertices")t=e.value[index];e.size===2?(e.array[R]=t.x,e.array[R+1]=t.y):e.size===3?e.type==="c"?(e.array[R]=t.r,e.array[R+1]=t.g,e.array[R+2]=t.b):(e.array[R]=t.x,e.array[R+1]=t.y,e.array[R+2]=t.z):(e.array[R]=
-t.x,e.array[R+1]=t.y,e.array[R+2]=t.z,e.array[R+3]=t.w)}e.offset+=e.size}}}else{if(o)for(e=0;e<A;e++)h=j[e].position,g=e*3,B[g]=h.x,B[g+1]=h.y,B[g+2]=h.z;if(p)for(e=0;e<R;e++)color=k[e],g=e*3,D[g]=color.r,D[g+1]=color.g,D[g+2]=color.b;if(r)for(q in r)if(e=r[q],e.__original.needsUpdate){k=e.value.length;for(g=0;g<k;g++){R=e.offset;if(e.size===1){if(e.boundTo===void 0||e.boundTo==="vertices")e.array[R]=e.value[g]}else{if(e.boundTo===void 0||e.boundTo==="vertices")t=e.value[g];e.size===2?(e.array[R]=
-t.x,e.array[R+1]=t.y):e.size===3?e.type==="c"?(e.array[R]=t.r,e.array[R+1]=t.g,e.array[R+2]=t.b):(e.array[R]=t.x,e.array[R+1]=t.y,e.array[R+2]=t.z):(e.array[R]=t.x,e.array[R+1]=t.y,e.array[R+2]=t.z,e.array[R+3]=t.w)}e.offset+=e.size}}}if(o||d.sortParticles)f.bindBuffer(f.ARRAY_BUFFER,b.__webglVertexBuffer),f.bufferData(f.ARRAY_BUFFER,B,c);if(p||d.sortParticles)f.bindBuffer(f.ARRAY_BUFFER,b.__webglColorBuffer),f.bufferData(f.ARRAY_BUFFER,D,c);if(r)for(q in r)if(e=r[q],e.__original.needsUpdate||d.sortParticles)f.bindBuffer(f.ARRAY_BUFFER,
+THREE.WebGLRenderer=function(b){function c(b,c,d){var e,h,g,j=b.vertices,A=j.length,k=b.colors,R=k.length,B=b.__vertexArray,D=b.__colorArray,o=b.__sortArray,p=b.__dirtyVertices,m=b.__dirtyColors,r=b.__webglCustomAttributes,q,t;if(r)for(q in r)r[q].offset=0;if(d.sortParticles){Ca.multiplySelf(d.matrixWorld);for(e=0;e<A;e++)h=j[e].position,Ja.copy(h),Ca.multiplyVector3(Ja),o[e]=[Ja.z,e];o.sort(function(b,c){return c[0]-b[0]});for(e=0;e<A;e++)h=j[o[e][1]].position,g=e*3,B[g]=h.x,B[g+1]=h.y,B[g+2]=h.z;
+for(e=0;e<R;e++)g=e*3,color=k[o[e][1]],D[g]=color.r,D[g+1]=color.g,D[g+2]=color.b;if(r)for(q in r){e=r[q];k=e.value.length;for(g=0;g<k;g++){index=o[g][1];R=e.offset;if(e.size===1){if(e.boundTo===void 0||e.boundTo==="vertices")e.array[R]=e.value[index]}else{if(e.boundTo===void 0||e.boundTo==="vertices")t=e.value[index];e.size===2?(e.array[R]=t.x,e.array[R+1]=t.y):e.size===3?e.type==="c"?(e.array[R]=t.r,e.array[R+1]=t.g,e.array[R+2]=t.b):(e.array[R]=t.x,e.array[R+1]=t.y,e.array[R+2]=t.z):(e.array[R]=
+t.x,e.array[R+1]=t.y,e.array[R+2]=t.z,e.array[R+3]=t.w)}e.offset+=e.size}}}else{if(p)for(e=0;e<A;e++)h=j[e].position,g=e*3,B[g]=h.x,B[g+1]=h.y,B[g+2]=h.z;if(m)for(e=0;e<R;e++)color=k[e],g=e*3,D[g]=color.r,D[g+1]=color.g,D[g+2]=color.b;if(r)for(q in r)if(e=r[q],e.__original.needsUpdate){k=e.value.length;for(g=0;g<k;g++){R=e.offset;if(e.size===1){if(e.boundTo===void 0||e.boundTo==="vertices")e.array[R]=e.value[g]}else{if(e.boundTo===void 0||e.boundTo==="vertices")t=e.value[g];e.size===2?(e.array[R]=
+t.x,e.array[R+1]=t.y):e.size===3?e.type==="c"?(e.array[R]=t.r,e.array[R+1]=t.g,e.array[R+2]=t.b):(e.array[R]=t.x,e.array[R+1]=t.y,e.array[R+2]=t.z):(e.array[R]=t.x,e.array[R+1]=t.y,e.array[R+2]=t.z,e.array[R+3]=t.w)}e.offset+=e.size}}}if(p||d.sortParticles)f.bindBuffer(f.ARRAY_BUFFER,b.__webglVertexBuffer),f.bufferData(f.ARRAY_BUFFER,B,c);if(m||d.sortParticles)f.bindBuffer(f.ARRAY_BUFFER,b.__webglColorBuffer),f.bufferData(f.ARRAY_BUFFER,D,c);if(r)for(q in r)if(e=r[q],e.__original.needsUpdate||d.sortParticles)f.bindBuffer(f.ARRAY_BUFFER,
 e.buffer),f.bufferData(f.ARRAY_BUFFER,e.array,c)}function d(b,c,d,e,h){e.program||J.initMaterial(e,c,d,h);if(e.morphTargets&&!h.__webglMorphTargetInfluences){h.__webglMorphTargetInfluences=new Float32Array(J.maxMorphTargets);for(var g=0,j=J.maxMorphTargets;g<j;g++)h.__webglMorphTargetInfluences[g]=0}var g=e.program,j=g.uniforms,A=e.uniforms;g!=ra&&(f.useProgram(g),ra=g);f.uniformMatrix4fv(j.projectionMatrix,!1,Ea);if(d&&(e instanceof THREE.MeshBasicMaterial||e instanceof THREE.MeshLambertMaterial||
 e.buffer),f.bufferData(f.ARRAY_BUFFER,e.array,c)}function d(b,c,d,e,h){e.program||J.initMaterial(e,c,d,h);if(e.morphTargets&&!h.__webglMorphTargetInfluences){h.__webglMorphTargetInfluences=new Float32Array(J.maxMorphTargets);for(var g=0,j=J.maxMorphTargets;g<j;g++)h.__webglMorphTargetInfluences[g]=0}var g=e.program,j=g.uniforms,A=e.uniforms;g!=ra&&(f.useProgram(g),ra=g);f.uniformMatrix4fv(j.projectionMatrix,!1,Ea);if(d&&(e instanceof THREE.MeshBasicMaterial||e instanceof THREE.MeshLambertMaterial||
-e instanceof THREE.MeshPhongMaterial||e instanceof THREE.LineBasicMaterial||e instanceof THREE.ParticleBasicMaterial||e.fog))if(A.fogColor.value=d.color,d instanceof THREE.Fog)A.fogNear.value=d.near,A.fogFar.value=d.far;else if(d instanceof THREE.FogExp2)A.fogDensity.value=d.density;if(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e.lights){var k,m,B,D=0,o=0,p=0,r,t,q,u=Ua,v=u.directional.colors,H=u.directional.positions,C=u.point.colors,z=u.point.positions,x=u.point.distances,
-K=0,E=0,d=m=q=0;for(k=c.length;d<k;d++)if(m=c[d],B=m.color,r=m.position,t=m.intensity,q=m.distance,m instanceof THREE.AmbientLight)D+=B.r,o+=B.g,p+=B.b;else if(m instanceof THREE.DirectionalLight)q=K*3,v[q]=B.r*t,v[q+1]=B.g*t,v[q+2]=B.b*t,H[q]=r.x,H[q+1]=r.y,H[q+2]=r.z,K+=1;else if(m instanceof THREE.SpotLight)q=K*3,v[q]=B.r*t,v[q+1]=B.g*t,v[q+2]=B.b*t,B=1/r.length(),H[q]=r.x*B,H[q+1]=r.y*B,H[q+2]=r.z*B,K+=1;else if(m instanceof THREE.PointLight)m=E*3,C[m]=B.r*t,C[m+1]=B.g*t,C[m+2]=B.b*t,z[m]=r.x,
-z[m+1]=r.y,z[m+2]=r.z,x[E]=q,E+=1;for(d=K*3;d<v.length;d++)v[d]=0;for(d=E*3;d<C.length;d++)C[d]=0;u.point.length=E;u.directional.length=K;u.ambient[0]=D;u.ambient[1]=o;u.ambient[2]=p;c=Ua;A.enableLighting.value=c.directional.length+c.point.length;A.ambientLightColor.value=c.ambient;A.directionalLightColor.value=c.directional.colors;A.directionalLightDirection.value=c.directional.positions;A.pointLightColor.value=c.point.colors;A.pointLightPosition.value=c.point.positions;A.pointLightDistance.value=
+e instanceof THREE.MeshPhongMaterial||e instanceof THREE.LineBasicMaterial||e instanceof THREE.ParticleBasicMaterial||e.fog))if(A.fogColor.value=d.color,d instanceof THREE.Fog)A.fogNear.value=d.near,A.fogFar.value=d.far;else if(d instanceof THREE.FogExp2)A.fogDensity.value=d.density;if(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e.lights){var k,o,B,D=0,p=0,r=0,m,t,q,u=Ua,v=u.directional.colors,H=u.directional.positions,C=u.point.colors,z=u.point.positions,x=u.point.distances,
+K=0,E=0,d=o=q=0;for(k=c.length;d<k;d++)if(o=c[d],B=o.color,m=o.position,t=o.intensity,q=o.distance,o instanceof THREE.AmbientLight)D+=B.r,p+=B.g,r+=B.b;else if(o instanceof THREE.DirectionalLight)q=K*3,v[q]=B.r*t,v[q+1]=B.g*t,v[q+2]=B.b*t,H[q]=m.x,H[q+1]=m.y,H[q+2]=m.z,K+=1;else if(o instanceof THREE.SpotLight)q=K*3,v[q]=B.r*t,v[q+1]=B.g*t,v[q+2]=B.b*t,B=1/m.length(),H[q]=m.x*B,H[q+1]=m.y*B,H[q+2]=m.z*B,K+=1;else if(o instanceof THREE.PointLight)o=E*3,C[o]=B.r*t,C[o+1]=B.g*t,C[o+2]=B.b*t,z[o]=m.x,
+z[o+1]=m.y,z[o+2]=m.z,x[E]=q,E+=1;for(d=K*3;d<v.length;d++)v[d]=0;for(d=E*3;d<C.length;d++)C[d]=0;u.point.length=E;u.directional.length=K;u.ambient[0]=D;u.ambient[1]=p;u.ambient[2]=r;c=Ua;A.enableLighting.value=c.directional.length+c.point.length;A.ambientLightColor.value=c.ambient;A.directionalLightColor.value=c.directional.colors;A.directionalLightDirection.value=c.directional.positions;A.pointLightColor.value=c.point.colors;A.pointLightPosition.value=c.point.positions;A.pointLightDistance.value=
 c.point.distances}if(e instanceof THREE.MeshBasicMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.MeshPhongMaterial)A.diffuse.value=e.color,A.opacity.value=e.opacity,(A.map.texture=e.map)&&A.offsetRepeat.value.set(e.map.offset.x,e.map.offset.y,e.map.repeat.x,e.map.repeat.y),A.lightMap.texture=e.lightMap,A.envMap.texture=e.envMap,A.reflectivity.value=e.reflectivity,A.refractionRatio.value=e.refractionRatio,A.combine.value=e.combine,A.useRefract.value=e.envMap&&e.envMap.mapping instanceof
 c.point.distances}if(e instanceof THREE.MeshBasicMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.MeshPhongMaterial)A.diffuse.value=e.color,A.opacity.value=e.opacity,(A.map.texture=e.map)&&A.offsetRepeat.value.set(e.map.offset.x,e.map.offset.y,e.map.repeat.x,e.map.repeat.y),A.lightMap.texture=e.lightMap,A.envMap.texture=e.envMap,A.reflectivity.value=e.reflectivity,A.refractionRatio.value=e.refractionRatio,A.combine.value=e.combine,A.useRefract.value=e.envMap&&e.envMap.mapping instanceof
 THREE.CubeRefractionMapping;if(e instanceof THREE.LineBasicMaterial)A.diffuse.value=e.color,A.opacity.value=e.opacity;else if(e instanceof THREE.ParticleBasicMaterial)A.psColor.value=e.color,A.opacity.value=e.opacity,A.size.value=e.size,A.scale.value=Ga.height/2,A.map.texture=e.map;else if(e instanceof THREE.MeshPhongMaterial)A.ambient.value=e.ambient,A.specular.value=e.specular,A.shininess.value=e.shininess;else if(e instanceof THREE.MeshDepthMaterial)A.mNear.value=b.near,A.mFar.value=b.far,A.opacity.value=
 THREE.CubeRefractionMapping;if(e instanceof THREE.LineBasicMaterial)A.diffuse.value=e.color,A.opacity.value=e.opacity;else if(e instanceof THREE.ParticleBasicMaterial)A.psColor.value=e.color,A.opacity.value=e.opacity,A.size.value=e.size,A.scale.value=Ga.height/2,A.map.texture=e.map;else if(e instanceof THREE.MeshPhongMaterial)A.ambient.value=e.ambient,A.specular.value=e.specular,A.shininess.value=e.shininess;else if(e instanceof THREE.MeshDepthMaterial)A.mNear.value=b.near,A.mFar.value=b.far,A.opacity.value=
 e.opacity;else if(e instanceof THREE.MeshNormalMaterial)A.opacity.value=e.opacity;if(h.receiveShadow&&!e._shadowPass&&A.shadowMatrix){for(c=0;c<Qa.length;c++)A.shadowMatrix.value[c]=Qa[c],A.shadowMap.texture[c]=J.shadowMap[c];A.shadowDarkness.value=J.shadowMapDarkness;A.shadowBias.value=J.shadowMapBias}for(var M in A)if(k=g.uniforms[M])if(d=A[M],D=d.type,c=d.value,D=="i")f.uniform1i(k,c);else if(D=="f")f.uniform1f(k,c);else if(D=="v2")f.uniform2f(k,c.x,c.y);else if(D=="v3")f.uniform3f(k,c.x,c.y,c.z);
 e.opacity;else if(e instanceof THREE.MeshNormalMaterial)A.opacity.value=e.opacity;if(h.receiveShadow&&!e._shadowPass&&A.shadowMatrix){for(c=0;c<Qa.length;c++)A.shadowMatrix.value[c]=Qa[c],A.shadowMap.texture[c]=J.shadowMap[c];A.shadowDarkness.value=J.shadowMapDarkness;A.shadowBias.value=J.shadowMapBias}for(var M in A)if(k=g.uniforms[M])if(d=A[M],D=d.type,c=d.value,D=="i")f.uniform1i(k,c);else if(D=="f")f.uniform1f(k,c);else if(D=="v2")f.uniform2f(k,c.x,c.y);else if(D=="v3")f.uniform3f(k,c.x,c.y,c.z);
-else if(D=="v4")f.uniform4f(k,c.x,c.y,c.z,c.w);else if(D=="c")f.uniform3f(k,c.r,c.g,c.b);else if(D=="fv1")f.uniform1fv(k,c);else if(D=="fv")f.uniform3fv(k,c);else if(D=="v3v"){if(!d._array)d._array=new Float32Array(3*c.length);D=0;for(o=c.length;D<o;D++)p=D*3,d._array[p]=c[D].x,d._array[p+1]=c[D].y,d._array[p+2]=c[D].z;f.uniform3fv(k,d._array)}else if(D=="m4"){if(!d._array)d._array=new Float32Array(16);c.flattenToArray(d._array);f.uniformMatrix4fv(k,!1,d._array)}else if(D=="m4v"){if(!d._array)d._array=
-new Float32Array(16*c.length);D=0;for(o=c.length;D<o;D++)c[D].flattenToArrayOffset(d._array,D*16);f.uniformMatrix4fv(k,!1,d._array)}else if(D=="t"){if(f.uniform1i(k,c),k=d.texture)if(k.image instanceof Array&&k.image.length==6){if(d=k,d.image.length==6)if(d.needsUpdate){if(!d.image.__webglTextureCube)d.image.__webglTextureCube=f.createTexture();f.activeTexture(f.TEXTURE0+c);f.bindTexture(f.TEXTURE_CUBE_MAP,d.image.__webglTextureCube);for(c=0;c<6;c++)f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,
-f.RGBA,f.RGBA,f.UNSIGNED_BYTE,d.image[c]);Y(f.TEXTURE_CUBE_MAP,d,d.image[0]);d.needsUpdate=!1}else f.activeTexture(f.TEXTURE0+c),f.bindTexture(f.TEXTURE_CUBE_MAP,d.image.__webglTextureCube)}else k instanceof THREE.WebGLRenderTargetCube?(d=k,f.activeTexture(f.TEXTURE0+c),f.bindTexture(f.TEXTURE_CUBE_MAP,d.__webglTexture)):L(k,c)}else if(D=="tv"){if(!d._array){d._array=[];D=0;for(o=d.texture.length;D<o;D++)d._array[D]=c+D}f.uniform1iv(k,d._array);D=0;for(o=d.texture.length;D<o;D++)(k=d.texture[D])&&
+else if(D=="v4")f.uniform4f(k,c.x,c.y,c.z,c.w);else if(D=="c")f.uniform3f(k,c.r,c.g,c.b);else if(D=="fv1")f.uniform1fv(k,c);else if(D=="fv")f.uniform3fv(k,c);else if(D=="v3v"){if(!d._array)d._array=new Float32Array(3*c.length);D=0;for(p=c.length;D<p;D++)r=D*3,d._array[r]=c[D].x,d._array[r+1]=c[D].y,d._array[r+2]=c[D].z;f.uniform3fv(k,d._array)}else if(D=="m4"){if(!d._array)d._array=new Float32Array(16);c.flattenToArray(d._array);f.uniformMatrix4fv(k,!1,d._array)}else if(D=="m4v"){if(!d._array)d._array=
+new Float32Array(16*c.length);D=0;for(p=c.length;D<p;D++)c[D].flattenToArrayOffset(d._array,D*16);f.uniformMatrix4fv(k,!1,d._array)}else if(D=="t"){if(f.uniform1i(k,c),k=d.texture)if(k.image instanceof Array&&k.image.length==6){if(d=k,d.image.length==6)if(d.needsUpdate){if(!d.image.__webglTextureCube)d.image.__webglTextureCube=f.createTexture();f.activeTexture(f.TEXTURE0+c);f.bindTexture(f.TEXTURE_CUBE_MAP,d.image.__webglTextureCube);for(c=0;c<6;c++)f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,
+f.RGBA,f.RGBA,f.UNSIGNED_BYTE,d.image[c]);Y(f.TEXTURE_CUBE_MAP,d,d.image[0]);d.needsUpdate=!1}else f.activeTexture(f.TEXTURE0+c),f.bindTexture(f.TEXTURE_CUBE_MAP,d.image.__webglTextureCube)}else k instanceof THREE.WebGLRenderTargetCube?(d=k,f.activeTexture(f.TEXTURE0+c),f.bindTexture(f.TEXTURE_CUBE_MAP,d.__webglTexture)):L(k,c)}else if(D=="tv"){if(!d._array){d._array=[];D=0;for(p=d.texture.length;D<p;D++)d._array[D]=c+D}f.uniform1iv(k,d._array);D=0;for(p=d.texture.length;D<p;D++)(k=d.texture[D])&&
 L(k,d._array[D])}f.uniformMatrix4fv(j.modelViewMatrix,!1,h._modelViewMatrixArray);f.uniformMatrix3fv(j.normalMatrix,!1,h._normalMatrixArray);(e instanceof THREE.MeshShaderMaterial||e instanceof THREE.MeshPhongMaterial||e.envMap)&&j.cameraPosition!==null&&f.uniform3f(j.cameraPosition,b.position.x,b.position.y,b.position.z);(e instanceof THREE.MeshShaderMaterial||e.envMap||e.skinning||h.receiveShadow)&&j.objectMatrix!==null&&f.uniformMatrix4fv(j.objectMatrix,!1,h._objectMatrixArray);(e instanceof THREE.MeshPhongMaterial||
 L(k,d._array[D])}f.uniformMatrix4fv(j.modelViewMatrix,!1,h._modelViewMatrixArray);f.uniformMatrix3fv(j.normalMatrix,!1,h._normalMatrixArray);(e instanceof THREE.MeshShaderMaterial||e instanceof THREE.MeshPhongMaterial||e.envMap)&&j.cameraPosition!==null&&f.uniform3f(j.cameraPosition,b.position.x,b.position.y,b.position.z);(e instanceof THREE.MeshShaderMaterial||e.envMap||e.skinning||h.receiveShadow)&&j.objectMatrix!==null&&f.uniformMatrix4fv(j.objectMatrix,!1,h._objectMatrixArray);(e instanceof THREE.MeshPhongMaterial||
 e instanceof THREE.MeshLambertMaterial||e instanceof THREE.MeshShaderMaterial||e.skinning)&&j.viewMatrix!==null&&f.uniformMatrix4fv(j.viewMatrix,!1,Ra);e.skinning&&(f.uniformMatrix4fv(j.cameraInverseMatrix,!1,Ra),f.uniformMatrix4fv(j.boneGlobalMatrices,!1,h.boneMatrices));return g}function e(b,c,e,h,g,j){if(h.opacity!=0){var k,b=d(b,c,e,h,j).attributes;if(!h.morphTargets&&b.position>=0)f.bindBuffer(f.ARRAY_BUFFER,g.__webglVertexBuffer),f.vertexAttribPointer(b.position,3,f.FLOAT,!1,0,0);else if(j.morphTargetBase){c=
 e instanceof THREE.MeshLambertMaterial||e instanceof THREE.MeshShaderMaterial||e.skinning)&&j.viewMatrix!==null&&f.uniformMatrix4fv(j.viewMatrix,!1,Ra);e.skinning&&(f.uniformMatrix4fv(j.cameraInverseMatrix,!1,Ra),f.uniformMatrix4fv(j.boneGlobalMatrices,!1,h.boneMatrices));return g}function e(b,c,e,h,g,j){if(h.opacity!=0){var k,b=d(b,c,e,h,j).attributes;if(!h.morphTargets&&b.position>=0)f.bindBuffer(f.ARRAY_BUFFER,g.__webglVertexBuffer),f.vertexAttribPointer(b.position,3,f.FLOAT,!1,0,0);else if(j.morphTargetBase){c=
-h.program.attributes;j.morphTargetBase!==-1?(f.bindBuffer(f.ARRAY_BUFFER,g.__webglMorphTargetsBuffers[j.morphTargetBase]),f.vertexAttribPointer(c.position,3,f.FLOAT,!1,0,0)):c.position>=0&&(f.bindBuffer(f.ARRAY_BUFFER,g.__webglVertexBuffer),f.vertexAttribPointer(c.position,3,f.FLOAT,!1,0,0));if(j.morphTargetForcedOrder.length)for(var e=0,A=j.morphTargetForcedOrder,m=j.morphTargetInfluences;e<h.numSupportedMorphTargets&&e<A.length;)f.bindBuffer(f.ARRAY_BUFFER,g.__webglMorphTargetsBuffers[A[e]]),f.vertexAttribPointer(c["morphTarget"+
-e],3,f.FLOAT,!1,0,0),j.__webglMorphTargetInfluences[e]=m[A[e]],e++;else{var A=[],o=-1,B=0,m=j.morphTargetInfluences,D,r=m.length,e=0;for(j.morphTargetBase!==-1&&(A[j.morphTargetBase]=!0);e<h.numSupportedMorphTargets;){for(D=0;D<r;D++)!A[D]&&m[D]>o&&(B=D,o=m[B]);f.bindBuffer(f.ARRAY_BUFFER,g.__webglMorphTargetsBuffers[B]);f.vertexAttribPointer(c["morphTarget"+e],3,f.FLOAT,!1,0,0);j.__webglMorphTargetInfluences[e]=o;A[B]=1;o=-1;e++}}h.program.uniforms.morphTargetInfluences!==null&&f.uniform1fv(h.program.uniforms.morphTargetInfluences,
+h.program.attributes;j.morphTargetBase!==-1?(f.bindBuffer(f.ARRAY_BUFFER,g.__webglMorphTargetsBuffers[j.morphTargetBase]),f.vertexAttribPointer(c.position,3,f.FLOAT,!1,0,0)):c.position>=0&&(f.bindBuffer(f.ARRAY_BUFFER,g.__webglVertexBuffer),f.vertexAttribPointer(c.position,3,f.FLOAT,!1,0,0));if(j.morphTargetForcedOrder.length)for(var e=0,A=j.morphTargetForcedOrder,o=j.morphTargetInfluences;e<h.numSupportedMorphTargets&&e<A.length;)f.bindBuffer(f.ARRAY_BUFFER,g.__webglMorphTargetsBuffers[A[e]]),f.vertexAttribPointer(c["morphTarget"+
+e],3,f.FLOAT,!1,0,0),j.__webglMorphTargetInfluences[e]=o[A[e]],e++;else{var A=[],p=-1,B=0,o=j.morphTargetInfluences,D,m=o.length,e=0;for(j.morphTargetBase!==-1&&(A[j.morphTargetBase]=!0);e<h.numSupportedMorphTargets;){for(D=0;D<m;D++)!A[D]&&o[D]>p&&(B=D,p=o[B]);f.bindBuffer(f.ARRAY_BUFFER,g.__webglMorphTargetsBuffers[B]);f.vertexAttribPointer(c["morphTarget"+e],3,f.FLOAT,!1,0,0);j.__webglMorphTargetInfluences[e]=p;A[B]=1;p=-1;e++}}h.program.uniforms.morphTargetInfluences!==null&&f.uniform1fv(h.program.uniforms.morphTargetInfluences,
 j.__webglMorphTargetInfluences)}if(g.__webglCustomAttributes)for(k in g.__webglCustomAttributes)b[k]>=0&&(c=g.__webglCustomAttributes[k],f.bindBuffer(f.ARRAY_BUFFER,c.buffer),f.vertexAttribPointer(b[k],c.size,f.FLOAT,!1,0,0));b.color>=0&&(f.bindBuffer(f.ARRAY_BUFFER,g.__webglColorBuffer),f.vertexAttribPointer(b.color,3,f.FLOAT,!1,0,0));b.normal>=0&&(f.bindBuffer(f.ARRAY_BUFFER,g.__webglNormalBuffer),f.vertexAttribPointer(b.normal,3,f.FLOAT,!1,0,0));b.tangent>=0&&(f.bindBuffer(f.ARRAY_BUFFER,g.__webglTangentBuffer),
 j.__webglMorphTargetInfluences)}if(g.__webglCustomAttributes)for(k in g.__webglCustomAttributes)b[k]>=0&&(c=g.__webglCustomAttributes[k],f.bindBuffer(f.ARRAY_BUFFER,c.buffer),f.vertexAttribPointer(b[k],c.size,f.FLOAT,!1,0,0));b.color>=0&&(f.bindBuffer(f.ARRAY_BUFFER,g.__webglColorBuffer),f.vertexAttribPointer(b.color,3,f.FLOAT,!1,0,0));b.normal>=0&&(f.bindBuffer(f.ARRAY_BUFFER,g.__webglNormalBuffer),f.vertexAttribPointer(b.normal,3,f.FLOAT,!1,0,0));b.tangent>=0&&(f.bindBuffer(f.ARRAY_BUFFER,g.__webglTangentBuffer),
 f.vertexAttribPointer(b.tangent,4,f.FLOAT,!1,0,0));b.uv>=0&&(g.__webglUVBuffer?(f.bindBuffer(f.ARRAY_BUFFER,g.__webglUVBuffer),f.vertexAttribPointer(b.uv,2,f.FLOAT,!1,0,0),f.enableVertexAttribArray(b.uv)):f.disableVertexAttribArray(b.uv));b.uv2>=0&&(g.__webglUV2Buffer?(f.bindBuffer(f.ARRAY_BUFFER,g.__webglUV2Buffer),f.vertexAttribPointer(b.uv2,2,f.FLOAT,!1,0,0),f.enableVertexAttribArray(b.uv2)):f.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=
 f.vertexAttribPointer(b.tangent,4,f.FLOAT,!1,0,0));b.uv>=0&&(g.__webglUVBuffer?(f.bindBuffer(f.ARRAY_BUFFER,g.__webglUVBuffer),f.vertexAttribPointer(b.uv,2,f.FLOAT,!1,0,0),f.enableVertexAttribArray(b.uv)):f.disableVertexAttribArray(b.uv));b.uv2>=0&&(g.__webglUV2Buffer?(f.bindBuffer(f.ARRAY_BUFFER,g.__webglUV2Buffer),f.vertexAttribPointer(b.uv2,2,f.FLOAT,!1,0,0),f.enableVertexAttribArray(b.uv2)):f.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=
 0&&(f.bindBuffer(f.ARRAY_BUFFER,g.__webglSkinVertexABuffer),f.vertexAttribPointer(b.skinVertexA,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,g.__webglSkinVertexBBuffer),f.vertexAttribPointer(b.skinVertexB,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,g.__webglSkinIndicesBuffer),f.vertexAttribPointer(b.skinIndex,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,g.__webglSkinWeightsBuffer),f.vertexAttribPointer(b.skinWeight,4,f.FLOAT,!1,0,0));j instanceof THREE.Mesh?(h.wireframe?(f.lineWidth(h.wireframeLinewidth),
 0&&(f.bindBuffer(f.ARRAY_BUFFER,g.__webglSkinVertexABuffer),f.vertexAttribPointer(b.skinVertexA,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,g.__webglSkinVertexBBuffer),f.vertexAttribPointer(b.skinVertexB,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,g.__webglSkinIndicesBuffer),f.vertexAttribPointer(b.skinIndex,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,g.__webglSkinWeightsBuffer),f.vertexAttribPointer(b.skinWeight,4,f.FLOAT,!1,0,0));j instanceof THREE.Mesh?(h.wireframe?(f.lineWidth(h.wireframeLinewidth),
 f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,g.__webglLineBuffer),f.drawElements(f.LINES,g.__webglLineCount,f.UNSIGNED_SHORT,0)):(f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,g.__webglFaceBuffer),f.drawElements(f.TRIANGLES,g.__webglFaceCount,f.UNSIGNED_SHORT,0)),J.data.vertices+=g.__webglFaceCount,J.data.faces+=g.__webglFaceCount/3,J.data.drawCalls++):j instanceof THREE.Line?(j=j.type==THREE.LineStrip?f.LINE_STRIP:f.LINES,f.lineWidth(h.linewidth),f.drawArrays(j,0,g.__webglLineCount),J.data.drawCalls++):j instanceof
 f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,g.__webglLineBuffer),f.drawElements(f.LINES,g.__webglLineCount,f.UNSIGNED_SHORT,0)):(f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,g.__webglFaceBuffer),f.drawElements(f.TRIANGLES,g.__webglFaceCount,f.UNSIGNED_SHORT,0)),J.data.vertices+=g.__webglFaceCount,J.data.faces+=g.__webglFaceCount/3,J.data.drawCalls++):j instanceof THREE.Line?(j=j.type==THREE.LineStrip?f.LINE_STRIP:f.LINES,f.lineWidth(h.linewidth),f.drawArrays(j,0,g.__webglLineCount),J.data.drawCalls++):j instanceof
 THREE.ParticleSystem?(f.drawArrays(f.POINTS,0,g.__webglParticleCount),J.data.drawCalls++):j instanceof THREE.Ribbon&&(f.drawArrays(f.TRIANGLE_STRIP,0,g.__webglVertexCount),J.data.drawCalls++)}}function h(b,c,d){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=f.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=f.createBuffer();b.hasPos&&(f.bindBuffer(f.ARRAY_BUFFER,b.__webglVertexBuffer),f.bufferData(f.ARRAY_BUFFER,b.positionArray,f.DYNAMIC_DRAW),f.enableVertexAttribArray(c.attributes.position),
 THREE.ParticleSystem?(f.drawArrays(f.POINTS,0,g.__webglParticleCount),J.data.drawCalls++):j instanceof THREE.Ribbon&&(f.drawArrays(f.TRIANGLE_STRIP,0,g.__webglVertexCount),J.data.drawCalls++)}}function h(b,c,d){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=f.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=f.createBuffer();b.hasPos&&(f.bindBuffer(f.ARRAY_BUFFER,b.__webglVertexBuffer),f.bufferData(f.ARRAY_BUFFER,b.positionArray,f.DYNAMIC_DRAW),f.enableVertexAttribArray(c.attributes.position),
-f.vertexAttribPointer(c.attributes.position,3,f.FLOAT,!1,0,0));if(b.hasNormal){f.bindBuffer(f.ARRAY_BUFFER,b.__webglNormalBuffer);if(d==THREE.FlatShading){var e,g,h,j,k,m,o,B,D,r,p=b.count*3;for(r=0;r<p;r+=9)d=b.normalArray,e=d[r],g=d[r+1],h=d[r+2],j=d[r+3],m=d[r+4],B=d[r+5],k=d[r+6],o=d[r+7],D=d[r+8],e=(e+j+k)/3,g=(g+m+o)/3,h=(h+B+D)/3,d[r]=e,d[r+1]=g,d[r+2]=h,d[r+3]=e,d[r+4]=g,d[r+5]=h,d[r+6]=e,d[r+7]=g,d[r+8]=h}f.bufferData(f.ARRAY_BUFFER,b.normalArray,f.DYNAMIC_DRAW);f.enableVertexAttribArray(c.attributes.normal);
+f.vertexAttribPointer(c.attributes.position,3,f.FLOAT,!1,0,0));if(b.hasNormal){f.bindBuffer(f.ARRAY_BUFFER,b.__webglNormalBuffer);if(d==THREE.FlatShading){var e,g,h,j,k,o,p,B,D,m,r=b.count*3;for(m=0;m<r;m+=9)d=b.normalArray,e=d[m],g=d[m+1],h=d[m+2],j=d[m+3],o=d[m+4],B=d[m+5],k=d[m+6],p=d[m+7],D=d[m+8],e=(e+j+k)/3,g=(g+o+p)/3,h=(h+B+D)/3,d[m]=e,d[m+1]=g,d[m+2]=h,d[m+3]=e,d[m+4]=g,d[m+5]=h,d[m+6]=e,d[m+7]=g,d[m+8]=h}f.bufferData(f.ARRAY_BUFFER,b.normalArray,f.DYNAMIC_DRAW);f.enableVertexAttribArray(c.attributes.normal);
 f.vertexAttribPointer(c.attributes.normal,3,f.FLOAT,!1,0,0)}f.drawArrays(f.TRIANGLES,0,b.count);b.count=0}function g(b){if(Z!=b.doubleSided)b.doubleSided?f.disable(f.CULL_FACE):f.enable(f.CULL_FACE),Z=b.doubleSided;if(F!=b.flipSided)b.flipSided?f.frontFace(f.CW):f.frontFace(f.CCW),F=b.flipSided}function j(b){N!=b&&(b?f.enable(f.DEPTH_TEST):f.disable(f.DEPTH_TEST),N=b)}function k(b,c,d){la!=b&&(b?f.enable(f.POLYGON_OFFSET_FILL):f.disable(f.POLYGON_OFFSET_FILL),la=b);if(b&&(wa!=c||O!=d))f.polygonOffset(c,
 f.vertexAttribPointer(c.attributes.normal,3,f.FLOAT,!1,0,0)}f.drawArrays(f.TRIANGLES,0,b.count);b.count=0}function g(b){if(Z!=b.doubleSided)b.doubleSided?f.disable(f.CULL_FACE):f.enable(f.CULL_FACE),Z=b.doubleSided;if(F!=b.flipSided)b.flipSided?f.frontFace(f.CW):f.frontFace(f.CCW),F=b.flipSided}function j(b){N!=b&&(b?f.enable(f.DEPTH_TEST):f.disable(f.DEPTH_TEST),N=b)}function k(b,c,d){la!=b&&(b?f.enable(f.POLYGON_OFFSET_FILL):f.disable(f.POLYGON_OFFSET_FILL),la=b);if(b&&(wa!=c||O!=d))f.polygonOffset(c,
-d),wa=c,O=d}function o(b){ia[0].set(b.n41-b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);ia[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);ia[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);ia[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);ia[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);ia[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34);for(var c,b=0;b<6;b++)c=ia[b],c.divideScalar(Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z))}function m(b){for(var c=b.matrixWorld,d=
--b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)),f=0;f<6;f++)if(b=ia[f].x*c.n14+ia[f].y*c.n24+ia[f].z*c.n34+ia[f].w,b<=d)return!1;return!0}function p(b,c){b.list[b.count]=c;b.count+=1}function r(b){var c,d,f=b.object,e=b.opaque,g=b.transparent;g.count=0;b=e.count=0;for(c=f.materials.length;b<c;b++)d=f.materials[b],d.transparent?p(g,d):p(e,d)}function q(b){var c,d,f,e,g=b.object,h=b.buffer,j=b.opaque,k=b.transparent;k.count=0;b=j.count=0;for(f=g.materials.length;b<
-f;b++)if(c=g.materials[b],c instanceof THREE.MeshFaceMaterial){c=0;for(d=h.materials.length;c<d;c++)(e=h.materials[c])&&(e.transparent?p(k,e):p(j,e))}else(e=c)&&(e.transparent?p(k,e):p(j,e))}function v(b,c){return c.z-b.z}function C(b,c){var k,Ta,G,r=0,fa,A,p,q,B=b.lights;W||(W=new THREE.Camera(J.shadowCameraFov,c.aspect,J.shadowCameraNear,J.shadowCameraFar));k=0;for(Ta=B.length;k<Ta;k++)if(G=B[k],G instanceof THREE.SpotLight&&G.castShadow){J.shadowMap[r]||(J.shadowMap[r]=new THREE.WebGLRenderTarget(J.shadowMapWidth,
-J.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));Qa[r]||(Qa[r]=new THREE.Matrix4);fa=J.shadowMap[r];A=Qa[r];W.position.copy(G.position);W.target.position.copy(G.target.position);W.update(void 0,!0);b.update(void 0,!1,W);A.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);A.multiplySelf(W.projectionMatrix);A.multiplySelf(W.matrixWorldInverse);W.matrixWorldInverse.flattenToArray(Ra);W.projectionMatrix.flattenToArray(Ea);Ca.multiply(W.projectionMatrix,
-W.matrixWorldInverse);o(Ca);J.initWebGLObjects(b);P(fa);f.clearColor(1,1,1,1);J.clear();f.clearColor(ua.r,ua.g,ua.b,Pa);A=b.__webglObjects.length;G=b.__webglObjectsImmediate.length;for(fa=0;fa<A;fa++)p=b.__webglObjects[fa],q=p.object,q.visible&&q.castShadow?!(q instanceof THREE.Mesh)||m(q)?(q.matrixWorld.flattenToArray(q._objectMatrixArray),E(q,W,!1),p.render=!0):p.render=!1:p.render=!1;j(!0);t(THREE.NormalBlending);for(fa=0;fa<A;fa++)if(p=b.__webglObjects[fa],p.render)q=p.object,buffer=p.buffer,
-g(q),p=q.customDepthMaterial?q.customDepthMaterial:q.geometry.morphTargets.length?Va:Sa,e(W,B,null,p,buffer,q);for(fa=0;fa<G;fa++)p=b.__webglObjectsImmediate[fa],q=p.object,q.visible&&q.castShadow&&(q.matrixAutoUpdate&&q.matrixWorld.flattenToArray(q._objectMatrixArray),E(q,W,!1),g(q),program=d(W,B,null,Sa,q),q.render(function(b){h(b,program,Sa.shading)}));r++}}function x(b,c){var d,e,g;d=u.attributes;var h=u.uniforms,j=xa/Fa,k,m=[],r=Fa*0.5,o=xa*0.5,D=!0;f.useProgram(u.program);ra=u.program;N=V=-1;
+d),wa=c,O=d}function p(b){ia[0].set(b.n41-b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);ia[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);ia[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);ia[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);ia[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);ia[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34);for(var c,b=0;b<6;b++)c=ia[b],c.divideScalar(Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z))}function o(b){for(var c=b.matrixWorld,d=
+-b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)),f=0;f<6;f++)if(b=ia[f].x*c.n14+ia[f].y*c.n24+ia[f].z*c.n34+ia[f].w,b<=d)return!1;return!0}function m(b,c){b.list[b.count]=c;b.count+=1}function r(b){var c,d,f=b.object,e=b.opaque,g=b.transparent;g.count=0;b=e.count=0;for(c=f.materials.length;b<c;b++)d=f.materials[b],d.transparent?m(g,d):m(e,d)}function q(b){var c,d,f,e,g=b.object,h=b.buffer,j=b.opaque,k=b.transparent;k.count=0;b=j.count=0;for(f=g.materials.length;b<
+f;b++)if(c=g.materials[b],c instanceof THREE.MeshFaceMaterial){c=0;for(d=h.materials.length;c<d;c++)(e=h.materials[c])&&(e.transparent?m(k,e):m(j,e))}else(e=c)&&(e.transparent?m(k,e):m(j,e))}function v(b,c){return c.z-b.z}function C(b,c){var k,Ta,G,m=0,fa,A,r,q,B=b.lights;W||(W=new THREE.Camera(J.shadowCameraFov,c.aspect,J.shadowCameraNear,J.shadowCameraFar));k=0;for(Ta=B.length;k<Ta;k++)if(G=B[k],G instanceof THREE.SpotLight&&G.castShadow){J.shadowMap[m]||(J.shadowMap[m]=new THREE.WebGLRenderTarget(J.shadowMapWidth,
+J.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));Qa[m]||(Qa[m]=new THREE.Matrix4);fa=J.shadowMap[m];A=Qa[m];W.position.copy(G.position);W.target.position.copy(G.target.position);W.update(void 0,!0);b.update(void 0,!1,W);A.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);A.multiplySelf(W.projectionMatrix);A.multiplySelf(W.matrixWorldInverse);W.matrixWorldInverse.flattenToArray(Ra);W.projectionMatrix.flattenToArray(Ea);Ca.multiply(W.projectionMatrix,
+W.matrixWorldInverse);p(Ca);J.initWebGLObjects(b);P(fa);f.clearColor(1,1,1,1);J.clear();f.clearColor(ua.r,ua.g,ua.b,Pa);A=b.__webglObjects.length;G=b.__webglObjectsImmediate.length;for(fa=0;fa<A;fa++)r=b.__webglObjects[fa],q=r.object,q.visible&&q.castShadow?!(q instanceof THREE.Mesh)||o(q)?(q.matrixWorld.flattenToArray(q._objectMatrixArray),E(q,W,!1),r.render=!0):r.render=!1:r.render=!1;j(!0);t(THREE.NormalBlending);for(fa=0;fa<A;fa++)if(r=b.__webglObjects[fa],r.render)q=r.object,buffer=r.buffer,
+g(q),r=q.customDepthMaterial?q.customDepthMaterial:q.geometry.morphTargets.length?Va:Sa,e(W,B,null,r,buffer,q);for(fa=0;fa<G;fa++)r=b.__webglObjectsImmediate[fa],q=r.object,q.visible&&q.castShadow&&(q.matrixAutoUpdate&&q.matrixWorld.flattenToArray(q._objectMatrixArray),E(q,W,!1),g(q),program=d(W,B,null,Sa,q),q.render(function(b){h(b,program,Sa.shading)}));m++}}function x(b,c){var d,e,g;d=u.attributes;var h=u.uniforms,j=xa/Fa,k,o=[],m=Fa*0.5,p=xa*0.5,D=!0;f.useProgram(u.program);ra=u.program;N=V=-1;
 Wa||(f.enableVertexAttribArray(u.attributes.position),f.enableVertexAttribArray(u.attributes.uv),Wa=!0);f.disable(f.CULL_FACE);f.enable(f.BLEND);f.depthMask(!0);f.bindBuffer(f.ARRAY_BUFFER,u.vertexBuffer);f.vertexAttribPointer(d.position,2,f.FLOAT,!1,16,0);f.vertexAttribPointer(d.uv,2,f.FLOAT,!1,16,8);f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,u.elementBuffer);f.uniformMatrix4fv(h.projectionMatrix,!1,Ea);f.activeTexture(f.TEXTURE0);f.uniform1i(h.map,0);d=0;for(e=b.__webglSprites.length;d<e;d++)g=b.__webglSprites[d],
 Wa||(f.enableVertexAttribArray(u.attributes.position),f.enableVertexAttribArray(u.attributes.uv),Wa=!0);f.disable(f.CULL_FACE);f.enable(f.BLEND);f.depthMask(!0);f.bindBuffer(f.ARRAY_BUFFER,u.vertexBuffer);f.vertexAttribPointer(d.position,2,f.FLOAT,!1,16,0);f.vertexAttribPointer(d.uv,2,f.FLOAT,!1,16,8);f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,u.elementBuffer);f.uniformMatrix4fv(h.projectionMatrix,!1,Ea);f.activeTexture(f.TEXTURE0);f.uniform1i(h.map,0);d=0;for(e=b.__webglSprites.length;d<e;d++)g=b.__webglSprites[d],
-g.useScreenCoordinates?g.z=-g.position.z:(g._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,g.matrixWorld,g._modelViewMatrixArray),g.z=-g._modelViewMatrix.n34);b.__webglSprites.sort(v);d=0;for(e=b.__webglSprites.length;d<e;d++)g=b.__webglSprites[d],g.material===void 0&&g.map&&g.map.image&&g.map.image.width&&(g.useScreenCoordinates?(f.uniform1i(h.useScreenCoordinates,1),f.uniform3f(h.screenPosition,(g.position.x-r)/r,(o-g.position.y)/o,Math.max(0,Math.min(1,g.position.z)))):(f.uniform1i(h.useScreenCoordinates,
-0),f.uniform1i(h.affectedByDistance,g.affectedByDistance?1:0),f.uniformMatrix4fv(h.modelViewMatrix,!1,g._modelViewMatrixArray)),k=g.map.image.width/(g.scaleByViewport?xa:1),m[0]=k*j*g.scale.x,m[1]=k*g.scale.y,f.uniform2f(h.uvScale,g.uvScale.x,g.uvScale.y),f.uniform2f(h.uvOffset,g.uvOffset.x,g.uvOffset.y),f.uniform2f(h.alignment,g.alignment.x,g.alignment.y),f.uniform1f(h.opacity,g.opacity),f.uniform1f(h.rotation,g.rotation),f.uniform2fv(h.scale,m),g.mergeWith3D&&!D?(f.enable(f.DEPTH_TEST),D=!0):!g.mergeWith3D&&
+g.useScreenCoordinates?g.z=-g.position.z:(g._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,g.matrixWorld,g._modelViewMatrixArray),g.z=-g._modelViewMatrix.n34);b.__webglSprites.sort(v);d=0;for(e=b.__webglSprites.length;d<e;d++)g=b.__webglSprites[d],g.material===void 0&&g.map&&g.map.image&&g.map.image.width&&(g.useScreenCoordinates?(f.uniform1i(h.useScreenCoordinates,1),f.uniform3f(h.screenPosition,(g.position.x-m)/m,(p-g.position.y)/p,Math.max(0,Math.min(1,g.position.z)))):(f.uniform1i(h.useScreenCoordinates,
+0),f.uniform1i(h.affectedByDistance,g.affectedByDistance?1:0),f.uniformMatrix4fv(h.modelViewMatrix,!1,g._modelViewMatrixArray)),k=g.map.image.width/(g.scaleByViewport?xa:1),o[0]=k*j*g.scale.x,o[1]=k*g.scale.y,f.uniform2f(h.uvScale,g.uvScale.x,g.uvScale.y),f.uniform2f(h.uvOffset,g.uvOffset.x,g.uvOffset.y),f.uniform2f(h.alignment,g.alignment.x,g.alignment.y),f.uniform1f(h.opacity,g.opacity),f.uniform1f(h.rotation,g.rotation),f.uniform2fv(h.scale,o),g.mergeWith3D&&!D?(f.enable(f.DEPTH_TEST),D=!0):!g.mergeWith3D&&
 D&&(f.disable(f.DEPTH_TEST),D=!1),t(g.blending),L(g.map,0),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0));f.enable(f.CULL_FACE);f.enable(f.DEPTH_TEST);f.depthMask(T)}function E(b,c,d){b._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);d&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}function K(b){var c,d,f,e;e=b.__materials;b=0;for(d=e.length;b<d;b++)if(f=e[b],f.attributes)for(c in f.attributes)if(f.attributes[c].needsUpdate)return!0;
 D&&(f.disable(f.DEPTH_TEST),D=!1),t(g.blending),L(g.map,0),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0));f.enable(f.CULL_FACE);f.enable(f.DEPTH_TEST);f.depthMask(T)}function E(b,c,d){b._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);d&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}function K(b){var c,d,f,e;e=b.__materials;b=0;for(d=e.length;b<d;b++)if(f=e[b],f.attributes)for(c in f.attributes)if(f.attributes[c].needsUpdate)return!0;
-return!1}function ya(b){var c,d,f,e;e=b.__materials;b=0;for(d=e.length;b<d;b++)if(f=e[b],f.attributes)for(c in f.attributes)f.attributes[c].needsUpdate=!1}function za(b,c){var d;for(d=b.length-1;d>=0;d--)b[d].object==c&&b.splice(d,1)}function ta(b){function c(b){var e=[];d=0;for(f=b.length;d<f;d++)b[d]==void 0?e.push("undefined"):e.push(b[d].id);return e.join("_")}var d,f,e,g,h,j,k,m,r={},D=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};e=0;for(g=b.faces.length;e<g;e++)h=b.faces[e],
-j=h.materials,k=c(j),r[k]==void 0&&(r[k]={hash:k,counter:0}),m=r[k].hash+"_"+r[k].counter,b.geometryGroups[m]==void 0&&(b.geometryGroups[m]={faces:[],materials:j,vertices:0,numMorphTargets:D}),h=h instanceof THREE.Face3?3:4,b.geometryGroups[m].vertices+h>65535&&(r[k].counter+=1,m=r[k].hash+"_"+r[k].counter,b.geometryGroups[m]==void 0&&(b.geometryGroups[m]={faces:[],materials:j,vertices:0,numMorphTargets:D})),b.geometryGroups[m].faces.push(e),b.geometryGroups[m].vertices+=h}function U(b,c,d){b.push({buffer:c,
+return!1}function ya(b){var c,d,f,e;e=b.__materials;b=0;for(d=e.length;b<d;b++)if(f=e[b],f.attributes)for(c in f.attributes)f.attributes[c].needsUpdate=!1}function za(b,c){var d;for(d=b.length-1;d>=0;d--)b[d].object==c&&b.splice(d,1)}function ta(b){function c(b){var e=[];d=0;for(f=b.length;d<f;d++)b[d]==void 0?e.push("undefined"):e.push(b[d].id);return e.join("_")}var d,f,e,g,h,j,k,o,m={},D=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};e=0;for(g=b.faces.length;e<g;e++)h=b.faces[e],
+j=h.materials,k=c(j),m[k]==void 0&&(m[k]={hash:k,counter:0}),o=m[k].hash+"_"+m[k].counter,b.geometryGroups[o]==void 0&&(b.geometryGroups[o]={faces:[],materials:j,vertices:0,numMorphTargets:D}),h=h instanceof THREE.Face3?3:4,b.geometryGroups[o].vertices+h>65535&&(m[k].counter+=1,o=m[k].hash+"_"+m[k].counter,b.geometryGroups[o]==void 0&&(b.geometryGroups[o]={faces:[],materials:j,vertices:0,numMorphTargets:D})),b.geometryGroups[o].faces.push(e),b.geometryGroups[o].vertices+=h}function U(b,c,d){b.push({buffer:c,
 object:d,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function t(b){if(b!=V){switch(b){case THREE.AdditiveBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.SRC_ALPHA,f.ONE);break;case THREE.SubtractiveBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.ZERO,f.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.ZERO,f.SRC_COLOR);break;default:f.blendEquationSeparate(f.FUNC_ADD,f.FUNC_ADD),f.blendFuncSeparate(f.SRC_ALPHA,f.ONE_MINUS_SRC_ALPHA,
 object:d,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function t(b){if(b!=V){switch(b){case THREE.AdditiveBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.SRC_ALPHA,f.ONE);break;case THREE.SubtractiveBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.ZERO,f.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.ZERO,f.SRC_COLOR);break;default:f.blendEquationSeparate(f.FUNC_ADD,f.FUNC_ADD),f.blendFuncSeparate(f.SRC_ALPHA,f.ONE_MINUS_SRC_ALPHA,
 f.ONE,f.ONE_MINUS_SRC_ALPHA)}V=b}}function Y(b,c,d){(d.width&d.width-1)==0&&(d.height&d.height-1)==0?(f.texParameteri(b,f.TEXTURE_WRAP_S,S(c.wrapS)),f.texParameteri(b,f.TEXTURE_WRAP_T,S(c.wrapT)),f.texParameteri(b,f.TEXTURE_MAG_FILTER,S(c.magFilter)),f.texParameteri(b,f.TEXTURE_MIN_FILTER,S(c.minFilter)),f.generateMipmap(b)):(f.texParameteri(b,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(b,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(b,f.TEXTURE_MAG_FILTER,qa(c.magFilter)),f.texParameteri(b,
 f.ONE,f.ONE_MINUS_SRC_ALPHA)}V=b}}function Y(b,c,d){(d.width&d.width-1)==0&&(d.height&d.height-1)==0?(f.texParameteri(b,f.TEXTURE_WRAP_S,S(c.wrapS)),f.texParameteri(b,f.TEXTURE_WRAP_T,S(c.wrapT)),f.texParameteri(b,f.TEXTURE_MAG_FILTER,S(c.magFilter)),f.texParameteri(b,f.TEXTURE_MIN_FILTER,S(c.minFilter)),f.generateMipmap(b)):(f.texParameteri(b,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(b,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(b,f.TEXTURE_MAG_FILTER,qa(c.magFilter)),f.texParameteri(b,
 f.TEXTURE_MIN_FILTER,qa(c.minFilter)))}function L(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglTexture=f.createTexture(),b.__webglInit=!0;f.activeTexture(f.TEXTURE0+c);f.bindTexture(f.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?f.texImage2D(f.TEXTURE_2D,0,S(b.format),b.image.width,b.image.height,0,S(b.format),f.UNSIGNED_BYTE,b.image.data):f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,b.image);Y(f.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else f.activeTexture(f.TEXTURE0+
 f.TEXTURE_MIN_FILTER,qa(c.minFilter)))}function L(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglTexture=f.createTexture(),b.__webglInit=!0;f.activeTexture(f.TEXTURE0+c);f.bindTexture(f.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?f.texImage2D(f.TEXTURE_2D,0,S(b.format),b.image.width,b.image.height,0,S(b.format),f.UNSIGNED_BYTE,b.image.data):f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,b.image);Y(f.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else f.activeTexture(f.TEXTURE0+
 c),f.bindTexture(f.TEXTURE_2D,b.__webglTexture)}function P(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglRenderbuffer=f.createRenderbuffer();b.__webglTexture=f.createTexture();if(c){f.bindTexture(f.TEXTURE_CUBE_MAP,b.__webglTexture);Y(f.TEXTURE_CUBE_MAP,b,b);b.__webglFramebuffer=[];for(var d=0;d<6;d++)b.__webglFramebuffer[d]=f.createFramebuffer(),f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+
 c),f.bindTexture(f.TEXTURE_2D,b.__webglTexture)}function P(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglRenderbuffer=f.createRenderbuffer();b.__webglTexture=f.createTexture();if(c){f.bindTexture(f.TEXTURE_CUBE_MAP,b.__webglTexture);Y(f.TEXTURE_CUBE_MAP,b,b);b.__webglFramebuffer=[];for(var d=0;d<6;d++)b.__webglFramebuffer[d]=f.createFramebuffer(),f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+
 d,0,S(b.format),b.width,b.height,0,S(b.format),S(b.type),null)}else b.__webglFramebuffer=f.createFramebuffer(),f.bindTexture(f.TEXTURE_2D,b.__webglTexture),Y(f.TEXTURE_2D,b,b),f.texImage2D(f.TEXTURE_2D,0,S(b.format),b.width,b.height,0,S(b.format),S(b.type),null);f.bindRenderbuffer(f.RENDERBUFFER,b.__webglRenderbuffer);if(c)for(d=0;d<6;++d)f.bindFramebuffer(f.FRAMEBUFFER,b.__webglFramebuffer[d]),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_CUBE_MAP_POSITIVE_X+d,b.__webglTexture,
 d,0,S(b.format),b.width,b.height,0,S(b.format),S(b.type),null)}else b.__webglFramebuffer=f.createFramebuffer(),f.bindTexture(f.TEXTURE_2D,b.__webglTexture),Y(f.TEXTURE_2D,b,b),f.texImage2D(f.TEXTURE_2D,0,S(b.format),b.width,b.height,0,S(b.format),S(b.type),null);f.bindRenderbuffer(f.RENDERBUFFER,b.__webglRenderbuffer);if(c)for(d=0;d<6;++d)f.bindFramebuffer(f.FRAMEBUFFER,b.__webglFramebuffer[d]),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_CUBE_MAP_POSITIVE_X+d,b.__webglTexture,
 0);else f.bindFramebuffer(f.FRAMEBUFFER,b.__webglFramebuffer),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,b.__webglTexture,0);b.depthBuffer&&!b.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,b.width,b.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,b.__webglRenderbuffer)):b.depthBuffer&&b.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_STENCIL,b.width,b.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,
 0);else f.bindFramebuffer(f.FRAMEBUFFER,b.__webglFramebuffer),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,b.__webglTexture,0);b.depthBuffer&&!b.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,b.width,b.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,b.__webglRenderbuffer)):b.depthBuffer&&b.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_STENCIL,b.width,b.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,
-f.DEPTH_STENCIL_ATTACHMENT,f.RENDERBUFFER,b.__webglRenderbuffer)):f.renderbufferStorage(f.RENDERBUFFER,f.RGBA4,b.width,b.height);c?f.bindTexture(f.TEXTURE_CUBE_MAP,null):f.bindTexture(f.TEXTURE_2D,null);f.bindRenderbuffer(f.RENDERBUFFER,null);f.bindFramebuffer(f.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,d=b.width,b=b.height):(c=null,d=Fa,b=xa);c!=va&&(f.bindFramebuffer(f.FRAMEBUFFER,c),f.viewport(Aa,Ia,d,b),va=c)}function Q(b){b instanceof THREE.WebGLRenderTargetCube?
-(f.bindTexture(f.TEXTURE_CUBE_MAP,b.__webglTexture),f.generateMipmap(f.TEXTURE_CUBE_MAP),f.bindTexture(f.TEXTURE_CUBE_MAP,null)):(f.bindTexture(f.TEXTURE_2D,b.__webglTexture),f.generateMipmap(f.TEXTURE_2D),f.bindTexture(f.TEXTURE_2D,null))}function ha(b,c){var d;b=="fragment"?d=f.createShader(f.FRAGMENT_SHADER):b=="vertex"&&(d=f.createShader(f.VERTEX_SHADER));f.shaderSource(d,c);f.compileShader(d);if(!f.getShaderParameter(d,f.COMPILE_STATUS))return console.error(f.getShaderInfoLog(d)),console.error(c),
-null;return d}function qa(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return f.NEAREST;default:return f.LINEAR}}function S(b){switch(b){case THREE.RepeatWrapping:return f.REPEAT;case THREE.ClampToEdgeWrapping:return f.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return f.MIRRORED_REPEAT;case THREE.NearestFilter:return f.NEAREST;case THREE.NearestMipMapNearestFilter:return f.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return f.NEAREST_MIPMAP_LINEAR;
+f.DEPTH_STENCIL_ATTACHMENT,f.RENDERBUFFER,b.__webglRenderbuffer)):f.renderbufferStorage(f.RENDERBUFFER,f.RGBA4,b.width,b.height);c?f.bindTexture(f.TEXTURE_CUBE_MAP,null):f.bindTexture(f.TEXTURE_2D,null);f.bindRenderbuffer(f.RENDERBUFFER,null);f.bindFramebuffer(f.FRAMEBUFFER,null)}var e,g;b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,d=b.width,b=b.height,g=e=0):(c=null,d=Fa,b=xa,e=Aa,g=Ia);c!=va&&(f.bindFramebuffer(f.FRAMEBUFFER,c),f.viewport(e,g,d,b),va=c)}function Q(b){b instanceof
+THREE.WebGLRenderTargetCube?(f.bindTexture(f.TEXTURE_CUBE_MAP,b.__webglTexture),f.generateMipmap(f.TEXTURE_CUBE_MAP),f.bindTexture(f.TEXTURE_CUBE_MAP,null)):(f.bindTexture(f.TEXTURE_2D,b.__webglTexture),f.generateMipmap(f.TEXTURE_2D),f.bindTexture(f.TEXTURE_2D,null))}function ha(b,c){var d;b=="fragment"?d=f.createShader(f.FRAGMENT_SHADER):b=="vertex"&&(d=f.createShader(f.VERTEX_SHADER));f.shaderSource(d,c);f.compileShader(d);if(!f.getShaderParameter(d,f.COMPILE_STATUS))return console.error(f.getShaderInfoLog(d)),
+console.error(c),null;return d}function qa(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return f.NEAREST;default:return f.LINEAR}}function S(b){switch(b){case THREE.RepeatWrapping:return f.REPEAT;case THREE.ClampToEdgeWrapping:return f.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return f.MIRRORED_REPEAT;case THREE.NearestFilter:return f.NEAREST;case THREE.NearestMipMapNearestFilter:return f.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return f.NEAREST_MIPMAP_LINEAR;
 case THREE.LinearFilter:return f.LINEAR;case THREE.LinearMipMapNearestFilter:return f.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return f.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return f.BYTE;case THREE.UnsignedByteType:return f.UNSIGNED_BYTE;case THREE.ShortType:return f.SHORT;case THREE.UnsignedShortType:return f.UNSIGNED_SHORT;case THREE.IntType:return f.INT;case THREE.UnsignedShortType:return f.UNSIGNED_INT;case THREE.FloatType:return f.FLOAT;case THREE.AlphaFormat:return f.ALPHA;
 case THREE.LinearFilter:return f.LINEAR;case THREE.LinearMipMapNearestFilter:return f.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return f.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return f.BYTE;case THREE.UnsignedByteType:return f.UNSIGNED_BYTE;case THREE.ShortType:return f.SHORT;case THREE.UnsignedShortType:return f.UNSIGNED_SHORT;case THREE.IntType:return f.INT;case THREE.UnsignedShortType:return f.UNSIGNED_INT;case THREE.FloatType:return f.FLOAT;case THREE.AlphaFormat:return f.ALPHA;
 case THREE.RGBFormat:return f.RGB;case THREE.RGBAFormat:return f.RGBA;case THREE.LuminanceFormat:return f.LUMINANCE;case THREE.LuminanceAlphaFormat:return f.LUMINANCE_ALPHA}return 0}var J=this,f,Ba=[],ra=null,va=null,T=!0,Z=null,F=null,V=null,N=null,la=null,wa=null,O=null,Aa=0,Ia=0,Fa=0,xa=0,ia=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Ea=new Float32Array(16),Ra=new Float32Array(16),Ja=new THREE.Vector4,Ua={ambient:[0,
 case THREE.RGBFormat:return f.RGB;case THREE.RGBAFormat:return f.RGBA;case THREE.LuminanceFormat:return f.LUMINANCE;case THREE.LuminanceAlphaFormat:return f.LUMINANCE_ALPHA}return 0}var J=this,f,Ba=[],ra=null,va=null,T=!0,Z=null,F=null,V=null,N=null,la=null,wa=null,O=null,Aa=0,Ia=0,Fa=0,xa=0,ia=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Ea=new Float32Array(16),Ra=new Float32Array(16),Ja=new THREE.Vector4,Ua={ambient:[0,
 0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},Ga=b.canvas!==void 0?b.canvas:document.createElement("canvas"),Za=b.stencil!==void 0?b.stencil:!0,$a=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,ab=b.antialias!==void 0?b.antialias:!1,ua=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),Pa=b.clearAlpha!==void 0?b.clearAlpha:0;_maxLights=b.maxLights!==void 0?b.maxLights:4;this.data={vertices:0,faces:0,
 0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},Ga=b.canvas!==void 0?b.canvas:document.createElement("canvas"),Za=b.stencil!==void 0?b.stencil:!0,$a=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,ab=b.antialias!==void 0?b.antialias:!1,ua=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),Pa=b.clearAlpha!==void 0?b.clearAlpha:0;_maxLights=b.maxLights!==void 0?b.maxLights:4;this.data={vertices:0,faces:0,
@@ -230,57 +231,57 @@ u.faces,f.STATIC_DRAW);u.program=f.createProgram();f.attachShader(u.program,ha("
 f.getUniformLocation(u.program,"rotation");u.uniforms.scale=f.getUniformLocation(u.program,"scale");u.uniforms.alignment=f.getUniformLocation(u.program,"alignment");u.uniforms.map=f.getUniformLocation(u.program,"map");u.uniforms.opacity=f.getUniformLocation(u.program,"opacity");u.uniforms.useScreenCoordinates=f.getUniformLocation(u.program,"useScreenCoordinates");u.uniforms.affectedByDistance=f.getUniformLocation(u.program,"affectedByDistance");u.uniforms.screenPosition=f.getUniformLocation(u.program,
 f.getUniformLocation(u.program,"rotation");u.uniforms.scale=f.getUniformLocation(u.program,"scale");u.uniforms.alignment=f.getUniformLocation(u.program,"alignment");u.uniforms.map=f.getUniformLocation(u.program,"map");u.uniforms.opacity=f.getUniformLocation(u.program,"opacity");u.uniforms.useScreenCoordinates=f.getUniformLocation(u.program,"useScreenCoordinates");u.uniforms.affectedByDistance=f.getUniformLocation(u.program,"affectedByDistance");u.uniforms.screenPosition=f.getUniformLocation(u.program,
 "screenPosition");u.uniforms.modelViewMatrix=f.getUniformLocation(u.program,"modelViewMatrix");u.uniforms.projectionMatrix=f.getUniformLocation(u.program,"projectionMatrix");var Wa=!1;this.setSize=function(b,c){Ga.width=b;Ga.height=c;this.setViewport(0,0,Ga.width,Ga.height)};this.setViewport=function(b,c,d,e){Aa=b;Ia=c;Fa=d;xa=e;f.viewport(Aa,Ia,Fa,xa)};this.setScissor=function(b,c,d,e){f.scissor(b,c,d,e)};this.enableScissorTest=function(b){b?f.enable(f.SCISSOR_TEST):f.disable(f.SCISSOR_TEST)};this.enableDepthBufferWrite=
 "screenPosition");u.uniforms.modelViewMatrix=f.getUniformLocation(u.program,"modelViewMatrix");u.uniforms.projectionMatrix=f.getUniformLocation(u.program,"projectionMatrix");var Wa=!1;this.setSize=function(b,c){Ga.width=b;Ga.height=c;this.setViewport(0,0,Ga.width,Ga.height)};this.setViewport=function(b,c,d,e){Aa=b;Ia=c;Fa=d;xa=e;f.viewport(Aa,Ia,Fa,xa)};this.setScissor=function(b,c,d,e){f.scissor(b,c,d,e)};this.enableScissorTest=function(b){b?f.enable(f.SCISSOR_TEST):f.disable(f.SCISSOR_TEST)};this.enableDepthBufferWrite=
 function(b){T=b;f.depthMask(b)};this.setClearColorHex=function(b,c){ua.setHex(b);Pa=c;f.clearColor(ua.r,ua.g,ua.b,Pa)};this.setClearColor=function(b,c){ua.copy(b);Pa=c;f.clearColor(ua.r,ua.g,ua.b,Pa)};this.clear=function(){f.clear(f.COLOR_BUFFER_BIT|f.DEPTH_BUFFER_BIT|f.STENCIL_BUFFER_BIT)};this.getContext=function(){return f};this.initMaterial=function(b,c,d,e){var g,h,j;b instanceof THREE.MeshDepthMaterial?j="depth":b instanceof THREE.MeshNormalMaterial?j="normal":b instanceof THREE.MeshBasicMaterial?
 function(b){T=b;f.depthMask(b)};this.setClearColorHex=function(b,c){ua.setHex(b);Pa=c;f.clearColor(ua.r,ua.g,ua.b,Pa)};this.setClearColor=function(b,c){ua.copy(b);Pa=c;f.clearColor(ua.r,ua.g,ua.b,Pa)};this.clear=function(){f.clear(f.COLOR_BUFFER_BIT|f.DEPTH_BUFFER_BIT|f.STENCIL_BUFFER_BIT)};this.getContext=function(){return f};this.initMaterial=function(b,c,d,e){var g,h,j;b instanceof THREE.MeshDepthMaterial?j="depth":b instanceof THREE.MeshNormalMaterial?j="normal":b instanceof THREE.MeshBasicMaterial?
-j="basic":b instanceof THREE.MeshLambertMaterial?j="lambert":b instanceof THREE.MeshPhongMaterial?j="phong":b instanceof THREE.LineBasicMaterial?j="basic":b instanceof THREE.ParticleBasicMaterial&&(j="particle_basic");if(j){var k=THREE.ShaderLib[j];b.uniforms=THREE.UniformsUtils.clone(k.uniforms);b.vertexShader=k.vertexShader;b.fragmentShader=k.fragmentShader}var m,r,o;m=o=k=0;for(r=c.length;m<r;m++)h=c[m],h instanceof THREE.SpotLight&&o++,h instanceof THREE.DirectionalLight&&o++,h instanceof THREE.PointLight&&
-k++;k+o<=_maxLights?m=o:(m=Math.ceil(_maxLights*o/(k+o)),k=_maxLights-m);h={directional:m,point:k};k=o=0;for(m=c.length;k<m;k++)r=c[k],r instanceof THREE.SpotLight&&r.castShadow&&o++;var D=50;if(e!==void 0&&e instanceof THREE.SkinnedMesh)D=e.bones.length;var q;a:{m=b.fragmentShader;r=b.vertexShader;var k=b.uniforms,c=b.attributes,d={map:!!b.map,envMap:!!b.envMap,lightMap:!!b.lightMap,vertexColors:b.vertexColors,fog:d,sizeAttenuation:b.sizeAttenuation,skinning:b.skinning,morphTargets:b.morphTargets,
-maxMorphTargets:this.maxMorphTargets,maxDirLights:h.directional,maxPointLights:h.point,maxBones:D,shadowMapEnabled:this.shadowMapEnabled&&e.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:o,alphaTest:b.alphaTest},p,e=[];j?e.push(j):(e.push(m),e.push(r));for(p in d)e.push(p),e.push(d[p]);j=e.join();p=0;for(e=Ba.length;p<e;p++)if(Ba[p].code==j){q=Ba[p].program;break a}p=f.createProgram();e=[Ya?"#define VERTEX_TEXTURES":
+j="basic":b instanceof THREE.MeshLambertMaterial?j="lambert":b instanceof THREE.MeshPhongMaterial?j="phong":b instanceof THREE.LineBasicMaterial?j="basic":b instanceof THREE.ParticleBasicMaterial&&(j="particle_basic");if(j){var k=THREE.ShaderLib[j];b.uniforms=THREE.UniformsUtils.clone(k.uniforms);b.vertexShader=k.vertexShader;b.fragmentShader=k.fragmentShader}var o,m,p;o=p=k=0;for(m=c.length;o<m;o++)h=c[o],h instanceof THREE.SpotLight&&p++,h instanceof THREE.DirectionalLight&&p++,h instanceof THREE.PointLight&&
+k++;k+p<=_maxLights?o=p:(o=Math.ceil(_maxLights*p/(k+p)),k=_maxLights-o);h={directional:o,point:k};k=p=0;for(o=c.length;k<o;k++)m=c[k],m instanceof THREE.SpotLight&&m.castShadow&&p++;var D=50;if(e!==void 0&&e instanceof THREE.SkinnedMesh)D=e.bones.length;var q;a:{o=b.fragmentShader;m=b.vertexShader;var k=b.uniforms,c=b.attributes,d={map:!!b.map,envMap:!!b.envMap,lightMap:!!b.lightMap,vertexColors:b.vertexColors,fog:d,sizeAttenuation:b.sizeAttenuation,skinning:b.skinning,morphTargets:b.morphTargets,
+maxMorphTargets:this.maxMorphTargets,maxDirLights:h.directional,maxPointLights:h.point,maxBones:D,shadowMapEnabled:this.shadowMapEnabled&&e.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:p,alphaTest:b.alphaTest},r,e=[];j?e.push(j):(e.push(o),e.push(m));for(r in d)e.push(r),e.push(d[r]);j=e.join();r=0;for(e=Ba.length;r<e;r++)if(Ba[r].code==j){q=Ba[r].program;break a}r=f.createProgram();e=[Ya?"#define VERTEX_TEXTURES":
 "","#define MAX_DIR_LIGHTS "+d.maxDirLights,"#define MAX_POINT_LIGHTS "+d.maxPointLights,"#define MAX_SHADOWS "+d.maxShadows,"#define MAX_BONES "+d.maxBones,d.map?"#define USE_MAP":"",d.envMap?"#define USE_ENVMAP":"",d.lightMap?"#define USE_LIGHTMAP":"",d.vertexColors?"#define USE_COLOR":"",d.skinning?"#define USE_SKINNING":"",d.morphTargets?"#define USE_MORPHTARGETS":"",d.shadowMapEnabled?"#define USE_SHADOWMAP":"",d.shadowMapSoft?"#define SHADOWMAP_SOFT":"",d.sizeAttenuation?"#define USE_SIZEATTENUATION":
 "","#define MAX_DIR_LIGHTS "+d.maxDirLights,"#define MAX_POINT_LIGHTS "+d.maxPointLights,"#define MAX_SHADOWS "+d.maxShadows,"#define MAX_BONES "+d.maxBones,d.map?"#define USE_MAP":"",d.envMap?"#define USE_ENVMAP":"",d.lightMap?"#define USE_LIGHTMAP":"",d.vertexColors?"#define USE_COLOR":"",d.skinning?"#define USE_SKINNING":"",d.morphTargets?"#define USE_MORPHTARGETS":"",d.shadowMapEnabled?"#define USE_SHADOWMAP":"",d.shadowMapSoft?"#define SHADOWMAP_SOFT":"",d.sizeAttenuation?"#define USE_SIZEATTENUATION":
 "","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
 "","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
 h=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+d.maxDirLights,"#define MAX_POINT_LIGHTS "+d.maxPointLights,"#define MAX_SHADOWS "+d.maxShadows,d.alphaTest?"#define ALPHATEST "+d.alphaTest:"",d.fog?"#define USE_FOG":"",d.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",d.map?"#define USE_MAP":"",d.envMap?"#define USE_ENVMAP":"",d.lightMap?"#define USE_LIGHTMAP":"",d.vertexColors?"#define USE_COLOR":"",d.shadowMapEnabled?"#define USE_SHADOWMAP":"",d.shadowMapSoft?"#define SHADOWMAP_SOFT":
 h=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+d.maxDirLights,"#define MAX_POINT_LIGHTS "+d.maxPointLights,"#define MAX_SHADOWS "+d.maxShadows,d.alphaTest?"#define ALPHATEST "+d.alphaTest:"",d.fog?"#define USE_FOG":"",d.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",d.map?"#define USE_MAP":"",d.envMap?"#define USE_ENVMAP":"",d.lightMap?"#define USE_LIGHTMAP":"",d.vertexColors?"#define USE_COLOR":"",d.shadowMapEnabled?"#define USE_SHADOWMAP":"",d.shadowMapSoft?"#define SHADOWMAP_SOFT":
-"",d.shadowMapSoft?"#define SHADOWMAP_WIDTH "+d.shadowMapWidth.toFixed(1):"",d.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+d.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");f.attachShader(p,ha("fragment",h+m));f.attachShader(p,ha("vertex",e+r));f.linkProgram(p);f.getProgramParameter(p,f.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+f.getProgramParameter(p,f.VALIDATE_STATUS)+", gl error ["+f.getError()+"]");p.uniforms=
-{};p.attributes={};var t,e=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(t in k)e.push(t);t=e;e=0;for(k=t.length;e<k;e++)m=t[e],p.uniforms[m]=f.getUniformLocation(p,m);e=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(t=0;t<d.maxMorphTargets;t++)e.push("morphTarget"+t);for(q in c)e.push(q);q=e;t=0;for(c=q.length;t<c;t++)d=
-q[t],p.attributes[d]=f.getAttribLocation(p,d);Ba.push({program:p,code:j});q=p}b.program=q;q=b.program.attributes;q.position>=0&&f.enableVertexAttribArray(q.position);q.color>=0&&f.enableVertexAttribArray(q.color);q.normal>=0&&f.enableVertexAttribArray(q.normal);q.tangent>=0&&f.enableVertexAttribArray(q.tangent);b.skinning&&q.skinVertexA>=0&&q.skinVertexB>=0&&q.skinIndex>=0&&q.skinWeight>=0&&(f.enableVertexAttribArray(q.skinVertexA),f.enableVertexAttribArray(q.skinVertexB),f.enableVertexAttribArray(q.skinIndex),
-f.enableVertexAttribArray(q.skinWeight));if(b.attributes)for(g in b.attributes)q[g]!==void 0&&q[g]>=0&&f.enableVertexAttribArray(q[g]);if(b.morphTargets)for(g=b.numSupportedMorphTargets=0;g<this.maxMorphTargets;g++)t="morphTarget"+g,q[t]>=0&&(f.enableVertexAttribArray(q[t]),b.numSupportedMorphTargets++)};this.render=function(b,c,f,p){var G,u,fa,A,K,R,B,D,F=b.lights,Oa=b.fog;this.shadowMapEnabled&&C(b,c);J.data.vertices=0;J.data.faces=0;J.data.drawCalls=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,
-!1,c);c.matrixWorldInverse.flattenToArray(Ra);c.projectionMatrix.flattenToArray(Ea);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);o(Ca);this.initWebGLObjects(b);P(f);(this.autoClear||p)&&this.clear();K=b.__webglObjects.length;for(p=0;p<K;p++)if(G=b.__webglObjects[p],B=G.object,B.visible)if(!(B instanceof THREE.Mesh)||m(B)){if(B.matrixWorld.flattenToArray(B._objectMatrixArray),E(B,c,!0),q(G),G.render=!0,this.sortObjects)G.object.renderDepth?G.z=G.object.renderDepth:(Ja.copy(B.position),Ca.multiplyVector3(Ja),
-G.z=Ja.z)}else G.render=!1;else G.render=!1;this.sortObjects&&b.__webglObjects.sort(v);R=b.__webglObjectsImmediate.length;for(p=0;p<R;p++)G=b.__webglObjectsImmediate[p],B=G.object,B.visible&&(B.matrixAutoUpdate&&B.matrixWorld.flattenToArray(B._objectMatrixArray),E(B,c,!0),r(G));if(b.overrideMaterial){j(b.overrideMaterial.depthTest);t(b.overrideMaterial.blending);for(p=0;p<K;p++)if(G=b.__webglObjects[p],G.render)B=G.object,D=G.buffer,g(B),e(c,F,Oa,b.overrideMaterial,D,B);for(p=0;p<R;p++)G=b.__webglObjectsImmediate[p],
-B=G.object,B.visible&&(g(B),u=d(c,F,Oa,b.overrideMaterial,B),B.render(function(c){h(c,u,b.overrideMaterial.shading)}))}else{t(THREE.NormalBlending);for(p=K-1;p>=0;p--)if(G=b.__webglObjects[p],G.render){B=G.object;D=G.buffer;fa=G.opaque;g(B);for(G=0;G<fa.count;G++)A=fa.list[G],j(A.depthTest),k(A.polygonOffset,A.polygonOffsetFactor,A.polygonOffsetUnits),e(c,F,Oa,A,D,B)}for(p=0;p<R;p++)if(G=b.__webglObjectsImmediate[p],B=G.object,B.visible){fa=G.opaque;g(B);for(G=0;G<fa.count;G++)A=fa.list[G],j(A.depthTest),
-k(A.polygonOffset,A.polygonOffsetFactor,A.polygonOffsetUnits),u=d(c,F,Oa,A,B),B.render(function(b){h(b,u,A.shading)})}for(p=0;p<K;p++)if(G=b.__webglObjects[p],G.render){B=G.object;D=G.buffer;fa=G.transparent;g(B);for(G=0;G<fa.count;G++)A=fa.list[G],t(A.blending),j(A.depthTest),k(A.polygonOffset,A.polygonOffsetFactor,A.polygonOffsetUnits),e(c,F,Oa,A,D,B)}for(p=0;p<R;p++)if(G=b.__webglObjectsImmediate[p],B=G.object,B.visible){fa=G.transparent;g(B);for(G=0;G<fa.count;G++)A=fa.list[G],t(A.blending),j(A.depthTest),
+"",d.shadowMapSoft?"#define SHADOWMAP_WIDTH "+d.shadowMapWidth.toFixed(1):"",d.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+d.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");f.attachShader(r,ha("fragment",h+o));f.attachShader(r,ha("vertex",e+m));f.linkProgram(r);f.getProgramParameter(r,f.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+f.getProgramParameter(r,f.VALIDATE_STATUS)+", gl error ["+f.getError()+"]");r.uniforms=
+{};r.attributes={};var t,e=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(t in k)e.push(t);t=e;e=0;for(k=t.length;e<k;e++)o=t[e],r.uniforms[o]=f.getUniformLocation(r,o);e=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(t=0;t<d.maxMorphTargets;t++)e.push("morphTarget"+t);for(q in c)e.push(q);q=e;t=0;for(c=q.length;t<c;t++)d=
+q[t],r.attributes[d]=f.getAttribLocation(r,d);Ba.push({program:r,code:j});q=r}b.program=q;q=b.program.attributes;q.position>=0&&f.enableVertexAttribArray(q.position);q.color>=0&&f.enableVertexAttribArray(q.color);q.normal>=0&&f.enableVertexAttribArray(q.normal);q.tangent>=0&&f.enableVertexAttribArray(q.tangent);b.skinning&&q.skinVertexA>=0&&q.skinVertexB>=0&&q.skinIndex>=0&&q.skinWeight>=0&&(f.enableVertexAttribArray(q.skinVertexA),f.enableVertexAttribArray(q.skinVertexB),f.enableVertexAttribArray(q.skinIndex),
+f.enableVertexAttribArray(q.skinWeight));if(b.attributes)for(g in b.attributes)q[g]!==void 0&&q[g]>=0&&f.enableVertexAttribArray(q[g]);if(b.morphTargets)for(g=b.numSupportedMorphTargets=0;g<this.maxMorphTargets;g++)t="morphTarget"+g,q[t]>=0&&(f.enableVertexAttribArray(q[t]),b.numSupportedMorphTargets++)};this.render=function(b,c,f,m){var G,u,fa,A,K,R,B,D,F=b.lights,Oa=b.fog;this.shadowMapEnabled&&C(b,c);J.data.vertices=0;J.data.faces=0;J.data.drawCalls=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,
+!1,c);c.matrixWorldInverse.flattenToArray(Ra);c.projectionMatrix.flattenToArray(Ea);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);p(Ca);this.initWebGLObjects(b);P(f);(this.autoClear||m)&&this.clear();K=b.__webglObjects.length;for(m=0;m<K;m++)if(G=b.__webglObjects[m],B=G.object,B.visible)if(!(B instanceof THREE.Mesh)||o(B)){if(B.matrixWorld.flattenToArray(B._objectMatrixArray),E(B,c,!0),q(G),G.render=!0,this.sortObjects)G.object.renderDepth?G.z=G.object.renderDepth:(Ja.copy(B.position),Ca.multiplyVector3(Ja),
+G.z=Ja.z)}else G.render=!1;else G.render=!1;this.sortObjects&&b.__webglObjects.sort(v);R=b.__webglObjectsImmediate.length;for(m=0;m<R;m++)G=b.__webglObjectsImmediate[m],B=G.object,B.visible&&(B.matrixAutoUpdate&&B.matrixWorld.flattenToArray(B._objectMatrixArray),E(B,c,!0),r(G));if(b.overrideMaterial){j(b.overrideMaterial.depthTest);t(b.overrideMaterial.blending);for(m=0;m<K;m++)if(G=b.__webglObjects[m],G.render)B=G.object,D=G.buffer,g(B),e(c,F,Oa,b.overrideMaterial,D,B);for(m=0;m<R;m++)G=b.__webglObjectsImmediate[m],
+B=G.object,B.visible&&(g(B),u=d(c,F,Oa,b.overrideMaterial,B),B.render(function(c){h(c,u,b.overrideMaterial.shading)}))}else{t(THREE.NormalBlending);for(m=K-1;m>=0;m--)if(G=b.__webglObjects[m],G.render){B=G.object;D=G.buffer;fa=G.opaque;g(B);for(G=0;G<fa.count;G++)A=fa.list[G],j(A.depthTest),k(A.polygonOffset,A.polygonOffsetFactor,A.polygonOffsetUnits),e(c,F,Oa,A,D,B)}for(m=0;m<R;m++)if(G=b.__webglObjectsImmediate[m],B=G.object,B.visible){fa=G.opaque;g(B);for(G=0;G<fa.count;G++)A=fa.list[G],j(A.depthTest),
+k(A.polygonOffset,A.polygonOffsetFactor,A.polygonOffsetUnits),u=d(c,F,Oa,A,B),B.render(function(b){h(b,u,A.shading)})}for(m=0;m<K;m++)if(G=b.__webglObjects[m],G.render){B=G.object;D=G.buffer;fa=G.transparent;g(B);for(G=0;G<fa.count;G++)A=fa.list[G],t(A.blending),j(A.depthTest),k(A.polygonOffset,A.polygonOffsetFactor,A.polygonOffsetUnits),e(c,F,Oa,A,D,B)}for(m=0;m<R;m++)if(G=b.__webglObjectsImmediate[m],B=G.object,B.visible){fa=G.transparent;g(B);for(G=0;G<fa.count;G++)A=fa.list[G],t(A.blending),j(A.depthTest),
 k(A.polygonOffset,A.polygonOffsetFactor,A.polygonOffsetUnits),u=d(c,F,Oa,A,B),B.render(function(b){h(b,u,A.shading)})}}b.__webglSprites.length&&x(b,c);f&&f.minFilter!==THREE.NearestFilter&&f.minFilter!==THREE.LinearFilter&&Q(f)};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var d=b.__objectsAdded[0],e=b,g=void 0,h=void 0,j=void 0;if(d._modelViewMatrix==void 0)d._modelViewMatrix=new THREE.Matrix4,
 k(A.polygonOffset,A.polygonOffsetFactor,A.polygonOffsetUnits),u=d(c,F,Oa,A,B),B.render(function(b){h(b,u,A.shading)})}}b.__webglSprites.length&&x(b,c);f&&f.minFilter!==THREE.NearestFilter&&f.minFilter!==THREE.LinearFilter&&Q(f)};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var d=b.__objectsAdded[0],e=b,g=void 0,h=void 0,j=void 0;if(d._modelViewMatrix==void 0)d._modelViewMatrix=new THREE.Matrix4,
 d._normalMatrixArray=new Float32Array(9),d._modelViewMatrixArray=new Float32Array(16),d._objectMatrixArray=new Float32Array(16),d.matrixWorld.flattenToArray(d._objectMatrixArray);if(d instanceof THREE.Mesh)for(g in h=d.geometry,h.geometryGroups==void 0&&ta(h),h.geometryGroups){j=h.geometryGroups[g];if(!j.__webglVertexBuffer){var k=j;k.__webglVertexBuffer=f.createBuffer();k.__webglNormalBuffer=f.createBuffer();k.__webglTangentBuffer=f.createBuffer();k.__webglColorBuffer=f.createBuffer();k.__webglUVBuffer=
 d._normalMatrixArray=new Float32Array(9),d._modelViewMatrixArray=new Float32Array(16),d._objectMatrixArray=new Float32Array(16),d.matrixWorld.flattenToArray(d._objectMatrixArray);if(d instanceof THREE.Mesh)for(g in h=d.geometry,h.geometryGroups==void 0&&ta(h),h.geometryGroups){j=h.geometryGroups[g];if(!j.__webglVertexBuffer){var k=j;k.__webglVertexBuffer=f.createBuffer();k.__webglNormalBuffer=f.createBuffer();k.__webglTangentBuffer=f.createBuffer();k.__webglColorBuffer=f.createBuffer();k.__webglUVBuffer=
-f.createBuffer();k.__webglUV2Buffer=f.createBuffer();k.__webglSkinVertexABuffer=f.createBuffer();k.__webglSkinVertexBBuffer=f.createBuffer();k.__webglSkinIndicesBuffer=f.createBuffer();k.__webglSkinWeightsBuffer=f.createBuffer();k.__webglFaceBuffer=f.createBuffer();k.__webglLineBuffer=f.createBuffer();if(k.numMorphTargets){var m=void 0,p=void 0;k.__webglMorphTargetsBuffers=[];m=0;for(p=k.numMorphTargets;m<p;m++)k.__webglMorphTargetsBuffers.push(f.createBuffer())}for(var k=j,m=d,r=void 0,q=void 0,
-o=void 0,t=o=void 0,u=void 0,v=void 0,C=v=p=0,x=o=q=void 0,E=x=q=r=void 0,o=void 0,t=m.geometry,u=t.faces,x=k.faces,r=0,q=x.length;r<q;r++)o=x[r],o=u[o],o instanceof THREE.Face3?(p+=3,v+=1,C+=3):o instanceof THREE.Face4&&(p+=4,v+=2,C+=4);for(var r=k,q=m,I=x=u=void 0,H=void 0,I=void 0,o=[],u=0,x=q.materials.length;u<x;u++)if(I=q.materials[u],I instanceof THREE.MeshFaceMaterial){I=0;for(l=r.materials.length;I<l;I++)(H=r.materials[I])&&o.push(H)}else(H=I)&&o.push(H);r=o;k.__materials=r;a:{u=q=void 0;
-x=r.length;for(q=0;q<x;q++)if(u=r[q],u.map||u.lightMap||u instanceof THREE.MeshShaderMaterial){q=!0;break a}q=!1}a:{x=u=void 0;o=r.length;for(u=0;u<o;u++)if(x=r[u],!(x instanceof THREE.MeshBasicMaterial&&!x.envMap||x instanceof THREE.MeshDepthMaterial)){x=x&&x.shading!=void 0&&x.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}x=!1}a:{o=u=void 0;I=r.length;for(u=0;u<I;u++)if(o=r[u],o.vertexColors){o=o.vertexColors;break a}o=!1}k.__vertexArray=new Float32Array(p*3);if(x)k.__normalArray=
-new Float32Array(p*3);if(t.hasTangents)k.__tangentArray=new Float32Array(p*4);if(o)k.__colorArray=new Float32Array(p*3);if(q){if(t.faceUvs.length>0||t.faceVertexUvs.length>0)k.__uvArray=new Float32Array(p*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)k.__uv2Array=new Float32Array(p*2)}if(m.geometry.skinWeights.length&&m.geometry.skinIndices.length)k.__skinVertexAArray=new Float32Array(p*4),k.__skinVertexBArray=new Float32Array(p*4),k.__skinIndexArray=new Float32Array(p*4),k.__skinWeightArray=
-new Float32Array(p*4);k.__faceArray=new Uint16Array(v*3+(m.geometry.edgeFaces?m.geometry.edgeFaces.length*6:0));k.__lineArray=new Uint16Array(C*2);if(k.numMorphTargets){k.__morphTargetsArrays=[];t=0;for(u=k.numMorphTargets;t<u;t++)k.__morphTargetsArrays.push(new Float32Array(p*3))}k.__needsSmoothNormals=x==THREE.SmoothShading;k.__uvType=q;k.__vertexColorType=o;k.__normalType=x;k.__webglFaceCount=v*3+(m.geometry.edgeFaces?m.geometry.edgeFaces.length*6:0);k.__webglLineCount=C*2;t=0;for(u=r.length;t<
-u;t++)if(q=r[t],q.attributes){if(k.__webglCustomAttributes===void 0)k.__webglCustomAttributes={};for(a in q.attributes){o=q.attributes[a];x={};for(E in o)x[E]=o[E];if(!x.__webglInitialized||x.createUniqueBuffers)x.__webglInitialized=!0,v=1,x.type==="v2"?v=2:x.type==="v3"?v=3:x.type==="v4"?v=4:x.type==="c"&&(v=3),x.size=v,x.array=new Float32Array(p*v),x.buffer=f.createBuffer(),x.buffer.belongsToAttribute=a,o.needsUpdate=!0,x.__original=o;k.__webglCustomAttributes[a]=x}}k.__inittedArrays=!0;h.__dirtyVertices=
+f.createBuffer();k.__webglUV2Buffer=f.createBuffer();k.__webglSkinVertexABuffer=f.createBuffer();k.__webglSkinVertexBBuffer=f.createBuffer();k.__webglSkinIndicesBuffer=f.createBuffer();k.__webglSkinWeightsBuffer=f.createBuffer();k.__webglFaceBuffer=f.createBuffer();k.__webglLineBuffer=f.createBuffer();if(k.numMorphTargets){var m=void 0,o=void 0;k.__webglMorphTargetsBuffers=[];m=0;for(o=k.numMorphTargets;m<o;m++)k.__webglMorphTargetsBuffers.push(f.createBuffer())}for(var k=j,m=d,q=void 0,r=void 0,
+p=void 0,t=p=void 0,u=void 0,v=void 0,C=v=o=0,x=p=r=void 0,E=x=r=q=void 0,p=void 0,t=m.geometry,u=t.faces,x=k.faces,q=0,r=x.length;q<r;q++)p=x[q],p=u[p],p instanceof THREE.Face3?(o+=3,v+=1,C+=3):p instanceof THREE.Face4&&(o+=4,v+=2,C+=4);for(var q=k,r=m,I=x=u=void 0,H=void 0,I=void 0,p=[],u=0,x=r.materials.length;u<x;u++)if(I=r.materials[u],I instanceof THREE.MeshFaceMaterial){I=0;for(l=q.materials.length;I<l;I++)(H=q.materials[I])&&p.push(H)}else(H=I)&&p.push(H);q=p;k.__materials=q;a:{u=r=void 0;
+x=q.length;for(r=0;r<x;r++)if(u=q[r],u.map||u.lightMap||u instanceof THREE.MeshShaderMaterial){r=!0;break a}r=!1}a:{x=u=void 0;p=q.length;for(u=0;u<p;u++)if(x=q[u],!(x instanceof THREE.MeshBasicMaterial&&!x.envMap||x instanceof THREE.MeshDepthMaterial)){x=x&&x.shading!=void 0&&x.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}x=!1}a:{p=u=void 0;I=q.length;for(u=0;u<I;u++)if(p=q[u],p.vertexColors){p=p.vertexColors;break a}p=!1}k.__vertexArray=new Float32Array(o*3);if(x)k.__normalArray=
+new Float32Array(o*3);if(t.hasTangents)k.__tangentArray=new Float32Array(o*4);if(p)k.__colorArray=new Float32Array(o*3);if(r){if(t.faceUvs.length>0||t.faceVertexUvs.length>0)k.__uvArray=new Float32Array(o*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)k.__uv2Array=new Float32Array(o*2)}if(m.geometry.skinWeights.length&&m.geometry.skinIndices.length)k.__skinVertexAArray=new Float32Array(o*4),k.__skinVertexBArray=new Float32Array(o*4),k.__skinIndexArray=new Float32Array(o*4),k.__skinWeightArray=
+new Float32Array(o*4);k.__faceArray=new Uint16Array(v*3+(m.geometry.edgeFaces?m.geometry.edgeFaces.length*6:0));k.__lineArray=new Uint16Array(C*2);if(k.numMorphTargets){k.__morphTargetsArrays=[];t=0;for(u=k.numMorphTargets;t<u;t++)k.__morphTargetsArrays.push(new Float32Array(o*3))}k.__needsSmoothNormals=x==THREE.SmoothShading;k.__uvType=r;k.__vertexColorType=p;k.__normalType=x;k.__webglFaceCount=v*3+(m.geometry.edgeFaces?m.geometry.edgeFaces.length*6:0);k.__webglLineCount=C*2;t=0;for(u=q.length;t<
+u;t++)if(r=q[t],r.attributes){if(k.__webglCustomAttributes===void 0)k.__webglCustomAttributes={};for(a in r.attributes){p=r.attributes[a];x={};for(E in p)x[E]=p[E];if(!x.__webglInitialized||x.createUniqueBuffers)x.__webglInitialized=!0,v=1,x.type==="v2"?v=2:x.type==="v3"?v=3:x.type==="v4"?v=4:x.type==="c"&&(v=3),x.size=v,x.array=new Float32Array(o*v),x.buffer=f.createBuffer(),x.buffer.belongsToAttribute=a,p.needsUpdate=!0,x.__original=p;k.__webglCustomAttributes[a]=x}}k.__inittedArrays=!0;h.__dirtyVertices=
 !0;h.__dirtyMorphTargets=!0;h.__dirtyElements=!0;h.__dirtyUvs=!0;h.__dirtyNormals=!0;h.__dirtyTangents=!0;h.__dirtyColors=!0}U(e.__webglObjects,j,d)}else if(d instanceof THREE.Ribbon){h=d.geometry;if(!h.__webglVertexBuffer)g=h,g.__webglVertexBuffer=f.createBuffer(),g.__webglColorBuffer=f.createBuffer(),g=h,j=g.vertices.length,g.__vertexArray=new Float32Array(j*3),g.__colorArray=new Float32Array(j*3),g.__webglVertexCount=j,h.__dirtyVertices=!0,h.__dirtyColors=!0;U(e.__webglObjects,h,d)}else if(d instanceof
 !0;h.__dirtyMorphTargets=!0;h.__dirtyElements=!0;h.__dirtyUvs=!0;h.__dirtyNormals=!0;h.__dirtyTangents=!0;h.__dirtyColors=!0}U(e.__webglObjects,j,d)}else if(d instanceof THREE.Ribbon){h=d.geometry;if(!h.__webglVertexBuffer)g=h,g.__webglVertexBuffer=f.createBuffer(),g.__webglColorBuffer=f.createBuffer(),g=h,j=g.vertices.length,g.__vertexArray=new Float32Array(j*3),g.__colorArray=new Float32Array(j*3),g.__webglVertexCount=j,h.__dirtyVertices=!0,h.__dirtyColors=!0;U(e.__webglObjects,h,d)}else if(d instanceof
 THREE.Line){h=d.geometry;if(!h.__webglVertexBuffer)g=h,g.__webglVertexBuffer=f.createBuffer(),g.__webglColorBuffer=f.createBuffer(),g=h,j=g.vertices.length,g.__vertexArray=new Float32Array(j*3),g.__colorArray=new Float32Array(j*3),g.__webglLineCount=j,h.__dirtyVertices=!0,h.__dirtyColors=!0;U(e.__webglObjects,h,d)}else if(d instanceof THREE.ParticleSystem){h=d.geometry;if(!h.__webglVertexBuffer){g=h;g.__webglVertexBuffer=f.createBuffer();g.__webglColorBuffer=f.createBuffer();g=h;j=d;k=g.vertices.length;
 THREE.Line){h=d.geometry;if(!h.__webglVertexBuffer)g=h,g.__webglVertexBuffer=f.createBuffer(),g.__webglColorBuffer=f.createBuffer(),g=h,j=g.vertices.length,g.__vertexArray=new Float32Array(j*3),g.__colorArray=new Float32Array(j*3),g.__webglLineCount=j,h.__dirtyVertices=!0,h.__dirtyColors=!0;U(e.__webglObjects,h,d)}else if(d instanceof THREE.ParticleSystem){h=d.geometry;if(!h.__webglVertexBuffer){g=h;g.__webglVertexBuffer=f.createBuffer();g.__webglColorBuffer=f.createBuffer();g=h;j=d;k=g.vertices.length;
-g.__vertexArray=new Float32Array(k*3);g.__colorArray=new Float32Array(k*3);g.__sortArray=[];g.__webglParticleCount=k;g.__materials=j.materials;E=p=m=void 0;m=0;for(p=j.materials.length;m<p;m++)if(E=j.materials[m],E.attributes){if(g.__webglCustomAttributes===void 0)g.__webglCustomAttributes={};for(a in E.attributes){originalAttribute=E.attributes[a];attribute={};for(property in originalAttribute)attribute[property]=originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=
+g.__vertexArray=new Float32Array(k*3);g.__colorArray=new Float32Array(k*3);g.__sortArray=[];g.__webglParticleCount=k;g.__materials=j.materials;E=o=m=void 0;m=0;for(o=j.materials.length;m<o;m++)if(E=j.materials[m],E.attributes){if(g.__webglCustomAttributes===void 0)g.__webglCustomAttributes={};for(a in E.attributes){originalAttribute=E.attributes[a];attribute={};for(property in originalAttribute)attribute[property]=originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=
 !0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=4:attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(k*size),attribute.buffer=f.createBuffer(),attribute.buffer.belongsToAttribute=a,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;g.__webglCustomAttributes[a]=attribute}}h.__dirtyVertices=!0;h.__dirtyColors=!0}U(e.__webglObjects,h,d)}else THREE.MarchingCubes!==void 0&&d instanceof THREE.MarchingCubes?
 !0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=4:attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(k*size),attribute.buffer=f.createBuffer(),attribute.buffer.belongsToAttribute=a,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;g.__webglCustomAttributes[a]=attribute}}h.__dirtyVertices=!0;h.__dirtyColors=!0}U(e.__webglObjects,h,d)}else THREE.MarchingCubes!==void 0&&d instanceof THREE.MarchingCubes?
 e.__webglObjectsImmediate.push({object:d,opaque:{list:[],count:0},transparent:{list:[],count:0}}):d instanceof THREE.Sprite&&e.__webglSprites.push(d);b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;){e=b.__objectsRemoved[0];d=b;if(e instanceof THREE.Mesh||e instanceof THREE.ParticleSystem||e instanceof THREE.Ribbon||e instanceof THREE.Line)za(d.__webglObjects,e);else if(e instanceof THREE.Sprite){d=d.__webglSprites;h=void 0;for(h=d.length-1;h>=0;h--)d[h]==e&&d.splice(h,1)}else e instanceof
 e.__webglObjectsImmediate.push({object:d,opaque:{list:[],count:0},transparent:{list:[],count:0}}):d instanceof THREE.Sprite&&e.__webglSprites.push(d);b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;){e=b.__objectsRemoved[0];d=b;if(e instanceof THREE.Mesh||e instanceof THREE.ParticleSystem||e instanceof THREE.Ribbon||e instanceof THREE.Line)za(d.__webglObjects,e);else if(e instanceof THREE.Sprite){d=d.__webglSprites;h=void 0;for(h=d.length-1;h>=0;h--)d[h]==e&&d.splice(h,1)}else e instanceof
-THREE.MarchingCubes&&za(d.__webglObjectsImmediate,e);b.__objectsRemoved.splice(0,1)}d=0;for(e=b.__webglObjects.length;d<e;d++)if(g=b.__webglObjects[d].object,m=k=h=j=void 0,g instanceof THREE.Mesh){h=g.geometry;for(j in h.geometryGroups)if(k=h.geometryGroups[j],m=K(k),h.__dirtyVertices||h.__dirtyMorphTargets||h.__dirtyElements||h.__dirtyUvs||h.__dirtyNormals||h.__dirtyColors||h.__dirtyTangents||m)if(m=k,p=f.DYNAMIC_DRAW,E=!h.dynamic,m.__inittedArrays){var F=C=v=void 0,z=void 0,J=F=void 0,ga=void 0,
-O=void 0,M=void 0,L=H=I=o=x=u=q=r=t=void 0,s=z=M=z=O=ga=void 0,n=void 0,y=n=s=ga=void 0,N=void 0,S=y=n=s=F=F=J=M=z=y=n=s=N=y=n=s=N=y=n=s=void 0,ja=0,ma=0,V=0,Y=0,T=0,P=0,X=0,Q=0,ka=0,w=0,na=0,y=s=0,y=void 0,oa=m.__vertexArray,ia=m.__uvArray,la=m.__uv2Array,W=m.__normalArray,$=m.__tangentArray,pa=m.__colorArray,aa=m.__skinVertexAArray,ca=m.__skinVertexBArray,da=m.__skinIndexArray,ea=m.__skinWeightArray,ra=m.__morphTargetsArrays,Z=m.__webglCustomAttributes,n=void 0,ha=m.__faceArray,Da=m.__lineArray,
-wa=m.__needsSmoothNormals,r=m.__vertexColorType,t=m.__uvType,q=m.__normalType,sa=g.geometry,ua=sa.__dirtyVertices,va=sa.__dirtyElements,qa=sa.__dirtyUvs,Aa=sa.__dirtyNormals,Ba=sa.__dirtyTangents,Ca=sa.__dirtyColors,Ea=sa.__dirtyMorphTargets,xa=sa.vertices,Fa=m.faces,Ia=sa.faces,Ga=sa.faceVertexUvs[0],Ja=sa.faceVertexUvs[1],La=sa.skinVerticesA,Ma=sa.skinVerticesB,Na=sa.skinIndices,Ka=sa.skinWeights,Ha=sa.morphTargets;if(Z)for(S in Z)Z[S].offset=0,Z[S].offsetSrc=0;v=0;for(C=Fa.length;v<C;v++)if(F=
-Fa[v],z=Ia[F],Ga&&(u=Ga[F]),Ja&&(x=Ja[F]),F=z.vertexNormals,J=z.normal,ga=z.vertexColors,O=z.color,M=z.vertexTangents,z instanceof THREE.Face3){if(ua)o=xa[z.a].position,I=xa[z.b].position,H=xa[z.c].position,oa[ma]=o.x,oa[ma+1]=o.y,oa[ma+2]=o.z,oa[ma+3]=I.x,oa[ma+4]=I.y,oa[ma+5]=I.z,oa[ma+6]=H.x,oa[ma+7]=H.y,oa[ma+8]=H.z,ma+=9;if(Z)for(S in Z)if(n=Z[S],n.__original.needsUpdate)s=n.offset,y=n.offsetSrc,n.size===1?(n.boundTo===void 0||n.boundTo==="vertices"?(n.array[s]=n.value[z.a],n.array[s+1]=n.value[z.b],
-n.array[s+2]=n.value[z.c]):n.boundTo==="faces"?(y=n.value[y],n.array[s]=y,n.array[s+1]=y,n.array[s+2]=y,n.offsetSrc++):n.boundTo==="faceVertices"&&(n.array[s]=n.value[y],n.array[s+1]=n.value[y+1],n.array[s+2]=n.value[y+2],n.offsetSrc+=3),n.offset+=3):(n.boundTo===void 0||n.boundTo==="vertices"?(o=n.value[z.a],I=n.value[z.b],H=n.value[z.c]):n.boundTo==="faces"?(H=I=o=y=n.value[y],n.offsetSrc++):n.boundTo==="faceVertices"&&(o=n.value[y],I=n.value[y+1],H=n.value[y+2],n.offsetSrc+=3),n.size===2?(n.array[s]=
-o.x,n.array[s+1]=o.y,n.array[s+2]=I.x,n.array[s+3]=I.y,n.array[s+4]=H.x,n.array[s+5]=H.y,n.offset+=6):n.size===3?(n.type==="c"?(n.array[s]=o.r,n.array[s+1]=o.g,n.array[s+2]=o.b,n.array[s+3]=I.r,n.array[s+4]=I.g,n.array[s+5]=I.b,n.array[s+6]=H.r,n.array[s+7]=H.g,n.array[s+8]=H.b):(n.array[s]=o.x,n.array[s+1]=o.y,n.array[s+2]=o.z,n.array[s+3]=I.x,n.array[s+4]=I.y,n.array[s+5]=I.z,n.array[s+6]=H.x,n.array[s+7]=H.y,n.array[s+8]=H.z),n.offset+=9):(n.array[s]=o.x,n.array[s+1]=o.y,n.array[s+2]=o.z,n.array[s+
-3]=o.w,n.array[s+4]=I.x,n.array[s+5]=I.y,n.array[s+6]=I.z,n.array[s+7]=I.w,n.array[s+8]=H.x,n.array[s+9]=H.y,n.array[s+10]=H.z,n.array[s+11]=H.w,n.offset+=12));if(Ea){s=0;for(n=Ha.length;s<n;s++)o=Ha[s].vertices[z.a].position,I=Ha[s].vertices[z.b].position,H=Ha[s].vertices[z.c].position,y=ra[s],y[na]=o.x,y[na+1]=o.y,y[na+2]=o.z,y[na+3]=I.x,y[na+4]=I.y,y[na+5]=I.z,y[na+6]=H.x,y[na+7]=H.y,y[na+8]=H.z;na+=9}if(Ka.length)s=Ka[z.a],n=Ka[z.b],y=Ka[z.c],ea[w]=s.x,ea[w+1]=s.y,ea[w+2]=s.z,ea[w+3]=s.w,ea[w+
+THREE.MarchingCubes&&za(d.__webglObjectsImmediate,e);b.__objectsRemoved.splice(0,1)}d=0;for(e=b.__webglObjects.length;d<e;d++)if(g=b.__webglObjects[d].object,m=k=h=j=void 0,g instanceof THREE.Mesh){h=g.geometry;for(j in h.geometryGroups)if(k=h.geometryGroups[j],m=K(k),h.__dirtyVertices||h.__dirtyMorphTargets||h.__dirtyElements||h.__dirtyUvs||h.__dirtyNormals||h.__dirtyColors||h.__dirtyTangents||m)if(m=k,o=f.DYNAMIC_DRAW,E=!h.dynamic,m.__inittedArrays){var F=C=v=void 0,z=void 0,J=F=void 0,ga=void 0,
+O=void 0,M=void 0,L=H=I=p=x=u=r=q=t=void 0,s=z=M=z=O=ga=void 0,n=void 0,y=n=s=ga=void 0,N=void 0,S=y=n=s=F=F=J=M=z=y=n=s=N=y=n=s=N=y=n=s=void 0,ja=0,ma=0,V=0,Y=0,T=0,P=0,X=0,Q=0,ka=0,w=0,na=0,y=s=0,y=void 0,oa=m.__vertexArray,ia=m.__uvArray,la=m.__uv2Array,W=m.__normalArray,$=m.__tangentArray,pa=m.__colorArray,aa=m.__skinVertexAArray,ca=m.__skinVertexBArray,da=m.__skinIndexArray,ea=m.__skinWeightArray,ra=m.__morphTargetsArrays,Z=m.__webglCustomAttributes,n=void 0,ha=m.__faceArray,Da=m.__lineArray,
+wa=m.__needsSmoothNormals,q=m.__vertexColorType,t=m.__uvType,r=m.__normalType,sa=g.geometry,ua=sa.__dirtyVertices,va=sa.__dirtyElements,qa=sa.__dirtyUvs,Aa=sa.__dirtyNormals,Ba=sa.__dirtyTangents,Ca=sa.__dirtyColors,Ea=sa.__dirtyMorphTargets,xa=sa.vertices,Fa=m.faces,Ia=sa.faces,Ga=sa.faceVertexUvs[0],Ja=sa.faceVertexUvs[1],La=sa.skinVerticesA,Ma=sa.skinVerticesB,Na=sa.skinIndices,Ka=sa.skinWeights,Ha=sa.morphTargets;if(Z)for(S in Z)Z[S].offset=0,Z[S].offsetSrc=0;v=0;for(C=Fa.length;v<C;v++)if(F=
+Fa[v],z=Ia[F],Ga&&(u=Ga[F]),Ja&&(x=Ja[F]),F=z.vertexNormals,J=z.normal,ga=z.vertexColors,O=z.color,M=z.vertexTangents,z instanceof THREE.Face3){if(ua)p=xa[z.a].position,I=xa[z.b].position,H=xa[z.c].position,oa[ma]=p.x,oa[ma+1]=p.y,oa[ma+2]=p.z,oa[ma+3]=I.x,oa[ma+4]=I.y,oa[ma+5]=I.z,oa[ma+6]=H.x,oa[ma+7]=H.y,oa[ma+8]=H.z,ma+=9;if(Z)for(S in Z)if(n=Z[S],n.__original.needsUpdate)s=n.offset,y=n.offsetSrc,n.size===1?(n.boundTo===void 0||n.boundTo==="vertices"?(n.array[s]=n.value[z.a],n.array[s+1]=n.value[z.b],
+n.array[s+2]=n.value[z.c]):n.boundTo==="faces"?(y=n.value[y],n.array[s]=y,n.array[s+1]=y,n.array[s+2]=y,n.offsetSrc++):n.boundTo==="faceVertices"&&(n.array[s]=n.value[y],n.array[s+1]=n.value[y+1],n.array[s+2]=n.value[y+2],n.offsetSrc+=3),n.offset+=3):(n.boundTo===void 0||n.boundTo==="vertices"?(p=n.value[z.a],I=n.value[z.b],H=n.value[z.c]):n.boundTo==="faces"?(H=I=p=y=n.value[y],n.offsetSrc++):n.boundTo==="faceVertices"&&(p=n.value[y],I=n.value[y+1],H=n.value[y+2],n.offsetSrc+=3),n.size===2?(n.array[s]=
+p.x,n.array[s+1]=p.y,n.array[s+2]=I.x,n.array[s+3]=I.y,n.array[s+4]=H.x,n.array[s+5]=H.y,n.offset+=6):n.size===3?(n.type==="c"?(n.array[s]=p.r,n.array[s+1]=p.g,n.array[s+2]=p.b,n.array[s+3]=I.r,n.array[s+4]=I.g,n.array[s+5]=I.b,n.array[s+6]=H.r,n.array[s+7]=H.g,n.array[s+8]=H.b):(n.array[s]=p.x,n.array[s+1]=p.y,n.array[s+2]=p.z,n.array[s+3]=I.x,n.array[s+4]=I.y,n.array[s+5]=I.z,n.array[s+6]=H.x,n.array[s+7]=H.y,n.array[s+8]=H.z),n.offset+=9):(n.array[s]=p.x,n.array[s+1]=p.y,n.array[s+2]=p.z,n.array[s+
+3]=p.w,n.array[s+4]=I.x,n.array[s+5]=I.y,n.array[s+6]=I.z,n.array[s+7]=I.w,n.array[s+8]=H.x,n.array[s+9]=H.y,n.array[s+10]=H.z,n.array[s+11]=H.w,n.offset+=12));if(Ea){s=0;for(n=Ha.length;s<n;s++)p=Ha[s].vertices[z.a].position,I=Ha[s].vertices[z.b].position,H=Ha[s].vertices[z.c].position,y=ra[s],y[na]=p.x,y[na+1]=p.y,y[na+2]=p.z,y[na+3]=I.x,y[na+4]=I.y,y[na+5]=I.z,y[na+6]=H.x,y[na+7]=H.y,y[na+8]=H.z;na+=9}if(Ka.length)s=Ka[z.a],n=Ka[z.b],y=Ka[z.c],ea[w]=s.x,ea[w+1]=s.y,ea[w+2]=s.z,ea[w+3]=s.w,ea[w+
 4]=n.x,ea[w+5]=n.y,ea[w+6]=n.z,ea[w+7]=n.w,ea[w+8]=y.x,ea[w+9]=y.y,ea[w+10]=y.z,ea[w+11]=y.w,s=Na[z.a],n=Na[z.b],y=Na[z.c],da[w]=s.x,da[w+1]=s.y,da[w+2]=s.z,da[w+3]=s.w,da[w+4]=n.x,da[w+5]=n.y,da[w+6]=n.z,da[w+7]=n.w,da[w+8]=y.x,da[w+9]=y.y,da[w+10]=y.z,da[w+11]=y.w,s=La[z.a],n=La[z.b],y=La[z.c],aa[w]=s.x,aa[w+1]=s.y,aa[w+2]=s.z,aa[w+3]=1,aa[w+4]=n.x,aa[w+5]=n.y,aa[w+6]=n.z,aa[w+7]=1,aa[w+8]=y.x,aa[w+9]=y.y,aa[w+10]=y.z,aa[w+11]=1,s=Ma[z.a],n=Ma[z.b],y=Ma[z.c],ca[w]=s.x,ca[w+1]=s.y,ca[w+2]=s.z,ca[w+
 4]=n.x,ea[w+5]=n.y,ea[w+6]=n.z,ea[w+7]=n.w,ea[w+8]=y.x,ea[w+9]=y.y,ea[w+10]=y.z,ea[w+11]=y.w,s=Na[z.a],n=Na[z.b],y=Na[z.c],da[w]=s.x,da[w+1]=s.y,da[w+2]=s.z,da[w+3]=s.w,da[w+4]=n.x,da[w+5]=n.y,da[w+6]=n.z,da[w+7]=n.w,da[w+8]=y.x,da[w+9]=y.y,da[w+10]=y.z,da[w+11]=y.w,s=La[z.a],n=La[z.b],y=La[z.c],aa[w]=s.x,aa[w+1]=s.y,aa[w+2]=s.z,aa[w+3]=1,aa[w+4]=n.x,aa[w+5]=n.y,aa[w+6]=n.z,aa[w+7]=1,aa[w+8]=y.x,aa[w+9]=y.y,aa[w+10]=y.z,aa[w+11]=1,s=Ma[z.a],n=Ma[z.b],y=Ma[z.c],ca[w]=s.x,ca[w+1]=s.y,ca[w+2]=s.z,ca[w+
-3]=1,ca[w+4]=n.x,ca[w+5]=n.y,ca[w+6]=n.z,ca[w+7]=1,ca[w+8]=y.x,ca[w+9]=y.y,ca[w+10]=y.z,ca[w+11]=1,w+=12;if(Ca&&r)ga.length==3&&r==THREE.VertexColors?(z=ga[0],s=ga[1],n=ga[2]):n=s=z=O,pa[ka]=z.r,pa[ka+1]=z.g,pa[ka+2]=z.b,pa[ka+3]=s.r,pa[ka+4]=s.g,pa[ka+5]=s.b,pa[ka+6]=n.r,pa[ka+7]=n.g,pa[ka+8]=n.b,ka+=9;if(Ba&&sa.hasTangents)ga=M[0],O=M[1],z=M[2],$[X]=ga.x,$[X+1]=ga.y,$[X+2]=ga.z,$[X+3]=ga.w,$[X+4]=O.x,$[X+5]=O.y,$[X+6]=O.z,$[X+7]=O.w,$[X+8]=z.x,$[X+9]=z.y,$[X+10]=z.z,$[X+11]=z.w,X+=12;if(Aa&&q)if(F.length==
-3&&wa)for(M=0;M<3;M++)J=F[M],W[P]=J.x,W[P+1]=J.y,W[P+2]=J.z,P+=3;else for(M=0;M<3;M++)W[P]=J.x,W[P+1]=J.y,W[P+2]=J.z,P+=3;if(qa&&u!==void 0&&t)for(M=0;M<3;M++)F=u[M],ia[V]=F.u,ia[V+1]=F.v,V+=2;if(qa&&x!==void 0&&t)for(M=0;M<3;M++)F=x[M],la[Y]=F.u,la[Y+1]=F.v,Y+=2;va&&(ha[T]=ja,ha[T+1]=ja+1,ha[T+2]=ja+2,T+=3,Da[Q]=ja,Da[Q+1]=ja+1,Da[Q+2]=ja,Da[Q+3]=ja+2,Da[Q+4]=ja+1,Da[Q+5]=ja+2,Q+=6,ja+=3)}else if(z instanceof THREE.Face4){if(ua)o=xa[z.a].position,I=xa[z.b].position,H=xa[z.c].position,L=xa[z.d].position,
-oa[ma]=o.x,oa[ma+1]=o.y,oa[ma+2]=o.z,oa[ma+3]=I.x,oa[ma+4]=I.y,oa[ma+5]=I.z,oa[ma+6]=H.x,oa[ma+7]=H.y,oa[ma+8]=H.z,oa[ma+9]=L.x,oa[ma+10]=L.y,oa[ma+11]=L.z,ma+=12;if(Z)for(S in Z)if(n=Z[S],n.__original.needsUpdate)s=n.offset,y=n.offsetSrc,n.size===1?(n.boundTo===void 0||n.boundTo==="vertices"?(n.array[s]=n.value[z.a],n.array[s+1]=n.value[z.b],n.array[s+2]=n.value[z.c],n.array[s+3]=n.value[z.d]):n.boundTo==="faces"?(y=n.value[y],n.array[s]=y,n.array[s+1]=y,n.array[s+2]=y,n.array[s+3]=y,n.offsetSrc++):
-n.boundTo==="faceVertices"&&(n.array[s]=n.value[y],n.array[s+1]=n.value[y+1],n.array[s+2]=n.value[y+2],n.array[s+3]=n.value[y+3],n.offsetSrc+=4),n.offset+=4):(n.boundTo===void 0||n.boundTo==="vertices"?(o=n.value[z.a],I=n.value[z.b],H=n.value[z.c],L=n.value[z.d]):n.boundTo==="faces"?(L=H=I=o=y=n.value[y],n.offsetSrc++):n.boundTo==="faceVertices"&&(o=n.value[y],I=n.value[y+1],H=n.value[y+2],L=n.value[y+3],n.offsetSrc+=4),n.size===2?(n.array[s]=o.x,n.array[s+1]=o.y,n.array[s+2]=I.x,n.array[s+3]=I.y,
-n.array[s+4]=H.x,n.array[s+5]=H.y,n.array[s+6]=L.x,n.array[s+7]=L.y,n.offset+=8):n.size===3?(n.type==="c"?(n.array[s]=o.r,n.array[s+1]=o.g,n.array[s+2]=o.b,n.array[s+3]=I.r,n.array[s+4]=I.g,n.array[s+5]=I.b,n.array[s+6]=H.r,n.array[s+7]=H.g,n.array[s+8]=H.b,n.array[s+9]=L.r,n.array[s+10]=L.g,n.array[s+11]=L.b):(n.array[s]=o.x,n.array[s+1]=o.y,n.array[s+2]=o.z,n.array[s+3]=I.x,n.array[s+4]=I.y,n.array[s+5]=I.z,n.array[s+6]=H.x,n.array[s+7]=H.y,n.array[s+8]=H.z,n.array[s+9]=L.x,n.array[s+10]=L.y,n.array[s+
-11]=L.z),n.offset+=12):(n.array[s]=o.x,n.array[s+1]=o.y,n.array[s+2]=o.z,n.array[s+3]=o.w,n.array[s+4]=I.x,n.array[s+5]=I.y,n.array[s+6]=I.z,n.array[s+7]=I.w,n.array[s+8]=H.x,n.array[s+9]=H.y,n.array[s+10]=H.z,n.array[s+11]=H.w,n.array[s+12]=L.x,n.array[s+13]=L.y,n.array[s+14]=L.z,n.array[s+15]=L.w,n.offset+=16));if(Ea){s=0;for(n=Ha.length;s<n;s++)o=Ha[s].vertices[z.a].position,I=Ha[s].vertices[z.b].position,H=Ha[s].vertices[z.c].position,L=Ha[s].vertices[z.d].position,y=ra[s],y[na]=o.x,y[na+1]=o.y,
-y[na+2]=o.z,y[na+3]=I.x,y[na+4]=I.y,y[na+5]=I.z,y[na+6]=H.x,y[na+7]=H.y,y[na+8]=H.z,y[na+9]=L.x,y[na+10]=L.y,y[na+11]=L.z;na+=12}if(Ka.length)s=Ka[z.a],n=Ka[z.b],y=Ka[z.c],N=Ka[z.d],ea[w]=s.x,ea[w+1]=s.y,ea[w+2]=s.z,ea[w+3]=s.w,ea[w+4]=n.x,ea[w+5]=n.y,ea[w+6]=n.z,ea[w+7]=n.w,ea[w+8]=y.x,ea[w+9]=y.y,ea[w+10]=y.z,ea[w+11]=y.w,ea[w+12]=N.x,ea[w+13]=N.y,ea[w+14]=N.z,ea[w+15]=N.w,s=Na[z.a],n=Na[z.b],y=Na[z.c],N=Na[z.d],da[w]=s.x,da[w+1]=s.y,da[w+2]=s.z,da[w+3]=s.w,da[w+4]=n.x,da[w+5]=n.y,da[w+6]=n.z,da[w+
+3]=1,ca[w+4]=n.x,ca[w+5]=n.y,ca[w+6]=n.z,ca[w+7]=1,ca[w+8]=y.x,ca[w+9]=y.y,ca[w+10]=y.z,ca[w+11]=1,w+=12;if(Ca&&q)ga.length==3&&q==THREE.VertexColors?(z=ga[0],s=ga[1],n=ga[2]):n=s=z=O,pa[ka]=z.r,pa[ka+1]=z.g,pa[ka+2]=z.b,pa[ka+3]=s.r,pa[ka+4]=s.g,pa[ka+5]=s.b,pa[ka+6]=n.r,pa[ka+7]=n.g,pa[ka+8]=n.b,ka+=9;if(Ba&&sa.hasTangents)ga=M[0],O=M[1],z=M[2],$[X]=ga.x,$[X+1]=ga.y,$[X+2]=ga.z,$[X+3]=ga.w,$[X+4]=O.x,$[X+5]=O.y,$[X+6]=O.z,$[X+7]=O.w,$[X+8]=z.x,$[X+9]=z.y,$[X+10]=z.z,$[X+11]=z.w,X+=12;if(Aa&&r)if(F.length==
+3&&wa)for(M=0;M<3;M++)J=F[M],W[P]=J.x,W[P+1]=J.y,W[P+2]=J.z,P+=3;else for(M=0;M<3;M++)W[P]=J.x,W[P+1]=J.y,W[P+2]=J.z,P+=3;if(qa&&u!==void 0&&t)for(M=0;M<3;M++)F=u[M],ia[V]=F.u,ia[V+1]=F.v,V+=2;if(qa&&x!==void 0&&t)for(M=0;M<3;M++)F=x[M],la[Y]=F.u,la[Y+1]=F.v,Y+=2;va&&(ha[T]=ja,ha[T+1]=ja+1,ha[T+2]=ja+2,T+=3,Da[Q]=ja,Da[Q+1]=ja+1,Da[Q+2]=ja,Da[Q+3]=ja+2,Da[Q+4]=ja+1,Da[Q+5]=ja+2,Q+=6,ja+=3)}else if(z instanceof THREE.Face4){if(ua)p=xa[z.a].position,I=xa[z.b].position,H=xa[z.c].position,L=xa[z.d].position,
+oa[ma]=p.x,oa[ma+1]=p.y,oa[ma+2]=p.z,oa[ma+3]=I.x,oa[ma+4]=I.y,oa[ma+5]=I.z,oa[ma+6]=H.x,oa[ma+7]=H.y,oa[ma+8]=H.z,oa[ma+9]=L.x,oa[ma+10]=L.y,oa[ma+11]=L.z,ma+=12;if(Z)for(S in Z)if(n=Z[S],n.__original.needsUpdate)s=n.offset,y=n.offsetSrc,n.size===1?(n.boundTo===void 0||n.boundTo==="vertices"?(n.array[s]=n.value[z.a],n.array[s+1]=n.value[z.b],n.array[s+2]=n.value[z.c],n.array[s+3]=n.value[z.d]):n.boundTo==="faces"?(y=n.value[y],n.array[s]=y,n.array[s+1]=y,n.array[s+2]=y,n.array[s+3]=y,n.offsetSrc++):
+n.boundTo==="faceVertices"&&(n.array[s]=n.value[y],n.array[s+1]=n.value[y+1],n.array[s+2]=n.value[y+2],n.array[s+3]=n.value[y+3],n.offsetSrc+=4),n.offset+=4):(n.boundTo===void 0||n.boundTo==="vertices"?(p=n.value[z.a],I=n.value[z.b],H=n.value[z.c],L=n.value[z.d]):n.boundTo==="faces"?(L=H=I=p=y=n.value[y],n.offsetSrc++):n.boundTo==="faceVertices"&&(p=n.value[y],I=n.value[y+1],H=n.value[y+2],L=n.value[y+3],n.offsetSrc+=4),n.size===2?(n.array[s]=p.x,n.array[s+1]=p.y,n.array[s+2]=I.x,n.array[s+3]=I.y,
+n.array[s+4]=H.x,n.array[s+5]=H.y,n.array[s+6]=L.x,n.array[s+7]=L.y,n.offset+=8):n.size===3?(n.type==="c"?(n.array[s]=p.r,n.array[s+1]=p.g,n.array[s+2]=p.b,n.array[s+3]=I.r,n.array[s+4]=I.g,n.array[s+5]=I.b,n.array[s+6]=H.r,n.array[s+7]=H.g,n.array[s+8]=H.b,n.array[s+9]=L.r,n.array[s+10]=L.g,n.array[s+11]=L.b):(n.array[s]=p.x,n.array[s+1]=p.y,n.array[s+2]=p.z,n.array[s+3]=I.x,n.array[s+4]=I.y,n.array[s+5]=I.z,n.array[s+6]=H.x,n.array[s+7]=H.y,n.array[s+8]=H.z,n.array[s+9]=L.x,n.array[s+10]=L.y,n.array[s+
+11]=L.z),n.offset+=12):(n.array[s]=p.x,n.array[s+1]=p.y,n.array[s+2]=p.z,n.array[s+3]=p.w,n.array[s+4]=I.x,n.array[s+5]=I.y,n.array[s+6]=I.z,n.array[s+7]=I.w,n.array[s+8]=H.x,n.array[s+9]=H.y,n.array[s+10]=H.z,n.array[s+11]=H.w,n.array[s+12]=L.x,n.array[s+13]=L.y,n.array[s+14]=L.z,n.array[s+15]=L.w,n.offset+=16));if(Ea){s=0;for(n=Ha.length;s<n;s++)p=Ha[s].vertices[z.a].position,I=Ha[s].vertices[z.b].position,H=Ha[s].vertices[z.c].position,L=Ha[s].vertices[z.d].position,y=ra[s],y[na]=p.x,y[na+1]=p.y,
+y[na+2]=p.z,y[na+3]=I.x,y[na+4]=I.y,y[na+5]=I.z,y[na+6]=H.x,y[na+7]=H.y,y[na+8]=H.z,y[na+9]=L.x,y[na+10]=L.y,y[na+11]=L.z;na+=12}if(Ka.length)s=Ka[z.a],n=Ka[z.b],y=Ka[z.c],N=Ka[z.d],ea[w]=s.x,ea[w+1]=s.y,ea[w+2]=s.z,ea[w+3]=s.w,ea[w+4]=n.x,ea[w+5]=n.y,ea[w+6]=n.z,ea[w+7]=n.w,ea[w+8]=y.x,ea[w+9]=y.y,ea[w+10]=y.z,ea[w+11]=y.w,ea[w+12]=N.x,ea[w+13]=N.y,ea[w+14]=N.z,ea[w+15]=N.w,s=Na[z.a],n=Na[z.b],y=Na[z.c],N=Na[z.d],da[w]=s.x,da[w+1]=s.y,da[w+2]=s.z,da[w+3]=s.w,da[w+4]=n.x,da[w+5]=n.y,da[w+6]=n.z,da[w+
 7]=n.w,da[w+8]=y.x,da[w+9]=y.y,da[w+10]=y.z,da[w+11]=y.w,da[w+12]=N.x,da[w+13]=N.y,da[w+14]=N.z,da[w+15]=N.w,s=La[z.a],n=La[z.b],y=La[z.c],N=La[z.d],aa[w]=s.x,aa[w+1]=s.y,aa[w+2]=s.z,aa[w+3]=1,aa[w+4]=n.x,aa[w+5]=n.y,aa[w+6]=n.z,aa[w+7]=1,aa[w+8]=y.x,aa[w+9]=y.y,aa[w+10]=y.z,aa[w+11]=1,aa[w+12]=N.x,aa[w+13]=N.y,aa[w+14]=N.z,aa[w+15]=1,s=Ma[z.a],n=Ma[z.b],y=Ma[z.c],z=Ma[z.d],ca[w]=s.x,ca[w+1]=s.y,ca[w+2]=s.z,ca[w+3]=1,ca[w+4]=n.x,ca[w+5]=n.y,ca[w+6]=n.z,ca[w+7]=1,ca[w+8]=y.x,ca[w+9]=y.y,ca[w+10]=y.z,
 7]=n.w,da[w+8]=y.x,da[w+9]=y.y,da[w+10]=y.z,da[w+11]=y.w,da[w+12]=N.x,da[w+13]=N.y,da[w+14]=N.z,da[w+15]=N.w,s=La[z.a],n=La[z.b],y=La[z.c],N=La[z.d],aa[w]=s.x,aa[w+1]=s.y,aa[w+2]=s.z,aa[w+3]=1,aa[w+4]=n.x,aa[w+5]=n.y,aa[w+6]=n.z,aa[w+7]=1,aa[w+8]=y.x,aa[w+9]=y.y,aa[w+10]=y.z,aa[w+11]=1,aa[w+12]=N.x,aa[w+13]=N.y,aa[w+14]=N.z,aa[w+15]=1,s=Ma[z.a],n=Ma[z.b],y=Ma[z.c],z=Ma[z.d],ca[w]=s.x,ca[w+1]=s.y,ca[w+2]=s.z,ca[w+3]=1,ca[w+4]=n.x,ca[w+5]=n.y,ca[w+6]=n.z,ca[w+7]=1,ca[w+8]=y.x,ca[w+9]=y.y,ca[w+10]=y.z,
-ca[w+11]=1,ca[w+12]=z.x,ca[w+13]=z.y,ca[w+14]=z.z,ca[w+15]=1,w+=16;if(Ca&&r)ga.length==4&&r==THREE.VertexColors?(z=ga[0],s=ga[1],n=ga[2],ga=ga[3]):ga=n=s=z=O,pa[ka]=z.r,pa[ka+1]=z.g,pa[ka+2]=z.b,pa[ka+3]=s.r,pa[ka+4]=s.g,pa[ka+5]=s.b,pa[ka+6]=n.r,pa[ka+7]=n.g,pa[ka+8]=n.b,pa[ka+9]=ga.r,pa[ka+10]=ga.g,pa[ka+11]=ga.b,ka+=12;if(Ba&&sa.hasTangents)ga=M[0],O=M[1],z=M[2],M=M[3],$[X]=ga.x,$[X+1]=ga.y,$[X+2]=ga.z,$[X+3]=ga.w,$[X+4]=O.x,$[X+5]=O.y,$[X+6]=O.z,$[X+7]=O.w,$[X+8]=z.x,$[X+9]=z.y,$[X+10]=z.z,$[X+
-11]=z.w,$[X+12]=M.x,$[X+13]=M.y,$[X+14]=M.z,$[X+15]=M.w,X+=16;if(Aa&&q)if(F.length==4&&wa)for(M=0;M<4;M++)J=F[M],W[P]=J.x,W[P+1]=J.y,W[P+2]=J.z,P+=3;else for(M=0;M<4;M++)W[P]=J.x,W[P+1]=J.y,W[P+2]=J.z,P+=3;if(qa&&u!==void 0&&t)for(M=0;M<4;M++)F=u[M],ia[V]=F.u,ia[V+1]=F.v,V+=2;if(qa&&x!==void 0&&t)for(M=0;M<4;M++)F=x[M],la[Y]=F.u,la[Y+1]=F.v,Y+=2;va&&(ha[T]=ja,ha[T+1]=ja+1,ha[T+2]=ja+3,ha[T+3]=ja+1,ha[T+4]=ja+2,ha[T+5]=ja+3,T+=6,Da[Q]=ja,Da[Q+1]=ja+1,Da[Q+2]=ja,Da[Q+3]=ja+3,Da[Q+4]=ja+1,Da[Q+5]=ja+
-2,Da[Q+6]=ja+2,Da[Q+7]=ja+3,Q+=8,ja+=4)}ua&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglVertexBuffer),f.bufferData(f.ARRAY_BUFFER,oa,p));if(Z)for(S in Z)n=Z[S],n.__original.needsUpdate&&(f.bindBuffer(f.ARRAY_BUFFER,n.buffer),f.bufferData(f.ARRAY_BUFFER,n.array,p));if(Ea){s=0;for(n=Ha.length;s<n;s++)f.bindBuffer(f.ARRAY_BUFFER,m.__webglMorphTargetsBuffers[s]),f.bufferData(f.ARRAY_BUFFER,ra[s],p)}Ca&&ka>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglColorBuffer),f.bufferData(f.ARRAY_BUFFER,pa,p));Aa&&(f.bindBuffer(f.ARRAY_BUFFER,
-m.__webglNormalBuffer),f.bufferData(f.ARRAY_BUFFER,W,p));Ba&&sa.hasTangents&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglTangentBuffer),f.bufferData(f.ARRAY_BUFFER,$,p));qa&&V>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglUVBuffer),f.bufferData(f.ARRAY_BUFFER,ia,p));qa&&Y>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglUV2Buffer),f.bufferData(f.ARRAY_BUFFER,la,p));va&&(f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,m.__webglFaceBuffer),f.bufferData(f.ELEMENT_ARRAY_BUFFER,ha,p),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,m.__webglLineBuffer),
-f.bufferData(f.ELEMENT_ARRAY_BUFFER,Da,p));w>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinVertexABuffer),f.bufferData(f.ARRAY_BUFFER,aa,p),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinVertexBBuffer),f.bufferData(f.ARRAY_BUFFER,ca,p),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinIndicesBuffer),f.bufferData(f.ARRAY_BUFFER,da,p),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinWeightsBuffer),f.bufferData(f.ARRAY_BUFFER,ea,p));E&&(delete m.__inittedArrays,delete m.__colorArray,delete m.__normalArray,delete m.__tangentArray,
+ca[w+11]=1,ca[w+12]=z.x,ca[w+13]=z.y,ca[w+14]=z.z,ca[w+15]=1,w+=16;if(Ca&&q)ga.length==4&&q==THREE.VertexColors?(z=ga[0],s=ga[1],n=ga[2],ga=ga[3]):ga=n=s=z=O,pa[ka]=z.r,pa[ka+1]=z.g,pa[ka+2]=z.b,pa[ka+3]=s.r,pa[ka+4]=s.g,pa[ka+5]=s.b,pa[ka+6]=n.r,pa[ka+7]=n.g,pa[ka+8]=n.b,pa[ka+9]=ga.r,pa[ka+10]=ga.g,pa[ka+11]=ga.b,ka+=12;if(Ba&&sa.hasTangents)ga=M[0],O=M[1],z=M[2],M=M[3],$[X]=ga.x,$[X+1]=ga.y,$[X+2]=ga.z,$[X+3]=ga.w,$[X+4]=O.x,$[X+5]=O.y,$[X+6]=O.z,$[X+7]=O.w,$[X+8]=z.x,$[X+9]=z.y,$[X+10]=z.z,$[X+
+11]=z.w,$[X+12]=M.x,$[X+13]=M.y,$[X+14]=M.z,$[X+15]=M.w,X+=16;if(Aa&&r)if(F.length==4&&wa)for(M=0;M<4;M++)J=F[M],W[P]=J.x,W[P+1]=J.y,W[P+2]=J.z,P+=3;else for(M=0;M<4;M++)W[P]=J.x,W[P+1]=J.y,W[P+2]=J.z,P+=3;if(qa&&u!==void 0&&t)for(M=0;M<4;M++)F=u[M],ia[V]=F.u,ia[V+1]=F.v,V+=2;if(qa&&x!==void 0&&t)for(M=0;M<4;M++)F=x[M],la[Y]=F.u,la[Y+1]=F.v,Y+=2;va&&(ha[T]=ja,ha[T+1]=ja+1,ha[T+2]=ja+3,ha[T+3]=ja+1,ha[T+4]=ja+2,ha[T+5]=ja+3,T+=6,Da[Q]=ja,Da[Q+1]=ja+1,Da[Q+2]=ja,Da[Q+3]=ja+3,Da[Q+4]=ja+1,Da[Q+5]=ja+
+2,Da[Q+6]=ja+2,Da[Q+7]=ja+3,Q+=8,ja+=4)}ua&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglVertexBuffer),f.bufferData(f.ARRAY_BUFFER,oa,o));if(Z)for(S in Z)n=Z[S],n.__original.needsUpdate&&(f.bindBuffer(f.ARRAY_BUFFER,n.buffer),f.bufferData(f.ARRAY_BUFFER,n.array,o));if(Ea){s=0;for(n=Ha.length;s<n;s++)f.bindBuffer(f.ARRAY_BUFFER,m.__webglMorphTargetsBuffers[s]),f.bufferData(f.ARRAY_BUFFER,ra[s],o)}Ca&&ka>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglColorBuffer),f.bufferData(f.ARRAY_BUFFER,pa,o));Aa&&(f.bindBuffer(f.ARRAY_BUFFER,
+m.__webglNormalBuffer),f.bufferData(f.ARRAY_BUFFER,W,o));Ba&&sa.hasTangents&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglTangentBuffer),f.bufferData(f.ARRAY_BUFFER,$,o));qa&&V>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglUVBuffer),f.bufferData(f.ARRAY_BUFFER,ia,o));qa&&Y>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglUV2Buffer),f.bufferData(f.ARRAY_BUFFER,la,o));va&&(f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,m.__webglFaceBuffer),f.bufferData(f.ELEMENT_ARRAY_BUFFER,ha,o),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,m.__webglLineBuffer),
+f.bufferData(f.ELEMENT_ARRAY_BUFFER,Da,o));w>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinVertexABuffer),f.bufferData(f.ARRAY_BUFFER,aa,o),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinVertexBBuffer),f.bufferData(f.ARRAY_BUFFER,ca,o),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinIndicesBuffer),f.bufferData(f.ARRAY_BUFFER,da,o),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinWeightsBuffer),f.bufferData(f.ARRAY_BUFFER,ea,o));E&&(delete m.__inittedArrays,delete m.__colorArray,delete m.__normalArray,delete m.__tangentArray,
 delete m.__uvArray,delete m.__uv2Array,delete m.__faceArray,delete m.__vertexArray,delete m.__lineArray,delete m.__skinVertexAArray,delete m.__skinVertexBArray,delete m.__skinIndexArray,delete m.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;ya(k)}else if(g instanceof THREE.Ribbon){h=g.geometry;if(h.__dirtyVertices||h.__dirtyColors){g=h;j=f.DYNAMIC_DRAW;k=C=v=v=void 0;t=g.vertices;m=
 delete m.__uvArray,delete m.__uv2Array,delete m.__faceArray,delete m.__vertexArray,delete m.__lineArray,delete m.__skinVertexAArray,delete m.__skinVertexBArray,delete m.__skinIndexArray,delete m.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;ya(k)}else if(g instanceof THREE.Ribbon){h=g.geometry;if(h.__dirtyVertices||h.__dirtyColors){g=h;j=f.DYNAMIC_DRAW;k=C=v=v=void 0;t=g.vertices;m=
-g.colors;r=t.length;p=m.length;q=g.__vertexArray;E=g.__colorArray;u=g.__dirtyColors;if(g.__dirtyVertices){for(v=0;v<r;v++)C=t[v].position,k=v*3,q[k]=C.x,q[k+1]=C.y,q[k+2]=C.z;f.bindBuffer(f.ARRAY_BUFFER,g.__webglVertexBuffer);f.bufferData(f.ARRAY_BUFFER,q,j)}if(u){for(v=0;v<p;v++)color=m[v],k=v*3,E[k]=color.r,E[k+1]=color.g,E[k+2]=color.b;f.bindBuffer(f.ARRAY_BUFFER,g.__webglColorBuffer);f.bufferData(f.ARRAY_BUFFER,E,j)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(g instanceof THREE.Line){h=g.geometry;
-if(h.__dirtyVertices||h.__dirtyColors){g=h;j=f.DYNAMIC_DRAW;k=C=v=v=void 0;t=g.vertices;m=g.colors;r=t.length;p=m.length;q=g.__vertexArray;E=g.__colorArray;u=g.__dirtyColors;if(g.__dirtyVertices){for(v=0;v<r;v++)C=t[v].position,k=v*3,q[k]=C.x,q[k+1]=C.y,q[k+2]=C.z;f.bindBuffer(f.ARRAY_BUFFER,g.__webglVertexBuffer);f.bufferData(f.ARRAY_BUFFER,q,j)}if(u){for(v=0;v<p;v++)color=m[v],k=v*3,E[k]=color.r,E[k+1]=color.g,E[k+2]=color.b;f.bindBuffer(f.ARRAY_BUFFER,g.__webglColorBuffer);f.bufferData(f.ARRAY_BUFFER,
+g.colors;q=t.length;o=m.length;r=g.__vertexArray;E=g.__colorArray;u=g.__dirtyColors;if(g.__dirtyVertices){for(v=0;v<q;v++)C=t[v].position,k=v*3,r[k]=C.x,r[k+1]=C.y,r[k+2]=C.z;f.bindBuffer(f.ARRAY_BUFFER,g.__webglVertexBuffer);f.bufferData(f.ARRAY_BUFFER,r,j)}if(u){for(v=0;v<o;v++)color=m[v],k=v*3,E[k]=color.r,E[k+1]=color.g,E[k+2]=color.b;f.bindBuffer(f.ARRAY_BUFFER,g.__webglColorBuffer);f.bufferData(f.ARRAY_BUFFER,E,j)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(g instanceof THREE.Line){h=g.geometry;
+if(h.__dirtyVertices||h.__dirtyColors){g=h;j=f.DYNAMIC_DRAW;k=C=v=v=void 0;t=g.vertices;m=g.colors;q=t.length;o=m.length;r=g.__vertexArray;E=g.__colorArray;u=g.__dirtyColors;if(g.__dirtyVertices){for(v=0;v<q;v++)C=t[v].position,k=v*3,r[k]=C.x,r[k+1]=C.y,r[k+2]=C.z;f.bindBuffer(f.ARRAY_BUFFER,g.__webglVertexBuffer);f.bufferData(f.ARRAY_BUFFER,r,j)}if(u){for(v=0;v<o;v++)color=m[v],k=v*3,E[k]=color.r,E[k+1]=color.g,E[k+2]=color.b;f.bindBuffer(f.ARRAY_BUFFER,g.__webglColorBuffer);f.bufferData(f.ARRAY_BUFFER,
 E,j)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(g instanceof THREE.ParticleSystem)h=g.geometry,m=K(h),(h.__dirtyVertices||h.__dirtyColors||g.sortParticles||m)&&c(h,f.DYNAMIC_DRAW,g),h.__dirtyVertices=!1,h.__dirtyColors=!1,ya(h)};this.setFaceCulling=function(b,c){b?(!c||c=="ccw"?f.frontFace(f.CCW):f.frontFace(f.CW),b=="back"?f.cullFace(f.BACK):b=="front"?f.cullFace(f.FRONT):f.cullFace(f.FRONT_AND_BACK),f.enable(f.CULL_FACE)):f.disable(f.CULL_FACE)};this.supportsVertexTextures=function(){return Ya}};
 E,j)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(g instanceof THREE.ParticleSystem)h=g.geometry,m=K(h),(h.__dirtyVertices||h.__dirtyColors||g.sortParticles||m)&&c(h,f.DYNAMIC_DRAW,g),h.__dirtyVertices=!1,h.__dirtyColors=!1,ya(h)};this.setFaceCulling=function(b,c){b?(!c||c=="ccw"?f.frontFace(f.CCW):f.frontFace(f.CW),b=="back"?f.cullFace(f.BACK):b=="front"?f.cullFace(f.FRONT):f.cullFace(f.FRONT_AND_BACK),f.enable(f.CULL_FACE)):f.disable(f.CULL_FACE)};this.supportsVertexTextures=function(){return Ya}};
 THREE.WebGLRenderTarget=function(b,c,d){this.width=b;this.height=c;d=d||{};this.wrapS=d.wrapS!==void 0?d.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=d.wrapT!==void 0?d.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=d.magFilter!==void 0?d.magFilter:THREE.LinearFilter;this.minFilter=d.minFilter!==void 0?d.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=d.format!==void 0?d.format:THREE.RGBAFormat;this.type=d.type!==void 0?d.type:
 THREE.WebGLRenderTarget=function(b,c,d){this.width=b;this.height=c;d=d||{};this.wrapS=d.wrapS!==void 0?d.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=d.wrapT!==void 0?d.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=d.magFilter!==void 0?d.magFilter:THREE.LinearFilter;this.minFilter=d.minFilter!==void 0?d.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=d.format!==void 0?d.format:THREE.RGBAFormat;this.type=d.type!==void 0?d.type:
 THREE.UnsignedByteType;this.depthBuffer=d.depthBuffer!==void 0?d.depthBuffer:!0;this.stencilBuffer=d.stencilBuffer!==void 0?d.stencilBuffer:!0};THREE.WebGLRenderTargetCube=function(b,c,d){THREE.WebGLRenderTarget.call(this,b,c,d);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=new THREE.WebGLRenderTarget;THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
 THREE.UnsignedByteType;this.depthBuffer=d.depthBuffer!==void 0?d.depthBuffer:!0;this.stencilBuffer=d.stencilBuffer!==void 0?d.stencilBuffer:!0};THREE.WebGLRenderTargetCube=function(b,c,d){THREE.WebGLRenderTarget.call(this,b,c,d);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=new THREE.WebGLRenderTarget;THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;

+ 1 - 2
examples/canvas_camera_orthographic.html

@@ -42,8 +42,7 @@
 				info.innerHTML = '<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - orthographic view';
 				info.innerHTML = '<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - orthographic view';
 				container.appendChild( info );
 				container.appendChild( info );
 
 
-				camera = new THREE.Camera( 45, window.innerWidth / window.innerHeight, - 2000, 1000 );
-				camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, - 2000, 1000 );
+				camera = new THREE.OrthoCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, - 2000, 1000 );
 				camera.position.x = 200;
 				camera.position.x = 200;
 				camera.position.y = 100;
 				camera.position.y = 100;
 				camera.position.z = 200;
 				camera.position.z = 200;

+ 12 - 9
examples/canvas_sandbox.html

@@ -39,9 +39,8 @@
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
 		<script type="text/javascript" src="../src/lights/PointLight.js"></script>
 		<script type="text/javascript" src="../src/lights/PointLight.js"></script>
-		<script type="text/javascript" src="../src/lights/LensFlare.js"></script>
+		<script type="text/javascript" src="../src/lights/SpotLight.js"></script>
 		<script type="text/javascript" src="../src/materials/Material.js"></script>
 		<script type="text/javascript" src="../src/materials/Material.js"></script>
-		<script type="text/javascript" src="../src/materials/Mappings.js"></script>
 		<script type="text/javascript" src="../src/materials/LineBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/LineBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshLambertMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshLambertMaterial.js"></script>
@@ -50,11 +49,11 @@
 		<script type="text/javascript" src="../src/materials/MeshNormalMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshNormalMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshFaceMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshFaceMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshShaderMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshShaderMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/ShadowVolumeDynamicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleCanvasMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleCanvasMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleDOMMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleDOMMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/Texture.js"></script>
+		<script type="text/javascript" src="../src/textures/Texture.js"></script>
+		<script type="text/javascript" src="../src/textures/DataTexture.js"></script>
 		<script type="text/javascript" src="../src/objects/Particle.js"></script>
 		<script type="text/javascript" src="../src/objects/Particle.js"></script>
 		<script type="text/javascript" src="../src/objects/ParticleSystem.js"></script>
 		<script type="text/javascript" src="../src/objects/ParticleSystem.js"></script>
 		<script type="text/javascript" src="../src/objects/Line.js"></script>
 		<script type="text/javascript" src="../src/objects/Line.js"></script>
@@ -63,7 +62,6 @@
 		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
 		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
 		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
 		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
 		<script type="text/javascript" src="../src/objects/LOD.js"></script>
 		<script type="text/javascript" src="../src/objects/LOD.js"></script>
-		<script type="text/javascript" src="../src/objects/ShadowVolume.js"></script>
 		<script type="text/javascript" src="../src/objects/Sprite.js"></script>
 		<script type="text/javascript" src="../src/objects/Sprite.js"></script>
 		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
 		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
 		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
 		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
@@ -75,6 +73,7 @@
 		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderTarget.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderTarget.js"></script>
+		<script type="text/javascript" src="../src/renderers/WebGLRenderTargetCube.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableVertex.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableVertex.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace3.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace3.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace4.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace4.js"></script>
@@ -94,8 +93,11 @@
 		<script type="text/javascript" src="../src/extras/cameras/RollCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/RollCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/TrackballCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/TrackballCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/Curve.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/CurvePath.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Path.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Path.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Shape.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Shape.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TextPath.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CubeGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CubeGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CylinderGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CylinderGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/ExtrudeGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/ExtrudeGeometry.js"></script>
@@ -106,10 +108,11 @@
 		<script type="text/javascript" src="../src/extras/geometries/TextGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TextGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusKnotGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusKnotGeometry.js"></script>
-		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
-		<script type="text/javascript" src="../src/extras/io/JSONLoader.js"></script>
-		<script type="text/javascript" src="../src/extras/io/BinaryLoader.js"></script>
-		<script type="text/javascript" src="../src/extras/io/SceneLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/Loader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/JSONLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/BinaryLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/SceneLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/UTF8Loader.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/Trident.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/Trident.js"></script>
 		<script type="text/javascript" src="../src/extras/physics/Collisions.js"></script>
 		<script type="text/javascript" src="../src/extras/physics/Collisions.js"></script>

+ 91 - 0
examples/js/postprocessing/BloomPass.js

@@ -0,0 +1,91 @@
+/**
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.BloomPass = function( strength, kernelSize, sigma, resolution ) {
+
+	strength = ( strength !== undefined ) ? strength : 1;
+	kernelSize = ( kernelSize !== undefined ) ? kernelSize : 25;
+	sigma = ( sigma !== undefined ) ? sigma : 4.0;
+	resolution = ( resolution !== resolution ) ? resolution : 256;
+
+	// render targets
+
+	var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
+
+	this.renderTargetX = new THREE.WebGLRenderTarget( resolution, resolution, pars );
+	this.renderTargetY = new THREE.WebGLRenderTarget( resolution, resolution, pars );
+
+	// screen material
+
+	var screenShader = THREE.ShaderUtils.lib[ "screen" ];
+
+	this.screenUniforms = THREE.UniformsUtils.clone( screenShader.uniforms );
+
+	this.screenUniforms[ "opacity" ].value = strength;
+
+	this.materialScreen = new THREE.MeshShaderMaterial( {
+
+		uniforms: this.screenUniforms,
+		vertexShader: screenShader.vertexShader,
+		fragmentShader: screenShader.fragmentShader,
+		blending: THREE.AdditiveBlending,
+		transparent: true
+
+	} );
+
+	// convolution material
+
+	var convolutionShader = THREE.ShaderUtils.lib[ "convolution" ];
+
+	this.convolutionUniforms = THREE.UniformsUtils.clone( convolutionShader.uniforms );
+
+	this.convolutionUniforms[ "uImageIncrement" ].value = THREE.BloomPass.blurx;
+	this.convolutionUniforms[ "cKernel" ].value = THREE.ShaderUtils.buildKernel( sigma );
+
+	this.materialConvolution = new THREE.MeshShaderMaterial( {
+
+		uniforms: this.convolutionUniforms,
+		vertexShader:   "#define KERNEL_SIZE " + kernelSize + ".0\n" + convolutionShader.vertexShader,
+		fragmentShader: "#define KERNEL_SIZE " + kernelSize + "\n"   + convolutionShader.fragmentShader
+
+	} );
+
+};
+
+THREE.BloomPass.prototype = {
+
+	render: function ( renderer, renderTarget, delta ) {
+
+		// Render quad with blured scene into texture (convolution pass 1)
+
+		THREE.EffectComposer.quad.materials[ 0 ] = this.materialConvolution;
+
+		this.convolutionUniforms[ "tDiffuse" ].texture = renderTarget;
+		this.convolutionUniforms[ "uImageIncrement" ].value = THREE.BloomPass.blurX;
+
+		renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, this.renderTargetX, true );
+
+		// Render quad with blured scene into texture (convolution pass 2)
+
+		this.convolutionUniforms[ "tDiffuse" ].texture = this.renderTargetX;
+		this.convolutionUniforms[ "uImageIncrement" ].value = THREE.BloomPass.blurY;
+
+		renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, this.renderTargetY, true );
+
+		// Render original scene with superimposed blur to texture
+
+		THREE.EffectComposer.quad.materials[ 0 ] = this.materialScreen;
+
+		this.screenUniforms[ "tDiffuse" ].texture = this.renderTargetY;
+
+		renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, renderTarget, false );
+
+	}
+
+};
+
+THREE.BloomPass.blurX = new THREE.Vector2( 0.001953125, 0.0 );
+THREE.BloomPass.blurY = new THREE.Vector2( 0.0, 0.001953125 );
+
+

+ 50 - 0
examples/js/postprocessing/DotScreenPass.js

@@ -0,0 +1,50 @@
+/**
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.DotScreenPass = function( center, angle, scale ) {
+
+	var shader = THREE.ShaderUtils.lib[ "dotscreen" ];
+
+	this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
+
+	if ( center !== undefined )
+		this.uniforms[ "center" ].value.copy( center );
+
+	if ( angle !== undefined )	this.uniforms[ "angle"].value = angle;
+	if ( scale !== undefined )	this.uniforms[ "scale"].value = scale;
+
+	this.material = new THREE.MeshShaderMaterial( {
+
+		uniforms: this.uniforms,
+		vertexShader: shader.vertexShader,
+		fragmentShader: shader.fragmentShader
+
+	} );
+
+	this.renderToScreen = false;
+
+};
+
+THREE.DotScreenPass.prototype = {
+
+	render: function ( renderer, renderTarget, delta ) {
+
+		this.uniforms[ "tDiffuse" ].texture = renderTarget;
+		this.uniforms[ "tSize" ].value.set( renderTarget.width, renderTarget.height );
+
+		THREE.EffectComposer.quad.materials[ 0 ] = this.material;
+
+		if ( this.renderToScreen ) {
+
+			renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera );
+
+		} else {
+
+			renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, renderTarget, false );
+
+		}
+
+	}
+
+};

+ 77 - 0
examples/js/postprocessing/EffectComposer.js

@@ -0,0 +1,77 @@
+/**
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.EffectComposer = function( renderer, renderTarget ) {
+
+	this.renderer = renderer;
+	this.renderTarget = renderTarget;
+
+	if ( this.renderTarget === undefined ) {
+
+		this.renderTargetParameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBufer: false };
+		this.renderTarget = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, this.renderTargetParameters );
+
+	}
+
+	this.passes = [];
+
+};
+
+THREE.EffectComposer.prototype = {
+
+	addPass: function ( pass ) {
+
+		this.passes.push( pass );
+
+	},
+
+	render: function ( delta ) {
+
+		var i, il = this.passes.length;
+
+		for ( i = 0; i < il; i ++ ) {
+
+			this.passes[ i ].render( this.renderer, this.renderTarget, delta );
+
+		}
+
+	},
+
+	reset: function () {
+
+		if ( this.renderTargetParameters ) {
+
+			this.renderTarget = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, this.renderTargetParameters );
+
+		}
+
+		THREE.EffectComposer.quad.scale.set( window.innerWidth, window.innerHeight, 1 );
+
+		THREE.EffectComposer.camera.left = window.innerWidth / - 2;
+		THREE.EffectComposer.camera.right = window.innerWidth / 2;
+		THREE.EffectComposer.camera.top = window.innerHeight / 2;
+		THREE.EffectComposer.camera.bottom = window.innerHeight / - 2;
+
+		THREE.EffectComposer.camera.updateProjectionMatrix();
+
+
+	}
+
+};
+
+// shared fullscreen quad scene
+
+THREE.EffectComposer.geometry = new THREE.PlaneGeometry( 1, 1 );
+
+THREE.EffectComposer.quad = new THREE.Mesh( THREE.EffectComposer.geometry, null );
+THREE.EffectComposer.quad.position.z = -100;
+THREE.EffectComposer.quad.scale.set( window.innerWidth, window.innerHeight, 1 );
+
+THREE.EffectComposer.scene = new THREE.Scene();
+THREE.EffectComposer.scene.addObject( THREE.EffectComposer.quad );
+
+// shared ortho camera
+
+THREE.EffectComposer.camera = new THREE.OrthoCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
+

+ 49 - 0
examples/js/postprocessing/FilmPass.js

@@ -0,0 +1,49 @@
+/**
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.FilmPass = function( noiseIntensity, scanlinesIntensity, scanlinesCount, grayscale ) {
+
+	var shader = THREE.ShaderUtils.lib[ "film" ];
+
+	this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
+
+	this.material = new THREE.MeshShaderMaterial( {
+
+		uniforms: this.uniforms,
+		vertexShader: shader.vertexShader,
+		fragmentShader: shader.fragmentShader
+
+	} );
+
+	if ( grayscale !== undefined )	this.uniforms.grayscale.value = grayscale;
+	if ( noiseIntensity !== undefined ) this.uniforms.nIntensity.value = noiseIntensity;
+	if ( scanlinesIntensity !== undefined ) this.uniforms.sIntensity.value = scanlinesIntensity;
+	if ( scanlinesCount !== undefined ) this.uniforms.sCount.value = scanlinesCount;
+
+	this.renderToScreen = false;
+
+};
+
+THREE.FilmPass.prototype = {
+
+	render: function ( renderer, renderTarget, delta ) {
+
+		this.uniforms[ "tDiffuse" ].texture = renderTarget;
+		this.uniforms[ "time" ].value += delta;
+
+		THREE.EffectComposer.quad.materials[ 0 ] = this.material;
+
+		if ( this.renderToScreen ) {
+
+			renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera );
+
+		} else {
+
+			renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, renderTarget, false );
+
+		}
+
+	}
+
+};

+ 22 - 0
examples/js/postprocessing/RenderPass.js

@@ -0,0 +1,22 @@
+/**
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.RenderPass = function ( scene, camera ) {
+
+	this.scene = scene;
+	this.camera = camera;
+
+	this.clear = true;
+
+};
+
+THREE.RenderPass.prototype = {
+
+	render: function ( renderer, renderTarget, delta ) {
+
+		renderer.render( this.scene, this.camera, renderTarget, this.clear );
+
+	}
+
+};

+ 34 - 0
examples/js/postprocessing/ScreenPass.js

@@ -0,0 +1,34 @@
+/**
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.ScreenPass = function( opacity ) {
+
+	var shader = THREE.ShaderUtils.lib[ "screen" ];
+
+	this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
+	this.uniforms[ "opacity" ].value = ( opacity !== undefined ) ? opacity : 1.0;
+
+	this.material = new THREE.MeshShaderMaterial( {
+
+		uniforms: this.uniforms,
+		vertexShader: shader.vertexShader,
+		fragmentShader: shader.fragmentShader
+
+	} );
+
+};
+
+THREE.ScreenPass.prototype = {
+
+	render: function ( renderer, renderTarget, delta ) {
+
+		this.uniforms[ "tDiffuse" ].texture = renderTarget;
+
+		THREE.EffectComposer.quad.materials[ 0 ] = this.material;
+
+		renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera );
+
+	}
+
+};

+ 44 - 0
examples/js/postprocessing/SepiaPass.js

@@ -0,0 +1,44 @@
+/**
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.SepiaPass = function( amount ) {
+
+	var shader = THREE.ShaderUtils.lib[ "sepia" ];
+
+	this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
+	this.uniforms[ "amount" ].value = ( amount !== undefined ) ? amount : 1.0;
+
+	this.material = new THREE.MeshShaderMaterial( {
+
+		uniforms: this.uniforms,
+		vertexShader: shader.vertexShader,
+		fragmentShader: shader.fragmentShader
+
+	} );
+
+	this.renderToScreen = false;
+
+};
+
+THREE.SepiaPass.prototype = {
+
+	render: function ( renderer, renderTarget, delta ) {
+
+		this.uniforms[ "tDiffuse" ].texture = renderTarget;
+
+		THREE.EffectComposer.quad.materials[ 0 ] = this.material;
+
+		if ( this.renderToScreen ) {
+
+			renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera );
+
+		} else {
+
+			renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, renderTarget, false );
+
+		}
+
+	}
+
+};

+ 46 - 0
examples/js/postprocessing/VignettePass.js

@@ -0,0 +1,46 @@
+/**
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.VignettePass = function( offset, darkness ) {
+
+	var shader = THREE.ShaderUtils.lib[ "vignette" ];
+
+	this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
+
+	if ( offset !== undefined )	this.uniforms[ "offset"].value = offset;
+	if ( darkness !== undefined ) this.uniforms[ "darkness"].value = darkness;
+
+	this.material = new THREE.MeshShaderMaterial( {
+
+		uniforms: this.uniforms,
+		vertexShader: shader.vertexShader,
+		fragmentShader: shader.fragmentShader
+
+	} );
+
+	this.renderToScreen = false;
+
+};
+
+THREE.VignettePass.prototype = {
+
+	render: function ( renderer, renderTarget, delta ) {
+
+		this.uniforms[ "tDiffuse" ].texture = renderTarget;
+
+		THREE.EffectComposer.quad.materials[ 0 ] = this.material;
+
+		if ( this.renderToScreen ) {
+
+			renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera );
+
+		} else {
+
+			renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, renderTarget, false );
+
+		}
+
+	}
+
+};

+ 8 - 21
examples/misc_lights_test.html

@@ -105,6 +105,12 @@
 
 
 				}
 				}
 
 
+				// Torus
+
+				mesh = new THREE.Mesh( new THREE.TorusGeometry( 100, 25, 15, 30 ), new THREE.MeshLambertMaterial( { color: 0xffffff } ) );
+				mesh.overdraw = true;
+				scene.addObject( mesh );
+
 				// Lights
 				// Lights
 
 
 				var ambient = new THREE.AmbientLight( 0x101010 );
 				var ambient = new THREE.AmbientLight( 0x101010 );
@@ -163,27 +169,8 @@
 				bcanvas.addEventListener("click", toggleCanvas, false);
 				bcanvas.addEventListener("click", toggleCanvas, false);
 				bwebgl.addEventListener("click", toggleWebGL, false);
 				bwebgl.addEventListener("click", toggleWebGL, false);
 
 
-
-				//var loader = new THREE.JSONLoader();
-				//loader.load( { model: "obj/torus/Torus_slim.js", callback: function( geometry ) { createMesh( geometry ) } } );
-				
-				var loader = new THREE.BinaryLoader();
-				loader.load( { model: "obj/torus/Torus_bin.js", callback: function( geometry ) { createMesh( geometry ) } } );
-
 			}
 			}
 
 
-			function createMesh( geometry ) {
-
-				zmesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0xffffff } ) );
-				zmesh.position.x = zmesh.position.y = zmesh.position.z = 0;
-				zmesh.scale.x = zmesh.scale.y = zmesh.scale.z = 100;
-				zmesh.overdraw = true;
-				zmesh.updateMatrix();
-				scene.addObject( zmesh );
-
-			}
-
-
 			function onDocumentMouseMove( event ) {
 			function onDocumentMouseMove( event ) {
 
 
 				mouseX = ( event.clientX - windowHalfX );
 				mouseX = ( event.clientX - windowHalfX );
@@ -215,7 +202,7 @@
 
 
 					if ( i%3 == 1 )
 					if ( i%3 == 1 )
 
 
-						scene.objects[i].rotation.x += 0.05;
+						scene.objects[i].rotation.z += 0.05;
 
 
 					else if ( i%3 == 2 )
 					else if ( i%3 == 2 )
 
 
@@ -223,7 +210,7 @@
 
 
 					else if ( i%3 == 0 )
 					else if ( i%3 == 0 )
 
 
-						scene.objects[i].rotation.z += 0.05;
+						scene.objects[i].rotation.x += 0.05;
 
 
 				}
 				}
 
 

+ 11 - 9
examples/misc_ubiquity_test.html

@@ -41,9 +41,7 @@
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
 		<script type="text/javascript" src="../src/lights/PointLight.js"></script>
 		<script type="text/javascript" src="../src/lights/PointLight.js"></script>
 		<script type="text/javascript" src="../src/lights/SpotLight.js"></script>
 		<script type="text/javascript" src="../src/lights/SpotLight.js"></script>
-		<script type="text/javascript" src="../src/lights/LensFlare.js"></script>
 		<script type="text/javascript" src="../src/materials/Material.js"></script>
 		<script type="text/javascript" src="../src/materials/Material.js"></script>
-		<script type="text/javascript" src="../src/materials/Mappings.js"></script>
 		<script type="text/javascript" src="../src/materials/LineBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/LineBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshLambertMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshLambertMaterial.js"></script>
@@ -52,11 +50,11 @@
 		<script type="text/javascript" src="../src/materials/MeshNormalMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshNormalMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshFaceMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshFaceMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshShaderMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshShaderMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/ShadowVolumeDynamicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleCanvasMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleCanvasMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleDOMMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleDOMMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/Texture.js"></script>
+		<script type="text/javascript" src="../src/textures/Texture.js"></script>
+		<script type="text/javascript" src="../src/textures/DataTexture.js"></script>
 		<script type="text/javascript" src="../src/objects/Particle.js"></script>
 		<script type="text/javascript" src="../src/objects/Particle.js"></script>
 		<script type="text/javascript" src="../src/objects/ParticleSystem.js"></script>
 		<script type="text/javascript" src="../src/objects/ParticleSystem.js"></script>
 		<script type="text/javascript" src="../src/objects/Line.js"></script>
 		<script type="text/javascript" src="../src/objects/Line.js"></script>
@@ -65,7 +63,6 @@
 		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
 		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
 		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
 		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
 		<script type="text/javascript" src="../src/objects/LOD.js"></script>
 		<script type="text/javascript" src="../src/objects/LOD.js"></script>
-		<script type="text/javascript" src="../src/objects/ShadowVolume.js"></script>
 		<script type="text/javascript" src="../src/objects/Sprite.js"></script>
 		<script type="text/javascript" src="../src/objects/Sprite.js"></script>
 		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
 		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
 		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
 		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
@@ -77,6 +74,7 @@
 		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderTarget.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderTarget.js"></script>
+		<script type="text/javascript" src="../src/renderers/WebGLRenderTargetCube.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableVertex.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableVertex.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace3.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace3.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace4.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace4.js"></script>
@@ -96,8 +94,11 @@
 		<script type="text/javascript" src="../src/extras/cameras/RollCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/RollCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/TrackballCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/TrackballCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/Curve.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/CurvePath.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Path.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Path.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Shape.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Shape.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TextPath.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CubeGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CubeGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CylinderGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CylinderGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/ExtrudeGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/ExtrudeGeometry.js"></script>
@@ -108,10 +109,11 @@
 		<script type="text/javascript" src="../src/extras/geometries/TextGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TextGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusKnotGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusKnotGeometry.js"></script>
-		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
-		<script type="text/javascript" src="../src/extras/io/JSONLoader.js"></script>
-		<script type="text/javascript" src="../src/extras/io/BinaryLoader.js"></script>
-		<script type="text/javascript" src="../src/extras/io/SceneLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/Loader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/JSONLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/BinaryLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/SceneLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/UTF8Loader.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/Trident.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/Trident.js"></script>
 		<script type="text/javascript" src="../src/extras/physics/Collisions.js"></script>
 		<script type="text/javascript" src="../src/extras/physics/Collisions.js"></script>

+ 0 - 3
examples/obj/torus/.htaccess

@@ -1,3 +0,0 @@
-<Files *.js>
-SetOutputFilter DEFLATE
-</Files>

+ 0 - 1
examples/obj/torus/Torus.mtl

@@ -1 +0,0 @@
-# Material Count: 0

+ 0 - 1406
examples/obj/torus/Torus.obj

@@ -1,1406 +0,0 @@
-# Blender v2.54 (sub 0) OBJ File: 'quit.blend'
-# www.blender.org
-mtllib Torus.mtl
-o Torus.001
-v 2.179167 -0.818439 -1.094899
-v 2.145673 -0.693439 -1.094899
-v 2.054167 -0.601933 -1.094899
-v 1.929167 -0.568439 -1.094899
-v 1.804167 -0.601933 -1.094899
-v 1.712660 -0.693439 -1.094899
-v 1.679167 -0.818439 -1.094899
-v 1.712660 -0.943439 -1.094899
-v 1.804167 -1.034945 -1.094899
-v 1.929167 -1.068439 -1.094899
-v 2.054167 -1.034945 -1.094899
-v 2.145673 -0.943439 -1.094899
-v 2.168473 -0.818439 -1.258056
-v 2.135266 -0.693439 -1.253685
-v 2.044542 -0.601933 -1.241741
-v 1.920612 -0.568439 -1.225425
-v 1.796681 -0.601933 -1.209109
-v 1.705957 -0.693439 -1.197165
-v 1.672750 -0.818439 -1.192793
-v 1.705957 -0.943439 -1.197165
-v 1.796681 -1.034945 -1.209109
-v 1.920612 -1.068439 -1.225425
-v 2.044542 -1.034945 -1.241741
-v 2.135266 -0.943439 -1.253685
-v 2.136574 -0.818439 -1.418422
-v 2.104222 -0.693439 -1.409754
-v 2.015833 -0.601933 -1.386070
-v 1.895092 -0.568439 -1.353718
-v 1.774352 -0.601933 -1.321365
-v 1.685963 -0.693439 -1.297682
-v 1.653611 -0.818439 -1.289013
-v 1.685963 -0.943439 -1.297682
-v 1.774352 -1.034945 -1.321365
-v 1.895092 -1.068439 -1.353718
-v 2.015833 -1.034945 -1.386070
-v 2.104222 -0.943439 -1.409754
-v 2.084016 -0.818439 -1.573253
-v 2.053072 -0.693439 -1.560436
-v 1.968531 -0.601933 -1.525418
-v 1.853046 -0.568439 -1.477582
-v 1.737561 -0.601933 -1.429747
-v 1.653020 -0.693439 -1.394729
-v 1.622076 -0.818439 -1.381911
-v 1.653020 -0.943439 -1.394729
-v 1.737561 -1.034945 -1.429747
-v 1.853046 -1.068439 -1.477582
-v 1.968531 -1.034945 -1.525418
-v 2.053072 -0.943439 -1.560436
-v 2.011698 -0.818439 -1.719899
-v 1.982692 -0.693439 -1.703152
-v 1.903445 -0.601933 -1.657399
-v 1.795192 -0.568439 -1.594899
-v 1.686939 -0.601933 -1.532399
-v 1.607692 -0.693439 -1.486646
-v 1.578686 -0.818439 -1.469899
-v 1.607692 -0.943439 -1.486645
-v 1.686939 -1.034945 -1.532399
-v 1.795192 -1.068439 -1.594899
-v 1.903445 -1.034945 -1.657399
-v 1.982692 -0.943439 -1.703152
-v 1.920858 -0.818439 -1.855850
-v 1.894286 -0.693439 -1.835461
-v 1.821689 -0.601933 -1.779755
-v 1.722520 -0.568439 -1.703660
-v 1.623351 -0.601933 -1.627565
-v 1.550754 -0.693439 -1.571859
-v 1.524182 -0.818439 -1.551470
-v 1.550754 -0.943439 -1.571859
-v 1.623351 -1.034945 -1.627565
-v 1.722520 -1.068439 -1.703660
-v 1.821689 -1.034945 -1.779755
-v 1.894286 -0.943439 -1.835461
-v 1.813050 -0.818439 -1.978782
-v 1.789366 -0.693439 -1.955099
-v 1.724662 -0.601933 -1.890394
-v 1.636273 -0.568439 -1.802006
-v 1.547885 -0.601933 -1.713617
-v 1.483180 -0.693439 -1.648912
-v 1.459497 -0.818439 -1.625229
-v 1.483180 -0.943439 -1.648912
-v 1.547885 -1.034945 -1.713617
-v 1.636273 -1.068439 -1.802006
-v 1.724662 -1.034945 -1.890394
-v 1.789366 -0.943439 -1.955099
-v 1.690118 -0.818439 -2.086590
-v 1.669729 -0.693439 -2.060018
-v 1.614023 -0.601933 -1.987421
-v 1.537928 -0.568439 -1.888252
-v 1.461833 -0.601933 -1.789083
-v 1.406127 -0.693439 -1.716486
-v 1.385738 -0.818439 -1.689914
-v 1.406127 -0.943439 -1.716486
-v 1.461833 -1.034945 -1.789083
-v 1.537928 -1.068439 -1.888252
-v 1.614023 -1.034945 -1.987421
-v 1.669729 -0.943439 -2.060018
-v 1.554167 -0.818439 -2.177430
-v 1.537420 -0.693439 -2.148424
-v 1.491667 -0.601933 -2.069177
-v 1.429167 -0.568439 -1.960924
-v 1.366667 -0.601933 -1.852671
-v 1.320913 -0.693439 -1.773424
-v 1.304167 -0.818439 -1.744418
-v 1.320913 -0.943439 -1.773424
-v 1.366667 -1.034945 -1.852671
-v 1.429167 -1.068439 -1.960924
-v 1.491667 -1.034945 -2.069177
-v 1.537420 -0.943439 -2.148424
-v 1.407521 -0.818439 -2.249748
-v 1.394704 -0.693439 -2.218804
-v 1.359685 -0.601933 -2.134263
-v 1.311850 -0.568439 -2.018778
-v 1.264015 -0.601933 -1.903293
-v 1.228997 -0.693439 -1.818752
-v 1.216179 -0.818439 -1.787808
-v 1.228997 -0.943439 -1.818752
-v 1.264015 -1.034945 -1.903293
-v 1.311850 -1.068439 -2.018778
-v 1.359685 -1.034945 -2.134263
-v 1.394704 -0.943439 -2.218804
-v 1.252690 -0.818439 -2.302306
-v 1.244022 -0.693439 -2.269954
-v 1.220338 -0.601933 -2.181565
-v 1.187986 -0.568439 -2.060825
-v 1.155633 -0.601933 -1.940084
-v 1.131950 -0.693439 -1.851695
-v 1.123281 -0.818439 -1.819343
-v 1.131950 -0.943439 -1.851695
-v 1.155633 -1.034945 -1.940084
-v 1.187986 -1.068439 -2.060824
-v 1.220338 -1.034945 -2.181565
-v 1.244022 -0.943439 -2.269953
-v 1.092324 -0.818439 -2.334205
-v 1.087953 -0.693439 -2.300998
-v 1.076009 -0.601933 -2.210274
-v 1.059693 -0.568439 -2.086344
-v 1.043377 -0.601933 -1.962413
-v 1.031433 -0.693439 -1.871689
-v 1.027061 -0.818439 -1.838482
-v 1.031433 -0.943439 -1.871689
-v 1.043377 -1.034945 -1.962413
-v 1.059693 -1.068439 -2.086344
-v 1.076009 -1.034945 -2.210274
-v 1.087953 -0.943439 -2.300998
-v 0.929167 -0.818439 -2.344899
-v 0.929167 -0.693439 -2.311405
-v 0.929167 -0.601933 -2.219899
-v 0.929167 -0.568439 -2.094899
-v 0.929167 -0.601933 -1.969899
-v 0.929167 -0.693439 -1.878392
-v 0.929167 -0.818439 -1.844899
-v 0.929167 -0.943439 -1.878392
-v 0.929167 -1.034945 -1.969899
-v 0.929167 -1.068439 -2.094899
-v 0.929167 -1.034945 -2.219898
-v 0.929167 -0.943439 -2.311405
-v 0.766009 -0.818439 -2.334205
-v 0.770381 -0.693439 -2.300998
-v 0.782325 -0.601933 -2.210274
-v 0.798640 -0.568439 -2.086344
-v 0.814956 -0.601933 -1.962413
-v 0.826900 -0.693439 -1.871689
-v 0.831272 -0.818439 -1.838482
-v 0.826900 -0.943439 -1.871689
-v 0.814956 -1.034945 -1.962413
-v 0.798640 -1.068439 -2.086344
-v 0.782325 -1.034945 -2.210274
-v 0.770381 -0.943439 -2.300998
-v 0.605643 -0.818439 -2.302306
-v 0.614312 -0.693439 -2.269954
-v 0.637995 -0.601933 -2.181565
-v 0.670348 -0.568439 -2.060825
-v 0.702700 -0.601933 -1.940084
-v 0.726384 -0.693439 -1.851695
-v 0.735052 -0.818439 -1.819343
-v 0.726384 -0.943439 -1.851695
-v 0.702700 -1.034945 -1.940084
-v 0.670348 -1.068439 -2.060824
-v 0.637995 -1.034945 -2.181565
-v 0.614312 -0.943439 -2.269953
-v 0.450812 -0.818439 -2.249748
-v 0.463630 -0.693439 -2.218804
-v 0.498648 -0.601933 -2.134263
-v 0.546483 -0.568439 -2.018778
-v 0.594319 -0.601933 -1.903293
-v 0.629337 -0.693439 -1.818752
-v 0.642154 -0.818439 -1.787808
-v 0.629337 -0.943439 -1.818752
-v 0.594319 -1.034945 -1.903293
-v 0.546483 -1.068439 -2.018778
-v 0.498648 -1.034945 -2.134263
-v 0.463630 -0.943439 -2.218804
-v 0.304167 -0.818439 -2.177430
-v 0.320913 -0.693439 -2.148424
-v 0.366667 -0.601933 -2.069177
-v 0.429167 -0.568439 -1.960924
-v 0.491667 -0.601933 -1.852671
-v 0.537420 -0.693439 -1.773424
-v 0.554167 -0.818439 -1.744418
-v 0.537420 -0.943439 -1.773424
-v 0.491667 -1.034945 -1.852671
-v 0.429167 -1.068439 -1.960924
-v 0.366667 -1.034945 -2.069177
-v 0.320913 -0.943439 -2.148424
-v 0.168215 -0.818439 -2.086590
-v 0.188604 -0.693439 -2.060018
-v 0.244310 -0.601933 -1.987421
-v 0.320405 -0.568439 -1.888252
-v 0.396500 -0.601933 -1.789083
-v 0.452206 -0.693439 -1.716486
-v 0.472596 -0.818439 -1.689914
-v 0.452206 -0.943439 -1.716486
-v 0.396500 -1.034945 -1.789083
-v 0.320405 -1.068439 -1.888252
-v 0.244310 -1.034945 -1.987421
-v 0.188604 -0.943439 -2.060018
-v 0.045283 -0.818439 -1.978782
-v 0.068967 -0.693439 -1.955099
-v 0.133672 -0.601933 -1.890394
-v 0.222060 -0.568439 -1.802006
-v 0.310448 -0.601933 -1.713617
-v 0.375153 -0.693439 -1.648912
-v 0.398837 -0.818439 -1.625229
-v 0.375153 -0.943439 -1.648912
-v 0.310448 -1.034945 -1.713617
-v 0.222060 -1.068439 -1.802005
-v 0.133672 -1.034945 -1.890394
-v 0.068967 -0.943439 -1.955099
-v -0.062525 -0.818439 -1.855850
-v -0.035953 -0.693439 -1.835461
-v 0.036644 -0.601933 -1.779755
-v 0.135813 -0.568439 -1.703660
-v 0.234982 -0.601933 -1.627565
-v 0.307579 -0.693439 -1.571859
-v 0.334152 -0.818439 -1.551470
-v 0.307579 -0.943439 -1.571859
-v 0.234982 -1.034945 -1.627565
-v 0.135813 -1.068439 -1.703660
-v 0.036644 -1.034945 -1.779755
-v -0.035953 -0.943439 -1.835461
-v -0.153365 -0.818439 -1.719899
-v -0.124359 -0.693439 -1.703152
-v -0.045112 -0.601933 -1.657399
-v 0.063141 -0.568439 -1.594899
-v 0.171394 -0.601933 -1.532399
-v 0.250641 -0.693439 -1.486646
-v 0.279648 -0.818439 -1.469899
-v 0.250641 -0.943439 -1.486646
-v 0.171394 -1.034945 -1.532399
-v 0.063141 -1.068439 -1.594899
-v -0.045112 -1.034945 -1.657399
-v -0.124359 -0.943439 -1.703152
-v -0.225683 -0.818439 -1.573253
-v -0.194739 -0.693439 -1.560436
-v -0.110198 -0.601933 -1.525418
-v 0.005287 -0.568439 -1.477582
-v 0.120772 -0.601933 -1.429747
-v 0.205313 -0.693439 -1.394729
-v 0.236257 -0.818439 -1.381911
-v 0.205313 -0.943439 -1.394729
-v 0.120772 -1.034945 -1.429747
-v 0.005287 -1.068439 -1.477582
-v -0.110198 -1.034945 -1.525418
-v -0.194739 -0.943439 -1.560436
-v -0.278240 -0.818439 -1.418423
-v -0.245888 -0.693439 -1.409754
-v -0.157500 -0.601933 -1.386070
-v -0.036759 -0.568439 -1.353718
-v 0.083982 -0.601933 -1.321365
-v 0.172370 -0.693439 -1.297682
-v 0.204722 -0.818439 -1.289013
-v 0.172370 -0.943439 -1.297682
-v 0.083982 -1.034945 -1.321365
-v -0.036759 -1.068439 -1.353718
-v -0.157500 -1.034945 -1.386070
-v -0.245888 -0.943439 -1.409754
-v -0.310139 -0.818439 -1.258056
-v -0.276932 -0.693439 -1.253685
-v -0.186209 -0.601933 -1.241741
-v -0.062278 -0.568439 -1.225425
-v 0.061652 -0.601933 -1.209109
-v 0.152376 -0.693439 -1.197165
-v 0.185583 -0.818439 -1.192793
-v 0.152376 -0.943439 -1.197165
-v 0.061652 -1.034945 -1.209109
-v -0.062278 -1.068439 -1.225425
-v -0.186209 -1.034945 -1.241741
-v -0.276932 -0.943439 -1.253685
-v -0.320833 -0.818439 -1.094899
-v -0.287340 -0.693439 -1.094899
-v -0.195833 -0.601933 -1.094899
-v -0.070833 -0.568439 -1.094899
-v 0.054167 -0.601933 -1.094899
-v 0.145673 -0.693439 -1.094899
-v 0.179167 -0.818439 -1.094899
-v 0.145673 -0.943439 -1.094899
-v 0.054167 -1.034945 -1.094899
-v -0.070833 -1.068439 -1.094899
-v -0.195833 -1.034945 -1.094899
-v -0.287340 -0.943439 -1.094899
-v -0.310139 -0.818439 -0.931741
-v -0.276932 -0.693439 -0.936113
-v -0.186209 -0.601933 -0.948057
-v -0.062278 -0.568439 -0.964372
-v 0.061652 -0.601933 -0.980688
-v 0.152376 -0.693439 -0.992632
-v 0.185583 -0.818439 -0.997004
-v 0.152376 -0.943439 -0.992632
-v 0.061652 -1.034945 -0.980688
-v -0.062278 -1.068439 -0.964372
-v -0.186209 -1.034945 -0.948057
-v -0.276932 -0.943439 -0.936113
-v -0.278241 -0.818439 -0.771375
-v -0.245888 -0.693439 -0.780044
-v -0.157500 -0.601933 -0.803727
-v -0.036759 -0.568439 -0.836080
-v 0.083982 -0.601933 -0.868432
-v 0.172370 -0.693439 -0.892116
-v 0.204722 -0.818439 -0.900784
-v 0.172370 -0.943439 -0.892116
-v 0.083982 -1.034945 -0.868432
-v -0.036759 -1.068439 -0.836080
-v -0.157500 -1.034945 -0.803727
-v -0.245888 -0.943439 -0.780044
-v -0.225683 -0.818439 -0.616544
-v -0.194739 -0.693439 -0.629362
-v -0.110198 -0.601933 -0.664380
-v 0.005287 -0.568439 -0.712215
-v 0.120772 -0.601933 -0.760051
-v 0.205313 -0.693439 -0.795069
-v 0.236257 -0.818439 -0.807886
-v 0.205313 -0.943439 -0.795069
-v 0.120772 -1.034945 -0.760051
-v 0.005287 -1.068439 -0.712215
-v -0.110198 -1.034945 -0.664380
-v -0.194739 -0.943439 -0.629362
-v -0.153365 -0.818439 -0.469899
-v -0.124359 -0.693439 -0.486646
-v -0.045112 -0.601933 -0.532399
-v 0.063141 -0.568439 -0.594899
-v 0.171394 -0.601933 -0.657399
-v 0.250641 -0.693439 -0.703152
-v 0.279648 -0.818439 -0.719899
-v 0.250641 -0.943439 -0.703152
-v 0.171394 -1.034945 -0.657399
-v 0.063141 -1.068439 -0.594899
-v -0.045112 -1.034945 -0.532399
-v -0.124359 -0.943439 -0.486646
-v -0.062525 -0.818439 -0.333947
-v -0.035953 -0.693439 -0.354337
-v 0.036644 -0.601933 -0.410042
-v 0.135813 -0.568439 -0.486137
-v 0.234982 -0.601933 -0.562232
-v 0.307579 -0.693439 -0.617938
-v 0.334152 -0.818439 -0.638328
-v 0.307579 -0.943439 -0.617938
-v 0.234982 -1.034945 -0.562232
-v 0.135813 -1.068439 -0.486137
-v 0.036644 -1.034945 -0.410042
-v -0.035953 -0.943439 -0.354337
-v 0.045283 -0.818439 -0.211015
-v 0.068967 -0.693439 -0.234699
-v 0.133671 -0.601932 -0.299404
-v 0.222060 -0.568439 -0.387792
-v 0.310448 -0.601933 -0.476180
-v 0.375153 -0.693439 -0.540885
-v 0.398837 -0.818439 -0.564569
-v 0.375153 -0.943439 -0.540885
-v 0.310448 -1.034945 -0.476180
-v 0.222060 -1.068439 -0.387792
-v 0.133671 -1.034945 -0.299404
-v 0.068967 -0.943439 -0.234699
-v 0.168215 -0.818439 -0.103207
-v 0.188604 -0.693439 -0.129779
-v 0.244310 -0.601933 -0.202376
-v 0.320405 -0.568439 -0.301545
-v 0.396500 -0.601933 -0.400715
-v 0.452206 -0.693439 -0.473311
-v 0.472596 -0.818439 -0.499884
-v 0.452206 -0.943439 -0.473311
-v 0.396500 -1.034945 -0.400715
-v 0.320405 -1.068439 -0.301545
-v 0.244310 -1.034945 -0.202376
-v 0.188604 -0.943439 -0.129779
-v 0.304167 -0.818439 -0.012367
-v 0.320914 -0.693439 -0.041373
-v 0.366667 -0.601932 -0.120620
-v 0.429167 -0.568439 -0.228873
-v 0.491667 -0.601932 -0.337126
-v 0.537420 -0.693439 -0.416373
-v 0.554167 -0.818439 -0.445380
-v 0.537420 -0.943439 -0.416373
-v 0.491667 -1.034945 -0.337126
-v 0.429167 -1.068439 -0.228873
-v 0.366667 -1.034945 -0.120620
-v 0.320914 -0.943439 -0.041373
-v 0.450812 -0.818439 0.059951
-v 0.463630 -0.693439 0.029007
-v 0.498648 -0.601932 -0.055534
-v 0.546483 -0.568439 -0.171019
-v 0.594319 -0.601933 -0.286504
-v 0.629337 -0.693439 -0.371045
-v 0.642154 -0.818439 -0.401989
-v 0.629337 -0.943439 -0.371045
-v 0.594319 -1.034945 -0.286504
-v 0.546483 -1.068439 -0.171019
-v 0.498648 -1.034945 -0.055534
-v 0.463630 -0.943439 0.029007
-v 0.605643 -0.818439 0.112509
-v 0.614312 -0.693439 0.080156
-v 0.637995 -0.601933 -0.008232
-v 0.670348 -0.568439 -0.128973
-v 0.702700 -0.601933 -0.249714
-v 0.726384 -0.693439 -0.338102
-v 0.735052 -0.818439 -0.370454
-v 0.726384 -0.943439 -0.338102
-v 0.702700 -1.034945 -0.249714
-v 0.670348 -1.068439 -0.128973
-v 0.637995 -1.034945 -0.008232
-v 0.614312 -0.943439 0.080156
-v 0.766009 -0.818439 0.144407
-v 0.770380 -0.693439 0.111200
-v 0.782324 -0.601932 0.020477
-v 0.798640 -0.568439 -0.103454
-v 0.814956 -0.601932 -0.227384
-v 0.826900 -0.693439 -0.318108
-v 0.831272 -0.818439 -0.351315
-v 0.826900 -0.943439 -0.318108
-v 0.814956 -1.034945 -0.227384
-v 0.798640 -1.068439 -0.103454
-v 0.782324 -1.034945 0.020477
-v 0.770380 -0.943439 0.111200
-v 0.929167 -0.818439 0.155101
-v 0.929167 -0.693439 0.121608
-v 0.929167 -0.601933 0.030101
-v 0.929167 -0.568439 -0.094899
-v 0.929167 -0.601933 -0.219899
-v 0.929167 -0.693439 -0.311405
-v 0.929167 -0.818439 -0.344899
-v 0.929167 -0.943439 -0.311405
-v 0.929167 -1.034945 -0.219899
-v 0.929167 -1.068439 -0.094899
-v 0.929167 -1.034945 0.030101
-v 0.929167 -0.943439 0.121608
-v 1.092325 -0.818439 0.144407
-v 1.087953 -0.693439 0.111200
-v 1.076009 -0.601932 0.020477
-v 1.059693 -0.568439 -0.103454
-v 1.043377 -0.601932 -0.227384
-v 1.031433 -0.693439 -0.318108
-v 1.027061 -0.818439 -0.351315
-v 1.031433 -0.943439 -0.318108
-v 1.043377 -1.034945 -0.227384
-v 1.059693 -1.068439 -0.103454
-v 1.076009 -1.034945 0.020477
-v 1.087953 -0.943439 0.111200
-v 1.252690 -0.818439 0.112509
-v 1.244022 -0.693439 0.080156
-v 1.220338 -0.601933 -0.008232
-v 1.187986 -0.568439 -0.128973
-v 1.155633 -0.601933 -0.249714
-v 1.131950 -0.693439 -0.338102
-v 1.123281 -0.818439 -0.370454
-v 1.131950 -0.943439 -0.338102
-v 1.155633 -1.034945 -0.249714
-v 1.187986 -1.068439 -0.128973
-v 1.220338 -1.034945 -0.008232
-v 1.244022 -0.943439 0.080156
-v 1.407521 -0.818439 0.059951
-v 1.394704 -0.693439 0.029007
-v 1.359686 -0.601932 -0.055534
-v 1.311850 -0.568439 -0.171019
-v 1.264015 -0.601933 -0.286504
-v 1.228997 -0.693439 -0.371045
-v 1.216179 -0.818439 -0.401989
-v 1.228997 -0.943439 -0.371045
-v 1.264015 -1.034945 -0.286504
-v 1.311850 -1.068439 -0.171019
-v 1.359686 -1.034945 -0.055534
-v 1.394704 -0.943439 0.029007
-v 1.554167 -0.818439 -0.012367
-v 1.537420 -0.693439 -0.041373
-v 1.491667 -0.601932 -0.120620
-v 1.429167 -0.568439 -0.228873
-v 1.366667 -0.601932 -0.337126
-v 1.320913 -0.693439 -0.416373
-v 1.304167 -0.818439 -0.445380
-v 1.320913 -0.943439 -0.416373
-v 1.366667 -1.034945 -0.337126
-v 1.429167 -1.068439 -0.228873
-v 1.491667 -1.034945 -0.120620
-v 1.537420 -0.943439 -0.041373
-v 1.690119 -0.818439 -0.103207
-v 1.669729 -0.693439 -0.129779
-v 1.614023 -0.601933 -0.202376
-v 1.537928 -0.568439 -0.301545
-v 1.461833 -0.601933 -0.400715
-v 1.406127 -0.693439 -0.473311
-v 1.385738 -0.818439 -0.499884
-v 1.406127 -0.943439 -0.473311
-v 1.461833 -1.034945 -0.400715
-v 1.537928 -1.068439 -0.301545
-v 1.614023 -1.034945 -0.202376
-v 1.669729 -0.943439 -0.129779
-v 1.813050 -0.818439 -0.211015
-v 1.789366 -0.693439 -0.234699
-v 1.724662 -0.601933 -0.299403
-v 1.636273 -0.568439 -0.387792
-v 1.547885 -0.601933 -0.476180
-v 1.483180 -0.693439 -0.540885
-v 1.459497 -0.818439 -0.564569
-v 1.483180 -0.943439 -0.540885
-v 1.547885 -1.034945 -0.476180
-v 1.636273 -1.068439 -0.387792
-v 1.724662 -1.034945 -0.299403
-v 1.789366 -0.943439 -0.234699
-v 1.920858 -0.818439 -0.333947
-v 1.894286 -0.693439 -0.354337
-v 1.821689 -0.601932 -0.410042
-v 1.722520 -0.568439 -0.486137
-v 1.623351 -0.601933 -0.562232
-v 1.550754 -0.693439 -0.617938
-v 1.524182 -0.818439 -0.638328
-v 1.550754 -0.943439 -0.617938
-v 1.623351 -1.034945 -0.562232
-v 1.722520 -1.068439 -0.486137
-v 1.821689 -1.034945 -0.410042
-v 1.894286 -0.943439 -0.354337
-v 2.011698 -0.818439 -0.469899
-v 1.982692 -0.693439 -0.486645
-v 1.903445 -0.601933 -0.532399
-v 1.795192 -0.568439 -0.594899
-v 1.686939 -0.601933 -0.657399
-v 1.607692 -0.693439 -0.703152
-v 1.578686 -0.818439 -0.719899
-v 1.607692 -0.943439 -0.703152
-v 1.686939 -1.034945 -0.657399
-v 1.795192 -1.068439 -0.594899
-v 1.903445 -1.034945 -0.532399
-v 1.982692 -0.943439 -0.486645
-v 2.084016 -0.818439 -0.616544
-v 2.053072 -0.693439 -0.629362
-v 1.968531 -0.601933 -0.664380
-v 1.853046 -0.568439 -0.712215
-v 1.737561 -0.601933 -0.760051
-v 1.653020 -0.693439 -0.795069
-v 1.622076 -0.818439 -0.807886
-v 1.653020 -0.943439 -0.795069
-v 1.737561 -1.034945 -0.760051
-v 1.853046 -1.068439 -0.712215
-v 1.968531 -1.034945 -0.664380
-v 2.053072 -0.943439 -0.629362
-v 2.136574 -0.818439 -0.771375
-v 2.104222 -0.693439 -0.780044
-v 2.015833 -0.601933 -0.803728
-v 1.895093 -0.568439 -0.836080
-v 1.774352 -0.601933 -0.868432
-v 1.685963 -0.693439 -0.892116
-v 1.653611 -0.818439 -0.900785
-v 1.685963 -0.943439 -0.892116
-v 1.774352 -1.034945 -0.868432
-v 1.895093 -1.068439 -0.836080
-v 2.015833 -1.034945 -0.803728
-v 2.104222 -0.943439 -0.780044
-v 2.168473 -0.818439 -0.931741
-v 2.135266 -0.693439 -0.936113
-v 2.044542 -0.601933 -0.948057
-v 1.920612 -0.568439 -0.964372
-v 1.796681 -0.601933 -0.980688
-v 1.705957 -0.693439 -0.992632
-v 1.672750 -0.818439 -0.997004
-v 1.705957 -0.943439 -0.992632
-v 1.796681 -1.034945 -0.980688
-v 1.920612 -1.068439 -0.964372
-v 2.044542 -1.034945 -0.948057
-v 2.135266 -0.943439 -0.936113
-vn 1.000000 0.000000 0.000000
-vn 0.991424 0.000000 -0.130497
-vn 0.858547 0.500107 -0.113010
-vn 0.865963 0.500107 0.000000
-vn 0.495590 0.866085 -0.065249
-vn 0.499863 0.866085 0.000000
-vn 0.000000 1.000000 0.000000
-vn -0.495590 0.866085 0.065249
-vn -0.499863 0.866085 0.000000
-vn -0.858547 0.500107 0.113010
-vn -0.865963 0.500107 0.000000
-vn -0.991424 0.000000 0.130497
-vn -0.999969 0.000000 0.000000
-vn -0.858547 -0.500107 0.113010
-vn -0.865963 -0.500107 0.000000
-vn -0.495590 -0.866085 0.065249
-vn -0.499863 -0.866085 0.000000
-vn 0.000000 -1.000000 0.000000
-vn 0.495590 -0.866085 -0.065249
-vn 0.499863 -0.866085 0.000000
-vn 0.858547 -0.500107 -0.113010
-vn 0.865963 -0.500107 0.000000
-vn 0.965911 0.000000 -0.258797
-vn 0.836451 0.500107 -0.224128
-vn 0.482833 0.866085 -0.129368
-vn -0.482833 0.866085 0.129368
-vn -0.836451 0.500107 0.224097
-vn -0.965911 0.000000 0.258797
-vn -0.836451 -0.500107 0.224128
-vn -0.482833 -0.866085 0.129368
-vn 0.482833 -0.866085 -0.129368
-vn 0.836451 -0.500107 -0.224128
-vn 0.923856 0.000000 -0.382672
-vn 0.800043 0.500107 -0.331370
-vn 0.461837 0.866085 -0.191290
-vn -0.461837 0.866085 0.191290
-vn -0.800043 0.500107 0.331370
-vn -0.923856 0.000000 0.382672
-vn -0.800043 -0.500107 0.331370
-vn -0.461837 -0.866085 0.191290
-vn 0.461837 -0.866085 -0.191290
-vn 0.800043 -0.500107 -0.331370
-vn 0.866024 0.000000 -0.499985
-vn 0.749931 0.500107 -0.432966
-vn 0.432905 0.866085 -0.249916
-vn -0.432905 0.866085 0.249916
-vn -0.749931 0.500107 0.432966
-vn -0.866024 0.000000 0.499985
-vn -0.749931 -0.500107 0.432966
-vn -0.432905 -0.866085 0.249916
-vn 0.432905 -0.866085 -0.249916
-vn 0.749931 -0.500107 -0.432966
-vn 0.793329 0.000000 -0.608753
-vn 0.687002 0.500107 -0.527146
-vn 0.396588 0.866085 -0.304300
-vn -0.396588 0.866085 0.304300
-vn -0.687002 0.500107 0.527146
-vn -0.793329 0.000000 0.608753
-vn -0.687002 -0.500107 0.527146
-vn -0.396588 -0.866085 0.304300
-vn 0.396588 -0.866085 -0.304300
-vn 0.687002 -0.500107 -0.527146
-vn 0.707083 0.000000 -0.707083
-vn 0.612323 0.500107 -0.612323
-vn 0.353465 0.866085 -0.353465
-vn -0.353465 0.866085 0.353465
-vn -0.612323 0.500107 0.612323
-vn -0.707083 0.000000 0.707083
-vn -0.612323 -0.500107 0.612323
-vn -0.353465 -0.866085 0.353465
-vn 0.353465 -0.866085 -0.353465
-vn 0.612323 -0.500107 -0.612323
-vn 0.608753 0.000000 -0.793329
-vn 0.527146 0.500107 -0.687002
-vn 0.304300 0.866085 -0.396588
-vn -0.304300 0.866085 0.396588
-vn -0.527146 0.500107 0.687002
-vn -0.608753 0.000000 0.793329
-vn -0.527146 -0.500107 0.687002
-vn -0.304300 -0.866085 0.396588
-vn 0.304300 -0.866085 -0.396588
-vn 0.527146 -0.500107 -0.687002
-vn 0.499985 0.000000 -0.866024
-vn 0.432966 0.500107 -0.749931
-vn 0.249916 0.866085 -0.432905
-vn -0.249916 0.866085 0.432905
-vn -0.432966 0.500107 0.749931
-vn -0.499985 0.000000 0.866024
-vn -0.432966 -0.500107 0.749931
-vn -0.249916 -0.866085 0.432905
-vn 0.249916 -0.866085 -0.432905
-vn 0.432966 -0.500107 -0.749931
-vn 0.382672 0.000000 -0.923856
-vn 0.331370 0.500107 -0.800043
-vn 0.191290 0.866085 -0.461837
-vn -0.191290 0.866085 0.461837
-vn -0.331370 0.500107 0.800043
-vn -0.382672 0.000000 0.923856
-vn -0.331370 -0.500107 0.800043
-vn -0.191290 -0.866085 0.461837
-vn 0.191290 -0.866085 -0.461837
-vn 0.331370 -0.500107 -0.800043
-vn 0.258797 0.000000 -0.965911
-vn 0.224097 0.500107 -0.836451
-vn 0.129368 0.866085 -0.482833
-vn -0.129368 0.866085 0.482833
-vn -0.224097 0.500107 0.836451
-vn -0.258797 0.000000 0.965911
-vn -0.224128 -0.500107 0.836451
-vn -0.129368 -0.866085 0.482833
-vn 0.129368 -0.866085 -0.482833
-vn 0.224097 -0.500107 -0.836451
-vn 0.130497 0.000000 -0.991424
-vn 0.113010 0.500107 -0.858547
-vn 0.065249 0.866085 -0.495590
-vn -0.065249 0.866085 0.495590
-vn -0.113010 0.500107 0.858547
-vn -0.130497 0.000000 0.991424
-vn -0.113010 -0.500107 0.858547
-vn -0.065249 -0.866085 0.495590
-vn 0.065249 -0.866085 -0.495590
-vn 0.113010 -0.500107 -0.858547
-vn 0.000000 0.000000 -1.000000
-vn 0.000000 0.500107 -0.865963
-vn 0.000000 0.866085 -0.499863
-vn 0.000000 0.866085 0.499863
-vn 0.000000 0.500107 0.865963
-vn 0.000000 0.000000 1.000000
-vn 0.000000 -0.500107 0.865963
-vn 0.000000 -0.866085 0.499863
-vn 0.000000 -0.866085 -0.499863
-vn 0.000000 -0.500107 -0.865963
-vn -0.130497 0.000000 -0.991424
-vn -0.113010 0.500107 -0.858547
-vn -0.065249 0.866085 -0.495590
-vn 0.065249 0.866085 0.495590
-vn 0.113010 0.500107 0.858547
-vn 0.130497 0.000000 0.991424
-vn 0.113010 -0.500107 0.858547
-vn 0.065249 -0.866085 0.495590
-vn -0.065249 -0.866085 -0.495590
-vn -0.113010 -0.500107 -0.858547
-vn -0.258797 0.000000 -0.965911
-vn -0.224097 0.500107 -0.836451
-vn -0.129368 0.866085 -0.482833
-vn 0.129368 0.866085 0.482833
-vn 0.224097 0.500107 0.836451
-vn 0.258797 0.000000 0.965911
-vn 0.224097 -0.500107 0.836451
-vn 0.129368 -0.866085 0.482833
-vn -0.129368 -0.866085 -0.482833
-vn -0.224097 -0.500107 -0.836451
-vn -0.382672 0.000000 -0.923856
-vn -0.331370 0.500107 -0.800043
-vn -0.191290 0.866085 -0.461837
-vn 0.191290 0.866085 0.461837
-vn 0.331370 0.500107 0.800043
-vn 0.382672 0.000000 0.923856
-vn 0.331370 -0.500107 0.800043
-vn 0.191290 -0.866085 0.461837
-vn -0.191290 -0.866085 -0.461837
-vn -0.331370 -0.500107 -0.800043
-vn -0.499985 0.000000 -0.866024
-vn -0.432966 0.500107 -0.749931
-vn -0.249916 0.866085 -0.432905
-vn 0.249916 0.866085 0.432905
-vn 0.432966 0.500107 0.749931
-vn 0.499985 0.000000 0.866024
-vn 0.432966 -0.500107 0.749931
-vn 0.249916 -0.866085 0.432905
-vn -0.249916 -0.866085 -0.432905
-vn -0.432966 -0.500107 -0.749931
-vn -0.608753 0.000000 -0.793329
-vn -0.527146 0.500107 -0.687002
-vn -0.304300 0.866085 -0.396588
-vn 0.304300 0.866085 0.396588
-vn 0.527146 0.500107 0.687002
-vn 0.608753 0.000000 0.793329
-vn 0.527146 -0.500107 0.687002
-vn 0.304300 -0.866085 0.396588
-vn -0.304300 -0.866085 -0.396588
-vn -0.527146 -0.500107 -0.687002
-vn -0.707083 0.000000 -0.707083
-vn -0.612323 0.500107 -0.612323
-vn -0.353465 0.866085 -0.353465
-vn 0.353465 0.866085 0.353465
-vn 0.612323 0.500107 0.612323
-vn 0.707083 0.000000 0.707083
-vn 0.612323 -0.500107 0.612323
-vn 0.353465 -0.866085 0.353465
-vn -0.353465 -0.866085 -0.353465
-vn -0.612323 -0.500107 -0.612323
-vn -0.793329 0.000000 -0.608753
-vn -0.687002 0.500107 -0.527146
-vn -0.396588 0.866085 -0.304300
-vn 0.396588 0.866085 0.304300
-vn 0.687002 0.500107 0.527146
-vn 0.793329 0.000000 0.608753
-vn 0.687002 -0.500107 0.527146
-vn 0.396588 -0.866085 0.304300
-vn -0.396588 -0.866085 -0.304300
-vn -0.687002 -0.500107 -0.527146
-vn -0.866024 0.000000 -0.499985
-vn -0.749931 0.500107 -0.432966
-vn -0.432905 0.866085 -0.249916
-vn 0.432905 0.866085 0.249916
-vn 0.749931 0.500107 0.432966
-vn 0.866024 0.000000 0.499985
-vn 0.749931 -0.500107 0.432966
-vn 0.432905 -0.866085 0.249916
-vn -0.432905 -0.866085 -0.249916
-vn -0.749931 -0.500107 -0.432966
-vn -0.923856 0.000000 -0.382672
-vn -0.800043 0.500107 -0.331370
-vn -0.461837 0.866085 -0.191290
-vn 0.461837 0.866085 0.191290
-vn 0.800043 0.500107 0.331370
-vn 0.923856 0.000000 0.382672
-vn 0.800043 -0.500107 0.331370
-vn 0.461837 -0.866085 0.191290
-vn -0.461837 -0.866085 -0.191290
-vn -0.800043 -0.500107 -0.331370
-vn -0.965911 0.000000 -0.258797
-vn -0.836451 0.500107 -0.224128
-vn -0.482833 0.866085 -0.129368
-vn 0.482833 0.866085 0.129368
-vn 0.836451 0.500107 0.224128
-vn 0.965911 0.000000 0.258797
-vn 0.836451 -0.500107 0.224128
-vn 0.482833 -0.866085 0.129368
-vn -0.482833 -0.866085 -0.129368
-vn -0.836451 -0.500107 -0.224128
-vn -0.991424 0.000000 -0.130497
-vn -0.858547 0.500107 -0.113010
-vn -0.495590 0.866085 -0.065249
-vn 0.495590 0.866085 0.065249
-vn 0.858547 0.500107 0.113010
-vn 0.991424 0.000000 0.130497
-vn 0.858547 -0.500107 0.113010
-vn 0.495590 -0.866085 0.065249
-vn -0.495590 -0.866085 -0.065249
-vn -0.858547 -0.500107 -0.113010
-vn -1.000000 0.000000 0.000000
-vn -0.836451 0.500107 0.224128
-vn -0.224097 -0.500107 0.836451
-vn 0.000000 0.000000 -0.999969
-vn -0.836451 0.500107 -0.224097
-g Torus.001_Torus.001
-usemtl (null)
-s 1
-f 1//1 13//2 14//3 2//4
-f 2//4 14//3 15//5 3//6
-f 3//6 15//5 16//7 4//7
-f 4//7 16//7 17//8 5//9
-f 5//9 17//8 18//10 6//11
-f 6//11 18//10 19//12 7//13
-f 7//13 19//12 20//14 8//15
-f 8//15 20//14 21//16 9//17
-f 9//17 21//16 22//18 10//18
-f 10//18 22//18 23//19 11//20
-f 11//20 23//19 24//21 12//22
-f 1//1 12//22 24//21 13//2
-f 13//2 25//23 26//24 14//3
-f 14//3 26//24 27//25 15//5
-f 15//5 27//25 28//7 16//7
-f 16//7 28//7 29//26 17//8
-f 17//8 29//26 30//27 18//10
-f 18//10 30//27 31//28 19//12
-f 19//12 31//28 32//29 20//14
-f 20//14 32//29 33//30 21//16
-f 21//16 33//30 34//18 22//18
-f 22//18 34//18 35//31 23//19
-f 23//19 35//31 36//32 24//21
-f 24//21 36//32 25//23 13//2
-f 25//23 37//33 38//34 26//24
-f 26//24 38//34 39//35 27//25
-f 27//25 39//35 40//7 28//7
-f 28//7 40//7 41//36 29//26
-f 29//26 41//36 42//37 30//27
-f 30//27 42//37 43//38 31//28
-f 31//28 43//38 44//39 32//29
-f 32//29 44//39 45//40 33//30
-f 33//30 45//40 46//18 34//18
-f 34//18 46//18 47//41 35//31
-f 35//31 47//41 48//42 36//32
-f 36//32 48//42 37//33 25//23
-f 37//33 49//43 50//44 38//34
-f 38//34 50//44 51//45 39//35
-f 39//35 51//45 52//7 40//7
-f 40//7 52//7 53//46 41//36
-f 41//36 53//46 54//47 42//37
-f 42//37 54//47 55//48 43//38
-f 43//38 55//48 56//49 44//39
-f 44//39 56//49 57//50 45//40
-f 45//40 57//50 58//18 46//18
-f 46//18 58//18 59//51 47//41
-f 47//41 59//51 60//52 48//42
-f 48//42 60//52 49//43 37//33
-f 49//43 61//53 62//54 50//44
-f 50//44 62//54 63//55 51//45
-f 51//45 63//55 64//7 52//7
-f 52//7 64//7 65//56 53//46
-f 53//46 65//56 66//57 54//47
-f 54//47 66//57 67//58 55//48
-f 55//48 67//58 68//59 56//49
-f 56//49 68//59 69//60 57//50
-f 57//50 69//60 70//18 58//18
-f 58//18 70//18 71//61 59//51
-f 59//51 71//61 72//62 60//52
-f 60//52 72//62 61//53 49//43
-f 61//53 73//63 74//64 62//54
-f 62//54 74//64 75//65 63//55
-f 63//55 75//65 76//7 64//7
-f 64//7 76//7 77//66 65//56
-f 65//56 77//66 78//67 66//57
-f 66//57 78//67 79//68 67//58
-f 67//58 79//68 80//69 68//59
-f 68//59 80//69 81//70 69//60
-f 69//60 81//70 82//18 70//18
-f 70//18 82//18 83//71 71//61
-f 71//61 83//71 84//72 72//62
-f 72//62 84//72 73//63 61//53
-f 73//63 85//73 86//74 74//64
-f 74//64 86//74 87//75 75//65
-f 75//65 87//75 88//7 76//7
-f 76//7 88//7 89//76 77//66
-f 77//66 89//76 90//77 78//67
-f 78//67 90//77 91//78 79//68
-f 79//68 91//78 92//79 80//69
-f 80//69 92//79 93//80 81//70
-f 81//70 93//80 94//18 82//18
-f 82//18 94//18 95//81 83//71
-f 83//71 95//81 96//82 84//72
-f 84//72 96//82 85//73 73//63
-f 85//73 97//83 98//84 86//74
-f 86//74 98//84 99//85 87//75
-f 87//75 99//85 100//7 88//7
-f 88//7 100//7 101//86 89//76
-f 89//76 101//86 102//87 90//77
-f 90//77 102//87 103//88 91//78
-f 91//78 103//88 104//89 92//79
-f 92//79 104//89 105//90 93//80
-f 93//80 105//90 106//18 94//18
-f 94//18 106//18 107//91 95//81
-f 95//81 107//91 108//92 96//82
-f 96//82 108//92 97//83 85//73
-f 97//83 109//93 110//94 98//84
-f 98//84 110//94 111//95 99//85
-f 99//85 111//95 112//7 100//7
-f 100//7 112//7 113//96 101//86
-f 101//86 113//96 114//97 102//87
-f 102//87 114//97 115//98 103//88
-f 103//88 115//98 116//99 104//89
-f 104//89 116//99 117//100 105//90
-f 105//90 117//100 118//18 106//18
-f 106//18 118//18 119//101 107//91
-f 107//91 119//101 120//102 108//92
-f 108//92 120//102 109//93 97//83
-f 109//93 121//103 122//104 110//94
-f 110//94 122//104 123//105 111//95
-f 111//95 123//105 124//7 112//7
-f 112//7 124//7 125//106 113//96
-f 113//96 125//106 126//107 114//97
-f 114//97 126//107 127//108 115//98
-f 115//98 127//108 128//109 116//99
-f 116//99 128//109 129//110 117//100
-f 117//100 129//110 130//18 118//18
-f 118//18 130//18 131//111 119//101
-f 119//101 131//111 132//112 120//102
-f 120//102 132//112 121//103 109//93
-f 121//103 133//113 134//114 122//104
-f 122//104 134//114 135//115 123//105
-f 123//105 135//115 136//7 124//7
-f 124//7 136//7 137//116 125//106
-f 125//106 137//116 138//117 126//107
-f 126//107 138//117 139//118 127//108
-f 127//108 139//118 140//119 128//109
-f 128//109 140//119 141//120 129//110
-f 129//110 141//120 142//18 130//18
-f 130//18 142//18 143//121 131//111
-f 131//111 143//121 144//122 132//112
-f 132//112 144//122 133//113 121//103
-f 133//113 145//123 146//124 134//114
-f 134//114 146//124 147//125 135//115
-f 135//115 147//125 148//7 136//7
-f 136//7 148//7 149//126 137//116
-f 137//116 149//126 150//127 138//117
-f 138//117 150//127 151//128 139//118
-f 139//118 151//128 152//129 140//119
-f 140//119 152//129 153//130 141//120
-f 141//120 153//130 154//18 142//18
-f 142//18 154//18 155//131 143//121
-f 143//121 155//131 156//132 144//122
-f 144//122 156//132 145//123 133//113
-f 145//123 157//133 158//134 146//124
-f 146//124 158//134 159//135 147//125
-f 147//125 159//135 160//7 148//7
-f 148//7 160//7 161//136 149//126
-f 149//126 161//136 162//137 150//127
-f 150//127 162//137 163//138 151//128
-f 151//128 163//138 164//139 152//129
-f 152//129 164//139 165//140 153//130
-f 153//130 165//140 166//18 154//18
-f 154//18 166//18 167//141 155//131
-f 155//131 167//141 168//142 156//132
-f 156//132 168//142 157//133 145//123
-f 157//133 169//143 170//144 158//134
-f 158//134 170//144 171//145 159//135
-f 159//135 171//145 172//7 160//7
-f 160//7 172//7 173//146 161//136
-f 161//136 173//146 174//147 162//137
-f 162//137 174//147 175//148 163//138
-f 163//138 175//148 176//149 164//139
-f 164//139 176//149 177//150 165//140
-f 165//140 177//150 178//18 166//18
-f 166//18 178//18 179//151 167//141
-f 167//141 179//151 180//152 168//142
-f 168//142 180//152 169//143 157//133
-f 169//143 181//153 182//154 170//144
-f 170//144 182//154 183//155 171//145
-f 171//145 183//155 184//7 172//7
-f 172//7 184//7 185//156 173//146
-f 173//146 185//156 186//157 174//147
-f 174//147 186//157 187//158 175//148
-f 175//148 187//158 188//159 176//149
-f 176//149 188//159 189//160 177//150
-f 177//150 189//160 190//18 178//18
-f 178//18 190//18 191//161 179//151
-f 179//151 191//161 192//162 180//152
-f 180//152 192//162 181//153 169//143
-f 181//153 193//163 194//164 182//154
-f 182//154 194//164 195//165 183//155
-f 183//155 195//165 196//7 184//7
-f 184//7 196//7 197//166 185//156
-f 185//156 197//166 198//167 186//157
-f 186//157 198//167 199//168 187//158
-f 187//158 199//168 200//169 188//159
-f 188//159 200//169 201//170 189//160
-f 189//160 201//170 202//18 190//18
-f 190//18 202//18 203//171 191//161
-f 191//161 203//171 204//172 192//162
-f 192//162 204//172 193//163 181//153
-f 193//163 205//173 206//174 194//164
-f 194//164 206//174 207//175 195//165
-f 195//165 207//175 208//7 196//7
-f 196//7 208//7 209//176 197//166
-f 197//166 209//176 210//177 198//167
-f 198//167 210//177 211//178 199//168
-f 199//168 211//178 212//179 200//169
-f 200//169 212//179 213//180 201//170
-f 201//170 213//180 214//18 202//18
-f 202//18 214//18 215//181 203//171
-f 203//171 215//181 216//182 204//172
-f 204//172 216//182 205//173 193//163
-f 205//173 217//183 218//184 206//174
-f 206//174 218//184 219//185 207//175
-f 207//175 219//185 220//7 208//7
-f 208//7 220//7 221//186 209//176
-f 209//176 221//186 222//187 210//177
-f 210//177 222//187 223//188 211//178
-f 211//178 223//188 224//189 212//179
-f 212//179 224//189 225//190 213//180
-f 213//180 225//190 226//18 214//18
-f 214//18 226//18 227//191 215//181
-f 215//181 227//191 228//192 216//182
-f 216//182 228//192 217//183 205//173
-f 217//183 229//193 230//194 218//184
-f 218//184 230//194 231//195 219//185
-f 219//185 231//195 232//7 220//7
-f 220//7 232//7 233//196 221//186
-f 221//186 233//196 234//197 222//187
-f 222//187 234//197 235//198 223//188
-f 223//188 235//198 236//199 224//189
-f 224//189 236//199 237//200 225//190
-f 225//190 237//200 238//18 226//18
-f 226//18 238//18 239//201 227//191
-f 227//191 239//201 240//202 228//192
-f 228//192 240//202 229//193 217//183
-f 229//193 241//203 242//204 230//194
-f 230//194 242//204 243//205 231//195
-f 231//195 243//205 244//7 232//7
-f 232//7 244//7 245//206 233//196
-f 233//196 245//206 246//207 234//197
-f 234//197 246//207 247//208 235//198
-f 235//198 247//208 248//209 236//199
-f 236//199 248//209 249//210 237//200
-f 237//200 249//210 250//18 238//18
-f 238//18 250//18 251//211 239//201
-f 239//201 251//211 252//212 240//202
-f 240//202 252//212 241//203 229//193
-f 241//203 253//213 254//214 242//204
-f 242//204 254//214 255//215 243//205
-f 243//205 255//215 256//7 244//7
-f 244//7 256//7 257//216 245//206
-f 245//206 257//216 258//217 246//207
-f 246//207 258//217 259//218 247//208
-f 247//208 259//218 260//219 248//209
-f 248//209 260//219 261//220 249//210
-f 249//210 261//220 262//18 250//18
-f 250//18 262//18 263//221 251//211
-f 251//211 263//221 264//222 252//212
-f 252//212 264//222 253//213 241//203
-f 253//213 265//223 266//224 254//214
-f 254//214 266//224 267//225 255//215
-f 255//215 267//225 268//7 256//7
-f 256//7 268//7 269//226 257//216
-f 257//216 269//226 270//227 258//217
-f 258//217 270//227 271//228 259//218
-f 259//218 271//228 272//229 260//219
-f 260//219 272//229 273//230 261//220
-f 261//220 273//230 274//18 262//18
-f 262//18 274//18 275//231 263//221
-f 263//221 275//231 276//232 264//222
-f 264//222 276//232 265//223 253//213
-f 265//223 277//233 278//234 266//224
-f 266//224 278//234 279//235 267//225
-f 267//225 279//235 280//7 268//7
-f 268//7 280//7 281//236 269//226
-f 269//226 281//236 282//237 270//227
-f 270//227 282//237 283//238 271//228
-f 271//228 283//238 284//239 272//229
-f 272//229 284//239 285//240 273//230
-f 273//230 285//240 286//18 274//18
-f 274//18 286//18 287//241 275//231
-f 275//231 287//241 288//242 276//232
-f 276//232 288//242 277//233 265//223
-f 277//233 289//243 290//11 278//234
-f 278//234 290//11 291//9 279//235
-f 279//235 291//9 292//7 280//7
-f 280//7 292//7 293//6 281//236
-f 281//236 293//6 294//4 282//237
-f 282//237 294//4 295//1 283//238
-f 283//238 295//1 296//22 284//239
-f 284//239 296//22 297//20 285//240
-f 285//240 297//20 298//18 286//18
-f 286//18 298//18 299//17 287//241
-f 287//241 299//17 300//15 288//242
-f 288//242 300//15 289//243 277//233
-f 289//243 301//12 302//10 290//11
-f 290//11 302//10 303//8 291//9
-f 291//9 303//8 304//7 292//7
-f 292//7 304//7 305//5 293//6
-f 293//6 305//5 306//3 294//4
-f 294//4 306//3 307//2 295//1
-f 295//1 307//2 308//21 296//22
-f 296//22 308//21 309//19 297//20
-f 297//20 309//19 310//18 298//18
-f 298//18 310//18 311//16 299//17
-f 299//17 311//16 312//14 300//15
-f 300//15 312//14 301//12 289//243
-f 301//12 313//28 314//244 302//10
-f 302//10 314//244 315//26 303//8
-f 303//8 315//26 316//7 304//7
-f 304//7 316//7 317//25 305//5
-f 305//5 317//25 318//24 306//3
-f 306//3 318//24 319//23 307//2
-f 307//2 319//23 320//32 308//21
-f 308//21 320//32 321//31 309//19
-f 309//19 321//31 322//18 310//18
-f 310//18 322//18 323//30 311//16
-f 311//16 323//30 324//29 312//14
-f 312//14 324//29 313//28 301//12
-f 313//28 325//38 326//37 314//244
-f 314//244 326//37 327//36 315//26
-f 315//26 327//36 328//7 316//7
-f 316//7 328//7 329//35 317//25
-f 317//25 329//35 330//34 318//24
-f 318//24 330//34 331//33 319//23
-f 319//23 331//33 332//42 320//32
-f 320//32 332//42 333//41 321//31
-f 321//31 333//41 334//18 322//18
-f 322//18 334//18 335//40 323//30
-f 323//30 335//40 336//39 324//29
-f 324//29 336//39 325//38 313//28
-f 325//38 337//48 338//47 326//37
-f 326//37 338//47 339//46 327//36
-f 327//36 339//46 340//7 328//7
-f 328//7 340//7 341//45 329//35
-f 329//35 341//45 342//44 330//34
-f 330//34 342//44 343//43 331//33
-f 331//33 343//43 344//52 332//42
-f 332//42 344//52 345//51 333//41
-f 333//41 345//51 346//18 334//18
-f 334//18 346//18 347//50 335//40
-f 335//40 347//50 348//49 336//39
-f 336//39 348//49 337//48 325//38
-f 337//48 349//58 350//57 338//47
-f 338//47 350//57 351//56 339//46
-f 339//46 351//56 352//7 340//7
-f 340//7 352//7 353//55 341//45
-f 341//45 353//55 354//54 342//44
-f 342//44 354//54 355//53 343//43
-f 343//43 355//53 356//62 344//52
-f 344//52 356//62 357//61 345//51
-f 345//51 357//61 358//18 346//18
-f 346//18 358//18 359//60 347//50
-f 347//50 359//60 360//59 348//49
-f 348//49 360//59 349//58 337//48
-f 349//58 361//68 362//67 350//57
-f 350//57 362//67 363//66 351//56
-f 351//56 363//66 364//7 352//7
-f 352//7 364//7 365//65 353//55
-f 353//55 365//65 366//64 354//54
-f 354//54 366//64 367//63 355//53
-f 355//53 367//63 368//72 356//62
-f 356//62 368//72 369//71 357//61
-f 357//61 369//71 370//18 358//18
-f 358//18 370//18 371//70 359//60
-f 359//60 371//70 372//69 360//59
-f 360//59 372//69 361//68 349//58
-f 361//68 373//78 374//77 362//67
-f 362//67 374//77 375//76 363//66
-f 363//66 375//76 376//7 364//7
-f 364//7 376//7 377//75 365//65
-f 365//65 377//75 378//74 366//64
-f 366//64 378//74 379//73 367//63
-f 367//63 379//73 380//82 368//72
-f 368//72 380//82 381//81 369//71
-f 369//71 381//81 382//18 370//18
-f 370//18 382//18 383//80 371//70
-f 371//70 383//80 384//79 372//69
-f 372//69 384//79 373//78 361//68
-f 373//78 385//88 386//87 374//77
-f 374//77 386//87 387//86 375//76
-f 375//76 387//86 388//7 376//7
-f 376//7 388//7 389//85 377//75
-f 377//75 389//85 390//84 378//74
-f 378//74 390//84 391//83 379//73
-f 379//73 391//83 392//92 380//82
-f 380//82 392//92 393//91 381//81
-f 381//81 393//91 394//18 382//18
-f 382//18 394//18 395//90 383//80
-f 383//80 395//90 396//89 384//79
-f 384//79 396//89 385//88 373//78
-f 385//88 397//98 398//97 386//87
-f 386//87 398//97 399//96 387//86
-f 387//86 399//96 400//7 388//7
-f 388//7 400//7 401//95 389//85
-f 389//85 401//95 402//94 390//84
-f 390//84 402//94 403//93 391//83
-f 391//83 403//93 404//102 392//92
-f 392//92 404//102 405//101 393//91
-f 393//91 405//101 406//18 394//18
-f 394//18 406//18 407//100 395//90
-f 395//90 407//100 408//99 396//89
-f 396//89 408//99 397//98 385//88
-f 397//98 409//108 410//107 398//97
-f 398//97 410//107 411//106 399//96
-f 399//96 411//106 412//7 400//7
-f 400//7 412//7 413//105 401//95
-f 401//95 413//105 414//104 402//94
-f 402//94 414//104 415//103 403//93
-f 403//93 415//103 416//112 404//102
-f 404//102 416//112 417//111 405//101
-f 405//101 417//111 418//18 406//18
-f 406//18 418//18 419//110 407//100
-f 407//100 419//110 420//245 408//99
-f 408//99 420//245 409//108 397//98
-f 409//108 421//118 422//117 410//107
-f 410//107 422//117 423//116 411//106
-f 411//106 423//116 424//7 412//7
-f 412//7 424//7 425//115 413//105
-f 413//105 425//115 426//114 414//104
-f 414//104 426//114 427//113 415//103
-f 415//103 427//113 428//122 416//112
-f 416//112 428//122 429//121 417//111
-f 417//111 429//121 430//18 418//18
-f 418//18 430//18 431//120 419//110
-f 419//110 431//120 432//119 420//245
-f 420//245 432//119 421//118 409//108
-f 421//118 433//128 434//127 422//117
-f 422//117 434//127 435//126 423//116
-f 423//116 435//126 436//7 424//7
-f 424//7 436//7 437//125 425//115
-f 425//115 437//125 438//124 426//114
-f 426//114 438//124 439//246 427//113
-f 427//113 439//246 440//132 428//122
-f 428//122 440//132 441//131 429//121
-f 429//121 441//131 442//18 430//18
-f 430//18 442//18 443//130 431//120
-f 431//120 443//130 444//129 432//119
-f 432//119 444//129 433//128 421//118
-f 433//128 445//138 446//137 434//127
-f 434//127 446//137 447//136 435//126
-f 435//126 447//136 448//7 436//7
-f 436//7 448//7 449//135 437//125
-f 437//125 449//135 450//134 438//124
-f 438//124 450//134 451//133 439//246
-f 439//246 451//133 452//142 440//132
-f 440//132 452//142 453//141 441//131
-f 441//131 453//141 454//18 442//18
-f 442//18 454//18 455//140 443//130
-f 443//130 455//140 456//139 444//129
-f 444//129 456//139 445//138 433//128
-f 445//138 457//148 458//147 446//137
-f 446//137 458//147 459//146 447//136
-f 447//136 459//146 460//7 448//7
-f 448//7 460//7 461//145 449//135
-f 449//135 461//145 462//144 450//134
-f 450//134 462//144 463//143 451//133
-f 451//133 463//143 464//152 452//142
-f 452//142 464//152 465//151 453//141
-f 453//141 465//151 466//18 454//18
-f 454//18 466//18 467//150 455//140
-f 455//140 467//150 468//149 456//139
-f 456//139 468//149 457//148 445//138
-f 457//148 469//158 470//157 458//147
-f 458//147 470//157 471//156 459//146
-f 459//146 471//156 472//7 460//7
-f 460//7 472//7 473//155 461//145
-f 461//145 473//155 474//154 462//144
-f 462//144 474//154 475//153 463//143
-f 463//143 475//153 476//162 464//152
-f 464//152 476//162 477//161 465//151
-f 465//151 477//161 478//18 466//18
-f 466//18 478//18 479//160 467//150
-f 467//150 479//160 480//159 468//149
-f 468//149 480//159 469//158 457//148
-f 469//158 481//168 482//167 470//157
-f 470//157 482//167 483//166 471//156
-f 471//156 483//166 484//7 472//7
-f 472//7 484//7 485//165 473//155
-f 473//155 485//165 486//164 474//154
-f 474//154 486//164 487//163 475//153
-f 475//153 487//163 488//172 476//162
-f 476//162 488//172 489//171 477//161
-f 477//161 489//171 490//18 478//18
-f 478//18 490//18 491//170 479//160
-f 479//160 491//170 492//169 480//159
-f 480//159 492//169 481//168 469//158
-f 481//168 493//178 494//177 482//167
-f 482//167 494//177 495//176 483//166
-f 483//166 495//176 496//7 484//7
-f 484//7 496//7 497//175 485//165
-f 485//165 497//175 498//174 486//164
-f 486//164 498//174 499//173 487//163
-f 487//163 499//173 500//182 488//172
-f 488//172 500//182 501//181 489//171
-f 489//171 501//181 502//18 490//18
-f 490//18 502//18 503//180 491//170
-f 491//170 503//180 504//179 492//169
-f 492//169 504//179 493//178 481//168
-f 493//178 505//188 506//187 494//177
-f 494//177 506//187 507//186 495//176
-f 495//176 507//186 508//7 496//7
-f 496//7 508//7 509//185 497//175
-f 497//175 509//185 510//184 498//174
-f 498//174 510//184 511//183 499//173
-f 499//173 511//183 512//192 500//182
-f 500//182 512//192 513//191 501//181
-f 501//181 513//191 514//18 502//18
-f 502//18 514//18 515//190 503//180
-f 503//180 515//190 516//189 504//179
-f 504//179 516//189 505//188 493//178
-f 505//188 517//198 518//197 506//187
-f 506//187 518//197 519//196 507//186
-f 507//186 519//196 520//7 508//7
-f 508//7 520//7 521//195 509//185
-f 509//185 521//195 522//194 510//184
-f 510//184 522//194 523//193 511//183
-f 511//183 523//193 524//202 512//192
-f 512//192 524//202 525//201 513//191
-f 513//191 525//201 526//18 514//18
-f 514//18 526//18 527//200 515//190
-f 515//190 527//200 528//199 516//189
-f 516//189 528//199 517//198 505//188
-f 517//198 529//208 530//207 518//197
-f 518//197 530//207 531//206 519//196
-f 519//196 531//206 532//7 520//7
-f 520//7 532//7 533//205 521//195
-f 521//195 533//205 534//204 522//194
-f 522//194 534//204 535//203 523//193
-f 523//193 535//203 536//212 524//202
-f 524//202 536//212 537//211 525//201
-f 525//201 537//211 538//18 526//18
-f 526//18 538//18 539//210 527//200
-f 527//200 539//210 540//209 528//199
-f 528//199 540//209 529//208 517//198
-f 529//208 541//218 542//217 530//207
-f 530//207 542//217 543//216 531//206
-f 531//206 543//216 544//7 532//7
-f 532//7 544//7 545//215 533//205
-f 533//205 545//215 546//214 534//204
-f 534//204 546//214 547//213 535//203
-f 535//203 547//213 548//222 536//212
-f 536//212 548//222 549//221 537//211
-f 537//211 549//221 550//18 538//18
-f 538//18 550//18 551//220 539//210
-f 539//210 551//220 552//219 540//209
-f 540//209 552//219 541//218 529//208
-f 541//218 553//228 554//227 542//217
-f 542//217 554//227 555//226 543//216
-f 543//216 555//226 556//7 544//7
-f 544//7 556//7 557//225 545//215
-f 545//215 557//225 558//247 546//214
-f 546//214 558//247 559//223 547//213
-f 547//213 559//223 560//232 548//222
-f 548//222 560//232 561//231 549//221
-f 549//221 561//231 562//18 550//18
-f 550//18 562//18 563//230 551//220
-f 551//220 563//230 564//229 552//219
-f 552//219 564//229 553//228 541//218
-f 553//228 565//238 566//237 554//227
-f 554//227 566//237 567//236 555//226
-f 555//226 567//236 568//7 556//7
-f 556//7 568//7 569//235 557//225
-f 557//225 569//235 570//234 558//247
-f 558//247 570//234 571//233 559//223
-f 559//223 571//233 572//242 560//232
-f 560//232 572//242 573//241 561//231
-f 561//231 573//241 574//18 562//18
-f 562//18 574//18 575//240 563//230
-f 563//230 575//240 576//239 564//229
-f 564//229 576//239 565//238 553//228
-f 565//238 1//1 2//4 566//237
-f 566//237 2//4 3//6 567//236
-f 567//236 3//6 4//7 568//7
-f 568//7 4//7 5//9 569//235
-f 569//235 5//9 6//11 570//234
-f 570//234 6//11 7//13 571//233
-f 571//233 7//13 8//15 572//242
-f 572//242 8//15 9//17 573//241
-f 573//241 9//17 10//18 574//18
-f 574//18 10//18 11//20 575//240
-f 575//240 11//20 12//22 576//239
-f 576//239 12//22 1//1 565//238

二進制
examples/obj/torus/Torus_bin.bin


+ 0 - 25
examples/obj/torus/Torus_bin.js

@@ -1,25 +0,0 @@
-// Converted from: ../../examples/obj/torus/Torus.obj
-//  vertices: 576
-//  faces: 576
-//  materials: 1
-//
-//  Generated with OBJ -> Three.js converter
-//  http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_three.py
-
-
-var model = {
-
-    "version" : 1,
-
-    "materials": [	{
-	"DbgColor" : 15658734,
-	"DbgIndex" : 0,
-	"DbgName" : "(null)"
-	}],
-
-    "buffers": "Torus_bin.bin"
-
-};
-    
-postMessage( model );
-close();

文件差異過大導致無法顯示
+ 0 - 25
examples/obj/torus/Torus_slim.js


+ 4 - 5
examples/webgl_collada.html

@@ -21,7 +21,7 @@
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
-		<script type="text/javascript" src="../src/extras/collada/dae.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/ColladaLoader.js"></script>
 
 
 		<script type="text/javascript">
 		<script type="text/javascript">
 
 
@@ -33,9 +33,8 @@
 			var particleLight, pointLight;
 			var particleLight, pointLight;
 			var dae, skin;
 			var dae, skin;
 
 
-			DAE.load( './models/monster.dae', colladaReady );
-
-			function colladaReady( collada ) {
+			var loader = new ColladaLoader();
+			loader.load( './models/monster.dae', function colladaReady( collada ) {
 
 
 				dae = collada.scene;
 				dae = collada.scene;
 				skin = collada.skins[ 0 ];
 				skin = collada.skins[ 0 ];
@@ -47,7 +46,7 @@
 				init();
 				init();
 				animate();
 				animate();
 
 
-			}
+			} );
 
 
 			function init() {
 			function init() {
 
 

+ 29 - 195
examples/webgl_flycamera_earth.html

@@ -32,6 +32,11 @@
 	</style>
 	</style>
 
 
 	<script type="text/javascript" src="../build/Three.js"></script>
 	<script type="text/javascript" src="../build/Three.js"></script>
+
+	<script type="text/javascript" src="js/postprocessing/EffectComposer.js"></script>
+	<script type="text/javascript" src="js/postprocessing/RenderPass.js"></script>
+	<script type="text/javascript" src="js/postprocessing/FilmPass.js"></script>
+
 	<script type="text/javascript" src="js/Detector.js"></script>
 	<script type="text/javascript" src="js/Detector.js"></script>
 	<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 	<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 	<script type="text/javascript" src="js/Stats.js"></script>
 	<script type="text/javascript" src="js/Stats.js"></script>
@@ -59,19 +64,13 @@
 	var SCREEN_HEIGHT = window.innerHeight - MARGIN * 2;
 	var SCREEN_HEIGHT = window.innerHeight - MARGIN * 2;
 	var SCREEN_WIDTH  = window.innerWidth;
 	var SCREEN_WIDTH  = window.innerWidth;
 
 
-	var ENABLE_LENSFLARES = false;
-
-	var lensFlare, lensFlareRotate;
-
 	var container, stats;
 	var container, stats;
 	var camera, scene, sceneCube, renderer;
 	var camera, scene, sceneCube, renderer;
 	var geometry, meshPlanet, meshClouds, meshMoon;
 	var geometry, meshPlanet, meshClouds, meshMoon;
 	var dirLight, pointLight, ambientLight;
 	var dirLight, pointLight, ambientLight;
 	var lastUpdate = new Date().getTime();
 	var lastUpdate = new Date().getTime();
 
 
-	var t, d, dPlanet, dMoon, dMoonVec = new THREE.Vector3();
-
-	var postprocessing = { enabled : true, bloom: false };
+	var delta, d, dPlanet, dMoon, dMoonVec = new THREE.Vector3();
 
 
 	init();
 	init();
 	animate();
 	animate();
@@ -105,10 +104,6 @@
         dirLight.position.normalize();
         dirLight.position.normalize();
         scene.addLight( dirLight );
         scene.addLight( dirLight );
 
 
-        pointLight = new THREE.PointLight( 0x000000 );
-        pointLight.position.set( -5000, 0, 5000 );
-        //scene.addLight( pointLight );
-
 		ambientLight = new THREE.AmbientLight( 0x000000 );
 		ambientLight = new THREE.AmbientLight( 0x000000 );
 		scene.addLight( ambientLight );
 		scene.addLight( ambientLight );
 
 
@@ -153,7 +148,7 @@
 
 
 		// clouds
 		// clouds
 
 
-        var materialClouds = new THREE.MeshLambertMaterial( { color: 0xffffff, map: cloudsTexture, transparent:true } );
+        var materialClouds = new THREE.MeshLambertMaterial( { color: 0xffffff, map: cloudsTexture, transparent: true } );
 
 
 		meshClouds = new THREE.Mesh( geometry, materialClouds );
 		meshClouds = new THREE.Mesh( geometry, materialClouds );
 		meshClouds.scale.set( cloudsScale, cloudsScale, cloudsScale );
 		meshClouds.scale.set( cloudsScale, cloudsScale, cloudsScale );
@@ -174,7 +169,7 @@
 		var i, r = radius,
 		var i, r = radius,
 			starsGeometry = [ new THREE.Geometry(), new THREE.Geometry() ];
 			starsGeometry = [ new THREE.Geometry(), new THREE.Geometry() ];
 
 
-		for ( i = 0; i < 250; ++i ) {
+		for ( i = 0; i < 250; i ++ ) {
 
 
 			vector1 = new THREE.Vector3( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 );
 			vector1 = new THREE.Vector3( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 );
 			vector1.multiplyScalar( r );
 			vector1.multiplyScalar( r );
@@ -201,9 +196,10 @@
 							   new THREE.ParticleBasicMaterial( { color: 0x1a1a1a, size: 1, sizeAttenuation: false } )
 							   new THREE.ParticleBasicMaterial( { color: 0x1a1a1a, size: 1, sizeAttenuation: false } )
 							];
 							];
 
 
-		for ( i = 10; i < 30; i ++) {
+		for ( i = 10; i < 30; i ++ ) {
 
 
 			stars = new THREE.ParticleSystem( starsGeometry[ i % 2 ], starsMaterials[ i % 6 ] );
 			stars = new THREE.ParticleSystem( starsGeometry[ i % 2 ], starsMaterials[ i % 6 ] );
+
 			stars.rotation.x = Math.random() * 6;
 			stars.rotation.x = Math.random() * 6;
 			stars.rotation.y = Math.random() * 6;
 			stars.rotation.y = Math.random() * 6;
 			stars.rotation.z = Math.random() * 6;
 			stars.rotation.z = Math.random() * 6;
@@ -218,38 +214,10 @@
 
 
 		}
 		}
 
 
-		if ( ENABLE_LENSFLARES ) {
-
-			lensFlare = new THREE.LensFlare( THREE.ImageUtils.loadTexture( "textures/lensflare/lensflare0.png" ), 700, 0.0, THREE.AdditiveBlending );
-
-			lensFlare.add( THREE.ImageUtils.loadTexture( "textures/lensflare/lensflare2.png" ), 512, 0.0, THREE.AdditiveBlending );
-			lensFlare.add( lensFlare.lensFlares[ 1 ].texture, 512, 0.0, THREE.AdditiveBlending );
-			lensFlare.add( lensFlare.lensFlares[ 1 ].texture, 512, 0.0, THREE.AdditiveBlending );
-
-			lensFlare.add( THREE.ImageUtils.loadTexture( "textures/lensflare/lensflare3.png" ), 60, 0.6, THREE.AdditiveBlending );
-			lensFlare.add( lensFlare.lensFlares[ 4 ].texture, 70, 0.7, THREE.AdditiveBlending );
-			lensFlare.add( lensFlare.lensFlares[ 4 ].texture, 120, 0.9, THREE.AdditiveBlending );
-			lensFlare.add( lensFlare.lensFlares[ 4 ].texture, 70, 1.0, THREE.AdditiveBlending );
-
-			lensFlare.customUpdateCallback = lensFlareUpdateCallback;
-			lensFlare.position.set( 0, 0, -99000 );
-
-
-			lensFlareRotate = new THREE.Object3D();
-			lensFlareRotate.addChild( lensFlare );
-
-			scene.addChild( lensFlareRotate );
-
-			lensFlareRotate.rotation.x = Math.PI;
-			lensFlareRotate.rotation.y = Math.PI / 2;
-
-		}
-
         renderer = new THREE.WebGLRenderer( { clearAlpha: 1, clearColor: 0x000000 } );
         renderer = new THREE.WebGLRenderer( { clearAlpha: 1, clearColor: 0x000000 } );
         renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
         renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
         renderer.sortObjects = false;
         renderer.sortObjects = false;
 
 
-		initPostprocessing();
 		renderer.autoClear = false;
 		renderer.autoClear = false;
 
 
         container.appendChild( renderer.domElement );
         container.appendChild( renderer.domElement );
@@ -258,10 +226,22 @@
         stats.domElement.style.position = 'absolute';
         stats.domElement.style.position = 'absolute';
         stats.domElement.style.top = '0px';
         stats.domElement.style.top = '0px';
         stats.domElement.style.zIndex = 100;
         stats.domElement.style.zIndex = 100;
-        //container.appendChild( stats.domElement );
+        container.appendChild( stats.domElement );
 
 
 		window.addEventListener( 'resize', onWindowResize, false );
 		window.addEventListener( 'resize', onWindowResize, false );
 
 
+		// postprocessing
+
+		var renderModel = new THREE.RenderPass( scene, camera );
+		var effectFilm = new THREE.FilmPass( 0.35, 0.75, 2048, false );
+
+		effectFilm.renderToScreen = true;
+
+		composer = new THREE.EffectComposer( renderer );
+
+		composer.addPass( renderModel );
+		composer.addPass( effectFilm );
+
 	};
 	};
 
 
 	function onWindowResize( event ) {
 	function onWindowResize( event ) {
@@ -274,107 +254,16 @@
 		camera.aspect = SCREEN_WIDTH / SCREEN_HEIGHT;
 		camera.aspect = SCREEN_WIDTH / SCREEN_HEIGHT;
 		camera.updateProjectionMatrix();
 		camera.updateProjectionMatrix();
 
 
-		initPostprocessing();
+		composer.reset();
 
 
 	}
 	}
 
 
-	function initPostprocessing() {
-
-		postprocessing.scene = new THREE.Scene();
-
-		postprocessing.camera = new THREE.Camera();
-		postprocessing.camera.projectionMatrix = THREE.Matrix4.makeOrtho( SCREEN_WIDTH / - 2, SCREEN_WIDTH / 2,  SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, -10000, 10000 );
-		postprocessing.camera.position.z = 100;
-
-		var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBAFormat };
-		postprocessing.rtTexture1 = new THREE.WebGLRenderTarget( SCREEN_WIDTH, SCREEN_HEIGHT, pars );
-		postprocessing.rtTexture2 = new THREE.WebGLRenderTarget( 512, 512, pars );
-		postprocessing.rtTexture3 = new THREE.WebGLRenderTarget( 512, 512, pars );
-
-		var screen_shader = THREE.ShaderUtils.lib["screen"];
-		var screen_uniforms = THREE.UniformsUtils.clone( screen_shader.uniforms );
-
-		screen_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-		screen_uniforms["opacity"].value = 1.0;
-
-		postprocessing.materialScreen = new THREE.MeshShaderMaterial( {
-
-			uniforms: screen_uniforms,
-			vertexShader: screen_shader.vertexShader,
-			fragmentShader: screen_shader.fragmentShader,
-			blending: THREE.AdditiveBlending,
-			transparent: true
-
-		} );
-
-		var convolution_shader = THREE.ShaderUtils.lib["convolution"];
-		var convolution_uniforms = THREE.UniformsUtils.clone( convolution_shader.uniforms );
-
-		postprocessing.blurx = new THREE.Vector2( 0.001953125, 0.0 ),
-		postprocessing.blury = new THREE.Vector2( 0.0, 0.001953125 );
-
-		convolution_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-		convolution_uniforms["uImageIncrement"].value = postprocessing.blurx;
-		convolution_uniforms["cKernel"].value = THREE.ShaderUtils.buildKernel( 4.0 );
-
-		postprocessing.materialConvolution = new THREE.MeshShaderMaterial( {
-
-			uniforms: convolution_uniforms,
-			vertexShader:   "#define KERNEL_SIZE 25.0\n" + convolution_shader.vertexShader,
-			fragmentShader: "#define KERNEL_SIZE 25\n"   + convolution_shader.fragmentShader
-
-		} );
-
-		var film_shader = THREE.ShaderUtils.lib["film"];
-		var film_uniforms = THREE.UniformsUtils.clone( film_shader.uniforms );
-
-		film_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-
-		postprocessing.materialFilm = new THREE.MeshShaderMaterial( { uniforms: film_uniforms, vertexShader: film_shader.vertexShader, fragmentShader: film_shader.fragmentShader } );
-		postprocessing.materialFilm.uniforms.grayscale.value = 0;
-		postprocessing.materialFilm.uniforms.nIntensity.value = 0.35;
-		postprocessing.materialFilm.uniforms.sIntensity.value = 0.75;
-		postprocessing.materialFilm.uniforms.sCount.value = 2048;
-
-		postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( SCREEN_WIDTH, SCREEN_HEIGHT ), postprocessing.materialConvolution );
-		postprocessing.quad.position.z = - 500;
-		postprocessing.scene.addObject( postprocessing.quad );
-
-	};
-
 	function cap_bottom( val, bottom ) {
 	function cap_bottom( val, bottom ) {
 
 
 		return val < bottom ? bottom : val;
 		return val < bottom ? bottom : val;
 
 
 	};
 	};
 
 
-	function lensFlareUpdateCallback( object ) {
-
-		var f, fl = object.lensFlares.length;
-		var flare;
-		var vecX = -object.positionScreen.x * 2;
-		var vecY = -object.positionScreen.y * 2;
-
-
-		for( f = 0; f < fl; f++ ) {
-
-			   flare = object.lensFlares[ f ];
-
-			   flare.x = object.positionScreen.x + vecX * flare.distance;
-			   flare.y = object.positionScreen.y + vecY * flare.distance;
-
-			   flare.rotation = 0;
-
-			   flare.opacity = cap_bottom( 1 - 0.01 * d / radius, 0 );
-
-		}
-
-		// hard coded stuff
-
-		object.lensFlares[ 2 ].y += 0.025;
-		object.lensFlares[ 3 ].rotation = object.positionScreen.x * 0.5 + 45 * Math.PI / 180;
-
-	};
 
 
 	function animate() {
 	function animate() {
 
 
@@ -396,10 +285,10 @@
 
 
 		// rotate the planet and clouds
 		// rotate the planet and clouds
 
 
-		t = this.getFrametime();
+		delta = this.getFrametime();
 
 
-        meshPlanet.rotation.y += rotationSpeed * t;
-		meshClouds.rotation.y += 1.25 * rotationSpeed * t;
+        meshPlanet.rotation.y += rotationSpeed * delta;
+		meshClouds.rotation.y += 1.25 * rotationSpeed * delta;
 
 
 		// slow down as we approach the surface
 		// slow down as we approach the surface
 
 
@@ -420,63 +309,8 @@
 
 
         camera.movementSpeed = 0.33 * d;
         camera.movementSpeed = 0.33 * d;
 
 
-		if ( ENABLE_LENSFLARES ) {
-
-			lensFlareRotate.position.set( camera.position.x, camera.position.y, camera.position.z );
-
-		}
-
-		if ( postprocessing.enabled ) {
-
-			renderer.clear();
-
-			// Render scene into texture
-
-			renderer.render( scene, camera, postprocessing.rtTexture1, true );
-
-			if ( postprocessing.bloom ) {
-
-				// Render quad with blured scene into texture (convolution pass 1)
-
-				postprocessing.quad.materials = [ postprocessing.materialConvolution ];
-
-				postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
-				postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blurx;
-
-				renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2, true );
-
-				// Render quad with blured scene into texture (convolution pass 2)
-
-				postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture2;
-				postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blury;
-
-				renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3, true );
-
-				// Render original scene with superimposed blur to texture
-
-				postprocessing.quad.materials = [ postprocessing.materialScreen ];
-
-				postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture3;
-				postprocessing.materialScreen.uniforms.opacity.value = 0.75;
-
-				renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1, false );
-
-			}
-
-			// Render to screen
-
-			postprocessing.materialFilm.uniforms.time.value += 0.01;
-			postprocessing.quad.materials = [ postprocessing.materialFilm ];
-
-			postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
-			renderer.render( postprocessing.scene, postprocessing.camera );
-
-		} else {
-
-			renderer.clear();
-			renderer.render( scene, camera );
-
-		}
+		renderer.clear();
+		composer.render( delta );
 
 
 	};
 	};
 
 

+ 2 - 2
examples/webgl_geometries.html

@@ -51,13 +51,13 @@
 
 
 				scene.addLight( new THREE.AmbientLight( 0x404040 ) );
 				scene.addLight( new THREE.AmbientLight( 0x404040 ) );
 
 
-				light = new THREE.DirectionalLight( 0xffffff, 2.0 );
+				light = new THREE.DirectionalLight( 0xffffff, 1 );
 				light.position.z = 1;
 				light.position.z = 1;
 				scene.addLight( light );
 				scene.addLight( light );
 
 
 				material = [
 				material = [
 					new THREE.MeshLambertMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/UV.jpg' ) } ),
 					new THREE.MeshLambertMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/UV.jpg' ) } ),
-					new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true, opacity: 0.1 } )
+					new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true, transparent: true, opacity: 0.1 } )
 				];
 				];
 
 
 				objects[ 0 ] = object = new THREE.Mesh( new THREE.CubeGeometry( 100, 100, 100, 4, 4, 4 ), material );
 				objects[ 0 ] = object = new THREE.Mesh( new THREE.CubeGeometry( 100, 100, 100, 4, 4, 4 ), material );

+ 1 - 2
examples/webgl_geometry_text.html

@@ -565,8 +565,7 @@
 
 
 				postprocessing.scene = new THREE.Scene();
 				postprocessing.scene = new THREE.Scene();
 
 
-				postprocessing.camera = new THREE.Camera();
-				postprocessing.camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
+				postprocessing.camera = new THREE.OrthoCamera( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
 				postprocessing.camera.position.z = 100;
 				postprocessing.camera.position.z = 100;
 
 
 				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
 				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };

+ 1 - 1
examples/webgl_interactive_cubes.html

@@ -117,7 +117,7 @@
 
 
 			}
 			}
 
 
-			var radius = 600;
+			var radius = 100;
 			var theta = 0;
 			var theta = 0;
 
 
 			function render() {
 			function render() {

+ 34 - 112
examples/webgl_lines_colors.html

@@ -45,6 +45,11 @@
 
 
 		<script type="text/javascript" src="../build/Three.js"></script>
 		<script type="text/javascript" src="../build/Three.js"></script>
 
 
+		<script type="text/javascript" src="js/postprocessing/EffectComposer.js"></script>
+		<script type="text/javascript" src="js/postprocessing/RenderPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/ScreenPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/BloomPass.js"></script>
+
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
@@ -58,10 +63,8 @@
 			windowHalfX = window.innerWidth / 2,
 			windowHalfX = window.innerWidth / 2,
 			windowHalfY = window.innerHeight / 2,
 			windowHalfY = window.innerHeight / 2,
 
 
-			camera, scene, renderer, material;
+			camera, scene, renderer, material, composer;
 
 
-			var postprocessing = { enabled: true };
-			
 			init();
 			init();
 			animate();
 			animate();
 
 
@@ -69,8 +72,8 @@
 
 
 				var i, container;
 				var i, container;
 
 
-				container = document.createElement('div');
-				document.body.appendChild(container);
+				container = document.createElement( 'div' );
+				document.body.appendChild( container );
 
 
 				camera = new THREE.Camera( 33, window.innerWidth / window.innerHeight, 1, 10000 );
 				camera = new THREE.Camera( 33, window.innerWidth / window.innerHeight, 1, 10000 );
 				camera.position.z = 700;
 				camera.position.z = 700;
@@ -79,6 +82,7 @@
 
 
 				renderer = new THREE.WebGLRenderer( { clearColor: 0x000000, clearAlpha: 1, antialias: false } );
 				renderer = new THREE.WebGLRenderer( { clearColor: 0x000000, clearAlpha: 1, antialias: false } );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 				renderer.setSize( window.innerWidth, window.innerHeight );
+				renderer.autoClear = false;
 
 
 				container.appendChild( renderer.domElement );
 				container.appendChild( renderer.domElement );
 
 
@@ -132,19 +136,30 @@
 
 
 				}
 				}
 
 
-				
+				//
+
 				stats = new Stats();
 				stats = new Stats();
 				stats.domElement.style.position = 'absolute';
 				stats.domElement.style.position = 'absolute';
 				stats.domElement.style.top = '0px';
 				stats.domElement.style.top = '0px';
-				//container.appendChild(stats.domElement);
+				//container.appendChild( stats.domElement );
 
 
+				//
 
 
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
 				document.addEventListener( 'touchstart', onDocumentTouchStart, false );
 				document.addEventListener( 'touchstart', onDocumentTouchStart, false );
 				document.addEventListener( 'touchmove', onDocumentTouchMove, false );
 				document.addEventListener( 'touchmove', onDocumentTouchMove, false );
 
 
-				initPostprocessing();
-				renderer.autoClear = false;
+				//
+
+				var renderModel = new THREE.RenderPass( scene, camera );
+				var effectBloom = new THREE.BloomPass( 1.3 );
+				var effectScreen = new THREE.ScreenPass();
+
+				composer = new THREE.EffectComposer( renderer );
+
+				composer.addPass( renderModel );
+				composer.addPass( effectBloom );
+				composer.addPass( effectScreen );
 
 
 			}
 			}
 
 
@@ -153,7 +168,7 @@
 
 
 			function hilbert3D( center, side, iterations, v0, v1, v2, v3, v4, v5, v6, v7 ) {
 			function hilbert3D( center, side, iterations, v0, v1, v2, v3, v4, v5, v6, v7 ) {
 
 
-				var half = side/2,
+				var half = side / 2,
 
 
 					vec_s = [
 					vec_s = [
 
 
@@ -192,63 +207,11 @@
 
 
 			//
 			//
 
 
-			function initPostprocessing() {
-
-				postprocessing.scene = new THREE.Scene();
-
-				postprocessing.camera = new THREE.Camera();
-				postprocessing.camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
-				postprocessing.camera.position.z = 100;
-
-				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
-				postprocessing.rtTexture1 = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, pars );
-				postprocessing.rtTexture2 = new THREE.WebGLRenderTarget( 512, 512, pars );
-				postprocessing.rtTexture3 = new THREE.WebGLRenderTarget( 512, 512, pars );
-
-				var screen_shader = THREE.ShaderUtils.lib["screen"];
-				var screen_uniforms = THREE.UniformsUtils.clone( screen_shader.uniforms );
-
-				screen_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-				screen_uniforms["opacity"].value = 1.0;
-
-				postprocessing.materialScreen = new THREE.MeshShaderMaterial( {
-
-					uniforms: screen_uniforms,
-					vertexShader: screen_shader.vertexShader,
-					fragmentShader: screen_shader.fragmentShader,
-					blending: THREE.AdditiveBlending,
-					transparent: true
-
-				} );
-
-				var convolution_shader = THREE.ShaderUtils.lib["convolution"];
-				var convolution_uniforms = THREE.UniformsUtils.clone( convolution_shader.uniforms );
-
-				postprocessing.blurx = new THREE.Vector2( 0.001953125, 0.0 ),
-				postprocessing.blury = new THREE.Vector2( 0.0, 0.001953125 );
-
-				convolution_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-				convolution_uniforms["uImageIncrement"].value = postprocessing.blurx;
-				convolution_uniforms["cKernel"].value = THREE.ShaderUtils.buildKernel( 4.0 );
-
-				postprocessing.materialConvolution = new THREE.MeshShaderMaterial( {
-
-					uniforms: convolution_uniforms,
-					vertexShader:   "#define KERNEL_SIZE 25.0\n" + convolution_shader.vertexShader,
-					fragmentShader: "#define KERNEL_SIZE 25\n"   + convolution_shader.fragmentShader
-
-				} );
-
-				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
-				postprocessing.quad.position.z = - 500;
-				postprocessing.scene.addObject( postprocessing.quad );
-
-			}
-
-			function onDocumentMouseMove(event) {
+			function onDocumentMouseMove( event ) {
 
 
 				mouseX = event.clientX - windowHalfX;
 				mouseX = event.clientX - windowHalfX;
 				mouseY = event.clientY - windowHalfY;
 				mouseY = event.clientY - windowHalfY;
+
 			}
 			}
 
 
 			function onDocumentTouchStart( event ) {
 			function onDocumentTouchStart( event ) {
@@ -259,7 +222,9 @@
 
 
 					mouseX = event.touches[ 0 ].pageX - windowHalfX;
 					mouseX = event.touches[ 0 ].pageX - windowHalfX;
 					mouseY = event.touches[ 0 ].pageY - windowHalfY;
 					mouseY = event.touches[ 0 ].pageY - windowHalfY;
+
 				}
 				}
+
 			}
 			}
 
 
 			function onDocumentTouchMove( event ) {
 			function onDocumentTouchMove( event ) {
@@ -271,6 +236,7 @@
 					mouseX = event.touches[ 0 ].pageX - windowHalfX;
 					mouseX = event.touches[ 0 ].pageX - windowHalfX;
 					mouseY = event.touches[ 0 ].pageY - windowHalfY;
 					mouseY = event.touches[ 0 ].pageY - windowHalfY;
 				}
 				}
+
 			}
 			}
 
 
 			//
 			//
@@ -278,7 +244,6 @@
 			function animate() {
 			function animate() {
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
-
 				render();
 				render();
 
 
 			}
 			}
@@ -290,60 +255,17 @@
 
 
 				var time = new Date().getTime() * 0.0005;
 				var time = new Date().getTime() * 0.0005;
 
 
-				for( var i = 0; i<scene.objects.length; i++ ) {
+				for( var i = 0; i < scene.objects.length; i ++ ) {
 
 
-					scene.objects[i].rotation.y = time * ( i % 2 ? 1 : -1);
+					scene.objects[ i ].rotation.y = time * ( i % 2 ? 1 : -1 );
 
 
 				}
 				}
 
 
-				if ( postprocessing.enabled ) {
-
-					renderer.clear();
-
-					// Render scene into texture
-
-					renderer.render( scene, camera, postprocessing.rtTexture1, true );
-
-					// Render quad with blured scene into texture (convolution pass 1)
-
-					postprocessing.quad.materials = [ postprocessing.materialConvolution ];
-
-					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
-					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blurx;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2, true );
-
-					// Render quad with blured scene into texture (convolution pass 2)
-
-					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture2;
-					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blury;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3, true );
-
-					// Render original scene with superimposed blur to texture
-
-					postprocessing.quad.materials = [ postprocessing.materialScreen ];
-
-					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture3;
-					postprocessing.materialScreen.uniforms.opacity.value = 1.3;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1, false );
-
-					// Render to screen
-
-					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
-					renderer.render( postprocessing.scene, postprocessing.camera );
-
-				} else {
-
-					renderer.clear();
-					renderer.render( scene, camera );
-
-				}
+				renderer.clear();
+				composer.render();
 
 
 			}
 			}
 
 
-
 		</script>
 		</script>
 	</body>
 	</body>
 </html>
 </html>

+ 14 - 29
examples/webgl_materials_normalmap.html

@@ -33,26 +33,19 @@
 
 
 			#vt { display:none }
 			#vt { display:none }
 			#vt, #vt a { color:orange; }
 			#vt, #vt a { color:orange; }
-			.code { }
-
-			#log { position:absolute; top:50px; text-align:left; display:block; z-index:100 }
 		</style>
 		</style>
 	</head>
 	</head>
 
 
 	<body>
 	<body>
-		<pre id="log"></pre>
 
 
 		<div id="info">
 		<div id="info">
 			<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - webgl (<span id="description">normal + ao + displacement</span>) map demo.
 			<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - webgl (<span id="description">normal + ao + displacement</span>) map demo.
 			ninja head from <a href="http://developer.amd.com/archive/gpu/MeshMapper/pages/default.aspx" target="_blank">AMD GPU MeshMapper</a>
 			ninja head from <a href="http://developer.amd.com/archive/gpu/MeshMapper/pages/default.aspx" target="_blank">AMD GPU MeshMapper</a>
 
 
-			<div id="vt">displacement mapping needs vertex textures (GPU with Shader Model 3.0)<br/>
-			on Windows use <span class="code">Chrome --use-gl=desktop</span> <br/>
-			or Firefox 4 (about:config => webgl.mochitest_native_gl=true)<br/>
-			please star this <a href="http://code.google.com/p/chromium/issues/detail?id=52497">Chrome issue</a> to get ANGLE support
-			</div>
+			<div id="vt">displacement mapping needs vertex textures (GPU with Shader Model 3.0)</div>
 		</div>
 		</div>
 
 
+
 		<script type="text/javascript" src="../build/Three.js"></script>
 		<script type="text/javascript" src="../build/Three.js"></script>
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
@@ -66,7 +59,7 @@
 
 
 			var container, stats, loader;
 			var container, stats, loader;
 
 
-			var camera, scene, webglRenderer;
+			var camera, scene, renderer;
 
 
 			var mesh, zmesh, lightMesh, geometry;
 			var mesh, zmesh, lightMesh, geometry;
 			var mesh1, mesh2;
 			var mesh1, mesh2;
@@ -91,8 +84,7 @@
 				container = document.createElement( 'div' );
 				container = document.createElement( 'div' );
 				document.body.appendChild( container );
 				document.body.appendChild( container );
 
 
-				camera = new THREE.Camera( 60, window.innerWidth / window.innerHeight, 1, 100000 );
-				camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
+				camera = new THREE.OrthoCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
 				camera.position.z = 6200;
 				camera.position.z = 6200;
 
 
 				scene = new THREE.Scene();
 				scene = new THREE.Scene();
@@ -116,7 +108,7 @@
 				// light representation
 				// light representation
 
 
 				var sphere = new THREE.SphereGeometry( 100, 16, 8 );
 				var sphere = new THREE.SphereGeometry( 100, 16, 8 );
-				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color:0xffaa00 } ) );
+				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xffaa00 } ) );
 				lightMesh.position = pointLight.position;
 				lightMesh.position = pointLight.position;
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;
 				scene.addObject(lightMesh);
 				scene.addObject(lightMesh);
@@ -140,7 +132,7 @@
 				uniforms[ "tDisplacement" ].texture = THREE.ImageUtils.loadTexture( "textures/normal/ninja/displacement.jpg" );
 				uniforms[ "tDisplacement" ].texture = THREE.ImageUtils.loadTexture( "textures/normal/ninja/displacement.jpg" );
 				uniforms[ "uDisplacementBias" ].value = - 0.428408 * scale;
 				uniforms[ "uDisplacementBias" ].value = - 0.428408 * scale;
 				uniforms[ "uDisplacementScale" ].value = 2.436143 * scale;
 				uniforms[ "uDisplacementScale" ].value = 2.436143 * scale;
-				
+
 				uniforms[ "uDiffuseColor" ].value.setHex( diffuse );
 				uniforms[ "uDiffuseColor" ].value.setHex( diffuse );
 				uniforms[ "uSpecularColor" ].value.setHex( specular );
 				uniforms[ "uSpecularColor" ].value.setHex( specular );
 				uniforms[ "uAmbientColor" ].value.setHex( ambient );
 				uniforms[ "uAmbientColor" ].value.setHex( ambient );
@@ -157,13 +149,13 @@
 
 
 				loader.load( { model: "obj/ninja/NinjaLo_bin.js", callback: function( geometry ) { createScene( geometry, scale, material1, material2 ) } } );
 				loader.load( { model: "obj/ninja/NinjaLo_bin.js", callback: function( geometry ) { createScene( geometry, scale, material1, material2 ) } } );
 
 
-				webglRenderer = new THREE.WebGLRenderer();
-				webglRenderer.setSize( window.innerWidth, window.innerHeight );
-				container.appendChild( webglRenderer.domElement );
+				renderer = new THREE.WebGLRenderer();
+				renderer.setSize( window.innerWidth, window.innerHeight );
+				container.appendChild( renderer.domElement );
 
 
-				var description = "normal + ao" + ( webglRenderer.supportsVertexTextures() ? " + displacement" : " + <strike>displacement</strike>" );
+				var description = "normal + ao" + ( renderer.supportsVertexTextures() ? " + displacement" : " + <strike>displacement</strike>" );
 				document.getElementById( "description" ).innerHTML = description;
 				document.getElementById( "description" ).innerHTML = description;
-				document.getElementById( "vt" ).style.display = webglRenderer.supportsVertexTextures() ? "none" : "block";
+				document.getElementById( "vt" ).style.display = renderer.supportsVertexTextures() ? "none" : "block";
 
 
 				if ( statsEnabled ) {
 				if ( statsEnabled ) {
 
 
@@ -183,12 +175,12 @@
 
 
 				mesh1 = new THREE.Mesh( geometry, material1 );
 				mesh1 = new THREE.Mesh( geometry, material1 );
 				mesh1.position.x = - scale * 12;
 				mesh1.position.x = - scale * 12;
-				mesh1.scale.x = mesh1.scale.y = mesh1.scale.z = scale;
+				mesh1.scale.set( scale, scale, scale );
 				scene.addObject( mesh1 );
 				scene.addObject( mesh1 );
 
 
 				mesh2 = new THREE.Mesh( geometry, material2 );
 				mesh2 = new THREE.Mesh( geometry, material2 );
 				mesh2.position.x = scale * 12;
 				mesh2.position.x = scale * 12;
-				mesh2.scale.x = mesh2.scale.y = mesh2.scale.z = scale;
+				mesh2.scale.set( scale, scale, scale );
 				scene.addObject( mesh2 );
 				scene.addObject( mesh2 );
 
 
 				loader.statusDomElement.style.display = "none";
 				loader.statusDomElement.style.display = "none";
@@ -236,14 +228,7 @@
 
 
 				r += 0.01;
 				r += 0.01;
 
 
-				webglRenderer.render( scene, camera );
-
-			}
-
-			function log( text ) {
-
-				var e = document.getElementById("log");
-				e.innerHTML = text + "<br/>" + e.innerHTML;
+				renderer.render( scene, camera );
 
 
 			}
 			}
 
 

+ 1 - 2
examples/webgl_materials_video.html

@@ -199,8 +199,7 @@
 
 
 				postprocessing.scene = new THREE.Scene();
 				postprocessing.scene = new THREE.Scene();
 
 
-				postprocessing.camera = new THREE.Camera();
-				postprocessing.camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
+				postprocessing.camera = new THREE.OrthoCamera( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
 				postprocessing.camera.position.z = 100;
 				postprocessing.camera.position.z = 100;
 
 
 				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
 				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };

+ 141 - 143
examples/webgl_particles_dynamic.html

@@ -21,7 +21,7 @@
                 position: absolute;
                 position: absolute;
                 top: 0px; width: 100%;
                 top: 0px; width: 100%;
                 padding: 5px;
                 padding: 5px;
-				
+
             }
             }
 
 
             a { color: red; }
             a { color: red; }
@@ -40,13 +40,13 @@
 		</div>
 		</div>
 
 
         <script type="text/javascript" src="../build/Three.js"></script>
         <script type="text/javascript" src="../build/Three.js"></script>
-		
+
         <script type="text/javascript" src="js/Stats.js"></script>
         <script type="text/javascript" src="js/Stats.js"></script>
         <script type="text/javascript" src="js/Detector.js"></script>
         <script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 
 
         <script type="text/javascript">
         <script type="text/javascript">
-			
+
 			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
 			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
 
 
 			var SCREEN_HEIGHT = window.innerHeight;
 			var SCREEN_HEIGHT = window.innerHeight;
@@ -55,14 +55,14 @@
             var container, stats;
             var container, stats;
 
 
             var camera, scene, renderer, mesh, directionalLight;
             var camera, scene, renderer, mesh, directionalLight;
-			
+
 			var parent,
 			var parent,
-				meshes = [], clonemeshes = [];			
-			
+				meshes = [], clonemeshes = [];
+
 			var p;
 			var p;
-			
+
 			var aloader, bloader;
 			var aloader, bloader;
-			
+
 			var total = 0, totaln = 0;
 			var total = 0, totaln = 0;
 
 
 			var postprocessing1 = {};
 			var postprocessing1 = {};
@@ -70,7 +70,7 @@
 
 
             init();
             init();
             animate();
             animate();
-			
+
             function init() {
             function init() {
 
 
                 container = document.getElementById( 'container' );
                 container = document.getElementById( 'container' );
@@ -82,7 +82,7 @@
                 scene = new THREE.Scene();
                 scene = new THREE.Scene();
 
 
 				scene.fog = new THREE.FogExp2( 0x000104, 0.0000675 );
 				scene.fog = new THREE.FogExp2( 0x000104, 0.0000675 );
-				
+
 				directionalLight = new THREE.DirectionalLight( 0xffffff );
 				directionalLight = new THREE.DirectionalLight( 0xffffff );
 				directionalLight.position.set( 0, 0, 1 );
 				directionalLight.position.set( 0, 0, 1 );
 				directionalLight.position.normalize();
 				directionalLight.position.normalize();
@@ -95,9 +95,9 @@
 				bloader = new THREE.BinaryLoader( true );
 				bloader = new THREE.BinaryLoader( true );
 
 
 				document.body.appendChild( bloader.statusDomElement );
 				document.body.appendChild( bloader.statusDomElement );
-				
-				aloader.load( { model: "obj/terrain.js", callback: function( geometry ) { 
-						
+
+				aloader.load( { model: "obj/terrain.js", callback: function( geometry ) {
+
 					createMesh( geometry, scene, 16.8, -11000, -200,  -5000, 0x00ff44, false );
 					createMesh( geometry, scene, 16.8, -11000, -200,  -5000, 0x00ff44, false );
 					createMesh( geometry, scene, 16.8,  11000, -200, -15000, 0x00ff33, false );
 					createMesh( geometry, scene, 16.8,  11000, -200, -15000, 0x00ff33, false );
 					createMesh( geometry, scene, 16.8,      0, -200, -15000, 0x00ff33, false );
 					createMesh( geometry, scene, 16.8,      0, -200, -15000, 0x00ff33, false );
@@ -106,43 +106,43 @@
 					createMesh( geometry, scene, 16.8, -11000, -200,   5000, 0x00ff11, false );
 					createMesh( geometry, scene, 16.8, -11000, -200,   5000, 0x00ff11, false );
 					createMesh( geometry, scene, 16.8,  13000, -200,   5000, 0x00ff55, false );
 					createMesh( geometry, scene, 16.8,  13000, -200,   5000, 0x00ff55, false );
 					createMesh( geometry, scene, 16.8,  13000, -200,  -5000, 0x00ff66, false );
 					createMesh( geometry, scene, 16.8,  13000, -200,  -5000, 0x00ff66, false );
-						
+
 				} } );
 				} } );
-				
+
 				bloader.load( { model: "obj/veyron/VeyronNoUv_bin.js", callback: function( geometry ) { createMesh( geometry, scene, 6.8, 2200, -200, -100, 0x0055ff, false ) } } );
 				bloader.load( { model: "obj/veyron/VeyronNoUv_bin.js", callback: function( geometry ) { createMesh( geometry, scene, 6.8, 2200, -200, -100, 0x0055ff, false ) } } );
-				
-				bloader.load( { model: "obj/female02/Female02_bin.js", callback: function( geometry ) { 
-				
+
+				bloader.load( { model: "obj/female02/Female02_bin.js", callback: function( geometry ) {
+
 					createMesh( geometry, scene, 4.05, -1000, -350,    0, 0xffdd44, true );
 					createMesh( geometry, scene, 4.05, -1000, -350,    0, 0xffdd44, true );
 					createMesh( geometry, scene, 4.05,     0, -350,    0, 0xffffff, true );
 					createMesh( geometry, scene, 4.05,     0, -350,    0, 0xffffff, true );
 					createMesh( geometry, scene, 4.05,  1000, -350,  400, 0xff4422, true );
 					createMesh( geometry, scene, 4.05,  1000, -350,  400, 0xff4422, true );
 					createMesh( geometry, scene, 4.05,   250, -350, 1500, 0xff9955, true );
 					createMesh( geometry, scene, 4.05,   250, -350, 1500, 0xff9955, true );
 					createMesh( geometry, scene, 4.05,   250, -350, 2500, 0xff77dd, true );
 					createMesh( geometry, scene, 4.05,   250, -350, 2500, 0xff77dd, true );
-					
+
 				} } );
 				} } );
-				
-				bloader.load( { model: "obj/male02/Male02_bin.js", callback: function( geometry ) { 
-				
+
+				bloader.load( { model: "obj/male02/Male02_bin.js", callback: function( geometry ) {
+
 					createMesh( geometry, scene, 4.05,  -500, -350,   600, 0xff7744, true );
 					createMesh( geometry, scene, 4.05,  -500, -350,   600, 0xff7744, true );
 					createMesh( geometry, scene, 4.05,   500, -350,     0, 0xff5522, true );
 					createMesh( geometry, scene, 4.05,   500, -350,     0, 0xff5522, true );
 					createMesh( geometry, scene, 4.05,  -250, -350,  1500, 0xff9922, true );
 					createMesh( geometry, scene, 4.05,  -250, -350,  1500, 0xff9922, true );
 					createMesh( geometry, scene, 4.05,  -250, -350, -1500, 0xff99ff, true );
 					createMesh( geometry, scene, 4.05,  -250, -350, -1500, 0xff99ff, true );
-					
+
 				} } );
 				} } );
-				
+
                 renderer = new THREE.WebGLRenderer( { clearColor: 0x000000, clearAlpha: 1, antialias: false } );
                 renderer = new THREE.WebGLRenderer( { clearColor: 0x000000, clearAlpha: 1, antialias: false } );
 				renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
 				renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
 				renderer.autoClear = false;
 				renderer.autoClear = false;
 				renderer.sortObjects = false;
 				renderer.sortObjects = false;
                 container.appendChild( renderer.domElement );
                 container.appendChild( renderer.domElement );
-				
+
 				renderer.setClearColor( scene.fog.color, 1 );
 				renderer.setClearColor( scene.fog.color, 1 );
-				
+
                 stats = new Stats();
                 stats = new Stats();
                 stats.domElement.style.position = 'absolute';
                 stats.domElement.style.position = 'absolute';
                 stats.domElement.style.top = '0px';
                 stats.domElement.style.top = '0px';
                 //container.appendChild( stats.domElement );
                 //container.appendChild( stats.domElement );
-				
+
 				parent = new THREE.Object3D();
 				parent = new THREE.Object3D();
 				scene.addObject( parent );
 				scene.addObject( parent );
 
 
@@ -150,7 +150,7 @@
 				grid.rotation.x = 1.57;
 				grid.rotation.x = 1.57;
 				grid.position.y = -400;
 				grid.position.y = -400;
 				parent.addChild( grid );
 				parent.addChild( grid );
-				
+
 				totaln += 1;
 				totaln += 1;
 				total += grid.geometry.vertices.length;
 				total += grid.geometry.vertices.length;
 
 
@@ -165,69 +165,69 @@
 
 
 				var geometry = new THREE.Geometry();
 				var geometry = new THREE.Geometry();
 				var vertices_tmp = [];
 				var vertices_tmp = [];
-				
+
 				for( i = 0; i < vl; i++ ) {
 				for( i = 0; i < vl; i++ ) {
-				
+
 					p = vertices[ i ].position;
 					p = vertices[ i ].position;
-					
+
 					geometry.vertices[ i ] = new THREE.Vertex( p.clone() );
 					geometry.vertices[ i ] = new THREE.Vertex( p.clone() );
 					vertices_tmp[ i ] = [ p.x, p.y, p.z, 0, 0 ];
 					vertices_tmp[ i ] = [ p.x, p.y, p.z, 0, 0 ];
 
 
 				}
 				}
 
 
 				var clones = [
 				var clones = [
-								[  6000, 0, -4000 ], 
-								[  5000, 0, 0 ], 
+								[  6000, 0, -4000 ],
+								[  5000, 0, 0 ],
 								[  1000, 0, 5000 ],
 								[  1000, 0, 5000 ],
 								[  1000, 0, -5000 ],
 								[  1000, 0, -5000 ],
-								[  4000, 0, 2000 ], 
-								[ -4000, 0, 1000 ], 
-								[ -5000, 0, -5000 ], 
+								[  4000, 0, 2000 ],
+								[ -4000, 0, 1000 ],
+								[ -5000, 0, -5000 ],
 
 
 								[ 0, 0, 0 ]
 								[ 0, 0, 0 ]
 
 
 							  ];
 							  ];
-				
+
 				if ( dynamic ) {
 				if ( dynamic ) {
-					
+
 					for( i = 0; i < clones.length; i++ ) {
 					for( i = 0; i < clones.length; i++ ) {
-					
+
 						c = ( i < clones.length -1 ) ? 0x252525 : color;
 						c = ( i < clones.length -1 ) ? 0x252525 : color;
 
 
 						mesh = new THREE.ParticleSystem( geometry, new THREE.ParticleBasicMaterial( { size: 3, color: c } ) );
 						mesh = new THREE.ParticleSystem( geometry, new THREE.ParticleBasicMaterial( { size: 3, color: c } ) );
 						mesh.scale.x = mesh.scale.y = mesh.scale.z = scale;
 						mesh.scale.x = mesh.scale.y = mesh.scale.z = scale;
-						
+
 						mesh.position.x = x + clones[ i ][ 0 ];
 						mesh.position.x = x + clones[ i ][ 0 ];
 						mesh.position.y = y + clones[ i ][ 1 ];
 						mesh.position.y = y + clones[ i ][ 1 ];
 						mesh.position.z = z + clones[ i ][ 2 ];
 						mesh.position.z = z + clones[ i ][ 2 ];
-						
+
 						parent.addChild( mesh );
 						parent.addChild( mesh );
-						
+
 						clonemeshes.push( { mesh: mesh, speed: 0.5 + Math.random() } );
 						clonemeshes.push( { mesh: mesh, speed: 0.5 + Math.random() } );
-						
+
 					}
 					}
-					
+
 					totaln += clones.length;
 					totaln += clones.length;
 					total += clones.length * vl;
 					total += clones.length * vl;
-				
+
 				} else {
 				} else {
-				
+
 					mesh = new THREE.ParticleSystem( geometry, new THREE.ParticleBasicMaterial( { size: 3, color: color } ) );
 					mesh = new THREE.ParticleSystem( geometry, new THREE.ParticleBasicMaterial( { size: 3, color: color } ) );
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = scale;
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = scale;
-					
+
 					mesh.position.x = x;
 					mesh.position.x = x;
 					mesh.position.y = y;
 					mesh.position.y = y;
 					mesh.position.z = z;
 					mesh.position.z = z;
-					
+
 					parent.addChild( mesh );
 					parent.addChild( mesh );
-					
+
 					totaln += 1;
 					totaln += 1;
 					total += vl;
 					total += vl;
 
 
 				}
 				}
 
 
 				bloader.statusDomElement.style.display = "none";
 				bloader.statusDomElement.style.display = "none";
-				
+
 				meshes.push( { mesh: mesh, vertices: geometry.vertices, vertices_tmp: vertices_tmp, vl: vl,
 				meshes.push( { mesh: mesh, vertices: geometry.vertices, vertices_tmp: vertices_tmp, vl: vl,
 							  down: 0, up: 0, direction: 0, speed: 35, delay: Math.floor( 200 + 200 * Math.random() ),
 							  down: 0, up: 0, direction: 0, speed: 35, delay: Math.floor( 200 + 200 * Math.random() ),
 							  started: false, start: Math.floor( 100 + 200 * Math.random() ),
 							  started: false, start: Math.floor( 100 + 200 * Math.random() ),
@@ -239,17 +239,16 @@
 			}
 			}
 
 
 			function initPostprocessingFocus( effect ) {
 			function initPostprocessingFocus( effect ) {
-				
+
 				effect.type = "focus";
 				effect.type = "focus";
-				
+
 				effect.scene = new THREE.Scene();
 				effect.scene = new THREE.Scene();
-				
-				effect.camera = new THREE.Camera();
-				effect.camera.projectionMatrix = THREE.Matrix4.makeOrtho( SCREEN_WIDTH / - 2, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, -10000, 10000 );
+
+				effect.camera = new THREE.OrthoCamera( SCREEN_WIDTH / - 2, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, -10000, 10000 );
 				effect.camera.position.z = 100;
 				effect.camera.position.z = 100;
-				
+
 				effect.texture = new THREE.WebGLRenderTarget( SCREEN_WIDTH, SCREEN_HEIGHT, { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBFormat } );
 				effect.texture = new THREE.WebGLRenderTarget( SCREEN_WIDTH, SCREEN_HEIGHT, { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBFormat } );
-				
+
 				var heatUniforms = {
 				var heatUniforms = {
 
 
 					"map": { type: "t", value:0, texture: effect.texture },
 					"map": { type: "t", value:0, texture: effect.texture },
@@ -275,66 +274,66 @@
 						"}"
 						"}"
 
 
 					].join("\n"),
 					].join("\n"),
-					
+
 					fragmentShader: [
 					fragmentShader: [
 
 
 							"uniform float screenWidth;",
 							"uniform float screenWidth;",
 							"uniform float screenHeight;",
 							"uniform float screenHeight;",
 							"uniform float sampleDistance;",
 							"uniform float sampleDistance;",
 							"uniform float waveFactor;",
 							"uniform float waveFactor;",
-							
+
 							"uniform sampler2D map;",
 							"uniform sampler2D map;",
 							"varying vec2 vUv;",
 							"varying vec2 vUv;",
-				
+
 							"void main() {",
 							"void main() {",
 
 
 								"vec4 color, org, tmp, add;",
 								"vec4 color, org, tmp, add;",
 								"float sample_dist, f;",
 								"float sample_dist, f;",
-								"vec2 vin;",				
+								"vec2 vin;",
 								"vec2 uv = vUv;",
 								"vec2 uv = vUv;",
-								
+
 								"add += color = org = texture2D( map, uv );",
 								"add += color = org = texture2D( map, uv );",
 
 
 								"vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );",
 								"vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );",
 								"sample_dist = dot( vin, vin ) * 2.0;",
 								"sample_dist = dot( vin, vin ) * 2.0;",
-								
+
 								"f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;",
 								"f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;",
-				
+
 								"vec2 sampleSize = vec2(  1.0 / screenWidth, 1.0 / screenHeight ) * vec2(f);",
 								"vec2 sampleSize = vec2(  1.0 / screenWidth, 1.0 / screenHeight ) * vec2(f);",
-				
-								"add += tmp = texture2D( map, uv + vec2(0.111964, 0.993712) * sampleSize );", 
+
+								"add += tmp = texture2D( map, uv + vec2(0.111964, 0.993712) * sampleSize );",
 								"if( tmp.b < color.b ) color = tmp;",
 								"if( tmp.b < color.b ) color = tmp;",
-				
+
 								"add += tmp = texture2D( map, uv + vec2(0.846724, 0.532032) * sampleSize );",
 								"add += tmp = texture2D( map, uv + vec2(0.846724, 0.532032) * sampleSize );",
 								"if( tmp.b < color.b ) color = tmp;",
 								"if( tmp.b < color.b ) color = tmp;",
-				
+
 								"add += tmp = texture2D( map, uv + vec2(0.943883, -0.330279) * sampleSize );",
 								"add += tmp = texture2D( map, uv + vec2(0.943883, -0.330279) * sampleSize );",
 								"if( tmp.b < color.b ) color = tmp;",
 								"if( tmp.b < color.b ) color = tmp;",
-				
+
 								"add += tmp = texture2D( map, uv + vec2(0.330279, -0.943883) * sampleSize );",
 								"add += tmp = texture2D( map, uv + vec2(0.330279, -0.943883) * sampleSize );",
 								"if( tmp.b < color.b ) color = tmp;",
 								"if( tmp.b < color.b ) color = tmp;",
-				
+
 								"add += tmp = texture2D( map, uv + vec2(-0.532032, -0.846724) * sampleSize );",
 								"add += tmp = texture2D( map, uv + vec2(-0.532032, -0.846724) * sampleSize );",
 								"if( tmp.b < color.b ) color = tmp;",
 								"if( tmp.b < color.b ) color = tmp;",
-				
+
 								"add += tmp = texture2D( map, uv + vec2(-0.993712, -0.111964) * sampleSize );",
 								"add += tmp = texture2D( map, uv + vec2(-0.993712, -0.111964) * sampleSize );",
 								"if( tmp.b < color.b ) color = tmp;",
 								"if( tmp.b < color.b ) color = tmp;",
-				
+
 								"add += tmp = texture2D( map, uv + vec2(-0.707107, 0.707107) * sampleSize );",
 								"add += tmp = texture2D( map, uv + vec2(-0.707107, 0.707107) * sampleSize );",
 								"if( tmp.b < color.b ) color = tmp;",
 								"if( tmp.b < color.b ) color = tmp;",
 
 
 								"color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );",
 								"color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );",
 								"color = color + ( add / vec4(8.0) - color ) * ( vec4(1.0) - vec4(sample_dist * 0.5) );",
 								"color = color + ( add / vec4(8.0) - color ) * ( vec4(1.0) - vec4(sample_dist * 0.5) );",
 
 
-								"gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );",								
-								
+								"gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );",
+
 							"}"
 							"}"
 
 
 
 
 						].join("\n")
 						].join("\n")
 
 
 				} );
 				} );
-				
+
 				effect.quad = new THREE.Mesh( new THREE.PlaneGeometry( SCREEN_WIDTH, SCREEN_HEIGHT ), effect.materialHeat );
 				effect.quad = new THREE.Mesh( new THREE.PlaneGeometry( SCREEN_WIDTH, SCREEN_HEIGHT ), effect.materialHeat );
 				effect.quad.position.z = -500;
 				effect.quad.position.z = -500;
 				effect.scene.addObject( effect.quad );
 				effect.scene.addObject( effect.quad );
@@ -344,19 +343,18 @@
 			function initPostprocessingBloom( effect ) {
 			function initPostprocessingBloom( effect ) {
 
 
 				effect.type = "bloomnoise";
 				effect.type = "bloomnoise";
-				
+
 				effect.scene = new THREE.Scene();
 				effect.scene = new THREE.Scene();
 
 
-				effect.camera = new THREE.Camera();
-				effect.camera.projectionMatrix = THREE.Matrix4.makeOrtho( SCREEN_WIDTH / - 2, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, -10000, 10000 );
+				effect.camera = new THREE.OrthoCamera( SCREEN_WIDTH / - 2, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, -10000, 10000 );
 				effect.camera.position.z = 100;
 				effect.camera.position.z = 100;
 
 
 				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
 				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
-				
+
 				effect.rtTexture1 = new THREE.WebGLRenderTarget( SCREEN_WIDTH, SCREEN_HEIGHT, pars );
 				effect.rtTexture1 = new THREE.WebGLRenderTarget( SCREEN_WIDTH, SCREEN_HEIGHT, pars );
 				effect.rtTexture2 = new THREE.WebGLRenderTarget( 256, 512, pars );
 				effect.rtTexture2 = new THREE.WebGLRenderTarget( 256, 512, pars );
 				effect.rtTexture3 = new THREE.WebGLRenderTarget( 512, 256, pars );
 				effect.rtTexture3 = new THREE.WebGLRenderTarget( 512, 256, pars );
-				
+
 				var screen_shader = THREE.ShaderUtils.lib["screen"];
 				var screen_shader = THREE.ShaderUtils.lib["screen"];
 				var screen_uniforms = THREE.UniformsUtils.clone( screen_shader.uniforms );
 				var screen_uniforms = THREE.UniformsUtils.clone( screen_shader.uniforms );
 
 
@@ -393,9 +391,9 @@
 
 
 				var film_shader = THREE.ShaderUtils.lib["film"];
 				var film_shader = THREE.ShaderUtils.lib["film"];
 				var film_uniforms = THREE.UniformsUtils.clone( film_shader.uniforms );
 				var film_uniforms = THREE.UniformsUtils.clone( film_shader.uniforms );
-				
+
 				film_uniforms["tDiffuse"].texture = effect.rtTexture1;
 				film_uniforms["tDiffuse"].texture = effect.rtTexture1;
-				
+
 				effect.materialFilm = new THREE.MeshShaderMaterial( { uniforms: film_uniforms, vertexShader: film_shader.vertexShader, fragmentShader: film_shader.fragmentShader } );
 				effect.materialFilm = new THREE.MeshShaderMaterial( { uniforms: film_uniforms, vertexShader: film_shader.vertexShader, fragmentShader: film_shader.fragmentShader } );
 				effect.materialFilm.uniforms.grayscale.value = 0;
 				effect.materialFilm.uniforms.grayscale.value = 0;
 				effect.materialFilm.uniforms.nIntensity.value = 0.5;
 				effect.materialFilm.uniforms.nIntensity.value = 0.5;
@@ -410,7 +408,7 @@
 
 
 			var j, jl, cm, data, vertices, vertices_tmp, vl, d, vt,
 			var j, jl, cm, data, vertices, vertices_tmp, vl, d, vt,
 				time, oldTime, delta;
 				time, oldTime, delta;
-			
+
 			function animate() {
 			function animate() {
 
 
 				requestAnimationFrame( animate );
 				requestAnimationFrame( animate );
@@ -419,32 +417,32 @@
 				//stats.update();
 				//stats.update();
 
 
 			}
 			}
-			
+
             function render() {
             function render() {
 
 
 				if ( ! oldTime ) {
 				if ( ! oldTime ) {
 
 
 					oldTime = new Date().getTime();
 					oldTime = new Date().getTime();
-					
+
 				}
 				}
-					
-				time = new Date().getTime();				
+
+				time = new Date().getTime();
 
 
 				delta = 0.01 * ( time - oldTime );
 				delta = 0.01 * ( time - oldTime );
 				oldTime = time;
 				oldTime = time;
-				
+
 				delta = delta < 2 ? delta : 2;
 				delta = delta < 2 ? delta : 2;
-				
+
 				parent.rotation.y += -0.02 * delta;
 				parent.rotation.y += -0.02 * delta;
-				
+
 				for( j = 0, jl = clonemeshes.length; j < jl; j++ ) {
 				for( j = 0, jl = clonemeshes.length; j < jl; j++ ) {
-				
+
 					cm = clonemeshes[ j ];
 					cm = clonemeshes[ j ];
 					cm.mesh.rotation.y += -0.1 * delta * cm.speed;
 					cm.mesh.rotation.y += -0.1 * delta * cm.speed;
-					
+
 				}
 				}
-				
-				for( j = 0, jl = meshes.length; j < jl; j++ ) {				
+
+				for( j = 0, jl = meshes.length; j < jl; j++ ) {
 
 
 					data = meshes[ j ];
 					data = meshes[ j ];
 					mesh = data.mesh;
 					mesh = data.mesh;
@@ -453,18 +451,18 @@
 					vl = data.vl;
 					vl = data.vl;
 
 
 					if ( ! data.dynamic ) continue;
 					if ( ! data.dynamic ) continue;
-					
+
 					if ( data.start > 0 ) {
 					if ( data.start > 0 ) {
-					
+
 						data.start -= 1;
 						data.start -= 1;
 
 
 					} else {
 					} else {
-					
+
 						if ( !data.started ) {
 						if ( !data.started ) {
 
 
 							data.direction = -1;
 							data.direction = -1;
 							data.started = true;
 							data.started = true;
-							
+
 						}
 						}
 
 
 					}
 					}
@@ -475,7 +473,7 @@
 						vt = vertices_tmp[ i ];
 						vt = vertices_tmp[ i ];
 
 
 						// falling down
 						// falling down
-						
+
 						if ( data.direction < 0 ) {
 						if ( data.direction < 0 ) {
 
 
 							// var d = Math.abs( p.x - vertices_tmp[ i ][ 0 ] ) + Math.abs( p.y - vertices_tmp[ i ][ 1 ] ) + Math.abs( p.z - vertices_tmp[ i ][ 2 ] );
 							// var d = Math.abs( p.x - vertices_tmp[ i ][ 0 ] ) + Math.abs( p.y - vertices_tmp[ i ][ 1 ] ) + Math.abs( p.z - vertices_tmp[ i ][ 2 ] );
@@ -490,102 +488,102 @@
 								p.z += 1.5 * ( 0.50 - Math.random() ) * data.speed * delta;
 								p.z += 1.5 * ( 0.50 - Math.random() ) * data.speed * delta;
 
 
 							} else {
 							} else {
-							
+
 								if ( ! vt[ 3 ] ) {
 								if ( ! vt[ 3 ] ) {
-								
+
 									vt[ 3 ] = 1;
 									vt[ 3 ] = 1;
 									data.down += 1;
 									data.down += 1;
-									
+
 								}
 								}
-								
+
 							}
 							}
-							
+
 						}
 						}
-						
-						// rising up 
-						
+
+						// rising up
+
 						if ( data.direction > 0 ) {
 						if ( data.direction > 0 ) {
-							
+
 							//if ( p.y < vertices_tmp[ i ][ 1 ] ) {
 							//if ( p.y < vertices_tmp[ i ][ 1 ] ) {
-							
+
 							//	p.y += data.direction * data.speed * delta;
 							//	p.y += data.direction * data.speed * delta;
-							
+
 							d = Math.abs( p.x - vt[ 0 ] ) + Math.abs( p.y - vt[ 1 ] ) + Math.abs( p.z - vt[ 2 ] );
 							d = Math.abs( p.x - vt[ 0 ] ) + Math.abs( p.y - vt[ 1 ] ) + Math.abs( p.z - vt[ 2 ] );
-							
+
 							if ( d > 1 ) {
 							if ( d > 1 ) {
-							
+
 								p.x += - ( p.x - vt[ 0 ] ) / d * data.speed * delta * ( 0.85 - Math.random() );
 								p.x += - ( p.x - vt[ 0 ] ) / d * data.speed * delta * ( 0.85 - Math.random() );
 								p.y += - ( p.y - vt[ 1 ] ) / d * data.speed * delta * ( 1 + Math.random() );
 								p.y += - ( p.y - vt[ 1 ] ) / d * data.speed * delta * ( 1 + Math.random() );
 								p.z += - ( p.z - vt[ 2 ] ) / d * data.speed * delta * ( 0.85 - Math.random() );
 								p.z += - ( p.z - vt[ 2 ] ) / d * data.speed * delta * ( 0.85 - Math.random() );
-							
+
 							} else {
 							} else {
-						
+
 								if ( ! vt[ 4 ] ) {
 								if ( ! vt[ 4 ] ) {
-								
+
 									vt[ 4 ] = 1;
 									vt[ 4 ] = 1;
 									data.up += 1;
 									data.up += 1;
-									
+
 								}
 								}
-								
+
 							}
 							}
-							
-						}						
-						
+
+						}
+
 
 
 					}
 					}
-					
+
 					// all down
 					// all down
-					
+
 					if ( data.down == vl ) {
 					if ( data.down == vl ) {
-						
+
 						if ( data.delay == 0 ) {
 						if ( data.delay == 0 ) {
-						
+
 							data.direction = 1;
 							data.direction = 1;
 							data.speed = 10;
 							data.speed = 10;
 							data.down = 0;
 							data.down = 0;
 							data.delay = 320;
 							data.delay = 320;
-							
+
 							for ( i = 0; i < vl; i ++ ) {
 							for ( i = 0; i < vl; i ++ ) {
-							
+
 								vertices_tmp[ i ][ 3 ] = 0;
 								vertices_tmp[ i ][ 3 ] = 0;
-								
+
 							}
 							}
-							
+
 						} else {
 						} else {
-						
+
 							data.delay -= 1;
 							data.delay -= 1;
-							
+
 						}
 						}
-						
-						
+
+
 					}
 					}
-					
+
 					// all up
 					// all up
-					
+
 					if ( data.up == vl ) {
 					if ( data.up == vl ) {
-						
+
 						if ( data.delay == 0 ) {
 						if ( data.delay == 0 ) {
-							
+
 							data.direction = -1;
 							data.direction = -1;
 							data.speed = 35;
 							data.speed = 35;
 							data.up = 0;
 							data.up = 0;
 							data.delay = 120;
 							data.delay = 120;
 
 
 							for ( i = 0; i < vl; i ++ ) {
 							for ( i = 0; i < vl; i ++ ) {
-							
+
 								vertices_tmp[ i ][ 4 ] = 0;
 								vertices_tmp[ i ][ 4 ] = 0;
-								
+
 							}
 							}
 
 
 						} else {
 						} else {
-						
+
 							data.delay -= 1;
 							data.delay -= 1;
-							
+
 						}
 						}
 
 
 
 
 					}
 					}
-					
+
 					mesh.geometry.__dirtyVertices = true;
 					mesh.geometry.__dirtyVertices = true;
 
 
 				}
 				}
@@ -622,13 +620,13 @@
 
 
 
 
 				// NOISE + SCANLINES
 				// NOISE + SCANLINES
-				
+
 				postprocessing1.materialFilm.uniforms.time.value += 0.01;
 				postprocessing1.materialFilm.uniforms.time.value += 0.01;
 				postprocessing1.quad.materials[ 0 ] = postprocessing1.materialFilm;
 				postprocessing1.quad.materials[ 0 ] = postprocessing1.materialFilm;
 
 
 				renderer.render( postprocessing1.scene, postprocessing1.camera, postprocessing2.texture, true );
 				renderer.render( postprocessing1.scene, postprocessing1.camera, postprocessing2.texture, true );
 
 
-				// FOCUS				
+				// FOCUS
 
 
 				renderer.render( postprocessing2.scene, postprocessing2.camera );
 				renderer.render( postprocessing2.scene, postprocessing2.camera );
 
 

+ 177 - 115
examples/webgl_postprocessing.html

@@ -17,45 +17,63 @@
 		    }
 		    }
 
 
 		    #info {
 		    #info {
-					color:#000;
-			position: absolute;
-			top: 0px; width: 100%;
+			color:#fff;
+			background-color: rgba( 0, 0, 0, 0.5 );
+			position: relative;
+			margin: 0 auto -2em;
+			top: 0px;
+			width: 550px;
 			padding: 5px;
 			padding: 5px;
-
+			z-index:100;
 		    }
 		    }
 
 
 		    a { color: red; }
 		    a { color: red; }
-
 		</style>
 		</style>
 	</head>
 	</head>
 	<body>
 	<body>
 
 
-		<div id="container"></div>
 		<div id="info">
 		<div id="info">
 			<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - webgl postprocessing example -
 			<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - webgl postprocessing example -
 			<a href="http://www.ir-ltd.net/infinite-3d-head-scan-released/" target="_blank">Lee Perry-Smith</a> head
 			<a href="http://www.ir-ltd.net/infinite-3d-head-scan-released/" target="_blank">Lee Perry-Smith</a> head
 		</div>
 		</div>
 
 
+		<div id="container"></div>
+
 		<script type="text/javascript" src="../build/Three.js"></script>
 		<script type="text/javascript" src="../build/Three.js"></script>
 
 
+		<script type="text/javascript" src="js/postprocessing/EffectComposer.js"></script>
+		<script type="text/javascript" src="js/postprocessing/RenderPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/BloomPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/FilmPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/SepiaPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/DotScreenPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/ScreenPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/VignettePass.js"></script>
+
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
 
 
 		<!-- Time modulated procedural color fragment shader -->
 		<!-- Time modulated procedural color fragment shader -->
+
 		<script id="fs-colors" type="x-shader/x-fragment">
 		<script id="fs-colors" type="x-shader/x-fragment">
+
 			varying vec2 vUv;
 			varying vec2 vUv;
 			uniform float time;
 			uniform float time;
 
 
-			void main(void) {
+			void main() {
 
 
-				gl_FragColor = vec4( time, vUv.x, vUv.y, 1.0 );
+				//gl_FragColor = vec4( time, vUv.x, vUv.y, 1.0 );
+				gl_FragColor = vec4( 0.2, 0.4, 0.5, 1.0 );
 
 
 			}
 			}
+
 		</script>
 		</script>
 
 
 		<!-- Generic vertex shader -->
 		<!-- Generic vertex shader -->
+
 		<script id="vs-generic" type="x-shader/x-vertex">
 		<script id="vs-generic" type="x-shader/x-vertex">
+
 			varying vec2 vUv;
 			varying vec2 vUv;
 
 
 			void main() {
 			void main() {
@@ -64,6 +82,7 @@
 				gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
 				gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
 
 
 			}
 			}
+
 		</script>
 		</script>
 
 
 
 
@@ -73,12 +92,14 @@
 
 
 			var container, stats;
 			var container, stats;
 
 
-			var cameraOrtho, cameraPerspective, sceneModel, sceneScreen, sceneBG, renderer, mesh, directionalLight;
+			var composerScene, composer1, composer2, composer3, composer4;
+
+			var cameraOrtho, cameraPerspective, sceneModel, sceneBG, renderer, mesh, directionalLight;
 
 
-			var windowHalfX = window.innerWidth / 2;
-			var windowHalfY = window.innerHeight / 2;
+			var halfWidth = window.innerWidth / 2;
+			var halfHeight = window.innerHeight / 2;
 
 
-			var rtTexture, materialColor, materialScreen, materialFilm, materialConvolution, blurx, blury, quadBG, quadScreen;
+			var rtTexture, materialColor, material2D, quadBG1, quadBG2;
 
 
 			var delta = 0.01;
 			var delta = 0.01;
 
 
@@ -89,29 +110,28 @@
 
 
 				container = document.getElementById( 'container' );
 				container = document.getElementById( 'container' );
 
 
-				cameraOrtho = new THREE.Camera();
-				cameraOrtho.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
+				cameraOrtho = new THREE.OrthoCamera( -halfWidth, halfWidth, halfHeight, -halfHeight, -10000, 10000 );
 				cameraOrtho.position.z = 100;
 				cameraOrtho.position.z = 100;
 
 
 				cameraPerspective = new THREE.Camera( 50, window.innerWidth / window.innerHeight, 1, 10000 );
 				cameraPerspective = new THREE.Camera( 50, window.innerWidth / window.innerHeight, 1, 10000 );
 				cameraPerspective.position.z = 900;
 				cameraPerspective.position.z = 900;
 
 
+				//
+
 				sceneModel = new THREE.Scene();
 				sceneModel = new THREE.Scene();
-				sceneScreen = new THREE.Scene();
-				sceneBG = new THREE.Scene();
 
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff );
 				directionalLight = new THREE.DirectionalLight( 0xffffff );
-				directionalLight.position.x = 0;
-				directionalLight.position.y = 0;
-				directionalLight.position.z = 1;
+				directionalLight.position.set( 0, 0, 1 );
 				directionalLight.position.normalize();
 				directionalLight.position.normalize();
 				sceneModel.addLight( directionalLight );
 				sceneModel.addLight( directionalLight );
 
 
-				var pars1 = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBFormat },
-					pars2 = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,  format: THREE.RGBFormat };
-				rtTexture1 = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, pars1 );
-				rtTexture2 = new THREE.WebGLRenderTarget( 256, 512, pars2 );
-				rtTexture3 = new THREE.WebGLRenderTarget( 512, 256, pars2 );
+				loader = new THREE.JSONLoader( true );
+				document.body.appendChild( loader.statusDomElement );
+				loader.load( { model: "obj/leeperrysmith/LeePerrySmith.js", callback: function( geometry ) { createMesh( geometry, sceneModel, 100 ) } } );
+
+				//
+
+				sceneBG = new THREE.Scene();
 
 
 				materialColor = new THREE.MeshShaderMaterial( {
 				materialColor = new THREE.MeshShaderMaterial( {
 
 
@@ -122,80 +142,148 @@
 
 
 				} );
 				} );
 
 
-				var screen_shader = THREE.ShaderUtils.lib["screen"];
-				var screen_uniforms = THREE.UniformsUtils.clone( screen_shader.uniforms );
+				var plane = new THREE.PlaneGeometry( 1, 1 );
 
 
-				screen_uniforms["tDiffuse"].texture = rtTexture1;
-				screen_uniforms["opacity"].value = 0.4;
+				quadBG1 = new THREE.Mesh( plane, materialColor );
+				quadBG1.position.z = -500;
+				quadBG1.scale.set( window.innerWidth, window.innerHeight, 1 );
+				sceneBG.addObject( quadBG1 );
 
 
-				materialScreen = new THREE.MeshShaderMaterial( {
+				//
 
 
-					uniforms: screen_uniforms,
-					vertexShader: screen_shader.vertexShader,
-					fragmentShader: screen_shader.fragmentShader,
-					blending: THREE.AdditiveBlending,
-					transparent: true
+				renderer = new THREE.WebGLRenderer( { antialias: false } );
+				renderer.setSize( window.innerWidth, window.innerHeight );
+				renderer.autoClear = false;
 
 
-				} );
+				container.appendChild( renderer.domElement );
 
 
-				var film_shader = THREE.ShaderUtils.lib["film"];
-				var film_uniforms = THREE.UniformsUtils.clone( film_shader.uniforms );
+				//
 
 
-				film_uniforms["tDiffuse"].texture = rtTexture1;
-				film_uniforms["nIntensity"].value = 0.25;
-				film_uniforms["sIntensity"].value = 0.5;
+				stats = new Stats();
+				stats.domElement.style.position = 'absolute';
+				stats.domElement.style.top = '0px';
+				//container.appendChild( stats.domElement );
 
 
-				materialFilm = new THREE.MeshShaderMaterial( {
+				//
 
 
-					uniforms: film_uniforms,
-					vertexShader: film_shader.vertexShader,
-					fragmentShader: film_shader.fragmentShader
+				var effectBloom = new THREE.BloomPass( 0.75 );
+				var effectFilm = new THREE.FilmPass( 0.75, 0.025, 648, false );
+				var effectFilmBW = new THREE.FilmPass( 0.35, 0.5, 2048, true );
+				var effectSepia = new THREE.SepiaPass( 1.0 );
+				var effectScreen = new THREE.ScreenPass();
+				var effectDotScreen = new THREE.DotScreenPass( new THREE.Vector2( 0, 0 ), 0.5, 0.4 );
+				var effectVignette = new THREE.VignettePass( 0.95, 1.6 );
 
 
-				} );
+				//effectFilm.renderToScreen = true;
+				//effectFilmBW.renderToScreen = true;
+				//effectDotScreen.renderToScreen = true;
+				effectVignette.renderToScreen = true;
 
 
-				var increment = 0.001953125;
+				//
 
 
-				blurx = new THREE.Vector2( increment, 0.0 ),
-				blury = new THREE.Vector2( 0.0, increment );
+				var renderBackground = new THREE.RenderPass( sceneBG, cameraOrtho );
+				var renderModel = new THREE.RenderPass( sceneModel, cameraPerspective );
 
 
-				var convolution_shader = THREE.ShaderUtils.lib["convolution"];
-				var convolution_uniforms = THREE.UniformsUtils.clone( convolution_shader.uniforms );
+				renderModel.clear = false;
 
 
-				convolution_uniforms["tDiffuse"].texture = rtTexture1;
-				convolution_uniforms["uImageIncrement"].value = blurx;
-				convolution_uniforms["cKernel"].value = THREE.ShaderUtils.buildKernel( 4.0 );
+				composerScene = new THREE.EffectComposer( renderer );
 
 
-				materialConvolution = new THREE.MeshShaderMaterial( {
+				composerScene.addPass( renderBackground );
+				composerScene.addPass( renderModel );
 
 
-					uniforms: convolution_uniforms,
-					vertexShader:   "#define KERNEL_SIZE 25.0\n" + convolution_shader.vertexShader,
-					fragmentShader: "#define KERNEL_SIZE 25\n"   + convolution_shader.fragmentShader
+				//
+
+				scene2D = new THREE.Scene();
+
+				var shader = THREE.ShaderUtils.lib[ "screen" ];
+
+				material2D = new THREE.MeshShaderMaterial( {
+
+					uniforms: THREE.UniformsUtils.clone( shader.uniforms ),
+					vertexShader: shader.vertexShader,
+					fragmentShader: shader.fragmentShader
 
 
 				} );
 				} );
 
 
-				var plane = new THREE.PlaneGeometry( window.innerWidth, window.innerHeight );
+				material2D.uniforms[ "tDiffuse" ].texture = composerScene.renderTarget;
 
 
-				quadBG = new THREE.Mesh( plane, materialColor );
-				quadBG.position.z = -500;
-				sceneBG.addObject( quadBG );
+				quadBG2 = new THREE.Mesh( plane, material2D );
+				quadBG2.position.z = -500;
+				quadBG2.scale.set( window.innerWidth, window.innerHeight, 1 );
+				scene2D.addObject( quadBG2 );
 
 
-				loader = new THREE.JSONLoader( true );
-				document.body.appendChild( loader.statusDomElement );
-				loader.load( { model: "obj/leeperrysmith/LeePerrySmith.js", callback: function( geometry ) { createMesh( geometry, sceneModel, 100 ) } } );
+				var renderScene = new THREE.RenderPass( scene2D, cameraOrtho );
 
 
-				quadScreen = new THREE.Mesh( plane, materialConvolution );
-				quadScreen.position.z = -100;
-				sceneScreen.addObject( quadScreen );
+				//
+
+				composer1 = new THREE.EffectComposer( renderer );
+
+				composer1.addPass( renderScene );
+				composer1.addPass( effectBloom );
+				composer1.addPass( effectFilmBW );
+				composer1.addPass( effectVignette );
+
+				//
+
+				composer2 = new THREE.EffectComposer( renderer );
+
+				composer2.addPass( renderScene );
+				composer2.addPass( effectDotScreen );
+				composer2.addPass( effectVignette );
+
+				//
+
+				composer3 = new THREE.EffectComposer( renderer );
+
+				composer3.addPass( renderScene );
+				composer3.addPass( effectSepia );
+				composer3.addPass( effectFilm );
+				composer3.addPass( effectVignette );
+
+				//
+
+				composer4 = new THREE.EffectComposer( renderer );
+
+				composer4.addPass( renderScene );
+				composer4.addPass( effectBloom );
+				composer4.addPass( effectVignette );
+
+				//
+
+				onWindowResize();
+
+				window.addEventListener( 'resize', onWindowResize, false );
+
+			}
+
+			function onWindowResize( event ) {
+
+				halfWidth = window.innerWidth / 2;
+				halfHeight = window.innerHeight / 2;
 
 
-				renderer = new THREE.WebGLRenderer( { antialias: false } );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 				renderer.setSize( window.innerWidth, window.innerHeight );
-				renderer.autoClear = false;
-				container.appendChild( renderer.domElement );
 
 
-				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				//container.appendChild( stats.domElement );
+				cameraPerspective.aspect = window.innerWidth / window.innerHeight;
+				cameraPerspective.updateProjectionMatrix();
+
+				cameraOrtho.left = -halfWidth;
+				cameraOrtho.right = halfWidth;
+				cameraOrtho.top = halfHeight;
+				cameraOrtho.bottom = -halfHeight;
+
+				cameraOrtho.updateProjectionMatrix();
+
+				composerScene.reset();
+
+				composer1.reset();
+				composer2.reset();
+				composer3.reset();
+				composer4.reset();
+
+				material2D.uniforms[ "tDiffuse" ].texture = composerScene.renderTarget;
+
+				quadBG1.scale.set( window.innerWidth, window.innerHeight, 1 );
+				quadBG2.scale.set( window.innerWidth, window.innerHeight, 1 );
 
 
 			}
 			}
 
 
@@ -232,11 +320,9 @@
 				var mat2 = new THREE.MeshShaderMaterial( parameters );
 				var mat2 = new THREE.MeshShaderMaterial( parameters );
 
 
 				mesh = new THREE.Mesh( geometry, mat2 );
 				mesh = new THREE.Mesh( geometry, mat2 );
-				mesh.position.x = 0;
-				mesh.position.y = -50;
-				mesh.position.z = 0;
-				mesh.scale.x = mesh.scale.y = mesh.scale.z = scale;
-				mesh.updateMatrix();
+				mesh.position.set( 0, -50, 0 );
+				mesh.scale.set( scale, scale, scale );
+
 				scene.addObject( mesh );
 				scene.addObject( mesh );
 
 
 				loader.statusDomElement.style.display = "none";
 				loader.statusDomElement.style.display = "none";
@@ -266,51 +352,27 @@
 
 
 				}
 				}
 
 
-				materialColor.uniforms.time.value += delta/2;
-				materialFilm.uniforms.time.value += delta;
-
-				renderer.clear();
-
-				// Render scene into texture
-
-				// background
-
-				renderer.render( sceneBG, cameraOrtho, rtTexture1, true );
-
-				// model
-
-				renderer.render( sceneModel, cameraPerspective, rtTexture1, false );
+				materialColor.uniforms.time.value += delta / 2;
 
 
-				// Render quad with blured scene into texture (convolution pass 1)
+				renderer.setViewport( 0, 0, 2 * halfWidth, 2 * halfHeight );
 
 
-				quadScreen.materials = [ materialConvolution ];
-				materialConvolution.uniforms.tDiffuse.texture = rtTexture1;
-				materialConvolution.uniforms.uImageIncrement.value = blurx;
-				renderer.render( sceneScreen, cameraOrtho, rtTexture2, true );
-
-				// Render quad with blured scene into texture (convolution pass 2)
-
-				materialConvolution.uniforms.tDiffuse.texture = rtTexture2;
-				materialConvolution.uniforms.uImageIncrement.value = blury;
-				renderer.render( sceneScreen, cameraOrtho, rtTexture3, true );
-
-				// Render original scene with superimposed blur into texture
+				renderer.clear();
+				composerScene.render( delta );
 
 
-				quadScreen.materials = [ materialScreen ];
+				renderer.setViewport( 0, 0, halfWidth, halfHeight );
+				composer1.render( delta );
 
 
-				materialScreen.uniforms.tDiffuse.texture = rtTexture3;
-				materialScreen.uniforms.opacity.value = 1.0;
-				renderer.render( sceneScreen, cameraOrtho, rtTexture1, false );
+				renderer.setViewport( halfWidth, 0, halfWidth, halfHeight );
+				composer2.render( delta );
 
 
-				// Render final scene to the screen with film shader
+				renderer.setViewport( 0, halfHeight, halfWidth, halfHeight );
+				composer3.render( delta );
 
 
-				materialFilm.uniforms.tDiffuse.texture = rtTexture1;
-				quadScreen.materials = [ materialFilm ];
-				renderer.render( sceneScreen, cameraOrtho );
+				renderer.setViewport( halfWidth, halfHeight, halfWidth, halfHeight );
+				composer4.render( delta );
 
 
 			}
 			}
 
 
-
 		</script>
 		</script>
 	</body>
 	</body>
 </html>
 </html>

+ 9 - 10
examples/webgl_postprocessing_dof.html

@@ -185,9 +185,9 @@
 
 
 				var matChanger = function( ) {
 				var matChanger = function( ) {
 
 
-					postprocessing.bokeh_uniforms["focus"].value = effectController.focus;
-					postprocessing.bokeh_uniforms["aperture"].value = effectController.aperture;
-					postprocessing.bokeh_uniforms["maxblur"].value = effectController.maxblur;
+					postprocessing.bokeh_uniforms[ "focus" ].value = effectController.focus;
+					postprocessing.bokeh_uniforms[ "aperture" ].value = effectController.aperture;
+					postprocessing.bokeh_uniforms[ "maxblur" ].value = effectController.maxblur;
 
 
 				};
 				};
 
 
@@ -234,22 +234,21 @@
 
 
 				postprocessing.scene = new THREE.Scene();
 				postprocessing.scene = new THREE.Scene();
 
 
-				postprocessing.camera = new THREE.Camera();
-				postprocessing.camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
+				postprocessing.camera = new THREE.OrthoCamera( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
 				postprocessing.camera.position.z = 100;
 				postprocessing.camera.position.z = 100;
 
 
 				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
 				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
 				postprocessing.rtTextureDepth = new THREE.WebGLRenderTarget( window.innerWidth, height, pars );
 				postprocessing.rtTextureDepth = new THREE.WebGLRenderTarget( window.innerWidth, height, pars );
 				postprocessing.rtTextureColor = new THREE.WebGLRenderTarget( window.innerWidth, height, pars );
 				postprocessing.rtTextureColor = new THREE.WebGLRenderTarget( window.innerWidth, height, pars );
 
 
-				var bokeh_shader = ShaderExtras["bokeh"];
+				var bokeh_shader = ShaderExtras[ "bokeh" ];
 
 
 				postprocessing.bokeh_uniforms = THREE.UniformsUtils.clone( bokeh_shader.uniforms );
 				postprocessing.bokeh_uniforms = THREE.UniformsUtils.clone( bokeh_shader.uniforms );
 
 
-				postprocessing.bokeh_uniforms["tColor"].texture = postprocessing.rtTextureColor;
-				postprocessing.bokeh_uniforms["tDepth"].texture = postprocessing.rtTextureDepth;
-				postprocessing.bokeh_uniforms["focus"].value = 1.1;
-				postprocessing.bokeh_uniforms["aspect"].value = window.innerWidth / height;
+				postprocessing.bokeh_uniforms[ "tColor" ].texture = postprocessing.rtTextureColor;
+				postprocessing.bokeh_uniforms[ "tDepth" ].texture = postprocessing.rtTextureDepth;
+				postprocessing.bokeh_uniforms[ "focus" ].value = 1.1;
+				postprocessing.bokeh_uniforms[ "aspect" ].value = window.innerWidth / height;
 
 
 				postprocessing.materialBokeh = new THREE.MeshShaderMaterial( {
 				postprocessing.materialBokeh = new THREE.MeshShaderMaterial( {
 
 

+ 45 - 124
examples/webgl_ribbons.html

@@ -33,6 +33,11 @@
 
 
 		<script type="text/javascript" src="../build/Three.js"></script>
 		<script type="text/javascript" src="../build/Three.js"></script>
 
 
+		<script type="text/javascript" src="js/postprocessing/EffectComposer.js"></script>
+		<script type="text/javascript" src="js/postprocessing/RenderPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/ScreenPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/BloomPass.js"></script>
+
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
@@ -57,6 +62,8 @@
 
 
 			var postprocessing = { enabled  : true };
 			var postprocessing = { enabled  : true };
 
 
+			var composer;
+
 			init();
 			init();
 			animate();
 			animate();
 
 
@@ -71,12 +78,6 @@
 				scene = new THREE.Scene();
 				scene = new THREE.Scene();
 				scene.fog = new THREE.FogExp2( 0x000000, 0.0016 );
 				scene.fog = new THREE.FogExp2( 0x000000, 0.0016 );
 
 
-				renderer = new THREE.WebGLRenderer( { antialias: false } );
-				renderer.setSize( window.innerWidth, window.innerHeight );
-				container.appendChild( renderer.domElement );
-
-				renderer.setClearColor( scene.fog.color, 1 );
-
 				geometry = new THREE.Geometry();
 				geometry = new THREE.Geometry();
 				geometry2 = new THREE.Geometry();
 				geometry2 = new THREE.Geometry();
 
 
@@ -99,12 +100,11 @@
 					vector = new THREE.Vector3( x, y, z );
 					vector = new THREE.Vector3( x, y, z );
 					geometry.vertices.push( new THREE.Vertex( vector ) );
 					geometry.vertices.push( new THREE.Vertex( vector ) );
 
 
-
 					vector = new THREE.Vector3( x, y, z );
 					vector = new THREE.Vector3( x, y, z );
 					geometry2.vertices.push( new THREE.Vertex( vector ) );
 					geometry2.vertices.push( new THREE.Vertex( vector ) );
 
 
-					h = i2%2 ? 1 : 0.15;
-					if( i2%4 <= 2 ) h -= 0.15;
+					h = i2 % 2 ? 1 : 0.15;
+					if( i2 % 4 <= 2 ) h -= 0.15;
 
 
 					color = new THREE.Color( 0xffffff );
 					color = new THREE.Color( 0xffffff );
 					color.setHSV( 0.1 , 0, h );
 					color.setHSV( 0.1 , 0, h );
@@ -116,22 +116,17 @@
 				var tmpRot = new THREE.Matrix4();
 				var tmpRot = new THREE.Matrix4();
 				tmpRot.setRotationAxis( new THREE.Vector3( 1, 0, 0 ), 1.57 );
 				tmpRot.setRotationAxis( new THREE.Vector3( 1, 0, 0 ), 1.57 );
 
 
-				var material_base = new THREE.MeshBasicMaterial( { color:0xffffff, vertexColors:true } );
-
-				renderer.initMaterial( material_base, scene.lights, scene.fog );
-
 				xgrid = 34;
 				xgrid = 34;
 				ygrid = 15;
 				ygrid = 15;
 				nribbons = xgrid * ygrid;
 				nribbons = xgrid * ygrid;
 
 
 				c = 0;
 				c = 0;
-				for ( i = 0; i < xgrid; i++ )
-				for ( j = 0; j < ygrid; j++ ) {
+				for ( i = 0; i < xgrid; i ++ )
+				for ( j = 0; j < ygrid; j ++ ) {
 
 
-					materials[c] = new THREE.MeshBasicMaterial( { color:0xffffff, vertexColors:true } );
-					//materials[c].program = material_base.program;
+					materials[ c ] = new THREE.MeshBasicMaterial( { color: 0xffffff, vertexColors: true } );
 
 
-					ribbon = new THREE.Ribbon( i % 2 ? geometry : geometry2, materials[c] );
+					ribbon = new THREE.Ribbon( i % 2 ? geometry : geometry2, materials[ c ] );
 					ribbon.rotation.x = 0;
 					ribbon.rotation.x = 0;
 					ribbon.rotation.y = 1.57;
 					ribbon.rotation.y = 1.57;
 					ribbon.rotation.z = 3.14;
 					ribbon.rotation.z = 3.14;
@@ -141,7 +136,7 @@
 					z = 0;
 					z = 0;
 					ribbon.position.set( x, y, z );
 					ribbon.position.set( x, y, z );
 
 
-					materials[c].color.setHSV( i/xgrid, 0.3 +  0.7*j/ygrid, 1 );
+					materials[c].color.setHSV( i / xgrid, 0.3 +  0.7 * j / ygrid, 1 );
 
 
 					ribbon.doubleSided = true;
 					ribbon.doubleSided = true;
 					ribbon.matrixAutoUpdate = false;
 					ribbon.matrixAutoUpdate = false;
@@ -171,24 +166,46 @@
 					ribbons.push( ribbon );
 					ribbons.push( ribbon );
 					scene.addObject( ribbon );
 					scene.addObject( ribbon );
 
 
-					c++;
+					c ++;
 
 
 				}
 				}
 
 
 				scene.matrixAutoUpdate = false;
 				scene.matrixAutoUpdate = false;
 
 
-				initPostprocessing();
+				//
+
+				renderer = new THREE.WebGLRenderer( { antialias: false } );
+				renderer.setSize( window.innerWidth, window.innerHeight );
 				renderer.autoClear = false;
 				renderer.autoClear = false;
+				renderer.setClearColor( scene.fog.color, 1 );
+
+				container.appendChild( renderer.domElement );
+
+				//
 
 
 				stats = new Stats();
 				stats = new Stats();
 				stats.domElement.style.position = 'absolute';
 				stats.domElement.style.position = 'absolute';
 				stats.domElement.style.top = '0px';
 				stats.domElement.style.top = '0px';
 				container.appendChild( stats.domElement );
 				container.appendChild( stats.domElement );
 
 
+				//
+
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
 				document.addEventListener( 'touchstart', onDocumentTouchStart, false );
 				document.addEventListener( 'touchstart', onDocumentTouchStart, false );
 				document.addEventListener( 'touchmove', onDocumentTouchMove, false );
 				document.addEventListener( 'touchmove', onDocumentTouchMove, false );
 
 
+				//
+
+				var renderModel = new THREE.RenderPass( scene, camera );
+				var effectBloom = new THREE.BloomPass( 1.0 );
+				var effectScreen = new THREE.ScreenPass();
+
+				composer = new THREE.EffectComposer( renderer );
+
+				composer.addPass( renderModel );
+				composer.addPass( effectBloom );
+				composer.addPass( effectScreen );
+
 			}
 			}
 
 
 			function onDocumentMouseMove( event ) {
 			function onDocumentMouseMove( event ) {
@@ -223,59 +240,6 @@
 
 
 			}
 			}
 
 
-			function initPostprocessing() {
-
-				postprocessing.scene = new THREE.Scene();
-
-				postprocessing.camera = new THREE.Camera();
-				postprocessing.camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
-				postprocessing.camera.position.z = 100;
-
-				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
-				postprocessing.rtTexture1 = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, pars );
-				postprocessing.rtTexture2 = new THREE.WebGLRenderTarget( 512, 512, pars );
-				postprocessing.rtTexture3 = new THREE.WebGLRenderTarget( 512, 512, pars );
-
-				var screen_shader = THREE.ShaderUtils.lib["screen"];
-				var screen_uniforms = THREE.UniformsUtils.clone( screen_shader.uniforms );
-
-				screen_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-				screen_uniforms["opacity"].value = 1.0;
-
-				postprocessing.materialScreen = new THREE.MeshShaderMaterial( {
-
-					uniforms: screen_uniforms,
-					vertexShader: screen_shader.vertexShader,
-					fragmentShader: screen_shader.fragmentShader,
-					blending: THREE.AdditiveBlending,
-					transparent: true
-
-				} );
-
-				var convolution_shader = THREE.ShaderUtils.lib["convolution"];
-				var convolution_uniforms = THREE.UniformsUtils.clone( convolution_shader.uniforms );
-
-				postprocessing.blurx = new THREE.Vector2( 0.001953125, 0.0 ),
-				postprocessing.blury = new THREE.Vector2( 0.0, 0.001953125 );
-
-				convolution_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-				convolution_uniforms["uImageIncrement"].value = postprocessing.blurx;
-				convolution_uniforms["cKernel"].value = THREE.ShaderUtils.buildKernel( 4.0 );
-
-				postprocessing.materialConvolution = new THREE.MeshShaderMaterial( {
-
-					uniforms: convolution_uniforms,
-					vertexShader:   "#define KERNEL_SIZE 25.0\n" + convolution_shader.vertexShader,
-					fragmentShader: "#define KERNEL_SIZE 25\n"   + convolution_shader.fragmentShader
-
-				} );
-
-				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
-				postprocessing.quad.position.z = -500;
-				postprocessing.scene.addObject( postprocessing.quad );
-
-			}
-
 			//
 			//
 
 
 			function animate() {
 			function animate() {
@@ -294,73 +258,30 @@
 				camera.position.x += ( mouseX - camera.position.x ) * 0.036;
 				camera.position.x += ( mouseX - camera.position.x ) * 0.036;
 				camera.position.y += ( - (mouseY) - camera.position.y ) * 0.036;
 				camera.position.y += ( - (mouseY) - camera.position.y ) * 0.036;
 
 
-				for ( i = -n; i < n; i++ ) {
+				for ( i = -n; i < n; i ++ ) {
 
 
 					i2 = i + n;
 					i2 = i + n;
 
 
 					z  =  10 * Math.sin( i2 * 0.1 + time*30 );
 					z  =  10 * Math.sin( i2 * 0.1 + time*30 );
 					z2 =  20 * Math.cos( Math.sin( i2 * 0.1 + time * 20 ) );
 					z2 =  20 * Math.cos( Math.sin( i2 * 0.1 + time * 20 ) );
 
 
-					geometry.vertices[i2].position.z = z;
-					geometry2.vertices[i2].position.z = z2;
+					geometry.vertices[ i2 ].position.z = z;
+					geometry2.vertices[ i2 ].position.z = z2;
 
 
 				}
 				}
 
 
 				geometry.__dirtyVertices = true;
 				geometry.__dirtyVertices = true;
 				geometry2.__dirtyVertices = true;
 				geometry2.__dirtyVertices = true;
 
 
-
 				for( i = 0; i < nribbons; i++ ) {
 				for( i = 0; i < nribbons; i++ ) {
 
 
-					h = ( 360 * ( i/nribbons + time ) % 360 ) / 360;
-					materials[i].color.setHSV( h, 0.5+0.5*(i%20/20), 1 );
+					h = ( 360 * ( i / nribbons + time ) % 360 ) / 360;
+					materials[ i ].color.setHSV( h, 0.5 + 0.5 * ( i % 20 / 20 ), 1 );
 
 
 				}
 				}
 
 
-				if ( postprocessing.enabled ) {
-
-					renderer.clear();
-
-					// Render scene into texture
-
-					renderer.render( scene, camera, postprocessing.rtTexture1, true );
-
-					// Render quad with blured scene into texture (convolution pass 1)
-
-					postprocessing.quad.materials = [ postprocessing.materialConvolution ];
-
-					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
-					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blurx;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2, true );
-
-					// Render quad with blured scene into texture (convolution pass 2)
-
-					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture2;
-					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blury;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3, true );
-
-					// Render original scene with superimposed blur to texture
-
-					postprocessing.quad.materials = [ postprocessing.materialScreen ];
-
-					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture3;
-					postprocessing.materialScreen.uniforms.opacity.value = 1.2;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1, false );
-
-					// Render to screen
-
-					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
-					renderer.render( postprocessing.scene, postprocessing.camera );
-
-				} else {
-
-					renderer.clear();
-					renderer.render( scene, camera );
-
-				}
+				renderer.clear();
+				composer.render( 0.1 );
 
 
 			}
 			}
 
 

+ 26 - 36
examples/webgl_rtt.html

@@ -39,24 +39,25 @@
 		<script type="text/javascript" src="js/Stats.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
 
 
 		<script id="fragment_shader_screen" type="x-shader/x-fragment">
 		<script id="fragment_shader_screen" type="x-shader/x-fragment">
+
 			varying vec2 vUv;
 			varying vec2 vUv;
 			uniform sampler2D tDiffuse;
 			uniform sampler2D tDiffuse;
 
 
-			void main(void) {
+			void main() {
 
 
-				//gl_FragColor = texture2D( tDiffuse, vec2( vUv.x, 1.0 - vUv.y ) );
 				gl_FragColor = texture2D( tDiffuse, vUv );
 				gl_FragColor = texture2D( tDiffuse, vUv );
 
 
 			}
 			}
+
 		</script>
 		</script>
 
 
 		<script id="fragment_shader_pass_1" type="x-shader/x-fragment">
 		<script id="fragment_shader_pass_1" type="x-shader/x-fragment">
+
 			varying vec2 vUv;
 			varying vec2 vUv;
 			uniform float time;
 			uniform float time;
 
 
-			void main(void) {
+			void main() {
 
 
-				//gl_FragColor = vec4( time, vUv.x, vUv.y, 1.0 );
 				float r = vUv.x;
 				float r = vUv.x;
 				if( vUv.y < 0.5 ) r = 0.0;
 				if( vUv.y < 0.5 ) r = 0.0;
 				float g = vUv.y;
 				float g = vUv.y;
@@ -65,18 +66,20 @@
 				gl_FragColor = vec4( r, g, time, 1.0 );
 				gl_FragColor = vec4( r, g, time, 1.0 );
 
 
 			}
 			}
+
 		</script>
 		</script>
 
 
 		<script id="vertexShader" type="x-shader/x-vertex">
 		<script id="vertexShader" type="x-shader/x-vertex">
+
 			varying vec2 vUv;
 			varying vec2 vUv;
 
 
 			void main() {
 			void main() {
 
 
 				vUv = uv;
 				vUv = uv;
-				//gl_Position = vec4( position, 1.0 );
 				gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
 				gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
 
 
 			}
 			}
+
 		</script>
 		</script>
 
 
 
 
@@ -104,8 +107,7 @@
 
 
 				container = document.getElementById( 'container' );
 				container = document.getElementById( 'container' );
 
 
-				cameraRTT = new THREE.Camera();
-				cameraRTT.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
+				cameraRTT = new THREE.OrthoCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
 				cameraRTT.position.z = 100;
 				cameraRTT.position.z = 100;
 
 
 				camera = new THREE.Camera( 30, window.innerWidth / window.innerHeight, 1, 10000 );
 				camera = new THREE.Camera( 30, window.innerWidth / window.innerHeight, 1, 10000 );
@@ -117,16 +119,12 @@
 				sceneScreen = new THREE.Scene();
 				sceneScreen = new THREE.Scene();
 
 
 				var light = new THREE.DirectionalLight( 0xffffff );
 				var light = new THREE.DirectionalLight( 0xffffff );
-				light.position.x = 0;
-				light.position.y = 0;
-				light.position.z = 1;
+				light.position.set( 0, 0, 1 );
 				light.position.normalize();
 				light.position.normalize();
 				sceneRTT.addLight( light );
 				sceneRTT.addLight( light );
 
 
 				light = new THREE.DirectionalLight( 0xffaaaa, 1.5 );
 				light = new THREE.DirectionalLight( 0xffaaaa, 1.5 );
-				light.position.x = 0;
-				light.position.y = 0;
-				light.position.z = -1;
+				light.position.set( 0, 0, -1 );
 				light.position.normalize();
 				light.position.normalize();
 				sceneRTT.addLight( light );
 				sceneRTT.addLight( light );
 
 
@@ -148,16 +146,13 @@
 
 
 				} );
 				} );
 
 
-				// var mt = new THREE.MeshBasicMaterial( { color:0xffffff, map: ImageUtils.loadTexture( "textures/land_ocean_ice_cloud_2048.jpg" ) } );
-
 				var plane = new THREE.PlaneGeometry( window.innerWidth, window.innerHeight );
 				var plane = new THREE.PlaneGeometry( window.innerWidth, window.innerHeight );
 
 
 				quad = new THREE.Mesh( plane, material );
 				quad = new THREE.Mesh( plane, material );
 				quad.position.z = -100;
 				quad.position.z = -100;
 				sceneRTT.addObject( quad );
 				sceneRTT.addObject( quad );
 
 
-				var loader = new THREE.BinaryLoader();
-				loader.load( { model: "obj/torus/Torus_bin.js", callback: function( geometry ) { createMesh( geometry, sceneRTT ) } } );
+				createMesh( new THREE.TorusGeometry( 100, 25, 15, 30 ), sceneRTT );
 
 
 				quad = new THREE.Mesh( plane, materialScreen );
 				quad = new THREE.Mesh( plane, materialScreen );
 				quad.position.z = -100;
 				quad.position.z = -100;
@@ -166,17 +161,19 @@
 				var n = 5,
 				var n = 5,
 					geometry = new THREE.SphereGeometry( 10, 64, 32 ),
 					geometry = new THREE.SphereGeometry( 10, 64, 32 ),
 					material2 = new THREE.MeshLambertMaterial( { color:0xffffff, map: rtTexture } );
 					material2 = new THREE.MeshLambertMaterial( { color:0xffffff, map: rtTexture } );
-					//material2 = new THREE.MeshBasicMaterial( { color:0xffffff, map: rtTexture } );
 
 
-				for( var j = 0; j < n; j++ ) {
+				for( var j = 0; j < n; j ++ ) {
 
 
-					for( var i = 0; i < n; i++ ) {
+					for( var i = 0; i < n; i ++ ) {
 
 
 						mesh = new THREE.Mesh( geometry, material2 );
 						mesh = new THREE.Mesh( geometry, material2 );
+
 						mesh.position.x = ( i - (n-1)/2 ) * 20;
 						mesh.position.x = ( i - (n-1)/2 ) * 20;
 						mesh.position.y = ( j - (n-1)/2 ) * 20;
 						mesh.position.y = ( j - (n-1)/2 ) * 20;
 						mesh.position.z = 0;
 						mesh.position.z = 0;
+
 						mesh.rotation.y = 1.57;
 						mesh.rotation.y = 1.57;
+
 						scene.addObject( mesh );
 						scene.addObject( mesh );
 
 
 					}
 					}
@@ -185,6 +182,7 @@
 				renderer = new THREE.WebGLRenderer();
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 				renderer.autoClear = false;
 				renderer.autoClear = false;
+
 				container.appendChild( renderer.domElement );
 				container.appendChild( renderer.domElement );
 
 
 				stats = new Stats();
 				stats = new Stats();
@@ -198,21 +196,17 @@
 
 
 			function createMesh( geometry, xscene ) {
 			function createMesh( geometry, xscene ) {
 
 
-				var mat1 = new THREE.MeshPhongMaterial( { color: 0x555555, specular:0xffaa00, shininess:5 } ),
-					mat2 = new THREE.MeshPhongMaterial( { color: 0x550000, specular:0xff2200, shininess:5 } );
+				var mat1 = new THREE.MeshPhongMaterial( { color: 0x555555, specular: 0xffaa00, shininess: 5 } ),
+					mat2 = new THREE.MeshPhongMaterial( { color: 0x550000, specular: 0xff2200, shininess: 5 } );
 
 
 				zmesh1 = new THREE.Mesh( geometry, mat1 );
 				zmesh1 = new THREE.Mesh( geometry, mat1 );
-				zmesh1.position.x = 0;
-				zmesh1.position.y = 0;
-				zmesh1.position.z = 100;
-				zmesh1.scale.x = zmesh1.scale.y = zmesh1.scale.z = 150;
+				zmesh1.position.set( 0, 0, 100 );
+				zmesh1.scale.set( 1.5, 1.5, 1.5 );
 				xscene.addObject( zmesh1 );
 				xscene.addObject( zmesh1 );
 
 
 				zmesh2 = new THREE.Mesh( geometry, mat2 );
 				zmesh2 = new THREE.Mesh( geometry, mat2 );
-				zmesh2.position.x = 0;
-				zmesh2.position.y = 150;
-				zmesh2.position.z = 100;
-				zmesh2.scale.x = zmesh2.scale.y = zmesh2.scale.z = 75;
+				zmesh2.position.set( 0, 150, 100 );
+				zmesh2.scale.set( 0.75, 0.75, 0.75 );
 				xscene.addObject( zmesh2 );
 				xscene.addObject( zmesh2 );
 
 
 			}
 			}
@@ -244,11 +238,8 @@
 
 
 				if ( zmesh1 && zmesh2 ) {
 				if ( zmesh1 && zmesh2 ) {
 
 
-					zmesh1.rotation.x = 1.57;
-					zmesh1.rotation.z = time;
-
-					zmesh2.rotation.z = 1.57;
-					zmesh2.rotation.y = -time;
+					zmesh1.rotation.y = - time;
+					zmesh2.rotation.y = - time + Math.PI / 2;
 
 
 				}
 				}
 
 
@@ -271,7 +262,6 @@
 
 
 				renderer.enableDepthBufferWrite( false );
 				renderer.enableDepthBufferWrite( false );
 				renderer.render( sceneScreen, cameraRTT );
 				renderer.render( sceneScreen, cameraRTT );
-				//renderer.render( sceneRTT, cameraRTT );
 				renderer.enableDepthBufferWrite( true );
 				renderer.enableDepthBufferWrite( true );
 
 
 				// Render second scene to screen
 				// Render second scene to screen

+ 12 - 9
examples/webgl_sandbox.html

@@ -58,9 +58,8 @@
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
 		<script type="text/javascript" src="../src/lights/PointLight.js"></script>
 		<script type="text/javascript" src="../src/lights/PointLight.js"></script>
-		<script type="text/javascript" src="../src/lights/LensFlare.js"></script>
+		<script type="text/javascript" src="../src/lights/SpotLight.js"></script>
 		<script type="text/javascript" src="../src/materials/Material.js"></script>
 		<script type="text/javascript" src="../src/materials/Material.js"></script>
-		<script type="text/javascript" src="../src/materials/Mappings.js"></script>
 		<script type="text/javascript" src="../src/materials/LineBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/LineBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshLambertMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshLambertMaterial.js"></script>
@@ -69,11 +68,11 @@
 		<script type="text/javascript" src="../src/materials/MeshNormalMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshNormalMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshFaceMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshFaceMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshShaderMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshShaderMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/ShadowVolumeDynamicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleCanvasMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleCanvasMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleDOMMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleDOMMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/Texture.js"></script>
+		<script type="text/javascript" src="../src/textures/Texture.js"></script>
+		<script type="text/javascript" src="../src/textures/DataTexture.js"></script>
 		<script type="text/javascript" src="../src/objects/Particle.js"></script>
 		<script type="text/javascript" src="../src/objects/Particle.js"></script>
 		<script type="text/javascript" src="../src/objects/ParticleSystem.js"></script>
 		<script type="text/javascript" src="../src/objects/ParticleSystem.js"></script>
 		<script type="text/javascript" src="../src/objects/Line.js"></script>
 		<script type="text/javascript" src="../src/objects/Line.js"></script>
@@ -82,7 +81,6 @@
 		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
 		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
 		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
 		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
 		<script type="text/javascript" src="../src/objects/LOD.js"></script>
 		<script type="text/javascript" src="../src/objects/LOD.js"></script>
-		<script type="text/javascript" src="../src/objects/ShadowVolume.js"></script>
 		<script type="text/javascript" src="../src/objects/Sprite.js"></script>
 		<script type="text/javascript" src="../src/objects/Sprite.js"></script>
 		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
 		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
 		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
 		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
@@ -94,6 +92,7 @@
 		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderTarget.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderTarget.js"></script>
+		<script type="text/javascript" src="../src/renderers/WebGLRenderTargetCube.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableVertex.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableVertex.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace3.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace3.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace4.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace4.js"></script>
@@ -113,8 +112,11 @@
 		<script type="text/javascript" src="../src/extras/cameras/RollCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/RollCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/TrackballCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/TrackballCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/Curve.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/CurvePath.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Path.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Path.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Shape.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/Shape.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TextPath.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CubeGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CubeGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CylinderGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/CylinderGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/ExtrudeGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/ExtrudeGeometry.js"></script>
@@ -125,10 +127,11 @@
 		<script type="text/javascript" src="../src/extras/geometries/TextGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TextGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusKnotGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/TorusKnotGeometry.js"></script>
-		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
-		<script type="text/javascript" src="../src/extras/io/JSONLoader.js"></script>
-		<script type="text/javascript" src="../src/extras/io/BinaryLoader.js"></script>
-		<script type="text/javascript" src="../src/extras/io/SceneLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/Loader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/JSONLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/BinaryLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/SceneLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/UTF8Loader.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/Trident.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/Trident.js"></script>
 		<script type="text/javascript" src="../src/extras/physics/Collisions.js"></script>
 		<script type="text/javascript" src="../src/extras/physics/Collisions.js"></script>

+ 29 - 115
examples/webgl_shader_lava.html

@@ -37,6 +37,11 @@
 
 
 		<script type="text/javascript" src="../build/Three.js"></script>
 		<script type="text/javascript" src="../build/Three.js"></script>
 
 
+		<script type="text/javascript" src="js/postprocessing/EffectComposer.js"></script>
+		<script type="text/javascript" src="js/postprocessing/RenderPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/BloomPass.js"></script>
+		<script type="text/javascript" src="js/postprocessing/FilmPass.js"></script>
+
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
@@ -86,6 +91,7 @@
 				gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );
 				gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );
 
 
 			}
 			}
+
 		</script>
 		</script>
 
 
 		<script id="vertexShader" type="x-shader/x-vertex">
 		<script id="vertexShader" type="x-shader/x-vertex">
@@ -112,7 +118,7 @@
 
 
 			var start_time;
 			var start_time;
 
 
-			var camera, scene, renderer;
+			var camera, scene, renderer, composer;
 
 
 			var uniforms, material, mesh;
 			var uniforms, material, mesh;
 
 
@@ -122,8 +128,6 @@
 			var windowHalfX = window.innerWidth / 2;
 			var windowHalfX = window.innerWidth / 2;
 			var windowHalfY = window.innerHeight / 2;
 			var windowHalfY = window.innerHeight / 2;
 
 
-			var postprocessing = { enabled : true };
-
 			init();
 			init();
 			animate();
 			animate();
 
 
@@ -169,18 +173,35 @@
 				mesh.rotation.x = 0.3;
 				mesh.rotation.x = 0.3;
 				scene.addObject( mesh );
 				scene.addObject( mesh );
 
 
+				//
 
 
 				renderer = new THREE.WebGLRenderer( { antialias: true } );
 				renderer = new THREE.WebGLRenderer( { antialias: true } );
 				container.appendChild( renderer.domElement );
 				container.appendChild( renderer.domElement );
-
-				initPostprocessing();
 				renderer.autoClear = false;
 				renderer.autoClear = false;
 
 
+				//
+
 				stats = new Stats();
 				stats = new Stats();
 				stats.domElement.style.position = 'absolute';
 				stats.domElement.style.position = 'absolute';
 				stats.domElement.style.top = '0px';
 				stats.domElement.style.top = '0px';
 				//container.appendChild( stats.domElement );
 				//container.appendChild( stats.domElement );
 
 
+				//
+
+				var renderModel = new THREE.RenderPass( scene, camera );
+				var effectBloom = new THREE.BloomPass( 1.25 );
+				var effectFilm = new THREE.FilmPass( 0.35, 0.95, 2048, false );
+
+				effectFilm.renderToScreen = true;
+
+				composer = new THREE.EffectComposer( renderer );
+
+				composer.addPass( renderModel );
+				composer.addPass( effectBloom );
+				composer.addPass( effectFilm );
+
+				//
+
 				onWindowResize();
 				onWindowResize();
 
 
 				window.addEventListener( 'resize', onWindowResize, false );
 				window.addEventListener( 'resize', onWindowResize, false );
@@ -197,69 +218,7 @@
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.updateProjectionMatrix();
 				camera.updateProjectionMatrix();
 
 
-			}
-
-			function initPostprocessing() {
-
-				postprocessing.scene = new THREE.Scene();
-
-				postprocessing.camera = new THREE.Camera();
-				postprocessing.camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
-				postprocessing.camera.position.z = 100;
-
-				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
-				postprocessing.rtTexture1 = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, pars );
-				postprocessing.rtTexture2 = new THREE.WebGLRenderTarget( 512, 512, pars );
-				postprocessing.rtTexture3 = new THREE.WebGLRenderTarget( 512, 512, pars );
-
-				var screen_shader = THREE.ShaderUtils.lib["screen"];
-				var screen_uniforms = THREE.UniformsUtils.clone( screen_shader.uniforms );
-
-				screen_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-				screen_uniforms["opacity"].value = 1.0;
-
-				postprocessing.materialScreen = new THREE.MeshShaderMaterial( {
-
-					uniforms: screen_uniforms,
-					vertexShader: screen_shader.vertexShader,
-					fragmentShader: screen_shader.fragmentShader,
-					blending: THREE.AdditiveBlending,
-					transparent: true
-
-				} );
-
-				var convolution_shader = THREE.ShaderUtils.lib["convolution"];
-				var convolution_uniforms = THREE.UniformsUtils.clone( convolution_shader.uniforms );
-
-				postprocessing.blurx = new THREE.Vector2( 0.001953125, 0.0 ),
-				postprocessing.blury = new THREE.Vector2( 0.0, 0.001953125 );
-
-				convolution_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-				convolution_uniforms["uImageIncrement"].value = postprocessing.blurx;
-				convolution_uniforms["cKernel"].value = THREE.ShaderUtils.buildKernel( 4.0 );
-
-				postprocessing.materialConvolution = new THREE.MeshShaderMaterial( {
-
-					uniforms: convolution_uniforms,
-					vertexShader:   "#define KERNEL_SIZE 25.0\n" + convolution_shader.vertexShader,
-					fragmentShader: "#define KERNEL_SIZE 25\n"   + convolution_shader.fragmentShader
-
-				} );
-
-				var film_shader = THREE.ShaderUtils.lib["film"];
-				var film_uniforms = THREE.UniformsUtils.clone( film_shader.uniforms );
-
-				film_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-
-				postprocessing.materialFilm = new THREE.MeshShaderMaterial( { uniforms: film_uniforms, vertexShader: film_shader.vertexShader, fragmentShader: film_shader.fragmentShader } );
-				postprocessing.materialFilm.uniforms.grayscale.value = 0;
-				postprocessing.materialFilm.uniforms.nIntensity.value = 0.35;
-				postprocessing.materialFilm.uniforms.sIntensity.value = 0.95;
-				postprocessing.materialFilm.uniforms.sCount.value = 2048;
-
-				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
-				postprocessing.quad.position.z = - 500;
-				postprocessing.scene.addObject( postprocessing.quad );
+				composer.reset();
 
 
 			}
 			}
 
 
@@ -281,53 +240,8 @@
 				mesh.rotation.y += 0.00125;
 				mesh.rotation.y += 0.00125;
 				mesh.rotation.x += 0.005;
 				mesh.rotation.x += 0.005;
 
 
-				if ( postprocessing.enabled ) {
-
-					renderer.clear();
-
-					// Render scene into texture
-
-					renderer.render( scene, camera, postprocessing.rtTexture1, true );
-
-					// Render quad with blured scene into texture (convolution pass 1)
-
-					postprocessing.quad.materials = [ postprocessing.materialConvolution ];
-
-					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
-					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blurx;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2, true );
-
-					// Render quad with blured scene into texture (convolution pass 2)
-
-					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture2;
-					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blury;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3, true );
-
-					// Render original scene with superimposed blur to texture
-
-					postprocessing.quad.materials = [ postprocessing.materialScreen ];
-
-					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture3;
-					postprocessing.materialScreen.uniforms.opacity.value = 1.25;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1, false );
-
-					// Render to screen
-
-					postprocessing.materialFilm.uniforms.time.value += 0.01;
-					postprocessing.quad.materials = [ postprocessing.materialFilm ];
-
-					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
-					renderer.render( postprocessing.scene, postprocessing.camera );
-
-				} else {
-
-					renderer.clear();
-					renderer.render( scene, camera );
-
-				}
+				renderer.clear();
+				composer.render( 0.01 );
 
 
 			}
 			}
 
 

+ 1 - 2
examples/webgl_shadowmap.html

@@ -135,8 +135,7 @@
 
 
 			function createHUD() {
 			function createHUD() {
 
 
-				cameraOrtho = new THREE.Camera( 45, SHADOW_MAP_WIDTH / SHADOW_MAP_HEIGHT, NEAR, FAR );
-				cameraOrtho.projectionMatrix = THREE.Matrix4.makeOrtho( SCREEN_WIDTH / - 2, SCREEN_WIDTH / 2,  SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, -10, 1000 );
+				cameraOrtho = new THREE.OrthoCamera( SCREEN_WIDTH / - 2, SCREEN_WIDTH / 2,  SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, -10, 1000 );
 				cameraOrtho.position.z = 10;
 				cameraOrtho.position.z = 10;
 
 
 				var shader = THREE.ShaderUtils.lib[ "screen" ];
 				var shader = THREE.ShaderUtils.lib[ "screen" ];

+ 26 - 0
src/cameras/OrthoCamera.js

@@ -0,0 +1,26 @@
+/**
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.OrthoCamera = function ( left, right, top, bottom, near, far, target ) {
+
+	THREE.Camera.call( this, 45, 1, near, far, target );
+
+	this.left = left;
+	this.right = right;
+	this.top = top;
+	this.bottom = bottom;
+
+	this.updateProjectionMatrix();
+
+};
+
+THREE.OrthoCamera.prototype = new THREE.Camera();
+THREE.OrthoCamera.prototype.constructor = THREE.OrthoCamera;
+
+THREE.OrthoCamera.prototype.updateProjectionMatrix = function () {
+
+	this.projectionMatrix = THREE.Matrix4.makeOrtho( this.left, this.right, this.top, this.bottom, this.near, this.far );
+
+};
+

+ 22 - 11
src/core/Ray.js

@@ -40,9 +40,9 @@ THREE.Ray.prototype = {
 
 
 		if ( object instanceof THREE.Particle ) {
 		if ( object instanceof THREE.Particle ) {
 
 
-			var distance = distanceFromIntersection( this.origin, this.direction, object );
+			var distance = distanceFromIntersection( this.origin, this.direction, object.matrixWorld.getPosition() );
 
 
-			if ( ! distance || distance > object.scale.x ) {
+			if ( distance == null || distance > object.scale.x ) {
 
 
 				return [];
 				return [];
 
 
@@ -61,9 +61,9 @@ THREE.Ray.prototype = {
 
 
 			// Checking boundingSphere
 			// Checking boundingSphere
 
 
-			var distance = distanceFromIntersection( this.origin, this.direction, object );
+			var distance = distanceFromIntersection( this.origin, this.direction, object.matrixWorld.getPosition() );
 
 
-			if ( ! distance || distance > object.geometry.boundingSphere.radius * Math.max( object.scale.x, Math.max( object.scale.y, object.scale.z ) ) ) {
+			if ( distance == null || distance > object.geometry.boundingSphere.radius * Math.max( object.scale.x, Math.max( object.scale.y, object.scale.z ) ) ) {
 
 
 				return [];
 				return [];
 
 
@@ -71,8 +71,9 @@ THREE.Ray.prototype = {
 
 
 			// Checking faces
 			// Checking faces
 
 
-			var f, fl, face, a, b, c, d, normal,
-			dot, scalar,
+			var f, fl, face,
+			a, b, c, d, normal,
+			vector, dot, scalar,
 			origin, direction,
 			origin, direction,
 			geometry = object.geometry,
 			geometry = object.geometry,
 			vertices = geometry.vertices,
 			vertices = geometry.vertices,
@@ -89,6 +90,15 @@ THREE.Ray.prototype = {
 
 
 				objMatrix = object.matrixWorld;
 				objMatrix = object.matrixWorld;
 
 
+				// check if face.centroid is behind the origin
+
+				vector = objMatrix.multiplyVector3( face.centroid.clone() ).subSelf( origin );
+				dot = vector.dot( direction );
+
+				if ( dot <= 0 ) continue;
+
+				//
+
 				a = objMatrix.multiplyVector3( vertices[ face.a ].position.clone() );
 				a = objMatrix.multiplyVector3( vertices[ face.a ].position.clone() );
 				b = objMatrix.multiplyVector3( vertices[ face.b ].position.clone() );
 				b = objMatrix.multiplyVector3( vertices[ face.b ].position.clone() );
 				c = objMatrix.multiplyVector3( vertices[ face.c ].position.clone() );
 				c = objMatrix.multiplyVector3( vertices[ face.c ].position.clone() );
@@ -142,6 +152,8 @@ THREE.Ray.prototype = {
 
 
 			}
 			}
 
 
+			intersects.sort( function ( a, b ) { return a.distance - b.distance; } );
+
 			return intersects;
 			return intersects;
 
 
 		} else {
 		} else {
@@ -150,19 +162,18 @@ THREE.Ray.prototype = {
 
 
 		}
 		}
 
 
-		function distanceFromIntersection( origin, direction, object ) {
+		function distanceFromIntersection( origin, direction, position ) {
 
 
-			var vector, dot, intersect, distance,
-			position = object.matrixWorld.getPosition();
+			var vector, dot, intersect, distance;
 
 
 			vector = position.clone().subSelf( origin );
 			vector = position.clone().subSelf( origin );
 			dot = vector.dot( direction );
 			dot = vector.dot( direction );
 
 
+			if ( dot <= 0 ) return null; // check if position behind origin.
+
 			intersect = origin.clone().addSelf( direction.clone().multiplyScalar( dot ) );
 			intersect = origin.clone().addSelf( direction.clone().multiplyScalar( dot ) );
 			distance = position.distanceTo( intersect );
 			distance = position.distanceTo( intersect );
 
 
-			// TODO: Check if distance is negative (object behind camera).			
-			
 			return distance;
 			return distance;
 
 
 		}
 		}

+ 9 - 11
src/core/UV.js

@@ -4,12 +4,8 @@
 
 
 THREE.UV = function ( u, v ) {
 THREE.UV = function ( u, v ) {
 
 
-	this.set(
-
-		u || 0,
-		v || 0
-
-	);
+	this.u = u || 0;
+	this.v = v || 0;
 
 
 };
 };
 
 
@@ -28,14 +24,16 @@ THREE.UV.prototype = {
 
 
 	copy: function ( uv ) {
 	copy: function ( uv ) {
 
 
-		this.set(
+		this.u = uv.u;
+		this.v = uv.v;
+
+		return this;
 
 
-			uv.u,
-			uv.v
+	},
 
 
-		);
+	clone: function () {
 
 
-		return this;
+		return new THREE.UV( this.u, this.v );
 
 
 	}
 	}
 
 

+ 3 - 19
src/core/Vector2.js

@@ -7,12 +7,8 @@
 
 
 THREE.Vector2 = function ( x, y ) {
 THREE.Vector2 = function ( x, y ) {
 
 
-	this.set(
-
-		x || 0,
-		y || 0
-
-	);
+	this.x = x || 0;
+	this.y = y || 0;
 
 
 };
 };
 
 
@@ -137,7 +133,7 @@ THREE.Vector2.prototype = {
 		return this.divideScalar( this.length() );
 		return this.divideScalar( this.length() );
 
 
 	},
 	},
-	
+
 	distanceTo: function ( v ) {
 	distanceTo: function ( v ) {
 
 
 		return Math.sqrt( this.distanceToSquared( v ) );
 		return Math.sqrt( this.distanceToSquared( v ) );
@@ -158,18 +154,6 @@ THREE.Vector2.prototype = {
 
 
 	},
 	},
 
 
-	// deprecated: same as normalize
-
-	unit: function () {
-
-		return this.normalize();
-
-	},
-	
-	// danger, works only on numbers which are exactly the same
-	// (which may be not what is expected thanks to floating point precision)
-	// (should be probably using some tiny epsilon instead of equality)
-	
 	equals: function( v ) {
 	equals: function( v ) {
 
 
 		return ( ( v.x == this.x ) && ( v.y == this.y ) );
 		return ( ( v.x == this.x ) && ( v.y == this.y ) );

+ 8 - 8
src/core/Vector3.js

@@ -8,13 +8,9 @@
 
 
 THREE.Vector3 = function ( x, y, z ) {
 THREE.Vector3 = function ( x, y, z ) {
 
 
-	this.set(
-
-		x || 0,
-		y || 0,
-		z || 0
-
-	);
+	this.x = x || 0;
+	this.y = y || 0;
+	this.z = z || 0;
 
 
 };
 };
 
 
@@ -132,7 +128,11 @@ THREE.Vector3.prototype = {
 
 
 	divideSelf: function ( v ) {
 	divideSelf: function ( v ) {
 
 
-		return this.divide( this, v );
+		this.x /= v.x;
+		this.y /= v.y;
+		this.z /= v.z;
+
+		return this;
 
 
 	},
 	},
 
 

+ 16 - 21
src/core/Vector4.js

@@ -7,14 +7,10 @@
 
 
 THREE.Vector4 = function ( x, y, z, w ) {
 THREE.Vector4 = function ( x, y, z, w ) {
 
 
-	this.set(
-
-		x || 0,
-		y || 0,
-		z || 0,
-		w || 1
-
-	);
+	this.x = x || 0;
+	this.y = y || 0;
+	this.z = z || 0;
+	this.w = w || 1;
 
 
 };
 };
 
 
@@ -35,14 +31,10 @@ THREE.Vector4.prototype = {
 
 
 	copy: function ( v ) {
 	copy: function ( v ) {
 
 
-		return this.set(
-
-			v.x,
-			v.y,
-			v.z,
-			v.w || 1.0
-
-		);
+		this.x = v.x;
+		this.y = v.y;
+		this.z = v.z;
+		this.w = v.w || 1;
 
 
 	},
 	},
 
 
@@ -119,7 +111,10 @@ THREE.Vector4.prototype = {
 
 
 		} else {
 		} else {
 
 
-			this.set( 0, 0, 0, 1 );
+			this.x = 0;
+			this.y = 0;
+			this.z = 0;
+			this.w = 1;
 
 
 		}
 		}
 
 
@@ -167,10 +162,10 @@ THREE.Vector4.prototype = {
 
 
 	lerpSelf: function ( v, alpha ) {
 	lerpSelf: function ( v, alpha ) {
 
 
-		this.x += (v.x - this.x) * alpha;
-		this.y += (v.y - this.y) * alpha;
-		this.z += (v.z - this.z) * alpha;
-		this.w += (v.w - this.w) * alpha;
+		this.x += ( v.x - this.x ) * alpha;
+		this.y += ( v.y - this.y ) * alpha;
+		this.z += ( v.z - this.z ) * alpha;
+		this.w += ( v.w - this.w ) * alpha;
 
 
 		return this;
 		return this;
 
 

+ 181 - 1
src/extras/ShaderUtils.js

@@ -562,6 +562,186 @@ THREE.ShaderUtils = {
 
 
 		},
 		},
 
 
+
+		/* -------------------------------------------------------------------------
+		//	Sepia tone shader
+		//  - based on glfx.js sepia shader
+		//		https://github.com/evanw/glfx.js
+		 ------------------------------------------------------------------------- */
+
+		'sepia': {
+
+			uniforms: {
+
+				tDiffuse: { type: "t", value: 0, texture: null },
+				amount:   { type: "f", value: 1.0 }
+
+			},
+
+			vertexShader: [
+
+				"varying vec2 vUv;",
+
+				"void main() {",
+
+					"vUv = vec2( uv.x, 1.0 - uv.y );",
+					"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+
+				"}"
+
+			].join("\n"),
+
+			fragmentShader: [
+
+				"uniform float amount;",
+
+				"varying vec2 vUv;",
+				"uniform sampler2D tDiffuse;",
+
+				"void main() {",
+
+					"vec4 color = texture2D( tDiffuse, vUv );",
+					"vec3 c = color.rgb;",
+
+					"color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );",
+					"color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );",
+					"color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );",
+
+					"gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );",
+
+				"}"
+
+			].join("\n")
+
+		},
+
+		/* -------------------------------------------------------------------------
+		//	Dot screen shader
+		//  - based on glfx.js sepia shader
+		//		https://github.com/evanw/glfx.js
+		 ------------------------------------------------------------------------- */
+
+		'dotscreen': {
+
+			uniforms: {
+
+				tDiffuse: { type: "t", value: 0, texture: null },
+				tSize:    { type: "v2", value: new THREE.Vector2( 256, 256 ) },
+				center:   { type: "v2", value: new THREE.Vector2( 0.5, 0.5 ) },
+				angle:	  { type: "f", value: 1.57 },
+				scale:	  { type: "f", value: 1.0 }
+
+			},
+
+			vertexShader: [
+
+				"varying vec2 vUv;",
+
+				"void main() {",
+
+					"vUv = vec2( uv.x, 1.0 - uv.y );",
+					"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+
+				"}"
+
+			].join("\n"),
+
+			fragmentShader: [
+
+				"uniform vec2 center;",
+				"uniform float angle;",
+				"uniform float scale;",
+				"uniform vec2 tSize;",
+
+				"varying vec2 vUv;",
+				"uniform sampler2D tDiffuse;",
+
+				"float pattern() {",
+
+					"float s = sin( angle ), c = cos( angle );",
+
+					"vec2 tex = vUv * tSize - center;",
+					"vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;",
+
+					"return ( sin( point.x ) * sin( point.y ) ) * 4.0;",
+
+				"}",
+
+				"void main() {",
+
+					"vec4 color = texture2D( tDiffuse, vUv );",
+
+					"float average = ( color.r + color.g + color.b ) / 3.0;",
+
+					"gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );",
+
+				"}"
+
+			].join("\n")
+
+		},
+
+		/* ------------------------------------------------------------------------------------------------
+		//	Vignette shader
+		//	- based on PaintEffect postprocess from ro.me
+		//		http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js
+		 ------------------------------------------------------------------------------------------------ */
+
+		'vignette': {
+
+			uniforms: {
+
+				tDiffuse: { type: "t", value: 0, texture: null },
+				offset:   { type: "f", value: 1.0 },
+				darkness: { type: "f", value: 1.0 }
+
+			},
+
+			vertexShader: [
+
+				"varying vec2 vUv;",
+
+				"void main() {",
+
+					"vUv = vec2( uv.x, 1.0 - uv.y );",
+					"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+
+				"}"
+
+			].join("\n"),
+
+			fragmentShader: [
+
+				"uniform float offset;",
+				"uniform float darkness;",
+
+				"varying vec2 vUv;",
+				"uniform sampler2D tDiffuse;",
+
+				"void main() {",
+
+					// Eskil's vignette
+
+					"vec4 texel = texture2D( tDiffuse, vUv );",
+					"vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );",
+					"gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );",
+
+					/*
+					// alternative version from glfx.js
+					// this one makes more "dusty" look (as opposed to "burned")
+
+					"vec4 color = texture2D( tDiffuse, vUv );",
+					"float dist = distance( vUv, vec2( 0.5 ) );",
+					"color.rgb *= smoothstep( 0.8, offset * 0.799, dist *( darkness + offset ) );",
+					"gl_FragColor = color;",
+					*/
+
+				"}"
+
+			].join("\n")
+
+		},
+
 		/* -------------------------------------------------------------------------
 		/* -------------------------------------------------------------------------
 		//	Full-screen textured quad shader
 		//	Full-screen textured quad shader
 		 ------------------------------------------------------------------------- */
 		 ------------------------------------------------------------------------- */
@@ -571,7 +751,7 @@ THREE.ShaderUtils = {
 			uniforms: {
 			uniforms: {
 
 
 				tDiffuse: { type: "t", value: 0, texture: null },
 				tDiffuse: { type: "t", value: 0, texture: null },
-				opacity: { type: "f", value: 1.0 }
+				opacity:  { type: "f", value: 1.0 }
 
 
 			},
 			},
 
 

+ 33 - 37
src/extras/geometries/TorusGeometry.js

@@ -1,5 +1,6 @@
 /**
 /**
  * @author oosmoxiecode
  * @author oosmoxiecode
+ * @author mr.doob / http://mrdoob.com/
  * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/src/away3dlite/primitives/Torus.as?r=2888
  * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/src/away3dlite/primitives/Torus.as?r=2888
  */
  */
 
 
@@ -13,63 +14,58 @@ THREE.TorusGeometry = function ( radius, tube, segmentsR, segmentsT, arc ) {
 	this.tube = tube || 40;
 	this.tube = tube || 40;
 	this.segmentsR = segmentsR || 8;
 	this.segmentsR = segmentsR || 8;
 	this.segmentsT = segmentsT || 6;
 	this.segmentsT = segmentsT || 6;
-	this.arc = arc || (2 * Math.PI);
+	this.arc = arc || Math.PI * 2;
 
 
-	var temp_uv = [];
+	var center = new THREE.Vector3(), uvs = [], normals = [];
 
 
-	for ( var j = 0; j <= this.segmentsR; ++j ) {
+	for ( var j = 0; j <= this.segmentsR; j ++ ) {
+
+		for ( var i = 0; i <= this.segmentsT; i ++ ) {
 
 
-		for ( var i = 0; i <= this.segmentsT; ++i ) {
-		
 			var u = i / this.segmentsT * this.arc;
 			var u = i / this.segmentsT * this.arc;
-			var v = j / this.segmentsR * 2 * Math.PI;
-			var x = (this.radius + this.tube*Math.cos(v))*Math.cos(u);
-			var y = (this.radius + this.tube*Math.cos(v))*Math.sin(u);
-			var z = this.tube*Math.sin(v);
+			var v = j / this.segmentsR * Math.PI * 2;
+
+			center.x = this.radius * Math.cos( u );
+			center.y = this.radius * Math.sin( u );
+
+			var vector = new THREE.Vector3();
+			vector.x = ( this.radius + this.tube * Math.cos( v ) ) * Math.cos( u );
+			vector.y = ( this.radius + this.tube * Math.cos( v ) ) * Math.sin( u );
+			vector.z = this.tube * Math.sin( v );
 
 
-			vert( x, y, z );
+			this.vertices.push( new THREE.Vertex( vector ) );
 
 
-			temp_uv.push( [i/this.segmentsT, 1 - j/this.segmentsR] );
+			uvs.push( new THREE.UV( i / this.segmentsT, 1 - j / this.segmentsR ) );
+			normals.push( vector.clone().subSelf( center ).normalize() );
 
 
 		}
 		}
 	}
 	}
 
 
 
 
-	for ( var j = 1; j <= this.segmentsR; ++j ) {
+	for ( var j = 1; j <= this.segmentsR; j ++ ) {
 
 
-		for ( var i = 1; i <= this.segmentsT; ++i ) {
+		for ( var i = 1; i <= this.segmentsT; i ++ ) {
 
 
-			var a = (this.segmentsT + 1)*j + i;
-			var b = (this.segmentsT + 1)*j + i - 1;
-			var c = (this.segmentsT + 1)*(j - 1) + i - 1;
-			var d = (this.segmentsT + 1)*(j - 1) + i;
+			var a = ( this.segmentsT + 1 ) * j + i - 1;
+			var b = ( this.segmentsT + 1 ) * ( j - 1 ) + i - 1;
+			var c = ( this.segmentsT + 1 ) * ( j - 1 ) + i;
+			var d = ( this.segmentsT + 1 ) * j + i;
 
 
-			f4( a, b, c,d );
+			var face = new THREE.Face4( a, b, c, d, [ normals[ a ], normals[ b ], normals[ c ], normals[ d ] ] );
+			face.normal.addSelf( normals[ a ] );
+			face.normal.addSelf( normals[ b ] );
+			face.normal.addSelf( normals[ c ] );
+			face.normal.addSelf( normals[ d ] );
+			face.normal.normalize();
 
 
-			this.faceVertexUvs[ 0 ].push( [new THREE.UV( temp_uv[a][0], temp_uv[a][1] ),
-							new THREE.UV( temp_uv[b][0], temp_uv[b][1] ),
-							new THREE.UV( temp_uv[c][0], temp_uv[c][1] ),
-							new THREE.UV( temp_uv[d][0], temp_uv[d][1] )
-							] );
+			this.faces.push( face );
+
+			this.faceVertexUvs[ 0 ].push( [ uvs[ a ].clone(), uvs[ b ].clone(), uvs[ c ].clone(), uvs[ d ].clone() ] );
 		}
 		}
 
 
 	}
 	}
 
 
 	this.computeCentroids();
 	this.computeCentroids();
-	this.computeFaceNormals();
-	this.computeVertexNormals();
-
-	function vert( x, y, z ) {
-
-		scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) );
-
-	};
-
-	function f4( a, b, c, d ) {
-
-		scope.faces.push( new THREE.Face4( a, b, c, d ) );
-
-	};
 
 
 };
 };
 
 

+ 0 - 1325
src/extras/io/LoaderOld.js

@@ -1,1325 +0,0 @@
-/**
- * @author alteredq / http://alteredqualia.com/
- */
-
-THREE.LoaderOld = function( showStatus ) {
-	
-	this.showStatus = showStatus;
-	
-	this.statusDomElement = showStatus ? this.addStatusElement() : null;
-
-};
-
-THREE.LoaderOld.prototype = {
-
-	addStatusElement: function ( ) {
-		
-		var e = document.createElement( "div" );
-		
-		e.style.fontSize = "0.8em"; 
-		e.style.textAlign = "left";
-		e.style.background = "#b00"; 
-		e.style.color = "#fff"; 
-		e.style.width = "140px"; 
-		e.style.padding = "0.25em 0.25em 0.25em 0.5em"; 
-		e.style.position = "absolute"; 
-		e.style.right = "0px"; 
-		e.style.top = "0px"; 
-		e.style.zIndex = 1000;
-		
-		e.innerHTML = "Loading ...";
-		
-		return e;
-		
-	},
-	
-	updateProgress: function ( progress ) {
-
-		var message = "Loaded ";
-
-		if ( progress.total ) {
-
-			message += ( 100 * progress.loaded / progress.total ).toFixed(0) + "%";
-
-
-		} else {
-
-			message += ( progress.loaded / 1000 ).toFixed(2) + " KB";
-
-		}
-
-		this.statusDomElement.innerHTML = message;
-
-	},
-	
-	// Load models generated by Blender exporter and original OBJ converter (converter_obj_three.py)
-
-	loadAsciiOld: function( url, callback ) {
-
-		var element = document.createElement( 'script' );
-		element.type = 'text/javascript';
-		element.onload = callback;
-		element.src = url;
-		document.getElementsByTagName( "head" )[ 0 ].appendChild( element );
-
-	},
-
-	// Load models generated by slim OBJ converter with ASCII option (converter_obj_three_slim.py -t ascii)
-	//  - parameters
-	//		- model (required)
-	//		- callback (required)
-	//		- texture_path (optional: if not specified, textures will be assumed to be in the same folder as JS model file)
-
-	loadAscii: function ( parameters ) {
-
-		var url = parameters.model,
-			callback = parameters.callback, 
-		    texture_path = parameters.texture_path ? parameters.texture_path : THREE.LoaderOld.prototype.extractUrlbase( url ),
-		
-			s = (new Date).getTime(),
-			worker = new Worker( url );
-		
-		worker.onmessage = function( event ) {
-			
-			THREE.LoaderOld.prototype.createModel( event.data, callback, texture_path );
-
-		};
-
-		worker.postMessage( s );
-
-	},
-
-	// Load models generated by slim OBJ converter with BINARY option (converter_obj_three_slim.py -t binary)
-	//  - binary models consist of two files: JS and BIN
-	//  - parameters
-	//		- model (required)
-	//		- callback (required)
-	//		- bin_path (optional: if not specified, binary file will be assumed to be in the same folder as JS model file)
-	//		- texture_path (optional: if not specified, textures will be assumed to be in the same folder as JS model file)
-
-	loadBinary: function( parameters ) {
-	
-		// #1 load JS part via web worker
-
-		//  This isn't really necessary, JS part is tiny,
-		//  could be done by more ordinary means.
-
-		var url = parameters.model,
-			callback = parameters.callback, 
-		    texture_path = parameters.texture_path ? parameters.texture_path : THREE.LoaderOld.prototype.extractUrlbase( url ),
-			bin_path = parameters.bin_path ? parameters.bin_path : THREE.LoaderOld.prototype.extractUrlbase( url ),
-
-			s = (new Date).getTime(),
-			worker = new Worker( url ),
-			callback_progress = this.showProgress ? THREE.LoaderOld.prototype.updateProgress : null;
-		
-		worker.onmessage = function( event ) {
-
-			var materials = event.data.materials,
-				buffers = event.data.buffers;
-
-			// #2 load BIN part via Ajax
-
-			//  For some reason it is faster doing loading from here than from within the worker.
-			//  Maybe passing of ginormous string as message between threads is costly? 
-			//  Also, worker loading huge data by Ajax still freezes browser. Go figure, 
-			//  worker with baked ascii JSON data keeps browser more responsive.
-
-			THREE.LoaderOld.prototype.loadAjaxBuffers( buffers, materials, callback, bin_path, texture_path, callback_progress );
-
-		};
-
-		worker.onerror = function (event) {
-
-			alert( "worker.onerror: " + event.message + "\n" + event.data );
-			event.preventDefault();
-
-		};
-
-		worker.postMessage( s );
-
-	},
-
-	// Binary AJAX parser based on Magi binary loader
-	// https://github.com/kig/magi
-
-	// Should look more into HTML5 File API
-	// See also other suggestions by Gregg Tavares
-	// https://groups.google.com/group/o3d-discuss/browse_thread/thread/a8967bc9ce1e0978
-
-	loadAjaxBuffers: function( buffers, materials, callback, bin_path, texture_path, callback_progress ) {
-
-		var xhr = new XMLHttpRequest(),
-			url = bin_path + "/" + buffers;
-
-		var length = 0;
-		
-		xhr.onreadystatechange = function() {
-			
-			if ( xhr.readyState == 4 ) {
-
-				if ( xhr.status == 200 || xhr.status == 0 ) {
-
-					THREE.LoaderOld.prototype.createBinModel( xhr.responseText, callback, texture_path, materials );
-
-				} else {
-
-					alert( "Couldn't load [" + url + "] [" + xhr.status + "]" );
-
-				}
-						
-			} else if ( xhr.readyState == 3 ) {
-				
-				if ( callback_progress ) {
-				
-					if ( length == 0 ) {
-						
-						length = xhr.getResponseHeader( "Content-Length" );
-						
-					}
-					
-					callback_progress( { total: length, loaded: xhr.responseText.length } );
-					
-				}
-				
-			} else if ( xhr.readyState == 2 ) {
-				
-				length = xhr.getResponseHeader( "Content-Length" );
-				
-			}
-			
-		}
-
-		xhr.open("GET", url, true);
-		xhr.overrideMimeType("text/plain; charset=x-user-defined");
-		xhr.setRequestHeader("Content-Type", "text/plain");
-		xhr.send(null);
-
-	},
-
-	createBinModel: function ( data, callback, texture_path, materials ) {
-
-		var Model = function ( texture_path ) {
-
-			//var s = (new Date).getTime();
-
-			var scope = this,
-				currentOffset = 0, 
-				md,
-				normals = [],
-				uvs = [],
-				tri_b, tri_c, tri_m, tri_na, tri_nb, tri_nc,
-				quad_b, quad_c, quad_d, quad_m, quad_na, quad_nb, quad_nc, quad_nd,
-				tri_uvb, tri_uvc, quad_uvb, quad_uvc, quad_uvd,
-				start_tri_flat, start_tri_smooth, start_tri_flat_uv, start_tri_smooth_uv,
-				start_quad_flat, start_quad_smooth, start_quad_flat_uv, start_quad_smooth_uv,
-				tri_size, quad_size,
-				len_tri_flat, len_tri_smooth, len_tri_flat_uv, len_tri_smooth_uv,
-				len_quad_flat, len_quad_smooth, len_quad_flat_uv, len_quad_smooth_uv;
-
-
-			THREE.Geometry.call(this);
-
-			THREE.LoaderOld.prototype.init_materials( scope, materials, texture_path );
-
-			md = parseMetaData( data, currentOffset );
-			currentOffset += md.header_bytes;
-
-			// cache offsets
-			
-			tri_b   = md.vertex_index_bytes, 
-			tri_c   = md.vertex_index_bytes*2, 
-			tri_m   = md.vertex_index_bytes*3,
-			tri_na  = md.vertex_index_bytes*3 + md.material_index_bytes,
-			tri_nb  = md.vertex_index_bytes*3 + md.material_index_bytes + md.normal_index_bytes,
-			tri_nc  = md.vertex_index_bytes*3 + md.material_index_bytes + md.normal_index_bytes*2,
-		
-			quad_b  = md.vertex_index_bytes,
-			quad_c  = md.vertex_index_bytes*2,
-			quad_d  = md.vertex_index_bytes*3,
-			quad_m  = md.vertex_index_bytes*4,
-			quad_na = md.vertex_index_bytes*4 + md.material_index_bytes,
-			quad_nb = md.vertex_index_bytes*4 + md.material_index_bytes + md.normal_index_bytes,
-			quad_nc = md.vertex_index_bytes*4 + md.material_index_bytes + md.normal_index_bytes*2,
-			quad_nd = md.vertex_index_bytes*4 + md.material_index_bytes + md.normal_index_bytes*3,
-		
-			tri_uvb = md.uv_index_bytes,
-			tri_uvc = md.uv_index_bytes * 2,
-		
-			quad_uvb = md.uv_index_bytes,
-			quad_uvc = md.uv_index_bytes * 2,
-			quad_uvd = md.uv_index_bytes * 3;
-			
-			// buffers sizes
-			
-			tri_size =  md.vertex_index_bytes * 3 + md.material_index_bytes;
-			quad_size = md.vertex_index_bytes * 4 + md.material_index_bytes;
-
-			len_tri_flat      = md.ntri_flat      * ( tri_size );
-			len_tri_smooth    = md.ntri_smooth    * ( tri_size + md.normal_index_bytes * 3 );
-			len_tri_flat_uv   = md.ntri_flat_uv   * ( tri_size + md.uv_index_bytes * 3 );
-			len_tri_smooth_uv = md.ntri_smooth_uv * ( tri_size + md.normal_index_bytes * 3 + md.uv_index_bytes * 3 );
-
-			len_quad_flat      = md.nquad_flat      * ( quad_size );
-			len_quad_smooth    = md.nquad_smooth    * ( quad_size + md.normal_index_bytes * 4 );
-			len_quad_flat_uv   = md.nquad_flat_uv   * ( quad_size + md.uv_index_bytes * 4 );
-			len_quad_smooth_uv = md.nquad_smooth_uv * ( quad_size + md.normal_index_bytes * 4 + md.uv_index_bytes * 4 );
-			
-			// read buffers
-			
-			currentOffset += init_vertices( currentOffset );
-			currentOffset += init_normals( currentOffset );
-			currentOffset += init_uvs( currentOffset );
-
-			start_tri_flat 		= currentOffset; 
-			start_tri_smooth    = start_tri_flat    + len_tri_flat;
-			start_tri_flat_uv   = start_tri_smooth  + len_tri_smooth;
-			start_tri_smooth_uv = start_tri_flat_uv + len_tri_flat_uv;
-			
-			start_quad_flat     = start_tri_smooth_uv + len_tri_smooth_uv;
-			start_quad_smooth   = start_quad_flat     + len_quad_flat;
-			start_quad_flat_uv  = start_quad_smooth   + len_quad_smooth;
-			start_quad_smooth_uv= start_quad_flat_uv  +len_quad_flat_uv;
-
-			// have to first process faces with uvs
-			// so that face and uv indices match
-			
-			init_triangles_flat_uv( start_tri_flat_uv );
-			init_triangles_smooth_uv( start_tri_smooth_uv );
-
-			init_quads_flat_uv( start_quad_flat_uv );
-			init_quads_smooth_uv( start_quad_smooth_uv );
-
-			// now we can process untextured faces
-			
-			init_triangles_flat( start_tri_flat );
-			init_triangles_smooth( start_tri_smooth );
-
-			init_quads_flat( start_quad_flat );
-			init_quads_smooth( start_quad_smooth );
-
-			this.computeCentroids();
-			this.computeFaceNormals();
-
-			//var e = (new Date).getTime();
-
-			//log( "binary data parse time: " + (e-s) + " ms" );
-
-			function parseMetaData( data, offset ) {
-
-				var metaData = {
-
-					'signature'               :parseString( data, offset, 8 ),
-					'header_bytes'            :parseUChar8( data, offset + 8 ),
-
-					'vertex_coordinate_bytes' :parseUChar8( data, offset + 9 ),
-					'normal_coordinate_bytes' :parseUChar8( data, offset + 10 ),
-					'uv_coordinate_bytes'     :parseUChar8( data, offset + 11 ),
-
-					'vertex_index_bytes'      :parseUChar8( data, offset + 12 ),
-					'normal_index_bytes'      :parseUChar8( data, offset + 13 ),
-					'uv_index_bytes'          :parseUChar8( data, offset + 14 ),
-					'material_index_bytes'    :parseUChar8( data, offset + 15 ),
-
-					'nvertices'    :parseUInt32( data, offset + 16 ),
-					'nnormals'     :parseUInt32( data, offset + 16 + 4*1 ),
-					'nuvs'         :parseUInt32( data, offset + 16 + 4*2 ),
-
-					'ntri_flat'      :parseUInt32( data, offset + 16 + 4*3 ),
-					'ntri_smooth'    :parseUInt32( data, offset + 16 + 4*4 ),
-					'ntri_flat_uv'   :parseUInt32( data, offset + 16 + 4*5 ),
-					'ntri_smooth_uv' :parseUInt32( data, offset + 16 + 4*6 ),
-
-					'nquad_flat'      :parseUInt32( data, offset + 16 + 4*7 ),
-					'nquad_smooth'    :parseUInt32( data, offset + 16 + 4*8 ),
-					'nquad_flat_uv'   :parseUInt32( data, offset + 16 + 4*9 ),
-					'nquad_smooth_uv' :parseUInt32( data, offset + 16 + 4*10 )
-
-				};
-
-				/*
-				log( "signature: " + metaData.signature );
-
-				log( "header_bytes: " + metaData.header_bytes );
-				log( "vertex_coordinate_bytes: " + metaData.vertex_coordinate_bytes );
-				log( "normal_coordinate_bytes: " + metaData.normal_coordinate_bytes );
-				log( "uv_coordinate_bytes: " + metaData.uv_coordinate_bytes );
-
-				log( "vertex_index_bytes: " + metaData.vertex_index_bytes );
-				log( "normal_index_bytes: " + metaData.normal_index_bytes );
-				log( "uv_index_bytes: " + metaData.uv_index_bytes );
-				log( "material_index_bytes: " + metaData.material_index_bytes );
-
-				log( "nvertices: " + metaData.nvertices );
-				log( "nnormals: " + metaData.nnormals );
-				log( "nuvs: " + metaData.nuvs );
-
-				log( "ntri_flat: " + metaData.ntri_flat );
-				log( "ntri_smooth: " + metaData.ntri_smooth );
-				log( "ntri_flat_uv: " + metaData.ntri_flat_uv );
-				log( "ntri_smooth_uv: " + metaData.ntri_smooth_uv );
-
-				log( "nquad_flat: " + metaData.nquad_flat );
-				log( "nquad_smooth: " + metaData.nquad_smooth );
-				log( "nquad_flat_uv: " + metaData.nquad_flat_uv );
-				log( "nquad_smooth_uv: " + metaData.nquad_smooth_uv );
-
-				var total = metaData.header_bytes
-						  + metaData.nvertices * metaData.vertex_coordinate_bytes * 3
-						  + metaData.nnormals * metaData.normal_coordinate_bytes * 3
-						  + metaData.nuvs * metaData.uv_coordinate_bytes * 2
-						  + metaData.ntri_flat * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes )
-						  + metaData.ntri_smooth * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.normal_index_bytes*3 )
-						  + metaData.ntri_flat_uv * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.uv_index_bytes*3 )
-						  + metaData.ntri_smooth_uv * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.normal_index_bytes*3 + metaData.uv_index_bytes*3 )
-						  + metaData.nquad_flat * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes )
-						  + metaData.nquad_smooth * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.normal_index_bytes*4 )
-						  + metaData.nquad_flat_uv * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.uv_index_bytes*4 )
-						  + metaData.nquad_smooth_uv * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.normal_index_bytes*4 + metaData.uv_index_bytes*4 );
-				log( "total bytes: " + total );
-				*/
-
-				return metaData;
-
-			}
-
-			function parseString( data, offset, length ) {
-
-				return data.substr( offset, length );
-
-			}
-
-			function parseFloat32( data, offset ) {
-
-				var b3 = parseUChar8( data, offset ),
-					b2 = parseUChar8( data, offset + 1 ),
-					b1 = parseUChar8( data, offset + 2 ),
-					b0 = parseUChar8( data, offset + 3 ),
-
-					sign = 1 - ( 2 * ( b0 >> 7 ) ),
-					exponent = ((( b0 << 1 ) & 0xff) | ( b1 >> 7 )) - 127,
-					mantissa = (( b1 & 0x7f ) << 16) | (b2 << 8) | b3;
-
-					if (mantissa == 0 && exponent == -127)
-						return 0.0;
-
-					return sign * ( 1 + mantissa * Math.pow( 2, -23 ) ) * Math.pow( 2, exponent );
-
-			}
-
-			function parseUInt32( data, offset ) {
-
-				var b0 = parseUChar8( data, offset ),
-					b1 = parseUChar8( data, offset + 1 ),
-					b2 = parseUChar8( data, offset + 2 ),
-					b3 = parseUChar8( data, offset + 3 );
-
-				return (b3 << 24) + (b2 << 16) + (b1 << 8) + b0;
-			}
-
-			function parseUInt16( data, offset ) {
-
-				var b0 = parseUChar8( data, offset ),
-					b1 = parseUChar8( data, offset + 1 );
-
-				return (b1 << 8) + b0;
-
-			}
-
-			function parseSChar8( data, offset ) {
-
-				var b = parseUChar8( data, offset );
-				return b > 127 ? b - 256 : b;
-
-			}
-
-			function parseUChar8( data, offset ) {
-
-				return data.charCodeAt( offset ) & 0xff;
-			}
-
-			function init_vertices( start ) {
-
-				var i, x, y, z, 
-					stride = md.vertex_coordinate_bytes * 3,
-					end = start + md.nvertices * stride;
-
-				for( i = start; i < end; i += stride ) {
-
-					x = parseFloat32( data, i );
-					y = parseFloat32( data, i + md.vertex_coordinate_bytes );
-					z = parseFloat32( data, i + md.vertex_coordinate_bytes*2 );
-
-					THREE.LoaderOld.prototype.v( scope, x, y, z );
-
-				}
-
-				return md.nvertices * stride;
-
-			}
-
-			function init_normals( start ) {
-
-				var i, x, y, z, 
-					stride = md.normal_coordinate_bytes * 3,
-					end = start + md.nnormals * stride;
-
-				for( i = start; i < end; i += stride ) {
-
-					x = parseSChar8( data, i );
-					y = parseSChar8( data, i + md.normal_coordinate_bytes );
-					z = parseSChar8( data, i + md.normal_coordinate_bytes*2 );
-
-					normals.push( x/127, y/127, z/127 );
-
-				}
-
-				return md.nnormals * stride;
-
-			}
-
-			function init_uvs( start ) {
-
-				var i, u, v, 
-					stride = md.uv_coordinate_bytes * 2,
-					end = start + md.nuvs * stride;
-
-				for( i = start; i < end; i += stride ) {
-
-					u = parseFloat32( data, i );
-					v = parseFloat32( data, i + md.uv_coordinate_bytes );
-
-					uvs.push( u, v );
-
-				}
-				
-				return md.nuvs * stride;
-
-			}			
-			
-			function add_tri( i ) {
-
-				var a, b, c, m;
-
-				a = parseUInt32( data, i );
-				b = parseUInt32( data, i + tri_b );
-				c = parseUInt32( data, i + tri_c );
-
-				m = parseUInt16( data, i + tri_m );
-
-				THREE.LoaderOld.prototype.f3( scope, a, b, c, m );
-
-			}
-
-			function add_tri_n( i ) {
-
-				var a, b, c, m, na, nb, nc;
-
-				a  = parseUInt32( data, i );
-				b  = parseUInt32( data, i + tri_b );
-				c  = parseUInt32( data, i + tri_c );
-
-				m  = parseUInt16( data, i + tri_m );
-
-				na = parseUInt32( data, i + tri_na );
-				nb = parseUInt32( data, i + tri_nb );
-				nc = parseUInt32( data, i + tri_nc );
-
-				THREE.LoaderOld.prototype.f3n( scope, normals, a, b, c, m, na, nb, nc );
-
-			}
-
-			function add_quad( i ) {
-
-				var a, b, c, d, m;
-
-				a = parseUInt32( data, i );
-				b = parseUInt32( data, i + quad_b );
-				c = parseUInt32( data, i + quad_c );
-				d = parseUInt32( data, i + quad_d );
-
-				m = parseUInt16( data, i + quad_m );
-
-				THREE.LoaderOld.prototype.f4( scope, a, b, c, d, m );
-
-			}
-
-			function add_quad_n( i ) {
-
-				var a, b, c, d, m, na, nb, nc, nd;
-
-				a  = parseUInt32( data, i );
-				b  = parseUInt32( data, i + quad_b );
-				c  = parseUInt32( data, i + quad_c );
-				d  = parseUInt32( data, i + quad_d );
-
-				m  = parseUInt16( data, i + quad_m );
-
-				na = parseUInt32( data, i + quad_na );
-				nb = parseUInt32( data, i + quad_nb );
-				nc = parseUInt32( data, i + quad_nc );
-				nd = parseUInt32( data, i + quad_nd );
-
-				THREE.LoaderOld.prototype.f4n( scope, normals, a, b, c, d, m, na, nb, nc, nd );
-
-			}
-
-			function add_uv3( i ) {
-
-				var uva, uvb, uvc, u1, u2, u3, v1, v2, v3;
-
-				uva = parseUInt32( data, i );
-				uvb = parseUInt32( data, i + tri_uvb );
-				uvc = parseUInt32( data, i + tri_uvc );
-
-				u1 = uvs[ uva*2 ];
-				v1 = uvs[ uva*2 + 1 ];
-
-				u2 = uvs[ uvb*2 ];
-				v2 = uvs[ uvb*2 + 1 ];
-
-				u3 = uvs[ uvc*2 ];
-				v3 = uvs[ uvc*2 + 1 ];
-
-				THREE.LoaderOld.prototype.uv3( scope.uvs, u1, v1, u2, v2, u3, v3 );
-
-			}
-
-			function add_uv4( i ) {
-
-				var uva, uvb, uvc, uvd, u1, u2, u3, u4, v1, v2, v3, v4;
-
-				uva = parseUInt32( data, i );
-				uvb = parseUInt32( data, i + quad_uvb );
-				uvc = parseUInt32( data, i + quad_uvc );
-				uvd = parseUInt32( data, i + quad_uvd );
-
-				u1 = uvs[ uva*2 ];
-				v1 = uvs[ uva*2 + 1 ];
-
-				u2 = uvs[ uvb*2 ];
-				v2 = uvs[ uvb*2 + 1 ];
-
-				u3 = uvs[ uvc*2 ];
-				v3 = uvs[ uvc*2 + 1 ];
-
-				u4 = uvs[ uvd*2 ];
-				v4 = uvs[ uvd*2 + 1 ];
-
-				THREE.LoaderOld.prototype.uv4( scope.uvs, u1, v1, u2, v2, u3, v3, u4, v4 );
-
-			}
-
-			function init_triangles_flat( start ) {
-
-				var i, stride = md.vertex_index_bytes * 3 + md.material_index_bytes,
-					end = start + md.ntri_flat * stride;
-
-				for( i = start; i < end; i += stride ) {
-
-					add_tri( i );
-
-				}
-
-				return end - start;
-
-			}
-
-			function init_triangles_flat_uv( start ) {
-
-				var i, offset = md.vertex_index_bytes * 3 + md.material_index_bytes,
-					stride = offset + md.uv_index_bytes * 3,
-					end = start + md.ntri_flat_uv * stride;
-
-				for( i = start; i < end; i += stride ) {
-
-					add_tri( i );
-					add_uv3( i + offset );
-
-				}
-
-				return end - start;
-
-			}
-
-			function init_triangles_smooth( start ) {
-
-				var i, stride = md.vertex_index_bytes * 3 + md.material_index_bytes + md.normal_index_bytes * 3,
-					end = start + md.ntri_smooth * stride;
-
-				for( i = start; i < end; i += stride ) {
-
-					add_tri_n( i );
-
-				}
-
-				return end - start;
-
-			}
-
-			function init_triangles_smooth_uv( start ) {
-
-				var i, offset = md.vertex_index_bytes * 3 + md.material_index_bytes + md.normal_index_bytes * 3,
-					stride = offset + md.uv_index_bytes * 3,
-					end = start + md.ntri_smooth_uv * stride;
-
-				for( i = start; i < end; i += stride ) {
-
-					add_tri_n( i );
-					add_uv3( i + offset );
-
-				}
-
-				return end - start;
-
-			}
-
-			function init_quads_flat( start ) {
-
-				var i, stride = md.vertex_index_bytes * 4 + md.material_index_bytes,
-					end = start + md.nquad_flat * stride;
-
-				for( i = start; i < end; i += stride ) {
-
-					add_quad( i );
-
-				}
-
-				return end - start;
-
-			}
-
-			function init_quads_flat_uv( start ) {
-
-				var i, offset = md.vertex_index_bytes * 4 + md.material_index_bytes,
-					stride = offset + md.uv_index_bytes * 4,
-					end = start + md.nquad_flat_uv * stride;
-
-				for( i = start; i < end; i += stride ) {
-
-					add_quad( i );
-					add_uv4( i + offset );
-
-				}
-
-				return end - start;
-
-			}
-
-			function init_quads_smooth( start ) {
-
-				var i, stride = md.vertex_index_bytes * 4 + md.material_index_bytes + md.normal_index_bytes * 4,
-					end = start + md.nquad_smooth * stride;
-
-				for( i = start; i < end; i += stride ) {
-
-					add_quad_n( i );
-				}
-
-				return end - start;
-
-			}
-
-			function init_quads_smooth_uv( start ) {
-
-				var i, offset = md.vertex_index_bytes * 4 + md.material_index_bytes + md.normal_index_bytes * 4, 
-					stride =  offset + md.uv_index_bytes * 4,
-					end = start + md.nquad_smooth_uv * stride;
-
-				for( i = start; i < end; i += stride ) {
-
-					add_quad_n( i );
-					add_uv4( i + offset );
-
-				}
-
-				return end - start;
-
-			}
-
-		}
-
-		Model.prototype = new THREE.Geometry();
-		Model.prototype.constructor = Model;
-
-		callback( new Model( texture_path ) );
-
-	},
-
-	createModel: function ( data, callback, texture_path ) {
-
-		var Model = function ( texture_path ) {
-
-			var scope = this;
-
-			THREE.Geometry.call( this );
-
-			THREE.LoaderOld.prototype.init_materials( scope, data.materials, texture_path );
-
-			init_vertices();
-			init_faces();
-			init_skin();
-
-			this.computeCentroids();
-			this.computeFaceNormals();
-
-			function init_skin() {
-				
-				var i, l, x, y, z, w, a, b, c, d;
-
-				if ( data.skinWeights ) {
-					
-					for( i = 0, l = data.skinWeights.length; i < l; i += 2 ) {
-
-						x = data.skinWeights[ i     ];
-						y = data.skinWeights[ i + 1 ];
-						z = 0;
-						w = 0;
-
-						THREE.LoaderOld.prototype.sw( scope, x, y, z, w );
-
-					}
-					
-				}
-				
-				if ( data.skinIndices ) {
-					
-					for( i = 0, l = data.skinIndices.length; i < l; i += 2 ) {
-
-						a = data.skinIndices[ i     ];
-						b = data.skinIndices[ i + 1 ];
-						c = 0;
-						d = 0;
-
-						THREE.LoaderOld.prototype.si( scope, a, b, c, d );
-
-					}
-				
-				}
-				
-				THREE.LoaderOld.prototype.bones( scope, data.bones );
-				THREE.LoaderOld.prototype.animation( scope, data.animation );
-				
-			}
-			
-			function init_vertices() {
-
-				var i, l, v, vl, x, y, z, r, g, b, srcVertices, dstVertices;
-
-				// normal vertices
-
-				for( i = 0, l = data.vertices.length; i < l; i += 3 ) {
-
-					x = data.vertices[ i     ];
-					y = data.vertices[ i + 1 ];
-					z = data.vertices[ i + 2 ];
-
-					THREE.LoaderOld.prototype.v( scope, x, y, z );
-
-				}
-
-				// vertex animation 
-
-				if( data.morphTargets !== undefined ) {
-					
-					for( i = 0, l = data.morphTargets.length; i < l; i++ ) {
-						
-						scope.morphTargets[ i ] = {};
-						scope.morphTargets[ i ].name = data.morphTargets[ i ].name;
-						scope.morphTargets[ i ].vertices = [];
-						
-						dstVertices = scope.morphTargets[ i ].vertices;
-						srcVertices = data.morphTargets [ i ].vertices;
-
-						for( v = 0, vl = srcVertices.length; v < vl; v += 3 ) {
-
-							dstVertices.push( new THREE.Vertex( new THREE.Vector3( srcVertices[ v ], srcVertices[ v + 1 ], srcVertices[ v + 2 ] )));
-
-						}
-						
-					} 
-					
-				}
-
-				
-				if ( data.colors ) {
-					
-					for( i = 0, l = data.colors.length; i < l; i += 3 ) {
-						
-						r = data.colors[ i     ];
-						g = data.colors[ i + 1 ];
-						b = data.colors[ i + 2 ];
-
-						THREE.LoaderOld.prototype.vc( scope, r, g, b );
-					
-					}
-					
-				}
-
-			}
-
-			function init_faces() {
-
-				function add_tri( src, i ) {
-
-					var a, b, c, m;
-
-					a = src[ i ];
-					b = src[ i + 1 ];
-					c = src[ i + 2 ];
-
-					m = src[ i + 3 ];
-
-					THREE.LoaderOld.prototype.f3( scope, a, b, c, m );
-
-				}
-
-				function add_tri_n( src, i ) {
-
-					var a, b, c, m, na, nb, nc;
-
-					a  = src[ i ];
-					b  = src[ i + 1 ];
-					c  = src[ i + 2 ];
-
-					m  = src[ i + 3 ];
-
-					na = src[ i + 4 ];
-					nb = src[ i + 5 ];
-					nc = src[ i + 6 ];
-
-					THREE.LoaderOld.prototype.f3n( scope, data.normals, a, b, c, m, na, nb, nc );
-
-				}
-
-				function add_quad( src, i ) {
-
-					var a, b, c, d, m;
-
-					a = src[ i ];
-					b = src[ i + 1 ];
-					c = src[ i + 2 ];
-					d = src[ i + 3 ];
-
-					m = src[ i + 4 ];
-
-					THREE.LoaderOld.prototype.f4( scope, a, b, c, d, m );
-
-				}
-
-				function add_quad_n( src, i ) {
-
-					var a, b, c, d, m, na, nb, nc, nd;
-
-					a  = src[ i ];
-					b  = src[ i + 1 ];
-					c  = src[ i + 2 ];
-					d  = src[ i + 3 ];
-
-					m  = src[ i + 4 ];
-
-					na = src[ i + 5 ];
-					nb = src[ i + 6 ];
-					nc = src[ i + 7 ];
-					nd = src[ i + 8 ];
-
-					THREE.LoaderOld.prototype.f4n( scope, data.normals, a, b, c, d, m, na, nb, nc, nd );
-
-				}
-
-				function add_uv3( src, i ) {
-
-					var uva, uvb, uvc, u1, u2, u3, v1, v2, v3;
-
-					uva = src[ i ];
-					uvb = src[ i + 1 ];
-					uvc = src[ i + 2 ];
-
-					u1 = data.uvs[ uva * 2 ];
-					v1 = data.uvs[ uva * 2 + 1 ];
-
-					u2 = data.uvs[ uvb * 2 ];
-					v2 = data.uvs[ uvb * 2 + 1 ];
-
-					u3 = data.uvs[ uvc * 2 ];
-					v3 = data.uvs[ uvc * 2 + 1 ];
-
-					THREE.LoaderOld.prototype.uv3( scope.uvs, u1, v1, u2, v2, u3, v3 );
-					
-					if( data.uvs2 && data.uvs2.length ) {
-						
-						u1 = data.uvs2[ uva * 2 ];
-						v1 = data.uvs2[ uva * 2 + 1 ];
-
-						u2 = data.uvs2[ uvb * 2 ];
-						v2 = data.uvs2[ uvb * 2 + 1 ];
-
-						u3 = data.uvs2[ uvc * 2 ];
-						v3 = data.uvs2[ uvc * 2 + 1 ];
-
-						THREE.LoaderOld.prototype.uv3( scope.uvs2, u1, 1-v1, u2, 1-v2, u3, 1-v3 );
-						
-					}
-
-				}
-
-				function add_uv4( src, i ) {
-
-					var uva, uvb, uvc, uvd, u1, u2, u3, u4, v1, v2, v3, v4;
-
-					uva = src[ i ];
-					uvb = src[ i + 1 ];
-					uvc = src[ i + 2 ];
-					uvd = src[ i + 3 ];
-
-					u1 = data.uvs[ uva * 2 ];
-					v1 = data.uvs[ uva * 2 + 1 ];
-
-					u2 = data.uvs[ uvb * 2 ];
-					v2 = data.uvs[ uvb * 2 + 1 ];
-
-					u3 = data.uvs[ uvc * 2 ];
-					v3 = data.uvs[ uvc * 2 + 1 ];
-
-					u4 = data.uvs[ uvd * 2 ];
-					v4 = data.uvs[ uvd * 2 + 1 ];
-
-					THREE.LoaderOld.prototype.uv4( scope.uvs, u1, v1, u2, v2, u3, v3, u4, v4 );
-					
-					if( data.uvs2 ) {
-						
-						u1 = data.uvs2[ uva * 2 ];
-						v1 = data.uvs2[ uva * 2 + 1 ];
-
-						u2 = data.uvs2[ uvb * 2 ];
-						v2 = data.uvs2[ uvb * 2 + 1 ];
-
-						u3 = data.uvs2[ uvc * 2 ];
-						v3 = data.uvs2[ uvc * 2 + 1 ];
-
-						u4 = data.uvs2[ uvd * 2 ];
-						v4 = data.uvs2[ uvd * 2 + 1 ];
-
-						THREE.LoaderOld.prototype.uv4( scope.uvs2, u1, 1-v1, u2, 1-v2, u3, 1-v3, u4, 1-v4 );
-						
-					}
-
-				}
-
-				var i, l;
-				
-				// need to process first faces with uvs
-				// as uvs are indexed by face indices
-				
-				for ( i = 0, l = data.trianglesUvs.length; i < l; i+= 7 ) {
-
-					add_tri( data.trianglesUvs, i );
-					add_uv3( data.trianglesUvs, i + 4 );
-
-				}
-
-				for ( i = 0, l = data.trianglesNormalsUvs.length; i < l; i += 10 ) {
-
-					add_tri_n( data.trianglesNormalsUvs, i );
-					add_uv3( data.trianglesNormalsUvs, i + 7 );
-
-				}
-				
-				for ( i = 0, l = data.quadsUvs.length; i < l; i += 9 ) {
-
-					add_quad( data.quadsUvs, i );
-					add_uv4( data.quadsUvs, i + 5 );
-
-				}
-				
-				for ( i = 0, l = data.quadsNormalsUvs.length; i < l; i += 13 ) {
-
-					add_quad_n( data.quadsNormalsUvs, i );
-					add_uv4( data.quadsNormalsUvs, i + 9 );
-
-				}
-				
-				// now can process untextured faces
-				
-				for ( i = 0, l = data.triangles.length; i < l; i += 4 ) {
-
-					add_tri( data.triangles, i );
-
-				}
-
-				for ( i = 0, l = data.trianglesNormals.length; i < l; i += 7 ) {
-
-					add_tri_n( data.trianglesNormals, i );
-
-				}
-
-				for ( i = 0, l = data.quads.length; i < l; i += 5 ) {
-
-					add_quad( data.quads, i );
-
-				}
-
-				for ( i = 0, l = data.quadsNormals.length; i < l; i += 9 ) {
-
-					add_quad_n( data.quadsNormals, i );
-
-				}
-
-			}
-
-		}
-
-		Model.prototype = new THREE.Geometry();
-		Model.prototype.constructor = Model;
-
-		callback( new Model( texture_path ) );
-
-	},
-
-	bones: function( scope, bones ) {
-
-		scope.bones = bones;
-
-	},
-	
-	animation: function( scope, animation ) {
-		
-		scope.animation = animation;
-
-	},
-	
-	si: function( scope, a, b, c, d ) {
-
-		scope.skinIndices.push( new THREE.Vector4( a, b, c, d ) );
-
-	},
-
-	sw: function( scope, x, y, z, w ) {
-
-		scope.skinWeights.push( new THREE.Vector4( x, y, z, w ) );
-
-	},
-	
-	v: function( scope, x, y, z ) {
-
-		scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) );
-
-	},
-
-
-
-	vc: function( scope, r, g, b ) {
-
-		var color = new THREE.Color( 0xffffff );
-		color.setRGB( r, g, b );
-		scope.colors.push( color );
-
-	},
-
-	f3: function( scope, a, b, c, mi ) {
-
-		var material = scope.materials[ mi ];
-		scope.faces.push( new THREE.Face3( a, b, c, null, material ) );
-
-	},
-
-	f4: function( scope, a, b, c, d, mi ) {
-
-		var material = scope.materials[ mi ];
-		scope.faces.push( new THREE.Face4( a, b, c, d, null, material ) );
-
-	},
-
-	f3n: function( scope, normals, a, b, c, mi, na, nb, nc ) {
-
-		var material = scope.materials[ mi ],
-			nax = normals[ na*3     ],
-			nay = normals[ na*3 + 1 ],
-			naz = normals[ na*3 + 2 ],
-
-			nbx = normals[ nb*3     ],
-			nby = normals[ nb*3 + 1 ],
-			nbz = normals[ nb*3 + 2 ],
-
-			ncx = normals[ nc*3     ],
-			ncy = normals[ nc*3 + 1 ],
-			ncz = normals[ nc*3 + 2 ];
-
-		scope.faces.push( new THREE.Face3( a, b, c, 
-						  [new THREE.Vector3( nax, nay, naz ), 
-						   new THREE.Vector3( nbx, nby, nbz ), 
-						   new THREE.Vector3( ncx, ncy, ncz )], 
-						  material ) );
-
-	},
-
-	f4n: function( scope, normals, a, b, c, d, mi, na, nb, nc, nd ) {
-
-		var material = scope.materials[ mi ],
-			nax = normals[ na*3     ],
-			nay = normals[ na*3 + 1 ],
-			naz = normals[ na*3 + 2 ],
-
-			nbx = normals[ nb*3     ],
-			nby = normals[ nb*3 + 1 ],
-			nbz = normals[ nb*3 + 2 ],
-
-			ncx = normals[ nc*3     ],
-			ncy = normals[ nc*3 + 1 ],
-			ncz = normals[ nc*3 + 2 ],
-
-			ndx = normals[ nd*3     ],
-			ndy = normals[ nd*3 + 1 ],
-			ndz = normals[ nd*3 + 2 ];
-
-		scope.faces.push( new THREE.Face4( a, b, c, d,
-						  [new THREE.Vector3( nax, nay, naz ), 
-						   new THREE.Vector3( nbx, nby, nbz ), 
-						   new THREE.Vector3( ncx, ncy, ncz ), 
-						   new THREE.Vector3( ndx, ndy, ndz )], 
-						  material ) );
-
-	},
-
-	uv3: function( where, u1, v1, u2, v2, u3, v3 ) {
-
-		var uv = [];
-		uv.push( new THREE.UV( u1, v1 ) );
-		uv.push( new THREE.UV( u2, v2 ) );
-		uv.push( new THREE.UV( u3, v3 ) );
-		where.push( uv );
-
-	},
-
-	uv4: function( where, u1, v1, u2, v2, u3, v3, u4, v4 ) {
-
-		var uv = [];
-		uv.push( new THREE.UV( u1, v1 ) );
-		uv.push( new THREE.UV( u2, v2 ) );
-		uv.push( new THREE.UV( u3, v3 ) );
-		uv.push( new THREE.UV( u4, v4 ) );
-		where.push( uv );
-
-	},
-
-	init_materials: function( scope, materials, texture_path ) {
-
-		scope.materials = [];
-
-		for ( var i = 0; i < materials.length; ++i ) {
-
-			scope.materials[i] = [ THREE.LoaderOld.prototype.createMaterial( materials[i], texture_path ) ];
-
-		}
-
-	},
-
-	createMaterial: function ( m, texture_path ) {
-
-		function is_pow2( n ) {
-
-			var l = Math.log(n) / Math.LN2;
-			return Math.floor(l) == l;
-
-		}
-
-		function nearest_pow2( n ) {
-
-			var l = Math.log(n) / Math.LN2;
-			return Math.pow( 2, Math.round(l) );
-
-		}
-
-		function load_image( where, url ) {
-			
-			var image = new Image();
-			
-			image.onload = function () {
-
-				if ( !is_pow2( this.width ) || !is_pow2( this.height ) ) {
-
-					var w = nearest_pow2( this.width ),
-						h = nearest_pow2( this.height );
-
-					where.image.width = w;
-					where.image.height = h;
-					where.image.getContext("2d").drawImage( this, 0, 0, w, h );
-
-				} else {
-
-					where.image = this;
-
-				}
-
-				where.needsUpdate = true;
-
-			};
-
-			image.src = url;
-			
-		}
-		
-		var material, mtype, mpars, texture, color;
-
-		// defaults
-		
-		mtype = "MeshLambertMaterial";
-		mpars = { color: 0xeeeeee, opacity: 1.0, map: null, lightMap: null, vertexColors: m.vertexColors };
-		
-		// parameters from model file
-		
-		if ( m.shading ) {
-			
-			if ( m.shading == "Phong" ) mtype = "MeshPhongMaterial";
-			
-		}
-		
-		if ( m.mapDiffuse && texture_path ) {
-
-			texture = document.createElement( 'canvas' );
-			
-			mpars.map = new THREE.Texture( texture );
-			mpars.map.sourceFile = m.mapDiffuse;
-			
-			load_image( mpars.map, texture_path + "/" + m.mapDiffuse );
-
-		} else if ( m.colorDiffuse ) {
-
-			color = ( m.colorDiffuse[0] * 255 << 16 ) + ( m.colorDiffuse[1] * 255 << 8 ) + m.colorDiffuse[2] * 255;
-			mpars.color = color;
-			mpars.opacity =  m.transparency;
-
-		} else if ( m.DbgColor ) {
-
-			mpars.color = m.DbgColor;
-
-		}
-
-		if ( m.mapLightmap && texture_path ) {
-
-			texture = document.createElement( 'canvas' );
-			
-			mpars.lightMap = new THREE.Texture( texture );
-			mpars.lightMap.sourceFile = m.mapLightmap;
-			
-			load_image( mpars.lightMap, texture_path + "/" + m.mapLightmap );
-
-		}
-		
-		material = new THREE[ mtype ]( mpars );
-
-		return material;
-
-	},
-	
-	extractUrlbase: function( url ) {
-		
-		var chunks = url.split( "/" );
-		chunks.pop();
-		return chunks.join( "/" );
-		
-	},
-	
-	constructor : THREE.LoaderOld
-
-};

+ 0 - 0
src/extras/io/BinaryLoader.js → src/extras/loaders/BinaryLoader.js


+ 4 - 4
src/extras/collada/dae.js → src/extras/loaders/ColladaLoader.js

@@ -2,7 +2,7 @@
  * @author Tim Knip / http://www.floorplanner.com/ / tim at floorplanner.com
  * @author Tim Knip / http://www.floorplanner.com/ / tim at floorplanner.com
  */
  */
 
 
-var DAE = (function() {
+var ColladaLoader = function() {
 	var COLLADA = null;
 	var COLLADA = null;
 	var scene = null;
 	var scene = null;
 	var daeScene;
 	var daeScene;
@@ -20,7 +20,7 @@ var DAE = (function() {
 	var morphs;
 	var morphs;
 	var skins;
 	var skins;
 	var preferredShading = THREE.SmoothShading;
 	var preferredShading = THREE.SmoothShading;
-	
+
 	function load(url, readyCallback) {
 	function load(url, readyCallback) {
 		if (document.implementation && document.implementation.createDocument) {
 		if (document.implementation && document.implementation.createDocument) {
 			var namespaceURL = "http://www.collada.org/2005/11/COLLADASchema";
 			var namespaceURL = "http://www.collada.org/2005/11/COLLADASchema";
@@ -40,7 +40,7 @@ var DAE = (function() {
 			req.onreadystatechange = function() {
 			req.onreadystatechange = function() {
 				if(req.readyState == 4) {
 				if(req.readyState == 4) {
 					if(req.status == 0 || req.status == 200) {
 					if(req.status == 0 || req.status == 200) {
-						
+
 						readyCallbackFunc = readyCallback;
 						readyCallbackFunc = readyCallback;
 						parse(req.responseXML, undefined, url);
 						parse(req.responseXML, undefined, url);
 					}
 					}
@@ -2027,4 +2027,4 @@ var DAE = (function() {
 		applySkin: applySkin,
 		applySkin: applySkin,
 		geometries : geometries
 		geometries : geometries
 	};
 	};
-})();
+};

+ 0 - 0
src/extras/io/JSONLoader.js → src/extras/loaders/JSONLoader.js


+ 0 - 0
src/extras/io/Loader.js → src/extras/loaders/Loader.js


+ 0 - 0
src/extras/io/SceneLoader.js → src/extras/loaders/SceneLoader.js


+ 0 - 0
src/extras/io/UTF8Loader.js → src/extras/loaders/UTF8Loader.js


+ 0 - 14
src/materials/Mappings.js

@@ -1,14 +0,0 @@
-/**
- * @author mr.doob / http://mrdoob.com/
- */
-
-THREE.CubeReflectionMapping = function () {};
-THREE.CubeRefractionMapping = function () {};
-
-THREE.LatitudeReflectionMapping = function () {};
-THREE.LatitudeRefractionMapping = function () {};
-
-THREE.SphericalReflectionMapping = function () {};
-THREE.SphericalRefractionMapping = function () {};
-
-THREE.UVMapping = function () {};

+ 7 - 2
src/renderers/WebGLRenderer.js

@@ -5065,7 +5065,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 		}
 		}
 
 
-		var framebuffer, width, height;
+		var framebuffer, width, height, vx, vy;
 
 
 		if ( renderTexture ) {
 		if ( renderTexture ) {
 
 
@@ -5082,18 +5082,23 @@ THREE.WebGLRenderer = function ( parameters ) {
 			width = renderTexture.width;
 			width = renderTexture.width;
 			height = renderTexture.height;
 			height = renderTexture.height;
 
 
+			vx = 0;
+			vy = 0;
+
 		} else {
 		} else {
 
 
 			framebuffer = null;
 			framebuffer = null;
 			width = _viewportWidth;
 			width = _viewportWidth;
 			height = _viewportHeight;
 			height = _viewportHeight;
+			vx = _viewportX;
+			vy = _viewportY;
 
 
 		}
 		}
 
 
 		if ( framebuffer != _currentFramebuffer ) {
 		if ( framebuffer != _currentFramebuffer ) {
 
 
 			_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
 			_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
-			_gl.viewport( _viewportX, _viewportY, width, height );
+			_gl.viewport( vx, vy, width, height );
 
 
 			_currentFramebuffer = framebuffer;
 			_currentFramebuffer = framebuffer;
 
 

+ 0 - 0
src/materials/DataTexture.js → src/textures/DataTexture.js


+ 13 - 0
src/materials/Texture.js → src/textures/Texture.js

@@ -47,6 +47,19 @@ THREE.TextureCount = 0;
 THREE.MultiplyOperation = 0;
 THREE.MultiplyOperation = 0;
 THREE.MixOperation = 1;
 THREE.MixOperation = 1;
 
 
+// Mapping modes
+
+THREE.CubeReflectionMapping = function () {};
+THREE.CubeRefractionMapping = function () {};
+
+THREE.LatitudeReflectionMapping = function () {};
+THREE.LatitudeRefractionMapping = function () {};
+
+THREE.SphericalReflectionMapping = function () {};
+THREE.SphericalRefractionMapping = function () {};
+
+THREE.UVMapping = function () {};
+
 // Wrapping modes
 // Wrapping modes
 
 
 THREE.RepeatWrapping = 0;
 THREE.RepeatWrapping = 0;

+ 14 - 12
utils/build.py

@@ -31,13 +31,13 @@ COMMON_FILES = [
 'core/Spline.js',
 'core/Spline.js',
 'core/Edge.js',
 'core/Edge.js',
 'cameras/Camera.js',
 'cameras/Camera.js',
+'cameras/OrthoCamera.js',
 'lights/Light.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/AmbientLight.js',
 'lights/DirectionalLight.js',
 'lights/DirectionalLight.js',
 'lights/PointLight.js',
 'lights/PointLight.js',
 'lights/SpotLight.js',
 'lights/SpotLight.js',
 'materials/Material.js',
 'materials/Material.js',
-'materials/Mappings.js',
 'materials/LineBasicMaterial.js',
 'materials/LineBasicMaterial.js',
 'materials/MeshBasicMaterial.js',
 'materials/MeshBasicMaterial.js',
 'materials/MeshLambertMaterial.js',
 'materials/MeshLambertMaterial.js',
@@ -49,8 +49,8 @@ COMMON_FILES = [
 'materials/ParticleBasicMaterial.js',
 'materials/ParticleBasicMaterial.js',
 'materials/ParticleCanvasMaterial.js',
 'materials/ParticleCanvasMaterial.js',
 'materials/ParticleDOMMaterial.js',
 'materials/ParticleDOMMaterial.js',
-'materials/Texture.js',
-'materials/DataTexture.js',
+'textures/Texture.js',
+'textures/DataTexture.js',
 'objects/Particle.js',
 'objects/Particle.js',
 'objects/ParticleSystem.js',
 'objects/ParticleSystem.js',
 'objects/Line.js',
 'objects/Line.js',
@@ -108,11 +108,11 @@ EXTRAS_FILES = [
 'extras/geometries/TextGeometry.js',
 'extras/geometries/TextGeometry.js',
 'extras/geometries/TorusGeometry.js',
 'extras/geometries/TorusGeometry.js',
 'extras/geometries/TorusKnotGeometry.js',
 'extras/geometries/TorusKnotGeometry.js',
-'extras/io/Loader.js',
-'extras/io/JSONLoader.js',
-'extras/io/BinaryLoader.js',
-'extras/io/SceneLoader.js',
-'extras/io/UTF8Loader.js',
+'extras/loaders/Loader.js',
+'extras/loaders/JSONLoader.js',
+'extras/loaders/BinaryLoader.js',
+'extras/loaders/SceneLoader.js',
+'extras/loaders/UTF8Loader.js',
 'extras/objects/MarchingCubes.js',
 'extras/objects/MarchingCubes.js',
 'extras/objects/Trident.js',
 'extras/objects/Trident.js',
 'extras/physics/Collisions.js',
 'extras/physics/Collisions.js',
@@ -139,12 +139,12 @@ CANVAS_FILES = [
 'core/UV.js',
 'core/UV.js',
 'core/Geometry.js',
 'core/Geometry.js',
 'cameras/Camera.js',
 'cameras/Camera.js',
+'cameras/OrthoCamera.js',
 'lights/Light.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/AmbientLight.js',
 'lights/DirectionalLight.js',
 'lights/DirectionalLight.js',
 'lights/PointLight.js',
 'lights/PointLight.js',
 'materials/Material.js',
 'materials/Material.js',
-'materials/Mappings.js',
 'materials/LineBasicMaterial.js',
 'materials/LineBasicMaterial.js',
 'materials/MeshBasicMaterial.js',
 'materials/MeshBasicMaterial.js',
 'materials/MeshLambertMaterial.js',
 'materials/MeshLambertMaterial.js',
@@ -154,7 +154,7 @@ CANVAS_FILES = [
 'materials/MeshFaceMaterial.js',
 'materials/MeshFaceMaterial.js',
 'materials/ParticleBasicMaterial.js',
 'materials/ParticleBasicMaterial.js',
 'materials/ParticleCanvasMaterial.js',
 'materials/ParticleCanvasMaterial.js',
-'materials/Texture.js',
+'textures/Texture.js',
 'objects/Particle.js',
 'objects/Particle.js',
 'objects/Line.js',
 'objects/Line.js',
 'objects/Mesh.js',
 'objects/Mesh.js',
@@ -187,6 +187,7 @@ DOM_FILES = [
 'core/Face4.js',
 'core/Face4.js',
 'core/UV.js',
 'core/UV.js',
 'cameras/Camera.js',
 'cameras/Camera.js',
+'cameras/OrthoCamera.js',
 'materials/ParticleDOMMaterial.js',
 'materials/ParticleDOMMaterial.js',
 'objects/Particle.js',
 'objects/Particle.js',
 'objects/Bone.js',
 'objects/Bone.js',
@@ -214,6 +215,7 @@ SVG_FILES = [
 'core/UV.js',
 'core/UV.js',
 'core/Geometry.js',
 'core/Geometry.js',
 'cameras/Camera.js',
 'cameras/Camera.js',
+'cameras/OrthoCamera.js',
 'lights/Light.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/AmbientLight.js',
 'lights/DirectionalLight.js',
 'lights/DirectionalLight.js',
@@ -262,13 +264,13 @@ WEBGL_FILES = [
 'core/Spline.js',
 'core/Spline.js',
 'core/Edge.js',
 'core/Edge.js',
 'cameras/Camera.js',
 'cameras/Camera.js',
+'cameras/OrthoCamera.js',
 'lights/Light.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/AmbientLight.js',
 'lights/DirectionalLight.js',
 'lights/DirectionalLight.js',
 'lights/PointLight.js',
 'lights/PointLight.js',
 'lights/SpotLight.js',
 'lights/SpotLight.js',
 'materials/Material.js',
 'materials/Material.js',
-'materials/Mappings.js',
 'materials/LineBasicMaterial.js',
 'materials/LineBasicMaterial.js',
 'materials/MeshBasicMaterial.js',
 'materials/MeshBasicMaterial.js',
 'materials/MeshLambertMaterial.js',
 'materials/MeshLambertMaterial.js',
@@ -278,7 +280,7 @@ WEBGL_FILES = [
 'materials/MeshFaceMaterial.js',
 'materials/MeshFaceMaterial.js',
 'materials/MeshShaderMaterial.js',
 'materials/MeshShaderMaterial.js',
 'materials/ParticleBasicMaterial.js',
 'materials/ParticleBasicMaterial.js',
-'materials/Texture.js',
+'textures/Texture.js',
 'objects/Particle.js',
 'objects/Particle.js',
 'objects/ParticleSystem.js',
 'objects/ParticleSystem.js',
 'objects/Line.js',
 'objects/Line.js',

部分文件因文件數量過多而無法顯示