瀏覽代碼

Rebuilt libs.

alteredq 14 年之前
父節點
當前提交
fe83a3f052
共有 100 個文件被更改,包括 950 次插入973 次删除
  1. 1 1
      README.md
  2. 342 343
      build/Three.js
  3. 6 6
      build/custom/ThreeCanvas.js
  4. 6 6
      build/custom/ThreeDOM.js
  5. 207 208
      build/custom/ThreeExtras.js
  6. 6 6
      build/custom/ThreeSVG.js
  7. 6 6
      build/custom/ThreeWebGL.js
  8. 6 6
      examples/canvas_camera_orthographic.html
  9. 1 1
      examples/canvas_geometry_birds.html
  10. 2 2
      examples/canvas_geometry_cube.html
  11. 2 2
      examples/canvas_geometry_earth.html
  12. 2 2
      examples/canvas_geometry_hierarchy.html
  13. 1 1
      examples/canvas_geometry_panorama.html
  14. 1 1
      examples/canvas_geometry_panorama_fisheye.html
  15. 1 1
      examples/canvas_geometry_terrain.html
  16. 2 2
      examples/canvas_geometry_text.html
  17. 2 2
      examples/canvas_interactive_cubes.html
  18. 1 1
      examples/canvas_interactive_cubes_tween.html
  19. 1 1
      examples/canvas_interactive_particles.html
  20. 8 8
      examples/canvas_interactive_voxelpainter.html
  21. 8 8
      examples/canvas_lights_pointlights.html
  22. 8 8
      examples/canvas_lights_pointlights_smooth.html
  23. 2 2
      examples/canvas_lines.html
  24. 2 2
      examples/canvas_lines_sphere.html
  25. 7 7
      examples/canvas_materials.html
  26. 5 5
      examples/canvas_materials_depth.html
  27. 1 1
      examples/canvas_materials_normal.html
  28. 1 1
      examples/canvas_materials_reflection.html
  29. 3 3
      examples/canvas_materials_video.html
  30. 1 1
      examples/canvas_particles_floor.html
  31. 2 2
      examples/canvas_particles_random.html
  32. 5 5
      examples/canvas_particles_shapes.html
  33. 1 1
      examples/canvas_particles_sprites.html
  34. 1 1
      examples/canvas_particles_waves.html
  35. 6 6
      examples/canvas_performance.html
  36. 6 6
      examples/canvas_sandbox.html
  37. 5 5
      examples/misc_camera_path.html
  38. 9 9
      examples/misc_camera_roll.html
  39. 8 8
      examples/misc_camera_trackball.html
  40. 7 7
      examples/misc_lights_test.html
  41. 2 2
      examples/misc_lookat.html
  42. 9 15
      examples/misc_materials_multimaterials.html
  43. 4 4
      examples/misc_sound.html
  44. 19 16
      examples/misc_ubiquity_test.html
  45. 7 9
      examples/scenes/test_scene.js
  46. 4 4
      examples/webgl_animation_skinning.html
  47. 6 6
      examples/webgl_collada.html
  48. 3 3
      examples/webgl_collisions_box.html
  49. 3 3
      examples/webgl_collisions_mesh.html
  50. 4 4
      examples/webgl_collisions_normal.html
  51. 5 5
      examples/webgl_collisions_primitives.html
  52. 5 5
      examples/webgl_collisions_reaction.html
  53. 4 4
      examples/webgl_collisions_terrain.html
  54. 4 4
      examples/webgl_collisions_trigger.html
  55. 1 1
      examples/webgl_custom_attributes.html
  56. 2 2
      examples/webgl_custom_attributes_particles.html
  57. 2 2
      examples/webgl_custom_attributes_particles2.html
  58. 2 2
      examples/webgl_custom_attributes_particles3.html
  59. 6 6
      examples/webgl_flycamera_earth.html
  60. 12 12
      examples/webgl_geometries.html
  61. 3 5
      examples/webgl_geometry_blenderexport_colors.html
  62. 7 7
      examples/webgl_geometry_colors.html
  63. 1 5
      examples/webgl_geometry_dynamic.html
  64. 2 2
      examples/webgl_geometry_hierarchy.html
  65. 7 7
      examples/webgl_geometry_hierarchy2.html
  66. 5 5
      examples/webgl_geometry_large_mesh.html
  67. 3 3
      examples/webgl_geometry_minecraft.html
  68. 3 3
      examples/webgl_geometry_minecraft_ao.html
  69. 8 8
      examples/webgl_geometry_shapes.html
  70. 1 1
      examples/webgl_geometry_terrain.html
  71. 1 1
      examples/webgl_geometry_terrain_fog.html
  72. 8 8
      examples/webgl_geometry_text.html
  73. 2 2
      examples/webgl_hdr.html
  74. 3 3
      examples/webgl_interactive_cubes.html
  75. 7 7
      examples/webgl_interactive_voxelpainter.html
  76. 8 18
      examples/webgl_lights_pointlights.html
  77. 1 1
      examples/webgl_lines_colors.html
  78. 1 1
      examples/webgl_lines_cubes.html
  79. 1 1
      examples/webgl_lines_sphere.html
  80. 1 1
      examples/webgl_lines_splines.html
  81. 3 3
      examples/webgl_lod.html
  82. 3 3
      examples/webgl_lod_text.html
  83. 6 6
      examples/webgl_materials.html
  84. 6 6
      examples/webgl_materials_cars.html
  85. 6 6
      examples/webgl_materials_cars_anaglyph.html
  86. 5 5
      examples/webgl_materials_cars_camaro.html
  87. 5 5
      examples/webgl_materials_cars_camaro_crosseyed.html
  88. 7 7
      examples/webgl_materials_cubemap.html
  89. 2 2
      examples/webgl_materials_cubemap_balls_reflection.html
  90. 2 2
      examples/webgl_materials_cubemap_balls_reflection_anaglyph.html
  91. 2 2
      examples/webgl_materials_cubemap_balls_refraction.html
  92. 2 2
      examples/webgl_materials_cubemap_balls_refraction_crosseyed.html
  93. 2 2
      examples/webgl_materials_cubemap_escher.html
  94. 7 7
      examples/webgl_materials_cubemap_refraction.html
  95. 1 1
      examples/webgl_materials_grass.html
  96. 6 6
      examples/webgl_materials_normalmap.html
  97. 4 4
      examples/webgl_materials_normalmap2.html
  98. 5 5
      examples/webgl_materials_shaders.html
  99. 2 2
      examples/webgl_materials_shaders_fresnel.html
  100. 5 5
      examples/webgl_materials_texture_filters.html

+ 1 - 1
README.md

@@ -104,7 +104,7 @@ This code creates a camera, then creates a scene, adds a cube on it, creates a &
 			material = new THREE.MeshBasicMaterial( { color: 0xff0000, wireframe: true } );
 
 			mesh = new THREE.Mesh( geometry, material );
-			scene.addObject( mesh );
+			scene.add( mesh );
 
 			renderer = new THREE.CanvasRenderer();
 			renderer.setSize( window.innerWidth, window.innerHeight );

+ 342 - 343
build/Three.js

@@ -1,91 +1,91 @@
 // Three.js r45dev - 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(!self.Int32Array)self.Int32Array=Array,self.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,h,m;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),h=b*6-f,b=e*(1-c),m=e*(1-c*h),c=e*(1-c*(1-h)),f){case 1:this.r=m;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=m;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=m;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.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},
 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)},
 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=
-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*
-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.x=b||0;this.y=c||0;this.z=e||0;this.w=f||1};
+THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(b,c,e){this.x=b;this.y=c;this.z=e;return this},setX:function(b){this.x=b;return this},setY:function(b){this.y=b;return this},setZ:function(b){this.z=b;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){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*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.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,e){return b.distance-e.distance});return f},intersectObject:function(b){function c(b,e,c){var f;f=c.clone().subSelf(b).dot(e);if(f<=0)return null;b=b.clone().addSelf(e.clone().multiplyScalar(f));return c.distanceTo(b)}function e(b,e,c,f){var f=f.clone().subSelf(e),
 c=c.clone().subSelf(e),h=b.clone().subSelf(e),b=f.dot(f),e=f.dot(c),f=f.dot(h),k=c.dot(c),c=c.dot(h),h=1/(b*k-e*e),k=(k*f-e*c)*h,b=(b*c-e*f)*h;return k>0&&b>0&&k+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 h,m,k,n,t,p,v,u,x,w,y=b.geometry,z=y.vertices,A=[],f=0;for(h=y.faces.length;f<h;f++)if(m=y.faces[f],x=this.origin.clone(),w=this.direction.clone(),p=b.matrixWorld,k=p.multiplyVector3(m.centroid.clone()).subSelf(x),u=k.dot(w),!(u<=0)&&(k=p.multiplyVector3(z[m.a].position.clone()),n=p.multiplyVector3(z[m.b].position.clone()),t=p.multiplyVector3(z[m.c].position.clone()),p=m instanceof THREE.Face4?p.multiplyVector3(z[m.d].position.clone()):null,v=b.matrixRotationWorld.multiplyVector3(m.normal.clone()),
-u=w.dot(v),b.doubleSided||(b.flipSided?u>0:u<0)))if(u=v.dot((new THREE.Vector3).sub(k,x))/u,x=x.addSelf(w.multiplyScalar(u)),m instanceof THREE.Face3)e(x,k,n,t)&&(m={distance:this.origin.distanceTo(x),point:x,face:m,object:b},A.push(m));else if(m instanceof THREE.Face4&&(e(x,k,n,p)||e(x,n,t,p)))m={distance:this.origin.distanceTo(x),point:x,face:m,object:b},A.push(m);A.sort(function(b,e){return b.distance-e.distance});return A}else return[]}};
-THREE.Rectangle=function(){function b(){m=f-c;k=h-e}var c,e,f,h,m,k,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return m};this.getHeight=function(){return k};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,v,u){n=!1;c=k;e=m;f=v;h=u;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=c<k?c:k,e=e<m?e:m,f=f>k?f:k,h=h>m?h:m);b()};this.add3Points=
-function(k,m,v,u,x,w){n?(n=!1,c=k<v?k<x?k:x:v<x?v:x,e=m<u?m<w?m:w:u<w?u:w,f=k>v?k>x?k:x:v>x?v:x,h=m>u?m>w?m:w:u>w?u:w):(c=k<v?k<x?k<c?k:c:x<c?x:c:v<x?v<c?v:c:x<c?x:c,e=m<u?m<w?m<e?m:e:w<e?w:e:u<w?u<e?u:e:w<e?w:e,f=k>v?k>x?k>f?k:f:x>f?x:f:v>x?v>f?v:f:x>f?x:f,h=m>u?m>w?m>h?m:h:w>h?w:h:u>w?u>h?u:h:w>h?w:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=c<k.getLeft()?c:k.getLeft(),e=e<k.getTop()?e:k.getTop(),f=f>k.getRight()?f:k.getRight(),h=h>
+Math.max(b.scale.y,b.scale.z)))return[];var h,m,k,n,p,v,u,t,x,w,y=b.geometry,z=y.vertices,A=[],f=0;for(h=y.faces.length;f<h;f++)if(m=y.faces[f],x=this.origin.clone(),w=this.direction.clone(),v=b.matrixWorld,k=v.multiplyVector3(m.centroid.clone()).subSelf(x),t=k.dot(w),!(t<=0)&&(k=v.multiplyVector3(z[m.a].position.clone()),n=v.multiplyVector3(z[m.b].position.clone()),p=v.multiplyVector3(z[m.c].position.clone()),v=m instanceof THREE.Face4?v.multiplyVector3(z[m.d].position.clone()):null,u=b.matrixRotationWorld.multiplyVector3(m.normal.clone()),
+t=w.dot(u),b.doubleSided||(b.flipSided?t>0:t<0)))if(t=u.dot((new THREE.Vector3).sub(k,x))/t,x=x.addSelf(w.multiplyScalar(t)),m instanceof THREE.Face3)e(x,k,n,p)&&(m={distance:this.origin.distanceTo(x),point:x,face:m,object:b},A.push(m));else if(m instanceof THREE.Face4&&(e(x,k,n,v)||e(x,n,p,v)))m={distance:this.origin.distanceTo(x),point:x,face:m,object:b},A.push(m);A.sort(function(b,e){return b.distance-e.distance});return A}else return[]}};
+THREE.Rectangle=function(){function b(){m=f-c;k=h-e}var c,e,f,h,m,k,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return m};this.getHeight=function(){return k};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,u,t){n=!1;c=k;e=m;f=u;h=t;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=c<k?c:k,e=e<m?e:m,f=f>k?f:k,h=h>m?h:m);b()};this.add3Points=
+function(k,m,u,t,x,w){n?(n=!1,c=k<u?k<x?k:x:u<x?u:x,e=m<t?m<w?m:w:t<w?t:w,f=k>u?k>x?k:x:u>x?u:x,h=m>t?m>w?m:w:t>w?t:w):(c=k<u?k<x?k<c?k:c:x<c?x:c:u<x?u<c?u:c:x<c?x:c,e=m<t?m<w?m<e?m:e:w<e?w:e:t<w?t<e?t:e:w<e?w:e,f=k>u?k>x?k>f?k:f:x>f?x:f:u>x?u>f?u:f:x>f?x:f,h=m>t?m>w?m>h?m:h:w>h?w:h:t>w?t>h?t:h:w>h?w:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=c<k.getLeft()?c:k.getLeft(),e=e<k.getTop()?e:k.getTop(),f=f>k.getRight()?f:k.getRight(),h=h>
 k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f<k.getRight()?f:k.getRight();h=h<k.getBottom()?h:k.getBottom();b()};this.instersects=function(b){return Math.min(f,b.getRight())-Math.max(c,b.getLeft())>=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}};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,h,m,k,n,t,p,v,u,x,w,y,z){this.set(b||1,c||0,e||0,f||0,h||0,m||1,k||0,n||0,t||0,p||0,v||1,u||0,x||0,w||0,y||0,z||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,h,m,k,n,t,p,v,u,x,w,y,z){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=h;this.n22=m;this.n23=k;this.n24=n;this.n31=t;this.n32=p;this.n33=v;this.n34=u;this.n41=x;this.n42=w;this.n43=y;this.n44=z;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,h,m,k,n,p,v,u,t,x,w,y,z){this.set(b||1,c||0,e||0,f||0,h||0,m||1,k||0,n||0,p||0,v||0,u||1,t||0,x||0,w||0,y||0,z||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,h,m,k,n,p,v,u,t,x,w,y,z){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=h;this.n22=m;this.n23=k;this.n24=n;this.n31=p;this.n32=v;this.n33=u;this.n34=t;this.n41=x;this.n42=w;this.n43=y;this.n44=z;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,h=THREE.Matrix4.__v2,m=THREE.Matrix4.__v3;m.sub(b,c).normalize();if(m.length()===0)m.z=1;f.cross(e,m).normalize();f.length()===0&&(m.x+=1.0E-4,f.cross(e,m).normalize());h.cross(m,f).normalize();this.n11=f.x;this.n12=h.x;this.n13=m.x;this.n21=f.y;this.n22=h.y;this.n23=m.y;this.n31=f.z;this.n32=h.z;this.n33=m.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,f=b.z,h=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)*h;
 b.y=(this.n21*c+this.n22*e+this.n23*f+this.n24)*h;b.z=(this.n31*c+this.n32*e+this.n33*f+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,e=b.y,f=b.z,h=b.w;b.x=this.n11*c+this.n12*e+this.n13*f+this.n14*h;b.y=this.n21*c+this.n22*e+this.n23*f+this.n24*h;b.z=this.n31*c+this.n32*e+this.n33*f+this.n34*h;b.w=this.n41*c+this.n42*e+this.n43*f+this.n44*h;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,h=b.n13,m=b.n14,k=b.n21,n=b.n22,t=b.n23,p=b.n24,v=b.n31,u=b.n32,x=b.n33,w=b.n34,y=b.n41,z=b.n42,A=b.n43,C=b.n44,E=c.n11,G=c.n12,
-H=c.n13,O=c.n14,S=c.n21,J=c.n22,I=c.n23,K=c.n24,W=c.n31,D=c.n32,M=c.n33,U=c.n34,V=c.n41,R=c.n42,o=c.n43,pa=c.n44;this.n11=e*E+f*S+h*W+m*V;this.n12=e*G+f*J+h*D+m*R;this.n13=e*H+f*I+h*M+m*o;this.n14=e*O+f*K+h*U+m*pa;this.n21=k*E+n*S+t*W+p*V;this.n22=k*G+n*J+t*D+p*R;this.n23=k*H+n*I+t*M+p*o;this.n24=k*O+n*K+t*U+p*pa;this.n31=v*E+u*S+x*W+w*V;this.n32=v*G+u*J+x*D+w*R;this.n33=v*H+u*I+x*M+w*o;this.n34=v*O+u*K+x*U+w*pa;this.n41=y*E+z*S+A*W+C*V;this.n42=y*G+z*J+A*D+C*R;this.n43=y*H+z*I+A*M+C*o;this.n44=y*
-O+z*K+A*U+C*pa;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,h=this.n21,m=this.n22,k=this.n23,n=this.n24,t=this.n31,p=this.n32,v=this.n33,u=this.n34,x=this.n41,w=this.n42,y=this.n43,z=this.n44;return f*k*p*x-e*n*p*x-f*m*v*x+c*n*v*x+e*m*u*x-c*k*u*x-f*k*t*w+e*n*t*w+f*h*v*w-b*n*v*w-e*h*u*w+b*k*u*w+f*m*t*y-c*n*t*y-f*h*p*y+b*n*p*y+c*h*u*y-b*m*u*y-e*m*t*z+c*k*t*z+e*h*p*z-b*k*p*z-c*h*
-v*z+b*m*v*z},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=
+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,h=b.n13,m=b.n14,k=b.n21,n=b.n22,p=b.n23,v=b.n24,u=b.n31,t=b.n32,x=b.n33,w=b.n34,y=b.n41,z=b.n42,A=b.n43,C=b.n44,E=c.n11,G=c.n12,
+H=c.n13,N=c.n14,S=c.n21,J=c.n22,I=c.n23,K=c.n24,W=c.n31,D=c.n32,M=c.n33,U=c.n34,V=c.n41,R=c.n42,o=c.n43,pa=c.n44;this.n11=e*E+f*S+h*W+m*V;this.n12=e*G+f*J+h*D+m*R;this.n13=e*H+f*I+h*M+m*o;this.n14=e*N+f*K+h*U+m*pa;this.n21=k*E+n*S+p*W+v*V;this.n22=k*G+n*J+p*D+v*R;this.n23=k*H+n*I+p*M+v*o;this.n24=k*N+n*K+p*U+v*pa;this.n31=u*E+t*S+x*W+w*V;this.n32=u*G+t*J+x*D+w*R;this.n33=u*H+t*I+x*M+w*o;this.n34=u*N+t*K+x*U+w*pa;this.n41=y*E+z*S+A*W+C*V;this.n42=y*G+z*J+A*D+C*R;this.n43=y*H+z*I+A*M+C*o;this.n44=y*
+N+z*K+A*U+C*pa;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,h=this.n21,m=this.n22,k=this.n23,n=this.n24,p=this.n31,v=this.n32,u=this.n33,t=this.n34,x=this.n41,w=this.n42,y=this.n43,z=this.n44;return f*k*v*x-e*n*v*x-f*m*u*x+c*n*u*x+e*m*t*x-c*k*t*x-f*k*p*w+e*n*p*w+f*h*u*w-b*n*u*w-e*h*t*w+b*k*t*w+f*m*p*y-c*n*p*y-f*h*v*y+b*n*v*y+c*h*t*y-b*m*t*y-e*m*p*z+c*k*p*z+e*h*v*z-b*k*v*z-c*h*
+u*z+b*m*u*z},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[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,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),f=Math.sin(c),h=1-e,m=b.x,k=b.y,n=b.z,t=h*m,p=h*k;this.set(t*m+e,t*k-f*n,t*n+f*k,0,t*k+f*n,p*k+e,p*n-f*m,0,t*n-f*k,p*n+f*m,h*n*n+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,h=b.z,m=Math.cos(e),e=Math.sin(e),k=Math.cos(f),f=Math.sin(f),n=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var t=
-k*n,p=k*h,v=f*n,u=f*h;this.n11=t+u*e;this.n12=v*e-p;this.n13=m*f;this.n21=m*h;this.n22=m*n;this.n23=-e;this.n31=p*e-v;this.n32=u+t*e;this.n33=m*k;break;case "ZXY":t=k*n;p=k*h;v=f*n;u=f*h;this.n11=t-u*e;this.n12=-m*h;this.n13=v+p*e;this.n21=p+v*e;this.n22=m*n;this.n23=u-t*e;this.n31=-m*f;this.n32=e;this.n33=m*k;break;case "ZYX":t=m*n;p=m*h;v=e*n;u=e*h;this.n11=k*n;this.n12=v*f-p;this.n13=t*f+u;this.n21=k*h;this.n22=u*f+t;this.n23=p*f-v;this.n31=-f;this.n32=e*k;this.n33=m*k;break;case "YZX":t=m*k;p=
-m*f;v=e*k;u=e*f;this.n11=k*n;this.n12=u-t*h;this.n13=v*h+p;this.n21=h;this.n22=m*n;this.n23=-e*n;this.n31=-f*n;this.n32=p*h+v;this.n33=t-u*h;break;case "XZY":t=m*k;p=m*f;v=e*k;u=e*f;this.n11=k*n;this.n12=-h;this.n13=f*n;this.n21=t*h+u;this.n22=m*n;this.n23=p*h-v;this.n31=v*h-p;this.n32=e*n;this.n33=u*h+t;break;default:t=m*n,p=m*h,v=e*n,u=e*h,this.n11=k*n,this.n12=-k*h,this.n13=f,this.n21=p+v*f,this.n22=t-u*f,this.n23=-e*k,this.n31=u-t*f,this.n32=v+p*f,this.n33=m*k}return this},setRotationFromQuaternion:function(b){var c=
-b.x,e=b.y,f=b.z,h=b.w,m=c+c,k=e+e,n=f+f,b=c*m,t=c*k;c*=n;var p=e*k;e*=n;f*=n;m*=h;k*=h;h*=n;this.n11=1-(p+f);this.n12=t-h;this.n13=c+k;this.n21=t+h;this.n22=1-(b+f);this.n23=e-m;this.n31=c-k;this.n32=e+m;this.n33=1-(b+p);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,h=THREE.Matrix4.__m2;
+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),h=1-e,m=b.x,k=b.y,n=b.z,p=h*m,v=h*k;this.set(p*m+e,p*k-f*n,p*n+f*k,0,p*k+f*n,v*k+e,v*n-f*m,0,p*n-f*k,v*n+f*m,h*n*n+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,h=b.z,m=Math.cos(e),e=Math.sin(e),k=Math.cos(f),f=Math.sin(f),n=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var p=
+k*n,v=k*h,u=f*n,t=f*h;this.n11=p+t*e;this.n12=u*e-v;this.n13=m*f;this.n21=m*h;this.n22=m*n;this.n23=-e;this.n31=v*e-u;this.n32=t+p*e;this.n33=m*k;break;case "ZXY":p=k*n;v=k*h;u=f*n;t=f*h;this.n11=p-t*e;this.n12=-m*h;this.n13=u+v*e;this.n21=v+u*e;this.n22=m*n;this.n23=t-p*e;this.n31=-m*f;this.n32=e;this.n33=m*k;break;case "ZYX":p=m*n;v=m*h;u=e*n;t=e*h;this.n11=k*n;this.n12=u*f-v;this.n13=p*f+t;this.n21=k*h;this.n22=t*f+p;this.n23=v*f-u;this.n31=-f;this.n32=e*k;this.n33=m*k;break;case "YZX":p=m*k;v=
+m*f;u=e*k;t=e*f;this.n11=k*n;this.n12=t-p*h;this.n13=u*h+v;this.n21=h;this.n22=m*n;this.n23=-e*n;this.n31=-f*n;this.n32=v*h+u;this.n33=p-t*h;break;case "XZY":p=m*k;v=m*f;u=e*k;t=e*f;this.n11=k*n;this.n12=-h;this.n13=f*n;this.n21=p*h+t;this.n22=m*n;this.n23=v*h-u;this.n31=u*h-v;this.n32=e*n;this.n33=t*h+p;break;default:p=m*n,v=m*h,u=e*n,t=e*h,this.n11=k*n,this.n12=-k*h,this.n13=f,this.n21=v+u*f,this.n22=p-t*f,this.n23=-e*k,this.n31=t-p*f,this.n32=u+v*f,this.n33=m*k}return this},setRotationFromQuaternion:function(b){var c=
+b.x,e=b.y,f=b.z,h=b.w,m=c+c,k=e+e,n=f+f,b=c*m,p=c*k;c*=n;var v=e*k;e*=n;f*=n;m*=h;k*=h;h*=n;this.n11=1-(v+f);this.n12=p-h;this.n13=c+k;this.n21=p+h;this.n22=1-(b+f);this.n23=e-m;this.n31=c-k;this.n32=e+m;this.n33=1-(b+v);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,h=THREE.Matrix4.__m2;
 f.identity();f.setRotationFromQuaternion(c);h.setScale(e.x,e.y,e.z);this.multiply(f,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,m=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);m.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=h.length();e.z=m.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,h=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*h;this.n23=
 b.n23*h;this.n33=b.n33*h}};
-THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,h=b.n13,m=b.n14,k=b.n21,n=b.n22,t=b.n23,p=b.n24,v=b.n31,u=b.n32,x=b.n33,w=b.n34,y=b.n41,z=b.n42,A=b.n43,C=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=t*w*z-p*x*z+p*u*A-n*w*A-t*u*C+n*x*C;c.n12=m*x*z-h*w*z-m*u*A+f*w*A+h*u*C-f*x*C;c.n13=h*p*z-m*t*z+m*n*A-f*p*A-h*n*C+f*t*C;c.n14=m*t*u-h*p*u-m*n*x+f*p*x+h*n*w-f*t*w;c.n21=p*x*y-t*w*y-p*v*A+k*w*A+t*v*C-k*x*C;c.n22=h*w*y-m*x*y+m*v*A-e*w*A-h*v*C+e*x*C;c.n23=m*t*y-h*p*y-m*k*A+e*p*A+h*k*C-e*t*C;c.n24=
-h*p*v-m*t*v+m*k*x-e*p*x-h*k*w+e*t*w;c.n31=n*w*y-p*u*y+p*v*z-k*w*z-n*v*C+k*u*C;c.n32=m*u*y-f*w*y-m*v*z+e*w*z+f*v*C-e*u*C;c.n33=h*p*y-m*n*y+m*k*z-e*p*z-f*k*C+e*n*C;c.n34=m*n*v-f*p*v-m*k*u+e*p*u+f*k*w-e*n*w;c.n41=t*u*y-n*x*y-t*v*z+k*x*z+n*v*A-k*u*A;c.n42=f*x*y-h*u*y+h*v*z-e*x*z-f*v*A+e*u*A;c.n43=h*n*y-f*t*y-h*k*z+e*t*z+f*k*A-e*n*A;c.n44=f*t*v-h*n*v+h*k*u-e*t*u-f*k*x+e*n*x;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,h=-b.n33*b.n21+b.n31*b.n23,m=b.n32*b.n21-b.n31*b.n22,k=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,t=-b.n32*b.n11+b.n31*b.n12,p=b.n23*b.n12-b.n22*b.n13,v=-b.n23*b.n11+b.n21*b.n13,u=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*k+b.n31*p;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*h;e[2]=b*m;e[3]=b*k;e[4]=b*n;e[5]=b*t;e[6]=b*p;e[7]=b*v;e[8]=b*u;return c};
+THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,h=b.n13,m=b.n14,k=b.n21,n=b.n22,p=b.n23,v=b.n24,u=b.n31,t=b.n32,x=b.n33,w=b.n34,y=b.n41,z=b.n42,A=b.n43,C=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=p*w*z-v*x*z+v*t*A-n*w*A-p*t*C+n*x*C;c.n12=m*x*z-h*w*z-m*t*A+f*w*A+h*t*C-f*x*C;c.n13=h*v*z-m*p*z+m*n*A-f*v*A-h*n*C+f*p*C;c.n14=m*p*t-h*v*t-m*n*x+f*v*x+h*n*w-f*p*w;c.n21=v*x*y-p*w*y-v*u*A+k*w*A+p*u*C-k*x*C;c.n22=h*w*y-m*x*y+m*u*A-e*w*A-h*u*C+e*x*C;c.n23=m*p*y-h*v*y-m*k*A+e*v*A+h*k*C-e*p*C;c.n24=
+h*v*u-m*p*u+m*k*x-e*v*x-h*k*w+e*p*w;c.n31=n*w*y-v*t*y+v*u*z-k*w*z-n*u*C+k*t*C;c.n32=m*t*y-f*w*y-m*u*z+e*w*z+f*u*C-e*t*C;c.n33=h*v*y-m*n*y+m*k*z-e*v*z-f*k*C+e*n*C;c.n34=m*n*u-f*v*u-m*k*t+e*v*t+f*k*w-e*n*w;c.n41=p*t*y-n*x*y-p*u*z+k*x*z+n*u*A-k*t*A;c.n42=f*x*y-h*t*y+h*u*z-e*x*z-f*u*A+e*t*A;c.n43=h*n*y-f*p*y-h*k*z+e*p*z+f*k*A-e*n*A;c.n44=f*p*u-h*n*u+h*k*t-e*p*t-f*k*x+e*n*x;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,h=-b.n33*b.n21+b.n31*b.n23,m=b.n32*b.n21-b.n31*b.n22,k=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,p=-b.n32*b.n11+b.n31*b.n12,v=b.n23*b.n12-b.n22*b.n13,u=-b.n23*b.n11+b.n21*b.n13,t=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*k+b.n31*v;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*h;e[2]=b*m;e[3]=b*k;e[4]=b*n;e[5]=b*p;e[6]=b*v;e[7]=b*u;e[8]=b*t;return c};
 THREE.Matrix4.makeFrustum=function(b,c,e,f,h,m){var k;k=new THREE.Matrix4;k.n11=2*h/(c-b);k.n12=0;k.n13=(c+b)/(c-b);k.n14=0;k.n21=0;k.n22=2*h/(f-e);k.n23=(f+e)/(f-e);k.n24=0;k.n31=0;k.n32=0;k.n33=-(m+h)/(m-h);k.n34=-2*m*h/(m-h);k.n41=0;k.n42=0;k.n43=-1;k.n44=0;return k};THREE.Matrix4.makePerspective=function(b,c,e,f){var h,b=e*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,e,f)};
-THREE.Matrix4.makeOrtho=function(b,c,e,f,h,m){var k,n,t,p;k=new THREE.Matrix4;n=c-b;t=e-f;p=m-h;k.n11=2/n;k.n12=0;k.n13=0;k.n14=-((c+b)/n);k.n21=0;k.n22=2/t;k.n23=0;k.n24=-((e+f)/t);k.n31=0;k.n32=0;k.n33=-2/p;k.n34=-((m+h)/p);k.n41=0;k.n42=0;k.n43=0;k.n44=1;return k};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,h,m){var k,n,p,v;k=new THREE.Matrix4;n=c-b;p=e-f;v=m-h;k.n11=2/n;k.n12=0;k.n13=0;k.n14=-((c+b)/n);k.n21=0;k.n22=2/p;k.n23=0;k.n24=-((e+f)/p);k.n31=0;k.n32=0;k.n33=-2/v;k.n34=-((m+h)/v);k.n41=0;k.n42=0;k.n43=0;k.n44=1;return k};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.id=THREE.Object3DCount++;this.name="";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.frustumCulled=!0;this._vector=new THREE.Vector3};
 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)},add:function(b){if(this.children.indexOf(b)===
 -1){b.parent!==void 0&&b.parent.removeChild(b);b.parent=this;this.children.push(b);for(var c=this;c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.addChildRecurse(b)}},remove:function(b){var c=this.children.indexOf(b);if(c!==-1)b.parent=void 0,this.children.splice(c,1)},getChildByName:function(b,c){var e,f,h;e=0;for(f=this.children.length;e<f;e++){h=this.children[e];if(h.name===b)return h;if(c&&(h=h.getChildByName(b,c),h!==void 0))return h}},updateMatrix:function(){this.matrix.setPosition(this.position);
 this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,e){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||c)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),
 this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,c=!0;for(var b=0,f=this.children.length;b<f;b++)this.children[b].update(this.matrixWorld,c,e)},addChild:function(b){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add()");this.add(b)},removeChild:function(b){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove()");this.remove(b)}};THREE.Object3DCount=0;
-THREE.Projector=function(){function b(){var b=t[n]=t[n]||new THREE.RenderableVertex;n++;return b}function c(b,e){return e.z-b.z}function e(b,e){var c=0,f=1,k=b.z+b.w,h=e.z+e.w,m=-b.z+b.w,n=-e.z+e.w;return k>=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?c=Math.max(c,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?c=Math.max(c,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),f<c?!1:(b.lerpSelf(e,c),e.lerpSelf(b,1-f),!0))}var f,h,m=[],k,n,t=[],p,v,u=[],x,w=[],y,z,A=[],C,E,G=[],H=[],O=[],S=new THREE.Vector4,J=new THREE.Vector4,
+THREE.Projector=function(){function b(){var b=p[n]=p[n]||new THREE.RenderableVertex;n++;return b}function c(b,e){return e.z-b.z}function e(b,e){var c=0,f=1,k=b.z+b.w,h=e.z+e.w,m=-b.z+b.w,n=-e.z+e.w;return k>=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?c=Math.max(c,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?c=Math.max(c,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),f<c?!1:(b.lerpSelf(e,c),e.lerpSelf(b,1-f),!0))}var f,h,m=[],k,n,p=[],v,u,t=[],x,w=[],y,z,A=[],C,E,G=[],H=[],N=[],S=new THREE.Vector4,J=new THREE.Vector4,
 I=new THREE.Matrix4,K=new THREE.Matrix4,W=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],D=new THREE.Vector4,M=new THREE.Vector4;this.projectVector=function(b,e){I.multiply(e.projectionMatrix,e.matrixWorldInverse);I.multiplyVector3(b);return b};this.unprojectVector=function(b,e){I.multiply(e.matrixWorld,THREE.Matrix4.makeInvert(e.projectionMatrix));I.multiplyVector3(b);return b};this.projectObjects=function(b,e,k){var o,n;h=H.length=0;
-o=b.objects;b=0;for(e=o.length;b<e;b++){n=o[b];var t;if(!(t=!n.visible))if(t=n instanceof THREE.Mesh)if(t=n.frustumCulled){a:{t=void 0;for(var u=n.matrixWorld,w=-n.geometry.boundingSphere.radius*Math.max(n.scale.x,Math.max(n.scale.y,n.scale.z)),p=0;p<6;p++)if(t=W[p].x*u.n14+W[p].y*u.n24+W[p].z*u.n34+W[p].w,t<=w){t=!1;break a}t=!0}t=!t}if(!t)t=m[h]=m[h]||new THREE.RenderableObject,h++,f=t,S.copy(n.position),I.multiplyVector3(S),f.object=n,f.z=S.z,H.push(f)}k&&H.sort(c);return H};this.projectScene=
-function(f,h,m){var o=h.near,H=h.far,S,la,aa,na,ja,ka,da,Z,fa,Y,ma,ia,sa,N,ca,ua,ta;E=z=x=v=O.length=0;h.matrixAutoUpdate&&h.update(void 0,!0);f.update(void 0,!1,h);I.multiply(h.projectionMatrix,h.matrixWorldInverse);W[0].set(I.n41-I.n11,I.n42-I.n12,I.n43-I.n13,I.n44-I.n14);W[1].set(I.n41+I.n11,I.n42+I.n12,I.n43+I.n13,I.n44+I.n14);W[2].set(I.n41+I.n21,I.n42+I.n22,I.n43+I.n23,I.n44+I.n24);W[3].set(I.n41-I.n21,I.n42-I.n22,I.n43-I.n23,I.n44-I.n24);W[4].set(I.n41-I.n31,I.n42-I.n32,I.n43-I.n33,I.n44-I.n34);
-W[5].set(I.n41+I.n31,I.n42+I.n32,I.n43+I.n33,I.n44+I.n34);for(S=0;S<6;S++)fa=W[S],fa.divideScalar(Math.sqrt(fa.x*fa.x+fa.y*fa.y+fa.z*fa.z));fa=this.projectObjects(f,h,!0);f=0;for(S=fa.length;f<S;f++)if(Y=fa[f].object,Y.visible)if(ma=Y.matrixWorld,ia=Y.matrixRotationWorld,sa=Y.materials,N=Y.overdraw,n=0,Y instanceof THREE.Mesh){ca=Y.geometry;na=ca.vertices;ua=ca.faces;ca=ca.faceVertexUvs;la=0;for(aa=na.length;la<aa;la++)k=b(),k.positionWorld.copy(na[la].position),ma.multiplyVector3(k.positionWorld),
-k.positionScreen.copy(k.positionWorld),I.multiplyVector4(k.positionScreen),k.positionScreen.x/=k.positionScreen.w,k.positionScreen.y/=k.positionScreen.w,k.visible=k.positionScreen.z>o&&k.positionScreen.z<H;na=0;for(la=ua.length;na<la;na++){aa=ua[na];if(aa instanceof THREE.Face3)if(ja=t[aa.a],ka=t[aa.b],da=t[aa.c],ja.visible&&ka.visible&&da.visible&&(Y.doubleSided||Y.flipSided!=(da.positionScreen.x-ja.positionScreen.x)*(ka.positionScreen.y-ja.positionScreen.y)-(da.positionScreen.y-ja.positionScreen.y)*
-(ka.positionScreen.x-ja.positionScreen.x)<0))Z=u[v]=u[v]||new THREE.RenderableFace3,v++,p=Z,p.v1.copy(ja),p.v2.copy(ka),p.v3.copy(da);else continue;else if(aa instanceof THREE.Face4)if(ja=t[aa.a],ka=t[aa.b],da=t[aa.c],Z=t[aa.d],ja.visible&&ka.visible&&da.visible&&Z.visible&&(Y.doubleSided||Y.flipSided!=((Z.positionScreen.x-ja.positionScreen.x)*(ka.positionScreen.y-ja.positionScreen.y)-(Z.positionScreen.y-ja.positionScreen.y)*(ka.positionScreen.x-ja.positionScreen.x)<0||(ka.positionScreen.x-da.positionScreen.x)*
-(Z.positionScreen.y-da.positionScreen.y)-(ka.positionScreen.y-da.positionScreen.y)*(Z.positionScreen.x-da.positionScreen.x)<0)))ta=w[x]=w[x]||new THREE.RenderableFace4,x++,p=ta,p.v1.copy(ja),p.v2.copy(ka),p.v3.copy(da),p.v4.copy(Z);else continue;p.normalWorld.copy(aa.normal);ia.multiplyVector3(p.normalWorld);p.centroidWorld.copy(aa.centroid);ma.multiplyVector3(p.centroidWorld);p.centroidScreen.copy(p.centroidWorld);I.multiplyVector3(p.centroidScreen);da=aa.vertexNormals;ja=0;for(ka=da.length;ja<ka;ja++)Z=
-p.vertexNormalsWorld[ja],Z.copy(da[ja]),ia.multiplyVector3(Z);ja=0;for(ka=ca.length;ja<ka;ja++)if(ta=ca[ja][na]){da=0;for(Z=ta.length;da<Z;da++)p.uvs[ja][da]=ta[da]}p.meshMaterials=sa;p.faceMaterials=aa.materials;p.overdraw=N;p.z=p.centroidScreen.z;O.push(p)}}else if(Y instanceof THREE.Line){K.multiply(I,ma);na=Y.geometry.vertices;ja=b();ja.positionScreen.copy(na[0].position);K.multiplyVector4(ja.positionScreen);la=1;for(aa=na.length;la<aa;la++)if(ja=b(),ja.positionScreen.copy(na[la].position),K.multiplyVector4(ja.positionScreen),
-ka=t[n-2],D.copy(ja.positionScreen),M.copy(ka.positionScreen),e(D,M))D.multiplyScalar(1/D.w),M.multiplyScalar(1/M.w),ma=A[z]=A[z]||new THREE.RenderableLine,z++,y=ma,y.v1.positionScreen.copy(D),y.v2.positionScreen.copy(M),y.z=Math.max(D.z,M.z),y.materials=Y.materials,O.push(y)}else if(Y instanceof THREE.Particle&&(J.set(Y.matrixWorld.n14,Y.matrixWorld.n24,Y.matrixWorld.n34,1),I.multiplyVector4(J),J.z/=J.w,J.z>0&&J.z<1))ma=G[E]=G[E]||new THREE.RenderableParticle,E++,C=ma,C.x=J.x/J.w,C.y=J.y/J.w,C.z=
-J.z,C.rotation=Y.rotation.z,C.scale.x=Y.scale.x*Math.abs(C.x-(J.x+h.projectionMatrix.n11)/(J.w+h.projectionMatrix.n14)),C.scale.y=Y.scale.y*Math.abs(C.y-(J.y+h.projectionMatrix.n22)/(J.w+h.projectionMatrix.n24)),C.materials=Y.materials,O.push(C);m&&O.sort(c);return O}};THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)};
+o=b.objects;b=0;for(e=o.length;b<e;b++){n=o[b];var t;if(!(t=!n.visible))if(t=n instanceof THREE.Mesh)if(t=n.frustumCulled){a:{t=void 0;for(var w=n.matrixWorld,p=-n.geometry.boundingSphere.radius*Math.max(n.scale.x,Math.max(n.scale.y,n.scale.z)),v=0;v<6;v++)if(t=W[v].x*w.n14+W[v].y*w.n24+W[v].z*w.n34+W[v].w,t<=p){t=!1;break a}t=!0}t=!t}if(!t)t=m[h]=m[h]||new THREE.RenderableObject,h++,f=t,S.copy(n.position),I.multiplyVector3(S),f.object=n,f.z=S.z,H.push(f)}k&&H.sort(c);return H};this.projectScene=
+function(f,h,m){var o=h.near,H=h.far,S,la,aa,na,ja,ka,ea,Z,ga,Y,ma,ia,sa,O,da,ua,ta;E=z=x=u=N.length=0;h.matrixAutoUpdate&&h.update(void 0,!0);f.update(void 0,!1,h);I.multiply(h.projectionMatrix,h.matrixWorldInverse);W[0].set(I.n41-I.n11,I.n42-I.n12,I.n43-I.n13,I.n44-I.n14);W[1].set(I.n41+I.n11,I.n42+I.n12,I.n43+I.n13,I.n44+I.n14);W[2].set(I.n41+I.n21,I.n42+I.n22,I.n43+I.n23,I.n44+I.n24);W[3].set(I.n41-I.n21,I.n42-I.n22,I.n43-I.n23,I.n44-I.n24);W[4].set(I.n41-I.n31,I.n42-I.n32,I.n43-I.n33,I.n44-I.n34);
+W[5].set(I.n41+I.n31,I.n42+I.n32,I.n43+I.n33,I.n44+I.n34);for(S=0;S<6;S++)ga=W[S],ga.divideScalar(Math.sqrt(ga.x*ga.x+ga.y*ga.y+ga.z*ga.z));ga=this.projectObjects(f,h,!0);f=0;for(S=ga.length;f<S;f++)if(Y=ga[f].object,Y.visible)if(ma=Y.matrixWorld,ia=Y.matrixRotationWorld,sa=Y.materials,O=Y.overdraw,n=0,Y instanceof THREE.Mesh){da=Y.geometry;na=da.vertices;ua=da.faces;da=da.faceVertexUvs;la=0;for(aa=na.length;la<aa;la++)k=b(),k.positionWorld.copy(na[la].position),ma.multiplyVector3(k.positionWorld),
+k.positionScreen.copy(k.positionWorld),I.multiplyVector4(k.positionScreen),k.positionScreen.x/=k.positionScreen.w,k.positionScreen.y/=k.positionScreen.w,k.visible=k.positionScreen.z>o&&k.positionScreen.z<H;na=0;for(la=ua.length;na<la;na++){aa=ua[na];if(aa instanceof THREE.Face3)if(ja=p[aa.a],ka=p[aa.b],ea=p[aa.c],ja.visible&&ka.visible&&ea.visible&&(Y.doubleSided||Y.flipSided!=(ea.positionScreen.x-ja.positionScreen.x)*(ka.positionScreen.y-ja.positionScreen.y)-(ea.positionScreen.y-ja.positionScreen.y)*
+(ka.positionScreen.x-ja.positionScreen.x)<0))Z=t[u]=t[u]||new THREE.RenderableFace3,u++,v=Z,v.v1.copy(ja),v.v2.copy(ka),v.v3.copy(ea);else continue;else if(aa instanceof THREE.Face4)if(ja=p[aa.a],ka=p[aa.b],ea=p[aa.c],Z=p[aa.d],ja.visible&&ka.visible&&ea.visible&&Z.visible&&(Y.doubleSided||Y.flipSided!=((Z.positionScreen.x-ja.positionScreen.x)*(ka.positionScreen.y-ja.positionScreen.y)-(Z.positionScreen.y-ja.positionScreen.y)*(ka.positionScreen.x-ja.positionScreen.x)<0||(ka.positionScreen.x-ea.positionScreen.x)*
+(Z.positionScreen.y-ea.positionScreen.y)-(ka.positionScreen.y-ea.positionScreen.y)*(Z.positionScreen.x-ea.positionScreen.x)<0)))ta=w[x]=w[x]||new THREE.RenderableFace4,x++,v=ta,v.v1.copy(ja),v.v2.copy(ka),v.v3.copy(ea),v.v4.copy(Z);else continue;v.normalWorld.copy(aa.normal);ia.multiplyVector3(v.normalWorld);v.centroidWorld.copy(aa.centroid);ma.multiplyVector3(v.centroidWorld);v.centroidScreen.copy(v.centroidWorld);I.multiplyVector3(v.centroidScreen);ea=aa.vertexNormals;ja=0;for(ka=ea.length;ja<ka;ja++)Z=
+v.vertexNormalsWorld[ja],Z.copy(ea[ja]),ia.multiplyVector3(Z);ja=0;for(ka=da.length;ja<ka;ja++)if(ta=da[ja][na]){ea=0;for(Z=ta.length;ea<Z;ea++)v.uvs[ja][ea]=ta[ea]}v.meshMaterials=sa;v.faceMaterials=aa.materials;v.overdraw=O;v.z=v.centroidScreen.z;N.push(v)}}else if(Y instanceof THREE.Line){K.multiply(I,ma);na=Y.geometry.vertices;ja=b();ja.positionScreen.copy(na[0].position);K.multiplyVector4(ja.positionScreen);la=1;for(aa=na.length;la<aa;la++)if(ja=b(),ja.positionScreen.copy(na[la].position),K.multiplyVector4(ja.positionScreen),
+ka=p[n-2],D.copy(ja.positionScreen),M.copy(ka.positionScreen),e(D,M))D.multiplyScalar(1/D.w),M.multiplyScalar(1/M.w),ma=A[z]=A[z]||new THREE.RenderableLine,z++,y=ma,y.v1.positionScreen.copy(D),y.v2.positionScreen.copy(M),y.z=Math.max(D.z,M.z),y.materials=Y.materials,N.push(y)}else if(Y instanceof THREE.Particle&&(J.set(Y.matrixWorld.n14,Y.matrixWorld.n24,Y.matrixWorld.n34,1),I.multiplyVector4(J),J.z/=J.w,J.z>0&&J.z<1))ma=G[E]=G[E]||new THREE.RenderableParticle,E++,C=ma,C.x=J.x/J.w,C.y=J.y/J.w,C.z=
+J.z,C.rotation=Y.rotation.z,C.scale.x=Y.scale.x*Math.abs(C.x-(J.x+h.projectionMatrix.n11)/(J.w+h.projectionMatrix.n14)),C.scale.y=Y.scale.y*Math.abs(C.y-(J.y+h.projectionMatrix.n22)/(J.w+h.projectionMatrix.n24)),C.materials=Y.materials,N.push(C);m&&N.sort(c);return N}};THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)};
 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,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),m=Math.cos(e),e=Math.sin(e),k=b*c,n=f*h;this.w=k*m-n*e;this.x=k*e+n*m;this.y=f*c*m+b*h*e;this.z=b*h*m-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.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,h=this.w,m=b.x,k=b.y,n=b.z,b=b.w;this.x=c*b+h*m+e*n-f*k;this.y=e*b+h*k+f*m-c*n;this.z=f*b+h*n+c*k-e*m;this.w=h*b-c*m-e*k-f*n;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,h=b.z,m=this.x,k=this.y,n=this.z,t=this.w,p=t*e+k*h-n*f,v=t*f+n*e-m*h,u=t*h+m*f-k*e,e=-m*
-e-k*f-n*h;c.x=p*t+e*-m+v*-n-u*-k;c.y=v*t+e*-k+u*-m-p*-n;c.z=u*t+e*-n+p*-k-v*-m;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var m=Math.acos(h),k=Math.sqrt(1-h*h);if(Math.abs(k)<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;h=Math.sin((1-f)*m)/k;f=Math.sin(f*m)/k;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e};
+this.x,e=this.y,f=this.z,h=this.w,m=b.x,k=b.y,n=b.z,b=b.w;this.x=c*b+h*m+e*n-f*k;this.y=e*b+h*k+f*m-c*n;this.z=f*b+h*n+c*k-e*m;this.w=h*b-c*m-e*k-f*n;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,h=b.z,m=this.x,k=this.y,n=this.z,p=this.w,v=p*e+k*h-n*f,u=p*f+n*e-m*h,t=p*h+m*f-k*e,e=-m*
+e-k*f-n*h;c.x=v*p+e*-m+u*-n-t*-k;c.y=u*p+e*-k+t*-m-v*-n;c.z=t*p+e*-n+v*-k-u*-m;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var m=Math.acos(h),k=Math.sqrt(1-h*h);if(Math.abs(k)<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;h=Math.sin((1-f)*m)/k;f=Math.sin(f*m)/k;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e};
 THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,h,m){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=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=m instanceof Array?m:[m];this.centroid=new THREE.Vector3};
 THREE.Face4=function(b,c,e,f,h,m,k){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=m instanceof THREE.Color?m:new THREE.Color;this.vertexColors=m instanceof Array?m:[];this.vertexTangents=[];this.materials=k instanceof Array?k:[k];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=THREE.GeometryCount++;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),
-e.centroid.addSelf(this.vertices[e.d].position),e.centroid.divideScalar(4))},computeFaceNormals:function(b){var c,e,f,h,m,k,n=new THREE.Vector3,t=new THREE.Vector3;f=0;for(h=this.faces.length;f<h;f++){m=this.faces[f];if(b&&m.vertexNormals.length){n.set(0,0,0);c=0;for(e=m.vertexNormals.length;c<e;c++)n.addSelf(m.vertexNormals[c]);n.divideScalar(3)}else c=this.vertices[m.a],e=this.vertices[m.b],k=this.vertices[m.c],n.sub(k.position,e.position),t.sub(c.position,e.position),n.crossSelf(t);n.isZero()||
+e.centroid.addSelf(this.vertices[e.d].position),e.centroid.divideScalar(4))},computeFaceNormals:function(b){var c,e,f,h,m,k,n=new THREE.Vector3,p=new THREE.Vector3;f=0;for(h=this.faces.length;f<h;f++){m=this.faces[f];if(b&&m.vertexNormals.length){n.set(0,0,0);c=0;for(e=m.vertexNormals.length;c<e;c++)n.addSelf(m.vertexNormals[c]);n.divideScalar(3)}else c=this.vertices[m.a],e=this.vertices[m.b],k=this.vertices[m.c],n.sub(k.position,e.position),p.sub(c.position,e.position),n.crossSelf(p);n.isZero()||
 n.normalize();m.normal.copy(n)}},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]),
-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,e,c,f,h,m,o){n=b.vertices[e].position;t=b.vertices[c].position;p=b.vertices[f].position;v=k[h];u=k[m];x=k[o];w=t.x-n.x;y=p.x-n.x;z=t.y-n.y;A=p.y-n.y;C=t.z-n.z;E=p.z-n.z;G=u.u-v.u;H=x.u-v.u;O=u.v-v.v;S=x.v-v.v;J=1/(G*S-H*O);D.set((S*w-O*y)*
-J,(S*z-O*A)*J,(S*C-O*E)*J);M.set((G*y-H*w)*J,(G*A-H*z)*J,(G*E-H*C)*J);K[e].addSelf(D);K[c].addSelf(D);K[f].addSelf(D);W[e].addSelf(M);W[c].addSelf(M);W[f].addSelf(M)}var c,e,f,h,m,k,n,t,p,v,u,x,w,y,z,A,C,E,G,H,O,S,J,I,K=[],W=[],D=new THREE.Vector3,M=new THREE.Vector3,U=new THREE.Vector3,V=new THREE.Vector3,R=new THREE.Vector3;c=0;for(e=this.vertices.length;c<e;c++)K[c]=new THREE.Vector3,W[c]=new THREE.Vector3;c=0;for(e=this.faces.length;c<e;c++)m=this.faces[c],k=this.faceVertexUvs[0][c],m instanceof
+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,e,c,f,h,m,o){n=b.vertices[e].position;p=b.vertices[c].position;v=b.vertices[f].position;u=k[h];t=k[m];x=k[o];w=p.x-n.x;y=v.x-n.x;z=p.y-n.y;A=v.y-n.y;C=p.z-n.z;E=v.z-n.z;G=t.u-u.u;H=x.u-u.u;N=t.v-u.v;S=x.v-u.v;J=1/(G*S-H*N);D.set((S*w-N*y)*
+J,(S*z-N*A)*J,(S*C-N*E)*J);M.set((G*y-H*w)*J,(G*A-H*z)*J,(G*E-H*C)*J);K[e].addSelf(D);K[c].addSelf(D);K[f].addSelf(D);W[e].addSelf(M);W[c].addSelf(M);W[f].addSelf(M)}var c,e,f,h,m,k,n,p,v,u,t,x,w,y,z,A,C,E,G,H,N,S,J,I,K=[],W=[],D=new THREE.Vector3,M=new THREE.Vector3,U=new THREE.Vector3,V=new THREE.Vector3,R=new THREE.Vector3;c=0;for(e=this.vertices.length;c<e;c++)K[c]=new THREE.Vector3,W[c]=new THREE.Vector3;c=0;for(e=this.faces.length;c<e;c++)m=this.faces[c],k=this.faceVertexUvs[0][c],m instanceof
 THREE.Face3?b(this,m.a,m.b,m.c,0,1,2):m instanceof THREE.Face4&&(b(this,m.a,m.b,m.c,0,1,2),b(this,m.a,m.b,m.d,0,1,3));var o=["a","b","c","d"];c=0;for(e=this.faces.length;c<e;c++){m=this.faces[c];for(f=0;f<m.vertexNormals.length;f++)R.copy(m.vertexNormals[f]),h=m[o[f]],I=K[h],U.copy(I),U.subSelf(R.multiplyScalar(R.dot(I))).normalize(),V.cross(m.vertexNormals[f],I),h=V.dot(W[h]),h=h<0?-1:1,m.vertexTangents[f]=new THREE.Vector4(U.x,U.y,U.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,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,e){return Math.min(b,e)+"_"+Math.max(b,e)}function c(b,e,c){b[e]===
 void 0?(b[e]={set:{},array:[]},b[e].set[c]=1,b[e].array.push(c)):b[e].set[c]===void 0&&(b[e].set[c]=1,b[e].array.push(c))}var e,f,h,m,k,n={};e=0;for(f=this.faces.length;e<f;e++)k=this.faces[e],k instanceof THREE.Face3?(h=b(k.a,k.b),c(n,h,e),h=b(k.b,k.c),c(n,h,e),h=b(k.a,k.c),c(n,h,e)):k instanceof THREE.Face4&&(h=b(k.b,k.d),c(n,h,e),h=b(k.a,k.b),c(n,h,e),h=b(k.a,k.d),c(n,h,e),h=b(k.b,k.c),c(n,h,e),h=b(k.c,k.d),c(n,h,e));e=0;for(f=this.edges.length;e<f;e++){k=this.edges[e];h=k.vertexIndices[0];m=k.vertexIndices[1];
 k.faceIndices=n[b(h,m)].array;for(h=0;h<k.faceIndices.length;h++)m=k.faceIndices[h],k.faces.push(this.faces[m])}}};THREE.GeometryCount=0;
-THREE.Spline=function(b){function c(b,e,c,f,k,h,m){b=(c-b)*0.5;f=(f-e)*0.5;return(2*(e-c)+b+f)*m+(-3*(e-c)-2*b-f)*h+b*k+e}this.points=b;var e=[],f={x:0,y:0,z:0},h,m,k,n,t,p,v,u,x;this.initFromArray=function(b){this.points=[];for(var e=0;e<b.length;e++)this.points[e]={x:b[e][0],y:b[e][1],z:b[e][2]}};this.getPoint=function(b){h=(this.points.length-1)*b;m=Math.floor(h);k=h-m;e[0]=m==0?m:m-1;e[1]=m;e[2]=m>this.points.length-2?m:m+1;e[3]=m>this.points.length-3?m:m+2;p=this.points[e[0]];v=this.points[e[1]];
-u=this.points[e[2]];x=this.points[e[3]];n=k*k;t=k*n;f.x=c(p.x,v.x,u.x,x.x,k,n,t);f.y=c(p.y,v.y,u.y,x.y,k,n,t);f.z=c(p.z,v.z,u.z,x.z,k,n,t);return f};this.getControlPointsArray=function(){var b,e,c=this.points.length,f=[];for(b=0;b<c;b++)e=this.points[b],f[b]=[e.x,e.y,e.z];return f};this.getLength=function(b){var e,c,f=e=e=0,k=new THREE.Vector3,h=new THREE.Vector3,m=[],n=0;m[0]=0;b||(b=100);c=this.points.length*b;k.copy(this.points[0]);for(b=1;b<c;b++)e=b/c,position=this.getPoint(e),h.copy(position),
-n+=h.distanceTo(k),k.copy(position),e*=this.points.length-1,e=Math.floor(e),e!=f&&(m[e]=n,f=e);m[m.length]=n;return{chunks:m,total:n}};this.reparametrizeByArcLength=function(b){var e,c,f,k,h,m,n=[],t=new THREE.Vector3,u=this.getLength();n.push(t.copy(this.points[0]).clone());for(e=1;e<this.points.length;e++){c=u.chunks[e]-u.chunks[e-1];m=Math.ceil(b*c/u.total);k=(e-1)/(this.points.length-1);h=e/(this.points.length-1);for(c=1;c<m-1;c++)f=k+c*(1/m)*(h-k),position=this.getPoint(f),n.push(t.copy(position).clone());
+THREE.Spline=function(b){function c(b,e,c,f,k,h,m){b=(c-b)*0.5;f=(f-e)*0.5;return(2*(e-c)+b+f)*m+(-3*(e-c)-2*b-f)*h+b*k+e}this.points=b;var e=[],f={x:0,y:0,z:0},h,m,k,n,p,v,u,t,x;this.initFromArray=function(b){this.points=[];for(var e=0;e<b.length;e++)this.points[e]={x:b[e][0],y:b[e][1],z:b[e][2]}};this.getPoint=function(b){h=(this.points.length-1)*b;m=Math.floor(h);k=h-m;e[0]=m==0?m:m-1;e[1]=m;e[2]=m>this.points.length-2?m:m+1;e[3]=m>this.points.length-3?m:m+2;v=this.points[e[0]];u=this.points[e[1]];
+t=this.points[e[2]];x=this.points[e[3]];n=k*k;p=k*n;f.x=c(v.x,u.x,t.x,x.x,k,n,p);f.y=c(v.y,u.y,t.y,x.y,k,n,p);f.z=c(v.z,u.z,t.z,x.z,k,n,p);return f};this.getControlPointsArray=function(){var b,e,c=this.points.length,f=[];for(b=0;b<c;b++)e=this.points[b],f[b]=[e.x,e.y,e.z];return f};this.getLength=function(b){var e,c,f=e=e=0,k=new THREE.Vector3,h=new THREE.Vector3,m=[],n=0;m[0]=0;b||(b=100);c=this.points.length*b;k.copy(this.points[0]);for(b=1;b<c;b++)e=b/c,position=this.getPoint(e),h.copy(position),
+n+=h.distanceTo(k),k.copy(position),e*=this.points.length-1,e=Math.floor(e),e!=f&&(m[e]=n,f=e);m[m.length]=n;return{chunks:m,total:n}};this.reparametrizeByArcLength=function(b){var e,c,f,k,h,m,n=[],t=new THREE.Vector3,v=this.getLength();n.push(t.copy(this.points[0]).clone());for(e=1;e<this.points.length;e++){c=v.chunks[e]-v.chunks[e-1];m=Math.ceil(b*c/v.total);k=(e-1)/(this.points.length-1);h=e/(this.points.length-1);for(c=1;c<m-1;c++)f=k+c*(1/m)*(h-k),position=this.getPoint(f),n.push(t.copy(position).clone());
 n.push(t.copy(this.points[e]).clone())}this.points=n}};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,h){THREE.Object3D.call(this);this.fov=b||50;this.aspect=c||1;this.near=e||0.1;this.far=f||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.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)};
@@ -116,7 +116,7 @@ THREE.ParticleCanvasMaterial=function(b){THREE.Material.call(this,b);b=b||{};thi
 THREE.Texture=function(b,c,e,f,h,m){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=h!==void 0?h:THREE.LinearFilter;this.minFilter=m!==void 0?m: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.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,h,m,k,n,t){THREE.Texture.call(this,null,h,m,k,n,t);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.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,h,m,k,n,p){THREE.Texture.call(this,null,h,m,k,n,p);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;
@@ -143,47 +143,47 @@ THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)th
 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.addChild=function(b){console.warn("DEPRECATED: Scene.addChild() is now Scene.add()");this.add(b)};
 THREE.Scene.prototype.addObject=function(b){console.warn("DEPRECATED: Scene.addObject() is now Scene.add()");this.add(b)};THREE.Scene.prototype.addLight=function(b){console.warn("DEPRECATED: Scene.addLight() is now Scene.add()");this.add(b)};THREE.Scene.prototype.removeChild=function(b){console.warn("DEPRECATED: Scene.removeChild() is now Scene.remove()");this.remove(b)};THREE.Scene.prototype.removeObject=function(b){console.warn("DEPRECATED: Scene.removeObject() is now Scene.remove()");this.remove(b)};
 THREE.Scene.prototype.removeLight=function(b){console.warn("DEPRECATED: Scene.removeLight() is now Scene.remove()");this.remove(b)};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.DOMRenderer=function(){THREE.Renderer.call(this);var b=null,c=new THREE.Projector,e,f,h,m;this.domElement=document.createElement("div");this.setSize=function(b,c){e=b;f=c;h=e/2;m=f/2};this.render=function(e,f){var t,p,v,u,x,w,y,z;b=c.projectScene(e,f);t=0;for(p=b.length;t<p;t++)if(x=b[t],x instanceof THREE.RenderableParticle){y=x.x*h+h;z=x.y*m+m;v=0;for(u=x.material.length;v<u;v++)if(w=x.material[v],w instanceof THREE.ParticleDOMMaterial)w=w.domElement,w.style.left=y+"px",w.style.top=z+"px"}}};
-THREE.CanvasRenderer=function(b){function c(b){if(A!=b)w.globalAlpha=A=b}function e(b){if(C!=b){switch(b){case THREE.NormalBlending:w.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:w.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:w.globalCompositeOperation="darker"}C=b}}function f(b){if(E!=b)w.strokeStyle=E=b}function h(b){if(G!=b)w.fillStyle=G=b}var m=this,k=null,n=new THREE.Projector,b=b||{},t=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
-p,v,u,x,w=t.getContext("2d"),y=new THREE.Color(0),z=0,A=1,C=0,E=null,G=null,H=null,O=null,S=null,J,I,K,W,D=new THREE.RenderableVertex,M=new THREE.RenderableVertex,U,V,R,o,pa,T,la,aa,na,ja,ka,da,Z=new THREE.Color(0),fa=new THREE.Color(0),Y=new THREE.Color(0),ma=new THREE.Color(0),ia=new THREE.Color(0),sa=[],N,ca,ua,ta,ra,wa,Ca,za,Aa,Ea,L=new THREE.Rectangle,P=new THREE.Rectangle,ea=new THREE.Rectangle,$=!1,ga=new THREE.Color,qa=new THREE.Color,ya=new THREE.Color,xa=new THREE.Color,oa=new THREE.Vector3,
-Fa,X,Ba,ha,Va,Wa,b=16;Fa=document.createElement("canvas");Fa.width=Fa.height=2;X=Fa.getContext("2d");X.fillStyle="rgba(0,0,0,1)";X.fillRect(0,0,2,2);Ba=X.getImageData(0,0,2,2);ha=Ba.data;Va=document.createElement("canvas");Va.width=Va.height=b;Wa=Va.getContext("2d");Wa.translate(-b/2,-b/2);Wa.scale(b,b);b--;this.domElement=t;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setSize=function(b,e){p=b;v=e;u=Math.floor(p/2);x=Math.floor(v/2);t.width=p;t.height=
-v;L.set(-u,-x,u,x);P.set(-u,-x,u,x);A=1;C=0;S=O=H=G=E=null};this.setClearColor=function(b,e){y.copy(b);z=e;P.set(-u,-x,u,x)};this.setClearColorHex=function(b,e){y.setHex(b);z=e;P.set(-u,-x,u,x)};this.clear=function(){w.setTransform(1,0,0,-1,u,x);P.isEmpty()||(P.minSelf(L),P.inflate(2),z<1&&w.clearRect(Math.floor(P.getX()),Math.floor(P.getY()),Math.floor(P.getWidth()),Math.floor(P.getHeight())),z>0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(y.r*255)+","+Math.floor(y.g*255)+","+Math.floor(y.b*
-255)+","+z+")"),w.fillRect(Math.floor(P.getX()),Math.floor(P.getY()),Math.floor(P.getWidth()),Math.floor(P.getHeight()))),P.empty())};this.render=function(b,t){function p(b){var e,c,f,k=b.lights;qa.setRGB(0,0,0);ya.setRGB(0,0,0);xa.setRGB(0,0,0);b=0;for(e=k.length;b<e;b++)c=k[b],f=c.color,c instanceof THREE.AmbientLight?(qa.r+=f.r,qa.g+=f.g,qa.b+=f.b):c instanceof THREE.DirectionalLight?(ya.r+=f.r,ya.g+=f.g,ya.b+=f.b):c instanceof THREE.PointLight&&(xa.r+=f.r,xa.g+=f.g,xa.b+=f.b)}function v(b,e,c,
-f){var k,h,m,o,n=b.lights,b=0;for(k=n.length;b<k;b++)h=n[b],m=h.color,h instanceof THREE.DirectionalLight?(o=c.dot(h.position),o<=0||(o*=h.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)):h instanceof THREE.PointLight&&(o=c.dot(oa.sub(h.position,e).normalize()),o<=0||(o*=h.distance==0?1:1-Math.min(e.distanceTo(h.position)/h.distance,1),o!=0&&(o*=h.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)))}function y(b,k,m){c(m.opacity);e(m.blending);var o,n,t,ha,p,v;if(m instanceof THREE.ParticleBasicMaterial){if(m.map)ha=
-m.map.image,p=ha.width>>1,v=ha.height>>1,m=k.scale.x*u,t=k.scale.y*x,o=m*p,n=t*v,ea.set(b.x-o,b.y-n,b.x+o,b.y+n),L.instersects(ea)&&(w.save(),w.translate(b.x,b.y),w.rotate(-k.rotation),w.scale(m,-t),w.translate(-p,-v),w.drawImage(ha,0,0),w.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(o=k.scale.x*u,n=k.scale.y*x,ea.set(b.x-o,b.y-n,b.x+o,b.y+n),L.instersects(ea)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),w.save(),w.translate(b.x,b.y),w.rotate(-k.rotation),w.scale(o,n),
-m.program(w),w.restore()))}function C(b,k,h,m){c(m.opacity);e(m.blending);w.beginPath();w.moveTo(b.positionScreen.x,b.positionScreen.y);w.lineTo(k.positionScreen.x,k.positionScreen.y);w.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(H!=b)w.lineWidth=H=b;b=m.linecap;if(O!=b)w.lineCap=O=b;b=m.linejoin;if(S!=b)w.lineJoin=S=b;f(m.color.getContextStyle());w.stroke();ea.inflate(m.linewidth*2)}}function z(b,f,k,h,n,u,ha,p,w){m.data.vertices+=3;m.data.faces++;c(p.opacity);e(p.blending);
-U=b.positionScreen.x;V=b.positionScreen.y;R=f.positionScreen.x;o=f.positionScreen.y;pa=k.positionScreen.x;T=k.positionScreen.y;E(U,V,R,o,pa,T);if(p instanceof THREE.MeshBasicMaterial)if(p.map)p.map.mapping instanceof THREE.UVMapping&&(ta=ha.uvs[0],$a(U,V,R,o,pa,T,ta[h].u,ta[h].v,ta[n].u,ta[n].v,ta[u].u,ta[u].v,p.map));else if(p.envMap){if(p.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=t.matrixWorldInverse,oa.copy(ha.vertexNormalsWorld[0]),ra=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+
-0.5,wa=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(ha.vertexNormalsWorld[1]),Ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,za=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(ha.vertexNormalsWorld[2]),Aa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Ea=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,$a(U,V,R,o,pa,T,ra,wa,Ca,za,Aa,Ea,p.envMap)}else p.wireframe?Ia(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ja(p.color);else if(p instanceof THREE.MeshLambertMaterial)p.map&&
-!p.wireframe&&(p.map.mapping instanceof THREE.UVMapping&&(ta=ha.uvs[0],$a(U,V,R,o,pa,T,ta[h].u,ta[h].v,ta[n].u,ta[n].v,ta[u].u,ta[u].v,p.map)),e(THREE.SubtractiveBlending)),$?!p.wireframe&&p.shading==THREE.SmoothShading&&ha.vertexNormalsWorld.length==3?(fa.r=Y.r=ma.r=qa.r,fa.g=Y.g=ma.g=qa.g,fa.b=Y.b=ma.b=qa.b,v(w,ha.v1.positionWorld,ha.vertexNormalsWorld[0],fa),v(w,ha.v2.positionWorld,ha.vertexNormalsWorld[1],Y),v(w,ha.v3.positionWorld,ha.vertexNormalsWorld[2],ma),ia.r=(Y.r+ma.r)*0.5,ia.g=(Y.g+ma.g)*
-0.5,ia.b=(Y.b+ma.b)*0.5,ua=Xa(fa,Y,ma,ia),Sa(U,V,R,o,pa,T,0,0,1,0,0,1,ua)):(ga.r=qa.r,ga.g=qa.g,ga.b=qa.b,v(w,ha.centroidWorld,ha.normalWorld,ga),Z.r=Math.max(0,Math.min(p.color.r*ga.r,1)),Z.g=Math.max(0,Math.min(p.color.g*ga.g,1)),Z.b=Math.max(0,Math.min(p.color.b*ga.b,1)),p.wireframe?Ia(Z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ja(Z)):p.wireframe?Ia(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ja(p.color);else if(p instanceof THREE.MeshDepthMaterial)N=
-t.near,ca=t.far,fa.r=fa.g=fa.b=1-Na(b.positionScreen.z,N,ca),Y.r=Y.g=Y.b=1-Na(f.positionScreen.z,N,ca),ma.r=ma.g=ma.b=1-Na(k.positionScreen.z,N,ca),ia.r=(Y.r+ma.r)*0.5,ia.g=(Y.g+ma.g)*0.5,ia.b=(Y.b+ma.b)*0.5,ua=Xa(fa,Y,ma,ia),Sa(U,V,R,o,pa,T,0,0,1,0,0,1,ua);else if(p instanceof THREE.MeshNormalMaterial)Z.r=Ta(ha.normalWorld.x),Z.g=Ta(ha.normalWorld.y),Z.b=Ta(ha.normalWorld.z),p.wireframe?Ia(Z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ja(Z)}function A(b,f,k,h,n,p,ha,u,w){m.data.vertices+=
-4;m.data.faces++;c(u.opacity);e(u.blending);if(u.map||u.envMap)z(b,f,h,0,1,3,ha,u,w),z(n,k,p,1,2,3,ha,u,w);else if(U=b.positionScreen.x,V=b.positionScreen.y,R=f.positionScreen.x,o=f.positionScreen.y,pa=k.positionScreen.x,T=k.positionScreen.y,la=h.positionScreen.x,aa=h.positionScreen.y,na=n.positionScreen.x,ja=n.positionScreen.y,ka=p.positionScreen.x,da=p.positionScreen.y,u instanceof THREE.MeshBasicMaterial)G(U,V,R,o,pa,T,la,aa),u.wireframe?Ia(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):
-Ja(u.color);else if(u instanceof THREE.MeshLambertMaterial)$?!u.wireframe&&u.shading==THREE.SmoothShading&&ha.vertexNormalsWorld.length==4?(fa.r=Y.r=ma.r=ia.r=qa.r,fa.g=Y.g=ma.g=ia.g=qa.g,fa.b=Y.b=ma.b=ia.b=qa.b,v(w,ha.v1.positionWorld,ha.vertexNormalsWorld[0],fa),v(w,ha.v2.positionWorld,ha.vertexNormalsWorld[1],Y),v(w,ha.v4.positionWorld,ha.vertexNormalsWorld[3],ma),v(w,ha.v3.positionWorld,ha.vertexNormalsWorld[2],ia),ua=Xa(fa,Y,ma,ia),E(U,V,R,o,la,aa),Sa(U,V,R,o,la,aa,0,0,1,0,0,1,ua),E(na,ja,pa,
-T,ka,da),Sa(na,ja,pa,T,ka,da,1,0,1,1,0,1,ua)):(ga.r=qa.r,ga.g=qa.g,ga.b=qa.b,v(w,ha.centroidWorld,ha.normalWorld,ga),Z.r=Math.max(0,Math.min(u.color.r*ga.r,1)),Z.g=Math.max(0,Math.min(u.color.g*ga.g,1)),Z.b=Math.max(0,Math.min(u.color.b*ga.b,1)),G(U,V,R,o,pa,T,la,aa),u.wireframe?Ia(Z,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):Ja(Z)):(G(U,V,R,o,pa,T,la,aa),u.wireframe?Ia(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):Ja(u.color));else if(u instanceof THREE.MeshNormalMaterial)Z.r=
-Ta(ha.normalWorld.x),Z.g=Ta(ha.normalWorld.y),Z.b=Ta(ha.normalWorld.z),G(U,V,R,o,pa,T,la,aa),u.wireframe?Ia(Z,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):Ja(Z);else if(u instanceof THREE.MeshDepthMaterial)N=t.near,ca=t.far,fa.r=fa.g=fa.b=1-Na(b.positionScreen.z,N,ca),Y.r=Y.g=Y.b=1-Na(f.positionScreen.z,N,ca),ma.r=ma.g=ma.b=1-Na(h.positionScreen.z,N,ca),ia.r=ia.g=ia.b=1-Na(k.positionScreen.z,N,ca),ua=Xa(fa,Y,ma,ia),E(U,V,R,o,la,aa),Sa(U,V,R,o,la,aa,0,0,1,0,0,1,ua),E(na,ja,pa,T,ka,
-da),Sa(na,ja,pa,T,ka,da,1,0,1,1,0,1,ua)}function E(b,e,c,f,k,h){w.beginPath();w.moveTo(b,e);w.lineTo(c,f);w.lineTo(k,h);w.lineTo(b,e);w.closePath()}function G(b,e,c,f,k,h,m,o){w.beginPath();w.moveTo(b,e);w.lineTo(c,f);w.lineTo(k,h);w.lineTo(m,o);w.lineTo(b,e);w.closePath()}function Ia(b,e,c,k){if(H!=e)w.lineWidth=H=e;if(O!=c)w.lineCap=O=c;if(S!=k)w.lineJoin=S=k;f(b.getContextStyle());w.stroke();ea.inflate(e*2)}function Ja(b){h(b.getContextStyle());w.fill()}function $a(b,e,c,f,k,m,o,n,u,p,ha,t,v){if(v.image.width!=
-0){if(v.needsUpdate==!0||sa[v.id]==void 0){var x=v.wrapS==THREE.RepeatWrapping,Ma=v.wrapT==THREE.RepeatWrapping;sa[v.id]=w.createPattern(v.image,x&&Ma?"repeat":x&&!Ma?"repeat-x":!x&&Ma?"repeat-y":"no-repeat");v.needsUpdate=!1}h(sa[v.id]);var x=v.offset.x/v.repeat.x,Ma=v.offset.y/v.repeat.y,L=(v.image.width-1)*v.repeat.x,v=(v.image.height-1)*v.repeat.y,o=(o+x)*L,n=(n+Ma)*v,u=(u+x)*L,p=(p+Ma)*v,ha=(ha+x)*L,t=(t+Ma)*v;c-=b;f-=e;k-=b;m-=e;u-=o;p-=n;ha-=o;t-=n;x=1/(u*t-ha*p);v=(t*c-p*k)*x;p=(t*f-p*m)*
-x;c=(u*k-ha*c)*x;f=(u*m-ha*f)*x;b=b-v*o-c*n;e=e-p*o-f*n;w.save();w.transform(v,p,c,f,b,e);w.fill();w.restore()}}function Sa(b,e,c,f,k,h,m,o,n,u,p,ha,t){var v,x;v=t.width-1;x=t.height-1;m*=v;o*=x;n*=v;u*=x;p*=v;ha*=x;c-=b;f-=e;k-=b;h-=e;n-=m;u-=o;p-=m;ha-=o;x=1/(n*ha-p*u);v=(ha*c-u*k)*x;u=(ha*f-u*h)*x;c=(n*k-p*c)*x;f=(n*h-p*f)*x;b=b-v*m-c*o;e=e-u*m-f*o;w.save();w.transform(v,u,c,f,b,e);w.clip();w.drawImage(t,0,0);w.restore()}function Xa(b,e,c,f){var k=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),m=~~(e.r*
-255),o=~~(e.g*255),e=~~(e.b*255),n=~~(c.r*255),u=~~(c.g*255),c=~~(c.b*255),p=~~(f.r*255),t=~~(f.g*255),f=~~(f.b*255);ha[0]=k<0?0:k>255?255:k;ha[1]=h<0?0:h>255?255:h;ha[2]=b<0?0:b>255?255:b;ha[4]=m<0?0:m>255?255:m;ha[5]=o<0?0:o>255?255:o;ha[6]=e<0?0:e>255?255:e;ha[8]=n<0?0:n>255?255:n;ha[9]=u<0?0:u>255?255:u;ha[10]=c<0?0:c>255?255:c;ha[12]=p<0?0:p>255?255:p;ha[13]=t<0?0:t>255?255:t;ha[14]=f<0?0:f>255?255:f;X.putImageData(Ba,0,0);Wa.drawImage(Fa,0,0);return Va}function Na(b,e,c){b=(b-e)/(c-e);return b*
-b*(3-2*b)}function Ta(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Ka(b,e){var c=e.x-b.x,f=e.y-b.y,k=c*c+f*f;k!=0&&(k=1/Math.sqrt(k),c*=k,f*=k,e.x+=c,e.y+=f,b.x-=c,b.y-=f)}var Ya,cb,va,Da,La,Ua,Za,F;this.autoClear?this.clear():w.setTransform(1,0,0,-1,u,x);m.data.vertices=0;m.data.faces=0;k=n.projectScene(b,t,this.sortElements);($=b.lights.length>0)&&p(b);Ya=0;for(cb=k.length;Ya<cb;Ya++){va=k[Ya];ea.empty();if(va instanceof THREE.RenderableParticle){J=va;J.x*=u;J.y*=x;Da=0;for(La=va.materials.length;Da<
-La;)F=va.materials[Da++],F.opacity!=0&&y(J,va,F,b)}else if(va instanceof THREE.RenderableLine){if(J=va.v1,I=va.v2,J.positionScreen.x*=u,J.positionScreen.y*=x,I.positionScreen.x*=u,I.positionScreen.y*=x,ea.addPoint(J.positionScreen.x,J.positionScreen.y),ea.addPoint(I.positionScreen.x,I.positionScreen.y),L.instersects(ea)){Da=0;for(La=va.materials.length;Da<La;)F=va.materials[Da++],F.opacity!=0&&C(J,I,va,F,b)}}else if(va instanceof THREE.RenderableFace3){if(J=va.v1,I=va.v2,K=va.v3,J.positionScreen.x*=
-u,J.positionScreen.y*=x,I.positionScreen.x*=u,I.positionScreen.y*=x,K.positionScreen.x*=u,K.positionScreen.y*=x,va.overdraw&&(Ka(J.positionScreen,I.positionScreen),Ka(I.positionScreen,K.positionScreen),Ka(K.positionScreen,J.positionScreen)),ea.add3Points(J.positionScreen.x,J.positionScreen.y,I.positionScreen.x,I.positionScreen.y,K.positionScreen.x,K.positionScreen.y),L.instersects(ea)){Da=0;for(La=va.meshMaterials.length;Da<La;)if(F=va.meshMaterials[Da++],F instanceof THREE.MeshFaceMaterial){Ua=0;
-for(Za=va.faceMaterials.length;Ua<Za;)(F=va.faceMaterials[Ua++])&&F.opacity!=0&&z(J,I,K,0,1,2,va,F,b)}else F.opacity!=0&&z(J,I,K,0,1,2,va,F,b)}}else if(va instanceof THREE.RenderableFace4&&(J=va.v1,I=va.v2,K=va.v3,W=va.v4,J.positionScreen.x*=u,J.positionScreen.y*=x,I.positionScreen.x*=u,I.positionScreen.y*=x,K.positionScreen.x*=u,K.positionScreen.y*=x,W.positionScreen.x*=u,W.positionScreen.y*=x,D.positionScreen.copy(I.positionScreen),M.positionScreen.copy(W.positionScreen),va.overdraw&&(Ka(J.positionScreen,
-I.positionScreen),Ka(I.positionScreen,W.positionScreen),Ka(W.positionScreen,J.positionScreen),Ka(K.positionScreen,D.positionScreen),Ka(K.positionScreen,M.positionScreen)),ea.addPoint(J.positionScreen.x,J.positionScreen.y),ea.addPoint(I.positionScreen.x,I.positionScreen.y),ea.addPoint(K.positionScreen.x,K.positionScreen.y),ea.addPoint(W.positionScreen.x,W.positionScreen.y),L.instersects(ea))){Da=0;for(La=va.meshMaterials.length;Da<La;)if(F=va.meshMaterials[Da++],F instanceof THREE.MeshFaceMaterial){Ua=
-0;for(Za=va.faceMaterials.length;Ua<Za;)(F=va.faceMaterials[Ua++])&&F.opacity!=0&&A(J,I,K,W,D,M,va,F,b)}else F.opacity!=0&&A(J,I,K,W,D,M,va,F,b)}P.addRectangle(ea)}w.setTransform(1,0,0,1,0,0)}};
-THREE.SVGRenderer=function(){function b(b,e,c){var f,k,h,m;f=0;for(k=b.lights.length;f<k;f++)h=b.lights[f],h instanceof THREE.DirectionalLight?(m=e.normalWorld.dot(h.position)*h.intensity,m>0&&(c.r+=h.color.r*m,c.g+=h.color.g*m,c.b+=h.color.b*m)):h instanceof THREE.PointLight&&(W.sub(h.position,e.centroidWorld),W.normalize(),m=e.normalWorld.dot(W)*h.intensity,m>0&&(c.r+=h.color.r*m,c.g+=h.color.g*m,c.b+=h.color.b*m))}function c(e,c,k,o,n,u){m.data.vertices+=3;m.data.faces++;U=f(V++);U.setAttribute("d",
-"M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");n instanceof THREE.MeshBasicMaterial?H.copy(n.color):n instanceof THREE.MeshLambertMaterial?G?(O.r=S.r,O.g=S.g,O.b=S.b,b(u,o,O),H.r=Math.max(0,Math.min(n.color.r*O.r,1)),H.g=Math.max(0,Math.min(n.color.g*O.g,1)),H.b=Math.max(0,Math.min(n.color.b*O.b,1))):H.copy(n.color):n instanceof THREE.MeshDepthMaterial?(K=1-n.__2near/(n.__farPlusNear-o.z*n.__farMinusNear),
-H.setRGB(K,K,K)):n instanceof THREE.MeshNormalMaterial&&H.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));n.wireframe?U.setAttribute("style","fill: none; stroke: "+H.getContextStyle()+"; stroke-width: "+n.wireframeLinewidth+"; stroke-opacity: "+n.opacity+"; stroke-linecap: "+n.wireframeLinecap+"; stroke-linejoin: "+n.wireframeLinejoin):U.setAttribute("style","fill: "+H.getContextStyle()+"; fill-opacity: "+n.opacity);t.appendChild(U)}function e(e,c,k,o,n,u,p){m.data.vertices+=4;m.data.faces++;
-U=f(V++);U.setAttribute("d","M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+" L "+o.positionScreen.x+","+o.positionScreen.y+"z");u instanceof THREE.MeshBasicMaterial?H.copy(u.color):u instanceof THREE.MeshLambertMaterial?G?(O.r=S.r,O.g=S.g,O.b=S.b,b(p,n,O),H.r=Math.max(0,Math.min(u.color.r*O.r,1)),H.g=Math.max(0,Math.min(u.color.g*O.g,1)),H.b=Math.max(0,Math.min(u.color.b*O.b,1))):H.copy(u.color):u instanceof
-THREE.MeshDepthMaterial?(K=1-u.__2near/(u.__farPlusNear-n.z*u.__farMinusNear),H.setRGB(K,K,K)):u instanceof THREE.MeshNormalMaterial&&H.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));u.wireframe?U.setAttribute("style","fill: none; stroke: "+H.getContextStyle()+"; stroke-width: "+u.wireframeLinewidth+"; stroke-opacity: "+u.opacity+"; stroke-linecap: "+u.wireframeLinecap+"; stroke-linejoin: "+u.wireframeLinejoin):U.setAttribute("style","fill: "+H.getContextStyle()+"; fill-opacity: "+
-u.opacity);t.appendChild(U)}function f(b){D[b]==null&&(D[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),o==0&&D[b].setAttribute("shape-rendering","crispEdges"));return D[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var m=this,k=null,n=new THREE.Projector,t=document.createElementNS("http://www.w3.org/2000/svg","svg"),p,v,u,x,w,y,z,A,C=new THREE.Rectangle,E=new THREE.Rectangle,G=!1,H=new THREE.Color(16777215),O=new THREE.Color(16777215),S=new THREE.Color(0),J=new THREE.Color(0),
-I=new THREE.Color(0),K,W=new THREE.Vector3,D=[],M=[],U,V,R,o=1;this.domElement=t;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setQuality=function(b){switch(b){case "high":o=1;break;case "low":o=0}};this.setSize=function(b,e){p=b;v=e;u=p/2;x=v/2;t.setAttribute("viewBox",-u+" "+-x+" "+p+" "+v);t.setAttribute("width",p);t.setAttribute("height",v);C.set(-u,-x,u,x)};this.clear=function(){for(;t.childNodes.length>0;)t.removeChild(t.childNodes[0])};this.render=
-function(b,f){var h,p,v,H,O,D,K,fa;this.autoClear&&this.clear();m.data.vertices=0;m.data.faces=0;k=n.projectScene(b,f,this.sortElements);R=V=0;if(G=b.lights.length>0){K=b.lights;S.setRGB(0,0,0);J.setRGB(0,0,0);I.setRGB(0,0,0);h=0;for(p=K.length;h<p;h++)v=K[h],H=v.color,v instanceof THREE.AmbientLight?(S.r+=H.r,S.g+=H.g,S.b+=H.b):v instanceof THREE.DirectionalLight?(J.r+=H.r,J.g+=H.g,J.b+=H.b):v instanceof THREE.PointLight&&(I.r+=H.r,I.g+=H.g,I.b+=H.b)}h=0;for(p=k.length;h<p;h++)if(K=k[h],E.empty(),
-K instanceof THREE.RenderableParticle){w=K;w.x*=u;w.y*=-x;v=0;for(H=K.materials.length;v<H;)v++}else if(K instanceof THREE.RenderableLine){if(w=K.v1,y=K.v2,w.positionScreen.x*=u,w.positionScreen.y*=-x,y.positionScreen.x*=u,y.positionScreen.y*=-x,E.addPoint(w.positionScreen.x,w.positionScreen.y),E.addPoint(y.positionScreen.x,y.positionScreen.y),C.instersects(E)){v=0;for(H=K.materials.length;v<H;)if((fa=K.materials[v++])&&fa.opacity!=0){O=w;D=y;var Y=R++;M[Y]==null&&(M[Y]=document.createElementNS("http://www.w3.org/2000/svg",
-"line"),o==0&&M[Y].setAttribute("shape-rendering","crispEdges"));U=M[Y];U.setAttribute("x1",O.positionScreen.x);U.setAttribute("y1",O.positionScreen.y);U.setAttribute("x2",D.positionScreen.x);U.setAttribute("y2",D.positionScreen.y);fa instanceof THREE.LineBasicMaterial&&(U.setAttribute("style","fill: none; stroke: "+fa.color.getContextStyle()+"; stroke-width: "+fa.linewidth+"; stroke-opacity: "+fa.opacity+"; stroke-linecap: "+fa.linecap+"; stroke-linejoin: "+fa.linejoin),t.appendChild(U))}}}else if(K instanceof
-THREE.RenderableFace3){if(w=K.v1,y=K.v2,z=K.v3,w.positionScreen.x*=u,w.positionScreen.y*=-x,y.positionScreen.x*=u,y.positionScreen.y*=-x,z.positionScreen.x*=u,z.positionScreen.y*=-x,E.addPoint(w.positionScreen.x,w.positionScreen.y),E.addPoint(y.positionScreen.x,y.positionScreen.y),E.addPoint(z.positionScreen.x,z.positionScreen.y),C.instersects(E)){v=0;for(H=K.meshMaterials.length;v<H;)if(fa=K.meshMaterials[v++],fa instanceof THREE.MeshFaceMaterial){O=0;for(D=K.faceMaterials.length;O<D;)(fa=K.faceMaterials[O++])&&
-fa.opacity!=0&&c(w,y,z,K,fa,b)}else fa&&fa.opacity!=0&&c(w,y,z,K,fa,b)}}else if(K instanceof THREE.RenderableFace4&&(w=K.v1,y=K.v2,z=K.v3,A=K.v4,w.positionScreen.x*=u,w.positionScreen.y*=-x,y.positionScreen.x*=u,y.positionScreen.y*=-x,z.positionScreen.x*=u,z.positionScreen.y*=-x,A.positionScreen.x*=u,A.positionScreen.y*=-x,E.addPoint(w.positionScreen.x,w.positionScreen.y),E.addPoint(y.positionScreen.x,y.positionScreen.y),E.addPoint(z.positionScreen.x,z.positionScreen.y),E.addPoint(A.positionScreen.x,
-A.positionScreen.y),C.instersects(E))){v=0;for(H=K.meshMaterials.length;v<H;)if(fa=K.meshMaterials[v++],fa instanceof THREE.MeshFaceMaterial){O=0;for(D=K.faceMaterials.length;O<D;)(fa=K.faceMaterials[O++])&&fa.opacity!=0&&e(w,y,z,A,K,fa,b)}else fa&&fa.opacity!=0&&e(w,y,z,A,K,fa,b)}}};
+THREE.DOMRenderer=function(){THREE.Renderer.call(this);var b=null,c=new THREE.Projector,e,f,h,m;this.domElement=document.createElement("div");this.setSize=function(b,c){e=b;f=c;h=e/2;m=f/2};this.render=function(e,f){var p,v,u,t,x,w,y,z;b=c.projectScene(e,f);p=0;for(v=b.length;p<v;p++)if(x=b[p],x instanceof THREE.RenderableParticle){y=x.x*h+h;z=x.y*m+m;u=0;for(t=x.material.length;u<t;u++)if(w=x.material[u],w instanceof THREE.ParticleDOMMaterial)w=w.domElement,w.style.left=y+"px",w.style.top=z+"px"}}};
+THREE.CanvasRenderer=function(b){function c(b){if(A!=b)w.globalAlpha=A=b}function e(b){if(C!=b){switch(b){case THREE.NormalBlending:w.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:w.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:w.globalCompositeOperation="darker"}C=b}}function f(b){if(E!=b)w.strokeStyle=E=b}function h(b){if(G!=b)w.fillStyle=G=b}var m=this,k=null,n=new THREE.Projector,b=b||{},p=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
+v,u,t,x,w=p.getContext("2d"),y=new THREE.Color(0),z=0,A=1,C=0,E=null,G=null,H=null,N=null,S=null,J,I,K,W,D=new THREE.RenderableVertex,M=new THREE.RenderableVertex,U,V,R,o,pa,T,la,aa,na,ja,ka,ea,Z=new THREE.Color(0),ga=new THREE.Color(0),Y=new THREE.Color(0),ma=new THREE.Color(0),ia=new THREE.Color(0),sa=[],O,da,ua,ta,ra,wa,Ca,za,Aa,Ea,L=new THREE.Rectangle,P=new THREE.Rectangle,fa=new THREE.Rectangle,$=!1,ha=new THREE.Color,qa=new THREE.Color,ya=new THREE.Color,xa=new THREE.Color,oa=new THREE.Vector3,
+Fa,X,Ba,ca,Va,Wa,b=16;Fa=document.createElement("canvas");Fa.width=Fa.height=2;X=Fa.getContext("2d");X.fillStyle="rgba(0,0,0,1)";X.fillRect(0,0,2,2);Ba=X.getImageData(0,0,2,2);ca=Ba.data;Va=document.createElement("canvas");Va.width=Va.height=b;Wa=Va.getContext("2d");Wa.translate(-b/2,-b/2);Wa.scale(b,b);b--;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setSize=function(b,e){v=b;u=e;t=Math.floor(v/2);x=Math.floor(u/2);p.width=v;p.height=
+u;L.set(-t,-x,t,x);P.set(-t,-x,t,x);A=1;C=0;S=N=H=G=E=null};this.setClearColor=function(b,e){y.copy(b);z=e;P.set(-t,-x,t,x)};this.setClearColorHex=function(b,e){y.setHex(b);z=e;P.set(-t,-x,t,x)};this.clear=function(){w.setTransform(1,0,0,-1,t,x);P.isEmpty()||(P.minSelf(L),P.inflate(2),z<1&&w.clearRect(Math.floor(P.getX()),Math.floor(P.getY()),Math.floor(P.getWidth()),Math.floor(P.getHeight())),z>0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(y.r*255)+","+Math.floor(y.g*255)+","+Math.floor(y.b*
+255)+","+z+")"),w.fillRect(Math.floor(P.getX()),Math.floor(P.getY()),Math.floor(P.getWidth()),Math.floor(P.getHeight()))),P.empty())};this.render=function(b,v){function p(b){var e,c,f,k=b.lights;qa.setRGB(0,0,0);ya.setRGB(0,0,0);xa.setRGB(0,0,0);b=0;for(e=k.length;b<e;b++)c=k[b],f=c.color,c instanceof THREE.AmbientLight?(qa.r+=f.r,qa.g+=f.g,qa.b+=f.b):c instanceof THREE.DirectionalLight?(ya.r+=f.r,ya.g+=f.g,ya.b+=f.b):c instanceof THREE.PointLight&&(xa.r+=f.r,xa.g+=f.g,xa.b+=f.b)}function u(b,e,c,
+f){var k,h,m,o,n=b.lights,b=0;for(k=n.length;b<k;b++)h=n[b],m=h.color,h instanceof THREE.DirectionalLight?(o=c.dot(h.position),o<=0||(o*=h.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)):h instanceof THREE.PointLight&&(o=c.dot(oa.sub(h.position,e).normalize()),o<=0||(o*=h.distance==0?1:1-Math.min(e.distanceTo(h.position)/h.distance,1),o!=0&&(o*=h.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)))}function y(b,k,m){c(m.opacity);e(m.blending);var o,n,v,ca,p,u;if(m instanceof THREE.ParticleBasicMaterial){if(m.map)ca=
+m.map.image,p=ca.width>>1,u=ca.height>>1,m=k.scale.x*t,v=k.scale.y*x,o=m*p,n=v*u,fa.set(b.x-o,b.y-n,b.x+o,b.y+n),L.instersects(fa)&&(w.save(),w.translate(b.x,b.y),w.rotate(-k.rotation),w.scale(m,-v),w.translate(-p,-u),w.drawImage(ca,0,0),w.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(o=k.scale.x*t,n=k.scale.y*x,fa.set(b.x-o,b.y-n,b.x+o,b.y+n),L.instersects(fa)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),w.save(),w.translate(b.x,b.y),w.rotate(-k.rotation),w.scale(o,n),
+m.program(w),w.restore()))}function z(b,k,h,m){c(m.opacity);e(m.blending);w.beginPath();w.moveTo(b.positionScreen.x,b.positionScreen.y);w.lineTo(k.positionScreen.x,k.positionScreen.y);w.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(H!=b)w.lineWidth=H=b;b=m.linecap;if(N!=b)w.lineCap=N=b;b=m.linejoin;if(S!=b)w.lineJoin=S=b;f(m.color.getContextStyle());w.stroke();fa.inflate(m.linewidth*2)}}function A(b,f,k,h,n,t,ca,p,w){m.data.vertices+=3;m.data.faces++;c(p.opacity);e(p.blending);
+U=b.positionScreen.x;V=b.positionScreen.y;R=f.positionScreen.x;o=f.positionScreen.y;pa=k.positionScreen.x;T=k.positionScreen.y;E(U,V,R,o,pa,T);if(p instanceof THREE.MeshBasicMaterial)if(p.map)p.map.mapping instanceof THREE.UVMapping&&(ta=ca.uvs[0],$a(U,V,R,o,pa,T,ta[h].u,ta[h].v,ta[n].u,ta[n].v,ta[t].u,ta[t].v,p.map));else if(p.envMap){if(p.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=v.matrixWorldInverse,oa.copy(ca.vertexNormalsWorld[0]),ra=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+
+0.5,wa=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(ca.vertexNormalsWorld[1]),Ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,za=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(ca.vertexNormalsWorld[2]),Aa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Ea=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,$a(U,V,R,o,pa,T,ra,wa,Ca,za,Aa,Ea,p.envMap)}else p.wireframe?Ia(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ja(p.color);else if(p instanceof THREE.MeshLambertMaterial)p.map&&
+!p.wireframe&&(p.map.mapping instanceof THREE.UVMapping&&(ta=ca.uvs[0],$a(U,V,R,o,pa,T,ta[h].u,ta[h].v,ta[n].u,ta[n].v,ta[t].u,ta[t].v,p.map)),e(THREE.SubtractiveBlending)),$?!p.wireframe&&p.shading==THREE.SmoothShading&&ca.vertexNormalsWorld.length==3?(ga.r=Y.r=ma.r=qa.r,ga.g=Y.g=ma.g=qa.g,ga.b=Y.b=ma.b=qa.b,u(w,ca.v1.positionWorld,ca.vertexNormalsWorld[0],ga),u(w,ca.v2.positionWorld,ca.vertexNormalsWorld[1],Y),u(w,ca.v3.positionWorld,ca.vertexNormalsWorld[2],ma),ia.r=(Y.r+ma.r)*0.5,ia.g=(Y.g+ma.g)*
+0.5,ia.b=(Y.b+ma.b)*0.5,ua=Xa(ga,Y,ma,ia),Sa(U,V,R,o,pa,T,0,0,1,0,0,1,ua)):(ha.r=qa.r,ha.g=qa.g,ha.b=qa.b,u(w,ca.centroidWorld,ca.normalWorld,ha),Z.r=Math.max(0,Math.min(p.color.r*ha.r,1)),Z.g=Math.max(0,Math.min(p.color.g*ha.g,1)),Z.b=Math.max(0,Math.min(p.color.b*ha.b,1)),p.wireframe?Ia(Z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ja(Z)):p.wireframe?Ia(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ja(p.color);else if(p instanceof THREE.MeshDepthMaterial)O=
+v.near,da=v.far,ga.r=ga.g=ga.b=1-Na(b.positionScreen.z,O,da),Y.r=Y.g=Y.b=1-Na(f.positionScreen.z,O,da),ma.r=ma.g=ma.b=1-Na(k.positionScreen.z,O,da),ia.r=(Y.r+ma.r)*0.5,ia.g=(Y.g+ma.g)*0.5,ia.b=(Y.b+ma.b)*0.5,ua=Xa(ga,Y,ma,ia),Sa(U,V,R,o,pa,T,0,0,1,0,0,1,ua);else if(p instanceof THREE.MeshNormalMaterial)Z.r=Ta(ca.normalWorld.x),Z.g=Ta(ca.normalWorld.y),Z.b=Ta(ca.normalWorld.z),p.wireframe?Ia(Z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ja(Z)}function C(b,f,k,h,n,p,t,ca,w){m.data.vertices+=
+4;m.data.faces++;c(ca.opacity);e(ca.blending);if(ca.map||ca.envMap)A(b,f,h,0,1,3,t,ca,w),A(n,k,p,1,2,3,t,ca,w);else if(U=b.positionScreen.x,V=b.positionScreen.y,R=f.positionScreen.x,o=f.positionScreen.y,pa=k.positionScreen.x,T=k.positionScreen.y,la=h.positionScreen.x,aa=h.positionScreen.y,na=n.positionScreen.x,ja=n.positionScreen.y,ka=p.positionScreen.x,ea=p.positionScreen.y,ca instanceof THREE.MeshBasicMaterial)G(U,V,R,o,pa,T,la,aa),ca.wireframe?Ia(ca.color,ca.wireframeLinewidth,ca.wireframeLinecap,
+ca.wireframeLinejoin):Ja(ca.color);else if(ca instanceof THREE.MeshLambertMaterial)$?!ca.wireframe&&ca.shading==THREE.SmoothShading&&t.vertexNormalsWorld.length==4?(ga.r=Y.r=ma.r=ia.r=qa.r,ga.g=Y.g=ma.g=ia.g=qa.g,ga.b=Y.b=ma.b=ia.b=qa.b,u(w,t.v1.positionWorld,t.vertexNormalsWorld[0],ga),u(w,t.v2.positionWorld,t.vertexNormalsWorld[1],Y),u(w,t.v4.positionWorld,t.vertexNormalsWorld[3],ma),u(w,t.v3.positionWorld,t.vertexNormalsWorld[2],ia),ua=Xa(ga,Y,ma,ia),E(U,V,R,o,la,aa),Sa(U,V,R,o,la,aa,0,0,1,0,0,
+1,ua),E(na,ja,pa,T,ka,ea),Sa(na,ja,pa,T,ka,ea,1,0,1,1,0,1,ua)):(ha.r=qa.r,ha.g=qa.g,ha.b=qa.b,u(w,t.centroidWorld,t.normalWorld,ha),Z.r=Math.max(0,Math.min(ca.color.r*ha.r,1)),Z.g=Math.max(0,Math.min(ca.color.g*ha.g,1)),Z.b=Math.max(0,Math.min(ca.color.b*ha.b,1)),G(U,V,R,o,pa,T,la,aa),ca.wireframe?Ia(Z,ca.wireframeLinewidth,ca.wireframeLinecap,ca.wireframeLinejoin):Ja(Z)):(G(U,V,R,o,pa,T,la,aa),ca.wireframe?Ia(ca.color,ca.wireframeLinewidth,ca.wireframeLinecap,ca.wireframeLinejoin):Ja(ca.color));
+else if(ca instanceof THREE.MeshNormalMaterial)Z.r=Ta(t.normalWorld.x),Z.g=Ta(t.normalWorld.y),Z.b=Ta(t.normalWorld.z),G(U,V,R,o,pa,T,la,aa),ca.wireframe?Ia(Z,ca.wireframeLinewidth,ca.wireframeLinecap,ca.wireframeLinejoin):Ja(Z);else if(ca instanceof THREE.MeshDepthMaterial)O=v.near,da=v.far,ga.r=ga.g=ga.b=1-Na(b.positionScreen.z,O,da),Y.r=Y.g=Y.b=1-Na(f.positionScreen.z,O,da),ma.r=ma.g=ma.b=1-Na(h.positionScreen.z,O,da),ia.r=ia.g=ia.b=1-Na(k.positionScreen.z,O,da),ua=Xa(ga,Y,ma,ia),E(U,V,R,o,la,
+aa),Sa(U,V,R,o,la,aa,0,0,1,0,0,1,ua),E(na,ja,pa,T,ka,ea),Sa(na,ja,pa,T,ka,ea,1,0,1,1,0,1,ua)}function E(b,e,c,f,k,h){w.beginPath();w.moveTo(b,e);w.lineTo(c,f);w.lineTo(k,h);w.lineTo(b,e);w.closePath()}function G(b,e,c,f,k,h,m,o){w.beginPath();w.moveTo(b,e);w.lineTo(c,f);w.lineTo(k,h);w.lineTo(m,o);w.lineTo(b,e);w.closePath()}function Ia(b,e,c,k){if(H!=e)w.lineWidth=H=e;if(N!=c)w.lineCap=N=c;if(S!=k)w.lineJoin=S=k;f(b.getContextStyle());w.stroke();fa.inflate(e*2)}function Ja(b){h(b.getContextStyle());
+w.fill()}function $a(b,e,c,f,k,m,o,n,ca,p,t,v,u){if(u.image.width!=0){if(u.needsUpdate==!0||sa[u.id]==void 0){var x=u.wrapS==THREE.RepeatWrapping,Ma=u.wrapT==THREE.RepeatWrapping;sa[u.id]=w.createPattern(u.image,x&&Ma?"repeat":x&&!Ma?"repeat-x":!x&&Ma?"repeat-y":"no-repeat");u.needsUpdate=!1}h(sa[u.id]);var x=u.offset.x/u.repeat.x,Ma=u.offset.y/u.repeat.y,L=(u.image.width-1)*u.repeat.x,u=(u.image.height-1)*u.repeat.y,o=(o+x)*L,n=(n+Ma)*u,ca=(ca+x)*L,p=(p+Ma)*u,t=(t+x)*L,v=(v+Ma)*u;c-=b;f-=e;k-=b;
+m-=e;ca-=o;p-=n;t-=o;v-=n;x=1/(ca*v-t*p);u=(v*c-p*k)*x;p=(v*f-p*m)*x;c=(ca*k-t*c)*x;f=(ca*m-t*f)*x;b=b-u*o-c*n;e=e-p*o-f*n;w.save();w.transform(u,p,c,f,b,e);w.fill();w.restore()}}function Sa(b,e,c,f,k,h,m,o,n,ca,p,t,v){var u,x;u=v.width-1;x=v.height-1;m*=u;o*=x;n*=u;ca*=x;p*=u;t*=x;c-=b;f-=e;k-=b;h-=e;n-=m;ca-=o;p-=m;t-=o;x=1/(n*t-p*ca);u=(t*c-ca*k)*x;ca=(t*f-ca*h)*x;c=(n*k-p*c)*x;f=(n*h-p*f)*x;b=b-u*m-c*o;e=e-ca*m-f*o;w.save();w.transform(u,ca,c,f,b,e);w.clip();w.drawImage(v,0,0);w.restore()}function Xa(b,
+e,c,f){var k=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),m=~~(e.r*255),o=~~(e.g*255),e=~~(e.b*255),n=~~(c.r*255),p=~~(c.g*255),c=~~(c.b*255),t=~~(f.r*255),v=~~(f.g*255),f=~~(f.b*255);ca[0]=k<0?0:k>255?255:k;ca[1]=h<0?0:h>255?255:h;ca[2]=b<0?0:b>255?255:b;ca[4]=m<0?0:m>255?255:m;ca[5]=o<0?0:o>255?255:o;ca[6]=e<0?0:e>255?255:e;ca[8]=n<0?0:n>255?255:n;ca[9]=p<0?0:p>255?255:p;ca[10]=c<0?0:c>255?255:c;ca[12]=t<0?0:t>255?255:t;ca[13]=v<0?0:v>255?255:v;ca[14]=f<0?0:f>255?255:f;X.putImageData(Ba,0,0);Wa.drawImage(Fa,
+0,0);return Va}function Na(b,e,c){b=(b-e)/(c-e);return b*b*(3-2*b)}function Ta(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Ka(b,e){var c=e.x-b.x,f=e.y-b.y,k=c*c+f*f;k!=0&&(k=1/Math.sqrt(k),c*=k,f*=k,e.x+=c,e.y+=f,b.x-=c,b.y-=f)}var Ya,cb,va,Da,La,Ua,Za,F;this.autoClear?this.clear():w.setTransform(1,0,0,-1,t,x);m.data.vertices=0;m.data.faces=0;k=n.projectScene(b,v,this.sortElements);($=b.lights.length>0)&&p(b);Ya=0;for(cb=k.length;Ya<cb;Ya++){va=k[Ya];fa.empty();if(va instanceof THREE.RenderableParticle){J=
+va;J.x*=t;J.y*=x;Da=0;for(La=va.materials.length;Da<La;)F=va.materials[Da++],F.opacity!=0&&y(J,va,F,b)}else if(va instanceof THREE.RenderableLine){if(J=va.v1,I=va.v2,J.positionScreen.x*=t,J.positionScreen.y*=x,I.positionScreen.x*=t,I.positionScreen.y*=x,fa.addPoint(J.positionScreen.x,J.positionScreen.y),fa.addPoint(I.positionScreen.x,I.positionScreen.y),L.instersects(fa)){Da=0;for(La=va.materials.length;Da<La;)F=va.materials[Da++],F.opacity!=0&&z(J,I,va,F,b)}}else if(va instanceof THREE.RenderableFace3){if(J=
+va.v1,I=va.v2,K=va.v3,J.positionScreen.x*=t,J.positionScreen.y*=x,I.positionScreen.x*=t,I.positionScreen.y*=x,K.positionScreen.x*=t,K.positionScreen.y*=x,va.overdraw&&(Ka(J.positionScreen,I.positionScreen),Ka(I.positionScreen,K.positionScreen),Ka(K.positionScreen,J.positionScreen)),fa.add3Points(J.positionScreen.x,J.positionScreen.y,I.positionScreen.x,I.positionScreen.y,K.positionScreen.x,K.positionScreen.y),L.instersects(fa)){Da=0;for(La=va.meshMaterials.length;Da<La;)if(F=va.meshMaterials[Da++],
+F instanceof THREE.MeshFaceMaterial){Ua=0;for(Za=va.faceMaterials.length;Ua<Za;)(F=va.faceMaterials[Ua++])&&F.opacity!=0&&A(J,I,K,0,1,2,va,F,b)}else F.opacity!=0&&A(J,I,K,0,1,2,va,F,b)}}else if(va instanceof THREE.RenderableFace4&&(J=va.v1,I=va.v2,K=va.v3,W=va.v4,J.positionScreen.x*=t,J.positionScreen.y*=x,I.positionScreen.x*=t,I.positionScreen.y*=x,K.positionScreen.x*=t,K.positionScreen.y*=x,W.positionScreen.x*=t,W.positionScreen.y*=x,D.positionScreen.copy(I.positionScreen),M.positionScreen.copy(W.positionScreen),
+va.overdraw&&(Ka(J.positionScreen,I.positionScreen),Ka(I.positionScreen,W.positionScreen),Ka(W.positionScreen,J.positionScreen),Ka(K.positionScreen,D.positionScreen),Ka(K.positionScreen,M.positionScreen)),fa.addPoint(J.positionScreen.x,J.positionScreen.y),fa.addPoint(I.positionScreen.x,I.positionScreen.y),fa.addPoint(K.positionScreen.x,K.positionScreen.y),fa.addPoint(W.positionScreen.x,W.positionScreen.y),L.instersects(fa))){Da=0;for(La=va.meshMaterials.length;Da<La;)if(F=va.meshMaterials[Da++],F instanceof
+THREE.MeshFaceMaterial){Ua=0;for(Za=va.faceMaterials.length;Ua<Za;)(F=va.faceMaterials[Ua++])&&F.opacity!=0&&C(J,I,K,W,D,M,va,F,b)}else F.opacity!=0&&C(J,I,K,W,D,M,va,F,b)}P.addRectangle(fa)}w.setTransform(1,0,0,1,0,0)}};
+THREE.SVGRenderer=function(){function b(b,e,c){var f,k,h,m;f=0;for(k=b.lights.length;f<k;f++)h=b.lights[f],h instanceof THREE.DirectionalLight?(m=e.normalWorld.dot(h.position)*h.intensity,m>0&&(c.r+=h.color.r*m,c.g+=h.color.g*m,c.b+=h.color.b*m)):h instanceof THREE.PointLight&&(W.sub(h.position,e.centroidWorld),W.normalize(),m=e.normalWorld.dot(W)*h.intensity,m>0&&(c.r+=h.color.r*m,c.g+=h.color.g*m,c.b+=h.color.b*m))}function c(e,c,k,o,n,t){m.data.vertices+=3;m.data.faces++;U=f(V++);U.setAttribute("d",
+"M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");n instanceof THREE.MeshBasicMaterial?H.copy(n.color):n instanceof THREE.MeshLambertMaterial?G?(N.r=S.r,N.g=S.g,N.b=S.b,b(t,o,N),H.r=Math.max(0,Math.min(n.color.r*N.r,1)),H.g=Math.max(0,Math.min(n.color.g*N.g,1)),H.b=Math.max(0,Math.min(n.color.b*N.b,1))):H.copy(n.color):n instanceof THREE.MeshDepthMaterial?(K=1-n.__2near/(n.__farPlusNear-o.z*n.__farMinusNear),
+H.setRGB(K,K,K)):n instanceof THREE.MeshNormalMaterial&&H.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));n.wireframe?U.setAttribute("style","fill: none; stroke: "+H.getContextStyle()+"; stroke-width: "+n.wireframeLinewidth+"; stroke-opacity: "+n.opacity+"; stroke-linecap: "+n.wireframeLinecap+"; stroke-linejoin: "+n.wireframeLinejoin):U.setAttribute("style","fill: "+H.getContextStyle()+"; fill-opacity: "+n.opacity);p.appendChild(U)}function e(e,c,k,o,n,t,v){m.data.vertices+=4;m.data.faces++;
+U=f(V++);U.setAttribute("d","M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+" L "+o.positionScreen.x+","+o.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?H.copy(t.color):t instanceof THREE.MeshLambertMaterial?G?(N.r=S.r,N.g=S.g,N.b=S.b,b(v,n,N),H.r=Math.max(0,Math.min(t.color.r*N.r,1)),H.g=Math.max(0,Math.min(t.color.g*N.g,1)),H.b=Math.max(0,Math.min(t.color.b*N.b,1))):H.copy(t.color):t instanceof
+THREE.MeshDepthMaterial?(K=1-t.__2near/(t.__farPlusNear-n.z*t.__farMinusNear),H.setRGB(K,K,K)):t instanceof THREE.MeshNormalMaterial&&H.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));t.wireframe?U.setAttribute("style","fill: none; stroke: "+H.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):U.setAttribute("style","fill: "+H.getContextStyle()+"; fill-opacity: "+
+t.opacity);p.appendChild(U)}function f(b){D[b]==null&&(D[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),o==0&&D[b].setAttribute("shape-rendering","crispEdges"));return D[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var m=this,k=null,n=new THREE.Projector,p=document.createElementNS("http://www.w3.org/2000/svg","svg"),v,u,t,x,w,y,z,A,C=new THREE.Rectangle,E=new THREE.Rectangle,G=!1,H=new THREE.Color(16777215),N=new THREE.Color(16777215),S=new THREE.Color(0),J=new THREE.Color(0),
+I=new THREE.Color(0),K,W=new THREE.Vector3,D=[],M=[],U,V,R,o=1;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setQuality=function(b){switch(b){case "high":o=1;break;case "low":o=0}};this.setSize=function(b,e){v=b;u=e;t=v/2;x=u/2;p.setAttribute("viewBox",-t+" "+-x+" "+v+" "+u);p.setAttribute("width",v);p.setAttribute("height",u);C.set(-t,-x,t,x)};this.clear=function(){for(;p.childNodes.length>0;)p.removeChild(p.childNodes[0])};this.render=
+function(b,f){var h,v,u,H,N,D,K,ga;this.autoClear&&this.clear();m.data.vertices=0;m.data.faces=0;k=n.projectScene(b,f,this.sortElements);R=V=0;if(G=b.lights.length>0){K=b.lights;S.setRGB(0,0,0);J.setRGB(0,0,0);I.setRGB(0,0,0);h=0;for(v=K.length;h<v;h++)u=K[h],H=u.color,u instanceof THREE.AmbientLight?(S.r+=H.r,S.g+=H.g,S.b+=H.b):u instanceof THREE.DirectionalLight?(J.r+=H.r,J.g+=H.g,J.b+=H.b):u instanceof THREE.PointLight&&(I.r+=H.r,I.g+=H.g,I.b+=H.b)}h=0;for(v=k.length;h<v;h++)if(K=k[h],E.empty(),
+K instanceof THREE.RenderableParticle){w=K;w.x*=t;w.y*=-x;u=0;for(H=K.materials.length;u<H;)u++}else if(K instanceof THREE.RenderableLine){if(w=K.v1,y=K.v2,w.positionScreen.x*=t,w.positionScreen.y*=-x,y.positionScreen.x*=t,y.positionScreen.y*=-x,E.addPoint(w.positionScreen.x,w.positionScreen.y),E.addPoint(y.positionScreen.x,y.positionScreen.y),C.instersects(E)){u=0;for(H=K.materials.length;u<H;)if((ga=K.materials[u++])&&ga.opacity!=0){N=w;D=y;var Y=R++;M[Y]==null&&(M[Y]=document.createElementNS("http://www.w3.org/2000/svg",
+"line"),o==0&&M[Y].setAttribute("shape-rendering","crispEdges"));U=M[Y];U.setAttribute("x1",N.positionScreen.x);U.setAttribute("y1",N.positionScreen.y);U.setAttribute("x2",D.positionScreen.x);U.setAttribute("y2",D.positionScreen.y);ga instanceof THREE.LineBasicMaterial&&(U.setAttribute("style","fill: none; stroke: "+ga.color.getContextStyle()+"; stroke-width: "+ga.linewidth+"; stroke-opacity: "+ga.opacity+"; stroke-linecap: "+ga.linecap+"; stroke-linejoin: "+ga.linejoin),p.appendChild(U))}}}else if(K instanceof
+THREE.RenderableFace3){if(w=K.v1,y=K.v2,z=K.v3,w.positionScreen.x*=t,w.positionScreen.y*=-x,y.positionScreen.x*=t,y.positionScreen.y*=-x,z.positionScreen.x*=t,z.positionScreen.y*=-x,E.addPoint(w.positionScreen.x,w.positionScreen.y),E.addPoint(y.positionScreen.x,y.positionScreen.y),E.addPoint(z.positionScreen.x,z.positionScreen.y),C.instersects(E)){u=0;for(H=K.meshMaterials.length;u<H;)if(ga=K.meshMaterials[u++],ga instanceof THREE.MeshFaceMaterial){N=0;for(D=K.faceMaterials.length;N<D;)(ga=K.faceMaterials[N++])&&
+ga.opacity!=0&&c(w,y,z,K,ga,b)}else ga&&ga.opacity!=0&&c(w,y,z,K,ga,b)}}else if(K instanceof THREE.RenderableFace4&&(w=K.v1,y=K.v2,z=K.v3,A=K.v4,w.positionScreen.x*=t,w.positionScreen.y*=-x,y.positionScreen.x*=t,y.positionScreen.y*=-x,z.positionScreen.x*=t,z.positionScreen.y*=-x,A.positionScreen.x*=t,A.positionScreen.y*=-x,E.addPoint(w.positionScreen.x,w.positionScreen.y),E.addPoint(y.positionScreen.x,y.positionScreen.y),E.addPoint(z.positionScreen.x,z.positionScreen.y),E.addPoint(A.positionScreen.x,
+A.positionScreen.y),C.instersects(E))){u=0;for(H=K.meshMaterials.length;u<H;)if(ga=K.meshMaterials[u++],ga instanceof THREE.MeshFaceMaterial){N=0;for(D=K.faceMaterials.length;N<D;)(ga=K.faceMaterials[N++])&&ga.opacity!=0&&e(w,y,z,A,K,ga,b)}else ga&&ga.opacity!=0&&e(w,y,z,A,K,ga,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",
 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",
@@ -219,118 +219,118 @@ 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;",
 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")}};
-THREE.WebGLRenderer=function(b){function c(b,e,c){var f,k,h,m=b.vertices,n=m.length,u=b.colors,p=u.length,t=b.__vertexArray,v=b.__colorArray,w=b.__sortArray,x=b.__dirtyVertices,L=b.__dirtyColors,ea=b.__webglCustomAttributes,y,P;if(ea)for(y in ea)ea[y].offset=0;if(c.sortParticles){ua.multiplySelf(c.matrixWorld);for(f=0;f<n;f++)k=m[f].position,wa.copy(k),ua.multiplyVector3(wa),w[f]=[wa.z,f];w.sort(function(b,e){return e[0]-b[0]});for(f=0;f<n;f++)k=m[w[f][1]].position,h=f*3,t[h]=k.x,t[h+1]=k.y,t[h+2]=
-k.z;for(f=0;f<p;f++)h=f*3,color=u[w[f][1]],v[h]=color.r,v[h+1]=color.g,v[h+2]=color.b;if(ea)for(y in ea){f=ea[y];u=f.value.length;for(h=0;h<u;h++){index=w[h][1];p=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[p]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")P=f.value[index];f.size===2?(f.array[p]=P.x,f.array[p+1]=P.y):f.size===3?f.type==="c"?(f.array[p]=P.r,f.array[p+1]=P.g,f.array[p+2]=P.b):(f.array[p]=P.x,f.array[p+1]=P.y,f.array[p+2]=P.z):(f.array[p]=
-P.x,f.array[p+1]=P.y,f.array[p+2]=P.z,f.array[p+3]=P.w)}f.offset+=f.size}}}else{if(x)for(f=0;f<n;f++)k=m[f].position,h=f*3,t[h]=k.x,t[h+1]=k.y,t[h+2]=k.z;if(L)for(f=0;f<p;f++)color=u[f],h=f*3,v[h]=color.r,v[h+1]=color.g,v[h+2]=color.b;if(ea)for(y in ea)if(f=ea[y],f.__original.needsUpdate){u=f.value.length;for(h=0;h<u;h++){p=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[p]=f.value[h]}else{if(f.boundTo===void 0||f.boundTo==="vertices")P=f.value[h];f.size===2?(f.array[p]=
-P.x,f.array[p+1]=P.y):f.size===3?f.type==="c"?(f.array[p]=P.r,f.array[p+1]=P.g,f.array[p+2]=P.b):(f.array[p]=P.x,f.array[p+1]=P.y,f.array[p+2]=P.z):(f.array[p]=P.x,f.array[p+1]=P.y,f.array[p+2]=P.z,f.array[p+3]=P.w)}f.offset+=f.size}}}if(x||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,t,e);if(L||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,v,e);if(ea)for(y in ea)if(f=ea[y],f.__original.needsUpdate||
-c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,f.buffer),o.bufferData(o.ARRAY_BUFFER,f.array,e)}function e(b,e,c,f,h){f.program||R.initMaterial(f,e,c,h);if(f.morphTargets&&!h.__webglMorphTargetInfluences){h.__webglMorphTargetInfluences=new Float32Array(R.maxMorphTargets);for(var k=0,m=R.maxMorphTargets;k<m;k++)h.__webglMorphTargetInfluences[k]=0}var k=f.program,m=k.uniforms,n=f.uniforms;k!=T&&(o.useProgram(k),T=k);o.uniformMatrix4fv(m.projectionMatrix,!1,ta);if(c&&(f instanceof THREE.MeshBasicMaterial||
-f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial||f instanceof THREE.LineBasicMaterial||f instanceof THREE.ParticleBasicMaterial||f.fog))if(n.fogColor.value=c.color,c instanceof THREE.Fog)n.fogNear.value=c.near,n.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)n.fogDensity.value=c.density;if(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f.lights){var p,u,t,v=0,w=0,x=0,L,ea,y,P=Ca,z=P.directional.colors,C=P.directional.positions,A=P.point.colors,
-E=P.point.positions,G=P.point.distances,H=0,$=0,c=u=y=0;for(p=e.length;c<p;c++)if(u=e[c],t=u.color,L=u.position,ea=u.intensity,y=u.distance,u instanceof THREE.AmbientLight)v+=t.r,w+=t.g,x+=t.b;else if(u instanceof THREE.DirectionalLight)y=H*3,z[y]=t.r*ea,z[y+1]=t.g*ea,z[y+2]=t.b*ea,C[y]=L.x,C[y+1]=L.y,C[y+2]=L.z,H+=1;else if(u instanceof THREE.SpotLight)y=H*3,z[y]=t.r*ea,z[y+1]=t.g*ea,z[y+2]=t.b*ea,t=1/L.length(),C[y]=L.x*t,C[y+1]=L.y*t,C[y+2]=L.z*t,H+=1;else if(u instanceof THREE.PointLight)u=$*
-3,A[u]=t.r*ea,A[u+1]=t.g*ea,A[u+2]=t.b*ea,E[u]=L.x,E[u+1]=L.y,E[u+2]=L.z,G[$]=y,$+=1;for(c=H*3;c<z.length;c++)z[c]=0;for(c=$*3;c<A.length;c++)A[c]=0;P.point.length=$;P.directional.length=H;P.ambient[0]=v;P.ambient[1]=w;P.ambient[2]=x;e=Ca;n.enableLighting.value=e.directional.length+e.point.length;n.ambientLightColor.value=e.ambient;n.directionalLightColor.value=e.directional.colors;n.directionalLightDirection.value=e.directional.positions;n.pointLightColor.value=e.point.colors;n.pointLightPosition.value=
+THREE.WebGLRenderer=function(b){function c(b,e,c){var f,k,h,m=b.vertices,n=m.length,t=b.colors,p=t.length,v=b.__vertexArray,u=b.__colorArray,w=b.__sortArray,x=b.__dirtyVertices,L=b.__dirtyColors,fa=b.__webglCustomAttributes,y,P;if(fa)for(y in fa)fa[y].offset=0;if(c.sortParticles){ua.multiplySelf(c.matrixWorld);for(f=0;f<n;f++)k=m[f].position,wa.copy(k),ua.multiplyVector3(wa),w[f]=[wa.z,f];w.sort(function(b,e){return e[0]-b[0]});for(f=0;f<n;f++)k=m[w[f][1]].position,h=f*3,v[h]=k.x,v[h+1]=k.y,v[h+2]=
+k.z;for(f=0;f<p;f++)h=f*3,color=t[w[f][1]],u[h]=color.r,u[h+1]=color.g,u[h+2]=color.b;if(fa)for(y in fa){f=fa[y];t=f.value.length;for(h=0;h<t;h++){index=w[h][1];p=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[p]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")P=f.value[index];f.size===2?(f.array[p]=P.x,f.array[p+1]=P.y):f.size===3?f.type==="c"?(f.array[p]=P.r,f.array[p+1]=P.g,f.array[p+2]=P.b):(f.array[p]=P.x,f.array[p+1]=P.y,f.array[p+2]=P.z):(f.array[p]=
+P.x,f.array[p+1]=P.y,f.array[p+2]=P.z,f.array[p+3]=P.w)}f.offset+=f.size}}}else{if(x)for(f=0;f<n;f++)k=m[f].position,h=f*3,v[h]=k.x,v[h+1]=k.y,v[h+2]=k.z;if(L)for(f=0;f<p;f++)color=t[f],h=f*3,u[h]=color.r,u[h+1]=color.g,u[h+2]=color.b;if(fa)for(y in fa)if(f=fa[y],f.__original.needsUpdate){t=f.value.length;for(h=0;h<t;h++){p=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[p]=f.value[h]}else{if(f.boundTo===void 0||f.boundTo==="vertices")P=f.value[h];f.size===2?(f.array[p]=
+P.x,f.array[p+1]=P.y):f.size===3?f.type==="c"?(f.array[p]=P.r,f.array[p+1]=P.g,f.array[p+2]=P.b):(f.array[p]=P.x,f.array[p+1]=P.y,f.array[p+2]=P.z):(f.array[p]=P.x,f.array[p+1]=P.y,f.array[p+2]=P.z,f.array[p+3]=P.w)}f.offset+=f.size}}}if(x||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,v,e);if(L||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,u,e);if(fa)for(y in fa)if(f=fa[y],f.__original.needsUpdate||
+c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,f.buffer),o.bufferData(o.ARRAY_BUFFER,f.array,e)}function e(b,e,c,f,k){f.program||R.initMaterial(f,e,c,k);if(f.morphTargets&&!k.__webglMorphTargetInfluences){k.__webglMorphTargetInfluences=new Float32Array(R.maxMorphTargets);for(var h=0,m=R.maxMorphTargets;h<m;h++)k.__webglMorphTargetInfluences[h]=0}var h=f.program,m=h.uniforms,n=f.uniforms;h!=T&&(o.useProgram(h),T=h);o.uniformMatrix4fv(m.projectionMatrix,!1,ta);if(c&&(f instanceof THREE.MeshBasicMaterial||
+f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial||f instanceof THREE.LineBasicMaterial||f instanceof THREE.ParticleBasicMaterial||f.fog))if(n.fogColor.value=c.color,c instanceof THREE.Fog)n.fogNear.value=c.near,n.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)n.fogDensity.value=c.density;if(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f.lights){var p,t,v,u=0,w=0,x=0,L,fa,y,P=Ca,z=P.directional.colors,A=P.directional.positions,C=P.point.colors,
+E=P.point.positions,G=P.point.distances,H=0,$=0,c=t=y=0;for(p=e.length;c<p;c++)if(t=e[c],v=t.color,L=t.position,fa=t.intensity,y=t.distance,t instanceof THREE.AmbientLight)u+=v.r,w+=v.g,x+=v.b;else if(t instanceof THREE.DirectionalLight)y=H*3,z[y]=v.r*fa,z[y+1]=v.g*fa,z[y+2]=v.b*fa,A[y]=L.x,A[y+1]=L.y,A[y+2]=L.z,H+=1;else if(t instanceof THREE.SpotLight)y=H*3,z[y]=v.r*fa,z[y+1]=v.g*fa,z[y+2]=v.b*fa,v=1/L.length(),A[y]=L.x*v,A[y+1]=L.y*v,A[y+2]=L.z*v,H+=1;else if(t instanceof THREE.PointLight)t=$*
+3,C[t]=v.r*fa,C[t+1]=v.g*fa,C[t+2]=v.b*fa,E[t]=L.x,E[t+1]=L.y,E[t+2]=L.z,G[$]=y,$+=1;for(c=H*3;c<z.length;c++)z[c]=0;for(c=$*3;c<C.length;c++)C[c]=0;P.point.length=$;P.directional.length=H;P.ambient[0]=u;P.ambient[1]=w;P.ambient[2]=x;e=Ca;n.enableLighting.value=e.directional.length+e.point.length;n.ambientLightColor.value=e.ambient;n.directionalLightColor.value=e.directional.colors;n.directionalLightDirection.value=e.directional.positions;n.pointLightColor.value=e.point.colors;n.pointLightPosition.value=
 e.point.positions;n.pointLightDistance.value=e.point.distances}if(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial)n.diffuse.value=f.color,n.opacity.value=f.opacity,(n.map.texture=f.map)&&n.offsetRepeat.value.set(f.map.offset.x,f.map.offset.y,f.map.repeat.x,f.map.repeat.y),n.lightMap.texture=f.lightMap,n.envMap.texture=f.envMap,n.reflectivity.value=f.reflectivity,n.refractionRatio.value=f.refractionRatio,n.combine.value=f.combine,n.useRefract.value=
 f.envMap&&f.envMap.mapping instanceof THREE.CubeRefractionMapping;if(f instanceof THREE.LineBasicMaterial)n.diffuse.value=f.color,n.opacity.value=f.opacity;else if(f instanceof THREE.ParticleBasicMaterial)n.psColor.value=f.color,n.opacity.value=f.opacity,n.size.value=f.size,n.scale.value=za.height/2,n.map.texture=f.map;else if(f instanceof THREE.MeshPhongMaterial)n.ambient.value=f.ambient,n.specular.value=f.specular,n.shininess.value=f.shininess;else if(f instanceof THREE.MeshDepthMaterial)n.mNear.value=
-b.near,n.mFar.value=b.far,n.opacity.value=f.opacity;else if(f instanceof THREE.MeshNormalMaterial)n.opacity.value=f.opacity;if(h.receiveShadow&&!f._shadowPass&&n.shadowMatrix){for(e=0;e<ga.length;e++)n.shadowMatrix.value[e]=ga[e],n.shadowMap.texture[e]=R.shadowMap[e];n.shadowDarkness.value=R.shadowMapDarkness;n.shadowBias.value=R.shadowMapBias}for(var N in n)if(p=k.uniforms[N])if(c=n[N],v=c.type,e=c.value,v=="i")o.uniform1i(p,e);else if(v=="f")o.uniform1f(p,e);else if(v=="v2")o.uniform2f(p,e.x,e.y);
-else if(v=="v3")o.uniform3f(p,e.x,e.y,e.z);else if(v=="v4")o.uniform4f(p,e.x,e.y,e.z,e.w);else if(v=="c")o.uniform3f(p,e.r,e.g,e.b);else if(v=="fv1")o.uniform1fv(p,e);else if(v=="fv")o.uniform3fv(p,e);else if(v=="v3v"){if(!c._array)c._array=new Float32Array(3*e.length);v=0;for(w=e.length;v<w;v++)x=v*3,c._array[x]=e[v].x,c._array[x+1]=e[v].y,c._array[x+2]=e[v].z;o.uniform3fv(p,c._array)}else if(v=="m4"){if(!c._array)c._array=new Float32Array(16);e.flattenToArray(c._array);o.uniformMatrix4fv(p,!1,c._array)}else if(v==
-"m4v"){if(!c._array)c._array=new Float32Array(16*e.length);v=0;for(w=e.length;v<w;v++)e[v].flattenToArrayOffset(c._array,v*16);o.uniformMatrix4fv(p,!1,c._array)}else if(v=="t"){if(o.uniform1i(p,e),p=c.texture)if(p.image instanceof Array&&p.image.length==6){if(c=p,c.image.length==6)if(c.needsUpdate){if(!c.image.__webglTextureCube)c.image.__webglTextureCube=o.createTexture();o.activeTexture(o.TEXTURE0+e);o.bindTexture(o.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);for(e=0;e<6;e++)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+
-e,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,c.image[e]);I(o.TEXTURE_CUBE_MAP,c,c.image[0]);c.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+e),o.bindTexture(o.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else p instanceof THREE.WebGLRenderTargetCube?(c=p,o.activeTexture(o.TEXTURE0+e),o.bindTexture(o.TEXTURE_CUBE_MAP,c.__webglTexture)):K(p,e)}else if(v=="tv"){if(!c._array){c._array=[];v=0;for(w=c.texture.length;v<w;v++)c._array[v]=e+v}o.uniform1iv(p,c._array);v=0;for(w=c.texture.length;v<w;v++)(p=c.texture[v])&&
-K(p,c._array[v])}o.uniformMatrix4fv(m.modelViewMatrix,!1,h._modelViewMatrixArray);m.normalMatrix&&o.uniformMatrix3fv(m.normalMatrix,!1,h._normalMatrixArray);(f instanceof THREE.MeshShaderMaterial||f instanceof THREE.MeshPhongMaterial||f.envMap)&&m.cameraPosition!==null&&o.uniform3f(m.cameraPosition,b.position.x,b.position.y,b.position.z);(f instanceof THREE.MeshShaderMaterial||f.envMap||f.skinning||h.receiveShadow)&&m.objectMatrix!==null&&o.uniformMatrix4fv(m.objectMatrix,!1,h._objectMatrixArray);
-(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshShaderMaterial||f.skinning)&&m.viewMatrix!==null&&o.uniformMatrix4fv(m.viewMatrix,!1,ra);f.skinning&&(o.uniformMatrix4fv(m.cameraInverseMatrix,!1,ra),o.uniformMatrix4fv(m.boneGlobalMatrices,!1,h.boneMatrices));return k}function f(b,c,f,h,k,m){if(h.opacity!=0){var n,b=e(b,c,f,h,m).attributes;if(!h.morphTargets&&b.position>=0)o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer),o.vertexAttribPointer(b.position,
-3,o.FLOAT,!1,0,0);else if(m.morphTargetBase){c=h.program.attributes;m.morphTargetBase!==-1?(o.bindBuffer(o.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[m.morphTargetBase]),o.vertexAttribPointer(c.position,3,o.FLOAT,!1,0,0)):c.position>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer),o.vertexAttribPointer(c.position,3,o.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var f=0,p=m.morphTargetForcedOrder,u=m.morphTargetInfluences;f<h.numSupportedMorphTargets&&f<p.length;)o.bindBuffer(o.ARRAY_BUFFER,
-k.__webglMorphTargetsBuffers[p[f]]),o.vertexAttribPointer(c["morphTarget"+f],3,o.FLOAT,!1,0,0),m.__webglMorphTargetInfluences[f]=u[p[f]],f++;else{var p=[],t=-1,v=0,u=m.morphTargetInfluences,w,x=u.length,f=0;for(m.morphTargetBase!==-1&&(p[m.morphTargetBase]=!0);f<h.numSupportedMorphTargets;){for(w=0;w<x;w++)!p[w]&&u[w]>t&&(v=w,t=u[v]);o.bindBuffer(o.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[v]);o.vertexAttribPointer(c["morphTarget"+f],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[f]=t;p[v]=1;t=
--1;f++}}h.program.uniforms.morphTargetInfluences!==null&&o.uniform1fv(h.program.uniforms.morphTargetInfluences,m.__webglMorphTargetInfluences)}if(k.__webglCustomAttributes)for(n in k.__webglCustomAttributes)b[n]>=0&&(c=k.__webglCustomAttributes[n],o.bindBuffer(o.ARRAY_BUFFER,c.buffer),o.vertexAttribPointer(b[n],c.size,o.FLOAT,!1,0,0));b.color>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer),o.vertexAttribPointer(b.color,3,o.FLOAT,!1,0,0));b.normal>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglNormalBuffer),
-o.vertexAttribPointer(b.normal,3,o.FLOAT,!1,0,0));b.tangent>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglTangentBuffer),o.vertexAttribPointer(b.tangent,4,o.FLOAT,!1,0,0));b.uv>=0&&(k.__webglUVBuffer?(o.bindBuffer(o.ARRAY_BUFFER,k.__webglUVBuffer),o.vertexAttribPointer(b.uv,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv)):o.disableVertexAttribArray(b.uv));b.uv2>=0&&(k.__webglUV2Buffer?(o.bindBuffer(o.ARRAY_BUFFER,k.__webglUV2Buffer),o.vertexAttribPointer(b.uv2,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv2)):
-o.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinVertexABuffer),o.vertexAttribPointer(b.skinVertexA,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinVertexBBuffer),o.vertexAttribPointer(b.skinVertexB,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinIndicesBuffer),o.vertexAttribPointer(b.skinIndex,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinWeightsBuffer),
-o.vertexAttribPointer(b.skinWeight,4,o.FLOAT,!1,0,0));m instanceof THREE.Mesh?(h.wireframe?(o.lineWidth(h.wireframeLinewidth),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,k.__webglLineBuffer),o.drawElements(o.LINES,k.__webglLineCount,o.UNSIGNED_SHORT,0)):(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,k.__webglFaceBuffer),o.drawElements(o.TRIANGLES,k.__webglFaceCount,o.UNSIGNED_SHORT,0)),R.data.vertices+=k.__webglFaceCount,R.data.faces+=k.__webglFaceCount/3,R.data.drawCalls++):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?
-o.LINE_STRIP:o.LINES,o.lineWidth(h.linewidth),o.drawArrays(m,0,k.__webglLineCount),R.data.drawCalls++):m instanceof THREE.ParticleSystem?(o.drawArrays(o.POINTS,0,k.__webglParticleCount),R.data.drawCalls++):m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP,0,k.__webglVertexCount),R.data.drawCalls++)}}function h(b,e,c){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=o.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=o.createBuffer();b.hasPos&&(o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),
-o.bufferData(o.ARRAY_BUFFER,b.positionArray,o.DYNAMIC_DRAW),o.enableVertexAttribArray(e.attributes.position),o.vertexAttribPointer(e.attributes.position,3,o.FLOAT,!1,0,0));if(b.hasNormal){o.bindBuffer(o.ARRAY_BUFFER,b.__webglNormalBuffer);if(c==THREE.FlatShading){var f,k,h,m,n,p,u,t,v,w,x=b.count*3;for(w=0;w<x;w+=9)c=b.normalArray,f=c[w],k=c[w+1],h=c[w+2],m=c[w+3],p=c[w+4],t=c[w+5],n=c[w+6],u=c[w+7],v=c[w+8],f=(f+m+n)/3,k=(k+p+u)/3,h=(h+t+v)/3,c[w]=f,c[w+1]=k,c[w+2]=h,c[w+3]=f,c[w+4]=k,c[w+5]=h,c[w+
-6]=f,c[w+7]=k,c[w+8]=h}o.bufferData(o.ARRAY_BUFFER,b.normalArray,o.DYNAMIC_DRAW);o.enableVertexAttribArray(e.attributes.normal);o.vertexAttribPointer(e.attributes.normal,3,o.FLOAT,!1,0,0)}o.drawArrays(o.TRIANGLES,0,b.count);b.count=0}function m(b){if(aa!=b.doubleSided)b.doubleSided?o.disable(o.CULL_FACE):o.enable(o.CULL_FACE),aa=b.doubleSided;if(na!=b.flipSided)b.flipSided?o.frontFace(o.CW):o.frontFace(o.CCW),na=b.flipSided}function k(b){ka!=b&&(b?o.enable(o.DEPTH_TEST):o.disable(o.DEPTH_TEST),ka=
-b)}function n(b){da!=b&&(o.depthMask(b),da=b)}function t(b,e,c){Z!=b&&(b?o.enable(o.POLYGON_OFFSET_FILL):o.disable(o.POLYGON_OFFSET_FILL),Z=b);if(b&&(fa!=e||Y!=c))o.polygonOffset(e,c),fa=e,Y=c}function p(b){ca[0].set(b.n41-b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);ca[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);ca[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);ca[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);ca[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);
-ca[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34);for(var e,b=0;b<6;b++)e=ca[b],e.divideScalar(Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z))}function v(b){for(var e=b.matrixWorld,c=-b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)),f=0;f<6;f++)if(b=ca[f].x*e.n14+ca[f].y*e.n24+ca[f].z*e.n34+ca[f].w,b<=c)return!1;return!0}function u(b,e){b.list[b.count]=e;b.count+=1}function x(b){var e,c,f=b.object,k=b.opaque,h=b.transparent;h.count=0;b=k.count=0;for(e=f.materials.length;b<
-e;b++)c=f.materials[b],c.transparent?u(h,c):u(k,c)}function w(b){var e,c,f,k,h=b.object,m=b.buffer,n=b.opaque,o=b.transparent;o.count=0;b=n.count=0;for(f=h.materials.length;b<f;b++)if(e=h.materials[b],e instanceof THREE.MeshFaceMaterial){e=0;for(c=m.materials.length;e<c;e++)(k=m.materials[e])&&(k.transparent?u(o,k):u(n,k))}else(k=e)&&(k.transparent?u(o,k):u(n,k))}function y(b,e){return e.z-b.z}function z(b,c){var n,u,t,w=0,x,L,y,z,A=b.lights;$||($=new THREE.Camera(R.shadowCameraFov,c.aspect,R.shadowCameraNear,
-R.shadowCameraFar));n=0;for(u=A.length;n<u;n++)if(t=A[n],t instanceof THREE.SpotLight&&t.castShadow){R.shadowMap[w]||(R.shadowMap[w]=new THREE.WebGLRenderTarget(R.shadowMapWidth,R.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));ga[w]||(ga[w]=new THREE.Matrix4);x=R.shadowMap[w];L=ga[w];$.position.copy(t.position);$.target.position.copy(t.target.position);$.update(void 0,!0);b.update(void 0,!1,$);L.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);
-L.multiplySelf($.projectionMatrix);L.multiplySelf($.matrixWorldInverse);$.matrixWorldInverse.flattenToArray(ra);$.projectionMatrix.flattenToArray(ta);ua.multiply($.projectionMatrix,$.matrixWorldInverse);p(ua);R.initWebGLObjects(b);W(x);o.clearColor(1,1,1,1);R.clear();o.clearColor(P.r,P.g,P.b,ea);L=b.__webglObjects.length;t=b.__webglObjectsImmediate.length;for(x=0;x<L;x++)y=b.__webglObjects[x],z=y.object,z.visible&&z.castShadow?!(z instanceof THREE.Mesh)||!z.frustumCulled||v(z)?(z.matrixWorld.flattenToArray(z._objectMatrixArray),
+b.near,n.mFar.value=b.far,n.opacity.value=f.opacity;else if(f instanceof THREE.MeshNormalMaterial)n.opacity.value=f.opacity;if(k.receiveShadow&&!f._shadowPass&&n.shadowMatrix){for(e=0;e<ha.length;e++)n.shadowMatrix.value[e]=ha[e],n.shadowMap.texture[e]=R.shadowMap[e];n.shadowDarkness.value=R.shadowMapDarkness;n.shadowBias.value=R.shadowMapBias}for(var O in n)if(p=h.uniforms[O])if(c=n[O],u=c.type,e=c.value,u=="i")o.uniform1i(p,e);else if(u=="f")o.uniform1f(p,e);else if(u=="v2")o.uniform2f(p,e.x,e.y);
+else if(u=="v3")o.uniform3f(p,e.x,e.y,e.z);else if(u=="v4")o.uniform4f(p,e.x,e.y,e.z,e.w);else if(u=="c")o.uniform3f(p,e.r,e.g,e.b);else if(u=="fv1")o.uniform1fv(p,e);else if(u=="fv")o.uniform3fv(p,e);else if(u=="v3v"){if(!c._array)c._array=new Float32Array(3*e.length);u=0;for(w=e.length;u<w;u++)x=u*3,c._array[x]=e[u].x,c._array[x+1]=e[u].y,c._array[x+2]=e[u].z;o.uniform3fv(p,c._array)}else if(u=="m4"){if(!c._array)c._array=new Float32Array(16);e.flattenToArray(c._array);o.uniformMatrix4fv(p,!1,c._array)}else if(u==
+"m4v"){if(!c._array)c._array=new Float32Array(16*e.length);u=0;for(w=e.length;u<w;u++)e[u].flattenToArrayOffset(c._array,u*16);o.uniformMatrix4fv(p,!1,c._array)}else if(u=="t"){if(o.uniform1i(p,e),p=c.texture)if(p.image instanceof Array&&p.image.length==6){if(c=p,c.image.length==6)if(c.needsUpdate){if(!c.image.__webglTextureCube)c.image.__webglTextureCube=o.createTexture();o.activeTexture(o.TEXTURE0+e);o.bindTexture(o.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);for(e=0;e<6;e++)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+
+e,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,c.image[e]);I(o.TEXTURE_CUBE_MAP,c,c.image[0]);c.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+e),o.bindTexture(o.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else p instanceof THREE.WebGLRenderTargetCube?(c=p,o.activeTexture(o.TEXTURE0+e),o.bindTexture(o.TEXTURE_CUBE_MAP,c.__webglTexture)):K(p,e)}else if(u=="tv"){if(!c._array){c._array=[];u=0;for(w=c.texture.length;u<w;u++)c._array[u]=e+u}o.uniform1iv(p,c._array);u=0;for(w=c.texture.length;u<w;u++)(p=c.texture[u])&&
+K(p,c._array[u])}o.uniformMatrix4fv(m.modelViewMatrix,!1,k._modelViewMatrixArray);m.normalMatrix&&o.uniformMatrix3fv(m.normalMatrix,!1,k._normalMatrixArray);(f instanceof THREE.MeshShaderMaterial||f instanceof THREE.MeshPhongMaterial||f.envMap)&&m.cameraPosition!==null&&o.uniform3f(m.cameraPosition,b.position.x,b.position.y,b.position.z);(f instanceof THREE.MeshShaderMaterial||f.envMap||f.skinning||k.receiveShadow)&&m.objectMatrix!==null&&o.uniformMatrix4fv(m.objectMatrix,!1,k._objectMatrixArray);
+(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshShaderMaterial||f.skinning)&&m.viewMatrix!==null&&o.uniformMatrix4fv(m.viewMatrix,!1,ra);f.skinning&&(o.uniformMatrix4fv(m.cameraInverseMatrix,!1,ra),o.uniformMatrix4fv(m.boneGlobalMatrices,!1,k.boneMatrices));return h}function f(b,c,f,k,h,m){if(k.opacity!=0){var n,b=e(b,c,f,k,m).attributes;if(!k.morphTargets&&b.position>=0)o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(b.position,
+3,o.FLOAT,!1,0,0);else if(m.morphTargetBase){c=k.program.attributes;m.morphTargetBase!==-1?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[m.morphTargetBase]),o.vertexAttribPointer(c.position,3,o.FLOAT,!1,0,0)):c.position>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(c.position,3,o.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var f=0,p=m.morphTargetForcedOrder,t=m.morphTargetInfluences;f<k.numSupportedMorphTargets&&f<p.length;)o.bindBuffer(o.ARRAY_BUFFER,
+h.__webglMorphTargetsBuffers[p[f]]),o.vertexAttribPointer(c["morphTarget"+f],3,o.FLOAT,!1,0,0),m.__webglMorphTargetInfluences[f]=t[p[f]],f++;else{var p=[],v=-1,u=0,t=m.morphTargetInfluences,w,x=t.length,f=0;for(m.morphTargetBase!==-1&&(p[m.morphTargetBase]=!0);f<k.numSupportedMorphTargets;){for(w=0;w<x;w++)!p[w]&&t[w]>v&&(u=w,v=t[u]);o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[u]);o.vertexAttribPointer(c["morphTarget"+f],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[f]=v;p[u]=1;v=
+-1;f++}}k.program.uniforms.morphTargetInfluences!==null&&o.uniform1fv(k.program.uniforms.morphTargetInfluences,m.__webglMorphTargetInfluences)}if(h.__webglCustomAttributes)for(n in h.__webglCustomAttributes)b[n]>=0&&(c=h.__webglCustomAttributes[n],o.bindBuffer(o.ARRAY_BUFFER,c.buffer),o.vertexAttribPointer(b[n],c.size,o.FLOAT,!1,0,0));b.color>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglColorBuffer),o.vertexAttribPointer(b.color,3,o.FLOAT,!1,0,0));b.normal>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglNormalBuffer),
+o.vertexAttribPointer(b.normal,3,o.FLOAT,!1,0,0));b.tangent>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglTangentBuffer),o.vertexAttribPointer(b.tangent,4,o.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglUVBuffer),o.vertexAttribPointer(b.uv,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv)):o.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglUV2Buffer),o.vertexAttribPointer(b.uv2,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv2)):
+o.disableVertexAttribArray(b.uv2));k.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinVertexABuffer),o.vertexAttribPointer(b.skinVertexA,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),o.vertexAttribPointer(b.skinVertexB,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),o.vertexAttribPointer(b.skinIndex,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),
+o.vertexAttribPointer(b.skinWeight,4,o.FLOAT,!1,0,0));m instanceof THREE.Mesh?(k.wireframe?(o.lineWidth(k.wireframeLinewidth),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),o.drawElements(o.LINES,h.__webglLineCount,o.UNSIGNED_SHORT,0)):(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),o.drawElements(o.TRIANGLES,h.__webglFaceCount,o.UNSIGNED_SHORT,0)),R.data.vertices+=h.__webglFaceCount,R.data.faces+=h.__webglFaceCount/3,R.data.drawCalls++):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?
+o.LINE_STRIP:o.LINES,o.lineWidth(k.linewidth),o.drawArrays(m,0,h.__webglLineCount),R.data.drawCalls++):m instanceof THREE.ParticleSystem?(o.drawArrays(o.POINTS,0,h.__webglParticleCount),R.data.drawCalls++):m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP,0,h.__webglVertexCount),R.data.drawCalls++)}}function h(b,e,c){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=o.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=o.createBuffer();b.hasPos&&(o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),
+o.bufferData(o.ARRAY_BUFFER,b.positionArray,o.DYNAMIC_DRAW),o.enableVertexAttribArray(e.attributes.position),o.vertexAttribPointer(e.attributes.position,3,o.FLOAT,!1,0,0));if(b.hasNormal){o.bindBuffer(o.ARRAY_BUFFER,b.__webglNormalBuffer);if(c==THREE.FlatShading){var f,h,k,m,n,p,t,v,u,w,x=b.count*3;for(w=0;w<x;w+=9)c=b.normalArray,f=c[w],h=c[w+1],k=c[w+2],m=c[w+3],p=c[w+4],v=c[w+5],n=c[w+6],t=c[w+7],u=c[w+8],f=(f+m+n)/3,h=(h+p+t)/3,k=(k+v+u)/3,c[w]=f,c[w+1]=h,c[w+2]=k,c[w+3]=f,c[w+4]=h,c[w+5]=k,c[w+
+6]=f,c[w+7]=h,c[w+8]=k}o.bufferData(o.ARRAY_BUFFER,b.normalArray,o.DYNAMIC_DRAW);o.enableVertexAttribArray(e.attributes.normal);o.vertexAttribPointer(e.attributes.normal,3,o.FLOAT,!1,0,0)}o.drawArrays(o.TRIANGLES,0,b.count);b.count=0}function m(b){if(aa!=b.doubleSided)b.doubleSided?o.disable(o.CULL_FACE):o.enable(o.CULL_FACE),aa=b.doubleSided;if(na!=b.flipSided)b.flipSided?o.frontFace(o.CW):o.frontFace(o.CCW),na=b.flipSided}function k(b){ka!=b&&(b?o.enable(o.DEPTH_TEST):o.disable(o.DEPTH_TEST),ka=
+b)}function n(b){ea!=b&&(o.depthMask(b),ea=b)}function p(b,e,c){Z!=b&&(b?o.enable(o.POLYGON_OFFSET_FILL):o.disable(o.POLYGON_OFFSET_FILL),Z=b);if(b&&(ga!=e||Y!=c))o.polygonOffset(e,c),ga=e,Y=c}function v(b){da[0].set(b.n41-b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);da[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);da[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);da[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);da[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);
+da[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34);for(var e,b=0;b<6;b++)e=da[b],e.divideScalar(Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z))}function u(b){for(var e=b.matrixWorld,c=-b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)),f=0;f<6;f++)if(b=da[f].x*e.n14+da[f].y*e.n24+da[f].z*e.n34+da[f].w,b<=c)return!1;return!0}function t(b,e){b.list[b.count]=e;b.count+=1}function x(b){var e,c,f=b.object,h=b.opaque,k=b.transparent;k.count=0;b=h.count=0;for(e=f.materials.length;b<
+e;b++)c=f.materials[b],c.transparent?t(k,c):t(h,c)}function w(b){var e,c,f,h,k=b.object,m=b.buffer,n=b.opaque,o=b.transparent;o.count=0;b=n.count=0;for(f=k.materials.length;b<f;b++)if(e=k.materials[b],e instanceof THREE.MeshFaceMaterial){e=0;for(c=m.materials.length;e<c;e++)(h=m.materials[e])&&(h.transparent?t(o,h):t(n,h))}else(h=e)&&(h.transparent?t(o,h):t(n,h))}function y(b,e){return e.z-b.z}function z(b,c){var n,p,t,w=0,x,L,y,z,A=b.lights;$||($=new THREE.Camera(R.shadowCameraFov,c.aspect,R.shadowCameraNear,
+R.shadowCameraFar));n=0;for(p=A.length;n<p;n++)if(t=A[n],t instanceof THREE.SpotLight&&t.castShadow){R.shadowMap[w]||(R.shadowMap[w]=new THREE.WebGLRenderTarget(R.shadowMapWidth,R.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));ha[w]||(ha[w]=new THREE.Matrix4);x=R.shadowMap[w];L=ha[w];$.position.copy(t.position);$.target.position.copy(t.target.position);$.update(void 0,!0);b.update(void 0,!1,$);L.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);
+L.multiplySelf($.projectionMatrix);L.multiplySelf($.matrixWorldInverse);$.matrixWorldInverse.flattenToArray(ra);$.projectionMatrix.flattenToArray(ta);ua.multiply($.projectionMatrix,$.matrixWorldInverse);v(ua);R.initWebGLObjects(b);W(x);o.clearColor(1,1,1,1);R.clear();o.clearColor(P.r,P.g,P.b,fa);L=b.__webglObjects.length;t=b.__webglObjectsImmediate.length;for(x=0;x<L;x++)y=b.__webglObjects[x],z=y.object,z.visible&&z.castShadow?!(z instanceof THREE.Mesh)||!z.frustumCulled||u(z)?(z.matrixWorld.flattenToArray(z._objectMatrixArray),
 C(z,$,!1),y.render=!0):y.render=!1:y.render=!1;k(!0);J(THREE.NormalBlending);for(x=0;x<L;x++)if(y=b.__webglObjects[x],y.render)z=y.object,buffer=y.buffer,m(z),y=z.customDepthMaterial?z.customDepthMaterial:z.geometry.morphTargets.length?xa:ya,f($,A,null,y,buffer,z);for(x=0;x<t;x++)y=b.__webglObjectsImmediate[x],z=y.object,z.visible&&z.castShadow&&(z.matrixAutoUpdate&&z.matrixWorld.flattenToArray(z._objectMatrixArray),C(z,$,!1),m(z),program=e($,A,null,ya,z),z.render(function(b){h(b,program,ya.shading)}));
-w++}}function A(b,e){var c,f,k;c=X.attributes;var h=X.uniforms,m=N/sa,n,p=[],u=sa*0.5,t=N*0.5,v=!0;o.useProgram(X.program);T=X.program;ka=ja=-1;Ba||(o.enableVertexAttribArray(X.attributes.position),o.enableVertexAttribArray(X.attributes.uv),Ba=!0);o.disable(o.CULL_FACE);o.enable(o.BLEND);o.depthMask(!0);o.bindBuffer(o.ARRAY_BUFFER,X.vertexBuffer);o.vertexAttribPointer(c.position,2,o.FLOAT,!1,16,0);o.vertexAttribPointer(c.uv,2,o.FLOAT,!1,16,8);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,X.elementBuffer);o.uniformMatrix4fv(h.projectionMatrix,
-!1,ta);o.activeTexture(o.TEXTURE0);o.uniform1i(h.map,0);c=0;for(f=b.__webglSprites.length;c<f;c++)k=b.__webglSprites[c],k.useScreenCoordinates?k.z=-k.position.z:(k._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,k.matrixWorld,k._modelViewMatrixArray),k.z=-k._modelViewMatrix.n34);b.__webglSprites.sort(y);c=0;for(f=b.__webglSprites.length;c<f;c++)k=b.__webglSprites[c],k.material===void 0&&k.map&&k.map.image&&k.map.image.width&&(k.useScreenCoordinates?(o.uniform1i(h.useScreenCoordinates,1),o.uniform3f(h.screenPosition,
-(k.position.x-u)/u,(t-k.position.y)/t,Math.max(0,Math.min(1,k.position.z)))):(o.uniform1i(h.useScreenCoordinates,0),o.uniform1i(h.affectedByDistance,k.affectedByDistance?1:0),o.uniformMatrix4fv(h.modelViewMatrix,!1,k._modelViewMatrixArray)),n=k.map.image.width/(k.scaleByViewport?N:1),p[0]=n*m*k.scale.x,p[1]=n*k.scale.y,o.uniform2f(h.uvScale,k.uvScale.x,k.uvScale.y),o.uniform2f(h.uvOffset,k.uvOffset.x,k.uvOffset.y),o.uniform2f(h.alignment,k.alignment.x,k.alignment.y),o.uniform1f(h.opacity,k.opacity),
-o.uniform1f(h.rotation,k.rotation),o.uniform2fv(h.scale,p),k.mergeWith3D&&!v?(o.enable(o.DEPTH_TEST),v=!0):!k.mergeWith3D&&v&&(o.disable(o.DEPTH_TEST),v=!1),J(k.blending),K(k.map,0),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0));o.enable(o.CULL_FACE);o.enable(o.DEPTH_TEST);o.depthMask(da)}function C(b,e,c){b._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);c&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}function E(b){var e,
-c,f,k;k=b.__materials;b=0;for(c=k.length;b<c;b++)if(f=k[b],f.attributes)for(e in f.attributes)if(f.attributes[e].needsUpdate)return!0;return!1}function G(b){var e,c,f,k;k=b.__materials;b=0;for(c=k.length;b<c;b++)if(f=k[b],f.attributes)for(e in f.attributes)f.attributes[e].needsUpdate=!1}function H(b,e){var c;for(c=b.length-1;c>=0;c--)b[c].object==e&&b.splice(c,1)}function O(b){function e(b){var k=[];c=0;for(f=b.length;c<f;c++)b[c]==void 0?k.push("undefined"):k.push(b[c].id);return k.join("_")}var c,
-f,k,h,m,n,o,p,u={},t=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};k=0;for(h=b.faces.length;k<h;k++)m=b.faces[k],n=m.materials,o=e(n),u[o]==void 0&&(u[o]={hash:o,counter:0}),p=u[o].hash+"_"+u[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[],materials:n,vertices:0,numMorphTargets:t}),m=m instanceof THREE.Face3?3:4,b.geometryGroups[p].vertices+m>65535&&(u[o].counter+=1,p=u[o].hash+"_"+u[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[],
-materials:n,vertices:0,numMorphTargets:t})),b.geometryGroups[p].faces.push(k),b.geometryGroups[p].vertices+=m;b.geometryGroupsList=[];for(var v in b.geometryGroups)b.geometryGroupsList.push(b.geometryGroups[v])}function S(b,e,c){b.push({buffer:e,object:c,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function J(b){if(b!=ja){switch(b){case THREE.AdditiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE);break;case THREE.SubtractiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,
+w++}}function A(b,e){var c,f,h;c=X.attributes;var k=X.uniforms,m=O/sa,n,p=[],t=sa*0.5,v=O*0.5,u=!0;o.useProgram(X.program);T=X.program;ka=ja=-1;Ba||(o.enableVertexAttribArray(X.attributes.position),o.enableVertexAttribArray(X.attributes.uv),Ba=!0);o.disable(o.CULL_FACE);o.enable(o.BLEND);o.depthMask(!0);o.bindBuffer(o.ARRAY_BUFFER,X.vertexBuffer);o.vertexAttribPointer(c.position,2,o.FLOAT,!1,16,0);o.vertexAttribPointer(c.uv,2,o.FLOAT,!1,16,8);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,X.elementBuffer);o.uniformMatrix4fv(k.projectionMatrix,
+!1,ta);o.activeTexture(o.TEXTURE0);o.uniform1i(k.map,0);c=0;for(f=b.__webglSprites.length;c<f;c++)h=b.__webglSprites[c],h.useScreenCoordinates?h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(y);c=0;for(f=b.__webglSprites.length;c<f;c++)h=b.__webglSprites[c],h.material===void 0&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(o.uniform1i(k.useScreenCoordinates,1),o.uniform3f(k.screenPosition,
+(h.position.x-t)/t,(v-h.position.y)/v,Math.max(0,Math.min(1,h.position.z)))):(o.uniform1i(k.useScreenCoordinates,0),o.uniform1i(k.affectedByDistance,h.affectedByDistance?1:0),o.uniformMatrix4fv(k.modelViewMatrix,!1,h._modelViewMatrixArray)),n=h.map.image.width/(h.scaleByViewport?O:1),p[0]=n*m*h.scale.x,p[1]=n*h.scale.y,o.uniform2f(k.uvScale,h.uvScale.x,h.uvScale.y),o.uniform2f(k.uvOffset,h.uvOffset.x,h.uvOffset.y),o.uniform2f(k.alignment,h.alignment.x,h.alignment.y),o.uniform1f(k.opacity,h.opacity),
+o.uniform1f(k.rotation,h.rotation),o.uniform2fv(k.scale,p),h.mergeWith3D&&!u?(o.enable(o.DEPTH_TEST),u=!0):!h.mergeWith3D&&u&&(o.disable(o.DEPTH_TEST),u=!1),J(h.blending),K(h.map,0),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0));o.enable(o.CULL_FACE);o.enable(o.DEPTH_TEST);o.depthMask(ea)}function C(b,e,c){b._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);c&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}function E(b){var e,
+c,f,h;h=b.__materials;b=0;for(c=h.length;b<c;b++)if(f=h[b],f.attributes)for(e in f.attributes)if(f.attributes[e].needsUpdate)return!0;return!1}function G(b){var e,c,f,h;h=b.__materials;b=0;for(c=h.length;b<c;b++)if(f=h[b],f.attributes)for(e in f.attributes)f.attributes[e].needsUpdate=!1}function H(b,e){var c;for(c=b.length-1;c>=0;c--)b[c].object==e&&b.splice(c,1)}function N(b){function e(b){var h=[];c=0;for(f=b.length;c<f;c++)b[c]==void 0?h.push("undefined"):h.push(b[c].id);return h.join("_")}var c,
+f,h,k,m,n,o,p,t={},v=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};h=0;for(k=b.faces.length;h<k;h++)m=b.faces[h],n=m.materials,o=e(n),t[o]==void 0&&(t[o]={hash:o,counter:0}),p=t[o].hash+"_"+t[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[],materials:n,vertices:0,numMorphTargets:v}),m=m instanceof THREE.Face3?3:4,b.geometryGroups[p].vertices+m>65535&&(t[o].counter+=1,p=t[o].hash+"_"+t[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[],
+materials:n,vertices:0,numMorphTargets:v})),b.geometryGroups[p].faces.push(h),b.geometryGroups[p].vertices+=m;b.geometryGroupsList=[];for(var u in b.geometryGroups)b.geometryGroupsList.push(b.geometryGroups[u])}function S(b,e,c){b.push({buffer:e,object:c,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function J(b){if(b!=ja){switch(b){case THREE.AdditiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE);break;case THREE.SubtractiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,
 o.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,o.SRC_COLOR);break;default:o.blendEquationSeparate(o.FUNC_ADD,o.FUNC_ADD),o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA)}ja=b}}function I(b,e,c){(c.width&c.width-1)==0&&(c.height&c.height-1)==0?(o.texParameteri(b,o.TEXTURE_WRAP_S,V(e.wrapS)),o.texParameteri(b,o.TEXTURE_WRAP_T,V(e.wrapT)),o.texParameteri(b,o.TEXTURE_MAG_FILTER,V(e.magFilter)),o.texParameteri(b,
 o.TEXTURE_MIN_FILTER,V(e.minFilter)),o.generateMipmap(b)):(o.texParameteri(b,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_MAG_FILTER,U(e.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,U(e.minFilter)))}function K(b,e){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=o.createTexture();o.activeTexture(o.TEXTURE0+e);o.bindTexture(o.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?o.texImage2D(o.TEXTURE_2D,
 0,V(b.format),b.image.width,b.image.height,0,V(b.format),o.UNSIGNED_BYTE,b.image.data):o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,b.image);I(o.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+e),o.bindTexture(o.TEXTURE_2D,b.__webglTexture)}function W(b){var e=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=o.createRenderbuffer();
 b.__webglTexture=o.createTexture();if(e){o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture);I(o.TEXTURE_CUBE_MAP,b,b);b.__webglFramebuffer=[];for(var c=0;c<6;c++)b.__webglFramebuffer[c]=o.createFramebuffer(),o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,V(b.format),b.width,b.height,0,V(b.format),V(b.type),null)}else b.__webglFramebuffer=o.createFramebuffer(),o.bindTexture(o.TEXTURE_2D,b.__webglTexture),I(o.TEXTURE_2D,b,b),o.texImage2D(o.TEXTURE_2D,0,V(b.format),b.width,b.height,0,V(b.format),V(b.type),
 null);o.bindRenderbuffer(o.RENDERBUFFER,b.__webglRenderbuffer);if(e)for(c=0;c<6;++c)o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer[c]),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+c,b.__webglTexture,0);else o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,b.__webglTexture,0);b.depthBuffer&&!b.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_COMPONENT16,b.width,b.height),
 o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.RENDERBUFFER,b.__webglRenderbuffer)):b.depthBuffer&&b.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,b.width,b.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,b.__webglRenderbuffer)):o.renderbufferStorage(o.RENDERBUFFER,o.RGBA4,b.width,b.height);e?o.bindTexture(o.TEXTURE_CUBE_MAP,null):o.bindTexture(o.TEXTURE_2D,null);o.bindRenderbuffer(o.RENDERBUFFER,null);o.bindFramebuffer(o.FRAMEBUFFER,
-null)}var f,k;b?(e=e?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,c=b.width,b=b.height,k=f=0):(e=null,c=sa,b=N,f=ma,k=ia);e!=la&&(o.bindFramebuffer(o.FRAMEBUFFER,e),o.viewport(f,k,c,b),la=e)}function D(b){b instanceof THREE.WebGLRenderTargetCube?(o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture),o.generateMipmap(o.TEXTURE_CUBE_MAP),o.bindTexture(o.TEXTURE_CUBE_MAP,null)):(o.bindTexture(o.TEXTURE_2D,b.__webglTexture),o.generateMipmap(o.TEXTURE_2D),o.bindTexture(o.TEXTURE_2D,null))}
+null)}var f,h;b?(e=e?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,c=b.width,b=b.height,h=f=0):(e=null,c=sa,b=O,f=ma,h=ia);e!=la&&(o.bindFramebuffer(o.FRAMEBUFFER,e),o.viewport(f,h,c,b),la=e)}function D(b){b instanceof THREE.WebGLRenderTargetCube?(o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture),o.generateMipmap(o.TEXTURE_CUBE_MAP),o.bindTexture(o.TEXTURE_CUBE_MAP,null)):(o.bindTexture(o.TEXTURE_2D,b.__webglTexture),o.generateMipmap(o.TEXTURE_2D),o.bindTexture(o.TEXTURE_2D,null))}
 function M(b,e){var c;b=="fragment"?c=o.createShader(o.FRAGMENT_SHADER):b=="vertex"&&(c=o.createShader(o.VERTEX_SHADER));o.shaderSource(c,e);o.compileShader(c);if(!o.getShaderParameter(c,o.COMPILE_STATUS))return console.error(o.getShaderInfoLog(c)),console.error(e),null;return c}function U(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return o.NEAREST;default:return o.LINEAR}}function V(b){switch(b){case THREE.RepeatWrapping:return o.REPEAT;
 case THREE.ClampToEdgeWrapping:return o.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return o.MIRRORED_REPEAT;case THREE.NearestFilter:return o.NEAREST;case THREE.NearestMipMapNearestFilter:return o.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return o.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return o.LINEAR;case THREE.LinearMipMapNearestFilter:return o.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return o.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return o.BYTE;
 case THREE.UnsignedByteType:return o.UNSIGNED_BYTE;case THREE.ShortType:return o.SHORT;case THREE.UnsignedShortType:return o.UNSIGNED_SHORT;case THREE.IntType:return o.INT;case THREE.UnsignedShortType:return o.UNSIGNED_INT;case THREE.FloatType:return o.FLOAT;case THREE.AlphaFormat:return o.ALPHA;case THREE.RGBFormat:return o.RGB;case THREE.RGBAFormat:return o.RGBA;case THREE.LuminanceFormat:return o.LUMINANCE;case THREE.LuminanceAlphaFormat:return o.LUMINANCE_ALPHA}return 0}var R=this,o,pa=[],T=null,
-la=null,aa=null,na=null,ja=null,ka=null,da=null,Z=null,fa=null,Y=null,ma=0,ia=0,sa=0,N=0,ca=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],ua=new THREE.Matrix4,ta=new Float32Array(16),ra=new Float32Array(16),wa=new THREE.Vector4,Ca={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},za=b.canvas!==void 0?b.canvas:document.createElement("canvas"),Aa=b.stencil!==void 0?
-b.stencil:!0,Ea=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,L=b.antialias!==void 0?b.antialias:!1,P=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),ea=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=za;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 $,ga=[],b=THREE.ShaderLib.depthRGBA,qa=THREE.UniformsUtils.clone(b.uniforms),ya=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:qa}),xa=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:qa,morphTargets:!0});ya._shadowPass=!0;xa._shadowPass=!0;try{if(!(o=za.getContext("experimental-webgl",
+la=null,aa=null,na=null,ja=null,ka=null,ea=null,Z=null,ga=null,Y=null,ma=0,ia=0,sa=0,O=0,da=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],ua=new THREE.Matrix4,ta=new Float32Array(16),ra=new Float32Array(16),wa=new THREE.Vector4,Ca={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},za=b.canvas!==void 0?b.canvas:document.createElement("canvas"),Aa=b.stencil!==void 0?
+b.stencil:!0,Ea=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,L=b.antialias!==void 0?b.antialias:!1,P=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),fa=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=za;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 $,ha=[],b=THREE.ShaderLib.depthRGBA,qa=THREE.UniformsUtils.clone(b.uniforms),ya=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:qa}),xa=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:qa,morphTargets:!0});ya._shadowPass=!0;xa._shadowPass=!0;try{if(!(o=za.getContext("experimental-webgl",
 {antialias:L,stencil:Aa,preserveDrawingBuffer:Ea})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+o.getParameter(o.VERSION)+" | "+o.getParameter(o.VENDOR)+" | "+o.getParameter(o.RENDERER)+" | "+o.getParameter(o.SHADING_LANGUAGE_VERSION))}catch(oa){console.error(oa)}o.clearColor(0,0,0,1);o.clearDepth(1);o.clearStencil(0);o.enable(o.DEPTH_TEST);o.depthFunc(o.LEQUAL);o.frontFace(o.CCW);o.cullFace(o.BACK);o.enable(o.CULL_FACE);o.enable(o.BLEND);o.blendEquation(o.FUNC_ADD);
-o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA);o.clearColor(P.r,P.g,P.b,ea);this.context=o;var Fa=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,X={};X.vertices=new Float32Array(16);X.faces=new Uint16Array(6);i=0;X.vertices[i++]=-1;X.vertices[i++]=-1;X.vertices[i++]=0;X.vertices[i++]=1;X.vertices[i++]=1;X.vertices[i++]=-1;X.vertices[i++]=1;X.vertices[i++]=1;X.vertices[i++]=1;X.vertices[i++]=1;X.vertices[i++]=1;X.vertices[i++]=0;X.vertices[i++]=-1;X.vertices[i++]=1;X.vertices[i++]=0;i=X.vertices[i++]=
+o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA);o.clearColor(P.r,P.g,P.b,fa);this.context=o;var Fa=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,X={};X.vertices=new Float32Array(16);X.faces=new Uint16Array(6);i=0;X.vertices[i++]=-1;X.vertices[i++]=-1;X.vertices[i++]=0;X.vertices[i++]=1;X.vertices[i++]=1;X.vertices[i++]=-1;X.vertices[i++]=1;X.vertices[i++]=1;X.vertices[i++]=1;X.vertices[i++]=1;X.vertices[i++]=1;X.vertices[i++]=0;X.vertices[i++]=-1;X.vertices[i++]=1;X.vertices[i++]=0;i=X.vertices[i++]=
 0;X.faces[i++]=0;X.faces[i++]=1;X.faces[i++]=2;X.faces[i++]=0;X.faces[i++]=2;X.faces[i++]=3;X.vertexBuffer=o.createBuffer();X.elementBuffer=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,X.vertexBuffer);o.bufferData(o.ARRAY_BUFFER,X.vertices,o.STATIC_DRAW);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,X.elementBuffer);o.bufferData(o.ELEMENT_ARRAY_BUFFER,X.faces,o.STATIC_DRAW);X.program=o.createProgram();o.attachShader(X.program,M("fragment",THREE.ShaderLib.sprite.fragmentShader));o.attachShader(X.program,M("vertex",
 THREE.ShaderLib.sprite.vertexShader));o.linkProgram(X.program);X.attributes={};X.uniforms={};X.attributes.position=o.getAttribLocation(X.program,"position");X.attributes.uv=o.getAttribLocation(X.program,"uv");X.uniforms.uvOffset=o.getUniformLocation(X.program,"uvOffset");X.uniforms.uvScale=o.getUniformLocation(X.program,"uvScale");X.uniforms.rotation=o.getUniformLocation(X.program,"rotation");X.uniforms.scale=o.getUniformLocation(X.program,"scale");X.uniforms.alignment=o.getUniformLocation(X.program,
 "alignment");X.uniforms.map=o.getUniformLocation(X.program,"map");X.uniforms.opacity=o.getUniformLocation(X.program,"opacity");X.uniforms.useScreenCoordinates=o.getUniformLocation(X.program,"useScreenCoordinates");X.uniforms.affectedByDistance=o.getUniformLocation(X.program,"affectedByDistance");X.uniforms.screenPosition=o.getUniformLocation(X.program,"screenPosition");X.uniforms.modelViewMatrix=o.getUniformLocation(X.program,"modelViewMatrix");X.uniforms.projectionMatrix=o.getUniformLocation(X.program,
-"projectionMatrix");var Ba=!1;this.setSize=function(b,e){za.width=b;za.height=e;this.setViewport(0,0,za.width,za.height)};this.setViewport=function(b,e,c,f){ma=b;ia=e;sa=c;N=f;o.viewport(ma,ia,sa,N)};this.setScissor=function(b,e,c,f){o.scissor(b,e,c,f)};this.enableScissorTest=function(b){b?o.enable(o.SCISSOR_TEST):o.disable(o.SCISSOR_TEST)};this.setClearColorHex=function(b,e){P.setHex(b);ea=e;o.clearColor(P.r,P.g,P.b,ea)};this.setClearColor=function(b,e){P.copy(b);ea=e;o.clearColor(P.r,P.g,P.b,ea)};
+"projectionMatrix");var Ba=!1;this.setSize=function(b,e){za.width=b;za.height=e;this.setViewport(0,0,za.width,za.height)};this.setViewport=function(b,e,c,f){ma=b;ia=e;sa=c;O=f;o.viewport(ma,ia,sa,O)};this.setScissor=function(b,e,c,f){o.scissor(b,e,c,f)};this.enableScissorTest=function(b){b?o.enable(o.SCISSOR_TEST):o.disable(o.SCISSOR_TEST)};this.setClearColorHex=function(b,e){P.setHex(b);fa=e;o.clearColor(P.r,P.g,P.b,fa)};this.setClearColor=function(b,e){P.copy(b);fa=e;o.clearColor(P.r,P.g,P.b,fa)};
 this.clear=function(){o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT|o.STENCIL_BUFFER_BIT)};this.getContext=function(){return o};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var e=b.geometry.geometryGroups[g];o.deleteBuffer(e.__webglVertexBuffer);o.deleteBuffer(e.__webglNormalBuffer);o.deleteBuffer(e.__webglTangentBuffer);
 o.deleteBuffer(e.__webglColorBuffer);o.deleteBuffer(e.__webglUVBuffer);o.deleteBuffer(e.__webglUV2Buffer);o.deleteBuffer(e.__webglSkinVertexABuffer);o.deleteBuffer(e.__webglSkinVertexBBuffer);o.deleteBuffer(e.__webglSkinIndicesBuffer);o.deleteBuffer(e.__webglSkinWeightsBuffer);o.deleteBuffer(e.__webglFaceBuffer);o.deleteBuffer(e.__webglLineBuffer);if(e.numMorphTargets)for(var c=0,f=e.numMorphTargets;c<f;c++)o.deleteBuffer(e.__webglMorphTargetsBuffers[c])}else if(b instanceof THREE.Ribbon)b=b.geometry,
-o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer);else if(b instanceof THREE.Line)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer);else if(b instanceof THREE.ParticleSystem)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer)};this.deallocateTexture=function(b){if(b.__webglInit)b.__webglInit=!1,o.deleteTexture(b.__webglTexture)};this.initMaterial=function(b,e,c,f){var k,h,m;b instanceof THREE.MeshDepthMaterial?
-m="depth":b instanceof THREE.MeshNormalMaterial?m="normal":b instanceof THREE.MeshBasicMaterial?m="basic":b instanceof THREE.MeshLambertMaterial?m="lambert":b instanceof THREE.MeshPhongMaterial?m="phong":b instanceof THREE.LineBasicMaterial?m="basic":b instanceof THREE.ParticleBasicMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];b.uniforms=THREE.UniformsUtils.clone(n.uniforms);b.vertexShader=n.vertexShader;b.fragmentShader=n.fragmentShader}var p,u,t;p=t=n=0;for(u=e.length;p<u;p++)h=
-e[p],h instanceof THREE.SpotLight&&t++,h instanceof THREE.DirectionalLight&&t++,h instanceof THREE.PointLight&&n++;n+t<=_maxLights?p=t:(p=Math.ceil(_maxLights*t/(n+t)),n=_maxLights-p);h={directional:p,point:n};n=t=0;for(p=e.length;n<p;n++)u=e[n],u instanceof THREE.SpotLight&&u.castShadow&&t++;var v=50;if(f!==void 0&&f instanceof THREE.SkinnedMesh)v=f.bones.length;var w;a:{p=b.fragmentShader;u=b.vertexShader;var n=b.uniforms,e=b.attributes,c={map:!!b.map,envMap:!!b.envMap,lightMap:!!b.lightMap,vertexColors:b.vertexColors,
-fog:c,sizeAttenuation:b.sizeAttenuation,skinning:b.skinning,morphTargets:b.morphTargets,maxMorphTargets:this.maxMorphTargets,maxDirLights:h.directional,maxPointLights:h.point,maxBones:v,shadowMapEnabled:this.shadowMapEnabled&&f.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:t,alphaTest:b.alphaTest},x,f=[];m?f.push(m):(f.push(p),f.push(u));for(x in c)f.push(x),f.push(c[x]);m=f.join();x=0;for(f=pa.length;x<f;x++)if(pa[x].code==
+o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer);else if(b instanceof THREE.Line)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer);else if(b instanceof THREE.ParticleSystem)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer)};this.deallocateTexture=function(b){if(b.__webglInit)b.__webglInit=!1,o.deleteTexture(b.__webglTexture)};this.initMaterial=function(b,e,c,f){var h,k,m;b instanceof THREE.MeshDepthMaterial?
+m="depth":b instanceof THREE.MeshNormalMaterial?m="normal":b instanceof THREE.MeshBasicMaterial?m="basic":b instanceof THREE.MeshLambertMaterial?m="lambert":b instanceof THREE.MeshPhongMaterial?m="phong":b instanceof THREE.LineBasicMaterial?m="basic":b instanceof THREE.ParticleBasicMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];b.uniforms=THREE.UniformsUtils.clone(n.uniforms);b.vertexShader=n.vertexShader;b.fragmentShader=n.fragmentShader}var p,t,v;p=v=n=0;for(t=e.length;p<t;p++)k=
+e[p],k instanceof THREE.SpotLight&&v++,k instanceof THREE.DirectionalLight&&v++,k instanceof THREE.PointLight&&n++;n+v<=_maxLights?p=v:(p=Math.ceil(_maxLights*v/(n+v)),n=_maxLights-p);k={directional:p,point:n};n=v=0;for(p=e.length;n<p;n++)t=e[n],t instanceof THREE.SpotLight&&t.castShadow&&v++;var u=50;if(f!==void 0&&f instanceof THREE.SkinnedMesh)u=f.bones.length;var w;a:{p=b.fragmentShader;t=b.vertexShader;var n=b.uniforms,e=b.attributes,c={map:!!b.map,envMap:!!b.envMap,lightMap:!!b.lightMap,vertexColors:b.vertexColors,
+fog:c,sizeAttenuation:b.sizeAttenuation,skinning:b.skinning,morphTargets:b.morphTargets,maxMorphTargets:this.maxMorphTargets,maxDirLights:k.directional,maxPointLights:k.point,maxBones:u,shadowMapEnabled:this.shadowMapEnabled&&f.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:v,alphaTest:b.alphaTest},x,f=[];m?f.push(m):(f.push(p),f.push(t));for(x in c)f.push(x),f.push(c[x]);m=f.join();x=0;for(f=pa.length;x<f;x++)if(pa[x].code==
 m){w=pa[x].program;break a}x=o.createProgram();f=[Fa?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?
 "#define SHADOWMAP_SOFT":"",c.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");
-h=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",c.fog?"#define USE_FOG":"",c.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":
-"",c.shadowMapSoft?"#define SHADOWMAP_WIDTH "+c.shadowMapWidth.toFixed(1):"",c.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+c.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");o.attachShader(x,M("fragment",h+p));o.attachShader(x,M("vertex",f+u));o.linkProgram(x);o.getProgramParameter(x,o.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+o.getProgramParameter(x,o.VALIDATE_STATUS)+", gl error ["+o.getError()+"]");x.uniforms=
+k=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",c.fog?"#define USE_FOG":"",c.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":
+"",c.shadowMapSoft?"#define SHADOWMAP_WIDTH "+c.shadowMapWidth.toFixed(1):"",c.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+c.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");o.attachShader(x,M("fragment",k+p));o.attachShader(x,M("vertex",f+t));o.linkProgram(x);o.getProgramParameter(x,o.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+o.getProgramParameter(x,o.VALIDATE_STATUS)+", gl error ["+o.getError()+"]");x.uniforms=
 {};x.attributes={};var L,f=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(L in n)f.push(L);L=f;f=0;for(n=L.length;f<n;f++)p=L[f],x.uniforms[p]=o.getUniformLocation(x,p);f=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(L=0;L<c.maxMorphTargets;L++)f.push("morphTarget"+L);for(w in e)f.push(w);w=f;L=0;for(e=w.length;L<e;L++)c=
 w[L],x.attributes[c]=o.getAttribLocation(x,c);pa.push({program:x,code:m});w=x}b.program=w;w=b.program.attributes;w.position>=0&&o.enableVertexAttribArray(w.position);w.color>=0&&o.enableVertexAttribArray(w.color);w.normal>=0&&o.enableVertexAttribArray(w.normal);w.tangent>=0&&o.enableVertexAttribArray(w.tangent);b.skinning&&w.skinVertexA>=0&&w.skinVertexB>=0&&w.skinIndex>=0&&w.skinWeight>=0&&(o.enableVertexAttribArray(w.skinVertexA),o.enableVertexAttribArray(w.skinVertexB),o.enableVertexAttribArray(w.skinIndex),
-o.enableVertexAttribArray(w.skinWeight));if(b.attributes)for(k in b.attributes)w[k]!==void 0&&w[k]>=0&&o.enableVertexAttribArray(w[k]);if(b.morphTargets)for(k=b.numSupportedMorphTargets=0;k<this.maxMorphTargets;k++)L="morphTarget"+k,w[L]>=0&&(o.enableVertexAttribArray(w[L]),b.numSupportedMorphTargets++)};this.clearTarget=function(b,c,e,f){W(b);b=0;c&&(b|=o.COLOR_BUFFER_BIT);e&&(b|=o.DEPTH_BUFFER_BIT);f&&(b|=o.STENCIL_BUFFER_BIT);o.clear(b)};this.render=function(b,c,o,u){var L,ea,P,E,G,H,$,N,I=b.lights,
-qa=b.fog;this.shadowMapEnabled&&z(b,c);R.data.vertices=0;R.data.faces=0;R.data.drawCalls=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(ra);c.projectionMatrix.flattenToArray(ta);ua.multiply(c.projectionMatrix,c.matrixWorldInverse);p(ua);this.initWebGLObjects(b);W(o);(this.autoClear||u)&&this.clear();G=b.__webglObjects.length;for(u=0;u<G;u++)if(L=b.__webglObjects[u],$=L.object,$.visible)if(!($ instanceof THREE.Mesh)||!$.frustumCulled||v($)){if($.matrixWorld.flattenToArray($._objectMatrixArray),
-C($,c,!0),w(L),L.render=!0,this.sortObjects)L.object.renderDepth?L.z=L.object.renderDepth:(wa.copy($.position),ua.multiplyVector3(wa),L.z=wa.z)}else L.render=!1;else L.render=!1;this.sortObjects&&b.__webglObjects.sort(y);H=b.__webglObjectsImmediate.length;for(u=0;u<H;u++)L=b.__webglObjectsImmediate[u],$=L.object,$.visible&&($.matrixAutoUpdate&&$.matrixWorld.flattenToArray($._objectMatrixArray),C($,c,!0),x(L));if(b.overrideMaterial){k(b.overrideMaterial.depthTest);J(b.overrideMaterial.blending);for(u=
-0;u<G;u++)if(L=b.__webglObjects[u],L.render)$=L.object,N=L.buffer,m($),f(c,I,qa,b.overrideMaterial,N,$);for(u=0;u<H;u++)L=b.__webglObjectsImmediate[u],$=L.object,$.visible&&(m($),ea=e(c,I,qa,b.overrideMaterial,$),$.render(function(c){h(c,ea,b.overrideMaterial.shading)}))}else{J(THREE.NormalBlending);for(u=G-1;u>=0;u--)if(L=b.__webglObjects[u],L.render){$=L.object;N=L.buffer;P=L.opaque;m($);for(L=0;L<P.count;L++)E=P.list[L],k(E.depthTest),n(E.depthWrite),t(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),
-f(c,I,qa,E,N,$)}for(u=0;u<H;u++)if(L=b.__webglObjectsImmediate[u],$=L.object,$.visible){P=L.opaque;m($);for(L=0;L<P.count;L++)E=P.list[L],k(E.depthTest),n(E.depthWrite),t(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),ea=e(c,I,qa,E,$),$.render(function(b){h(b,ea,E.shading)})}for(u=0;u<G;u++)if(L=b.__webglObjects[u],L.render){$=L.object;N=L.buffer;P=L.transparent;m($);for(L=0;L<P.count;L++)E=P.list[L],J(E.blending),k(E.depthTest),n(E.depthWrite),t(E.polygonOffset,E.polygonOffsetFactor,
-E.polygonOffsetUnits),f(c,I,qa,E,N,$)}for(u=0;u<H;u++)if(L=b.__webglObjectsImmediate[u],$=L.object,$.visible){P=L.transparent;m($);for(L=0;L<P.count;L++)E=P.list[L],J(E.blending),k(E.depthTest),n(E.depthWrite),t(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),ea=e(c,I,qa,E,$),$.render(function(b){h(b,ea,E.shading)})}}b.__webglSprites.length&&A(b,c);o&&o.minFilter!==THREE.NearestFilter&&o.minFilter!==THREE.LinearFilter&&D(o)};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=
-[],b.__webglObjectsImmediate=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var e=b.__objectsAdded[0],f=b,k=void 0,h=void 0,m=void 0;if(!e.__webglInit)if(e.__webglInit=!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),e instanceof THREE.Mesh)for(k in h=e.geometry,h.geometryGroups==void 0&&O(h),h.geometryGroups){m=h.geometryGroups[k];
+o.enableVertexAttribArray(w.skinWeight));if(b.attributes)for(h in b.attributes)w[h]!==void 0&&w[h]>=0&&o.enableVertexAttribArray(w[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h<this.maxMorphTargets;h++)L="morphTarget"+h,w[L]>=0&&(o.enableVertexAttribArray(w[L]),b.numSupportedMorphTargets++)};this.clearTarget=function(b,e,c,f){W(b);b=0;e&&(b|=o.COLOR_BUFFER_BIT);c&&(b|=o.DEPTH_BUFFER_BIT);f&&(b|=o.STENCIL_BUFFER_BIT);o.clear(b)};this.render=function(b,c,o,t){var L,fa,P,E,G,H,$,O,I=b.lights,
+qa=b.fog;this.shadowMapEnabled&&z(b,c);R.data.vertices=0;R.data.faces=0;R.data.drawCalls=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(ra);c.projectionMatrix.flattenToArray(ta);ua.multiply(c.projectionMatrix,c.matrixWorldInverse);v(ua);this.initWebGLObjects(b);W(o);(this.autoClear||t)&&this.clear();G=b.__webglObjects.length;for(t=0;t<G;t++)if(L=b.__webglObjects[t],$=L.object,$.visible)if(!($ instanceof THREE.Mesh)||!$.frustumCulled||u($)){if($.matrixWorld.flattenToArray($._objectMatrixArray),
+C($,c,!0),w(L),L.render=!0,this.sortObjects)L.object.renderDepth?L.z=L.object.renderDepth:(wa.copy($.position),ua.multiplyVector3(wa),L.z=wa.z)}else L.render=!1;else L.render=!1;this.sortObjects&&b.__webglObjects.sort(y);H=b.__webglObjectsImmediate.length;for(t=0;t<H;t++)L=b.__webglObjectsImmediate[t],$=L.object,$.visible&&($.matrixAutoUpdate&&$.matrixWorld.flattenToArray($._objectMatrixArray),C($,c,!0),x(L));if(b.overrideMaterial){k(b.overrideMaterial.depthTest);J(b.overrideMaterial.blending);for(t=
+0;t<G;t++)if(L=b.__webglObjects[t],L.render)$=L.object,O=L.buffer,m($),f(c,I,qa,b.overrideMaterial,O,$);for(t=0;t<H;t++)L=b.__webglObjectsImmediate[t],$=L.object,$.visible&&(m($),fa=e(c,I,qa,b.overrideMaterial,$),$.render(function(e){h(e,fa,b.overrideMaterial.shading)}))}else{J(THREE.NormalBlending);for(t=G-1;t>=0;t--)if(L=b.__webglObjects[t],L.render){$=L.object;O=L.buffer;P=L.opaque;m($);for(L=0;L<P.count;L++)E=P.list[L],k(E.depthTest),n(E.depthWrite),p(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),
+f(c,I,qa,E,O,$)}for(t=0;t<H;t++)if(L=b.__webglObjectsImmediate[t],$=L.object,$.visible){P=L.opaque;m($);for(L=0;L<P.count;L++)E=P.list[L],k(E.depthTest),n(E.depthWrite),p(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),fa=e(c,I,qa,E,$),$.render(function(b){h(b,fa,E.shading)})}for(t=0;t<G;t++)if(L=b.__webglObjects[t],L.render){$=L.object;O=L.buffer;P=L.transparent;m($);for(L=0;L<P.count;L++)E=P.list[L],J(E.blending),k(E.depthTest),n(E.depthWrite),p(E.polygonOffset,E.polygonOffsetFactor,
+E.polygonOffsetUnits),f(c,I,qa,E,O,$)}for(t=0;t<H;t++)if(L=b.__webglObjectsImmediate[t],$=L.object,$.visible){P=L.transparent;m($);for(L=0;L<P.count;L++)E=P.list[L],J(E.blending),k(E.depthTest),n(E.depthWrite),p(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),fa=e(c,I,qa,E,$),$.render(function(b){h(b,fa,E.shading)})}}b.__webglSprites.length&&A(b,c);o&&o.minFilter!==THREE.NearestFilter&&o.minFilter!==THREE.LinearFilter&&D(o)};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,k=void 0,m=void 0;if(!e.__webglInit)if(e.__webglInit=!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),e instanceof THREE.Mesh)for(h in k=e.geometry,k.geometryGroups==void 0&&N(k),k.geometryGroups){m=k.geometryGroups[h];
 if(!m.__webglVertexBuffer){var n=m;n.__webglVertexBuffer=o.createBuffer();n.__webglNormalBuffer=o.createBuffer();n.__webglTangentBuffer=o.createBuffer();n.__webglColorBuffer=o.createBuffer();n.__webglUVBuffer=o.createBuffer();n.__webglUV2Buffer=o.createBuffer();n.__webglSkinVertexABuffer=o.createBuffer();n.__webglSkinVertexBBuffer=o.createBuffer();n.__webglSkinIndicesBuffer=o.createBuffer();n.__webglSkinWeightsBuffer=o.createBuffer();n.__webglFaceBuffer=o.createBuffer();n.__webglLineBuffer=o.createBuffer();
-if(n.numMorphTargets){var u=void 0,p=void 0;n.__webglMorphTargetsBuffers=[];u=0;for(p=n.numMorphTargets;u<p;u++)n.__webglMorphTargetsBuffers.push(o.createBuffer())}for(var n=m,u=e,t=void 0,w=void 0,v=void 0,x=v=void 0,L=void 0,y=void 0,ea=y=p=0,P=v=w=void 0,z=P=w=t=void 0,v=void 0,x=u.geometry,L=x.faces,P=n.faces,t=0,w=P.length;t<w;t++)v=P[t],v=L[v],v instanceof THREE.Face3?(p+=3,y+=1,ea+=3):v instanceof THREE.Face4&&(p+=4,y+=2,ea+=4);for(var t=n,w=u,A=P=L=void 0,C=void 0,A=void 0,v=[],L=0,P=w.materials.length;L<
-P;L++)if(A=w.materials[L],A instanceof THREE.MeshFaceMaterial){A=0;for(l=t.materials.length;A<l;A++)(C=t.materials[A])&&v.push(C)}else(C=A)&&v.push(C);t=v;n.__materials=t;a:{L=w=void 0;P=t.length;for(w=0;w<P;w++)if(L=t[w],L.map||L.lightMap||L instanceof THREE.MeshShaderMaterial){w=!0;break a}w=!1}a:{P=L=void 0;v=t.length;for(L=0;L<v;L++)if(P=t[L],!(P instanceof THREE.MeshBasicMaterial&&!P.envMap||P instanceof THREE.MeshDepthMaterial)){P=P&&P.shading!=void 0&&P.shading==THREE.SmoothShading?THREE.SmoothShading:
-THREE.FlatShading;break a}P=!1}a:{v=L=void 0;A=t.length;for(L=0;L<A;L++)if(v=t[L],v.vertexColors){v=v.vertexColors;break a}v=!1}n.__vertexArray=new Float32Array(p*3);if(P)n.__normalArray=new Float32Array(p*3);if(x.hasTangents)n.__tangentArray=new Float32Array(p*4);if(v)n.__colorArray=new Float32Array(p*3);if(w){if(x.faceUvs.length>0||x.faceVertexUvs.length>0)n.__uvArray=new Float32Array(p*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)n.__uv2Array=new Float32Array(p*2)}if(u.geometry.skinWeights.length&&
-u.geometry.skinIndices.length)n.__skinVertexAArray=new Float32Array(p*4),n.__skinVertexBArray=new Float32Array(p*4),n.__skinIndexArray=new Float32Array(p*4),n.__skinWeightArray=new Float32Array(p*4);n.__faceArray=new Uint16Array(y*3+(u.geometry.edgeFaces?u.geometry.edgeFaces.length*6:0));n.__lineArray=new Uint16Array(ea*2);if(n.numMorphTargets){n.__morphTargetsArrays=[];x=0;for(L=n.numMorphTargets;x<L;x++)n.__morphTargetsArrays.push(new Float32Array(p*3))}n.__needsSmoothNormals=P==THREE.SmoothShading;
-n.__uvType=w;n.__vertexColorType=v;n.__normalType=P;n.__webglFaceCount=y*3+(u.geometry.edgeFaces?u.geometry.edgeFaces.length*6:0);n.__webglLineCount=ea*2;x=0;for(L=t.length;x<L;x++)if(w=t[x],w.attributes){if(n.__webglCustomAttributes===void 0)n.__webglCustomAttributes={};for(a in w.attributes){v=w.attributes[a];P={};for(z in v)P[z]=v[z];if(!P.__webglInitialized||P.createUniqueBuffers)P.__webglInitialized=!0,y=1,P.type==="v2"?y=2:P.type==="v3"?y=3:P.type==="v4"?y=4:P.type==="c"&&(y=3),P.size=y,P.array=
-new Float32Array(p*y),P.buffer=o.createBuffer(),P.buffer.belongsToAttribute=a,v.needsUpdate=!0,P.__original=v;n.__webglCustomAttributes[a]=P}}n.__inittedArrays=!0;h.__dirtyVertices=!0;h.__dirtyMorphTargets=!0;h.__dirtyElements=!0;h.__dirtyUvs=!0;h.__dirtyNormals=!0;h.__dirtyTangents=!0;h.__dirtyColors=!0}S(f.__webglObjects,m,e)}else if(e instanceof THREE.Ribbon){h=e.geometry;if(!h.__webglVertexBuffer)k=h,k.__webglVertexBuffer=o.createBuffer(),k.__webglColorBuffer=o.createBuffer(),k=h,m=k.vertices.length,
-k.__vertexArray=new Float32Array(m*3),k.__colorArray=new Float32Array(m*3),k.__webglVertexCount=m,h.__dirtyVertices=!0,h.__dirtyColors=!0;S(f.__webglObjects,h,e)}else if(e instanceof THREE.Line){h=e.geometry;if(!h.__webglVertexBuffer)k=h,k.__webglVertexBuffer=o.createBuffer(),k.__webglColorBuffer=o.createBuffer(),k=h,m=k.vertices.length,k.__vertexArray=new Float32Array(m*3),k.__colorArray=new Float32Array(m*3),k.__webglLineCount=m,h.__dirtyVertices=!0,h.__dirtyColors=!0;S(f.__webglObjects,h,e)}else if(e instanceof
-THREE.ParticleSystem){h=e.geometry;if(!h.__webglVertexBuffer){k=h;k.__webglVertexBuffer=o.createBuffer();k.__webglColorBuffer=o.createBuffer();k=h;m=e;n=k.vertices.length;k.__vertexArray=new Float32Array(n*3);k.__colorArray=new Float32Array(n*3);k.__sortArray=[];k.__webglParticleCount=n;k.__materials=m.materials;z=p=u=void 0;u=0;for(p=m.materials.length;u<p;u++)if(z=m.materials[u],z.attributes){if(k.__webglCustomAttributes===void 0)k.__webglCustomAttributes={};for(a in z.attributes){originalAttribute=
+if(n.numMorphTargets){var t=void 0,p=void 0;n.__webglMorphTargetsBuffers=[];t=0;for(p=n.numMorphTargets;t<p;t++)n.__webglMorphTargetsBuffers.push(o.createBuffer())}for(var n=m,t=e,v=void 0,w=void 0,u=void 0,x=u=void 0,L=void 0,y=void 0,fa=y=p=0,P=u=w=void 0,z=P=w=v=void 0,u=void 0,x=t.geometry,L=x.faces,P=n.faces,v=0,w=P.length;v<w;v++)u=P[v],u=L[u],u instanceof THREE.Face3?(p+=3,y+=1,fa+=3):u instanceof THREE.Face4&&(p+=4,y+=2,fa+=4);for(var v=n,w=t,A=P=L=void 0,C=void 0,A=void 0,u=[],L=0,P=w.materials.length;L<
+P;L++)if(A=w.materials[L],A instanceof THREE.MeshFaceMaterial){A=0;for(l=v.materials.length;A<l;A++)(C=v.materials[A])&&u.push(C)}else(C=A)&&u.push(C);v=u;n.__materials=v;a:{L=w=void 0;P=v.length;for(w=0;w<P;w++)if(L=v[w],L.map||L.lightMap||L instanceof THREE.MeshShaderMaterial){w=!0;break a}w=!1}a:{P=L=void 0;u=v.length;for(L=0;L<u;L++)if(P=v[L],!(P instanceof THREE.MeshBasicMaterial&&!P.envMap||P instanceof THREE.MeshDepthMaterial)){P=P&&P.shading!=void 0&&P.shading==THREE.SmoothShading?THREE.SmoothShading:
+THREE.FlatShading;break a}P=!1}a:{u=L=void 0;A=v.length;for(L=0;L<A;L++)if(u=v[L],u.vertexColors){u=u.vertexColors;break a}u=!1}n.__vertexArray=new Float32Array(p*3);if(P)n.__normalArray=new Float32Array(p*3);if(x.hasTangents)n.__tangentArray=new Float32Array(p*4);if(u)n.__colorArray=new Float32Array(p*3);if(w){if(x.faceUvs.length>0||x.faceVertexUvs.length>0)n.__uvArray=new Float32Array(p*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)n.__uv2Array=new Float32Array(p*2)}if(t.geometry.skinWeights.length&&
+t.geometry.skinIndices.length)n.__skinVertexAArray=new Float32Array(p*4),n.__skinVertexBArray=new Float32Array(p*4),n.__skinIndexArray=new Float32Array(p*4),n.__skinWeightArray=new Float32Array(p*4);n.__faceArray=new Uint16Array(y*3+(t.geometry.edgeFaces?t.geometry.edgeFaces.length*6:0));n.__lineArray=new Uint16Array(fa*2);if(n.numMorphTargets){n.__morphTargetsArrays=[];x=0;for(L=n.numMorphTargets;x<L;x++)n.__morphTargetsArrays.push(new Float32Array(p*3))}n.__needsSmoothNormals=P==THREE.SmoothShading;
+n.__uvType=w;n.__vertexColorType=u;n.__normalType=P;n.__webglFaceCount=y*3+(t.geometry.edgeFaces?t.geometry.edgeFaces.length*6:0);n.__webglLineCount=fa*2;x=0;for(L=v.length;x<L;x++)if(w=v[x],w.attributes){if(n.__webglCustomAttributes===void 0)n.__webglCustomAttributes={};for(a in w.attributes){u=w.attributes[a];P={};for(z in u)P[z]=u[z];if(!P.__webglInitialized||P.createUniqueBuffers)P.__webglInitialized=!0,y=1,P.type==="v2"?y=2:P.type==="v3"?y=3:P.type==="v4"?y=4:P.type==="c"&&(y=3),P.size=y,P.array=
+new Float32Array(p*y),P.buffer=o.createBuffer(),P.buffer.belongsToAttribute=a,u.needsUpdate=!0,P.__original=u;n.__webglCustomAttributes[a]=P}}n.__inittedArrays=!0;k.__dirtyVertices=!0;k.__dirtyMorphTargets=!0;k.__dirtyElements=!0;k.__dirtyUvs=!0;k.__dirtyNormals=!0;k.__dirtyTangents=!0;k.__dirtyColors=!0}S(f.__webglObjects,m,e)}else if(e instanceof THREE.Ribbon){k=e.geometry;if(!k.__webglVertexBuffer)h=k,h.__webglVertexBuffer=o.createBuffer(),h.__webglColorBuffer=o.createBuffer(),h=k,m=h.vertices.length,
+h.__vertexArray=new Float32Array(m*3),h.__colorArray=new Float32Array(m*3),h.__webglVertexCount=m,k.__dirtyVertices=!0,k.__dirtyColors=!0;S(f.__webglObjects,k,e)}else if(e instanceof THREE.Line){k=e.geometry;if(!k.__webglVertexBuffer)h=k,h.__webglVertexBuffer=o.createBuffer(),h.__webglColorBuffer=o.createBuffer(),h=k,m=h.vertices.length,h.__vertexArray=new Float32Array(m*3),h.__colorArray=new Float32Array(m*3),h.__webglLineCount=m,k.__dirtyVertices=!0,k.__dirtyColors=!0;S(f.__webglObjects,k,e)}else if(e instanceof
+THREE.ParticleSystem){k=e.geometry;if(!k.__webglVertexBuffer){h=k;h.__webglVertexBuffer=o.createBuffer();h.__webglColorBuffer=o.createBuffer();h=k;m=e;n=h.vertices.length;h.__vertexArray=new Float32Array(n*3);h.__colorArray=new Float32Array(n*3);h.__sortArray=[];h.__webglParticleCount=n;h.__materials=m.materials;z=p=t=void 0;t=0;for(p=m.materials.length;t<p;t++)if(z=m.materials[t],z.attributes){if(h.__webglCustomAttributes===void 0)h.__webglCustomAttributes={};for(a in z.attributes){originalAttribute=
 z.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(n*size),attribute.buffer=o.createBuffer(),attribute.buffer.belongsToAttribute=a,originalAttribute.needsUpdate=!0,attribute.__original=
-originalAttribute;k.__webglCustomAttributes[a]=attribute}}h.__dirtyVertices=!0;h.__dirtyColors=!0}S(f.__webglObjects,h,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)H(e.__webglObjects,f);else if(f instanceof THREE.Sprite){e=e.__webglSprites;h=void 0;for(h=e.length-1;h>=0;h--)e[h]==f&&e.splice(h,1)}else f instanceof THREE.MarchingCubes&&H(e.__webglObjectsImmediate,f);b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e<f;e++)if(k=b.__webglObjects[e].object,p=m=h=void 0,k instanceof THREE.Mesh){h=k.geometry;n=0;for(u=h.geometryGroupsList.length;n<u;n++)if(m=h.geometryGroupsList[n],p=E(m),h.__dirtyVertices||h.__dirtyMorphTargets||
-h.__dirtyElements||h.__dirtyUvs||h.__dirtyNormals||h.__dirtyColors||h.__dirtyTangents||p)if(p=m,z=o.DYNAMIC_DRAW,y=!h.dynamic,p.__inittedArrays){var $=x=ea=void 0,N=void 0,I=$=void 0,qa=void 0,K=void 0,ca=void 0,ga=C=A=v=P=L=w=t=void 0,J=void 0,F=N=ca=N=K=qa=void 0,B=void 0,D=B=F=qa=void 0,X=void 0,ua=D=B=F=$=$=I=ca=N=D=B=F=X=D=B=F=X=D=B=F=void 0,M=0,Y=0,ta=0,fa=0,ya=0,T=0,oa=0,U=0,R=0,Q=0,W=0,D=F=0,D=void 0,V=p.__vertexArray,ma=p.__uvArray,ja=p.__uv2Array,na=p.__normalArray,Z=p.__tangentArray,xa=
-p.__colorArray,aa=p.__skinVertexAArray,ra=p.__skinVertexBArray,ia=p.__skinIndexArray,da=p.__skinWeightArray,pa=p.__morphTargetsArrays,ka=p.__webglCustomAttributes,B=void 0,sa=p.__faceArray,la=p.__lineArray,Fa=p.__needsSmoothNormals,w=p.__vertexColorType,t=p.__uvType,L=p.__normalType,wa=k.geometry,za=wa.__dirtyVertices,Ca=wa.__dirtyElements,Ba=wa.__dirtyUvs,Aa=wa.__dirtyNormals,Ea=wa.__dirtyTangents,ab=wa.__dirtyColors,bb=wa.__dirtyMorphTargets,Oa=wa.vertices,db=p.faces,gb=wa.faces,eb=wa.faceVertexUvs[0],
-fb=wa.faceVertexUvs[1],Pa=wa.skinVerticesA,Qa=wa.skinVerticesB,Ra=wa.skinIndices,Ha=wa.skinWeights,Ga=wa.morphTargets;if(ka)for(ua in ka)ka[ua].offset=0,ka[ua].offsetSrc=0;ea=0;for(x=db.length;ea<x;ea++)if($=db[ea],N=gb[$],eb&&(P=eb[$]),fb&&(v=fb[$]),$=N.vertexNormals,I=N.normal,qa=N.vertexColors,K=N.color,ca=N.vertexTangents,N instanceof THREE.Face3){if(za)A=Oa[N.a].position,C=Oa[N.b].position,ga=Oa[N.c].position,V[Y]=A.x,V[Y+1]=A.y,V[Y+2]=A.z,V[Y+3]=C.x,V[Y+4]=C.y,V[Y+5]=C.z,V[Y+6]=ga.x,V[Y+7]=
-ga.y,V[Y+8]=ga.z,Y+=9;if(ka)for(ua in ka)if(B=ka[ua],B.__original.needsUpdate)F=B.offset,D=B.offsetSrc,B.size===1?(B.boundTo===void 0||B.boundTo==="vertices"?(B.array[F]=B.value[N.a],B.array[F+1]=B.value[N.b],B.array[F+2]=B.value[N.c]):B.boundTo==="faces"?(D=B.value[D],B.array[F]=D,B.array[F+1]=D,B.array[F+2]=D,B.offsetSrc++):B.boundTo==="faceVertices"&&(B.array[F]=B.value[D],B.array[F+1]=B.value[D+1],B.array[F+2]=B.value[D+2],B.offsetSrc+=3),B.offset+=3):(B.boundTo===void 0||B.boundTo==="vertices"?
-(A=B.value[N.a],C=B.value[N.b],ga=B.value[N.c]):B.boundTo==="faces"?(ga=C=A=D=B.value[D],B.offsetSrc++):B.boundTo==="faceVertices"&&(A=B.value[D],C=B.value[D+1],ga=B.value[D+2],B.offsetSrc+=3),B.size===2?(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=C.x,B.array[F+3]=C.y,B.array[F+4]=ga.x,B.array[F+5]=ga.y,B.offset+=6):B.size===3?(B.type==="c"?(B.array[F]=A.r,B.array[F+1]=A.g,B.array[F+2]=A.b,B.array[F+3]=C.r,B.array[F+4]=C.g,B.array[F+5]=C.b,B.array[F+6]=ga.r,B.array[F+7]=ga.g,B.array[F+8]=ga.b):
-(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=A.z,B.array[F+3]=C.x,B.array[F+4]=C.y,B.array[F+5]=C.z,B.array[F+6]=ga.x,B.array[F+7]=ga.y,B.array[F+8]=ga.z),B.offset+=9):(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=A.z,B.array[F+3]=A.w,B.array[F+4]=C.x,B.array[F+5]=C.y,B.array[F+6]=C.z,B.array[F+7]=C.w,B.array[F+8]=ga.x,B.array[F+9]=ga.y,B.array[F+10]=ga.z,B.array[F+11]=ga.w,B.offset+=12));if(bb){F=0;for(B=Ga.length;F<B;F++)A=Ga[F].vertices[N.a].position,C=Ga[F].vertices[N.b].position,ga=Ga[F].vertices[N.c].position,
-D=pa[F],D[W]=A.x,D[W+1]=A.y,D[W+2]=A.z,D[W+3]=C.x,D[W+4]=C.y,D[W+5]=C.z,D[W+6]=ga.x,D[W+7]=ga.y,D[W+8]=ga.z;W+=9}if(Ha.length)F=Ha[N.a],B=Ha[N.b],D=Ha[N.c],da[Q]=F.x,da[Q+1]=F.y,da[Q+2]=F.z,da[Q+3]=F.w,da[Q+4]=B.x,da[Q+5]=B.y,da[Q+6]=B.z,da[Q+7]=B.w,da[Q+8]=D.x,da[Q+9]=D.y,da[Q+10]=D.z,da[Q+11]=D.w,F=Ra[N.a],B=Ra[N.b],D=Ra[N.c],ia[Q]=F.x,ia[Q+1]=F.y,ia[Q+2]=F.z,ia[Q+3]=F.w,ia[Q+4]=B.x,ia[Q+5]=B.y,ia[Q+6]=B.z,ia[Q+7]=B.w,ia[Q+8]=D.x,ia[Q+9]=D.y,ia[Q+10]=D.z,ia[Q+11]=D.w,F=Pa[N.a],B=Pa[N.b],D=Pa[N.c],
-aa[Q]=F.x,aa[Q+1]=F.y,aa[Q+2]=F.z,aa[Q+3]=1,aa[Q+4]=B.x,aa[Q+5]=B.y,aa[Q+6]=B.z,aa[Q+7]=1,aa[Q+8]=D.x,aa[Q+9]=D.y,aa[Q+10]=D.z,aa[Q+11]=1,F=Qa[N.a],B=Qa[N.b],D=Qa[N.c],ra[Q]=F.x,ra[Q+1]=F.y,ra[Q+2]=F.z,ra[Q+3]=1,ra[Q+4]=B.x,ra[Q+5]=B.y,ra[Q+6]=B.z,ra[Q+7]=1,ra[Q+8]=D.x,ra[Q+9]=D.y,ra[Q+10]=D.z,ra[Q+11]=1,Q+=12;if(ab&&w)qa.length==3&&w==THREE.VertexColors?(N=qa[0],F=qa[1],B=qa[2]):B=F=N=K,xa[R]=N.r,xa[R+1]=N.g,xa[R+2]=N.b,xa[R+3]=F.r,xa[R+4]=F.g,xa[R+5]=F.b,xa[R+6]=B.r,xa[R+7]=B.g,xa[R+8]=B.b,R+=9;
-if(Ea&&wa.hasTangents)qa=ca[0],K=ca[1],N=ca[2],Z[oa]=qa.x,Z[oa+1]=qa.y,Z[oa+2]=qa.z,Z[oa+3]=qa.w,Z[oa+4]=K.x,Z[oa+5]=K.y,Z[oa+6]=K.z,Z[oa+7]=K.w,Z[oa+8]=N.x,Z[oa+9]=N.y,Z[oa+10]=N.z,Z[oa+11]=N.w,oa+=12;if(Aa&&L)if($.length==3&&Fa)for(ca=0;ca<3;ca++)I=$[ca],na[T]=I.x,na[T+1]=I.y,na[T+2]=I.z,T+=3;else for(ca=0;ca<3;ca++)na[T]=I.x,na[T+1]=I.y,na[T+2]=I.z,T+=3;if(Ba&&P!==void 0&&t)for(ca=0;ca<3;ca++)$=P[ca],ma[ta]=$.u,ma[ta+1]=$.v,ta+=2;if(Ba&&v!==void 0&&t)for(ca=0;ca<3;ca++)$=v[ca],ja[fa]=$.u,ja[fa+
-1]=$.v,fa+=2;Ca&&(sa[ya]=M,sa[ya+1]=M+1,sa[ya+2]=M+2,ya+=3,la[U]=M,la[U+1]=M+1,la[U+2]=M,la[U+3]=M+2,la[U+4]=M+1,la[U+5]=M+2,U+=6,M+=3)}else if(N instanceof THREE.Face4){if(za)A=Oa[N.a].position,C=Oa[N.b].position,ga=Oa[N.c].position,J=Oa[N.d].position,V[Y]=A.x,V[Y+1]=A.y,V[Y+2]=A.z,V[Y+3]=C.x,V[Y+4]=C.y,V[Y+5]=C.z,V[Y+6]=ga.x,V[Y+7]=ga.y,V[Y+8]=ga.z,V[Y+9]=J.x,V[Y+10]=J.y,V[Y+11]=J.z,Y+=12;if(ka)for(ua in ka)if(B=ka[ua],B.__original.needsUpdate)F=B.offset,D=B.offsetSrc,B.size===1?(B.boundTo===void 0||
-B.boundTo==="vertices"?(B.array[F]=B.value[N.a],B.array[F+1]=B.value[N.b],B.array[F+2]=B.value[N.c],B.array[F+3]=B.value[N.d]):B.boundTo==="faces"?(D=B.value[D],B.array[F]=D,B.array[F+1]=D,B.array[F+2]=D,B.array[F+3]=D,B.offsetSrc++):B.boundTo==="faceVertices"&&(B.array[F]=B.value[D],B.array[F+1]=B.value[D+1],B.array[F+2]=B.value[D+2],B.array[F+3]=B.value[D+3],B.offsetSrc+=4),B.offset+=4):(B.boundTo===void 0||B.boundTo==="vertices"?(A=B.value[N.a],C=B.value[N.b],ga=B.value[N.c],J=B.value[N.d]):B.boundTo===
-"faces"?(J=ga=C=A=D=B.value[D],B.offsetSrc++):B.boundTo==="faceVertices"&&(A=B.value[D],C=B.value[D+1],ga=B.value[D+2],J=B.value[D+3],B.offsetSrc+=4),B.size===2?(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=C.x,B.array[F+3]=C.y,B.array[F+4]=ga.x,B.array[F+5]=ga.y,B.array[F+6]=J.x,B.array[F+7]=J.y,B.offset+=8):B.size===3?(B.type==="c"?(B.array[F]=A.r,B.array[F+1]=A.g,B.array[F+2]=A.b,B.array[F+3]=C.r,B.array[F+4]=C.g,B.array[F+5]=C.b,B.array[F+6]=ga.r,B.array[F+7]=ga.g,B.array[F+8]=ga.b,B.array[F+
-9]=J.r,B.array[F+10]=J.g,B.array[F+11]=J.b):(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=A.z,B.array[F+3]=C.x,B.array[F+4]=C.y,B.array[F+5]=C.z,B.array[F+6]=ga.x,B.array[F+7]=ga.y,B.array[F+8]=ga.z,B.array[F+9]=J.x,B.array[F+10]=J.y,B.array[F+11]=J.z),B.offset+=12):(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=A.z,B.array[F+3]=A.w,B.array[F+4]=C.x,B.array[F+5]=C.y,B.array[F+6]=C.z,B.array[F+7]=C.w,B.array[F+8]=ga.x,B.array[F+9]=ga.y,B.array[F+10]=ga.z,B.array[F+11]=ga.w,B.array[F+12]=J.x,B.array[F+
-13]=J.y,B.array[F+14]=J.z,B.array[F+15]=J.w,B.offset+=16));if(bb){F=0;for(B=Ga.length;F<B;F++)A=Ga[F].vertices[N.a].position,C=Ga[F].vertices[N.b].position,ga=Ga[F].vertices[N.c].position,J=Ga[F].vertices[N.d].position,D=pa[F],D[W]=A.x,D[W+1]=A.y,D[W+2]=A.z,D[W+3]=C.x,D[W+4]=C.y,D[W+5]=C.z,D[W+6]=ga.x,D[W+7]=ga.y,D[W+8]=ga.z,D[W+9]=J.x,D[W+10]=J.y,D[W+11]=J.z;W+=12}if(Ha.length)F=Ha[N.a],B=Ha[N.b],D=Ha[N.c],X=Ha[N.d],da[Q]=F.x,da[Q+1]=F.y,da[Q+2]=F.z,da[Q+3]=F.w,da[Q+4]=B.x,da[Q+5]=B.y,da[Q+6]=B.z,
-da[Q+7]=B.w,da[Q+8]=D.x,da[Q+9]=D.y,da[Q+10]=D.z,da[Q+11]=D.w,da[Q+12]=X.x,da[Q+13]=X.y,da[Q+14]=X.z,da[Q+15]=X.w,F=Ra[N.a],B=Ra[N.b],D=Ra[N.c],X=Ra[N.d],ia[Q]=F.x,ia[Q+1]=F.y,ia[Q+2]=F.z,ia[Q+3]=F.w,ia[Q+4]=B.x,ia[Q+5]=B.y,ia[Q+6]=B.z,ia[Q+7]=B.w,ia[Q+8]=D.x,ia[Q+9]=D.y,ia[Q+10]=D.z,ia[Q+11]=D.w,ia[Q+12]=X.x,ia[Q+13]=X.y,ia[Q+14]=X.z,ia[Q+15]=X.w,F=Pa[N.a],B=Pa[N.b],D=Pa[N.c],X=Pa[N.d],aa[Q]=F.x,aa[Q+1]=F.y,aa[Q+2]=F.z,aa[Q+3]=1,aa[Q+4]=B.x,aa[Q+5]=B.y,aa[Q+6]=B.z,aa[Q+7]=1,aa[Q+8]=D.x,aa[Q+9]=D.y,
-aa[Q+10]=D.z,aa[Q+11]=1,aa[Q+12]=X.x,aa[Q+13]=X.y,aa[Q+14]=X.z,aa[Q+15]=1,F=Qa[N.a],B=Qa[N.b],D=Qa[N.c],N=Qa[N.d],ra[Q]=F.x,ra[Q+1]=F.y,ra[Q+2]=F.z,ra[Q+3]=1,ra[Q+4]=B.x,ra[Q+5]=B.y,ra[Q+6]=B.z,ra[Q+7]=1,ra[Q+8]=D.x,ra[Q+9]=D.y,ra[Q+10]=D.z,ra[Q+11]=1,ra[Q+12]=N.x,ra[Q+13]=N.y,ra[Q+14]=N.z,ra[Q+15]=1,Q+=16;if(ab&&w)qa.length==4&&w==THREE.VertexColors?(N=qa[0],F=qa[1],B=qa[2],qa=qa[3]):qa=B=F=N=K,xa[R]=N.r,xa[R+1]=N.g,xa[R+2]=N.b,xa[R+3]=F.r,xa[R+4]=F.g,xa[R+5]=F.b,xa[R+6]=B.r,xa[R+7]=B.g,xa[R+8]=
-B.b,xa[R+9]=qa.r,xa[R+10]=qa.g,xa[R+11]=qa.b,R+=12;if(Ea&&wa.hasTangents)qa=ca[0],K=ca[1],N=ca[2],ca=ca[3],Z[oa]=qa.x,Z[oa+1]=qa.y,Z[oa+2]=qa.z,Z[oa+3]=qa.w,Z[oa+4]=K.x,Z[oa+5]=K.y,Z[oa+6]=K.z,Z[oa+7]=K.w,Z[oa+8]=N.x,Z[oa+9]=N.y,Z[oa+10]=N.z,Z[oa+11]=N.w,Z[oa+12]=ca.x,Z[oa+13]=ca.y,Z[oa+14]=ca.z,Z[oa+15]=ca.w,oa+=16;if(Aa&&L)if($.length==4&&Fa)for(ca=0;ca<4;ca++)I=$[ca],na[T]=I.x,na[T+1]=I.y,na[T+2]=I.z,T+=3;else for(ca=0;ca<4;ca++)na[T]=I.x,na[T+1]=I.y,na[T+2]=I.z,T+=3;if(Ba&&P!==void 0&&t)for(ca=
-0;ca<4;ca++)$=P[ca],ma[ta]=$.u,ma[ta+1]=$.v,ta+=2;if(Ba&&v!==void 0&&t)for(ca=0;ca<4;ca++)$=v[ca],ja[fa]=$.u,ja[fa+1]=$.v,fa+=2;Ca&&(sa[ya]=M,sa[ya+1]=M+1,sa[ya+2]=M+3,sa[ya+3]=M+1,sa[ya+4]=M+2,sa[ya+5]=M+3,ya+=6,la[U]=M,la[U+1]=M+1,la[U+2]=M,la[U+3]=M+3,la[U+4]=M+1,la[U+5]=M+2,la[U+6]=M+2,la[U+7]=M+3,U+=8,M+=4)}za&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,V,z));if(ka)for(ua in ka)B=ka[ua],B.__original.needsUpdate&&(o.bindBuffer(o.ARRAY_BUFFER,B.buffer),o.bufferData(o.ARRAY_BUFFER,
+originalAttribute;h.__webglCustomAttributes[a]=attribute}}k.__dirtyVertices=!0;k.__dirtyColors=!0}S(f.__webglObjects,k,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)H(e.__webglObjects,f);else if(f instanceof THREE.Sprite){e=e.__webglSprites;k=void 0;for(k=e.length-1;k>=0;k--)e[k]==f&&e.splice(k,1)}else f instanceof THREE.MarchingCubes&&H(e.__webglObjectsImmediate,f);b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e<f;e++)if(h=b.__webglObjects[e].object,p=m=k=void 0,h instanceof THREE.Mesh){k=h.geometry;n=0;for(t=k.geometryGroupsList.length;n<t;n++)if(m=k.geometryGroupsList[n],p=E(m),k.__dirtyVertices||k.__dirtyMorphTargets||
+k.__dirtyElements||k.__dirtyUvs||k.__dirtyNormals||k.__dirtyColors||k.__dirtyTangents||p)if(p=m,z=o.DYNAMIC_DRAW,y=!k.dynamic,p.__inittedArrays){var $=x=fa=void 0,O=void 0,I=$=void 0,qa=void 0,K=void 0,da=void 0,ha=C=A=u=P=L=w=v=void 0,J=void 0,F=O=da=O=K=qa=void 0,B=void 0,D=B=F=qa=void 0,X=void 0,ua=D=B=F=$=$=I=da=O=D=B=F=X=D=B=F=X=D=B=F=void 0,M=0,Y=0,ta=0,ga=0,ya=0,T=0,oa=0,U=0,R=0,Q=0,W=0,D=F=0,D=void 0,V=p.__vertexArray,ma=p.__uvArray,ja=p.__uv2Array,na=p.__normalArray,Z=p.__tangentArray,xa=
+p.__colorArray,aa=p.__skinVertexAArray,ra=p.__skinVertexBArray,ia=p.__skinIndexArray,ea=p.__skinWeightArray,pa=p.__morphTargetsArrays,ka=p.__webglCustomAttributes,B=void 0,sa=p.__faceArray,la=p.__lineArray,Fa=p.__needsSmoothNormals,w=p.__vertexColorType,v=p.__uvType,L=p.__normalType,wa=h.geometry,za=wa.__dirtyVertices,Ca=wa.__dirtyElements,Ba=wa.__dirtyUvs,Aa=wa.__dirtyNormals,Ea=wa.__dirtyTangents,ab=wa.__dirtyColors,bb=wa.__dirtyMorphTargets,Oa=wa.vertices,db=p.faces,gb=wa.faces,eb=wa.faceVertexUvs[0],
+fb=wa.faceVertexUvs[1],Pa=wa.skinVerticesA,Qa=wa.skinVerticesB,Ra=wa.skinIndices,Ha=wa.skinWeights,Ga=wa.morphTargets;if(ka)for(ua in ka)ka[ua].offset=0,ka[ua].offsetSrc=0;fa=0;for(x=db.length;fa<x;fa++)if($=db[fa],O=gb[$],eb&&(P=eb[$]),fb&&(u=fb[$]),$=O.vertexNormals,I=O.normal,qa=O.vertexColors,K=O.color,da=O.vertexTangents,O instanceof THREE.Face3){if(za)A=Oa[O.a].position,C=Oa[O.b].position,ha=Oa[O.c].position,V[Y]=A.x,V[Y+1]=A.y,V[Y+2]=A.z,V[Y+3]=C.x,V[Y+4]=C.y,V[Y+5]=C.z,V[Y+6]=ha.x,V[Y+7]=
+ha.y,V[Y+8]=ha.z,Y+=9;if(ka)for(ua in ka)if(B=ka[ua],B.__original.needsUpdate)F=B.offset,D=B.offsetSrc,B.size===1?(B.boundTo===void 0||B.boundTo==="vertices"?(B.array[F]=B.value[O.a],B.array[F+1]=B.value[O.b],B.array[F+2]=B.value[O.c]):B.boundTo==="faces"?(D=B.value[D],B.array[F]=D,B.array[F+1]=D,B.array[F+2]=D,B.offsetSrc++):B.boundTo==="faceVertices"&&(B.array[F]=B.value[D],B.array[F+1]=B.value[D+1],B.array[F+2]=B.value[D+2],B.offsetSrc+=3),B.offset+=3):(B.boundTo===void 0||B.boundTo==="vertices"?
+(A=B.value[O.a],C=B.value[O.b],ha=B.value[O.c]):B.boundTo==="faces"?(ha=C=A=D=B.value[D],B.offsetSrc++):B.boundTo==="faceVertices"&&(A=B.value[D],C=B.value[D+1],ha=B.value[D+2],B.offsetSrc+=3),B.size===2?(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=C.x,B.array[F+3]=C.y,B.array[F+4]=ha.x,B.array[F+5]=ha.y,B.offset+=6):B.size===3?(B.type==="c"?(B.array[F]=A.r,B.array[F+1]=A.g,B.array[F+2]=A.b,B.array[F+3]=C.r,B.array[F+4]=C.g,B.array[F+5]=C.b,B.array[F+6]=ha.r,B.array[F+7]=ha.g,B.array[F+8]=ha.b):
+(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=A.z,B.array[F+3]=C.x,B.array[F+4]=C.y,B.array[F+5]=C.z,B.array[F+6]=ha.x,B.array[F+7]=ha.y,B.array[F+8]=ha.z),B.offset+=9):(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=A.z,B.array[F+3]=A.w,B.array[F+4]=C.x,B.array[F+5]=C.y,B.array[F+6]=C.z,B.array[F+7]=C.w,B.array[F+8]=ha.x,B.array[F+9]=ha.y,B.array[F+10]=ha.z,B.array[F+11]=ha.w,B.offset+=12));if(bb){F=0;for(B=Ga.length;F<B;F++)A=Ga[F].vertices[O.a].position,C=Ga[F].vertices[O.b].position,ha=Ga[F].vertices[O.c].position,
+D=pa[F],D[W]=A.x,D[W+1]=A.y,D[W+2]=A.z,D[W+3]=C.x,D[W+4]=C.y,D[W+5]=C.z,D[W+6]=ha.x,D[W+7]=ha.y,D[W+8]=ha.z;W+=9}if(Ha.length)F=Ha[O.a],B=Ha[O.b],D=Ha[O.c],ea[Q]=F.x,ea[Q+1]=F.y,ea[Q+2]=F.z,ea[Q+3]=F.w,ea[Q+4]=B.x,ea[Q+5]=B.y,ea[Q+6]=B.z,ea[Q+7]=B.w,ea[Q+8]=D.x,ea[Q+9]=D.y,ea[Q+10]=D.z,ea[Q+11]=D.w,F=Ra[O.a],B=Ra[O.b],D=Ra[O.c],ia[Q]=F.x,ia[Q+1]=F.y,ia[Q+2]=F.z,ia[Q+3]=F.w,ia[Q+4]=B.x,ia[Q+5]=B.y,ia[Q+6]=B.z,ia[Q+7]=B.w,ia[Q+8]=D.x,ia[Q+9]=D.y,ia[Q+10]=D.z,ia[Q+11]=D.w,F=Pa[O.a],B=Pa[O.b],D=Pa[O.c],
+aa[Q]=F.x,aa[Q+1]=F.y,aa[Q+2]=F.z,aa[Q+3]=1,aa[Q+4]=B.x,aa[Q+5]=B.y,aa[Q+6]=B.z,aa[Q+7]=1,aa[Q+8]=D.x,aa[Q+9]=D.y,aa[Q+10]=D.z,aa[Q+11]=1,F=Qa[O.a],B=Qa[O.b],D=Qa[O.c],ra[Q]=F.x,ra[Q+1]=F.y,ra[Q+2]=F.z,ra[Q+3]=1,ra[Q+4]=B.x,ra[Q+5]=B.y,ra[Q+6]=B.z,ra[Q+7]=1,ra[Q+8]=D.x,ra[Q+9]=D.y,ra[Q+10]=D.z,ra[Q+11]=1,Q+=12;if(ab&&w)qa.length==3&&w==THREE.VertexColors?(O=qa[0],F=qa[1],B=qa[2]):B=F=O=K,xa[R]=O.r,xa[R+1]=O.g,xa[R+2]=O.b,xa[R+3]=F.r,xa[R+4]=F.g,xa[R+5]=F.b,xa[R+6]=B.r,xa[R+7]=B.g,xa[R+8]=B.b,R+=9;
+if(Ea&&wa.hasTangents)qa=da[0],K=da[1],O=da[2],Z[oa]=qa.x,Z[oa+1]=qa.y,Z[oa+2]=qa.z,Z[oa+3]=qa.w,Z[oa+4]=K.x,Z[oa+5]=K.y,Z[oa+6]=K.z,Z[oa+7]=K.w,Z[oa+8]=O.x,Z[oa+9]=O.y,Z[oa+10]=O.z,Z[oa+11]=O.w,oa+=12;if(Aa&&L)if($.length==3&&Fa)for(da=0;da<3;da++)I=$[da],na[T]=I.x,na[T+1]=I.y,na[T+2]=I.z,T+=3;else for(da=0;da<3;da++)na[T]=I.x,na[T+1]=I.y,na[T+2]=I.z,T+=3;if(Ba&&P!==void 0&&v)for(da=0;da<3;da++)$=P[da],ma[ta]=$.u,ma[ta+1]=$.v,ta+=2;if(Ba&&u!==void 0&&v)for(da=0;da<3;da++)$=u[da],ja[ga]=$.u,ja[ga+
+1]=$.v,ga+=2;Ca&&(sa[ya]=M,sa[ya+1]=M+1,sa[ya+2]=M+2,ya+=3,la[U]=M,la[U+1]=M+1,la[U+2]=M,la[U+3]=M+2,la[U+4]=M+1,la[U+5]=M+2,U+=6,M+=3)}else if(O instanceof THREE.Face4){if(za)A=Oa[O.a].position,C=Oa[O.b].position,ha=Oa[O.c].position,J=Oa[O.d].position,V[Y]=A.x,V[Y+1]=A.y,V[Y+2]=A.z,V[Y+3]=C.x,V[Y+4]=C.y,V[Y+5]=C.z,V[Y+6]=ha.x,V[Y+7]=ha.y,V[Y+8]=ha.z,V[Y+9]=J.x,V[Y+10]=J.y,V[Y+11]=J.z,Y+=12;if(ka)for(ua in ka)if(B=ka[ua],B.__original.needsUpdate)F=B.offset,D=B.offsetSrc,B.size===1?(B.boundTo===void 0||
+B.boundTo==="vertices"?(B.array[F]=B.value[O.a],B.array[F+1]=B.value[O.b],B.array[F+2]=B.value[O.c],B.array[F+3]=B.value[O.d]):B.boundTo==="faces"?(D=B.value[D],B.array[F]=D,B.array[F+1]=D,B.array[F+2]=D,B.array[F+3]=D,B.offsetSrc++):B.boundTo==="faceVertices"&&(B.array[F]=B.value[D],B.array[F+1]=B.value[D+1],B.array[F+2]=B.value[D+2],B.array[F+3]=B.value[D+3],B.offsetSrc+=4),B.offset+=4):(B.boundTo===void 0||B.boundTo==="vertices"?(A=B.value[O.a],C=B.value[O.b],ha=B.value[O.c],J=B.value[O.d]):B.boundTo===
+"faces"?(J=ha=C=A=D=B.value[D],B.offsetSrc++):B.boundTo==="faceVertices"&&(A=B.value[D],C=B.value[D+1],ha=B.value[D+2],J=B.value[D+3],B.offsetSrc+=4),B.size===2?(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=C.x,B.array[F+3]=C.y,B.array[F+4]=ha.x,B.array[F+5]=ha.y,B.array[F+6]=J.x,B.array[F+7]=J.y,B.offset+=8):B.size===3?(B.type==="c"?(B.array[F]=A.r,B.array[F+1]=A.g,B.array[F+2]=A.b,B.array[F+3]=C.r,B.array[F+4]=C.g,B.array[F+5]=C.b,B.array[F+6]=ha.r,B.array[F+7]=ha.g,B.array[F+8]=ha.b,B.array[F+
+9]=J.r,B.array[F+10]=J.g,B.array[F+11]=J.b):(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=A.z,B.array[F+3]=C.x,B.array[F+4]=C.y,B.array[F+5]=C.z,B.array[F+6]=ha.x,B.array[F+7]=ha.y,B.array[F+8]=ha.z,B.array[F+9]=J.x,B.array[F+10]=J.y,B.array[F+11]=J.z),B.offset+=12):(B.array[F]=A.x,B.array[F+1]=A.y,B.array[F+2]=A.z,B.array[F+3]=A.w,B.array[F+4]=C.x,B.array[F+5]=C.y,B.array[F+6]=C.z,B.array[F+7]=C.w,B.array[F+8]=ha.x,B.array[F+9]=ha.y,B.array[F+10]=ha.z,B.array[F+11]=ha.w,B.array[F+12]=J.x,B.array[F+
+13]=J.y,B.array[F+14]=J.z,B.array[F+15]=J.w,B.offset+=16));if(bb){F=0;for(B=Ga.length;F<B;F++)A=Ga[F].vertices[O.a].position,C=Ga[F].vertices[O.b].position,ha=Ga[F].vertices[O.c].position,J=Ga[F].vertices[O.d].position,D=pa[F],D[W]=A.x,D[W+1]=A.y,D[W+2]=A.z,D[W+3]=C.x,D[W+4]=C.y,D[W+5]=C.z,D[W+6]=ha.x,D[W+7]=ha.y,D[W+8]=ha.z,D[W+9]=J.x,D[W+10]=J.y,D[W+11]=J.z;W+=12}if(Ha.length)F=Ha[O.a],B=Ha[O.b],D=Ha[O.c],X=Ha[O.d],ea[Q]=F.x,ea[Q+1]=F.y,ea[Q+2]=F.z,ea[Q+3]=F.w,ea[Q+4]=B.x,ea[Q+5]=B.y,ea[Q+6]=B.z,
+ea[Q+7]=B.w,ea[Q+8]=D.x,ea[Q+9]=D.y,ea[Q+10]=D.z,ea[Q+11]=D.w,ea[Q+12]=X.x,ea[Q+13]=X.y,ea[Q+14]=X.z,ea[Q+15]=X.w,F=Ra[O.a],B=Ra[O.b],D=Ra[O.c],X=Ra[O.d],ia[Q]=F.x,ia[Q+1]=F.y,ia[Q+2]=F.z,ia[Q+3]=F.w,ia[Q+4]=B.x,ia[Q+5]=B.y,ia[Q+6]=B.z,ia[Q+7]=B.w,ia[Q+8]=D.x,ia[Q+9]=D.y,ia[Q+10]=D.z,ia[Q+11]=D.w,ia[Q+12]=X.x,ia[Q+13]=X.y,ia[Q+14]=X.z,ia[Q+15]=X.w,F=Pa[O.a],B=Pa[O.b],D=Pa[O.c],X=Pa[O.d],aa[Q]=F.x,aa[Q+1]=F.y,aa[Q+2]=F.z,aa[Q+3]=1,aa[Q+4]=B.x,aa[Q+5]=B.y,aa[Q+6]=B.z,aa[Q+7]=1,aa[Q+8]=D.x,aa[Q+9]=D.y,
+aa[Q+10]=D.z,aa[Q+11]=1,aa[Q+12]=X.x,aa[Q+13]=X.y,aa[Q+14]=X.z,aa[Q+15]=1,F=Qa[O.a],B=Qa[O.b],D=Qa[O.c],O=Qa[O.d],ra[Q]=F.x,ra[Q+1]=F.y,ra[Q+2]=F.z,ra[Q+3]=1,ra[Q+4]=B.x,ra[Q+5]=B.y,ra[Q+6]=B.z,ra[Q+7]=1,ra[Q+8]=D.x,ra[Q+9]=D.y,ra[Q+10]=D.z,ra[Q+11]=1,ra[Q+12]=O.x,ra[Q+13]=O.y,ra[Q+14]=O.z,ra[Q+15]=1,Q+=16;if(ab&&w)qa.length==4&&w==THREE.VertexColors?(O=qa[0],F=qa[1],B=qa[2],qa=qa[3]):qa=B=F=O=K,xa[R]=O.r,xa[R+1]=O.g,xa[R+2]=O.b,xa[R+3]=F.r,xa[R+4]=F.g,xa[R+5]=F.b,xa[R+6]=B.r,xa[R+7]=B.g,xa[R+8]=
+B.b,xa[R+9]=qa.r,xa[R+10]=qa.g,xa[R+11]=qa.b,R+=12;if(Ea&&wa.hasTangents)qa=da[0],K=da[1],O=da[2],da=da[3],Z[oa]=qa.x,Z[oa+1]=qa.y,Z[oa+2]=qa.z,Z[oa+3]=qa.w,Z[oa+4]=K.x,Z[oa+5]=K.y,Z[oa+6]=K.z,Z[oa+7]=K.w,Z[oa+8]=O.x,Z[oa+9]=O.y,Z[oa+10]=O.z,Z[oa+11]=O.w,Z[oa+12]=da.x,Z[oa+13]=da.y,Z[oa+14]=da.z,Z[oa+15]=da.w,oa+=16;if(Aa&&L)if($.length==4&&Fa)for(da=0;da<4;da++)I=$[da],na[T]=I.x,na[T+1]=I.y,na[T+2]=I.z,T+=3;else for(da=0;da<4;da++)na[T]=I.x,na[T+1]=I.y,na[T+2]=I.z,T+=3;if(Ba&&P!==void 0&&v)for(da=
+0;da<4;da++)$=P[da],ma[ta]=$.u,ma[ta+1]=$.v,ta+=2;if(Ba&&u!==void 0&&v)for(da=0;da<4;da++)$=u[da],ja[ga]=$.u,ja[ga+1]=$.v,ga+=2;Ca&&(sa[ya]=M,sa[ya+1]=M+1,sa[ya+2]=M+3,sa[ya+3]=M+1,sa[ya+4]=M+2,sa[ya+5]=M+3,ya+=6,la[U]=M,la[U+1]=M+1,la[U+2]=M,la[U+3]=M+3,la[U+4]=M+1,la[U+5]=M+2,la[U+6]=M+2,la[U+7]=M+3,U+=8,M+=4)}za&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,V,z));if(ka)for(ua in ka)B=ka[ua],B.__original.needsUpdate&&(o.bindBuffer(o.ARRAY_BUFFER,B.buffer),o.bufferData(o.ARRAY_BUFFER,
 B.array,z));if(bb){F=0;for(B=Ga.length;F<B;F++)o.bindBuffer(o.ARRAY_BUFFER,p.__webglMorphTargetsBuffers[F]),o.bufferData(o.ARRAY_BUFFER,pa[F],z)}ab&&R>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,xa,z));Aa&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglNormalBuffer),o.bufferData(o.ARRAY_BUFFER,na,z));Ea&&wa.hasTangents&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglTangentBuffer),o.bufferData(o.ARRAY_BUFFER,Z,z));Ba&&ta>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglUVBuffer),o.bufferData(o.ARRAY_BUFFER,
-ma,z));Ba&&fa>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglUV2Buffer),o.bufferData(o.ARRAY_BUFFER,ja,z));Ca&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,sa,z),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,la,z));Q>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinVertexABuffer),o.bufferData(o.ARRAY_BUFFER,aa,z),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinVertexBBuffer),o.bufferData(o.ARRAY_BUFFER,ra,z),o.bindBuffer(o.ARRAY_BUFFER,
-p.__webglSkinIndicesBuffer),o.bufferData(o.ARRAY_BUFFER,ia,z),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinWeightsBuffer),o.bufferData(o.ARRAY_BUFFER,da,z));y&&(delete p.__inittedArrays,delete p.__colorArray,delete p.__normalArray,delete p.__tangentArray,delete p.__uvArray,delete p.__uv2Array,delete p.__faceArray,delete p.__vertexArray,delete p.__lineArray,delete p.__skinVertexAArray,delete p.__skinVertexBArray,delete p.__skinIndexArray,delete p.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=
-!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;G(m)}else if(k instanceof THREE.Ribbon){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=ea=y=y=void 0;x=k.vertices;u=k.colors;t=x.length;p=u.length;w=k.__vertexArray;z=k.__colorArray;L=k.__dirtyColors;if(k.__dirtyVertices){for(y=0;y<t;y++)ea=x[y].position,n=y*3,w[n]=ea.x,w[n+1]=ea.y,w[n+2]=ea.z;o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,
-w,m)}if(L){for(y=0;y<p;y++)color=u[y],n=y*3,z[n]=color.r,z[n+1]=color.g,z[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,z,m)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(k instanceof THREE.Line){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=ea=y=y=void 0;x=k.vertices;u=k.colors;t=x.length;p=u.length;w=k.__vertexArray;z=k.__colorArray;L=k.__dirtyColors;if(k.__dirtyVertices){for(y=0;y<t;y++)ea=x[y].position,n=y*3,w[n]=ea.x,
-w[n+1]=ea.y,w[n+2]=ea.z;o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,w,m)}if(L){for(y=0;y<p;y++)color=u[y],n=y*3,z[n]=color.r,z[n+1]=color.g,z[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,z,m)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(k instanceof THREE.ParticleSystem)h=k.geometry,p=E(h),(h.__dirtyVertices||h.__dirtyColors||k.sortParticles||p)&&c(h,o.DYNAMIC_DRAW,k),h.__dirtyVertices=!1,h.__dirtyColors=!1,G(h)};
+ma,z));Ba&&ga>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglUV2Buffer),o.bufferData(o.ARRAY_BUFFER,ja,z));Ca&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,sa,z),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,la,z));Q>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinVertexABuffer),o.bufferData(o.ARRAY_BUFFER,aa,z),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinVertexBBuffer),o.bufferData(o.ARRAY_BUFFER,ra,z),o.bindBuffer(o.ARRAY_BUFFER,
+p.__webglSkinIndicesBuffer),o.bufferData(o.ARRAY_BUFFER,ia,z),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinWeightsBuffer),o.bufferData(o.ARRAY_BUFFER,ea,z));y&&(delete p.__inittedArrays,delete p.__colorArray,delete p.__normalArray,delete p.__tangentArray,delete p.__uvArray,delete p.__uv2Array,delete p.__faceArray,delete p.__vertexArray,delete p.__lineArray,delete p.__skinVertexAArray,delete p.__skinVertexBArray,delete p.__skinIndexArray,delete p.__skinWeightArray)}k.__dirtyVertices=!1;k.__dirtyMorphTargets=
+!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;G(m)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=o.DYNAMIC_DRAW;n=fa=y=y=void 0;x=h.vertices;t=h.colors;v=x.length;p=t.length;w=h.__vertexArray;z=h.__colorArray;L=h.__dirtyColors;if(h.__dirtyVertices){for(y=0;y<v;y++)fa=x[y].position,n=y*3,w[n]=fa.x,w[n+1]=fa.y,w[n+2]=fa.z;o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,
+w,m)}if(L){for(y=0;y<p;y++)color=t[y],n=y*3,z[n]=color.r,z[n+1]=color.g,z[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,h.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,z,m)}}k.__dirtyVertices=!1;k.__dirtyColors=!1}else if(h instanceof THREE.Line){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=o.DYNAMIC_DRAW;n=fa=y=y=void 0;x=h.vertices;t=h.colors;v=x.length;p=t.length;w=h.__vertexArray;z=h.__colorArray;L=h.__dirtyColors;if(h.__dirtyVertices){for(y=0;y<v;y++)fa=x[y].position,n=y*3,w[n]=fa.x,
+w[n+1]=fa.y,w[n+2]=fa.z;o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,w,m)}if(L){for(y=0;y<p;y++)color=t[y],n=y*3,z[n]=color.r,z[n+1]=color.g,z[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,h.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,z,m)}}k.__dirtyVertices=!1;k.__dirtyColors=!1}else if(h instanceof THREE.ParticleSystem)k=h.geometry,p=E(k),(k.__dirtyVertices||k.__dirtyColors||h.sortParticles||p)&&c(k,o.DYNAMIC_DRAW,h),k.__dirtyVertices=!1,k.__dirtyColors=!1,G(k)};
 this.setFaceCulling=function(b,e){b?(!e||e=="ccw"?o.frontFace(o.CCW):o.frontFace(o.CW),b=="back"?o.cullFace(o.BACK):b=="front"?o.cullFace(o.FRONT):o.cullFace(o.FRONT_AND_BACK),o.enable(o.CULL_FACE)):o.disable(o.CULL_FACE)};this.supportsVertexTextures=function(){return Fa}};
 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};
@@ -341,18 +341,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.ColorUtils={adjustHSV:function(b,c,e,f){var h=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,h);h.h=THREE.ColorUtils.clamp(h.h+c,0,1);h.s=THREE.ColorUtils.clamp(h.s+e,0,1);h.v=THREE.ColorUtils.clamp(h.v+f,0,1);b.setHSV(h.h,h.s,h.v)},rgbToHsv:function(b,c){var e=b.r,f=b.g,h=b.b,m=Math.max(Math.max(e,f),h),k=Math.min(Math.min(e,f),h);if(k==m)k=e=0;else{var n=m-k,k=n/m,e=e==m?(f-h)/n:f==m?2+(h-e)/n:4+(e-f)/n;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=k;c.v=m;return c},
 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,h=e?c.geometry:c,m=b.vertices,k=h.vertices,n=b.faces,t=h.faces,p=b.faceVertexUvs[0],h=h.faceVertexUvs[0];e&&c.matrixAutoUpdate&&c.updateMatrix();for(var v=0,u=k.length;v<u;v++){var x=new THREE.Vertex(k[v].position.clone());e&&c.matrix.multiplyVector3(x.position);m.push(x)}v=0;for(u=t.length;v<u;v++){var k=t[v],w,y,z=k.vertexNormals,x=k.vertexColors;k instanceof THREE.Face3?w=new THREE.Face3(k.a+f,k.b+f,k.c+
-f):k instanceof THREE.Face4&&(w=new THREE.Face4(k.a+f,k.b+f,k.c+f,k.d+f));w.normal.copy(k.normal);e=0;for(m=z.length;e<m;e++)y=z[e],w.vertexNormals.push(y.clone());w.color.copy(k.color);e=0;for(m=x.length;e<m;e++)y=x[e],w.vertexColors.push(y.clone());w.materials=k.materials.slice();w.centroid.copy(k.centroid);n.push(w)}v=0;for(u=h.length;v<u;v++){f=h[v];n=[];e=0;for(m=f.length;e<m;e++)n.push(new THREE.UV(f[e].u,f[e].v));p.push(n)}},clone:function(b){var c=new THREE.Geometry,e,f=b.vertices,h=b.faces,
-m=b.faceVertexUvs[0],b=0;for(e=f.length;b<e;b++){var k=new THREE.Vertex(f[b].position.clone());c.vertices.push(k)}b=0;for(e=h.length;b<e;b++){var n=h[b],t,p,v=n.vertexNormals,u=n.vertexColors;n instanceof THREE.Face3?t=new THREE.Face3(n.a,n.b,n.c):n instanceof THREE.Face4&&(t=new THREE.Face4(n.a,n.b,n.c,n.d));t.normal.copy(n.normal);f=0;for(k=v.length;f<k;f++)p=v[f],t.vertexNormals.push(p.clone());t.color.copy(n.color);f=0;for(k=u.length;f<k;f++)p=u[f],t.vertexColors.push(p.clone());t.materials=n.materials.slice();
-t.centroid.copy(n.centroid);c.faces.push(t)}b=0;for(e=m.length;b<e;b++){h=m[b];t=[];f=0;for(k=h.length;f<k;f++)t.push(new THREE.UV(h[f].u,h[f].v));c.faceVertexUvs[0].push(t)}return c},randomPointInTriangle:function(b,c,e){var f,h,m,k=new THREE.Vector3,n=THREE.GeometryUtils.__v1;f=THREE.GeometryUtils.random();h=THREE.GeometryUtils.random();f+h>1&&(f=1-f,h=1-h);m=1-f-h;k.copy(b);k.multiplyScalar(f);n.copy(c);n.multiplyScalar(h);k.addSelf(n);n.copy(e);n.multiplyScalar(m);k.addSelf(n);return k},randomPointInFace:function(b,
+THREE.GeometryUtils={merge:function(b,c){var e=c instanceof THREE.Mesh,f=b.vertices.length,h=e?c.geometry:c,m=b.vertices,k=h.vertices,n=b.faces,p=h.faces,v=b.faceVertexUvs[0],h=h.faceVertexUvs[0];e&&c.matrixAutoUpdate&&c.updateMatrix();for(var u=0,t=k.length;u<t;u++){var x=new THREE.Vertex(k[u].position.clone());e&&c.matrix.multiplyVector3(x.position);m.push(x)}u=0;for(t=p.length;u<t;u++){var k=p[u],w,y,z=k.vertexNormals,x=k.vertexColors;k instanceof THREE.Face3?w=new THREE.Face3(k.a+f,k.b+f,k.c+
+f):k instanceof THREE.Face4&&(w=new THREE.Face4(k.a+f,k.b+f,k.c+f,k.d+f));w.normal.copy(k.normal);e=0;for(m=z.length;e<m;e++)y=z[e],w.vertexNormals.push(y.clone());w.color.copy(k.color);e=0;for(m=x.length;e<m;e++)y=x[e],w.vertexColors.push(y.clone());w.materials=k.materials.slice();w.centroid.copy(k.centroid);n.push(w)}u=0;for(t=h.length;u<t;u++){f=h[u];n=[];e=0;for(m=f.length;e<m;e++)n.push(new THREE.UV(f[e].u,f[e].v));v.push(n)}},clone:function(b){var c=new THREE.Geometry,e,f=b.vertices,h=b.faces,
+m=b.faceVertexUvs[0],b=0;for(e=f.length;b<e;b++){var k=new THREE.Vertex(f[b].position.clone());c.vertices.push(k)}b=0;for(e=h.length;b<e;b++){var n=h[b],p,v,u=n.vertexNormals,t=n.vertexColors;n instanceof THREE.Face3?p=new THREE.Face3(n.a,n.b,n.c):n instanceof THREE.Face4&&(p=new THREE.Face4(n.a,n.b,n.c,n.d));p.normal.copy(n.normal);f=0;for(k=u.length;f<k;f++)v=u[f],p.vertexNormals.push(v.clone());p.color.copy(n.color);f=0;for(k=t.length;f<k;f++)v=t[f],p.vertexColors.push(v.clone());p.materials=n.materials.slice();
+p.centroid.copy(n.centroid);c.faces.push(p)}b=0;for(e=m.length;b<e;b++){h=m[b];p=[];f=0;for(k=h.length;f<k;f++)p.push(new THREE.UV(h[f].u,h[f].v));c.faceVertexUvs[0].push(p)}return c},randomPointInTriangle:function(b,c,e){var f,h,m,k=new THREE.Vector3,n=THREE.GeometryUtils.__v1;f=THREE.GeometryUtils.random();h=THREE.GeometryUtils.random();f+h>1&&(f=1-f,h=1-h);m=1-f-h;k.copy(b);k.multiplyScalar(f);n.copy(c);n.multiplyScalar(h);k.addSelf(n);n.copy(e);n.multiplyScalar(m);k.addSelf(n);return k},randomPointInFace:function(b,
 c,e){var f,h,m;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,h=c.vertices[b.b].position,m=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,h,m);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;h=c.vertices[b.b].position;m=c.vertices[b.c].position;var c=c.vertices[b.d].position,k;e?b._area1&&b._area2?(e=b._area1,k=b._area2):(e=THREE.GeometryUtils.triangleArea(f,h,c),k=THREE.GeometryUtils.triangleArea(h,m,c),b._area1=e,b._area2=k):(e=THREE.GeometryUtils.triangleArea(f,
-h,c),k=THREE.GeometryUtils.triangleArea(h,m,c));return THREE.GeometryUtils.random()*(e+k)<e?THREE.GeometryUtils.randomPointInTriangle(f,h,c):THREE.GeometryUtils.randomPointInTriangle(h,m,c)}},randomPointsInGeometry:function(b,c){function e(b){function e(c,f){if(f<c)return c;var k=c+Math.floor((f-c)/2);return p[k]>b?e(c,k-1):p[k]<b?e(k+1,f):k}return e(0,p.length-1)}var f,h,m=b.faces,k=b.vertices,n=m.length,t=0,p=[],v,u,x,w;for(h=0;h<n;h++){f=m[h];if(f instanceof THREE.Face3)v=k[f.a].position,u=k[f.b].position,
-x=k[f.c].position,f._area=THREE.GeometryUtils.triangleArea(v,u,x);else if(f instanceof THREE.Face4)v=k[f.a].position,u=k[f.b].position,x=k[f.c].position,w=k[f.d].position,f._area1=THREE.GeometryUtils.triangleArea(v,u,w),f._area2=THREE.GeometryUtils.triangleArea(u,x,w),f._area=f._area1+f._area2;t+=f._area;p[h]=t}f=[];k={};for(h=0;h<c;h++)n=THREE.GeometryUtils.random()*t,n=e(n),f[h]=THREE.GeometryUtils.randomPointInFace(m[n],b,!0),k[n]?k[n]+=1:k[n]=1;return f},triangleArea:function(b,c,e){var f,h=THREE.GeometryUtils.__v1;
+h,c),k=THREE.GeometryUtils.triangleArea(h,m,c));return THREE.GeometryUtils.random()*(e+k)<e?THREE.GeometryUtils.randomPointInTriangle(f,h,c):THREE.GeometryUtils.randomPointInTriangle(h,m,c)}},randomPointsInGeometry:function(b,c){function e(b){function e(c,f){if(f<c)return c;var h=c+Math.floor((f-c)/2);return v[h]>b?e(c,h-1):v[h]<b?e(h+1,f):h}return e(0,v.length-1)}var f,h,m=b.faces,k=b.vertices,n=m.length,p=0,v=[],u,t,x,w;for(h=0;h<n;h++){f=m[h];if(f instanceof THREE.Face3)u=k[f.a].position,t=k[f.b].position,
+x=k[f.c].position,f._area=THREE.GeometryUtils.triangleArea(u,t,x);else if(f instanceof THREE.Face4)u=k[f.a].position,t=k[f.b].position,x=k[f.c].position,w=k[f.d].position,f._area1=THREE.GeometryUtils.triangleArea(u,t,w),f._area2=THREE.GeometryUtils.triangleArea(t,x,w),f._area=f._area1+f._area2;p+=f._area;v[h]=p}f=[];k={};for(h=0;h<c;h++)n=THREE.GeometryUtils.random()*p,n=e(n),f[h]=THREE.GeometryUtils.randomPointInFace(m[n],b,!0),k[n]?k[n]+=1:k[n]=1;return f},triangleArea:function(b,c,e){var f,h=THREE.GeometryUtils.__v1;
 h.sub(b,c);f=h.length();h.sub(b,e);b=h.length();h.sub(c,e);e=h.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,h=new THREE.Texture(f,c);f.onload=function(){h.needsUpdate=!0;e&&e(this)};f.crossOrigin="";f.src=b;return h},loadTextureCube:function(b,c,e){var f,h=[],m=new THREE.Texture(h,c),c=h.loadCount=0;for(f=b.length;c<f;++c)h[c]=new Image,h[c].onload=function(){h.loadCount+=1;if(h.loadCount==6)m.needsUpdate=!0;e&&e(this)},h[c].crossOrigin="",h[c].src=b[c];return m},getNormalMap:function(b,c){var e=function(b){var e=Math.sqrt(b[0]*b[0]+b[1]*b[1]+
-b[2]*b[2]);return[b[0]/e,b[1]/e,b[2]/e]};c|=1;var f=b.width,h=b.height,m=document.createElement("canvas");m.width=f;m.height=h;var k=m.getContext("2d");k.drawImage(b,0,0);for(var n=k.getImageData(0,0,f,h).data,t=k.createImageData(f,h),p=t.data,v=0;v<f;v++)for(var u=1;u<h;u++){var x=u-1<0?h-1:u-1,w=(u+1)%h,y=v-1<0?f-1:v-1,z=(v+1)%f,A=[],C=[0,0,n[(u*f+v)*4]/255*c];A.push([-1,0,n[(u*f+y)*4]/255*c]);A.push([-1,-1,n[(x*f+y)*4]/255*c]);A.push([0,-1,n[(x*f+v)*4]/255*c]);A.push([1,-1,n[(x*f+z)*4]/255*c]);
-A.push([1,0,n[(u*f+z)*4]/255*c]);A.push([1,1,n[(w*f+z)*4]/255*c]);A.push([0,1,n[(w*f+v)*4]/255*c]);A.push([-1,1,n[(w*f+y)*4]/255*c]);x=[];y=A.length;for(w=0;w<y;w++){var z=A[w],E=A[(w+1)%y],z=[z[0]-C[0],z[1]-C[1],z[2]-C[2]],E=[E[0]-C[0],E[1]-C[1],E[2]-C[2]];x.push(e([z[1]*E[2]-z[2]*E[1],z[2]*E[0]-z[0]*E[2],z[0]*E[1]-z[1]*E[0]]))}A=[0,0,0];for(w=0;w<x.length;w++)A[0]+=x[w][0],A[1]+=x[w][1],A[2]+=x[w][2];A[0]/=x.length;A[1]/=x.length;A[2]/=x.length;C=(u*f+v)*4;p[C]=(A[0]+1)/2*255|0;p[C+1]=(A[1]+0.5)*
-255|0;p[C+2]=A[2]*255|0;p[C+3]=255}k.putImageData(t,0,0);return m}};THREE.SceneUtils={showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var e,f,h=b.children.length;for(f=0;f<h;f++)e=b.children[f],c(e),THREE.SceneUtils.traverseHierarchy(e,c)}};
+b[2]*b[2]);return[b[0]/e,b[1]/e,b[2]/e]};c|=1;var f=b.width,h=b.height,m=document.createElement("canvas");m.width=f;m.height=h;var k=m.getContext("2d");k.drawImage(b,0,0);for(var n=k.getImageData(0,0,f,h).data,p=k.createImageData(f,h),v=p.data,u=0;u<f;u++)for(var t=1;t<h;t++){var x=t-1<0?h-1:t-1,w=(t+1)%h,y=u-1<0?f-1:u-1,z=(u+1)%f,A=[],C=[0,0,n[(t*f+u)*4]/255*c];A.push([-1,0,n[(t*f+y)*4]/255*c]);A.push([-1,-1,n[(x*f+y)*4]/255*c]);A.push([0,-1,n[(x*f+u)*4]/255*c]);A.push([1,-1,n[(x*f+z)*4]/255*c]);
+A.push([1,0,n[(t*f+z)*4]/255*c]);A.push([1,1,n[(w*f+z)*4]/255*c]);A.push([0,1,n[(w*f+u)*4]/255*c]);A.push([-1,1,n[(w*f+y)*4]/255*c]);x=[];y=A.length;for(w=0;w<y;w++){var z=A[w],E=A[(w+1)%y],z=[z[0]-C[0],z[1]-C[1],z[2]-C[2]],E=[E[0]-C[0],E[1]-C[1],E[2]-C[2]];x.push(e([z[1]*E[2]-z[2]*E[1],z[2]*E[0]-z[0]*E[2],z[0]*E[1]-z[1]*E[0]]))}A=[0,0,0];for(w=0;w<x.length;w++)A[0]+=x[w][0],A[1]+=x[w][1],A[2]+=x[w][2];A[0]/=x.length;A[1]/=x.length;A[2]/=x.length;C=(t*f+u)*4;v[C]=(A[0]+1)/2*255|0;v[C+1]=(A[1]+0.5)*
+255|0;v[C+2]=A[2]*255|0;v[C+3]=255}k.putImageData(p,0,0);return m}};THREE.SceneUtils={showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var e,f,h=b.children.length;for(f=0;f<h;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}",
 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",
@@ -362,7 +362,7 @@ 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}"}}};
 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.getLengths=function(b){b||(b=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==b+1)return this.cacheArcLengths;var c=[],e,f=this.getPoint(0),h,m=0;c.push(0);for(h=1;h<=b;h++)e=this.getPoint(h/b),m+=e.distanceTo(f),c.push(m),f=e;return this.cacheArcLengths=c};
-THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,h=e.length,m;m=c?c:b*e[h-1];time=Date.now();for(var k=0,n=h-1,t;k<=n;)if(f=Math.floor(k+(n-k)/2),t=e[f]-m,t<0)k=f+1;else if(t>0)n=f-1;else{n=f;break}f=n;if(e[f]==m)return f/(h-1);k=e[f];return e=(f+(m-k)/(e[f+1]-k))/(h-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,h=e.length,m;m=c?c:b*e[h-1];time=Date.now();for(var k=0,n=h-1,p;k<=n;)if(f=Math.floor(k+(n-k)/2),p=e[f]-m,p<0)k=f+1;else if(p>0)n=f-1;else{n=f;break}f=n;if(e[f]==m)return f/(h-1);k=e[f];return e=(f+(m-k)/(e[f+1]-k))/(h-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.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;
@@ -377,47 +377,47 @@ 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.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.getBoundingBox=function(){var b=this.getPoints(),c,e,f,h;c=e=Number.NEGATIVE_INFINITY;f=h=Number.POSITIVE_INFINITY;var m,k,n,t;t=new THREE.Vector2;k=0;for(n=b.length;k<n;k++){m=b[k];if(m.x>c)c=m.x;else if(m.x<f)f=m.x;if(m.y>e)e=m.y;else if(m.y<e)h=m.y;t.addSelf(m.x,m.y)}return{minX:f,minY:h,maxX:c,maxY:e,centroid:t.divideScalar(n)}};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,h;c=e=Number.NEGATIVE_INFINITY;f=h=Number.POSITIVE_INFINITY;var m,k,n,p;p=new THREE.Vector2;k=0;for(n=b.length;k<n;k++){m=b[k];if(m.x>c)c=m.x;else if(m.x<f)f=m.x;if(m.y>e)e=m.y;else if(m.y<e)h=m.y;p.addSelf(m.x,m.y)}return{minX:f,minY:h,maxX:c,maxY:e,centroid:p.divideScalar(n)}};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.getTransformedPoints=function(b,c){var e=this.getPoints(b),f,h;if(!c)c=this.bends;f=0;for(h=c.length;f<h;f++)e=this.getWrapPoints(e,c[f]);return e};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(b,c){var e=this.getSpacedPoints(b),f,h;if(!c)c=this.bends;f=0;for(h=c.length;f<h;f++)e=this.getWrapPoints(e,c[f]);return e};
-THREE.CurvePath.prototype.getWrapPoints=function(b,c){var e=this.getBoundingBox(),f,h,m,k,n,t;f=0;for(h=b.length;f<h;f++)m=b[f],k=m.x,n=m.y,t=k/e.maxX,t=c.getUtoTmapping(t,k),k=c.getPoint(t),n=c.getNormalVector(t).multiplyScalar(n),m.x=k.x+n.x,m.y=k.y+n.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,h,m,k,n,p;f=0;for(h=b.length;f<h;f++)m=b[f],k=m.x,n=m.y,p=k/e.maxX,p=c.getUtoTmapping(p,k),k=c.getPoint(p),n=c.getNormalVector(p).multiplyScalar(n),m.x=k.x+n.x,m.y=k.y+n.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.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 h=Array.prototype.slice.call(arguments),m=this.actions[this.actions.length-1].args;this.curves.push(new THREE.QuadraticBezierCurve(new THREE.Vector2(m[m.length-2],m[m.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f)));this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:h})};
 THREE.Path.prototype.bezierCurveTo=function(b,c,e,f,h,m){var k=Array.prototype.slice.call(arguments),n=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(n[n.length-2],n[n.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f),new THREE.Vector2(h,m)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:k})};
 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,h,m){var k=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(b,c,e,f,h,m));this.actions.push({action:THREE.PathActions.ARC,args:k})};
 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,h,m,k,n,t,p,v,u,x,w,y,z;f=0;for(h=this.actions.length;f<h;f++)switch(m=this.actions[f],k=m.action,m=m.args,k){case THREE.PathActions.LINE_TO:e.push(new THREE.Vector2(m[0],m[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:n=m[2];t=m[3];u=m[0];x=m[1];e.length>0?(k=e[e.length-1],w=k.x,y=k.y):(k=this.actions[f-1].args,w=k[k.length-2],y=k[k.length-1]);for(k=1;k<=b;k++)z=k/b,m=THREE.Shape.Utils.b2(z,w,u,n),z=THREE.Shape.Utils.b2(z,y,x,
-t),e.push(new THREE.Vector2(m,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=m[4];t=m[5];u=m[0];x=m[1];p=m[2];v=m[3];e.length>0?(k=e[e.length-1],w=k.x,y=k.y):(k=this.actions[f-1].args,w=k[k.length-2],y=k[k.length-1]);for(k=1;k<=b;k++)z=k/b,m=THREE.Shape.Utils.b3(z,w,u,p,n),z=THREE.Shape.Utils.b3(z,y,x,v,t),e.push(new THREE.Vector2(m,z));break;case THREE.PathActions.CSPLINE_THRU:k=this.actions[f-1].args;k=[new THREE.Vector2(k[k.length-2],k[k.length-1])];z=b*m[0].length;k=k.concat(m[0]);m=new THREE.SplineCurve(k);
-for(k=1;k<=z;k++)e.push(m.getPointAt(k/z));break;case THREE.PathActions.ARC:k=this.actions[f-1].args;n=m[0];t=m[1];p=m[2];u=m[3];z=m[4];x=!!m[5];v=k[k.length-2];w=k[k.length-1];k.length==0&&(v=w=0);y=z-u;var A=b*2;for(k=1;k<=A;k++)z=k/A,x||(z=1-z),z=u+z*y,m=v+n+p*Math.cos(z),z=w+t+p*Math.sin(z),e.push(new THREE.Vector2(m,z))}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,h,m){var k=this.getPoints(),n,t,p,v,u;n=0;for(t=k.length;n<t;n++)p=k[n],v=p.x,u=p.y,p.x=b*v+c*u+e,p.y=f*u+h*v+m;return k};
+THREE.Path.prototype.getPoints=function(b,c){var b=b||12,e=[],f,h,m,k,n,p,v,u,t,x,w,y,z;f=0;for(h=this.actions.length;f<h;f++)switch(m=this.actions[f],k=m.action,m=m.args,k){case THREE.PathActions.LINE_TO:e.push(new THREE.Vector2(m[0],m[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:n=m[2];p=m[3];t=m[0];x=m[1];e.length>0?(k=e[e.length-1],w=k.x,y=k.y):(k=this.actions[f-1].args,w=k[k.length-2],y=k[k.length-1]);for(k=1;k<=b;k++)z=k/b,m=THREE.Shape.Utils.b2(z,w,t,n),z=THREE.Shape.Utils.b2(z,y,x,
+p),e.push(new THREE.Vector2(m,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=m[4];p=m[5];t=m[0];x=m[1];v=m[2];u=m[3];e.length>0?(k=e[e.length-1],w=k.x,y=k.y):(k=this.actions[f-1].args,w=k[k.length-2],y=k[k.length-1]);for(k=1;k<=b;k++)z=k/b,m=THREE.Shape.Utils.b3(z,w,t,v,n),z=THREE.Shape.Utils.b3(z,y,x,u,p),e.push(new THREE.Vector2(m,z));break;case THREE.PathActions.CSPLINE_THRU:k=this.actions[f-1].args;k=[new THREE.Vector2(k[k.length-2],k[k.length-1])];z=b*m[0].length;k=k.concat(m[0]);m=new THREE.SplineCurve(k);
+for(k=1;k<=z;k++)e.push(m.getPointAt(k/z));break;case THREE.PathActions.ARC:k=this.actions[f-1].args;n=m[0];p=m[1];v=m[2];t=m[3];z=m[4];x=!!m[5];u=k[k.length-2];w=k[k.length-1];k.length==0&&(u=w=0);y=z-t;var A=b*2;for(k=1;k<=A;k++)z=k/A,x||(z=1-z),z=t+z*y,m=u+n+v*Math.cos(z),z=w+p+v*Math.sin(z),e.push(new THREE.Vector2(m,z))}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,h,m){var k=this.getPoints(),n,p,v,u,t;n=0;for(p=k.length;n<p;n++)v=k[n],u=v.x,t=v.y,v.x=b*u+c*t+e,v.y=f*t+h*u+m;return k};
 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,h,b=0;for(e=this.actions.length;b<e;b++)f=this.actions[b],h=f.args,f=f.action,f!=THREE.PathActions.CSPLINE_THRU&&c[f].apply(c,h);c.stroke();c.closePath();c.strokeStyle="red";f=
 this.getPoints();b=0;for(e=f.length;b<e;b++)h=f[b],c.beginPath(),c.arc(h.x,h.y,1.5,0,Math.PI*2,!1),c.stroke(),c.closePath()};
 THREE.Path.prototype.toShapes=function(){var b,c,e,f,h=[],m=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&&m.actions.length!=0&&(h.push(m),m=new THREE.Path),m[e].apply(m,f);m.actions.length!=0&&h.push(m);if(h.length==0)return[];var k,m=[];if(THREE.Shape.Utils.isClockWise(h[0].getPoints())){b=0;for(c=h.length;b<c;b++)f=h[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(k&&m.push(k),k=new THREE.Shape,k.actions=f.actions,k.curves=
 f.curves):k.holes.push(f);m.push(k)}else{k=new THREE.Shape;b=0;for(c=h.length;b<c;b++)f=h[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(k.actions=f.actions,k.curves=f.curves,m.push(k),k=new THREE.Shape):k.holes.push(f)}return m};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.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(),h,m,k,n,t,p,v,u,x,w,y=[];for(t=0;t<c.length;t++){p=c[t];f=f.concat(p);m=Number.POSITIVE_INFINITY;for(h=0;h<p.length;h++){x=p[h];w=[];for(u=0;u<e.length;u++)v=e[u],v=x.distanceToSquared(v),w.push(v),v<m&&(m=v,k=h,n=u)}h=n-1>=0?n-1:e.length-1;m=k-1>=0?k-1:p.length-1;var z=[p[k],e[n],e[h]];u=THREE.FontUtils.Triangulate.area(z);var A=[p[k],p[m],e[n]];x=THREE.FontUtils.Triangulate.area(A);w=n;v=k;n+=1;k+=-1;n<0&&(n+=e.length);n%=
-e.length;k<0&&(k+=p.length);k%=p.length;h=n-1>=0?n-1:e.length-1;m=k-1>=0?k-1:p.length-1;z=[p[k],e[n],e[h]];z=THREE.FontUtils.Triangulate.area(z);A=[p[k],p[m],e[n]];A=THREE.FontUtils.Triangulate.area(A);u+x>z+A&&(n=w,k=v,n<0&&(n+=e.length),n%=e.length,k<0&&(k+=p.length),k%=p.length,h=n-1>=0?n-1:e.length-1,m=k-1>=0?k-1:p.length-1);u=e.slice(0,n);x=e.slice(n);w=p.slice(k);v=p.slice(0,k);m=[p[k],p[m],e[n]];y.push([p[k],e[n],e[h]]);y.push(m);e=u.concat(w).concat(v).concat(x)}return{shape:e,isolatedPts:y,
-allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),m,k,n,t,p={};m=0;for(k=f.length;m<k;m++)t=f[m].x+":"+f[m].y,p[t]!==void 0&&console.log("Duplicate point",t),p[t]=m;m=0;for(k=e.length;m<k;m++){n=e[m];for(f=0;f<3;f++)t=n[f].x+":"+n[f].y,t=p[t],t!==void 0&&(n[f]=t)}m=0;for(k=h.length;m<k;m++){n=h[m];for(f=0;f<3;f++)t=n[f].x+":"+n[f].y,t=p[t],t!==void 0&&(n[f]=t)}return e.concat(h)},isClockWise:function(b){return THREE.FontUtils.Triangulate.area(b)<
+THREE.Shape.Utils={removeHoles:function(b,c){var e=b.concat(),f=e.concat(),h,m,k,n,p,v,u,t,x,w,y=[];for(p=0;p<c.length;p++){v=c[p];f=f.concat(v);m=Number.POSITIVE_INFINITY;for(h=0;h<v.length;h++){x=v[h];w=[];for(t=0;t<e.length;t++)u=e[t],u=x.distanceToSquared(u),w.push(u),u<m&&(m=u,k=h,n=t)}h=n-1>=0?n-1:e.length-1;m=k-1>=0?k-1:v.length-1;var z=[v[k],e[n],e[h]];t=THREE.FontUtils.Triangulate.area(z);var A=[v[k],v[m],e[n]];x=THREE.FontUtils.Triangulate.area(A);w=n;u=k;n+=1;k+=-1;n<0&&(n+=e.length);n%=
+e.length;k<0&&(k+=v.length);k%=v.length;h=n-1>=0?n-1:e.length-1;m=k-1>=0?k-1:v.length-1;z=[v[k],e[n],e[h]];z=THREE.FontUtils.Triangulate.area(z);A=[v[k],v[m],e[n]];A=THREE.FontUtils.Triangulate.area(A);t+x>z+A&&(n=w,k=u,n<0&&(n+=e.length),n%=e.length,k<0&&(k+=v.length),k%=v.length,h=n-1>=0?n-1:e.length-1,m=k-1>=0?k-1:v.length-1);t=e.slice(0,n);x=e.slice(n);w=v.slice(k);u=v.slice(0,k);m=[v[k],v[m],e[n]];y.push([v[k],e[n],e[h]]);y.push(m);e=t.concat(w).concat(u).concat(x)}return{shape:e,isolatedPts:y,
+allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),m,k,n,p,v={};m=0;for(k=f.length;m<k;m++)p=f[m].x+":"+f[m].y,v[p]!==void 0&&console.log("Duplicate point",p),v[p]=m;m=0;for(k=e.length;m<k;m++){n=e[m];for(f=0;f<3;f++)p=n[f].x+":"+n[f].y,p=v[p],p!==void 0&&(n[f]=p)}m=0;for(k=h.length;m<k;m++){n=h[m];for(f=0;f<3;f++)p=n[f].x+":"+n[f].y,p=v[p],p!==void 0&&(n[f]=p)}return e.concat(h)},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,h){return this.b3p0(b,c)+this.b3p1(b,e)+this.b3p2(b,f)+this.b3p3(b,h)}};
 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",h=c.weight!==void 0?c.weight:"normal",m=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=h;THREE.FontUtils.style=m};
 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.AnimationHandler=function(){var b=[],c={},e={update:function(e){for(var c=0;c<b.length;c++)b[c].update(e)},addToUpdate:function(e){b.indexOf(e)===-1&&b.push(e)},removeFromUpdate:function(e){e=b.indexOf(e);e!==-1&&b.splice(e,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 n=b.hierarchy[e].keys[f].rot;b.hierarchy[e].keys[f].rot=new THREE.Quaternion(n[0],n[1],n[2],n[3])}}if(b.hierarchy[e].keys[0].morphTargets!==void 0){n={};for(f=0;f<b.hierarchy[e].keys.length;f++)for(var t=0;t<b.hierarchy[e].keys[f].morphTargets.length;t++){var p=b.hierarchy[e].keys[f].morphTargets[t];n[p]=-1}b.hierarchy[e].usedMorphTargets=n;for(f=0;f<b.hierarchy[e].keys.length;f++){var v=
-{};for(p in n){for(t=0;t<b.hierarchy[e].keys[f].morphTargets.length;t++)if(b.hierarchy[e].keys[f].morphTargets[t]===p){v[p]=b.hierarchy[e].keys[f].morphTargetsInfluences[t];break}t===b.hierarchy[e].keys[f].morphTargets.length&&(v[p]=0)}b.hierarchy[e].keys[f].morphTargetsInfluences=v}}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 n=b.hierarchy[e].keys[f].rot;b.hierarchy[e].keys[f].rot=new THREE.Quaternion(n[0],n[1],n[2],n[3])}}if(b.hierarchy[e].keys[0].morphTargets!==void 0){n={};for(f=0;f<b.hierarchy[e].keys.length;f++)for(var p=0;p<b.hierarchy[e].keys[f].morphTargets.length;p++){var v=b.hierarchy[e].keys[f].morphTargets[p];n[v]=-1}b.hierarchy[e].usedMorphTargets=n;for(f=0;f<b.hierarchy[e].keys.length;f++){var u=
+{};for(v in n){for(p=0;p<b.hierarchy[e].keys[f].morphTargets.length;p++)if(b.hierarchy[e].keys[f].morphTargets[p]===v){u[v]=b.hierarchy[e].keys[f].morphTargetsInfluences[p];break}p===b.hierarchy[e].keys[f].morphTargets.length&&(u[v]=0)}b.hierarchy[e].keys[f].morphTargetsInfluences=u}}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=
 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,h;for(e=0;e<f;e++){h=this.hierarchy[e];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)h.useQuaternion=!0;h.matrixAutoUpdate=!0;if(h.animationCache===void 0)h.animationCache={},h.animationCache.prevKey={pos:0,rot:0,scl:0},h.animationCache.nextKey={pos:0,rot:0,scl:0},h.animationCache.originalMatrix=h instanceof
 THREE.Bone?h.skinMatrix:h.matrix;var m=h.animationCache.prevKey;h=h.animationCache.nextKey;m.pos=this.data.hierarchy[e].keys[0];m.rot=this.data.hierarchy[e].keys[0];m.scl=this.data.hierarchy[e].keys[0];h.pos=this.getNextKeyWith("pos",e,1);h.rot=this.getNextKeyWith("rot",e,1);h.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.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,h,m,k,n,t,p,v=this.data.JIT.hierarchy,u,x;this.currentTime+=b*this.timeScale;x=this.currentTime;u=this.currentTime%=this.data.length;p=parseInt(Math.min(u*this.data.fps,this.data.length*this.data.fps),10);for(var w=0,y=this.hierarchy.length;w<y;w++)if(b=this.hierarchy[w],t=b.animationCache,this.JITCompile&&v[w][p]!==void 0)b instanceof THREE.Bone?(b.skinMatrix=v[w][p],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=
-!1):(b.matrix=v[w][p],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 z=0;z<3;z++){e=c[z];k=t.prevKey[e];n=t.nextKey[e];if(n.time<=x){if(u<x)if(this.loop){k=this.data.hierarchy[w].keys[0];for(n=this.getNextKeyWith(e,w,1);n.time<u;)k=n,n=this.getNextKeyWith(e,w,n.index+1)}else{this.stop();return}else{do k=n,n=this.getNextKeyWith(e,w,n.index+1);while(n.time<
-u)}t.prevKey[e]=k;t.nextKey[e]=n}b.matrixAutoUpdate=!0;b.matrixWorldNeedsUpdate=!0;f=(u-k.time)/(n.time-k.time);h=k[e];m=n[e];if(f<0||f>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+w),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(m[0]-h[0])*f,e.y=h[1]+(m[1]-h[1])*f,e.z=h[2]+(m[2]-h[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,h,m,k,n,p,v,u=this.data.JIT.hierarchy,t,x;this.currentTime+=b*this.timeScale;x=this.currentTime;t=this.currentTime%=this.data.length;v=parseInt(Math.min(t*this.data.fps,this.data.length*this.data.fps),10);for(var w=0,y=this.hierarchy.length;w<y;w++)if(b=this.hierarchy[w],p=b.animationCache,this.JITCompile&&u[w][v]!==void 0)b instanceof THREE.Bone?(b.skinMatrix=u[w][v],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=
+!1):(b.matrix=u[w][v],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 z=0;z<3;z++){e=c[z];k=p.prevKey[e];n=p.nextKey[e];if(n.time<=x){if(t<x)if(this.loop){k=this.data.hierarchy[w].keys[0];for(n=this.getNextKeyWith(e,w,1);n.time<t;)k=n,n=this.getNextKeyWith(e,w,n.index+1)}else{this.stop();return}else{do k=n,n=this.getNextKeyWith(e,w,n.index+1);while(n.time<
+t)}p.prevKey[e]=k;p.nextKey[e]=n}b.matrixAutoUpdate=!0;b.matrixWorldNeedsUpdate=!0;f=(t-k.time)/(n.time-k.time);h=k[e];m=n[e];if(f<0||f>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+w),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(m[0]-h[0])*f,e.y=h[1]+(m[1]-h[1])*f,e.z=h[2]+(m[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
 this.getPrevKeyWith("pos",w,k.index-1).pos,this.points[1]=h,this.points[2]=m,this.points[3]=this.getNextKeyWith("pos",w,n.index+1).pos,f=f*0.33+0.33,h=this.interpolateCatmullRom(this.points,f),e.x=h[0],e.y=h[1],e.z=h[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(h,m,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(m[0]-h[0])*f,e.y=h[1]+(m[1]-h[1])*f,e.z=h[2]+(m[2]-h[2])*f}}if(this.JITCompile&&v[0][p]===void 0){this.hierarchy[0].update(void 0,!0);for(w=0;w<this.hierarchy.length;w++)v[w][p]=this.hierarchy[w]instanceof THREE.Bone?this.hierarchy[w].skinMatrix.clone():this.hierarchy[w].matrix.clone()}}};
-THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var e=[],f=[],h,m,k,n,t,p;h=(b.length-1)*c;m=Math.floor(h);h-=m;e[0]=m==0?m:m-1;e[1]=m;e[2]=m>b.length-2?m:m+1;e[3]=m>b.length-3?m:m+2;m=b[e[0]];n=b[e[1]];t=b[e[2]];p=b[e[3]];e=h*h;k=h*e;f[0]=this.interpolate(m[0],n[0],t[0],p[0],h,e,k);f[1]=this.interpolate(m[1],n[1],t[1],p[1],h,e,k);f[2]=this.interpolate(m[2],n[2],t[2],p[2],h,e,k);return f};
+"rot")THREE.Quaternion.slerp(h,m,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(m[0]-h[0])*f,e.y=h[1]+(m[1]-h[1])*f,e.z=h[2]+(m[2]-h[2])*f}}if(this.JITCompile&&u[0][v]===void 0){this.hierarchy[0].update(void 0,!0);for(w=0;w<this.hierarchy.length;w++)u[w][v]=this.hierarchy[w]instanceof THREE.Bone?this.hierarchy[w].skinMatrix.clone():this.hierarchy[w].matrix.clone()}}};
+THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var e=[],f=[],h,m,k,n,p,v;h=(b.length-1)*c;m=Math.floor(h);h-=m;e[0]=m==0?m:m-1;e[1]=m;e[2]=m>b.length-2?m:m+1;e[3]=m>b.length-3?m:m+2;m=b[e[0]];n=b[e[1]];p=b[e[2]];v=b[e[3]];e=h*h;k=h*e;f[0]=this.interpolate(m[0],n[0],p[0],v[0],h,e,k);f[1]=this.interpolate(m[1],n[1],p[1],v[1],h,e,k);f[2]=this.interpolate(m[2],n[2],p[2],v[2],h,e,k);return f};
 THREE.Animation.prototype.interpolate=function(b,c,e,f,h,m,k){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*k+(-3*(c-e)-2*b-f)*m+b*h+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.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=
@@ -430,14 +430,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;h=this.position;b.x=h.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=h.y+100*Math.cos(this.phi);b.z=h.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)};
 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,e,c,f){var k={name:c,fps:0.6,length:f,hierarchy:[]},h,m=e.getControlPointsArray(),n=e.getLength(),t=m.length,E=0;h=t-1;e={parent:-1,keys:[]};e.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};e.keys[h]={time:f,pos:m[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h<t-1;h++)E=f*n.chunks[h]/n.total,e.keys[h]={time:E,pos:m[h]};k.hierarchy[0]=e;THREE.AnimationHandler.add(k);return new THREE.Animation(b,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function e(b,e){var c,
-f,k=new THREE.Geometry;for(c=0;c<b.points.length*e;c++)f=c/(b.points.length*e),f=b.getPoint(f),k.vertices[c]=new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z));return k}function f(b,c){var f=e(c,10),k=e(c,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(f,h);particleObj=new THREE.ParticleSystem(k,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);k=new THREE.SphereGeometry(1,
-16,8);h=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)f=new THREE.Mesh(k,h),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=
+THREE.PathCamera=function(b){function c(b,e,c,f){var h={name:c,fps:0.6,length:f,hierarchy:[]},k,m=e.getControlPointsArray(),n=e.getLength(),p=m.length,E=0;k=p-1;e={parent:-1,keys:[]};e.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};e.keys[k]={time:f,pos:m[k],rot:[0,0,0,1],scl:[1,1,1]};for(k=1;k<p-1;k++)E=f*n.chunks[k]/n.total,e.keys[k]={time:E,pos:m[k]};h.hierarchy[0]=e;THREE.AnimationHandler.add(h);return new THREE.Animation(b,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function e(b,e){var c,
+f,h=new THREE.Geometry;for(c=0;c<b.points.length*e;c++)f=c/(b.points.length*e),f=b.getPoint(f),h.vertices[c]=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),k=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(f,k);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);k=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)f=new THREE.Mesh(h,k),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!==
 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 h=Math.PI*2,m=Math.PI/180;this.update=function(b,e,c){var f,k;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)*m;this.theta=this.lon*m;f=this.phi%h;this.phi=f>=0?f:f+h;f=this.verticalAngleMap.srcRange;k=this.verticalAngleMap.dstRange;var n=k[1]-k[0];this.phi=
 TWEEN.Easing.Quadratic.EaseInOut(((this.phi-f[0])*(k[1]-k[0])/(f[1]-f[0])+k[0]-k[0])/n)*n+k[0];f=this.horizontalAngleMap.srcRange;k=this.horizontalAngleMap.dstRange;n=k[1]-k[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-f[0])*(k[1]-k[0])/(f[1]-f[0])+k[0]-k[0])/n)*n+k[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,e,c)};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}),k=new THREE.MeshLambertMaterial({color:65280}),n=new THREE.CubeGeometry(10,10,20),t=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(n,b);b=new THREE.Mesh(t,k);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}),k=new THREE.MeshLambertMaterial({color:65280}),n=new THREE.CubeGeometry(10,10,20),p=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(n,b);b=new THREE.Mesh(p,k);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,e){return function(){e.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;
 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=
@@ -450,189 +450,189 @@ 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!=
 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;
-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 h=new THREE.Vector3,m=new THREE.Vector3,k=new THREE.Vector3,n=new THREE.Matrix4,t=!1,p=1,v=0,u=0,x=0,w=0,y=0,z=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*w),this.rotateVertically(b*y));b=this.delta*this.movementSpeed;this.translateZ(b*(v>0||this.autoForward&&!(v<0)?1:v));this.translateX(b*u);this.translateY(b*x);t&&(this.roll+=this.rollSpeed*this.delta*p);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 h=new THREE.Vector3,m=new THREE.Vector3,k=new THREE.Vector3,n=new THREE.Matrix4,p=!1,v=1,u=0,t=0,x=0,w=0,y=0,z=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*w),this.rotateVertically(b*y));b=this.delta*this.movementSpeed;this.translateZ(b*(u>0||this.autoForward&&!(u<0)?1:u));this.translateX(b*t);this.translateY(b*x);p&&(this.roll+=this.rollSpeed*this.delta*v);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();k.copy(this.forward);m.set(0,1,0);h.cross(m,k).normalize();m.cross(k,h).normalize();this.matrix.n11=h.x;this.matrix.n12=m.x;this.matrix.n13=k.x;this.matrix.n21=h.y;this.matrix.n22=m.y;this.matrix.n23=k.y;this.matrix.n31=h.z;this.matrix.n32=m.z;this.matrix.n33=k.z;n.identity();n.n11=Math.cos(this.roll);n.n12=-Math.sin(this.roll);n.n21=Math.sin(this.roll);n.n22=Math.cos(this.roll);this.matrix.multiplySelf(n);
 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){h.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);h.multiplyScalar(b);this.forward.subSelf(h);this.forward.normalize()};this.rotateVertically=function(b){m.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);m.multiplyScalar(b);this.forward.addSelf(m);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
-function(b){w=(b.clientX-z)/window.innerWidth;y=(b.clientY-A)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:v=1;break;case 2:v=-1}},!1);this.domElement.addEventListener("mouseup",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:v=0;break;case 2:v=0}},!1);this.domElement.addEventListener("keydown",function(b){switch(b.keyCode){case 38:case 87:v=1;break;case 37:case 65:u=-1;break;
-case 40:case 83:v=-1;break;case 39:case 68:u=1;break;case 81:t=!0;p=1;break;case 69:t=!0;p=-1;break;case 82:x=1;break;case 70:x=-1}},!1);this.domElement.addEventListener("keyup",function(b){switch(b.keyCode){case 38:case 87:v=0;break;case 37:case 65:u=0;break;case 40:case 83:v=0;break;case 39:case 68:u=0;break;case 81:t=!1;break;case 69:t=!1;break;case 82:x=0;break;case 70:x=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
+function(b){w=(b.clientX-z)/window.innerWidth;y=(b.clientY-A)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:u=1;break;case 2:u=-1}},!1);this.domElement.addEventListener("mouseup",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:u=0;break;case 2:u=0}},!1);this.domElement.addEventListener("keydown",function(b){switch(b.keyCode){case 38:case 87:u=1;break;case 37:case 65:t=-1;break;
+case 40:case 83:u=-1;break;case 39:case 68:t=1;break;case 81:p=!0;v=1;break;case 69:p=!0;v=-1;break;case 82:x=1;break;case 70:x=-1}},!1);this.domElement.addEventListener("keyup",function(b){switch(b.keyCode){case 38:case 87:u=0;break;case 37:case 65:t=0;break;case 40:case 83:u=0;break;case 39:case 68:t=0;break;case 81:p=!1;break;case 69:p=!1;break;case 82:x=0;break;case 70:x=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
 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||
-!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,h=new THREE.Vector3,m=new THREE.Vector3,k=new THREE.Vector3,n=new THREE.Vector2,t=new THREE.Vector2,p=new THREE.Vector2,v=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,h=new THREE.Vector3,m=new THREE.Vector3,k=new THREE.Vector3,n=new THREE.Vector2,p=new THREE.Vector2,v=new THREE.Vector2,u=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);h=this.position.clone().subSelf(this.target.position);f=this.up.clone().setLength(e.y);f.addSelf(this.up.clone().crossSelf(h).setLength(e.x));f.addSelf(h.setLength(e.z));return f};
-this.rotateCamera=function(){var b=Math.acos(m.dot(k)/m.length()/k.length());if(b){var c=(new THREE.Vector3).cross(m,k).normalize(),e=new THREE.Quaternion;b*=this.rotateSpeed;e.setFromAxisAngle(c,-b);e.multiplyVector3(h);e.multiplyVector3(this.up);e.multiplyVector3(k);this.staticMoving?m=k:(e.setFromAxisAngle(c,b*(this.dynamicDampingFactor-1)),e.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(t.y-n.y)*this.zoomSpeed;b!==1&&b>0&&(h.multiplyScalar(b),this.staticMoving?n=t:n.y+=(t.y-n.y)*this.dynamicDampingFactor)};
-this.panCamera=function(){var b=v.clone().subSelf(p);if(b.lengthSq()){b.multiplyScalar(h.length()*this.panSpeed);var c=h.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?p=v:p.addSelf(b.sub(v,p).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.position.lengthSq()>this.maxDistance*this.maxDistance&&this.position.setLength(this.maxDistance),
+this.rotateCamera=function(){var b=Math.acos(m.dot(k)/m.length()/k.length());if(b){var c=(new THREE.Vector3).cross(m,k).normalize(),e=new THREE.Quaternion;b*=this.rotateSpeed;e.setFromAxisAngle(c,-b);e.multiplyVector3(h);e.multiplyVector3(this.up);e.multiplyVector3(k);this.staticMoving?m=k:(e.setFromAxisAngle(c,b*(this.dynamicDampingFactor-1)),e.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(p.y-n.y)*this.zoomSpeed;b!==1&&b>0&&(h.multiplyScalar(b),this.staticMoving?n=p:n.y+=(p.y-n.y)*this.dynamicDampingFactor)};
+this.panCamera=function(){var b=u.clone().subSelf(v);if(b.lengthSq()){b.multiplyScalar(h.length()*this.panSpeed);var c=h.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?v=u:v.addSelf(b.sub(u,v).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.position.lengthSq()>this.maxDistance*this.maxDistance&&this.position.setLength(this.maxDistance),
 h.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.position,h.setLength(this.minDistance))};this.update=function(b,c,e){h=this.position.clone().subSelf(this.target.position);this.rotateCamera();this.noZoom||this.zoomCamera();this.noPan||this.panCamera();this.position.add(this.target.position,h);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&&(m=k=this.getMouseProjectionOnBall(b.clientX,b.clientY),n=t=this.getMouseOnScreen(b.clientX,b.clientY),p=v=this.getMouseOnScreen(b.clientX,b.clientY),e=!1);f!==this.STATE.NONE&&(f===this.STATE.ROTATE?k=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?t=this.getMouseOnScreen(b.clientX,b.clientY):f===this.STATE.PAN&&!this.noPan&&(v=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?m=k=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?n=t=this.getMouseOnScreen(b.clientX,b.clientY):this.noPan||(p=v=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&&(m=k=this.getMouseProjectionOnBall(b.clientX,b.clientY),n=p=this.getMouseOnScreen(b.clientX,b.clientY),v=u=this.getMouseOnScreen(b.clientX,b.clientY),e=!1);f!==this.STATE.NONE&&(f===this.STATE.ROTATE?k=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?p=this.getMouseOnScreen(b.clientX,b.clientY):f===this.STATE.PAN&&!this.noPan&&(u=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?m=k=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?n=p=this.getMouseOnScreen(b.clientX,b.clientY):this.noPan||(v=u=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;
 THREE.TrackballCamera.prototype.STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2};THREE.QuakeCamera=THREE.FirstPersonCamera;
-THREE.CubeGeometry=function(b,c,e,f,h,m,k,n,t){function p(b,c,e,k,n,p,t,u){var w,x,y=f||1,z=h||1,M=n/2,U=p/2,V=v.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")w="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")w="y",z=m||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")w="x",y=m||1;var R=y+1,o=z+1;n/=y;var pa=p/z;for(x=0;x<o;x++)for(p=0;p<R;p++){var T=new THREE.Vector3;T[b]=(p*n-M)*e;T[c]=(x*pa-U)*k;T[w]=t;v.vertices.push(new THREE.Vertex(T))}for(x=0;x<z;x++)for(p=0;p<y;p++)v.faces.push(new THREE.Face4(p+R*
-x+V,p+R*(x+1)+V,p+1+R*(x+1)+V,p+1+R*x+V,null,null,u)),v.faceVertexUvs[0].push([new THREE.UV(p/y,x/z),new THREE.UV(p/y,(x+1)/z),new THREE.UV((p+1)/y,(x+1)/z),new THREE.UV((p+1)/y,x/z)])}THREE.Geometry.call(this);var v=this,u=b/2,x=c/2,w=e/2,n=n?-1:1;if(k!==void 0)if(k instanceof Array)this.materials=k;else{this.materials=[];for(var y=0;y<6;y++)this.materials.push([k])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(t!=void 0)for(var z in t)this.sides[z]!=void 0&&(this.sides[z]=
-t[z]);this.sides.px&&p("z","y",1*n,-1,e,c,-u,this.materials[0]);this.sides.nx&&p("z","y",-1*n,-1,e,c,u,this.materials[1]);this.sides.py&&p("x","z",1*n,1,b,e,x,this.materials[2]);this.sides.ny&&p("x","z",1*n,-1,b,e,-x,this.materials[3]);this.sides.pz&&p("x","y",1*n,-1,b,c,w,this.materials[4]);this.sides.nz&&p("x","y",-1*n,-1,b,c,-w,this.materials[5]);(function(){for(var b=[],c=[],e=0,f=v.vertices.length;e<f;e++){for(var k=v.vertices[e],h=!1,m=0,n=b.length;m<n;m++){var p=b[m];if(k.position.x==p.position.x&&
-k.position.y==p.position.y&&k.position.z==p.position.z){c[e]=m;h=!0;break}}if(!h)c[e]=b.length,b.push(new THREE.Vertex(k.position.clone()))}e=0;for(f=v.faces.length;e<f;e++)k=v.faces[e],k.a=c[k.a],k.b=c[k.b],k.c=c[k.c],k.d=c[k.d];v.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,h,m){function k(b,c,e){n.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}THREE.Geometry.call(this);var n=this,t,p=Math.PI*2,v=f/2;for(t=0;t<b;t++)k(Math.sin(p*t/b)*c,Math.cos(p*t/b)*c,-v);for(t=0;t<b;t++)k(Math.sin(p*t/b)*e,Math.cos(p*t/b)*e,v);var u,x,w,y,z=c-e;for(t=0;t<b;t++)u=new THREE.Vector3,u.copy(n.vertices[t].position),u.z=z,u.normalize(),x=new THREE.Vector3,x.copy(n.vertices[t+b].position),x.z=z,x.normalize(),w=new THREE.Vector3,w.copy(n.vertices[b+
-(t+1)%b].position),w.z=z,w.normalize(),y=new THREE.Vector3,y.copy(n.vertices[(t+1)%b].position),y.z=z,y.normalize(),n.faces.push(new THREE.Face4(t,t+b,b+(t+1)%b,(t+1)%b,[u,x,w,y]));if(e>0){e=new THREE.Vector3(0,0,-1);k(0,0,-v-(m||0));for(t=b;t<b+b/2;t++)n.faces.push(new THREE.Face4(2*b,(2*t-2*b)%b,(2*t-2*b+1)%b,(2*t-2*b+2)%b,[e,e,e,e]))}if(c>0){c=new THREE.Vector3(0,0,1);k(0,0,v+(h||0));for(t=b+b/2;t<2*b;t++)n.faces.push(new THREE.Face4(2*b+1,(2*t-2*b+2)%b+b,(2*t-2*b+1)%b+b,(2*t-2*b)%b+b,[c,c,c,c]))}t=
-0;for(b=this.faces.length;t<b;t++)h=[],v=this.faces[t],c=this.vertices[v.a],m=this.vertices[v.b],e=this.vertices[v.c],u=this.vertices[v.d],h.push(new THREE.UV(0.5+Math.atan2(c.position.x,c.position.y)/p,0.5+c.position.z/f)),h.push(new THREE.UV(0.5+Math.atan2(m.position.x,m.position.y)/p,0.5+m.position.z/f)),h.push(new THREE.UV(0.5+Math.atan2(e.position.x,e.position.y)/p,0.5+e.position.z/f)),v instanceof THREE.Face4&&h.push(new THREE.UV(0.5+Math.atan2(u.position.x,u.position.y)/p,0.5+u.position.z/
-f)),this.faceVertexUvs[0].push(h);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,h;this.shapebb=b[f-1].getBoundingBox();for(e=0;e<f;e++)h=b[e],this.addShape(h,c);this.computeCentroids();this.computeFaceNormals()}};
-THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
+THREE.CubeGeometry=function(b,c,e,f,h,m,k,n,p){function v(b,c,e,k,n,p,t,v){var w,x,y=f||1,z=h||1,M=n/2,U=p/2,V=u.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")w="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")w="y",z=m||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")w="x",y=m||1;var R=y+1,o=z+1;n/=y;var pa=p/z;for(x=0;x<o;x++)for(p=0;p<R;p++){var T=new THREE.Vector3;T[b]=(p*n-M)*e;T[c]=(x*pa-U)*k;T[w]=t;u.vertices.push(new THREE.Vertex(T))}for(x=0;x<z;x++)for(p=0;p<y;p++)u.faces.push(new THREE.Face4(p+R*
+x+V,p+R*(x+1)+V,p+1+R*(x+1)+V,p+1+R*x+V,null,null,v)),u.faceVertexUvs[0].push([new THREE.UV(p/y,x/z),new THREE.UV(p/y,(x+1)/z),new THREE.UV((p+1)/y,(x+1)/z),new THREE.UV((p+1)/y,x/z)])}THREE.Geometry.call(this);var u=this,t=b/2,x=c/2,w=e/2,n=n?-1:1;if(k!==void 0)if(k instanceof Array)this.materials=k;else{this.materials=[];for(var y=0;y<6;y++)this.materials.push([k])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(p!=void 0)for(var z in p)this.sides[z]!=void 0&&(this.sides[z]=
+p[z]);this.sides.px&&v("z","y",1*n,-1,e,c,-t,this.materials[0]);this.sides.nx&&v("z","y",-1*n,-1,e,c,t,this.materials[1]);this.sides.py&&v("x","z",1*n,1,b,e,x,this.materials[2]);this.sides.ny&&v("x","z",1*n,-1,b,e,-x,this.materials[3]);this.sides.pz&&v("x","y",1*n,-1,b,c,w,this.materials[4]);this.sides.nz&&v("x","y",-1*n,-1,b,c,-w,this.materials[5]);(function(){for(var b=[],c=[],e=0,f=u.vertices.length;e<f;e++){for(var k=u.vertices[e],h=!1,m=0,n=b.length;m<n;m++){var p=b[m];if(k.position.x==p.position.x&&
+k.position.y==p.position.y&&k.position.z==p.position.z){c[e]=m;h=!0;break}}if(!h)c[e]=b.length,b.push(new THREE.Vertex(k.position.clone()))}e=0;for(f=u.faces.length;e<f;e++)k=u.faces[e],k.a=c[k.a],k.b=c[k.b],k.c=c[k.c],k.d=c[k.d];u.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,h,m){THREE.Geometry.call(this);var b=b!=null?b:20,c=c!=null?c:20,e=e||100,k=e/2,f=f||8,h=h||1,n,p,v=[],u=[];for(p=0;p<=h;p++){var t=[],x=[],w=p/h,y=w*(c-b)+b;for(n=0;n<=f;n++){var z=n/f;this.vertices.push(new THREE.Vertex(new THREE.Vector3(y*Math.sin(z*Math.PI*2),-w*e+k,y*Math.cos(z*Math.PI*2))));t.push(this.vertices.length-1);x.push(new THREE.UV(z,w))}v.push(t);u.push(x)}for(p=0;p<h;p++)for(n=0;n<f;n++){var e=v[p][n],t=v[p+1][n],x=v[p+1][n+1],w=v[p][n+1],y=
+this.vertices[e].position.clone().setY(0).normalize(),z=this.vertices[t].position.clone().setY(0).normalize(),A=this.vertices[x].position.clone().setY(0).normalize(),C=this.vertices[w].position.clone().setY(0).normalize(),E=u[p][n].clone(),G=u[p+1][n].clone(),H=u[p+1][n+1].clone(),N=u[p][n+1].clone();this.faces.push(new THREE.Face4(e,t,x,w,[y,z,A,C]));this.faceVertexUvs[0].push([E,G,H,N])}if(!m&&b>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,k,0)));for(n=0;n<f;n++)e=v[0][n],t=v[0][n+
+1],x=this.vertices.length-1,y=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,1,0),A=new THREE.Vector3(0,1,0),E=u[0][n].clone(),G=u[0][n+1].clone(),H=new THREE.UV(G.u,0),this.faces.push(new THREE.Face3(e,t,x,[y,z,A])),this.faceVertexUvs[0].push([E,G,H])}if(!m&&c>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-k,0)));for(n=0;n<f;n++)e=v[p][n+1],t=v[p][n],x=this.vertices.length-1,y=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),A=new THREE.Vector3(0,-1,0),E=u[p][n+1].clone(),G=u[p][n].clone(),
+H=new THREE.UV(G.u,1),this.faces.push(new THREE.Face3(e,t,x,[y,z,A])),this.faceVertexUvs[0].push([E,G,H])}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,h;this.shapebb=b[f-1].getBoundingBox();for(e=0;e<f;e++)h=b[e],this.addShape(h,c);this.computeCentroids();this.computeFaceNormals()}};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,k=THREE.ExtrudeGeometry.__v2,h=THREE.ExtrudeGeometry.__v3,m=THREE.ExtrudeGeometry.__v4,n=THREE.ExtrudeGeometry.__v5,o=THREE.ExtrudeGeometry.__v6;f.set(b.x-c.x,b.y-c.y);k.set(b.x-e.x,b.y-e.y);f=f.normalize();k=k.normalize();h.set(-f.y,f.x);m.set(k.y,-k.x);n.copy(b).addSelf(h);o.copy(b).addSelf(m);if(n.equals(o))return m.clone();
-n.copy(c).addSelf(h);o.copy(e).addSelf(m);h=f.dot(m);m=o.subSelf(n).dot(m);h==0&&(console.log("Either infinite or no solutions!"),m==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));m/=h;if(m<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(m).addSelf(n).subSelf(b).clone()}function h(b){for(D=b.length;--D>=0;){ka=D;da=D-1;da<0&&(da=b.length-
-1);for(var c=0,e=w+v*2,c=0;c<e;c++){var f=pa*c,k=pa*(c+1),h=Z+ka+f,m=Z+ka+k,o=h,f=Z+da+f,k=Z+da+k,p=m;o+=W;f+=W;k+=W;p+=W;K.faces.push(new THREE.Face4(o,f,k,p,null,null,H));H&&(o=c/e,f=(c+1)/e,k=n+t*2,h=(K.vertices[h].position.z+t)/k,m=(K.vertices[m].position.z+t)/k,K.faceVertexUvs[0].push([new THREE.UV(h,o),new THREE.UV(m,o),new THREE.UV(m,f),new THREE.UV(h,f)]))}}}function m(b,c,e){K.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}function k(b,c,e){b+=W;c+=W;e+=W;K.faces.push(new THREE.Face3(b,
-c,e,null,null,G));if(G){var f=O.maxY,k=O.maxX,h=K.vertices[c].position.x,c=K.vertices[c].position.y,m=K.vertices[e].position.x,e=K.vertices[e].position.y;K.faceVertexUvs[0].push([new THREE.UV(K.vertices[b].position.x/k,K.vertices[b].position.y/f),new THREE.UV(h/k,c/f),new THREE.UV(m/k,e/f)])}}var n=c.amount!==void 0?c.amount:100,t=c.bevelThickness!==void 0?c.bevelThickness:6,p=c.bevelSize!==void 0?c.bevelSize:t-2,v=c.bevelSegments!==void 0?c.bevelSegments:3,u=c.bevelEnabled!==void 0?c.bevelEnabled:
-!0,x=c.curveSegments!==void 0?c.curveSegments:12,w=c.steps!==void 0?c.steps:1,y=c.bendPath,z=c.extrudePath,A,C=!1,E=c.useSpacedPoints!==void 0?c.useSpacedPoints:!1,G=c.material,H=c.extrudeMaterial,O=this.shapebb;if(z)A=z.getPoints(x),w=A.length,C=!0,u=!1;u||(p=t=v=0);var S,J,I,K=this,W=this.vertices.length;y&&b.addWrapPath(y);x=E?b.extractAllSpacedPoints(x):b.extractAllPoints(x);y=x.shape;x=x.holes;if(z=!THREE.Shape.Utils.isClockWise(y)){y=y.reverse();J=0;for(I=x.length;J<I;J++)S=x[J],THREE.Shape.Utils.isClockWise(S)&&
-(x[J]=S.reverse());z=!1}z=THREE.Shape.Utils.triangulateShape(y,x);E=y;J=0;for(I=x.length;J<I;J++)S=x[J],y=y.concat(S);var D,M,U,V,R,o,pa=y.length,T=z.length,la=[];D=0;M=E.length;ka=M-1;for(da=D+1;D<M;D++,ka++,da++)ka==M&&(ka=0),da==M&&(da=0),la[D]=f(E[D],E[ka],E[da]);var aa=[],na,ja=la.concat();J=0;for(I=x.length;J<I;J++){S=x[J];na=[];D=0;M=S.length;ka=M-1;for(da=D+1;D<M;D++,ka++,da++)ka==M&&(ka=0),da==M&&(da=0),na[D]=f(S[D],S[ka],S[da]);aa.push(na);ja=ja.concat(na)}for(U=0;U<v;U++){V=U/v;R=t*(1-
-V);V=p*Math.sin(V*Math.PI/2);D=0;for(M=E.length;D<M;D++)o=e(E[D],la[D],V),m(o.x,o.y,-R);J=0;for(I=x.length;J<I;J++){S=x[J];na=aa[J];D=0;for(M=S.length;D<M;D++)o=e(S[D],na[D],V),m(o.x,o.y,-R)}}V=p;for(D=0;D<pa;D++)o=u?e(y[D],ja[D],V):y[D],C?m(o.x,o.y+A[0].y,A[0].x):m(o.x,o.y,0);for(U=1;U<=w;U++)for(D=0;D<pa;D++)o=u?e(y[D],ja[D],V):y[D],C?m(o.x,o.y+A[U-1].y,A[U-1].x):m(o.x,o.y,n/w*U);for(U=v-1;U>=0;U--){V=U/v;R=t*(1-V);V=p*Math.sin(V*Math.PI/2);D=0;for(M=E.length;D<M;D++)o=e(E[D],la[D],V),m(o.x,o.y,
-n+R);J=0;for(I=x.length;J<I;J++){S=x[J];na=aa[J];D=0;for(M=S.length;D<M;D++)o=e(S[D],na[D],V),C?m(o.x,o.y+A[w-1].y,A[w-1].x+R):m(o.x,o.y,n+R)}}if(u){u=pa*0;for(D=0;D<T;D++)p=z[D],k(p[2]+u,p[1]+u,p[0]+u);u=pa*(w+v*2);for(D=0;D<T;D++)p=z[D],k(p[0]+u,p[1]+u,p[2]+u)}else{for(D=0;D<T;D++)p=z[D],k(p[2],p[1],p[0]);for(D=0;D<T;D++)p=z[D],k(p[0]+pa*w,p[1]+pa*w,p[2]+pa*w)}var ka,da,Z=0;h(E);Z+=E.length;J=0;for(I=x.length;J<I;J++)S=x[J],h(S),Z+=S.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;
+n.copy(c).addSelf(h);o.copy(e).addSelf(m);h=f.dot(m);m=o.subSelf(n).dot(m);h==0&&(console.log("Either infinite or no solutions!"),m==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));m/=h;if(m<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(m).addSelf(n).subSelf(b).clone()}function h(b){for(D=b.length;--D>=0;){ka=D;ea=D-1;ea<0&&(ea=b.length-
+1);for(var c=0,e=w+u*2,c=0;c<e;c++){var f=pa*c,k=pa*(c+1),h=Z+ka+f,m=Z+ka+k,o=h,f=Z+ea+f,k=Z+ea+k,t=m;o+=W;f+=W;k+=W;t+=W;K.faces.push(new THREE.Face4(o,f,k,t,null,null,H));H&&(o=c/e,f=(c+1)/e,k=n+p*2,h=(K.vertices[h].position.z+p)/k,m=(K.vertices[m].position.z+p)/k,K.faceVertexUvs[0].push([new THREE.UV(h,o),new THREE.UV(m,o),new THREE.UV(m,f),new THREE.UV(h,f)]))}}}function m(b,c,e){K.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}function k(b,c,e){b+=W;c+=W;e+=W;K.faces.push(new THREE.Face3(b,
+c,e,null,null,G));if(G){var f=N.maxY,k=N.maxX,h=K.vertices[c].position.x,c=K.vertices[c].position.y,m=K.vertices[e].position.x,e=K.vertices[e].position.y;K.faceVertexUvs[0].push([new THREE.UV(K.vertices[b].position.x/k,K.vertices[b].position.y/f),new THREE.UV(h/k,c/f),new THREE.UV(m/k,e/f)])}}var n=c.amount!==void 0?c.amount:100,p=c.bevelThickness!==void 0?c.bevelThickness:6,v=c.bevelSize!==void 0?c.bevelSize:p-2,u=c.bevelSegments!==void 0?c.bevelSegments:3,t=c.bevelEnabled!==void 0?c.bevelEnabled:
+!0,x=c.curveSegments!==void 0?c.curveSegments:12,w=c.steps!==void 0?c.steps:1,y=c.bendPath,z=c.extrudePath,A,C=!1,E=c.useSpacedPoints!==void 0?c.useSpacedPoints:!1,G=c.material,H=c.extrudeMaterial,N=this.shapebb;if(z)A=z.getPoints(x),w=A.length,C=!0,t=!1;t||(v=p=u=0);var S,J,I,K=this,W=this.vertices.length;y&&b.addWrapPath(y);x=E?b.extractAllSpacedPoints(x):b.extractAllPoints(x);y=x.shape;x=x.holes;if(z=!THREE.Shape.Utils.isClockWise(y)){y=y.reverse();J=0;for(I=x.length;J<I;J++)S=x[J],THREE.Shape.Utils.isClockWise(S)&&
+(x[J]=S.reverse());z=!1}z=THREE.Shape.Utils.triangulateShape(y,x);E=y;J=0;for(I=x.length;J<I;J++)S=x[J],y=y.concat(S);var D,M,U,V,R,o,pa=y.length,T=z.length,la=[];D=0;M=E.length;ka=M-1;for(ea=D+1;D<M;D++,ka++,ea++)ka==M&&(ka=0),ea==M&&(ea=0),la[D]=f(E[D],E[ka],E[ea]);var aa=[],na,ja=la.concat();J=0;for(I=x.length;J<I;J++){S=x[J];na=[];D=0;M=S.length;ka=M-1;for(ea=D+1;D<M;D++,ka++,ea++)ka==M&&(ka=0),ea==M&&(ea=0),na[D]=f(S[D],S[ka],S[ea]);aa.push(na);ja=ja.concat(na)}for(U=0;U<u;U++){V=U/u;R=p*(1-
+V);V=v*Math.sin(V*Math.PI/2);D=0;for(M=E.length;D<M;D++)o=e(E[D],la[D],V),m(o.x,o.y,-R);J=0;for(I=x.length;J<I;J++){S=x[J];na=aa[J];D=0;for(M=S.length;D<M;D++)o=e(S[D],na[D],V),m(o.x,o.y,-R)}}V=v;for(D=0;D<pa;D++)o=t?e(y[D],ja[D],V):y[D],C?m(o.x,o.y+A[0].y,A[0].x):m(o.x,o.y,0);for(U=1;U<=w;U++)for(D=0;D<pa;D++)o=t?e(y[D],ja[D],V):y[D],C?m(o.x,o.y+A[U-1].y,A[U-1].x):m(o.x,o.y,n/w*U);for(U=u-1;U>=0;U--){V=U/u;R=p*(1-V);V=v*Math.sin(V*Math.PI/2);D=0;for(M=E.length;D<M;D++)o=e(E[D],la[D],V),m(o.x,o.y,
+n+R);J=0;for(I=x.length;J<I;J++){S=x[J];na=aa[J];D=0;for(M=S.length;D<M;D++)o=e(S[D],na[D],V),C?m(o.x,o.y+A[w-1].y,A[w-1].x+R):m(o.x,o.y,n+R)}}if(t){t=pa*0;for(D=0;D<T;D++)v=z[D],k(v[2]+t,v[1]+t,v[0]+t);t=pa*(w+u*2);for(D=0;D<T;D++)v=z[D],k(v[0]+t,v[1]+t,v[2]+t)}else{for(D=0;D<T;D++)v=z[D],k(v[2],v[1],v[0]);for(D=0;D<T;D++)v=z[D],k(v[0]+pa*w,v[1]+pa*w,v[2]+pa*w)}var ka,ea,Z=0;h(E);Z+=E.length;J=0;for(I=x.length;J<I;J++)S=x[J],h(S),Z+=S.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.IcosahedronGeometry=function(b){function c(b,c,e){var f=Math.sqrt(b*b+c*c+e*e);return h.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=h.vertices[b].position,k=h.vertices[e].position;return c((f.x+k.x)/2,(f.y+k.y)/2,(f.z+k.z)/2)}var h=this,m=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,m);e(0,5,1,m);e(0,1,7,m);e(0,7,10,m);e(0,10,11,m);e(1,5,9,m);e(5,11,4,m);e(11,10,2,m);e(10,7,6,m);e(7,1,8,m);e(3,9,4,m);e(3,4,2,m);e(3,2,6,m);e(3,6,8,m);e(3,8,9,m);e(4,9,5,m);e(2,4,11,m);e(6,2,10,m);e(8,6,7,m);e(9,8,1,m);for(var k=0;k<this.subdivisions;k++){var b=new THREE.Geometry,n;for(n in m.faces){var t=f(m.faces[n].a,m.faces[n].b),p=f(m.faces[n].b,m.faces[n].c),v=f(m.faces[n].c,m.faces[n].a);e(m.faces[n].a,t,v,b);e(m.faces[n].b,p,
-t,b);e(m.faces[n].c,v,p,b);e(t,p,v,b)}m.faces=b.faces}h.faces=m.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=[],h=[],m=[],k=(new THREE.Matrix4).setRotationZ(c),n=0;n<b.length;n++)this.vertices.push(new THREE.Vertex(b[n])),e[n]=b[n].clone(),f[n]=this.vertices.length-1;for(var t=0;t<=this.angle+0.0010;t+=c){for(n=0;n<e.length;n++)t<this.angle?(e[n]=k.multiplyVector3(e[n].clone()),this.vertices.push(new THREE.Vertex(e[n])),h[n]=this.vertices.length-1):h=m;t==0&&(m=f);
-for(n=0;n<f.length-1;n++)this.faces.push(new THREE.Face4(h[n],h[n+1],f[n+1],f[n])),this.faceVertexUvs[0].push([new THREE.UV(1-t/this.angle,n/b.length),new THREE.UV(1-t/this.angle,(n+1)/b.length),new THREE.UV(1-(t-c)/this.angle,(n+1)/b.length),new THREE.UV(1-(t-c)/this.angle,n/b.length)]);f=h;h=[]}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 h,m=b/2,k=c/2,e=e||1,f=f||1,n=e+1,t=f+1;b/=e;var p=c/f;for(h=0;h<t;h++)for(c=0;c<n;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-m,-(h*p-k),0)));for(h=0;h<f;h++)for(c=0;c<e;c++)this.faces.push(new THREE.Face4(c+n*h,c+n*(h+1),c+1+n*(h+1),c+1+n*h)),this.faceVertexUvs[0].push([new THREE.UV(c/e,h/f),new THREE.UV(c/e,(h+1)/f),new THREE.UV((c+1)/e,(h+1)/f),new THREE.UV((c+1)/e,h/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,m);e(0,5,1,m);e(0,1,7,m);e(0,7,10,m);e(0,10,11,m);e(1,5,9,m);e(5,11,4,m);e(11,10,2,m);e(10,7,6,m);e(7,1,8,m);e(3,9,4,m);e(3,4,2,m);e(3,2,6,m);e(3,6,8,m);e(3,8,9,m);e(4,9,5,m);e(2,4,11,m);e(6,2,10,m);e(8,6,7,m);e(9,8,1,m);for(var k=0;k<this.subdivisions;k++){var b=new THREE.Geometry,n;for(n in m.faces){var p=f(m.faces[n].a,m.faces[n].b),v=f(m.faces[n].b,m.faces[n].c),u=f(m.faces[n].c,m.faces[n].a);e(m.faces[n].a,p,u,b);e(m.faces[n].b,v,
+p,b);e(m.faces[n].c,u,v,b);e(p,v,u,b)}m.faces=b.faces}h.faces=m.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=[],h=[],m=[],k=(new THREE.Matrix4).setRotationZ(c),n=0;n<b.length;n++)this.vertices.push(new THREE.Vertex(b[n])),e[n]=b[n].clone(),f[n]=this.vertices.length-1;for(var p=0;p<=this.angle+0.0010;p+=c){for(n=0;n<e.length;n++)p<this.angle?(e[n]=k.multiplyVector3(e[n].clone()),this.vertices.push(new THREE.Vertex(e[n])),h[n]=this.vertices.length-1):h=m;p==0&&(m=f);
+for(n=0;n<f.length-1;n++)this.faces.push(new THREE.Face4(h[n],h[n+1],f[n+1],f[n])),this.faceVertexUvs[0].push([new THREE.UV(1-p/this.angle,n/b.length),new THREE.UV(1-p/this.angle,(n+1)/b.length),new THREE.UV(1-(p-c)/this.angle,(n+1)/b.length),new THREE.UV(1-(p-c)/this.angle,n/b.length)]);f=h;h=[]}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 h,m=b/2,k=c/2,e=e||1,f=f||1,n=e+1,p=f+1;b/=e;var v=c/f;for(h=0;h<p;h++)for(c=0;c<n;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-m,-(h*v-k),0)));for(h=0;h<f;h++)for(c=0;c<e;c++)this.faces.push(new THREE.Face4(c+n*h,c+n*(h+1),c+1+n*(h+1),c+1+n*h)),this.faceVertexUvs[0].push([new THREE.UV(c/e,h/f),new THREE.UV(c/e,(h+1)/f),new THREE.UV((c+1)/e,(h+1)/f),new THREE.UV((c+1)/e,h/f)]);this.computeCentroids();this.computeFaceNormals()};
 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,h=Math.PI,m=Math.max(3,c||8),k=Math.max(2,e||6),c=[],e=0;e<k+1;e++){f=e/k;var n=b*Math.cos(f*h),t=b*Math.sin(f*h),p=[],v=0;for(f=0;f<m;f++){var u=2*f/m,x=t*Math.sin(u*h),u=t*Math.cos(u*h);(e==0||e==k)&&f>0||(v=this.vertices.push(new THREE.Vertex(new THREE.Vector3(u,n,x)))-1);p.push(v)}c.push(p)}for(var w,y,z,h=c.length,e=0;e<h;e++)if(m=c[e].length,e>0)for(f=0;f<m;f++){p=f==m-1;k=c[e][p?0:f+1];n=c[e][p?m-1:f];t=c[e-1][p?
-m-1:f];p=c[e-1][p?0:f+1];x=e/(h-1);w=(e-1)/(h-1);y=(f+1)/m;var u=f/m,v=new THREE.UV(1-y,x),x=new THREE.UV(1-u,x),u=new THREE.UV(1-u,w),A=new THREE.UV(1-y,w);e<c.length-1&&(w=this.vertices[k].position.clone(),y=this.vertices[n].position.clone(),z=this.vertices[t].position.clone(),w.normalize(),y.normalize(),z.normalize(),this.faces.push(new THREE.Face3(k,n,t,[new THREE.Vector3(w.x,w.y,w.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([v,x,u]));e>1&&(w=
-this.vertices[k].position.clone(),y=this.vertices[t].position.clone(),z=this.vertices[p].position.clone(),w.normalize(),y.normalize(),z.normalize(),this.faces.push(new THREE.Face3(k,t,p,[new THREE.Vector3(w.x,w.y,w.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([v,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,h=Math.PI,m=Math.max(3,c||8),k=Math.max(2,e||6),c=[],e=0;e<k+1;e++){f=e/k;var n=b*Math.cos(f*h),p=b*Math.sin(f*h),v=[],u=0;for(f=0;f<m;f++){var t=2*f/m,x=p*Math.sin(t*h),t=p*Math.cos(t*h);(e==0||e==k)&&f>0||(u=this.vertices.push(new THREE.Vertex(new THREE.Vector3(t,n,x)))-1);v.push(u)}c.push(v)}for(var w,y,z,h=c.length,e=0;e<h;e++)if(m=c[e].length,e>0)for(f=0;f<m;f++){v=f==m-1;k=c[e][v?0:f+1];n=c[e][v?m-1:f];p=c[e-1][v?
+m-1:f];v=c[e-1][v?0:f+1];x=e/(h-1);w=(e-1)/(h-1);y=(f+1)/m;var t=f/m,u=new THREE.UV(1-y,x),x=new THREE.UV(1-t,x),t=new THREE.UV(1-t,w),A=new THREE.UV(1-y,w);e<c.length-1&&(w=this.vertices[k].position.clone(),y=this.vertices[n].position.clone(),z=this.vertices[p].position.clone(),w.normalize(),y.normalize(),z.normalize(),this.faces.push(new THREE.Face3(k,n,p,[new THREE.Vector3(w.x,w.y,w.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([u,x,t]));e>1&&(w=
+this.vertices[k].position.clone(),y=this.vertices[p].position.clone(),z=this.vertices[v].position.clone(),w.normalize(),y.normalize(),z.normalize(),this.faces.push(new THREE.Face3(k,p,v,[new THREE.Vector3(w.x,w.y,w.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([u,t,A]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;
 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.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=
-this.getFace(),e=this.size/c.resolution,f=0,h=String(b).split(""),m=h.length,k=[],b=0;b<m;b++){var n=new THREE.Path,n=this.extractGlyphPoints(h[b],c,e,f,n);f+=n.offset;k.push(n.path)}return{paths:k,offset:f/2}},extractGlyphPoints:function(b,c,e,f,h){var m=[],k,n,t,p,v,u,x,w,y,z,A=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(A){if(A.o){c=A._cachedOutline||(A._cachedOutline=A.o.split(" "));t=c.length;for(b=0;b<t;)switch(n=c[b++],n){case "m":n=c[b++]*e+f;p=c[b++]*e;m.push(new THREE.Vector2(n,
-p));h.moveTo(n,p);break;case "l":n=c[b++]*e+f;p=c[b++]*e;m.push(new THREE.Vector2(n,p));h.lineTo(n,p);break;case "q":n=c[b++]*e+f;p=c[b++]*e;x=c[b++]*e+f;w=c[b++]*e;h.quadraticCurveTo(x,w,n,p);if(k=m[m.length-1]){v=k.x;u=k.y;k=1;for(divisions=this.divisions;k<=divisions;k++){var C=k/divisions,E=THREE.Shape.Utils.b2(C,v,x,n),C=THREE.Shape.Utils.b2(C,u,w,p);m.push(new THREE.Vector2(E,C))}}break;case "b":if(n=c[b++]*e+f,p=c[b++]*e,x=c[b++]*e+f,w=c[b++]*-e,y=c[b++]*e+f,z=c[b++]*-e,h.bezierCurveTo(n,p,
-x,w,y,z),k=m[m.length-1]){v=k.x;u=k.y;k=1;for(divisions=this.divisions;k<=divisions;k++)C=k/divisions,E=THREE.Shape.Utils.b3(C,v,x,y,n),C=THREE.Shape.Utils.b3(C,u,w,z,p),m.push(new THREE.Vector2(E,C))}}}return{offset:A.ha*e,points:m,path:h}}}};
-(function(b){var c=function(b){for(var c=b.length,h=0,m=c-1,k=0;k<c;m=k++)h+=b[m].x*b[k].y-b[k].x*b[m].y;return h*0.5};b.Triangulate=function(b,f){var h=b.length;if(h<3)return null;var m=[],k=[],n=[],t,p,v;if(c(b)>0)for(p=0;p<h;p++)k[p]=p;else for(p=0;p<h;p++)k[p]=h-1-p;var u=2*h;for(p=h-1;h>2;){if(u--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return m}t=p;h<=t&&(t=0);p=t+1;h<=p&&(p=0);v=p+1;h<=v&&(v=0);var x;a:{x=b;var w=t,y=p,z=v,A=h,C=k,E=void 0,G=void 0,H=void 0,
-O=void 0,S=void 0,J=void 0,I=void 0,K=void 0,W=void 0,G=x[C[w]].x,H=x[C[w]].y,O=x[C[y]].x,S=x[C[y]].y,J=x[C[z]].x,I=x[C[z]].y;if(1.0E-10>(O-G)*(I-H)-(S-H)*(J-G))x=!1;else{for(E=0;E<A;E++)if(!(E==w||E==y||E==z)){var K=x[C[E]].x,W=x[C[E]].y,D=void 0,M=void 0,U=void 0,V=void 0,R=void 0,o=void 0,pa=void 0,T=void 0,la=void 0,aa=void 0,na=void 0,ja=void 0,D=U=R=void 0,D=J-O,M=I-S,U=G-J,V=H-I,R=O-G,o=S-H,pa=K-G,T=W-H,la=K-O,aa=W-S,na=K-J,ja=W-I,D=D*aa-M*la,R=R*T-o*pa,U=U*ja-V*na;if(D>=0&&U>=0&&R>=0){x=!1;
-break a}}x=!0}}if(x){m.push([b[k[t]],b[k[p]],b[k[v]]]);n.push([k[t],k[p],k[v]]);t=p;for(v=p+1;v<h;t++,v++)k[t]=k[v];h--;u=2*h}}if(f)return n;return m};b.Triangulate.area=c;return b})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
+this.getFace(),e=this.size/c.resolution,f=0,h=String(b).split(""),m=h.length,k=[],b=0;b<m;b++){var n=new THREE.Path,n=this.extractGlyphPoints(h[b],c,e,f,n);f+=n.offset;k.push(n.path)}return{paths:k,offset:f/2}},extractGlyphPoints:function(b,c,e,f,h){var m=[],k,n,p,v,u,t,x,w,y,z,A=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(A){if(A.o){c=A._cachedOutline||(A._cachedOutline=A.o.split(" "));p=c.length;for(b=0;b<p;)switch(n=c[b++],n){case "m":n=c[b++]*e+f;v=c[b++]*e;m.push(new THREE.Vector2(n,
+v));h.moveTo(n,v);break;case "l":n=c[b++]*e+f;v=c[b++]*e;m.push(new THREE.Vector2(n,v));h.lineTo(n,v);break;case "q":n=c[b++]*e+f;v=c[b++]*e;x=c[b++]*e+f;w=c[b++]*e;h.quadraticCurveTo(x,w,n,v);if(k=m[m.length-1]){u=k.x;t=k.y;k=1;for(divisions=this.divisions;k<=divisions;k++){var C=k/divisions,E=THREE.Shape.Utils.b2(C,u,x,n),C=THREE.Shape.Utils.b2(C,t,w,v);m.push(new THREE.Vector2(E,C))}}break;case "b":if(n=c[b++]*e+f,v=c[b++]*e,x=c[b++]*e+f,w=c[b++]*-e,y=c[b++]*e+f,z=c[b++]*-e,h.bezierCurveTo(n,v,
+x,w,y,z),k=m[m.length-1]){u=k.x;t=k.y;k=1;for(divisions=this.divisions;k<=divisions;k++)C=k/divisions,E=THREE.Shape.Utils.b3(C,u,x,y,n),C=THREE.Shape.Utils.b3(C,t,w,z,v),m.push(new THREE.Vector2(E,C))}}}return{offset:A.ha*e,points:m,path:h}}}};
+(function(b){var c=function(b){for(var c=b.length,h=0,m=c-1,k=0;k<c;m=k++)h+=b[m].x*b[k].y-b[k].x*b[m].y;return h*0.5};b.Triangulate=function(b,f){var h=b.length;if(h<3)return null;var m=[],k=[],n=[],p,v,u;if(c(b)>0)for(v=0;v<h;v++)k[v]=v;else for(v=0;v<h;v++)k[v]=h-1-v;var t=2*h;for(v=h-1;h>2;){if(t--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return m}p=v;h<=p&&(p=0);v=p+1;h<=v&&(v=0);u=v+1;h<=u&&(u=0);var x;a:{x=b;var w=p,y=v,z=u,A=h,C=k,E=void 0,G=void 0,H=void 0,
+N=void 0,S=void 0,J=void 0,I=void 0,K=void 0,W=void 0,G=x[C[w]].x,H=x[C[w]].y,N=x[C[y]].x,S=x[C[y]].y,J=x[C[z]].x,I=x[C[z]].y;if(1.0E-10>(N-G)*(I-H)-(S-H)*(J-G))x=!1;else{for(E=0;E<A;E++)if(!(E==w||E==y||E==z)){var K=x[C[E]].x,W=x[C[E]].y,D=void 0,M=void 0,U=void 0,V=void 0,R=void 0,o=void 0,pa=void 0,T=void 0,la=void 0,aa=void 0,na=void 0,ja=void 0,D=U=R=void 0,D=J-N,M=I-S,U=G-J,V=H-I,R=N-G,o=S-H,pa=K-G,T=W-H,la=K-N,aa=W-S,na=K-J,ja=W-I,D=D*aa-M*la,R=R*T-o*pa,U=U*ja-V*na;if(D>=0&&U>=0&&R>=0){x=!1;
+break a}}x=!0}}if(x){m.push([b[k[p]],b[k[v]],b[k[u]]]);n.push([k[p],k[v],k[u]]);p=v;for(u=v+1;u<h;p++,u++)k[p]=k[u];h--;t=2*h}}if(f)return n;return m};b.Triangulate.area=c;return b})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 THREE.TorusGeometry=function(b,c,e,f,h){THREE.Geometry.call(this);this.radius=b||100;this.tube=c||40;this.segmentsR=e||8;this.segmentsT=f||6;this.arc=h||Math.PI*2;h=new THREE.Vector3;b=[];c=[];for(e=0;e<=this.segmentsR;e++)for(f=0;f<=this.segmentsT;f++){var m=f/this.segmentsT*this.arc,k=e/this.segmentsR*Math.PI*2;h.x=this.radius*Math.cos(m);h.y=this.radius*Math.sin(m);var n=new THREE.Vector3;n.x=(this.radius+this.tube*Math.cos(k))*Math.cos(m);n.y=(this.radius+this.tube*Math.cos(k))*Math.sin(m);n.z=
-this.tube*Math.sin(k);this.vertices.push(new THREE.Vertex(n));b.push(new THREE.UV(f/this.segmentsT,1-e/this.segmentsR));c.push(n.clone().subSelf(h).normalize())}for(e=1;e<=this.segmentsR;e++)for(f=1;f<=this.segmentsT;f++){var h=(this.segmentsT+1)*e+f-1,m=(this.segmentsT+1)*(e-1)+f-1,k=(this.segmentsT+1)*(e-1)+f,n=(this.segmentsT+1)*e+f,t=new THREE.Face4(h,m,k,n,[c[h],c[m],c[k],c[n]]);t.normal.addSelf(c[h]);t.normal.addSelf(c[m]);t.normal.addSelf(c[k]);t.normal.addSelf(c[n]);t.normal.normalize();this.faces.push(t);
+this.tube*Math.sin(k);this.vertices.push(new THREE.Vertex(n));b.push(new THREE.UV(f/this.segmentsT,1-e/this.segmentsR));c.push(n.clone().subSelf(h).normalize())}for(e=1;e<=this.segmentsR;e++)for(f=1;f<=this.segmentsT;f++){var h=(this.segmentsT+1)*e+f-1,m=(this.segmentsT+1)*(e-1)+f-1,k=(this.segmentsT+1)*(e-1)+f,n=(this.segmentsT+1)*e+f,p=new THREE.Face4(h,m,k,n,[c[h],c[m],c[k],c[n]]);p.normal.addSelf(c[h]);p.normal.addSelf(c[m]);p.normal.addSelf(c[k]);p.normal.addSelf(c[n]);p.normal.normalize();this.faces.push(p);
 this.faceVertexUvs[0].push([b[h].clone(),b[m].clone(),b[k].clone(),b[n].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
 THREE.TorusKnotGeometry=function(b,c,e,f,h,m,k){function n(b,c,e,f,k,h){c=e/f*b;e=Math.cos(c);return new THREE.Vector3(k*(2+e)*0.5*Math.cos(b),k*(2+e)*Math.sin(b)*0.5,h*k*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=h||2;this.q=m||3;this.heightScale=k||1;this.grid=Array(this.segmentsR);e=new THREE.Vector3;f=new THREE.Vector3;m=new THREE.Vector3;for(b=0;b<this.segmentsR;++b){this.grid[b]=Array(this.segmentsT);for(c=0;c<
-this.segmentsT;++c){var t=b/this.segmentsR*2*this.p*Math.PI,k=c/this.segmentsT*2*Math.PI,h=n(t,k,this.q,this.p,this.radius,this.heightScale),t=n(t+0.01,k,this.q,this.p,this.radius,this.heightScale);e.x=t.x-h.x;e.y=t.y-h.y;e.z=t.z-h.z;f.x=t.x+h.x;f.y=t.y+h.y;f.z=t.z+h.z;m.cross(e,f);f.cross(m,e);m.normalize();f.normalize();t=-this.tube*Math.cos(k);k=this.tube*Math.sin(k);h.x+=t*f.x+k*m.x;h.y+=t*f.y+k*m.y;h.z+=t*f.z+k*m.z;this.grid[b][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(h.x,h.y,
-h.z)))-1}}for(b=0;b<this.segmentsR;++b)for(c=0;c<this.segmentsT;++c){var f=(b+1)%this.segmentsR,m=(c+1)%this.segmentsT,h=this.grid[b][c],e=this.grid[f][c],f=this.grid[f][m],m=this.grid[b][m],k=new THREE.UV(b/this.segmentsR,c/this.segmentsT),t=new THREE.UV((b+1)/this.segmentsR,c/this.segmentsT),p=new THREE.UV((b+1)/this.segmentsR,(c+1)/this.segmentsT),v=new THREE.UV(b/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(h,e,f,m));this.faceVertexUvs[0].push([k,t,p,v])}this.computeCentroids();
+this.segmentsT;++c){var p=b/this.segmentsR*2*this.p*Math.PI,k=c/this.segmentsT*2*Math.PI,h=n(p,k,this.q,this.p,this.radius,this.heightScale),p=n(p+0.01,k,this.q,this.p,this.radius,this.heightScale);e.x=p.x-h.x;e.y=p.y-h.y;e.z=p.z-h.z;f.x=p.x+h.x;f.y=p.y+h.y;f.z=p.z+h.z;m.cross(e,f);f.cross(m,e);m.normalize();f.normalize();p=-this.tube*Math.cos(k);k=this.tube*Math.sin(k);h.x+=p*f.x+k*m.x;h.y+=p*f.y+k*m.y;h.z+=p*f.z+k*m.z;this.grid[b][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(h.x,h.y,
+h.z)))-1}}for(b=0;b<this.segmentsR;++b)for(c=0;c<this.segmentsT;++c){var f=(b+1)%this.segmentsR,m=(c+1)%this.segmentsT,h=this.grid[b][c],e=this.grid[f][c],f=this.grid[f][m],m=this.grid[b][m],k=new THREE.UV(b/this.segmentsR,c/this.segmentsT),p=new THREE.UV((b+1)/this.segmentsR,c/this.segmentsT),v=new THREE.UV((b+1)/this.segmentsR,(c+1)/this.segmentsT),u=new THREE.UV(b/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(h,e,f,m));this.faceVertexUvs[0].push([k,p,v,u])}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(){}};
 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=
 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 h(b,e,k,h,m,n){var p=document.createElement("canvas");b[e]=new THREE.Texture(p);b[e].sourceFile=k;if(h){b[e].repeat.set(h[0],h[1]);if(h[0]!=1)b[e].wrapS=THREE.RepeatWrapping;if(h[1]!=
-1)b[e].wrapT=THREE.RepeatWrapping}m&&b[e].offset.set(m[0],m[1]);if(n){h={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(h[n[0]]!==void 0)b[e].wrapS=h[n[0]];if(h[n[1]]!==void 0)b[e].wrapT=h[n[1]]}f(b[e],c+"/"+k)}function m(b){return(b[0]*255<<16)+(b[1]*255<<8)+b[2]*255}var k,n,t;n="MeshLambertMaterial";k={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:b.wireframe};b.shading&&(b.shading=="Phong"?n="MeshPhongMaterial":b.shading=="Basic"&&(n="MeshBasicMaterial"));
+1)b[e].wrapT=THREE.RepeatWrapping}m&&b[e].offset.set(m[0],m[1]);if(n){h={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(h[n[0]]!==void 0)b[e].wrapS=h[n[0]];if(h[n[1]]!==void 0)b[e].wrapT=h[n[1]]}f(b[e],c+"/"+k)}function m(b){return(b[0]*255<<16)+(b[1]*255<<8)+b[2]*255}var k,n,p;n="MeshLambertMaterial";k={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:b.wireframe};b.shading&&(b.shading=="Phong"?n="MeshPhongMaterial":b.shading=="Basic"&&(n="MeshBasicMaterial"));
 if(b.blending)if(b.blending=="Additive")k.blending=THREE.AdditiveBlending;else if(b.blending=="Subtractive")k.blending=THREE.SubtractiveBlending;else if(b.blending=="Multiply")k.blending=THREE.MultiplyBlending;if(b.transparent!==void 0||b.opacity<1)k.transparent=b.transparent;if(b.depthTest!==void 0)k.depthTest=b.depthTest;if(b.vertexColors!==void 0)if(b.vertexColors=="face")k.vertexColors=THREE.FaceColors;else if(b.vertexColors)k.vertexColors=THREE.VertexColors;if(b.colorDiffuse)k.color=m(b.colorDiffuse);
 else if(b.DbgColor)k.color=b.DbgColor;if(b.colorSpecular)k.specular=m(b.colorSpecular);if(b.colorAmbient)k.ambient=m(b.colorAmbient);if(b.transparency)k.opacity=b.transparency;if(b.specularCoef)k.shininess=b.specularCoef;b.mapDiffuse&&c&&h(k,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap);b.mapLight&&c&&h(k,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap);b.mapNormal&&c&&h(k,"normalMap",b.mapNormal,b.mapNormalRepeat,b.mapNormalOffset,b.mapNormalWrap);
-b.mapSpecular&&c&&h(k,"specularMap",b.mapSpecular,b.mapSpecularRepeat,b.mapSpecularOffset,b.mapSpecularWrap);if(b.mapNormal){var p=THREE.ShaderUtils.lib.normal,v=THREE.UniformsUtils.clone(p.uniforms),u=k.color;n=k.specular;t=k.ambient;var x=k.shininess;v.tNormal.texture=k.normalMap;if(b.mapNormalFactor)v.uNormalScale.value=b.mapNormalFactor;if(k.map)v.tDiffuse.texture=k.map,v.enableDiffuse.value=!0;if(k.specularMap)v.tSpecular.texture=k.specularMap,v.enableSpecular.value=!0;if(k.lightMap)v.tAO.texture=
-k.lightMap,v.enableAO.value=!0;v.uDiffuseColor.value.setHex(u);v.uSpecularColor.value.setHex(n);v.uAmbientColor.value.setHex(t);v.uShininess.value=x;if(k.opacity)v.uOpacity.value=k.opacity;k=new THREE.MeshShaderMaterial({fragmentShader:p.fragmentShader,vertexShader:p.vertexShader,uniforms:v,lights:!0,fog:!0})}else k=new THREE[n](k);return k},constructor:THREE.Loader};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;
+b.mapSpecular&&c&&h(k,"specularMap",b.mapSpecular,b.mapSpecularRepeat,b.mapSpecularOffset,b.mapSpecularWrap);if(b.mapNormal){var v=THREE.ShaderUtils.lib.normal,u=THREE.UniformsUtils.clone(v.uniforms),t=k.color;n=k.specular;p=k.ambient;var x=k.shininess;u.tNormal.texture=k.normalMap;if(b.mapNormalFactor)u.uNormalScale.value=b.mapNormalFactor;if(k.map)u.tDiffuse.texture=k.map,u.enableDiffuse.value=!0;if(k.specularMap)u.tSpecular.texture=k.specularMap,u.enableSpecular.value=!0;if(k.lightMap)u.tAO.texture=
+k.lightMap,u.enableAO.value=!0;u.uDiffuseColor.value.setHex(t);u.uSpecularColor.value.setHex(n);u.uAmbientColor.value.setHex(p);u.uShininess.value=x;if(k.opacity)u.uOpacity.value=k.opacity;k=new THREE.MeshShaderMaterial({fragmentShader:v.fragmentShader,vertexShader:v.vertexShader,uniforms:u,lights:!0,fog:!0})}else k=new THREE[n](k);return k},constructor:THREE.Loader};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),h=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(c),b=(new Date).getTime(),c=new Worker(c),m=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,e,h,f,m)};c.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};
 c.postMessage(b)};
-THREE.BinaryLoader.prototype.loadAjaxBuffers=function(b,c,e,f,h,m){var k=new XMLHttpRequest,n=f+"/"+b,t=0;k.onreadystatechange=function(){k.readyState==4?k.status==200||k.status==0?THREE.BinaryLoader.prototype.createBinModel(k.responseText,e,h,c):alert("Couldn't load ["+n+"] ["+k.status+"]"):k.readyState==3?m&&(t==0&&(t=k.getResponseHeader("Content-Length")),m({total:t,loaded:k.responseText.length})):k.readyState==2&&(t=k.getResponseHeader("Content-Length"))};k.open("GET",n,!0);k.overrideMimeType("text/plain; charset=x-user-defined");
+THREE.BinaryLoader.prototype.loadAjaxBuffers=function(b,c,e,f,h,m){var k=new XMLHttpRequest,n=f+"/"+b,p=0;k.onreadystatechange=function(){k.readyState==4?k.status==200||k.status==0?THREE.BinaryLoader.prototype.createBinModel(k.responseText,e,h,c):alert("Couldn't load ["+n+"] ["+k.status+"]"):k.readyState==3?m&&(p==0&&(p=k.getResponseHeader("Content-Length")),m({total:p,loaded:k.responseText.length})):k.readyState==2&&(p=k.getResponseHeader("Content-Length"))};k.open("GET",n,!0);k.overrideMimeType("text/plain; charset=x-user-defined");
 k.setRequestHeader("Content-Type","text/plain");k.send(null)};
-THREE.BinaryLoader.prototype.createBinModel=function(b,c,e,f){var h=function(c){function e(b,c){var f=v(b,c),k=v(b,c+1),h=v(b,c+2),m=v(b,c+3),n=(m<<1&255|h>>7)-127;f|=(h&127)<<16|k<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,c){var e=v(b,c),f=v(b,c+1),k=v(b,c+2);return(v(b,c+3)<<24)+(k<<16)+(f<<8)+e}function t(b,c){var e=v(b,c);return(v(b,c+1)<<8)+e}function p(b,c){var e=v(b,c);return e>127?e-256:e}function v(b,c){return b.charCodeAt(c)&255}function u(c){var e,
-f,k;e=h(b,c);f=h(b,c+S);k=h(b,c+J);c=t(b,c+I);C.faces.push(new THREE.Face3(e,f,k,null,null,C.materials[c]))}function x(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+S);k=h(b,c+J);m=t(b,c+I);o=h(b,c+K);p=h(b,c+W);c=h(b,c+D);m=C.materials[m];var u=H[p*3],v=H[p*3+1];p=H[p*3+2];var w=H[c*3],L=H[c*3+1],c=H[c*3+2];C.faces.push(new THREE.Face3(e,f,k,[new THREE.Vector3(H[o*3],H[o*3+1],H[o*3+2]),new THREE.Vector3(u,v,p),new THREE.Vector3(w,L,c)],null,m))}function w(c){var e,f,k,m;e=h(b,c);f=h(b,c+M);k=h(b,c+U);m=h(b,
-c+V);c=t(b,c+R);C.faces.push(new THREE.Face4(e,f,k,m,null,null,C.materials[c]))}function y(c){var e,f,k,m,p,u,v,w;e=h(b,c);f=h(b,c+M);k=h(b,c+U);m=h(b,c+V);p=t(b,c+R);u=h(b,c+o);v=h(b,c+pa);w=h(b,c+T);c=h(b,c+la);p=C.materials[p];var x=H[v*3],L=H[v*3+1];v=H[v*3+2];var P=H[w*3],ea=H[w*3+1];w=H[w*3+2];var y=H[c*3],z=H[c*3+1],c=H[c*3+2];C.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(H[u*3],H[u*3+1],H[u*3+2]),new THREE.Vector3(x,L,v),new THREE.Vector3(P,ea,w),new THREE.Vector3(y,z,c)],null,p))}
-function z(c){var e,f,k,m;e=h(b,c);f=h(b,c+aa);k=h(b,c+na);c=O[e*2];m=O[e*2+1];e=O[f*2];var o=C.faceVertexUvs[0];f=O[f*2+1];var p=O[k*2];k=O[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,k));o.push(t)}function A(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+ja);k=h(b,c+ka);m=h(b,c+da);c=O[e*2];o=O[e*2+1];e=O[f*2];p=O[f*2+1];f=O[k*2];var t=C.faceVertexUvs[0];k=O[k*2+1];var u=O[m*2];m=O[m*2+1];var v=[];v.push(new THREE.UV(c,o));v.push(new THREE.UV(e,p));v.push(new THREE.UV(f,
-k));v.push(new THREE.UV(u,m));t.push(v)}var C=this,E=0,G,H=[],O=[],S,J,I,K,W,D,M,U,V,R,o,pa,T,la,aa,na,ja,ka,da,Z,fa,Y,ma,ia,sa;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(C,f,c);G={signature:b.substr(E,8),header_bytes:v(b,E+8),vertex_coordinate_bytes:v(b,E+9),normal_coordinate_bytes:v(b,E+10),uv_coordinate_bytes:v(b,E+11),vertex_index_bytes:v(b,E+12),normal_index_bytes:v(b,E+13),uv_index_bytes:v(b,E+14),material_index_bytes:v(b,E+15),nvertices:h(b,E+16),nnormals:h(b,E+16+4),nuvs:h(b,
+THREE.BinaryLoader.prototype.createBinModel=function(b,c,e,f){var h=function(c){function e(b,c){var f=u(b,c),h=u(b,c+1),k=u(b,c+2),m=u(b,c+3),n=(m<<1&255|k>>7)-127;f|=(k&127)<<16|h<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,c){var e=u(b,c),f=u(b,c+1),k=u(b,c+2);return(u(b,c+3)<<24)+(k<<16)+(f<<8)+e}function p(b,c){var e=u(b,c);return(u(b,c+1)<<8)+e}function v(b,c){var e=u(b,c);return e>127?e-256:e}function u(b,c){return b.charCodeAt(c)&255}function t(c){var e,
+f,k;e=h(b,c);f=h(b,c+S);k=h(b,c+J);c=p(b,c+I);C.faces.push(new THREE.Face3(e,f,k,null,null,C.materials[c]))}function x(c){var e,f,k,m,o,t;e=h(b,c);f=h(b,c+S);k=h(b,c+J);m=p(b,c+I);o=h(b,c+K);t=h(b,c+W);c=h(b,c+D);m=C.materials[m];var v=H[t*3],u=H[t*3+1];t=H[t*3+2];var w=H[c*3],L=H[c*3+1],c=H[c*3+2];C.faces.push(new THREE.Face3(e,f,k,[new THREE.Vector3(H[o*3],H[o*3+1],H[o*3+2]),new THREE.Vector3(v,u,t),new THREE.Vector3(w,L,c)],null,m))}function w(c){var e,f,k,m;e=h(b,c);f=h(b,c+M);k=h(b,c+U);m=h(b,
+c+V);c=p(b,c+R);C.faces.push(new THREE.Face4(e,f,k,m,null,null,C.materials[c]))}function y(c){var e,f,k,m,t,v,u,w;e=h(b,c);f=h(b,c+M);k=h(b,c+U);m=h(b,c+V);t=p(b,c+R);v=h(b,c+o);u=h(b,c+pa);w=h(b,c+T);c=h(b,c+la);t=C.materials[t];var x=H[u*3],L=H[u*3+1];u=H[u*3+2];var P=H[w*3],fa=H[w*3+1];w=H[w*3+2];var y=H[c*3],z=H[c*3+1],c=H[c*3+2];C.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(H[v*3],H[v*3+1],H[v*3+2]),new THREE.Vector3(x,L,u),new THREE.Vector3(P,fa,w),new THREE.Vector3(y,z,c)],null,t))}
+function z(c){var e,f,k,m;e=h(b,c);f=h(b,c+aa);k=h(b,c+na);c=N[e*2];m=N[e*2+1];e=N[f*2];var o=C.faceVertexUvs[0];f=N[f*2+1];var p=N[k*2];k=N[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,k));o.push(t)}function A(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+ja);k=h(b,c+ka);m=h(b,c+ea);c=N[e*2];o=N[e*2+1];e=N[f*2];p=N[f*2+1];f=N[k*2];var t=C.faceVertexUvs[0];k=N[k*2+1];var v=N[m*2];m=N[m*2+1];var u=[];u.push(new THREE.UV(c,o));u.push(new THREE.UV(e,p));u.push(new THREE.UV(f,
+k));u.push(new THREE.UV(v,m));t.push(u)}var C=this,E=0,G,H=[],N=[],S,J,I,K,W,D,M,U,V,R,o,pa,T,la,aa,na,ja,ka,ea,Z,ga,Y,ma,ia,sa;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(C,f,c);G={signature:b.substr(E,8),header_bytes:u(b,E+8),vertex_coordinate_bytes:u(b,E+9),normal_coordinate_bytes:u(b,E+10),uv_coordinate_bytes:u(b,E+11),vertex_index_bytes:u(b,E+12),normal_index_bytes:u(b,E+13),uv_index_bytes:u(b,E+14),material_index_bytes:u(b,E+15),nvertices:h(b,E+16),nnormals:h(b,E+16+4),nuvs:h(b,
 E+16+8),ntri_flat:h(b,E+16+12),ntri_smooth:h(b,E+16+16),ntri_flat_uv:h(b,E+16+20),ntri_smooth_uv:h(b,E+16+24),nquad_flat:h(b,E+16+28),nquad_smooth:h(b,E+16+32),nquad_flat_uv:h(b,E+16+36),nquad_smooth_uv:h(b,E+16+40)};E+=G.header_bytes;S=G.vertex_index_bytes;J=G.vertex_index_bytes*2;I=G.vertex_index_bytes*3;K=G.vertex_index_bytes*3+G.material_index_bytes;W=G.vertex_index_bytes*3+G.material_index_bytes+G.normal_index_bytes;D=G.vertex_index_bytes*3+G.material_index_bytes+G.normal_index_bytes*2;M=G.vertex_index_bytes;
-U=G.vertex_index_bytes*2;V=G.vertex_index_bytes*3;R=G.vertex_index_bytes*4;o=G.vertex_index_bytes*4+G.material_index_bytes;pa=G.vertex_index_bytes*4+G.material_index_bytes+G.normal_index_bytes;T=G.vertex_index_bytes*4+G.material_index_bytes+G.normal_index_bytes*2;la=G.vertex_index_bytes*4+G.material_index_bytes+G.normal_index_bytes*3;aa=G.uv_index_bytes;na=G.uv_index_bytes*2;ja=G.uv_index_bytes;ka=G.uv_index_bytes*2;da=G.uv_index_bytes*3;c=G.vertex_index_bytes*3+G.material_index_bytes;sa=G.vertex_index_bytes*
-4+G.material_index_bytes;Z=G.ntri_flat*c;fa=G.ntri_smooth*(c+G.normal_index_bytes*3);Y=G.ntri_flat_uv*(c+G.uv_index_bytes*3);ma=G.ntri_smooth_uv*(c+G.normal_index_bytes*3+G.uv_index_bytes*3);ia=G.nquad_flat*sa;c=G.nquad_smooth*(sa+G.normal_index_bytes*4);sa=G.nquad_flat_uv*(sa+G.uv_index_bytes*4);E+=function(c){for(var f,h,m,n=G.vertex_coordinate_bytes*3,o=c+G.nvertices*n;c<o;c+=n)f=e(b,c),h=e(b,c+G.vertex_coordinate_bytes),m=e(b,c+G.vertex_coordinate_bytes*2),C.vertices.push(new THREE.Vertex(new THREE.Vector3(f,
-h,m)));return G.nvertices*n}(E);E+=function(c){for(var e,f,k,h=G.normal_coordinate_bytes*3,m=c+G.nnormals*h;c<m;c+=h)e=p(b,c),f=p(b,c+G.normal_coordinate_bytes),k=p(b,c+G.normal_coordinate_bytes*2),H.push(e/127,f/127,k/127);return G.nnormals*h}(E);E+=function(c){for(var f,h,m=G.uv_coordinate_bytes*2,n=c+G.nuvs*m;c<n;c+=m)f=e(b,c),h=e(b,c+G.uv_coordinate_bytes),O.push(f,h);return G.nuvs*m}(E);Z=E+Z;fa=Z+fa;Y=fa+Y;ma=Y+ma;ia=ma+ia;c=ia+c;sa=c+sa;(function(b){var c,e=G.vertex_index_bytes*3+G.material_index_bytes,
-f=e+G.uv_index_bytes*3,k=b+G.ntri_flat_uv*f;for(c=b;c<k;c+=f)u(c),z(c+e);return k-b})(fa);(function(b){var c,e=G.vertex_index_bytes*3+G.material_index_bytes+G.normal_index_bytes*3,f=e+G.uv_index_bytes*3,k=b+G.ntri_smooth_uv*f;for(c=b;c<k;c+=f)x(c),z(c+e);return k-b})(Y);(function(b){var c,e=G.vertex_index_bytes*4+G.material_index_bytes,f=e+G.uv_index_bytes*4,k=b+G.nquad_flat_uv*f;for(c=b;c<k;c+=f)w(c),A(c+e);return k-b})(c);(function(b){var c,e=G.vertex_index_bytes*4+G.material_index_bytes+G.normal_index_bytes*
-4,f=e+G.uv_index_bytes*4,k=b+G.nquad_smooth_uv*f;for(c=b;c<k;c+=f)y(c),A(c+e);return k-b})(sa);(function(b){var c,e=G.vertex_index_bytes*3+G.material_index_bytes,f=b+G.ntri_flat*e;for(c=b;c<f;c+=e)u(c);return f-b})(E);(function(b){var c,e=G.vertex_index_bytes*3+G.material_index_bytes+G.normal_index_bytes*3,f=b+G.ntri_smooth*e;for(c=b;c<f;c+=e)x(c);return f-b})(Z);(function(b){var c,e=G.vertex_index_bytes*4+G.material_index_bytes,f=b+G.nquad_flat*e;for(c=b;c<f;c+=e)w(c);return f-b})(ma);(function(b){var c,
+U=G.vertex_index_bytes*2;V=G.vertex_index_bytes*3;R=G.vertex_index_bytes*4;o=G.vertex_index_bytes*4+G.material_index_bytes;pa=G.vertex_index_bytes*4+G.material_index_bytes+G.normal_index_bytes;T=G.vertex_index_bytes*4+G.material_index_bytes+G.normal_index_bytes*2;la=G.vertex_index_bytes*4+G.material_index_bytes+G.normal_index_bytes*3;aa=G.uv_index_bytes;na=G.uv_index_bytes*2;ja=G.uv_index_bytes;ka=G.uv_index_bytes*2;ea=G.uv_index_bytes*3;c=G.vertex_index_bytes*3+G.material_index_bytes;sa=G.vertex_index_bytes*
+4+G.material_index_bytes;Z=G.ntri_flat*c;ga=G.ntri_smooth*(c+G.normal_index_bytes*3);Y=G.ntri_flat_uv*(c+G.uv_index_bytes*3);ma=G.ntri_smooth_uv*(c+G.normal_index_bytes*3+G.uv_index_bytes*3);ia=G.nquad_flat*sa;c=G.nquad_smooth*(sa+G.normal_index_bytes*4);sa=G.nquad_flat_uv*(sa+G.uv_index_bytes*4);E+=function(c){for(var f,h,m,n=G.vertex_coordinate_bytes*3,o=c+G.nvertices*n;c<o;c+=n)f=e(b,c),h=e(b,c+G.vertex_coordinate_bytes),m=e(b,c+G.vertex_coordinate_bytes*2),C.vertices.push(new THREE.Vertex(new THREE.Vector3(f,
+h,m)));return G.nvertices*n}(E);E+=function(c){for(var e,f,h,k=G.normal_coordinate_bytes*3,m=c+G.nnormals*k;c<m;c+=k)e=v(b,c),f=v(b,c+G.normal_coordinate_bytes),h=v(b,c+G.normal_coordinate_bytes*2),H.push(e/127,f/127,h/127);return G.nnormals*k}(E);E+=function(c){for(var f,h,m=G.uv_coordinate_bytes*2,n=c+G.nuvs*m;c<n;c+=m)f=e(b,c),h=e(b,c+G.uv_coordinate_bytes),N.push(f,h);return G.nuvs*m}(E);Z=E+Z;ga=Z+ga;Y=ga+Y;ma=Y+ma;ia=ma+ia;c=ia+c;sa=c+sa;(function(b){var c,e=G.vertex_index_bytes*3+G.material_index_bytes,
+f=e+G.uv_index_bytes*3,h=b+G.ntri_flat_uv*f;for(c=b;c<h;c+=f)t(c),z(c+e);return h-b})(ga);(function(b){var c,e=G.vertex_index_bytes*3+G.material_index_bytes+G.normal_index_bytes*3,f=e+G.uv_index_bytes*3,h=b+G.ntri_smooth_uv*f;for(c=b;c<h;c+=f)x(c),z(c+e);return h-b})(Y);(function(b){var c,e=G.vertex_index_bytes*4+G.material_index_bytes,f=e+G.uv_index_bytes*4,h=b+G.nquad_flat_uv*f;for(c=b;c<h;c+=f)w(c),A(c+e);return h-b})(c);(function(b){var c,e=G.vertex_index_bytes*4+G.material_index_bytes+G.normal_index_bytes*
+4,f=e+G.uv_index_bytes*4,h=b+G.nquad_smooth_uv*f;for(c=b;c<h;c+=f)y(c),A(c+e);return h-b})(sa);(function(b){var c,e=G.vertex_index_bytes*3+G.material_index_bytes,f=b+G.ntri_flat*e;for(c=b;c<f;c+=e)t(c);return f-b})(E);(function(b){var c,e=G.vertex_index_bytes*3+G.material_index_bytes+G.normal_index_bytes*3,f=b+G.ntri_smooth*e;for(c=b;c<f;c+=e)x(c);return f-b})(Z);(function(b){var c,e=G.vertex_index_bytes*4+G.material_index_bytes,f=b+G.nquad_flat*e;for(c=b;c<f;c+=e)w(c);return f-b})(ma);(function(b){var c,
 e=G.vertex_index_bytes*4+G.material_index_bytes+G.normal_index_bytes*4,f=b+G.nquad_smooth*e;for(c=b;c<f;c+=e)y(c);return f-b})(ia);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};h.prototype=new THREE.Geometry;h.prototype.constructor=h;c(new h(e))};
-var ColladaLoader=function(){function b(b,c,e){for(var b=Z.evaluate(b,Z,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),f={},k=b.iterateNext(),h=0;k;){k=(new c).parse(k);if(k.id.length==0)k.id=e+h++;f[k.id]=k;k=b.iterateNext()}return f}function c(){var b=1E6,c=-b,e=0,f;for(f in sa)for(var k=sa[f],h=0;h<k.sampler.length;h++){var m=k.sampler[h];m.create();b=Math.min(b,m.startTime);c=Math.max(c,m.endTime);e=Math.max(e,m.input.length)}return{start:b,end:c,frames:e}}function e(b,c,f,k){b.world=b.world||
-new THREE.Matrix4;b.world.copy(b.matrix);if(b.channels&&b.channels.length){var h=b.channels[0].sampler.output[f];h instanceof THREE.Matrix4&&b.world.copy(h)}k&&b.world.multiply(k,b.world);c.push(b);for(k=0;k<b.nodes.length;k++)e(b.nodes[k],c,f,b.world)}function f(b,f,k){var h=N[f.url];if(!h||!h.skin)console.log("could not find skin controller!");else if(!f.skeleton||!f.skeleton.length)console.log("could not find the skeleton for the skin!");else{var m=c(),f=Y.getChildById(f.skeleton[0],!0)||Y.getChildBySid(f.skeleton[0],
-!0),n,o,p,t,u=new THREE.Vector3,v;for(n=0;n<b.vertices.length;n++)h.skin.bindShapeMatrix.multiplyVector3(b.vertices[n].position);for(k=0;k<m.frames;k++){var w=[],x=[];for(n=0;n<b.vertices.length;n++)x.push(new THREE.Vertex(new THREE.Vector3));e(f,w,k);n=w;o=h.skin;for(t=0;t<n.length;t++){p=n[t];v=-1;for(var y=0;y<o.joints.length;y++)if(p.sid==o.joints[y]){v=y;break}if(v>=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];
-for(y=0;y<o.weights.length;y++)for(var z=0;z<o.weights[y].length;z++){var A=o.weights[y][z];A.joint==v&&p.weights.push(A)}}else throw"could not find joint!";}for(n=0;n<w.length;n++)for(o=0;o<w[n].weights.length;o++)p=w[n].weights[o],t=p.index,p=p.weight,v=b.vertices[t],t=x[t],u.x=v.position.x,u.y=v.position.y,u.z=v.position.z,w[n].skinningMatrix.multiplyVector3(u),t.position.x+=u.x*p,t.position.y+=u.y*p,t.position.z+=u.z*p;b.morphTargets.push({name:"target_"+k,vertices:x})}}}function h(b){var c=new THREE.Object3D,
-e,k,m;c.name=b.id||"";c.matrixAutoUpdate=!1;c.matrix=b.matrix;for(m=0;m<b.controllers.length;m++){var n=N[b.controllers[m].url];switch(n.type){case "skin":if(ca[n.skin.source]){var o=new y;o.url=n.skin.source;o.instance_material=b.controllers[m].instance_material;b.geometries.push(o);e=b.controllers[m]}else if(N[n.skin.source]&&(k=n=N[n.skin.source],n.morph&&ca[n.morph.source]))o=new y,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o);break;case "morph":if(ca[n.morph.source])o=
-new y,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o),k=b.controllers[m];console.log("DAE: morph-controller partially supported.")}}for(m=0;m<b.geometries.length;m++){var n=b.geometries[m],o=n.instance_material,n=ca[n.url],p={},t=0,u;if(n&&n.mesh&&n.mesh.primitives){if(c.name.length==0)c.name=n.id;if(o)for(j=0;j<o.length;j++){u=o[j];var v=ta[ua[u.target].instance_effect.url].shader;v.material.opacity=!v.material.opacity?1:v.material.opacity;u=p[u.symbol]=
-v.material;t++}o=u||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});n=n.mesh.geometry3js;if(t>1){o=new THREE.MeshFaceMaterial;for(j=0;j<n.faces.length;j++)t=n.faces[j],t.materials=[p[t.daeMaterial]]}if(e!==void 0)f(n,e),o.morphTargets=!0,o=new THREE.SkinnedMesh(n,o),o.skeleton=e.skeleton,o.skinController=N[e.url],o.skinInstanceController=e,o.name="skin_"+Aa.length,Aa.push(o);else if(k!==void 0){p=n;t=k instanceof x?N[k.url]:k;if(!t||!t.morph)console.log("could not find morph controller!");
-else{t=t.morph;for(v=0;v<t.targets.length;v++){var w=ca[t.targets[v]];if(w.mesh&&w.mesh.primitives&&w.mesh.primitives.length)w=w.mesh.primitives[0].geometry,w.vertices.length===p.vertices.length&&p.morphTargets.push({name:"target_1",vertices:w.vertices})}p.morphTargets.push({name:"target_Z",vertices:p.vertices})}o.morphTargets=!0;o=new THREE.Mesh(n,o);o.name="morph_"+za.length;za.push(o)}else o=new THREE.Mesh(n,o);c.addChild(o)}}for(m=0;m<b.nodes.length;m++)c.addChild(h(b.nodes[m],b));return c}function m(){this.init_from=
-this.id=""}function k(){this.type=this.name=this.id="";this.morph=this.skin=null}function n(){this.weights=this.targets=this.source=this.method=null}function t(){this.source="";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function p(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function v(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=[];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function u(){this.type=
+var ColladaLoader=function(){function b(b,c,e){for(var b=Z.evaluate(b,Z,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),f={},h=b.iterateNext(),k=0;h;){h=(new c).parse(h);if(h.id.length==0)h.id=e+k++;f[h.id]=h;h=b.iterateNext()}return f}function c(){var b=1E6,c=-b,e=0,f;for(f in sa)for(var h=sa[f],k=0;k<h.sampler.length;k++){var m=h.sampler[k];m.create();b=Math.min(b,m.startTime);c=Math.max(c,m.endTime);e=Math.max(e,m.input.length)}return{start:b,end:c,frames:e}}function e(b,c,f,h){b.world=b.world||
+new THREE.Matrix4;b.world.copy(b.matrix);if(b.channels&&b.channels.length){var k=b.channels[0].sampler.output[f];k instanceof THREE.Matrix4&&b.world.copy(k)}h&&b.world.multiply(h,b.world);c.push(b);for(h=0;h<b.nodes.length;h++)e(b.nodes[h],c,f,b.world)}function f(b,f,h){var k=O[f.url];if(!k||!k.skin)console.log("could not find skin controller!");else if(!f.skeleton||!f.skeleton.length)console.log("could not find the skeleton for the skin!");else{var m=c(),f=Y.getChildById(f.skeleton[0],!0)||Y.getChildBySid(f.skeleton[0],
+!0),n,o,p,t,v=new THREE.Vector3,u;for(n=0;n<b.vertices.length;n++)k.skin.bindShapeMatrix.multiplyVector3(b.vertices[n].position);for(h=0;h<m.frames;h++){var w=[],x=[];for(n=0;n<b.vertices.length;n++)x.push(new THREE.Vertex(new THREE.Vector3));e(f,w,h);n=w;o=k.skin;for(t=0;t<n.length;t++){p=n[t];u=-1;for(var y=0;y<o.joints.length;y++)if(p.sid==o.joints[y]){u=y;break}if(u>=0){y=o.invBindMatrices[u];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];
+for(y=0;y<o.weights.length;y++)for(var z=0;z<o.weights[y].length;z++){var A=o.weights[y][z];A.joint==u&&p.weights.push(A)}}else throw"could not find joint!";}for(n=0;n<w.length;n++)for(o=0;o<w[n].weights.length;o++)p=w[n].weights[o],t=p.index,p=p.weight,u=b.vertices[t],t=x[t],v.x=u.position.x,v.y=u.position.y,v.z=u.position.z,w[n].skinningMatrix.multiplyVector3(v),t.position.x+=v.x*p,t.position.y+=v.y*p,t.position.z+=v.z*p;b.morphTargets.push({name:"target_"+h,vertices:x})}}}function h(b){var c=new THREE.Object3D,
+e,k,m;c.name=b.id||"";c.matrixAutoUpdate=!1;c.matrix=b.matrix;for(m=0;m<b.controllers.length;m++){var n=O[b.controllers[m].url];switch(n.type){case "skin":if(da[n.skin.source]){var o=new y;o.url=n.skin.source;o.instance_material=b.controllers[m].instance_material;b.geometries.push(o);e=b.controllers[m]}else if(O[n.skin.source]&&(k=n=O[n.skin.source],n.morph&&da[n.morph.source]))o=new y,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o);break;case "morph":if(da[n.morph.source])o=
+new y,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o),k=b.controllers[m];console.log("DAE: morph-controller partially supported.")}}for(m=0;m<b.geometries.length;m++){var n=b.geometries[m],o=n.instance_material,n=da[n.url],p={},t=0,v;if(n&&n.mesh&&n.mesh.primitives){if(c.name.length==0)c.name=n.id;if(o)for(j=0;j<o.length;j++){v=o[j];var u=ta[ua[v.target].instance_effect.url].shader;u.material.opacity=!u.material.opacity?1:u.material.opacity;v=p[v.symbol]=
+u.material;t++}o=v||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});n=n.mesh.geometry3js;if(t>1){o=new THREE.MeshFaceMaterial;for(j=0;j<n.faces.length;j++)t=n.faces[j],t.materials=[p[t.daeMaterial]]}if(e!==void 0)f(n,e),o.morphTargets=!0,o=new THREE.SkinnedMesh(n,o),o.skeleton=e.skeleton,o.skinController=O[e.url],o.skinInstanceController=e,o.name="skin_"+Aa.length,Aa.push(o);else if(k!==void 0){p=n;t=k instanceof x?O[k.url]:k;if(!t||!t.morph)console.log("could not find morph controller!");
+else{t=t.morph;for(u=0;u<t.targets.length;u++){var w=da[t.targets[u]];if(w.mesh&&w.mesh.primitives&&w.mesh.primitives.length)w=w.mesh.primitives[0].geometry,w.vertices.length===p.vertices.length&&p.morphTargets.push({name:"target_1",vertices:w.vertices})}p.morphTargets.push({name:"target_Z",vertices:p.vertices})}o.morphTargets=!0;o=new THREE.Mesh(n,o);o.name="morph_"+za.length;za.push(o)}else o=new THREE.Mesh(n,o);c.addChild(o)}}for(m=0;m<b.nodes.length;m++)c.addChild(h(b.nodes[m],b));return c}function m(){this.init_from=
+this.id=""}function k(){this.type=this.name=this.id="";this.morph=this.skin=null}function n(){this.weights=this.targets=this.source=this.method=null}function p(){this.source="";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function v(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function u(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=[];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function t(){this.type=
 this.sid="";this.data=[];this.matrix=new THREE.Matrix4}function x(){this.url="";this.skeleton=[];this.instance_material=[]}function w(){this.target=this.symbol=""}function y(){this.url="";this.instance_material=[]}function z(){this.id="";this.mesh=null}function A(b){this.geometry=b.id;this.primitives=[];this.geometry3js=this.vertices=null}function C(){}function E(){this.material="";this.count=0;this.inputs=[];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function G(){this.source="";
-this.stride=this.count=0;this.params=[]}function H(){this.input={}}function O(){this.semantic="";this.offset=0;this.source="";this.set=0}function S(b){this.id=b;this.type=null}function J(){this.name=this.id="";this.instance_effect=null}function I(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texcoord=this.texture=null}function K(b,c){this.type=b;this.effect=c;this.material=null}function W(b){this.effect=b;this.format=this.init_from=
+this.stride=this.count=0;this.params=[]}function H(){this.input={}}function N(){this.semantic="";this.offset=0;this.source="";this.set=0}function S(b){this.id=b;this.type=null}function J(){this.name=this.id="";this.instance_effect=null}function I(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texcoord=this.texture=null}function K(b,c){this.type=b;this.effect=c;this.material=null}function W(b){this.effect=b;this.format=this.init_from=
 null}function D(b){this.effect=b;this.mipfilter=this.magfilter=this.minfilter=this.wrap_t=this.wrap_s=this.source=null}function M(){this.name=this.id="";this.sampler=this.surface=this.shader=null}function U(){this.url=""}function V(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function R(b){this.animation=b;this.target=this.source="";this.member=this.arrIndices=this.arrSyntax=this.dotSyntax=this.sid=null}function o(b){this.id="";this.animation=b;this.inputs=[];this.endTime=
 this.startTime=this.interpolation=this.output=this.input=null;this.duration=0}function pa(b){var c=b.getAttribute("id");if(ma[c]!=void 0)return ma[c];ma[c]=(new S(c)).parse(b);return ma[c]}function T(b){if(b=="dae")return"http://www.collada.org/2005/11/COLLADASchema";return null}function la(b){for(var b=na(b),c=[],e=0;e<b.length;e++)c.push(parseFloat(b[e]));return c}function aa(b){for(var b=na(b),c=[],e=0;e<b.length;e++)c.push(parseInt(b[e],10));return c}function na(b){return b.replace(/^\s+/,"").replace(/\s+$/,
-"").split(/\s+/)}function ja(b,c,e){return b.hasAttribute(c)?parseInt(b.getAttribute(c),10):e}function ka(b,c){if(b===void 0){for(var e="0.";e.length<c+2;)e+="0";return e}c=c||2;e=b.toString().split(".");for(e[1]=e.length>1?e[1].substr(0,c):"0";e[1].length<c;)e[1]+="0";return e.join(".")}function da(b,c){var e="";e+=ka(b.x,c)+",";e+=ka(b.y,c)+",";e+=ka(b.z,c);return e}var Z=null,fa=null,Y,ma={},ia={},sa={},N={},ca={},ua={},ta={},ra,wa=null,Ca,za,Aa,Ea=THREE.SmoothShading;m.prototype.parse=function(b){this.id=
-b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="init_from")this.init_from=e.textContent}return this};k.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.type="none";for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "skin":this.skin=(new t).parse(e);this.type=e.nodeName;break;case "morph":this.morph=(new n).parse(e),this.type=e.nodeName}}return this};n.prototype.parse=function(b){var c=
-{},e=[],f;this.method=b.getAttribute("method");this.source=b.getAttribute("source").replace(/^#/,"");for(f=0;f<b.childNodes.length;f++){var k=b.childNodes[f];if(k.nodeType==1)switch(k.nodeName){case "source":k=(new S).parse(k);c[k.id]=k;break;case "targets":e=this.parseInputs(k);break;default:console.log(k.nodeName)}}for(f=0;f<e.length;f++)switch(b=e[f],k=c[b.source],b.semantic){case "MORPH_TARGET":this.targets=k.read();break;case "MORPH_WEIGHT":this.weights=k.read()}return this};n.prototype.parseInputs=
-function(b){for(var c=[],e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":c.push((new O).parse(f))}}return c};t.prototype.parse=function(b){var c={},e,f;this.source=b.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var k=0;k<b.childNodes.length;k++){var h=b.childNodes[k];if(h.nodeType==1)switch(h.nodeName){case "bind_shape_matrix":h=la(h.textContent);this.bindShapeMatrix=new THREE.Matrix4;this.bindShapeMatrix.set(h[0],
-h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],h[10],h[11],h[12],h[13],h[14],h[15]);break;case "source":h=(new S).parse(h);c[h.id]=h;break;case "joints":e=h;break;case "vertex_weights":f=h;break;default:console.log(h.nodeName)}}this.parseJoints(e,c);this.parseWeights(f,c);return this};t.prototype.parseJoints=function(b,c){for(var e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":var f=(new O).parse(f),k=c[f.source];if(f.semantic=="JOINT")this.joints=
-k.read();else if(f.semantic=="INV_BIND_MATRIX")this.invBindMatrices=k.read()}}};t.prototype.parseWeights=function(b,c){for(var e,f,k=[],h=0;h<b.childNodes.length;h++){var m=b.childNodes[h];if(m.nodeType==1)switch(m.nodeName){case "input":k.push((new O).parse(m));break;case "v":e=aa(m.textContent);break;case "vcount":f=aa(m.textContent)}}for(h=m=0;h<f.length;h++){for(var n=f[h],o=[],p=0;p<n;p++){for(var t={},u=0;u<k.length;u++){var v=k[u],w=e[m+v.offset];switch(v.semantic){case "JOINT":t.joint=w;break;
-case "WEIGHT":t.weight=c[v.source].data[w]}}o.push(t);m+=k.length}for(p=0;p<o.length;p++)o[p].index=h;this.weights.push(o)}};p.prototype.getChildById=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};p.prototype.getChildBySid=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};p.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");
-this.nodes=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "node":this.nodes.push((new v).parse(e))}}return this};v.prototype.getChannelForTransform=function(b){for(var c=0;c<this.channels.length;c++){var e=this.channels[c],f=e.target.split("/");f.shift();var k=f.shift(),h=k.indexOf(".")>=0,m=k.indexOf("(")>=0,n;if(h)f=k.split("."),k=f.shift(),f.shift();else if(m){n=k.split("(");k=n.shift();for(f=0;f<n.length;f++)n[f]=parseInt(n[f].replace(/\)/,
-""))}if(k==b)return e.info={sid:k,dotSyntax:h,arrSyntax:m,arrIndices:n},e}return null};v.prototype.getChildById=function(b,c){if(this.id==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};v.prototype.getChildBySid=function(b,c){if(this.sid==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};v.prototype.getTransformBySid=function(b){for(var c=0;c<this.transforms.length;c++)if(this.transforms[c].sid==
-b)return this.transforms[c];return null};v.prototype.parse=function(b){var c;this.id=b.getAttribute("id");this.sid=b.getAttribute("sid");this.name=b.getAttribute("name");this.type=b.getAttribute("type");this.type=this.type=="JOINT"?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var e=0;e<b.childNodes.length;e++)if(c=b.childNodes[e],c.nodeType==1)switch(c.nodeName){case "node":this.nodes.push((new v).parse(c));break;case "instance_camera":break;
-case "instance_controller":this.controllers.push((new x).parse(c));break;case "instance_geometry":this.geometries.push((new y).parse(c));break;case "instance_light":break;case "instance_node":c=c.getAttribute("url").replace(/^#/,"");(c=Z.evaluate(".//dae:library_nodes//dae:node[@id='"+c+"']",Z,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new v).parse(c));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new u).parse(c));
-break;case "extra":break;default:console.log(c.nodeName)}b=[];e=1E6;c=-1E6;for(var f in sa)for(var k=sa[f],h=0;h<k.channel.length;h++){var m=k.channel[h],n=k.sampler[h];f=m.target.split("/")[0];if(f==this.id)n.create(),m.sampler=n,e=Math.min(e,n.startTime),c=Math.max(c,n.endTime),b.push(m)}if(b.length)this.startTime=e,this.endTime=c;if((this.channels=b)&&this.channels.length){f=1E7;for(i=0;i<this.channels.length;i++){b=this.channels[i].sampler;for(e=0;e<b.input.length-1;e++)f=Math.min(f,b.input[e+
-1]-b.input[e])}e=[];for(b=this.startTime;b<this.endTime;b+=f){c=b;for(var k={},o=h=void 0,h=0;h<this.channels.length;h++)o=this.channels[h],k[o.sid]=o;m=new THREE.Matrix4;for(h=0;h<this.transforms.length;h++)if(n=this.transforms[h],o=k[n.sid],o!==void 0){for(var p=o.sampler,t,o=0;o<p.input.length-1;o++)if(p.input[o+1]>c){t=p.output[o];break}m=t!==void 0?t instanceof THREE.Matrix4?m.multiply(m,t):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,
-c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};v.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b<this.transforms.length;b++)this.matrix.multiply(this.matrix,this.transforms[b].matrix)};u.prototype.parse=function(b){this.sid=b.getAttribute("sid");this.type=b.nodeName;this.data=la(b.textContent);this.updateMatrix();return this};u.prototype.updateMatrix=function(){var b=0;this.matrix.identity();switch(this.type){case "matrix":this.matrix.set(this.data[0],
+"").split(/\s+/)}function ja(b,c,e){return b.hasAttribute(c)?parseInt(b.getAttribute(c),10):e}function ka(b,c){if(b===void 0){for(var e="0.";e.length<c+2;)e+="0";return e}c=c||2;e=b.toString().split(".");for(e[1]=e.length>1?e[1].substr(0,c):"0";e[1].length<c;)e[1]+="0";return e.join(".")}function ea(b,c){var e="";e+=ka(b.x,c)+",";e+=ka(b.y,c)+",";e+=ka(b.z,c);return e}var Z=null,ga=null,Y,ma={},ia={},sa={},O={},da={},ua={},ta={},ra,wa=null,Ca,za,Aa,Ea=THREE.SmoothShading;m.prototype.parse=function(b){this.id=
+b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="init_from")this.init_from=e.textContent}return this};k.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.type="none";for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "skin":this.skin=(new p).parse(e);this.type=e.nodeName;break;case "morph":this.morph=(new n).parse(e),this.type=e.nodeName}}return this};n.prototype.parse=function(b){var c=
+{},e=[],f;this.method=b.getAttribute("method");this.source=b.getAttribute("source").replace(/^#/,"");for(f=0;f<b.childNodes.length;f++){var h=b.childNodes[f];if(h.nodeType==1)switch(h.nodeName){case "source":h=(new S).parse(h);c[h.id]=h;break;case "targets":e=this.parseInputs(h);break;default:console.log(h.nodeName)}}for(f=0;f<e.length;f++)switch(b=e[f],h=c[b.source],b.semantic){case "MORPH_TARGET":this.targets=h.read();break;case "MORPH_WEIGHT":this.weights=h.read()}return this};n.prototype.parseInputs=
+function(b){for(var c=[],e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":c.push((new N).parse(f))}}return c};p.prototype.parse=function(b){var c={},e,f;this.source=b.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var h=0;h<b.childNodes.length;h++){var k=b.childNodes[h];if(k.nodeType==1)switch(k.nodeName){case "bind_shape_matrix":k=la(k.textContent);this.bindShapeMatrix=new THREE.Matrix4;this.bindShapeMatrix.set(k[0],
+k[1],k[2],k[3],k[4],k[5],k[6],k[7],k[8],k[9],k[10],k[11],k[12],k[13],k[14],k[15]);break;case "source":k=(new S).parse(k);c[k.id]=k;break;case "joints":e=k;break;case "vertex_weights":f=k;break;default:console.log(k.nodeName)}}this.parseJoints(e,c);this.parseWeights(f,c);return this};p.prototype.parseJoints=function(b,c){for(var e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":var f=(new N).parse(f),h=c[f.source];if(f.semantic=="JOINT")this.joints=
+h.read();else if(f.semantic=="INV_BIND_MATRIX")this.invBindMatrices=h.read()}}};p.prototype.parseWeights=function(b,c){for(var e,f,h=[],k=0;k<b.childNodes.length;k++){var m=b.childNodes[k];if(m.nodeType==1)switch(m.nodeName){case "input":h.push((new N).parse(m));break;case "v":e=aa(m.textContent);break;case "vcount":f=aa(m.textContent)}}for(k=m=0;k<f.length;k++){for(var n=f[k],o=[],p=0;p<n;p++){for(var t={},v=0;v<h.length;v++){var u=h[v],w=e[m+u.offset];switch(u.semantic){case "JOINT":t.joint=w;break;
+case "WEIGHT":t.weight=c[u.source].data[w]}}o.push(t);m+=h.length}for(p=0;p<o.length;p++)o[p].index=k;this.weights.push(o)}};v.prototype.getChildById=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};v.prototype.getChildBySid=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};v.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");
+this.nodes=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "node":this.nodes.push((new u).parse(e))}}return this};u.prototype.getChannelForTransform=function(b){for(var c=0;c<this.channels.length;c++){var e=this.channels[c],f=e.target.split("/");f.shift();var h=f.shift(),k=h.indexOf(".")>=0,m=h.indexOf("(")>=0,n;if(k)f=h.split("."),h=f.shift(),f.shift();else if(m){n=h.split("(");h=n.shift();for(f=0;f<n.length;f++)n[f]=parseInt(n[f].replace(/\)/,
+""))}if(h==b)return e.info={sid:h,dotSyntax:k,arrSyntax:m,arrIndices:n},e}return null};u.prototype.getChildById=function(b,c){if(this.id==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};u.prototype.getChildBySid=function(b,c){if(this.sid==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};u.prototype.getTransformBySid=function(b){for(var c=0;c<this.transforms.length;c++)if(this.transforms[c].sid==
+b)return this.transforms[c];return null};u.prototype.parse=function(b){var c;this.id=b.getAttribute("id");this.sid=b.getAttribute("sid");this.name=b.getAttribute("name");this.type=b.getAttribute("type");this.type=this.type=="JOINT"?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var e=0;e<b.childNodes.length;e++)if(c=b.childNodes[e],c.nodeType==1)switch(c.nodeName){case "node":this.nodes.push((new u).parse(c));break;case "instance_camera":break;
+case "instance_controller":this.controllers.push((new x).parse(c));break;case "instance_geometry":this.geometries.push((new y).parse(c));break;case "instance_light":break;case "instance_node":c=c.getAttribute("url").replace(/^#/,"");(c=Z.evaluate(".//dae:library_nodes//dae:node[@id='"+c+"']",Z,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new u).parse(c));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new t).parse(c));
+break;case "extra":break;default:console.log(c.nodeName)}b=[];e=1E6;c=-1E6;for(var f in sa)for(var h=sa[f],k=0;k<h.channel.length;k++){var m=h.channel[k],n=h.sampler[k];f=m.target.split("/")[0];if(f==this.id)n.create(),m.sampler=n,e=Math.min(e,n.startTime),c=Math.max(c,n.endTime),b.push(m)}if(b.length)this.startTime=e,this.endTime=c;if((this.channels=b)&&this.channels.length){f=1E7;for(i=0;i<this.channels.length;i++){b=this.channels[i].sampler;for(e=0;e<b.input.length-1;e++)f=Math.min(f,b.input[e+
+1]-b.input[e])}e=[];for(b=this.startTime;b<this.endTime;b+=f){c=b;for(var h={},o=k=void 0,k=0;k<this.channels.length;k++)o=this.channels[k],h[o.sid]=o;m=new THREE.Matrix4;for(k=0;k<this.transforms.length;k++)if(n=this.transforms[k],o=h[n.sid],o!==void 0){for(var p=o.sampler,v,o=0;o<p.input.length-1;o++)if(p.input[o+1]>c){v=p.output[o];break}m=v!==void 0?v instanceof THREE.Matrix4?m.multiply(m,v):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,
+c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};u.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b<this.transforms.length;b++)this.matrix.multiply(this.matrix,this.transforms[b].matrix)};t.prototype.parse=function(b){this.sid=b.getAttribute("sid");this.type=b.nodeName;this.data=la(b.textContent);this.updateMatrix();return this};t.prototype.updateMatrix=function(){var b=0;this.matrix.identity();switch(this.type){case "matrix":this.matrix.set(this.data[0],
 this.data[1],this.data[2],this.data[3],this.data[4],this.data[5],this.data[6],this.data[7],this.data[8],this.data[9],this.data[10],this.data[11],this.data[12],this.data[13],this.data[14],this.data[15]);break;case "translate":this.matrix.setTranslation(this.data[0],this.data[1],this.data[2]);break;case "rotate":b=this.data[3]*(Math.PI/180);this.matrix.setRotationAxis(new THREE.Vector3(this.data[0],this.data[1],this.data[2]),b);break;case "scale":this.matrix.setScale(this.data[0],this.data[1],this.data[2])}return this.matrix};
 x.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "skeleton":this.skeleton.push(e.textContent.replace(/^#/,""));break;case "bind_material":if(e=Z.evaluate(".//dae:instance_material",e,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(var f=e.iterateNext();f;)this.instance_material.push((new w).parse(f)),f=e.iterateNext()}}return this};
 w.prototype.parse=function(b){this.symbol=b.getAttribute("symbol");this.target=b.getAttribute("target").replace(/^#/,"");return this};y.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1&&e.nodeName=="bind_material"){if(b=Z.evaluate(".//dae:instance_material",e,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(c=b.iterateNext();c;)this.instance_material.push((new w).parse(c)),
-c=b.iterateNext();break}}return this};z.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "mesh":this.mesh=(new A(this)).parse(e)}}return this};A.prototype.parse=function(b){function c(b,e){var f=da(b.position);k[f]===void 0&&(k[f]={v:b,index:e});return k[f]}this.primitives=[];var e;for(e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];switch(f.nodeName){case "source":pa(f);break;case "vertices":this.vertices=
-(new H).parse(f);break;case "triangles":this.primitives.push((new E).parse(f));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new C).parse(f))}}var k={};this.geometry3js=new THREE.Geometry;f=ma[this.vertices.input.POSITION.source].data;for(b=e=0;e<f.length;e+=3,b++){var h=new THREE.Vertex(new THREE.Vector3(f[e],f[e+1],f[e+2]));c(h,b);this.geometry3js.vertices.push(h)}for(e=0;e<this.primitives.length;e++)primitive=this.primitives[e],primitive.setVertices(this.vertices),
-this.handlePrimitive(primitive,this.geometry3js,k);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.computeVertexNormals();this.geometry3js.computeBoundingBox();return this};A.prototype.handlePrimitive=function(b,c,e){var f=0,k,h,m=b.p,n=b.inputs,o,p,t,u=0,v=3,w=[];for(k=0;k<n.length;k++)o=n[k],o.semantic=="TEXCOORD"&&w.push(o.set);for(;f<m.length;){var x=[],y=[],z={};b.vcount&&(v=b.vcount[u++]);for(k=0;k<v;k++)for(h=0;h<n.length;h++)switch(o=n[h],source=
-ma[o.source],p=m[f+k*n.length+o.offset],numParams=source.accessor.params.length,t=p*numParams,o.semantic){case "VERTEX":o=da(c.vertices[p].position);x.push(e[o].index);break;case "NORMAL":y.push(new THREE.Vector3(source.data[t+0],source.data[t+1],source.data[t+2]));break;case "TEXCOORD":z[o.set]===void 0&&(z[o.set]=[]),z[o.set].push(new THREE.UV(source.data[t+0],source.data[t+1]))}h=new THREE.Face3(x[0],x[1],x[2],[y[0],y[1],y[2]]);h.daeMaterial=b.material;c.faces.push(h);for(h=0;h<w.length;h++)o=
-z[w[h]],c.faceVertexUvs[h].push([o[0],o[1],o[2]]);if(v>3)for(k=2;k<x.length-1;k++){h=new THREE.Face3(x[0],x[k],x[k+1],[y[0],y[k],y[k+1]]);h.daeMaterial=b.material;c.faces.push(h);for(h=0;h<w.length;h++)o=z[w[h]],c.faceVertexUvs[h].push([o[0],o[k],o[k+1]])}f+=n.length*v}};C.prototype=new E;C.prototype.constructor=C;E.prototype.setVertices=function(b){for(var c=0;c<this.inputs.length;c++)if(this.inputs[c].source==b.id)this.inputs[c].source=b.input.POSITION.source};E.prototype.parse=function(b){this.inputs=
-[];this.material=b.getAttribute("material");this.count=ja(b,"count",0);for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "input":this.inputs.push((new O).parse(b.childNodes[c]));break;case "vcount":this.vcount=aa(e.textContent);break;case "p":this.p=aa(e.textContent)}}return this};G.prototype.parse=function(b){this.params=[];this.source=b.getAttribute("source");this.count=ja(b,"count",0);this.stride=ja(b,"stride",0);for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];
-if(e.nodeName=="param"){var f={};f.name=e.getAttribute("name");f.type=e.getAttribute("type");this.params.push(f)}}return this};H.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++)b.childNodes[c].nodeName=="input"&&(input=(new O).parse(b.childNodes[c]),this.input[input.semantic]=input);return this};O.prototype.parse=function(b){this.semantic=b.getAttribute("semantic");this.source=b.getAttribute("source").replace(/^#/,"");this.set=ja(b,"set",-1);this.offset=
-ja(b,"offset",0);if(this.semantic=="TEXCOORD"&&this.set<0)this.set=0;return this};S.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "bool_array":for(var f=na(e.textContent),k=[],h=0;h<f.length;h++)k.push(f[h]=="true"||f[h]=="1"?!0:!1);this.data=k;this.type=e.nodeName;break;case "float_array":this.data=la(e.textContent);this.type=e.nodeName;break;case "int_array":this.data=aa(e.textContent);this.type=e.nodeName;
+c=b.iterateNext();break}}return this};z.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "mesh":this.mesh=(new A(this)).parse(e)}}return this};A.prototype.parse=function(b){function c(b,e){var f=ea(b.position);h[f]===void 0&&(h[f]={v:b,index:e});return h[f]}this.primitives=[];var e;for(e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];switch(f.nodeName){case "source":pa(f);break;case "vertices":this.vertices=
+(new H).parse(f);break;case "triangles":this.primitives.push((new E).parse(f));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new C).parse(f))}}var h={};this.geometry3js=new THREE.Geometry;f=ma[this.vertices.input.POSITION.source].data;for(b=e=0;e<f.length;e+=3,b++){var k=new THREE.Vertex(new THREE.Vector3(f[e],f[e+1],f[e+2]));c(k,b);this.geometry3js.vertices.push(k)}for(e=0;e<this.primitives.length;e++)primitive=this.primitives[e],primitive.setVertices(this.vertices),
+this.handlePrimitive(primitive,this.geometry3js,h);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.computeVertexNormals();this.geometry3js.computeBoundingBox();return this};A.prototype.handlePrimitive=function(b,c,e){var f=0,h,k,m=b.p,n=b.inputs,o,p,t,v=0,u=3,w=[];for(h=0;h<n.length;h++)o=n[h],o.semantic=="TEXCOORD"&&w.push(o.set);for(;f<m.length;){var x=[],y=[],z={};b.vcount&&(u=b.vcount[v++]);for(h=0;h<u;h++)for(k=0;k<n.length;k++)switch(o=n[k],source=
+ma[o.source],p=m[f+h*n.length+o.offset],numParams=source.accessor.params.length,t=p*numParams,o.semantic){case "VERTEX":o=ea(c.vertices[p].position);x.push(e[o].index);break;case "NORMAL":y.push(new THREE.Vector3(source.data[t+0],source.data[t+1],source.data[t+2]));break;case "TEXCOORD":z[o.set]===void 0&&(z[o.set]=[]),z[o.set].push(new THREE.UV(source.data[t+0],source.data[t+1]))}k=new THREE.Face3(x[0],x[1],x[2],[y[0],y[1],y[2]]);k.daeMaterial=b.material;c.faces.push(k);for(k=0;k<w.length;k++)o=
+z[w[k]],c.faceVertexUvs[k].push([o[0],o[1],o[2]]);if(u>3)for(h=2;h<x.length-1;h++){k=new THREE.Face3(x[0],x[h],x[h+1],[y[0],y[h],y[h+1]]);k.daeMaterial=b.material;c.faces.push(k);for(k=0;k<w.length;k++)o=z[w[k]],c.faceVertexUvs[k].push([o[0],o[h],o[h+1]])}f+=n.length*u}};C.prototype=new E;C.prototype.constructor=C;E.prototype.setVertices=function(b){for(var c=0;c<this.inputs.length;c++)if(this.inputs[c].source==b.id)this.inputs[c].source=b.input.POSITION.source};E.prototype.parse=function(b){this.inputs=
+[];this.material=b.getAttribute("material");this.count=ja(b,"count",0);for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "input":this.inputs.push((new N).parse(b.childNodes[c]));break;case "vcount":this.vcount=aa(e.textContent);break;case "p":this.p=aa(e.textContent)}}return this};G.prototype.parse=function(b){this.params=[];this.source=b.getAttribute("source");this.count=ja(b,"count",0);this.stride=ja(b,"stride",0);for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];
+if(e.nodeName=="param"){var f={};f.name=e.getAttribute("name");f.type=e.getAttribute("type");this.params.push(f)}}return this};H.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++)b.childNodes[c].nodeName=="input"&&(input=(new N).parse(b.childNodes[c]),this.input[input.semantic]=input);return this};N.prototype.parse=function(b){this.semantic=b.getAttribute("semantic");this.source=b.getAttribute("source").replace(/^#/,"");this.set=ja(b,"set",-1);this.offset=
+ja(b,"offset",0);if(this.semantic=="TEXCOORD"&&this.set<0)this.set=0;return this};S.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "bool_array":for(var f=na(e.textContent),h=[],k=0;k<f.length;k++)h.push(f[k]=="true"||f[k]=="1"?!0:!1);this.data=h;this.type=e.nodeName;break;case "float_array":this.data=la(e.textContent);this.type=e.nodeName;break;case "int_array":this.data=aa(e.textContent);this.type=e.nodeName;
 break;case "IDREF_array":case "Name_array":this.data=na(e.textContent);this.type=e.nodeName;break;case "technique_common":for(f=0;f<e.childNodes.length;f++)if(e.childNodes[f].nodeName=="accessor"){this.accessor=(new G).parse(e.childNodes[f]);break}}}return this};S.prototype.read=function(){var b=[],c=this.accessor.params[0];switch(c.type){case "IDREF":case "Name":case "float":return this.data;case "float4x4":for(c=0;c<this.data.length;c+=16){var e=this.data.slice(c,c+16),f=new THREE.Matrix4;f.set(e[0],
 e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]);b.push(f)}break;default:console.log("Dae::Source:read dont know how to read "+c.type)}return b};J.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");for(var c=0;c<b.childNodes.length;c++)if(b.childNodes[c].nodeName=="instance_effect"){this.instance_effect=(new U).parse(b.childNodes[c]);break}return this};I.prototype.isColor=function(){return this.texture==null};I.prototype.isTexture=
 function(){return this.texture!=null};I.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "color":e=la(e.textContent);this.color=new THREE.Color(0);this.color.setRGB(e[0],e[1],e[2]);this.color.a=e[3];break;case "texture":this.texture=e.getAttribute("texture"),this.texcoord=e.getAttribute("texcoord")}}return this};K.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==
-1)switch(e.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[e.nodeName]=(new I).parse(e);break;case "shininess":case "reflectivity":case "transparency":var f;f=Z.evaluate(".//dae:float",e,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var k=f.iterateNext(),h=[];k;)h.push(k),k=f.iterateNext();f=h;f.length>0&&(this[e.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};K.prototype.create=function(){var b={},c=this.transparency!==void 0&&
+1)switch(e.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[e.nodeName]=(new I).parse(e);break;case "shininess":case "reflectivity":case "transparency":var f;f=Z.evaluate(".//dae:float",e,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var h=f.iterateNext(),k=[];h;)k.push(h),h=f.iterateNext();f=k;f.length>0&&(this[e.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};K.prototype.create=function(){var b={},c=this.transparency!==void 0&&
 this.transparency<1,e;for(e in this)switch(e){case "ambient":case "emission":case "diffuse":case "specular":var f=this[e];if(f instanceof I)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=ia[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ca+f.init_from),b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else e=="diffuse"?b.color=f.color.getHex():c||(b[e]=f.color.getHex());
 break;case "shininess":case "reflectivity":b[e]=this[e];break;case "transparency":if(c)b.transparent=!0,b.opacity=this[e],c=!0}b.shading=Ea;return this.material=new THREE.MeshLambertMaterial(b)};W.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "init_from":this.init_from=e.textContent;break;case "format":this.format=e.textContent;break;default:console.log("unhandled Surface prop: "+e.nodeName)}}return this};D.prototype.parse=
 function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "source":this.source=e.textContent;break;case "minfilter":this.minfilter=e.textContent;break;case "magfilter":this.magfilter=e.textContent;break;case "mipfilter":this.mipfilter=e.textContent;break;case "wrap_s":this.wrap_s=e.textContent;break;case "wrap_t":this.wrap_t=e.textContent;break;default:console.log("unhandled Sampler2D prop: "+e.nodeName)}}return this};M.prototype.create=function(){if(this.shader==
 null)return null};M.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.shader=null;for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(e))}}return this};M.prototype.parseNewparam=function(b){for(var c=b.getAttribute("sid"),e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "surface":this.surface=(new W(this)).parse(f);
 this.surface.sid=c;break;case "sampler2D":this.sampler=(new D(this)).parse(f);this.sampler.sid=c;break;case "extra":break;default:console.log(f.nodeName)}}};M.prototype.parseProfileCOMMON=function(b){for(var c,e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "profile_COMMON":this.parseProfileCOMMON(f);break;case "technique":c=f;break;case "newparam":this.parseNewparam(f);break;case "extra":break;default:console.log(f.nodeName)}}return c};M.prototype.parseTechnique=
 function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "lambert":case "blinn":case "phong":this.shader=(new K(e.nodeName,this)).parse(e)}}};U.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");return this};V.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.source={};for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "source":e=
-(new S).parse(e);this.source[e.id]=e;break;case "sampler":this.sampler.push((new o(this)).parse(e));break;case "channel":this.channel.push((new R(this)).parse(e))}}return this};R.prototype.parse=function(b){this.source=b.getAttribute("source").replace(/^#/,"");this.target=b.getAttribute("target");var c=this.target.split("/");c.shift();var b=c.shift(),e=b.indexOf(".")>=0,f=b.indexOf("(")>=0,k,h;if(e)c=b.split("."),b=c.shift(),h=c.shift();else if(f){k=b.split("(");b=k.shift();for(c=0;c<k.length;c++)k[c]=
-parseInt(k[c].replace(/\)/,""))}this.sid=b;this.dotSyntax=e;this.arrSyntax=f;this.arrIndices=k;this.member=h;return this};o.prototype.parse=function(b){this.id=b.getAttribute("id");this.inputs=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "input":this.inputs.push((new O).parse(e))}}return this};o.prototype.create=function(){for(var b=0;b<this.inputs.length;b++){var c=this.inputs[b],e=this.animation.source[c.source];switch(c.semantic){case "INPUT":this.input=
+(new S).parse(e);this.source[e.id]=e;break;case "sampler":this.sampler.push((new o(this)).parse(e));break;case "channel":this.channel.push((new R(this)).parse(e))}}return this};R.prototype.parse=function(b){this.source=b.getAttribute("source").replace(/^#/,"");this.target=b.getAttribute("target");var c=this.target.split("/");c.shift();var b=c.shift(),e=b.indexOf(".")>=0,f=b.indexOf("(")>=0,h,k;if(e)c=b.split("."),b=c.shift(),k=c.shift();else if(f){h=b.split("(");b=h.shift();for(c=0;c<h.length;c++)h[c]=
+parseInt(h[c].replace(/\)/,""))}this.sid=b;this.dotSyntax=e;this.arrSyntax=f;this.arrIndices=h;this.member=k;return this};o.prototype.parse=function(b){this.id=b.getAttribute("id");this.inputs=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "input":this.inputs.push((new N).parse(e))}}return this};o.prototype.create=function(){for(var b=0;b<this.inputs.length;b++){var c=this.inputs[b],e=this.animation.source[c.source];switch(c.semantic){case "INPUT":this.input=
 e.read();break;case "OUTPUT":this.output=e.read();break;case "INTERPOLATION":this.interpolation=e.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(c.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(b=0;b<this.input.length;b++)this.startTime=Math.min(this.startTime,this.input[b]),this.endTime=Math.max(this.endTime,this.input[b]);this.duration=this.endTime-this.startTime}};return{load:function(e,f){if(document.implementation&&
-document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);e+="?rnd="+Math.random();var n=new XMLHttpRequest;n.overrideMimeType&&n.overrideMimeType("text/xml");n.onreadystatechange=function(){if(n.readyState==4&&(n.status==0||n.status==200)){wa=f;var o,t=e;Z=n.responseXML;o=wa;t!==void 0&&(t=t.split("/"),t.pop(),Ca=t.join("/")+"/");ia=b("//dae:library_images/dae:image",m,"image");ua=b("//dae:library_materials/dae:material",
-J,"material");ta=b("//dae:library_effects/dae:effect",M,"effect");ca=b("//dae:library_geometries/dae:geometry",z,"geometry");N=b("//dae:library_controllers/dae:controller",k,"controller");sa=b("//dae:library_animations/dae:animation",V,"animation");ra=b(".//dae:library_visual_scenes/dae:visual_scene",p,"visual_scene");za=[];Aa=[];(t=Z.evaluate(".//dae:scene/dae:instance_visual_scene",Z,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(t=t.getAttribute("url").replace(/^#/,""),Y=ra[t]):
-Y=null;fa=new THREE.Object3D;for(t=0;t<Y.nodes.length;t++)fa.addChild(h(Y.nodes[t]));c();for(var u in sa);u={scene:fa,morphs:za,skins:Aa,dae:{images:ia,materials:ua,effects:ta,geometries:ca,controllers:N,animations:sa,visualScenes:ra,scene:Y}};o&&o(u)}};n.open("GET",e,!0);n.send(null)}else alert("Don't know how to parse XML!")},setPreferredShading:function(b){Ea=b},applySkin:f,geometries:ca}};THREE.JSONLoader=function(b){THREE.Loader.call(this,b)};THREE.JSONLoader.prototype=new THREE.Loader;
+document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);e+="?rnd="+Math.random();var n=new XMLHttpRequest;n.overrideMimeType&&n.overrideMimeType("text/xml");n.onreadystatechange=function(){if(n.readyState==4&&(n.status==0||n.status==200)){wa=f;var o,p=e;Z=n.responseXML;o=wa;p!==void 0&&(p=p.split("/"),p.pop(),Ca=p.join("/")+"/");ia=b("//dae:library_images/dae:image",m,"image");ua=b("//dae:library_materials/dae:material",
+J,"material");ta=b("//dae:library_effects/dae:effect",M,"effect");da=b("//dae:library_geometries/dae:geometry",z,"geometry");O=b("//dae:library_controllers/dae:controller",k,"controller");sa=b("//dae:library_animations/dae:animation",V,"animation");ra=b(".//dae:library_visual_scenes/dae:visual_scene",v,"visual_scene");za=[];Aa=[];(p=Z.evaluate(".//dae:scene/dae:instance_visual_scene",Z,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(p=p.getAttribute("url").replace(/^#/,""),Y=ra[p]):
+Y=null;ga=new THREE.Object3D;for(p=0;p<Y.nodes.length;p++)ga.addChild(h(Y.nodes[p]));c();for(var t in sa);t={scene:ga,morphs:za,skins:Aa,dae:{images:ia,materials:ua,effects:ta,geometries:da,controllers:O,animations:sa,visualScenes:ra,scene:Y}};o&&o(t)}};n.open("GET",e,!0);n.send(null)}else alert("Don't know how to parse XML!")},setPreferredShading:function(b){Ea=b},applySkin:f,geometries:da}};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,h=b.texture_path?b.texture_path:this.extractUrlbase(e),b=new Worker(e);b.onmessage=function(b){c.createModel(b.data,f,h);c.onLoadComplete()};this.onLoadStart();b.postMessage((new Date).getTime())};
-THREE.JSONLoader.prototype.createModel=function(b,c,e){var f=new THREE.Geometry,h=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,h,t,p,v,u,x,w,y,z,A,C,E,G,H=b.faces;u=b.vertices;var O=b.normals,S=b.colors,J=0;for(e=0;e<b.uvs.length;e++)b.uvs[e].length&&J++;for(e=0;e<J;e++)f.faceUvs[e]=[],f.faceVertexUvs[e]=[];p=0;for(v=u.length;p<v;)x=new THREE.Vertex,x.position.x=u[p++]*c,x.position.y=
-u[p++]*c,x.position.z=u[p++]*c,f.vertices.push(x);p=0;for(v=H.length;p<v;){c=H[p++];u=c&1;t=c&2;e=c&4;h=c&8;w=c&16;x=c&32;z=c&64;c&=128;u?(A=new THREE.Face4,A.a=H[p++],A.b=H[p++],A.c=H[p++],A.d=H[p++],u=4):(A=new THREE.Face3,A.a=H[p++],A.b=H[p++],A.c=H[p++],u=3);if(t)t=H[p++],A.materials=f.materials[t];t=f.faces.length;if(e)for(e=0;e<J;e++)C=b.uvs[e],y=H[p++],G=C[y*2],y=C[y*2+1],f.faceUvs[e][t]=new THREE.UV(G,y);if(h)for(e=0;e<J;e++){C=b.uvs[e];E=[];for(h=0;h<u;h++)y=H[p++],G=C[y*2],y=C[y*2+1],E[h]=
-new THREE.UV(G,y);f.faceVertexUvs[e][t]=E}if(w)w=H[p++]*3,h=new THREE.Vector3,h.x=O[w++],h.y=O[w++],h.z=O[w],A.normal=h;if(x)for(e=0;e<u;e++)w=H[p++]*3,h=new THREE.Vector3,h.x=O[w++],h.y=O[w++],h.z=O[w],A.vertexNormals.push(h);if(z)x=H[p++],x=new THREE.Color(S[x]),A.color=x;if(c)for(e=0;e<u;e++)x=H[p++],x=new THREE.Color(S[x]),A.vertexColors.push(x);f.faces.push(A)}}})(h);(function(){var c,e,h,t;if(b.skinWeights){c=0;for(e=b.skinWeights.length;c<e;c+=2)h=b.skinWeights[c],t=b.skinWeights[c+1],f.skinWeights.push(new THREE.Vector4(h,
-t,0,0))}if(b.skinIndices){c=0;for(e=b.skinIndices.length;c<e;c+=2)h=b.skinIndices[c],t=b.skinIndices[c+1],f.skinIndices.push(new THREE.Vector4(h,t,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var e,h,t,p,v,u,x,w,y;e=0;for(h=b.morphTargets.length;e<h;e++){f.morphTargets[e]={};f.morphTargets[e].name=b.morphTargets[e].name;f.morphTargets[e].vertices=[];w=f.morphTargets[e].vertices;y=b.morphTargets[e].vertices;t=0;for(p=y.length;t<p;t+=3)v=y[t]*c,u=y[t+1]*
-c,x=y[t+2]*c,w.push(new THREE.Vertex(new THREE.Vector3(v,u,x)))}}if(b.morphColors!==void 0){e=0;for(h=b.morphColors.length;e<h;e++){f.morphColors[e]={};f.morphColors[e].name=b.morphColors[e].name;f.morphColors[e].colors=[];p=f.morphColors[e].colors;v=b.morphColors[e].colors;c=0;for(t=v.length;c<t;c+=3)u=new THREE.Color(16755200),u.setRGB(v[c],v[c+1],v[c+2]),p.push(u)}}})(h);(function(){if(b.edges!==void 0){var c,e,h;for(c=0;c<b.edges.length;c+=2)e=b.edges[c],h=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,h=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,h,p,v,u,t,x,w,y,z,A,C,E,G,H=b.faces;t=b.vertices;var N=b.normals,S=b.colors,J=0;for(e=0;e<b.uvs.length;e++)b.uvs[e].length&&J++;for(e=0;e<J;e++)f.faceUvs[e]=[],f.faceVertexUvs[e]=[];v=0;for(u=t.length;v<u;)x=new THREE.Vertex,x.position.x=t[v++]*c,x.position.y=
+t[v++]*c,x.position.z=t[v++]*c,f.vertices.push(x);v=0;for(u=H.length;v<u;){c=H[v++];t=c&1;p=c&2;e=c&4;h=c&8;w=c&16;x=c&32;z=c&64;c&=128;t?(A=new THREE.Face4,A.a=H[v++],A.b=H[v++],A.c=H[v++],A.d=H[v++],t=4):(A=new THREE.Face3,A.a=H[v++],A.b=H[v++],A.c=H[v++],t=3);if(p)p=H[v++],A.materials=f.materials[p];p=f.faces.length;if(e)for(e=0;e<J;e++)C=b.uvs[e],y=H[v++],G=C[y*2],y=C[y*2+1],f.faceUvs[e][p]=new THREE.UV(G,y);if(h)for(e=0;e<J;e++){C=b.uvs[e];E=[];for(h=0;h<t;h++)y=H[v++],G=C[y*2],y=C[y*2+1],E[h]=
+new THREE.UV(G,y);f.faceVertexUvs[e][p]=E}if(w)w=H[v++]*3,h=new THREE.Vector3,h.x=N[w++],h.y=N[w++],h.z=N[w],A.normal=h;if(x)for(e=0;e<t;e++)w=H[v++]*3,h=new THREE.Vector3,h.x=N[w++],h.y=N[w++],h.z=N[w],A.vertexNormals.push(h);if(z)x=H[v++],x=new THREE.Color(S[x]),A.color=x;if(c)for(e=0;e<t;e++)x=H[v++],x=new THREE.Color(S[x]),A.vertexColors.push(x);f.faces.push(A)}}})(h);(function(){var c,e,h,p;if(b.skinWeights){c=0;for(e=b.skinWeights.length;c<e;c+=2)h=b.skinWeights[c],p=b.skinWeights[c+1],f.skinWeights.push(new THREE.Vector4(h,
+p,0,0))}if(b.skinIndices){c=0;for(e=b.skinIndices.length;c<e;c+=2)h=b.skinIndices[c],p=b.skinIndices[c+1],f.skinIndices.push(new THREE.Vector4(h,p,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var e,h,p,v,u,t,x,w,y;e=0;for(h=b.morphTargets.length;e<h;e++){f.morphTargets[e]={};f.morphTargets[e].name=b.morphTargets[e].name;f.morphTargets[e].vertices=[];w=f.morphTargets[e].vertices;y=b.morphTargets[e].vertices;p=0;for(v=y.length;p<v;p+=3)u=y[p]*c,t=y[p+1]*
+c,x=y[p+2]*c,w.push(new THREE.Vertex(new THREE.Vector3(u,t,x)))}}if(b.morphColors!==void 0){e=0;for(h=b.morphColors.length;e<h;e++){f.morphColors[e]={};f.morphColors[e].name=b.morphColors[e].name;f.morphColors[e].colors=[];v=f.morphColors[e].colors;u=b.morphColors[e].colors;c=0;for(p=u.length;c<p;c+=3)t=new THREE.Color(16755200),t.setRGB(u[c],u[c+1],u[c+2]),v.push(t)}}})(h);(function(){if(b.edges!==void 0){var c,e,h;for(c=0;c<b.edges.length;c+=2)e=b.edges[c],h=b.edges[c+1],f.edges.push(new THREE.Edge(f.vertices[e],
 f.vertices[h],e,h))}})();f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};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 h=THREE.Loader.prototype.extractUrlbase(b);f.onmessage=function(b){function f(b,c){return c=="relativeToHTML"?b:h+"/"+b}function n(){for(w in M.objects)if(!T.objects[w])if(E=M.objects[w],E.geometry!==void 0){if(S=T.geometries[E.geometry]){var b=!1;W=[];for(aa=0;aa<E.materials.length;aa++)W[aa]=T.materials[E.materials[aa]],b=W[aa]instanceof THREE.MeshShaderMaterial;b&&S.computeTangents();G=E.position;r=
 E.rotation;q=E.quaternion;s=E.scale;q=0;W.length==0&&(W[0]=new THREE.MeshFaceMaterial);W.length>1&&(W=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(S,W);object.name=w;object.position.set(G[0],G[1],G[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=E.visible;T.scene.addObject(object);T.objects[w]=object;E.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),T.scene.collisions.colliders.push(b));
 if(E.castsShadow)b=new THREE.ShadowVolume(S),T.scene.addChild(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},T.triggers[object.name]=b)}}else G=E.position,r=E.rotation,q=E.quaternion,s=E.scale,q=0,object=new THREE.Object3D,object.name=w,object.position.set(G[0],G[1],G[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=E.visible!==void 0?E.visible:!1,T.scene.addObject(object),T.objects[w]=object,T.empties[w]=object,E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},T.triggers[object.name]=b)}function t(b){return function(c){T.geometries[b]=c;n();V-=1;e.onLoadComplete();v()}}function p(b){return function(c){T.geometries[b]=c}}function v(){e.callbackProgress({totalModels:o,totalTextures:pa,loadedModels:o-V,loadedTextures:pa-R},T);e.onLoadProgress();V==0&&R==0&&c(T)}
-var u,x,w,y,z,A,C,E,G,H,O,S,J,I,K,W,D,M,U,V,R,o,pa,T;M=b.data;K=new THREE.BinaryLoader;U=new THREE.JSONLoader;R=V=0;T={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(w in M.objects)if(E=M.objects[w],E.meshCollider){b=!0;break}if(b)T.scene.collisions=new THREE.CollisionSystem;if(M.transform){b=M.transform.position;H=M.transform.rotation;var la=M.transform.scale;b&&T.scene.position.set(b[0],b[1],b[2]);H&&T.scene.rotation.set(H[0],
-H[1],H[2]);la&&T.scene.scale.set(la[0],la[1],la[2]);(b||H||la)&&T.scene.updateMatrix()}b=function(){R-=1;v();e.onLoadComplete()};for(z in M.cameras){H=M.cameras[z];if(H.type=="perspective")J=new THREE.Camera(H.fov,H.aspect,H.near,H.far);else if(H.type=="ortho")J=new THREE.Camera,J.projectionMatrix=THREE.Matrix4.makeOrtho(H.left,H.right,H.top,H.bottom,H.near,H.far);G=H.position;H=H.target;J.position.set(G[0],G[1],G[2]);J.target.position.set(H[0],H[1],H[2]);T.cameras[z]=J}for(y in M.lights)z=M.lights[y],
+s[1],s[2]),object.visible=E.visible!==void 0?E.visible:!1,T.scene.addObject(object),T.objects[w]=object,T.empties[w]=object,E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},T.triggers[object.name]=b)}function p(b){return function(c){T.geometries[b]=c;n();V-=1;e.onLoadComplete();u()}}function v(b){return function(c){T.geometries[b]=c}}function u(){e.callbackProgress({totalModels:o,totalTextures:pa,loadedModels:o-V,loadedTextures:pa-R},T);e.onLoadProgress();V==0&&R==0&&c(T)}
+var t,x,w,y,z,A,C,E,G,H,N,S,J,I,K,W,D,M,U,V,R,o,pa,T;M=b.data;K=new THREE.BinaryLoader;U=new THREE.JSONLoader;R=V=0;T={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(w in M.objects)if(E=M.objects[w],E.meshCollider){b=!0;break}if(b)T.scene.collisions=new THREE.CollisionSystem;if(M.transform){b=M.transform.position;H=M.transform.rotation;var la=M.transform.scale;b&&T.scene.position.set(b[0],b[1],b[2]);H&&T.scene.rotation.set(H[0],
+H[1],H[2]);la&&T.scene.scale.set(la[0],la[1],la[2]);(b||H||la)&&T.scene.updateMatrix()}b=function(){R-=1;u();e.onLoadComplete()};for(z in M.cameras){H=M.cameras[z];if(H.type=="perspective")J=new THREE.Camera(H.fov,H.aspect,H.near,H.far);else if(H.type=="ortho")J=new THREE.Camera,J.projectionMatrix=THREE.Matrix4.makeOrtho(H.left,H.right,H.top,H.bottom,H.near,H.far);G=H.position;H=H.target;J.position.set(G[0],G[1],G[2]);J.target.position.set(H[0],H[1],H[2]);T.cameras[z]=J}for(y in M.lights)z=M.lights[y],
 J=z.color!==void 0?z.color:16777215,H=z.intensity!==void 0?z.intensity:1,z.type=="directional"?(G=z.direction,D=new THREE.DirectionalLight(J,H),D.position.set(G[0],G[1],G[2]),D.position.normalize()):z.type=="point"?(G=z.position,d=z.distance,D=new THREE.PointLight(J,H,d),D.position.set(G[0],G[1],G[2])):z.type=="ambient"&&(D=new THREE.AmbientLight(J)),T.scene.addLight(D),T.lights[y]=D;for(A in M.fogs)y=M.fogs[A],y.type=="linear"?I=new THREE.Fog(0,y.near,y.far):y.type=="exp2"&&(I=new THREE.FogExp2(0,
-y.density)),H=y.color,I.color.setRGB(H[0],H[1],H[2]),T.fogs[A]=I;if(T.cameras&&M.defaults.camera)T.currentCamera=T.cameras[M.defaults.camera];if(T.fogs&&M.defaults.fog)T.scene.fog=T.fogs[M.defaults.fog];H=M.defaults.bgcolor;T.bgColor=new THREE.Color;T.bgColor.setRGB(H[0],H[1],H[2]);T.bgColorAlpha=M.defaults.bgalpha;for(u in M.geometries)if(A=M.geometries[u],A.type=="bin_mesh"||A.type=="ascii_mesh")V+=1,e.onLoadStart();o=V;for(u in M.geometries)A=M.geometries[u],A.type=="cube"?(S=new THREE.CubeGeometry(A.width,
-A.height,A.depth,A.segmentsWidth,A.segmentsHeight,A.segmentsDepth,null,A.flipped,A.sides),T.geometries[u]=S):A.type=="plane"?(S=new THREE.PlaneGeometry(A.width,A.height,A.segmentsWidth,A.segmentsHeight),T.geometries[u]=S):A.type=="sphere"?(S=new THREE.SphereGeometry(A.radius,A.segmentsWidth,A.segmentsHeight),T.geometries[u]=S):A.type=="cylinder"?(S=new THREE.CylinderGeometry(A.numSegs,A.topRad,A.botRad,A.height,A.topOffset,A.botOffset),T.geometries[u]=S):A.type=="torus"?(S=new THREE.TorusGeometry(A.radius,
-A.tube,A.segmentsR,A.segmentsT),T.geometries[u]=S):A.type=="icosahedron"?(S=new THREE.IcosahedronGeometry(A.subdivisions),T.geometries[u]=S):A.type=="bin_mesh"?K.load({model:f(A.url,M.urlBaseType),callback:t(u)}):A.type=="ascii_mesh"?U.load({model:f(A.url,M.urlBaseType),callback:t(u)}):A.type=="embedded_mesh"&&(A=M.embeds[A.id])&&U.createModel(A,p(u),"");for(C in M.textures)if(u=M.textures[C],u.url instanceof Array){R+=u.url.length;for(K=0;K<u.url.length;K++)e.onLoadStart()}else R+=1,e.onLoadStart();
-pa=R;for(C in M.textures){u=M.textures[C];if(u.mapping!=void 0&&THREE[u.mapping]!=void 0)u.mapping=new THREE[u.mapping];if(u.url instanceof Array){K=[];for(var aa=0;aa<u.url.length;aa++)K[aa]=f(u.url[aa],M.urlBaseType);K=THREE.ImageUtils.loadTextureCube(K,u.mapping,b)}else{K=THREE.ImageUtils.loadTexture(f(u.url,M.urlBaseType),u.mapping,b);if(THREE[u.minFilter]!=void 0)K.minFilter=THREE[u.minFilter];if(THREE[u.magFilter]!=void 0)K.magFilter=THREE[u.magFilter];if(u.repeat){K.repeat.set(u.repeat[0],
-u.repeat[1]);if(u.repeat[0]!=1)K.wrapS=THREE.RepeatWrapping;if(u.repeat[1]!=1)K.wrapT=THREE.RepeatWrapping}u.offset&&K.offset.set(u.offset[0],u.offset[1]);if(u.wrap){U={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(U[u.wrap[0]]!==void 0)K.wrapS=U[u.wrap[0]];if(U[u.wrap[1]]!==void 0)K.wrapT=U[u.wrap[1]]}}T.textures[C]=K}for(x in M.materials){C=M.materials[x];for(O in C.parameters)if(O=="envMap"||O=="map"||O=="lightMap")C.parameters[O]=T.textures[C.parameters[O]];else if(O=="shading")C.parameters[O]=
-C.parameters[O]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(O=="blending")C.parameters[O]=THREE[C.parameters[O]]?THREE[C.parameters[O]]:THREE.NormalBlending;else if(O=="combine")C.parameters[O]=C.parameters[O]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(O=="vertexColors")if(C.parameters[O]=="face")C.parameters[O]=THREE.FaceColors;else if(C.parameters[O])C.parameters[O]=THREE.VertexColors;if(C.parameters.opacity!==void 0&&C.parameters.opacity<1)C.parameters.transparent=
-!0;if(C.parameters.normalMap){u=THREE.ShaderUtils.lib.normal;b=THREE.UniformsUtils.clone(u.uniforms);K=C.parameters.color;U=C.parameters.specular;A=C.parameters.ambient;I=C.parameters.shininess;b.tNormal.texture=T.textures[C.parameters.normalMap];if(C.parameters.normalMapFactor)b.uNormalScale.value=C.parameters.normalMapFactor;if(C.parameters.map)b.tDiffuse.texture=C.parameters.map,b.enableDiffuse.value=!0;if(C.parameters.lightMap)b.tAO.texture=C.parameters.lightMap,b.enableAO.value=!0;if(C.parameters.specularMap)b.tSpecular.texture=
-T.textures[C.parameters.specularMap],b.enableSpecular.value=!0;b.uDiffuseColor.value.setHex(K);b.uSpecularColor.value.setHex(U);b.uAmbientColor.value.setHex(A);b.uShininess.value=I;if(C.parameters.opacity)b.uOpacity.value=C.parameters.opacity;C=new THREE.MeshShaderMaterial({fragmentShader:u.fragmentShader,vertexShader:u.vertexShader,uniforms:b,lights:!0,fog:!0})}else C=new THREE[C.type](C.parameters);T.materials[x]=C}n();e.callbackSync(T)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};
+y.density)),H=y.color,I.color.setRGB(H[0],H[1],H[2]),T.fogs[A]=I;if(T.cameras&&M.defaults.camera)T.currentCamera=T.cameras[M.defaults.camera];if(T.fogs&&M.defaults.fog)T.scene.fog=T.fogs[M.defaults.fog];H=M.defaults.bgcolor;T.bgColor=new THREE.Color;T.bgColor.setRGB(H[0],H[1],H[2]);T.bgColorAlpha=M.defaults.bgalpha;for(t in M.geometries)if(A=M.geometries[t],A.type=="bin_mesh"||A.type=="ascii_mesh")V+=1,e.onLoadStart();o=V;for(t in M.geometries)A=M.geometries[t],A.type=="cube"?(S=new THREE.CubeGeometry(A.width,
+A.height,A.depth,A.segmentsWidth,A.segmentsHeight,A.segmentsDepth,null,A.flipped,A.sides),T.geometries[t]=S):A.type=="plane"?(S=new THREE.PlaneGeometry(A.width,A.height,A.segmentsWidth,A.segmentsHeight),T.geometries[t]=S):A.type=="sphere"?(S=new THREE.SphereGeometry(A.radius,A.segmentsWidth,A.segmentsHeight),T.geometries[t]=S):A.type=="cylinder"?(S=new THREE.CylinderGeometry(A.topRad,A.botRad,A.height,A.radSegs,A.heightSegs),T.geometries[t]=S):A.type=="torus"?(S=new THREE.TorusGeometry(A.radius,A.tube,
+A.segmentsR,A.segmentsT),T.geometries[t]=S):A.type=="icosahedron"?(S=new THREE.IcosahedronGeometry(A.subdivisions),T.geometries[t]=S):A.type=="bin_mesh"?K.load({model:f(A.url,M.urlBaseType),callback:p(t)}):A.type=="ascii_mesh"?U.load({model:f(A.url,M.urlBaseType),callback:p(t)}):A.type=="embedded_mesh"&&(A=M.embeds[A.id])&&U.createModel(A,v(t),"");for(C in M.textures)if(t=M.textures[C],t.url instanceof Array){R+=t.url.length;for(K=0;K<t.url.length;K++)e.onLoadStart()}else R+=1,e.onLoadStart();pa=
+R;for(C in M.textures){t=M.textures[C];if(t.mapping!=void 0&&THREE[t.mapping]!=void 0)t.mapping=new THREE[t.mapping];if(t.url instanceof Array){K=[];for(var aa=0;aa<t.url.length;aa++)K[aa]=f(t.url[aa],M.urlBaseType);K=THREE.ImageUtils.loadTextureCube(K,t.mapping,b)}else{K=THREE.ImageUtils.loadTexture(f(t.url,M.urlBaseType),t.mapping,b);if(THREE[t.minFilter]!=void 0)K.minFilter=THREE[t.minFilter];if(THREE[t.magFilter]!=void 0)K.magFilter=THREE[t.magFilter];if(t.repeat){K.repeat.set(t.repeat[0],t.repeat[1]);
+if(t.repeat[0]!=1)K.wrapS=THREE.RepeatWrapping;if(t.repeat[1]!=1)K.wrapT=THREE.RepeatWrapping}t.offset&&K.offset.set(t.offset[0],t.offset[1]);if(t.wrap){U={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(U[t.wrap[0]]!==void 0)K.wrapS=U[t.wrap[0]];if(U[t.wrap[1]]!==void 0)K.wrapT=U[t.wrap[1]]}}T.textures[C]=K}for(x in M.materials){C=M.materials[x];for(N in C.parameters)if(N=="envMap"||N=="map"||N=="lightMap")C.parameters[N]=T.textures[C.parameters[N]];else if(N=="shading")C.parameters[N]=
+C.parameters[N]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(N=="blending")C.parameters[N]=THREE[C.parameters[N]]?THREE[C.parameters[N]]:THREE.NormalBlending;else if(N=="combine")C.parameters[N]=C.parameters[N]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(N=="vertexColors")if(C.parameters[N]=="face")C.parameters[N]=THREE.FaceColors;else if(C.parameters[N])C.parameters[N]=THREE.VertexColors;if(C.parameters.opacity!==void 0&&C.parameters.opacity<1)C.parameters.transparent=
+!0;if(C.parameters.normalMap){t=THREE.ShaderUtils.lib.normal;b=THREE.UniformsUtils.clone(t.uniforms);K=C.parameters.color;U=C.parameters.specular;A=C.parameters.ambient;I=C.parameters.shininess;b.tNormal.texture=T.textures[C.parameters.normalMap];if(C.parameters.normalMapFactor)b.uNormalScale.value=C.parameters.normalMapFactor;if(C.parameters.map)b.tDiffuse.texture=C.parameters.map,b.enableDiffuse.value=!0;if(C.parameters.lightMap)b.tAO.texture=C.parameters.lightMap,b.enableAO.value=!0;if(C.parameters.specularMap)b.tSpecular.texture=
+T.textures[C.parameters.specularMap],b.enableSpecular.value=!0;b.uDiffuseColor.value.setHex(K);b.uSpecularColor.value.setHex(U);b.uAmbientColor.value.setHex(A);b.uShininess.value=I;if(C.parameters.opacity)b.uOpacity.value=C.parameters.opacity;C=new THREE.MeshShaderMaterial({fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:b,lights:!0,fog:!0})}else C=new THREE[C.type](C.parameters);T.materials[x]=C}n();e.callbackSync(T)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};
 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,h=b.scale!==void 0?b.scale:1,m=b.offsetX!==void 0?b.offsetX:0,k=b.offsetY!==void 0?b.offsetY:0,n=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,h,m,k,n):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.decompressMesh=function(b){var c=b.charCodeAt(0);c>=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,h=0;h<8;h++){for(var m=0,k=0;k<c;++k){var n=b.charCodeAt(k+f);m+=n>>1^-(n&1);e[8*k+h]=m}f+=c}c=b.length-f;m=new Uint16Array(c);for(h=k=0;h<c;h++)n=b.charCodeAt(h+f),m[h]=k-n,n==0&&k++;return[e,m]};
-THREE.UTF8Loader.prototype.createModel=function(b,c,e,f,h,m){var k=function(){var c=this;c.materials=[];THREE.Geometry.call(this);var k=THREE.UTF8Loader.prototype.decompressMesh(b),p=[],v=[];(function(b,k,p){for(var t,v,A,C=b.length;p<C;p+=k)t=b[p],v=b[p+1],A=b[p+2],t=t/16383*e,v=v/16383*e,A=A/16383*e,t+=f,v+=h,A+=m,c.vertices.push(new THREE.Vertex(new THREE.Vector3(t,v,A)))})(k[0],8,0);(function(b,c,e){for(var f,h,k=b.length;e<k;e+=c)f=b[e],h=b[e+1],f/=1023,h/=1023,v.push(f,h)})(k[0],8,3);(function(b,
-c,e){for(var f,h,k,m=b.length;e<m;e+=c)f=b[e],h=b[e+1],k=b[e+2],f=(f-512)/511,h=(h-512)/511,k=(k-512)/511,p.push(f,h,k)})(k[0],8,5);(function(b){var e,f,h,k,m,t,E,G,H,O=b.length;for(e=0;e<O;e+=3){f=b[e];h=b[e+1];k=b[e+2];m=c;G=f;H=h;t=k;E=f;var S=h,J=k,I=m.materials[0],K=p[S*3],W=p[S*3+1],S=p[S*3+2],D=p[J*3],M=p[J*3+1],J=p[J*3+2];E=new THREE.Vector3(p[E*3],p[E*3+1],p[E*3+2]);S=new THREE.Vector3(K,W,S);J=new THREE.Vector3(D,M,J);m.faces.push(new THREE.Face3(G,H,t,[E,S,J],null,I));m=v[f*2];f=v[f*2+
-1];t=v[h*2];E=v[h*2+1];G=v[k*2];H=v[k*2+1];k=c.faceVertexUvs[0];h=t;t=E;E=[];E.push(new THREE.UV(m,f));E.push(new THREE.UV(h,t));E.push(new THREE.UV(G,H));k.push(E)}})(k[1]);this.computeCentroids();this.computeFaceNormals()};k.prototype=new THREE.Geometry;k.prototype.constructor=k;c(new k)};
+THREE.UTF8Loader.prototype.createModel=function(b,c,e,f,h,m){var k=function(){var c=this;c.materials=[];THREE.Geometry.call(this);var k=THREE.UTF8Loader.prototype.decompressMesh(b),v=[],u=[];(function(b,k,p){for(var v,u,A,C=b.length;p<C;p+=k)v=b[p],u=b[p+1],A=b[p+2],v=v/16383*e,u=u/16383*e,A=A/16383*e,v+=f,u+=h,A+=m,c.vertices.push(new THREE.Vertex(new THREE.Vector3(v,u,A)))})(k[0],8,0);(function(b,c,e){for(var f,h,k=b.length;e<k;e+=c)f=b[e],h=b[e+1],f/=1023,h/=1023,u.push(f,h)})(k[0],8,3);(function(b,
+c,e){for(var f,h,k,m=b.length;e<m;e+=c)f=b[e],h=b[e+1],k=b[e+2],f=(f-512)/511,h=(h-512)/511,k=(k-512)/511,v.push(f,h,k)})(k[0],8,5);(function(b){var e,f,h,k,m,p,E,G,H,N=b.length;for(e=0;e<N;e+=3){f=b[e];h=b[e+1];k=b[e+2];m=c;G=f;H=h;p=k;E=f;var S=h,J=k,I=m.materials[0],K=v[S*3],W=v[S*3+1],S=v[S*3+2],D=v[J*3],M=v[J*3+1],J=v[J*3+2];E=new THREE.Vector3(v[E*3],v[E*3+1],v[E*3+2]);S=new THREE.Vector3(K,W,S);J=new THREE.Vector3(D,M,J);m.faces.push(new THREE.Face3(G,H,p,[E,S,J],null,I));m=u[f*2];f=u[f*2+
+1];p=u[h*2];E=u[h*2+1];G=u[k*2];H=u[k*2+1];k=c.faceVertexUvs[0];h=p;p=E;E=[];E.push(new THREE.UV(m,f));E.push(new THREE.UV(h,p));E.push(new THREE.UV(G,H));k.push(E)}})(k[1]);this.computeCentroids();this.computeFaceNormals()};k.prototype=new THREE.Geometry;k.prototype.constructor=k;c(new k)};
 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,h){return b+(c-b)*h};this.VIntX=function(b,c,h,m,k,n,t,p,v,u){k=(k-v)/(u-v);v=this.normal_cache;c[m]=n+k*this.delta;c[m+1]=t;c[m+2]=p;h[m]=this.lerp(v[b],v[b+3],k);h[m+1]=this.lerp(v[b+1],v[b+4],k);h[m+2]=this.lerp(v[b+2],v[b+5],k)};this.VIntY=function(b,c,h,m,k,n,t,p,v,u){k=(k-v)/(u-v);v=this.normal_cache;c[m]=n;c[m+1]=t+k*this.delta;c[m+
-2]=p;c=b+this.yd*3;h[m]=this.lerp(v[b],v[c],k);h[m+1]=this.lerp(v[b+1],v[c+1],k);h[m+2]=this.lerp(v[b+2],v[c+2],k)};this.VIntZ=function(b,c,h,m,k,n,t,p,v,u){k=(k-v)/(u-v);v=this.normal_cache;c[m]=n;c[m+1]=t;c[m+2]=p+k*this.delta;c=b+this.zd*3;h[m]=this.lerp(v[b],v[c],k);h[m+1]=this.lerp(v[b+1],v[c+1],k);h[m+2]=this.lerp(v[b+2],v[c+2],k)};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,h,m,k,n){var t=m+1,p=m+this.yd,v=m+this.zd,u=t+this.yd,x=t+this.zd,w=m+this.yd+this.zd,y=t+this.yd+this.zd,z=0,A=this.field[m],C=this.field[t],E=this.field[p],G=this.field[u],H=this.field[v],O=this.field[x],S=this.field[w],J=this.field[y];A<k&&(z|=1);C<k&&(z|=2);E<k&&(z|=8);G<k&&(z|=4);H<k&&(z|=16);O<k&&(z|=32);S<k&&(z|=128);J<k&&(z|=64);var I=THREE.edgeTable[z];if(I==0)return 0;var K=this.delta,
-W=b+K,D=c+K,K=h+K;I&1&&(this.compNorm(m),this.compNorm(t),this.VIntX(m*3,this.vlist,this.nlist,0,k,b,c,h,A,C));I&2&&(this.compNorm(t),this.compNorm(u),this.VIntY(t*3,this.vlist,this.nlist,3,k,W,c,h,C,G));I&4&&(this.compNorm(p),this.compNorm(u),this.VIntX(p*3,this.vlist,this.nlist,6,k,b,D,h,E,G));I&8&&(this.compNorm(m),this.compNorm(p),this.VIntY(m*3,this.vlist,this.nlist,9,k,b,c,h,A,E));I&16&&(this.compNorm(v),this.compNorm(x),this.VIntX(v*3,this.vlist,this.nlist,12,k,b,c,K,H,O));I&32&&(this.compNorm(x),
-this.compNorm(y),this.VIntY(x*3,this.vlist,this.nlist,15,k,W,c,K,O,J));I&64&&(this.compNorm(w),this.compNorm(y),this.VIntX(w*3,this.vlist,this.nlist,18,k,b,D,K,S,J));I&128&&(this.compNorm(v),this.compNorm(w),this.VIntY(v*3,this.vlist,this.nlist,21,k,b,c,K,H,S));I&256&&(this.compNorm(m),this.compNorm(v),this.VIntZ(m*3,this.vlist,this.nlist,24,k,b,c,h,A,H));I&512&&(this.compNorm(t),this.compNorm(x),this.VIntZ(t*3,this.vlist,this.nlist,27,k,W,c,h,C,O));I&1024&&(this.compNorm(u),this.compNorm(y),this.VIntZ(u*
-3,this.vlist,this.nlist,30,k,W,D,h,G,J));I&2048&&(this.compNorm(p),this.compNorm(w),this.VIntZ(p*3,this.vlist,this.nlist,33,k,b,D,h,E,S));z<<=4;for(k=m=0;THREE.triTable[z+k]!=-1;)b=z+k,c=b+1,h=b+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[c],3*THREE.triTable[h],n),k+=3,m++;return m};this.posnormtriv=function(b,c,h,m,k,n){var t=this.count*3;this.positionArray[t]=b[h];this.positionArray[t+1]=b[h+1];this.positionArray[t+2]=b[h+2];this.positionArray[t+3]=b[m];this.positionArray[t+
-4]=b[m+1];this.positionArray[t+5]=b[m+2];this.positionArray[t+6]=b[k];this.positionArray[t+7]=b[k+1];this.positionArray[t+8]=b[k+2];this.normalArray[t]=c[h];this.normalArray[t+1]=c[h+1];this.normalArray[t+2]=c[h+2];this.normalArray[t+3]=c[m];this.normalArray[t+4]=c[m+1];this.normalArray[t+5]=c[m+2];this.normalArray[t+6]=c[k];this.normalArray[t+7]=c[k+1];this.normalArray[t+8]=c[k+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&n(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,h,m,k){var n=this.size*Math.sqrt(m/k),t=h*this.size,p=c*this.size,v=b*this.size,u=Math.floor(t-n);u<1&&(u=1);t=Math.floor(t+n);t>this.size-1&&(t=this.size-1);var x=Math.floor(p-n);x<1&&(x=1);p=Math.floor(p+n);p>this.size-1&&(p=this.size-1);var w=Math.floor(v-n);w<1&&(w=1);n=Math.floor(v+n);n>this.size-1&&(n=this.size-
-1);for(var y,z,A,C,E,G;u<t;u++){v=this.size2*u;z=u/this.size-h;E=z*z;for(z=x;z<p;z++){A=v+this.size*z;y=z/this.size-c;G=y*y;for(y=w;y<n;y++)C=y/this.size-b,C=m/(1.0E-6+C*C+G+E)-k,C>0&&(this.field[A+y]+=C)}}};this.addPlaneX=function(b,c){var h,m,k,n,t,p=this.size,v=this.yd,u=this.zd,x=this.field,w=p*Math.sqrt(b/c);w>p&&(w=p);for(h=0;h<w;h++)if(m=h/p,m*=m,n=b/(1.0E-4+m)-c,n>0)for(m=0;m<p;m++){t=h+m*v;for(k=0;k<p;k++)x[u*k+t]+=n}};this.addPlaneY=function(b,c){var h,m,k,n,t,p,v=this.size,u=this.yd,x=
-this.zd,w=this.field,y=v*Math.sqrt(b/c);y>v&&(y=v);for(m=0;m<y;m++)if(h=m/v,h*=h,n=b/(1.0E-4+h)-c,n>0){t=m*u;for(h=0;h<v;h++){p=t+h;for(k=0;k<v;k++)w[x*k+p]+=n}}};this.addPlaneZ=function(b,c){var h,m,k,n,t,p;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/c);dist>size&&(dist=size);for(k=0;k<dist;k++)if(h=k/size,h*=h,n=b/(1.0E-4+h)-c,n>0){t=zd*k;for(m=0;m<size;m++){p=t+m*yd;for(h=0;h<size;h++)field[p+h]+=n}}};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,h,m,k,n,t,p,v,u,x=this.size-2;for(k=1;k<x;k++){u=this.size2*k;p=(k-this.halfsize)/this.halfsize;for(m=1;m<x;m++){v=u+this.size*m;t=(m-this.halfsize)/this.halfsize;for(h=1;h<x;h++)n=(h-this.halfsize)/this.halfsize,c=v+h,this.polygonize(n,t,p,c,this.isolation,b)}}this.end(b)};this.generateGeometry=function(){var b=0,c=new THREE.Geometry,h=[];this.render(function(m){var k,n,t,p,v,u,x,w;for(k=0;k<m.count;k++)x=k*3,v=x+1,w=x+2,n=m.positionArray[x],
-t=m.positionArray[v],p=m.positionArray[w],u=new THREE.Vector3(n,t,p),n=m.normalArray[x],t=m.normalArray[v],p=m.normalArray[w],x=new THREE.Vector3(n,t,p),x.normalize(),v=new THREE.Vertex(u),c.vertices.push(v),h.push(x);nfaces=m.count/3;for(k=0;k<nfaces;k++)x=(b+k)*3,v=x+1,w=x+2,u=h[x],n=h[v],t=h[w],x=new THREE.Face3(x,v,w,[u,n,t]),c.faces.push(x);b+=nfaces;m.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,h){return b+(c-b)*h};this.VIntX=function(b,c,h,m,k,n,p,v,u,t){k=(k-u)/(t-u);u=this.normal_cache;c[m]=n+k*this.delta;c[m+1]=p;c[m+2]=v;h[m]=this.lerp(u[b],u[b+3],k);h[m+1]=this.lerp(u[b+1],u[b+4],k);h[m+2]=this.lerp(u[b+2],u[b+5],k)};this.VIntY=function(b,c,h,m,k,n,p,v,u,t){k=(k-u)/(t-u);u=this.normal_cache;c[m]=n;c[m+1]=p+k*this.delta;c[m+
+2]=v;c=b+this.yd*3;h[m]=this.lerp(u[b],u[c],k);h[m+1]=this.lerp(u[b+1],u[c+1],k);h[m+2]=this.lerp(u[b+2],u[c+2],k)};this.VIntZ=function(b,c,h,m,k,n,p,v,u,t){k=(k-u)/(t-u);u=this.normal_cache;c[m]=n;c[m+1]=p;c[m+2]=v+k*this.delta;c=b+this.zd*3;h[m]=this.lerp(u[b],u[c],k);h[m+1]=this.lerp(u[b+1],u[c+1],k);h[m+2]=this.lerp(u[b+2],u[c+2],k)};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,h,m,k,n){var p=m+1,v=m+this.yd,u=m+this.zd,t=p+this.yd,x=p+this.zd,w=m+this.yd+this.zd,y=p+this.yd+this.zd,z=0,A=this.field[m],C=this.field[p],E=this.field[v],G=this.field[t],H=this.field[u],N=this.field[x],S=this.field[w],J=this.field[y];A<k&&(z|=1);C<k&&(z|=2);E<k&&(z|=8);G<k&&(z|=4);H<k&&(z|=16);N<k&&(z|=32);S<k&&(z|=128);J<k&&(z|=64);var I=THREE.edgeTable[z];if(I==0)return 0;var K=this.delta,
+W=b+K,D=c+K,K=h+K;I&1&&(this.compNorm(m),this.compNorm(p),this.VIntX(m*3,this.vlist,this.nlist,0,k,b,c,h,A,C));I&2&&(this.compNorm(p),this.compNorm(t),this.VIntY(p*3,this.vlist,this.nlist,3,k,W,c,h,C,G));I&4&&(this.compNorm(v),this.compNorm(t),this.VIntX(v*3,this.vlist,this.nlist,6,k,b,D,h,E,G));I&8&&(this.compNorm(m),this.compNorm(v),this.VIntY(m*3,this.vlist,this.nlist,9,k,b,c,h,A,E));I&16&&(this.compNorm(u),this.compNorm(x),this.VIntX(u*3,this.vlist,this.nlist,12,k,b,c,K,H,N));I&32&&(this.compNorm(x),
+this.compNorm(y),this.VIntY(x*3,this.vlist,this.nlist,15,k,W,c,K,N,J));I&64&&(this.compNorm(w),this.compNorm(y),this.VIntX(w*3,this.vlist,this.nlist,18,k,b,D,K,S,J));I&128&&(this.compNorm(u),this.compNorm(w),this.VIntY(u*3,this.vlist,this.nlist,21,k,b,c,K,H,S));I&256&&(this.compNorm(m),this.compNorm(u),this.VIntZ(m*3,this.vlist,this.nlist,24,k,b,c,h,A,H));I&512&&(this.compNorm(p),this.compNorm(x),this.VIntZ(p*3,this.vlist,this.nlist,27,k,W,c,h,C,N));I&1024&&(this.compNorm(t),this.compNorm(y),this.VIntZ(t*
+3,this.vlist,this.nlist,30,k,W,D,h,G,J));I&2048&&(this.compNorm(v),this.compNorm(w),this.VIntZ(v*3,this.vlist,this.nlist,33,k,b,D,h,E,S));z<<=4;for(k=m=0;THREE.triTable[z+k]!=-1;)b=z+k,c=b+1,h=b+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[c],3*THREE.triTable[h],n),k+=3,m++;return m};this.posnormtriv=function(b,c,h,m,k,n){var p=this.count*3;this.positionArray[p]=b[h];this.positionArray[p+1]=b[h+1];this.positionArray[p+2]=b[h+2];this.positionArray[p+3]=b[m];this.positionArray[p+
+4]=b[m+1];this.positionArray[p+5]=b[m+2];this.positionArray[p+6]=b[k];this.positionArray[p+7]=b[k+1];this.positionArray[p+8]=b[k+2];this.normalArray[p]=c[h];this.normalArray[p+1]=c[h+1];this.normalArray[p+2]=c[h+2];this.normalArray[p+3]=c[m];this.normalArray[p+4]=c[m+1];this.normalArray[p+5]=c[m+2];this.normalArray[p+6]=c[k];this.normalArray[p+7]=c[k+1];this.normalArray[p+8]=c[k+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&n(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,h,m,k){var n=this.size*Math.sqrt(m/k),p=h*this.size,v=c*this.size,u=b*this.size,t=Math.floor(p-n);t<1&&(t=1);p=Math.floor(p+n);p>this.size-1&&(p=this.size-1);var x=Math.floor(v-n);x<1&&(x=1);v=Math.floor(v+n);v>this.size-1&&(v=this.size-1);var w=Math.floor(u-n);w<1&&(w=1);n=Math.floor(u+n);n>this.size-1&&(n=this.size-
+1);for(var y,z,A,C,E,G;t<p;t++){u=this.size2*t;z=t/this.size-h;E=z*z;for(z=x;z<v;z++){A=u+this.size*z;y=z/this.size-c;G=y*y;for(y=w;y<n;y++)C=y/this.size-b,C=m/(1.0E-6+C*C+G+E)-k,C>0&&(this.field[A+y]+=C)}}};this.addPlaneX=function(b,c){var h,m,k,n,p,v=this.size,u=this.yd,t=this.zd,x=this.field,w=v*Math.sqrt(b/c);w>v&&(w=v);for(h=0;h<w;h++)if(m=h/v,m*=m,n=b/(1.0E-4+m)-c,n>0)for(m=0;m<v;m++){p=h+m*u;for(k=0;k<v;k++)x[t*k+p]+=n}};this.addPlaneY=function(b,c){var h,m,k,n,p,v,u=this.size,t=this.yd,x=
+this.zd,w=this.field,y=u*Math.sqrt(b/c);y>u&&(y=u);for(m=0;m<y;m++)if(h=m/u,h*=h,n=b/(1.0E-4+h)-c,n>0){p=m*t;for(h=0;h<u;h++){v=p+h;for(k=0;k<u;k++)w[x*k+v]+=n}}};this.addPlaneZ=function(b,c){var h,m,k,n,p,v;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/c);dist>size&&(dist=size);for(k=0;k<dist;k++)if(h=k/size,h*=h,n=b/(1.0E-4+h)-c,n>0){p=zd*k;for(m=0;m<size;m++){v=p+m*yd;for(h=0;h<size;h++)field[v+h]+=n}}};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,h,m,k,n,p,v,u,t,x=this.size-2;for(k=1;k<x;k++){t=this.size2*k;v=(k-this.halfsize)/this.halfsize;for(m=1;m<x;m++){u=t+this.size*m;p=(m-this.halfsize)/this.halfsize;for(h=1;h<x;h++)n=(h-this.halfsize)/this.halfsize,c=u+h,this.polygonize(n,p,v,c,this.isolation,b)}}this.end(b)};this.generateGeometry=function(){var b=0,c=new THREE.Geometry,h=[];this.render(function(m){var k,n,p,v,u,t,x,w;for(k=0;k<m.count;k++)x=k*3,u=x+1,w=x+2,n=m.positionArray[x],
+p=m.positionArray[u],v=m.positionArray[w],t=new THREE.Vector3(n,p,v),n=m.normalArray[x],p=m.normalArray[u],v=m.normalArray[w],x=new THREE.Vector3(n,p,v),x.normalize(),u=new THREE.Vertex(t),c.vertices.push(u),h.push(x);nfaces=m.count/3;for(k=0;k<nfaces;k++)x=(b+k)*3,u=x+1,w=x+2,t=h[x],n=h[u],p=h[w],x=new THREE.Face3(x,u,w,[t,n,p]),c.faces.push(x);b+=nfaces;m.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,
 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]);
@@ -657,27 +657,26 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
 -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,
 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);
-THREE.Trident=function(b){function c(c){return new THREE.Mesh(new THREE.CylinderGeometry(30,0.1,b.length/20,b.length/5),new THREE.MeshBasicMaterial({color:c}))}function e(b,c){var e=new THREE.Geometry;e.vertices=[new THREE.Vertex,new THREE.Vertex(b)];return new THREE.Line(e,new THREE.LineBasicMaterial({color:c}))}THREE.Object3D.call(this);var f=Math.PI/2,h,b=b||THREE.Trident.defaultParams;if(b!==THREE.Trident.defaultParams)for(h in THREE.Trident.defaultParams)b.hasOwnProperty(h)||(b[h]=THREE.Trident.defaultParams[h]);
-this.scale=new THREE.Vector3(b.scale,b.scale,b.scale);this.addChild(e(new THREE.Vector3(b.length,0,0),b.xAxisColor));this.addChild(e(new THREE.Vector3(0,b.length,0),b.yAxisColor));this.addChild(e(new THREE.Vector3(0,0,b.length),b.zAxisColor));if(b.showArrows)h=c(b.xAxisColor),h.rotation.y=-f,h.position.x=b.length,this.addChild(h),h=c(b.yAxisColor),h.rotation.x=f,h.position.y=b.length,this.addChild(h),h=c(b.zAxisColor),h.rotation.y=Math.PI,h.position.z=b.length,this.addChild(h)};
-THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.Trident.defaultParams={xAxisColor:16711680,yAxisColor:65280,zAxisColor:255,showArrows:!0,length:100,scale:1};THREE.PlaneCollider=function(b,c){this.point=b;this.normal=c};THREE.SphereCollider=function(b,c){this.center=b;this.radius=c;this.radiusSq=c*c};THREE.BoxCollider=function(b,c){this.min=b;this.max=c;this.dynamic=!0;this.normal=new THREE.Vector3};
-THREE.MeshCollider=function(b,c){this.mesh=b;this.box=c;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;THREE.CollisionSystem.prototype.merge=function(b){this.colliders=this.colliders.concat(b.colliders);this.hits=this.hits.concat(b.hits)};
-THREE.CollisionSystem.prototype.rayCastAll=function(b){b.direction.normalize();this.hits.length=0;var c,e,f,h,m=0;c=0;for(e=this.colliders.length;c<e;c++)if(h=this.colliders[c],f=this.rayCast(b,h),f<Number.MAX_VALUE)h.distance=f,f>m?this.hits.push(h):this.hits.unshift(h),m=f;return this.hits};
+THREE.Trident=function(){THREE.Object3D.call(this);var b=new THREE.Geometry;b.vertices.push(new THREE.Vertex);b.vertices.push(new THREE.Vertex(new THREE.Vector3(0,100,0)));var c=new THREE.CylinderGeometry(0,5,25,5,1),e=new THREE.Line(b,new THREE.LineBasicMaterial({color:16711680}));e.rotation.z=-Math.PI/2;this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:16711680}));e.position.x=100;e.rotation.z=-Math.PI/2;this.add(e);e=new THREE.Line(b,new THREE.LineBasicMaterial({color:65280}));
+this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:65280}));e.position.y=100;this.add(e);e=new THREE.Line(b,new THREE.LineBasicMaterial({color:255}));e.rotation.x=Math.PI/2;this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:255}));e.position.z=100;e.rotation.x=Math.PI/2;this.add(e)};THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.PlaneCollider=function(b,c){this.point=b;this.normal=c};
+THREE.SphereCollider=function(b,c){this.center=b;this.radius=c;this.radiusSq=c*c};THREE.BoxCollider=function(b,c){this.min=b;this.max=c;this.dynamic=!0;this.normal=new THREE.Vector3};THREE.MeshCollider=function(b,c){this.mesh=b;this.box=c;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;
+THREE.CollisionSystem.prototype.merge=function(b){this.colliders=this.colliders.concat(b.colliders);this.hits=this.hits.concat(b.hits)};THREE.CollisionSystem.prototype.rayCastAll=function(b){b.direction.normalize();this.hits.length=0;var c,e,f,h,m=0;c=0;for(e=this.colliders.length;c<e;c++)if(h=this.colliders[c],f=this.rayCast(b,h),f<Number.MAX_VALUE)h.distance=f,f>m?this.hits.push(h):this.hits.unshift(h),m=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.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,h,m=0;m<c.numFaces;m++){var k=c.mesh.geometry.faces[m],n=c.mesh.geometry.vertices[k.a].position,t=c.mesh.geometry.vertices[k.b].position,p=c.mesh.geometry.vertices[k.c].position,v=k instanceof THREE.Face4?c.mesh.geometry.vertices[k.d].position:null;k instanceof THREE.Face3?(k=this.rayTriangle(e,n,t,p,f,this.collisionNormal,c.mesh),k<f&&(f=k,h=m,c.normal.copy(this.collisionNormal),c.normal.normalize())):
-k instanceof THREE.Face4&&(k=this.rayTriangle(e,n,t,v,f,this.collisionNormal,c.mesh),k<f&&(f=k,h=m,c.normal.copy(this.collisionNormal),c.normal.normalize()),k=this.rayTriangle(e,t,p,v,f,this.collisionNormal,c.mesh),k<f&&(f=k,h=m,c.normal.copy(this.collisionNormal),c.normal.normalize()))}return{dist:f,faceIndex:h}};
-THREE.CollisionSystem.prototype.rayTriangle=function(b,c,e,f,h,m,k){var n=THREE.CollisionSystem.__v1,t=THREE.CollisionSystem.__v2;m.set(0,0,0);n.sub(e,c);t.sub(f,e);m.cross(n,t);n=m.dot(b.direction);if(!(n<0))if(k.doubleSided||k.flipSided)m.multiplyScalar(-1),n*=-1;else return Number.MAX_VALUE;k=m.dot(c)-m.dot(b.origin);if(!(k<=0))return Number.MAX_VALUE;if(!(k>=n*h))return Number.MAX_VALUE;k/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(k);n.addSelf(b.origin);Math.abs(m.x)>
+THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,m=0;m<c.numFaces;m++){var k=c.mesh.geometry.faces[m],n=c.mesh.geometry.vertices[k.a].position,p=c.mesh.geometry.vertices[k.b].position,v=c.mesh.geometry.vertices[k.c].position,u=k instanceof THREE.Face4?c.mesh.geometry.vertices[k.d].position:null;k instanceof THREE.Face3?(k=this.rayTriangle(e,n,p,v,f,this.collisionNormal,c.mesh),k<f&&(f=k,h=m,c.normal.copy(this.collisionNormal),c.normal.normalize())):
+k instanceof THREE.Face4&&(k=this.rayTriangle(e,n,p,u,f,this.collisionNormal,c.mesh),k<f&&(f=k,h=m,c.normal.copy(this.collisionNormal),c.normal.normalize()),k=this.rayTriangle(e,p,v,u,f,this.collisionNormal,c.mesh),k<f&&(f=k,h=m,c.normal.copy(this.collisionNormal),c.normal.normalize()))}return{dist:f,faceIndex:h}};
+THREE.CollisionSystem.prototype.rayTriangle=function(b,c,e,f,h,m,k){var n=THREE.CollisionSystem.__v1,p=THREE.CollisionSystem.__v2;m.set(0,0,0);n.sub(e,c);p.sub(f,e);m.cross(n,p);n=m.dot(b.direction);if(!(n<0))if(k.doubleSided||k.flipSided)m.multiplyScalar(-1),n*=-1;else return Number.MAX_VALUE;k=m.dot(c)-m.dot(b.origin);if(!(k<=0))return Number.MAX_VALUE;if(!(k>=n*h))return Number.MAX_VALUE;k/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(k);n.addSelf(b.origin);Math.abs(m.x)>
 Math.abs(m.y)?Math.abs(m.x)>Math.abs(m.z)?(b=n.y-c.y,m=e.y-c.y,h=f.y-c.y,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,m=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(m.y)>Math.abs(m.z)?(b=n.x-c.x,m=e.x-c.x,h=f.x-c.x,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,m=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y);c=m*f-e*h;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-n*h)*c;if(!(f>=0))return Number.MAX_VALUE;c*=m*n-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return k};
 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,h=0,m=0,k=0,n=0,t=0,p=!0;e.origin.x<c.min.x?(f=c.min.x-e.origin.x,f/=e.direction.x,p=!1,k=-1):e.origin.x>c.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,p=!1,k=1);e.origin.y<c.min.y?(h=c.min.y-e.origin.y,h/=e.direction.y,p=!1,n=-1):e.origin.y>c.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y,
-p=!1,n=1);e.origin.z<c.min.z?(m=c.min.z-e.origin.z,m/=e.direction.z,p=!1,t=-1):e.origin.z>c.max.z&&(m=c.max.z-e.origin.z,m/=e.direction.z,p=!1,t=1);if(p)return-1;p=0;h>f&&(p=1,f=h);m>f&&(p=2,f=m);switch(p){case 0:n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>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(k,0,0);break;case 1:k=e.origin.x+e.direction.x*f;if(k<c.min.x||k>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,n,0);break;case 2:k=e.origin.x+e.direction.x*f;if(k<c.min.x||k>c.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>c.max.y)return Number.MAX_VALUE;c.normal.set(0,0,t)}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,h=0,m=0,k=0,n=0,p=0,v=!0;e.origin.x<c.min.x?(f=c.min.x-e.origin.x,f/=e.direction.x,v=!1,k=-1):e.origin.x>c.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,v=!1,k=1);e.origin.y<c.min.y?(h=c.min.y-e.origin.y,h/=e.direction.y,v=!1,n=-1):e.origin.y>c.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y,
+v=!1,n=1);e.origin.z<c.min.z?(m=c.min.z-e.origin.z,m/=e.direction.z,v=!1,p=-1):e.origin.z>c.max.z&&(m=c.max.z-e.origin.z,m/=e.direction.z,v=!1,p=1);if(v)return-1;v=0;h>f&&(v=1,f=h);m>f&&(v=2,f=m);switch(v){case 0:n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>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(k,0,0);break;case 1:k=e.origin.x+e.direction.x*f;if(k<c.min.x||k>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,n,0);break;case 2:k=e.origin.x+e.direction.x*f;if(k<c.min.x||k>c.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>c.max.y)return Number.MAX_VALUE;c.normal.set(0,0,p)}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.__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))};
-if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.Camera,m=new THREE.Camera,k=new THREE.Matrix4,n=new THREE.Matrix4,t,p,v;h.useTarget=m.useTarget=!1;h.matrixAutoUpdate=m.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},u=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),w=new THREE.Camera(53,1,1,1E4);w.position.z=
-2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:u},mapRight:{type:"t",value:1,texture:x}},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;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(t!==e.aspect||p!==e.near||v!==e.fov){t=e.aspect;p=e.near;v=e.fov;var C=e.projectionMatrix.clone(),E=125/30*0.5,G=E*p/125,H=p*Math.tan(v*Math.PI/360),O;k.n14=E;n.n14=-E;E=-H*t+G;O=H*t+G;C.n11=2*p/(O-E);C.n13=(O+E)/(O-E);h.projectionMatrix=C.clone();E=-H*t-G;O=H*t-G;C.n11=2*p/(O-E);
-C.n13=(O+E)/(O-E);m.projectionMatrix=C.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=p;h.far=e.far;f.call(c,b,h,u,!0);m.matrix=e.matrixWorld.clone().multiplySelf(k);m.update(null,!0);m.position.copy(e.position);m.near=p;m.far=e.far;f.call(c,b,m,x,!0);f.call(c,y,w)}};
+if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.Camera,m=new THREE.Camera,k=new THREE.Matrix4,n=new THREE.Matrix4,p,v,u;h.useTarget=m.useTarget=!1;h.matrixAutoUpdate=m.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},t=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),w=new THREE.Camera(53,1,1,1E4);w.position.z=
+2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:t},mapRight:{type:"t",value:1,texture:x}},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);t.width=b;t.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(p!==e.aspect||v!==e.near||u!==e.fov){p=e.aspect;v=e.near;u=e.fov;var C=e.projectionMatrix.clone(),E=125/30*0.5,G=E*v/125,H=v*Math.tan(u*Math.PI/360),N;k.n14=E;n.n14=-E;E=-H*p+G;N=H*p+G;C.n11=2*v/(N-E);C.n13=(N+E)/(N-E);h.projectionMatrix=C.clone();E=-H*p-G;N=H*p-G;C.n11=2*v/(N-E);
+C.n13=(N+E)/(N-E);m.projectionMatrix=C.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=v;h.far=e.far;f.call(c,b,h,t,!0);m.matrix=e.matrixWorld.clone().multiplySelf(k);m.update(null,!0);m.position.copy(e.position);m.near=v;m.far=e.far;f.call(c,b,m,x,!0);f.call(c,y,w)}};
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,h,m,k=new THREE.Camera,n=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);h=b/2;m=f};this.render=function(b,e){this.clear();k.fov=e.fov;k.aspect=0.5*e.aspect;k.near=e.near;k.far=e.far;
 k.updateProjectionMatrix();k.position.copy(e.position);k.target.position.copy(e.target.position);k.translateX(c.separation);n.projectionMatrix=k.projectionMatrix;n.position.copy(e.position);n.target.position.copy(e.target.position);n.translateX(-c.separation);this.setViewport(0,0,h,m);f.call(c,b,k);this.setViewport(h,0,h,m);f.call(c,b,n,!1)}};

+ 6 - 6
build/custom/ThreeCanvas.js

@@ -1,16 +1,16 @@
 // ThreeCanvas.js r45dev - 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(!self.Int32Array)self.Int32Array=Array,self.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,f,g;if(c==0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),f=a*6-d,a=c*(1-b),g=c*(1-b*f),b=c*(1-b*(1-f)),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)}};
 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},
 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)},
 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=
-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*
-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.x=a||0;this.y=b||0;this.z=c||0;this.w=d||1};
+THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},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){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*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.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};

+ 6 - 6
build/custom/ThreeDOM.js

@@ -1,16 +1,16 @@
 // ThreeDOM.js r45dev - 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(!self.Int32Array)self.Int32Array=Array,self.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=
 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.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},
 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)},
 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=
-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*
-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.x=a||0;this.y=b||0;this.z=c||0;this.w=d||1};
+THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},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){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*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.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};

+ 207 - 208
build/custom/ThreeExtras.js

@@ -1,18 +1,18 @@
 // ThreeExtras.js r45dev - http://github.com/mrdoob/three.js
-THREE.ColorUtils={adjustHSV:function(a,b,c,e){var g=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,g);g.h=THREE.ColorUtils.clamp(g.h+b,0,1);g.s=THREE.ColorUtils.clamp(g.s+c,0,1);g.v=THREE.ColorUtils.clamp(g.v+e,0,1);a.setHSV(g.h,g.s,g.v)},rgbToHsv:function(a,b){var c=a.r,e=a.g,g=a.b,h=Math.max(Math.max(c,e),g),f=Math.min(Math.min(c,e),g);if(f==h)f=c=0;else{var k=h-f,f=k/h,c=c==h?(e-g)/k:e==h?2+(g-c)/k:4+(c-e)/k;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=f;b.v=h;return b},
+THREE.ColorUtils={adjustHSV:function(a,b,c,e){var h=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,h);h.h=THREE.ColorUtils.clamp(h.h+b,0,1);h.s=THREE.ColorUtils.clamp(h.s+c,0,1);h.v=THREE.ColorUtils.clamp(h.v+e,0,1);a.setHSV(h.h,h.s,h.v)},rgbToHsv:function(a,b){var c=a.r,e=a.g,h=a.b,g=Math.max(Math.max(c,e),h),f=Math.min(Math.min(c,e),h);if(f==g)f=c=0;else{var k=g-f,f=k/g,c=c==g?(e-h)/k:e==g?2+(h-c)/k:4+(c-e)/k;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=f;b.v=g;return b},
 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,g=c?b.geometry:b,h=a.vertices,f=g.vertices,k=a.faces,l=g.faces,m=a.faceVertexUvs[0],g=g.faceVertexUvs[0];c&&b.matrixAutoUpdate&&b.updateMatrix();for(var n=0,o=f.length;n<o;n++){var p=new THREE.Vertex(f[n].position.clone());c&&b.matrix.multiplyVector3(p.position);h.push(p)}n=0;for(o=l.length;n<o;n++){var f=l[n],t,x,v=f.vertexNormals,p=f.vertexColors;f instanceof THREE.Face3?t=new THREE.Face3(f.a+e,f.b+e,f.c+
-e):f instanceof THREE.Face4&&(t=new THREE.Face4(f.a+e,f.b+e,f.c+e,f.d+e));t.normal.copy(f.normal);c=0;for(h=v.length;c<h;c++)x=v[c],t.vertexNormals.push(x.clone());t.color.copy(f.color);c=0;for(h=p.length;c<h;c++)x=p[c],t.vertexColors.push(x.clone());t.materials=f.materials.slice();t.centroid.copy(f.centroid);k.push(t)}n=0;for(o=g.length;n<o;n++){e=g[n];k=[];c=0;for(h=e.length;c<h;c++)k.push(new THREE.UV(e[c].u,e[c].v));m.push(k)}},clone:function(a){var b=new THREE.Geometry,c,e=a.vertices,g=a.faces,
-h=a.faceVertexUvs[0],a=0;for(c=e.length;a<c;a++){var f=new THREE.Vertex(e[a].position.clone());b.vertices.push(f)}a=0;for(c=g.length;a<c;a++){var k=g[a],l,m,n=k.vertexNormals,o=k.vertexColors;k instanceof THREE.Face3?l=new THREE.Face3(k.a,k.b,k.c):k instanceof THREE.Face4&&(l=new THREE.Face4(k.a,k.b,k.c,k.d));l.normal.copy(k.normal);e=0;for(f=n.length;e<f;e++)m=n[e],l.vertexNormals.push(m.clone());l.color.copy(k.color);e=0;for(f=o.length;e<f;e++)m=o[e],l.vertexColors.push(m.clone());l.materials=k.materials.slice();
-l.centroid.copy(k.centroid);b.faces.push(l)}a=0;for(c=h.length;a<c;a++){g=h[a];l=[];e=0;for(f=g.length;e<f;e++)l.push(new THREE.UV(g[e].u,g[e].v));b.faceVertexUvs[0].push(l)}return b},randomPointInTriangle:function(a,b,c){var e,g,h,f=new THREE.Vector3,k=THREE.GeometryUtils.__v1;e=THREE.GeometryUtils.random();g=THREE.GeometryUtils.random();e+g>1&&(e=1-e,g=1-g);h=1-e-g;f.copy(a);f.multiplyScalar(e);k.copy(b);k.multiplyScalar(g);f.addSelf(k);k.copy(c);k.multiplyScalar(h);f.addSelf(k);return f},randomPointInFace:function(a,
-b,c){var e,g,h;if(a instanceof THREE.Face3)return e=b.vertices[a.a].position,g=b.vertices[a.b].position,h=b.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(e,g,h);else if(a instanceof THREE.Face4){e=b.vertices[a.a].position;g=b.vertices[a.b].position;h=b.vertices[a.c].position;var b=b.vertices[a.d].position,f;c?a._area1&&a._area2?(c=a._area1,f=a._area2):(c=THREE.GeometryUtils.triangleArea(e,g,b),f=THREE.GeometryUtils.triangleArea(g,h,b),a._area1=c,a._area2=f):(c=THREE.GeometryUtils.triangleArea(e,
-g,b),f=THREE.GeometryUtils.triangleArea(g,h,b));return THREE.GeometryUtils.random()*(c+f)<c?THREE.GeometryUtils.randomPointInTriangle(e,g,b):THREE.GeometryUtils.randomPointInTriangle(g,h,b)}},randomPointsInGeometry:function(a,b){function c(a){function c(b,e){if(e<b)return b;var f=b+Math.floor((e-b)/2);return m[f]>a?c(b,f-1):m[f]<a?c(f+1,e):f}return c(0,m.length-1)}var e,g,h=a.faces,f=a.vertices,k=h.length,l=0,m=[],n,o,p,t;for(g=0;g<k;g++){e=h[g];if(e instanceof THREE.Face3)n=f[e.a].position,o=f[e.b].position,
-p=f[e.c].position,e._area=THREE.GeometryUtils.triangleArea(n,o,p);else if(e instanceof THREE.Face4)n=f[e.a].position,o=f[e.b].position,p=f[e.c].position,t=f[e.d].position,e._area1=THREE.GeometryUtils.triangleArea(n,o,t),e._area2=THREE.GeometryUtils.triangleArea(o,p,t),e._area=e._area1+e._area2;l+=e._area;m[g]=l}e=[];f={};for(g=0;g<b;g++)k=THREE.GeometryUtils.random()*l,k=c(k),e[g]=THREE.GeometryUtils.randomPointInFace(h[k],a,!0),f[k]?f[k]+=1:f[k]=1;return e},triangleArea:function(a,b,c){var e,g=THREE.GeometryUtils.__v1;
-g.sub(a,b);e=g.length();g.sub(a,c);a=g.length();g.sub(b,c);c=g.length();b=0.5*(e+a+c);return Math.sqrt(b*(b-e)*(b-a)*(b-c))},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(a,b,c){var e=new Image,g=new THREE.Texture(e,b);e.onload=function(){g.needsUpdate=!0;c&&c(this)};e.crossOrigin="";e.src=a;return g},loadTextureCube:function(a,b,c){var e,g=[],h=new THREE.Texture(g,b),b=g.loadCount=0;for(e=a.length;b<e;++b)g[b]=new Image,g[b].onload=function(){g.loadCount+=1;if(g.loadCount==6)h.needsUpdate=!0;c&&c(this)},g[b].crossOrigin="",g[b].src=a[b];return h},getNormalMap:function(a,b){var c=function(a){var c=Math.sqrt(a[0]*a[0]+a[1]*a[1]+
-a[2]*a[2]);return[a[0]/c,a[1]/c,a[2]/c]};b|=1;var e=a.width,g=a.height,h=document.createElement("canvas");h.width=e;h.height=g;var f=h.getContext("2d");f.drawImage(a,0,0);for(var k=f.getImageData(0,0,e,g).data,l=f.createImageData(e,g),m=l.data,n=0;n<e;n++)for(var o=1;o<g;o++){var p=o-1<0?g-1:o-1,t=(o+1)%g,x=n-1<0?e-1:n-1,v=(n+1)%e,u=[],z=[0,0,k[(o*e+n)*4]/255*b];u.push([-1,0,k[(o*e+x)*4]/255*b]);u.push([-1,-1,k[(p*e+x)*4]/255*b]);u.push([0,-1,k[(p*e+n)*4]/255*b]);u.push([1,-1,k[(p*e+v)*4]/255*b]);
+THREE.GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,e=a.vertices.length,h=c?b.geometry:b,g=a.vertices,f=h.vertices,k=a.faces,l=h.faces,m=a.faceVertexUvs[0],h=h.faceVertexUvs[0];c&&b.matrixAutoUpdate&&b.updateMatrix();for(var n=0,o=f.length;n<o;n++){var p=new THREE.Vertex(f[n].position.clone());c&&b.matrix.multiplyVector3(p.position);g.push(p)}n=0;for(o=l.length;n<o;n++){var f=l[n],t,x,v=f.vertexNormals,p=f.vertexColors;f instanceof THREE.Face3?t=new THREE.Face3(f.a+e,f.b+e,f.c+
+e):f instanceof THREE.Face4&&(t=new THREE.Face4(f.a+e,f.b+e,f.c+e,f.d+e));t.normal.copy(f.normal);c=0;for(g=v.length;c<g;c++)x=v[c],t.vertexNormals.push(x.clone());t.color.copy(f.color);c=0;for(g=p.length;c<g;c++)x=p[c],t.vertexColors.push(x.clone());t.materials=f.materials.slice();t.centroid.copy(f.centroid);k.push(t)}n=0;for(o=h.length;n<o;n++){e=h[n];k=[];c=0;for(g=e.length;c<g;c++)k.push(new THREE.UV(e[c].u,e[c].v));m.push(k)}},clone:function(a){var b=new THREE.Geometry,c,e=a.vertices,h=a.faces,
+g=a.faceVertexUvs[0],a=0;for(c=e.length;a<c;a++){var f=new THREE.Vertex(e[a].position.clone());b.vertices.push(f)}a=0;for(c=h.length;a<c;a++){var k=h[a],l,m,n=k.vertexNormals,o=k.vertexColors;k instanceof THREE.Face3?l=new THREE.Face3(k.a,k.b,k.c):k instanceof THREE.Face4&&(l=new THREE.Face4(k.a,k.b,k.c,k.d));l.normal.copy(k.normal);e=0;for(f=n.length;e<f;e++)m=n[e],l.vertexNormals.push(m.clone());l.color.copy(k.color);e=0;for(f=o.length;e<f;e++)m=o[e],l.vertexColors.push(m.clone());l.materials=k.materials.slice();
+l.centroid.copy(k.centroid);b.faces.push(l)}a=0;for(c=g.length;a<c;a++){h=g[a];l=[];e=0;for(f=h.length;e<f;e++)l.push(new THREE.UV(h[e].u,h[e].v));b.faceVertexUvs[0].push(l)}return b},randomPointInTriangle:function(a,b,c){var e,h,g,f=new THREE.Vector3,k=THREE.GeometryUtils.__v1;e=THREE.GeometryUtils.random();h=THREE.GeometryUtils.random();e+h>1&&(e=1-e,h=1-h);g=1-e-h;f.copy(a);f.multiplyScalar(e);k.copy(b);k.multiplyScalar(h);f.addSelf(k);k.copy(c);k.multiplyScalar(g);f.addSelf(k);return f},randomPointInFace:function(a,
+b,c){var e,h,g;if(a instanceof THREE.Face3)return e=b.vertices[a.a].position,h=b.vertices[a.b].position,g=b.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(e,h,g);else if(a instanceof THREE.Face4){e=b.vertices[a.a].position;h=b.vertices[a.b].position;g=b.vertices[a.c].position;var b=b.vertices[a.d].position,f;c?a._area1&&a._area2?(c=a._area1,f=a._area2):(c=THREE.GeometryUtils.triangleArea(e,h,b),f=THREE.GeometryUtils.triangleArea(h,g,b),a._area1=c,a._area2=f):(c=THREE.GeometryUtils.triangleArea(e,
+h,b),f=THREE.GeometryUtils.triangleArea(h,g,b));return THREE.GeometryUtils.random()*(c+f)<c?THREE.GeometryUtils.randomPointInTriangle(e,h,b):THREE.GeometryUtils.randomPointInTriangle(h,g,b)}},randomPointsInGeometry:function(a,b){function c(a){function c(b,e){if(e<b)return b;var f=b+Math.floor((e-b)/2);return m[f]>a?c(b,f-1):m[f]<a?c(f+1,e):f}return c(0,m.length-1)}var e,h,g=a.faces,f=a.vertices,k=g.length,l=0,m=[],n,o,p,t;for(h=0;h<k;h++){e=g[h];if(e instanceof THREE.Face3)n=f[e.a].position,o=f[e.b].position,
+p=f[e.c].position,e._area=THREE.GeometryUtils.triangleArea(n,o,p);else if(e instanceof THREE.Face4)n=f[e.a].position,o=f[e.b].position,p=f[e.c].position,t=f[e.d].position,e._area1=THREE.GeometryUtils.triangleArea(n,o,t),e._area2=THREE.GeometryUtils.triangleArea(o,p,t),e._area=e._area1+e._area2;l+=e._area;m[h]=l}e=[];f={};for(h=0;h<b;h++)k=THREE.GeometryUtils.random()*l,k=c(k),e[h]=THREE.GeometryUtils.randomPointInFace(g[k],a,!0),f[k]?f[k]+=1:f[k]=1;return e},triangleArea:function(a,b,c){var e,h=THREE.GeometryUtils.__v1;
+h.sub(a,b);e=h.length();h.sub(a,c);a=h.length();h.sub(b,c);c=h.length();b=0.5*(e+a+c);return Math.sqrt(b*(b-e)*(b-a)*(b-c))},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(a,b,c){var e=new Image,h=new THREE.Texture(e,b);e.onload=function(){h.needsUpdate=!0;c&&c(this)};e.crossOrigin="";e.src=a;return h},loadTextureCube:function(a,b,c){var e,h=[],g=new THREE.Texture(h,b),b=h.loadCount=0;for(e=a.length;b<e;++b)h[b]=new Image,h[b].onload=function(){h.loadCount+=1;if(h.loadCount==6)g.needsUpdate=!0;c&&c(this)},h[b].crossOrigin="",h[b].src=a[b];return g},getNormalMap:function(a,b){var c=function(a){var c=Math.sqrt(a[0]*a[0]+a[1]*a[1]+
+a[2]*a[2]);return[a[0]/c,a[1]/c,a[2]/c]};b|=1;var e=a.width,h=a.height,g=document.createElement("canvas");g.width=e;g.height=h;var f=g.getContext("2d");f.drawImage(a,0,0);for(var k=f.getImageData(0,0,e,h).data,l=f.createImageData(e,h),m=l.data,n=0;n<e;n++)for(var o=1;o<h;o++){var p=o-1<0?h-1:o-1,t=(o+1)%h,x=n-1<0?e-1:n-1,v=(n+1)%e,u=[],z=[0,0,k[(o*e+n)*4]/255*b];u.push([-1,0,k[(o*e+x)*4]/255*b]);u.push([-1,-1,k[(p*e+x)*4]/255*b]);u.push([0,-1,k[(p*e+n)*4]/255*b]);u.push([1,-1,k[(p*e+v)*4]/255*b]);
 u.push([1,0,k[(o*e+v)*4]/255*b]);u.push([1,1,k[(t*e+v)*4]/255*b]);u.push([0,1,k[(t*e+n)*4]/255*b]);u.push([-1,1,k[(t*e+x)*4]/255*b]);p=[];x=u.length;for(t=0;t<x;t++){var v=u[t],y=u[(t+1)%x],v=[v[0]-z[0],v[1]-z[1],v[2]-z[2]],y=[y[0]-z[0],y[1]-z[1],y[2]-z[2]];p.push(c([v[1]*y[2]-v[2]*y[1],v[2]*y[0]-v[0]*y[2],v[0]*y[1]-v[1]*y[0]]))}u=[0,0,0];for(t=0;t<p.length;t++)u[0]+=p[t][0],u[1]+=p[t][1],u[2]+=p[t][2];u[0]/=p.length;u[1]/=p.length;u[2]/=p.length;z=(o*e+n)*4;m[z]=(u[0]+1)/2*255|0;m[z+1]=(u[1]+0.5)*
-255|0;m[z+2]=u[2]*255|0;m[z+3]=255}f.putImageData(l,0,0);return h}};THREE.SceneUtils={showHierarchy:function(a,b){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=b})},traverseHierarchy:function(a,b){var c,e,g=a.children.length;for(e=0;e<g;e++)c=a.children[e],b(c),THREE.SceneUtils.traverseHierarchy(c,b)}};
+255|0;m[z+2]=u[2]*255|0;m[z+3]=255}f.putImageData(l,0,0);return g}};THREE.SceneUtils={showHierarchy:function(a,b){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=b})},traverseHierarchy:function(a,b){var c,e,h=a.children.length;for(e=0;e<h;e++)c=a.children[e],b(c),THREE.SceneUtils.traverseHierarchy(c,b)}};
 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}"},
 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",
@@ -21,64 +21,64 @@ THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( 1.0 );\
 THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:"attribute vec4 tangent;\n#ifdef VERTEX_TEXTURES\nuniform sampler2D tDisplacement;\nuniform float uDisplacementScale;\nuniform float uDisplacementBias;\n#endif\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvViewPosition = -mvPosition.xyz;\nvNormal = normalize( normalMatrix * normal );\nvTangent = normalize( normalMatrix * tangent.xyz );\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvBinormal = normalize( vBinormal );\nvUv = uv;\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#ifdef VERTEX_TEXTURES\nvec3 dv = texture2D( tDisplacement, uv ).xyz;\nfloat df = uDisplacementScale * dv.x + uDisplacementBias;\nvec4 displacedPosition = vec4( vNormal.xyz * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif\n}"},
 cube:{uniforms:{tCube:{type:"t",value:1,texture:null}},vertexShader:"varying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvViewPosition = cameraPosition - mPosition.xyz;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform samplerCube tCube;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( - wPos.x, wPos.yz ) );\n}"}}};
 THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){return this.getPoint(this.getUtoTmapping(a))};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};
-THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1)return this.cacheArcLengths;var b=[],c,e=this.getPoint(0),g,h=0;b.push(0);for(g=1;g<=a;g++)c=this.getPoint(g/a),h+=c.distanceTo(e),b.push(h),e=c;return this.cacheArcLengths=b};
-THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),e=0,g=c.length,h;h=b?b:a*c[g-1];time=Date.now();for(var f=0,k=g-1,l;f<=k;)if(e=Math.floor(f+(k-f)/2),l=c[e]-h,l<0)f=e+1;else if(l>0)k=e-1;else{k=e;break}e=k;if(c[e]==h)return e/(g-1);f=c[e];return c=(e+(h-f)/(c[e+1]-f))/(g-1)};THREE.Curve.prototype.getNormalVector=function(a){a=this.getTangent(a);return new THREE.Vector2(-a.y,a.x)};
+THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1)return this.cacheArcLengths;var b=[],c,e=this.getPoint(0),h,g=0;b.push(0);for(h=1;h<=a;h++)c=this.getPoint(h/a),g+=c.distanceTo(e),b.push(g),e=c;return this.cacheArcLengths=b};
+THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),e=0,h=c.length,g;g=b?b:a*c[h-1];time=Date.now();for(var f=0,k=h-1,l;f<=k;)if(e=Math.floor(f+(k-f)/2),l=c[e]-g,l<0)f=e+1;else if(l>0)k=e-1;else{k=e;break}e=k;if(c[e]==g)return e/(h-1);f=c[e];return c=(e+(g-f)/(c[e+1]-f))/(h-1)};THREE.Curve.prototype.getNormalVector=function(a){a=this.getTangent(a);return new THREE.Vector2(-a.y,a.x)};
 THREE.Curve.prototype.getTangent=function(a){var b=a-1.0E-4;a+=1.0E-4;b<0&&(b=0);a>1&&(a=1);var b=this.getPoint(b),a=this.getPoint(a),c=new THREE.Vector2;c.sub(a,b);return c.unit()};THREE.LineCurve=function(a,b){a instanceof THREE.Vector2?(this.v1=a,this.v2=b):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(a,b,c,e){this.constructor(new THREE.Vector2(a,b),new THREE.Vector2(c,e))};THREE.LineCurve.prototype=new THREE.Curve;
 THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.multiplyScalar(a).addSelf(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(){var a=new THREE.Vector2;a.sub(this.v2,this.v1);a.normalize();return a};
 THREE.QuadraticBezierCurve=function(a,b,c){if(!(b instanceof THREE.Vector2))var e=Array.prototype.slice.call(arguments),a=new THREE.Vector2(e[0],e[1]),b=new THREE.Vector2(e[2],e[3]),c=new THREE.Vector2(e[4],e[5]);this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
 THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};
-THREE.CubicBezierCurve=function(a,b,c,e){if(!(b instanceof THREE.Vector2))var g=Array.prototype.slice.call(arguments),a=new THREE.Vector2(g[0],g[1]),b=new THREE.Vector2(g[2],g[3]),c=new THREE.Vector2(g[4],g[5]),e=new THREE.Vector2(g[6],g[7]);this.v0=a;this.v1=b;this.v2=c;this.v3=e};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve;
+THREE.CubicBezierCurve=function(a,b,c,e){if(!(b instanceof THREE.Vector2))var h=Array.prototype.slice.call(arguments),a=new THREE.Vector2(h[0],h[1]),b=new THREE.Vector2(h[2],h[3]),c=new THREE.Vector2(h[4],h[5]),e=new THREE.Vector2(h[6],h[7]);this.v0=a;this.v1=b;this.v2=c;this.v3=e};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve;
 THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b};
 THREE.SplineCurve=function(a){this.points=a};THREE.SplineCurve.prototype=new THREE.Curve;THREE.SplineCurve.prototype.constructor=THREE.SplineCurve;
-THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],e=this.points,g;g=(e.length-1)*a;a=Math.floor(g);g-=a;c[0]=a==0?a:a-1;c[1]=a;c[2]=a>e.length-2?a:a+1;c[3]=a>e.length-3?a:a+2;b.x=THREE.Curve.Utils.interpolate(e[c[0]].x,e[c[1]].x,e[c[2]].x,e[c[3]].x,g);b.y=THREE.Curve.Utils.interpolate(e[c[0]].y,e[c[1]].y,e[c[2]].y,e[c[3]].y,g);return b};THREE.ArcCurve=function(a,b,c,e,g,h){this.aX=a;this.aY=b;this.aRadius=c;this.aStartAngle=e;this.aEndAngle=g;this.aClockwise=h};
+THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],e=this.points,h;h=(e.length-1)*a;a=Math.floor(h);h-=a;c[0]=a==0?a:a-1;c[1]=a;c[2]=a>e.length-2?a:a+1;c[3]=a>e.length-3?a:a+2;b.x=THREE.Curve.Utils.interpolate(e[c[0]].x,e[c[1]].x,e[c[2]].x,e[c[3]].x,h);b.y=THREE.Curve.Utils.interpolate(e[c[0]].y,e[c[1]].y,e[c[2]].y,e[c[3]].y,h);return b};THREE.ArcCurve=function(a,b,c,e,h,g){this.aX=a;this.aY=b;this.aRadius=c;this.aStartAngle=e;this.aEndAngle=h;this.aClockwise=g};
 THREE.ArcCurve.prototype=new THREE.Curve;THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.ArcCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;this.aClockwise||(a=1-a);a=this.aStartAngle+a*b;return new THREE.Vector2(this.aX+this.aRadius*Math.cos(a),this.aY+this.aRadius*Math.sin(a))};
-THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,e){return 2*(1-a)*(c-b)+2*a*(e-c)},tangentCubicBezier:function(a,b,c,e,g){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*e*(1-a)-3*a*a*e+3*a*a*g},tangentSpline:function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,e,g){var a=(c-a)*0.5,e=(e-b)*0.5,h=g*g;return(2*b-2*c+a+e)*g*h+(-3*b+3*c-2*a-e)*h+a*g+b}};
+THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,e){return 2*(1-a)*(c-b)+2*a*(e-c)},tangentCubicBezier:function(a,b,c,e,h){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*e*(1-a)-3*a*a*e+3*a*a*h},tangentSpline:function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,e,h){var a=(c-a)*0.5,e=(e-b)*0.5,g=h*h;return(2*b-2*c+a+e)*h*g+(-3*b+3*c-2*a-e)*g+a*h+b}};
 THREE.Curve.create=function(a,b){a.prototype=new THREE.Curve;a.prototype.constructor=a;a.prototype.getPoint=b;return a};THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.sub(v2,v1);b.multiplyScalar(a);b.addSelf(this.v1);return b});
 THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b,c;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);a=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(b,c,a)});THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};
 THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){};THREE.CurvePath.prototype.getPoint=function(a){for(var b=a*this.getLength(),c=this.getCurveLengths(),a=0;a<c.length;){if(c[a]>=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]};
 THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,e=this.curves.length;for(c=0;c<e;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a};
-THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,e,g;b=c=Number.NEGATIVE_INFINITY;e=g=Number.POSITIVE_INFINITY;var h,f,k,l;l=new THREE.Vector2;f=0;for(k=a.length;f<k;f++){h=a[f];if(h.x>b)b=h.x;else if(h.x<e)e=h.x;if(h.y>c)c=h.y;else if(h.y<c)g=h.y;l.addSelf(h.x,h.y)}return{minX:e,minY:g,maxX:b,maxY:c,centroid:l.divideScalar(k)}};THREE.CurvePath.prototype.createPointsGeometry=function(a){return this.createGeometry(this.getPoints(a,!0))};
+THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,e,h;b=c=Number.NEGATIVE_INFINITY;e=h=Number.POSITIVE_INFINITY;var g,f,k,l;l=new THREE.Vector2;f=0;for(k=a.length;f<k;f++){g=a[f];if(g.x>b)b=g.x;else if(g.x<e)e=g.x;if(g.y>c)c=g.y;else if(g.y<c)h=g.y;l.addSelf(g.x,g.y)}return{minX:e,minY:h,maxX:b,maxY:c,centroid:l.divideScalar(k)}};THREE.CurvePath.prototype.createPointsGeometry=function(a){return this.createGeometry(this.getPoints(a,!0))};
 THREE.CurvePath.prototype.createSpacedPointsGeometry=function(a){return this.createGeometry(this.getSpacedPoints(a,!0))};THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(new THREE.Vertex(new THREE.Vector3(a[c].x,a[c].y,0)));return b};THREE.CurvePath.prototype.addWrapPath=function(a){this.bends.push(a)};
-THREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c=this.getPoints(a),e,g;if(!b)b=this.bends;e=0;for(g=b.length;e<g;e++)c=this.getWrapPoints(c,b[e]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),e,g;if(!b)b=this.bends;e=0;for(g=b.length;e<g;e++)c=this.getWrapPoints(c,b[e]);return c};
-THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),e,g,h,f,k,l;e=0;for(g=a.length;e<g;e++)h=a[e],f=h.x,k=h.y,l=f/c.maxX,l=b.getUtoTmapping(l,f),f=b.getPoint(l),k=b.getNormalVector(l).multiplyScalar(k),h.x=f.x+k.x,h.y=f.y+k.y;return a};THREE.Path=function(a){THREE.CurvePath.call(this);this.actions=[];a&&this.fromPoints(a)};THREE.Path.prototype=new THREE.CurvePath;THREE.Path.prototype.constructor=THREE.Path;
+THREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c=this.getPoints(a),e,h;if(!b)b=this.bends;e=0;for(h=b.length;e<h;e++)c=this.getWrapPoints(c,b[e]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),e,h;if(!b)b=this.bends;e=0;for(h=b.length;e<h;e++)c=this.getWrapPoints(c,b[e]);return c};
+THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),e,h,g,f,k,l;e=0;for(h=a.length;e<h;e++)g=a[e],f=g.x,k=g.y,l=f/c.maxX,l=b.getUtoTmapping(l,f),f=b.getPoint(l),k=b.getNormalVector(l).multiplyScalar(k),g.x=f.x+k.x,g.y=f.y+k.y;return a};THREE.Path=function(a){THREE.CurvePath.call(this);this.actions=[];a&&this.fromPoints(a)};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(a){this.moveTo(a[0].x,a[0].y);var b,c=a.length;for(b=1;b<c;b++)this.lineTo(a[b].x,a[b].y)};THREE.Path.prototype.moveTo=function(){var a=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:a})};
 THREE.Path.prototype.lineTo=function(a,b){var c=Array.prototype.slice.call(arguments),e=this.actions[this.actions.length-1].args;this.curves.push(new THREE.LineCurve(new THREE.Vector2(e[e.length-2],e[e.length-1]),new THREE.Vector2(a,b)));this.actions.push({action:THREE.PathActions.LINE_TO,args:c})};
-THREE.Path.prototype.quadraticCurveTo=function(a,b,c,e){var g=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args;this.curves.push(new THREE.QuadraticBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,e)));this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:g})};
-THREE.Path.prototype.bezierCurveTo=function(a,b,c,e,g,h){var f=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(a,b),new THREE.Vector2(c,e),new THREE.Vector2(g,h)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:f})};
-THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])],c=c.concat(a);this.curves.push(new THREE.SplineCurve(c));this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,e,g,h){var f=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(a,b,c,e,g,h));this.actions.push({action:THREE.PathActions.ARC,args:f})};
+THREE.Path.prototype.quadraticCurveTo=function(a,b,c,e){var h=Array.prototype.slice.call(arguments),g=this.actions[this.actions.length-1].args;this.curves.push(new THREE.QuadraticBezierCurve(new THREE.Vector2(g[g.length-2],g[g.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,e)));this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:h})};
+THREE.Path.prototype.bezierCurveTo=function(a,b,c,e,h,g){var f=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(a,b),new THREE.Vector2(c,e),new THREE.Vector2(h,g)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:f})};
+THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])],c=c.concat(a);this.curves.push(new THREE.SplineCurve(c));this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,e,h,g){var f=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(a,b,c,e,h,g));this.actions.push({action:THREE.PathActions.ARC,args:f})};
 THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;c<a;c++)b.push(this.getPoint(c/a));return b};
-THREE.Path.prototype.getPoints=function(a,b){var a=a||12,c=[],e,g,h,f,k,l,m,n,o,p,t,x,v;e=0;for(g=this.actions.length;e<g;e++)switch(h=this.actions[e],f=h.action,h=h.args,f){case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(h[0],h[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:k=h[2];l=h[3];o=h[0];p=h[1];c.length>0?(f=c[c.length-1],t=f.x,x=f.y):(f=this.actions[e-1].args,t=f[f.length-2],x=f[f.length-1]);for(f=1;f<=a;f++)v=f/a,h=THREE.Shape.Utils.b2(v,t,o,k),v=THREE.Shape.Utils.b2(v,x,p,
-l),c.push(new THREE.Vector2(h,v));break;case THREE.PathActions.BEZIER_CURVE_TO:k=h[4];l=h[5];o=h[0];p=h[1];m=h[2];n=h[3];c.length>0?(f=c[c.length-1],t=f.x,x=f.y):(f=this.actions[e-1].args,t=f[f.length-2],x=f[f.length-1]);for(f=1;f<=a;f++)v=f/a,h=THREE.Shape.Utils.b3(v,t,o,m,k),v=THREE.Shape.Utils.b3(v,x,p,n,l),c.push(new THREE.Vector2(h,v));break;case THREE.PathActions.CSPLINE_THRU:f=this.actions[e-1].args;f=[new THREE.Vector2(f[f.length-2],f[f.length-1])];v=a*h[0].length;f=f.concat(h[0]);h=new THREE.SplineCurve(f);
-for(f=1;f<=v;f++)c.push(h.getPointAt(f/v));break;case THREE.PathActions.ARC:f=this.actions[e-1].args;k=h[0];l=h[1];m=h[2];o=h[3];v=h[4];p=!!h[5];n=f[f.length-2];t=f[f.length-1];f.length==0&&(n=t=0);x=v-o;var u=a*2;for(f=1;f<=u;f++)v=f/u,p||(v=1-v),v=o+v*x,h=n+k+m*Math.cos(v),v=t+l+m*Math.sin(v),c.push(new THREE.Vector2(h,v))}b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)};
-THREE.Path.prototype.nltransform=function(a,b,c,e,g,h){var f=this.getPoints(),k,l,m,n,o;k=0;for(l=f.length;k<l;k++)m=f[k],n=m.x,o=m.y,m.x=a*n+b*o+c,m.y=e*o+g*n+h;return f};
-THREE.Path.prototype.debug=function(a){var b=this.getBoundingBox();a||(a=document.createElement("canvas"),a.setAttribute("width",b.maxX+100),a.setAttribute("height",b.maxY+100),document.body.appendChild(a));b=a.getContext("2d");b.fillStyle="white";b.fillRect(0,0,a.width,a.height);b.strokeStyle="black";b.beginPath();var c,e,g,a=0;for(c=this.actions.length;a<c;a++)e=this.actions[a],g=e.args,e=e.action,e!=THREE.PathActions.CSPLINE_THRU&&b[e].apply(b,g);b.stroke();b.closePath();b.strokeStyle="red";e=
-this.getPoints();a=0;for(c=e.length;a<c;a++)g=e[a],b.beginPath(),b.arc(g.x,g.y,1.5,0,Math.PI*2,!1),b.stroke(),b.closePath()};
-THREE.Path.prototype.toShapes=function(){var a,b,c,e,g=[],h=new THREE.Path;a=0;for(b=this.actions.length;a<b;a++)c=this.actions[a],e=c.args,c=c.action,c==THREE.PathActions.MOVE_TO&&h.actions.length!=0&&(g.push(h),h=new THREE.Path),h[c].apply(h,e);h.actions.length!=0&&g.push(h);if(g.length==0)return[];var f,h=[];if(THREE.Shape.Utils.isClockWise(g[0].getPoints())){a=0;for(b=g.length;a<b;a++)e=g[a],THREE.Shape.Utils.isClockWise(e.getPoints())?(f&&h.push(f),f=new THREE.Shape,f.actions=e.actions,f.curves=
-e.curves):f.holes.push(e);h.push(f)}else{f=new THREE.Shape;a=0;for(b=g.length;a<b;a++)e=g[a],THREE.Shape.Utils.isClockWise(e.getPoints())?(f.actions=e.actions,f.curves=e.curves,h.push(f),f=new THREE.Shape):f.holes.push(e)}return h};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(a){return new THREE.ExtrudeGeometry(this,a)};
+THREE.Path.prototype.getPoints=function(a,b){var a=a||12,c=[],e,h,g,f,k,l,m,n,o,p,t,x,v;e=0;for(h=this.actions.length;e<h;e++)switch(g=this.actions[e],f=g.action,g=g.args,f){case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:k=g[2];l=g[3];o=g[0];p=g[1];c.length>0?(f=c[c.length-1],t=f.x,x=f.y):(f=this.actions[e-1].args,t=f[f.length-2],x=f[f.length-1]);for(f=1;f<=a;f++)v=f/a,g=THREE.Shape.Utils.b2(v,t,o,k),v=THREE.Shape.Utils.b2(v,x,p,
+l),c.push(new THREE.Vector2(g,v));break;case THREE.PathActions.BEZIER_CURVE_TO:k=g[4];l=g[5];o=g[0];p=g[1];m=g[2];n=g[3];c.length>0?(f=c[c.length-1],t=f.x,x=f.y):(f=this.actions[e-1].args,t=f[f.length-2],x=f[f.length-1]);for(f=1;f<=a;f++)v=f/a,g=THREE.Shape.Utils.b3(v,t,o,m,k),v=THREE.Shape.Utils.b3(v,x,p,n,l),c.push(new THREE.Vector2(g,v));break;case THREE.PathActions.CSPLINE_THRU:f=this.actions[e-1].args;f=[new THREE.Vector2(f[f.length-2],f[f.length-1])];v=a*g[0].length;f=f.concat(g[0]);g=new THREE.SplineCurve(f);
+for(f=1;f<=v;f++)c.push(g.getPointAt(f/v));break;case THREE.PathActions.ARC:f=this.actions[e-1].args;k=g[0];l=g[1];m=g[2];o=g[3];v=g[4];p=!!g[5];n=f[f.length-2];t=f[f.length-1];f.length==0&&(n=t=0);x=v-o;var u=a*2;for(f=1;f<=u;f++)v=f/u,p||(v=1-v),v=o+v*x,g=n+k+m*Math.cos(v),v=t+l+m*Math.sin(v),c.push(new THREE.Vector2(g,v))}b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)};
+THREE.Path.prototype.nltransform=function(a,b,c,e,h,g){var f=this.getPoints(),k,l,m,n,o;k=0;for(l=f.length;k<l;k++)m=f[k],n=m.x,o=m.y,m.x=a*n+b*o+c,m.y=e*o+h*n+g;return f};
+THREE.Path.prototype.debug=function(a){var b=this.getBoundingBox();a||(a=document.createElement("canvas"),a.setAttribute("width",b.maxX+100),a.setAttribute("height",b.maxY+100),document.body.appendChild(a));b=a.getContext("2d");b.fillStyle="white";b.fillRect(0,0,a.width,a.height);b.strokeStyle="black";b.beginPath();var c,e,h,a=0;for(c=this.actions.length;a<c;a++)e=this.actions[a],h=e.args,e=e.action,e!=THREE.PathActions.CSPLINE_THRU&&b[e].apply(b,h);b.stroke();b.closePath();b.strokeStyle="red";e=
+this.getPoints();a=0;for(c=e.length;a<c;a++)h=e[a],b.beginPath(),b.arc(h.x,h.y,1.5,0,Math.PI*2,!1),b.stroke(),b.closePath()};
+THREE.Path.prototype.toShapes=function(){var a,b,c,e,h=[],g=new THREE.Path;a=0;for(b=this.actions.length;a<b;a++)c=this.actions[a],e=c.args,c=c.action,c==THREE.PathActions.MOVE_TO&&g.actions.length!=0&&(h.push(g),g=new THREE.Path),g[c].apply(g,e);g.actions.length!=0&&h.push(g);if(h.length==0)return[];var f,g=[];if(THREE.Shape.Utils.isClockWise(h[0].getPoints())){a=0;for(b=h.length;a<b;a++)e=h[a],THREE.Shape.Utils.isClockWise(e.getPoints())?(f&&g.push(f),f=new THREE.Shape,f.actions=e.actions,f.curves=
+e.curves):f.holes.push(e);g.push(f)}else{f=new THREE.Shape;a=0;for(b=h.length;a<b;a++)e=h[a],THREE.Shape.Utils.isClockWise(e.getPoints())?(f.actions=e.actions,f.curves=e.curves,g.push(f),f=new THREE.Shape):f.holes.push(e)}return g};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(a){return new THREE.ExtrudeGeometry(this,a)};
 THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,e=[];for(b=0;b<c;b++)e[b]=this.holes[b].getTransformedPoints(a,this.bends);return e};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,e=[];for(b=0;b<c;b++)e[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return e};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};
 THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={removeHoles:function(a,b){var c=a.concat(),e=c.concat(),g,h,f,k,l,m,n,o,p,t,x=[];for(l=0;l<b.length;l++){m=b[l];e=e.concat(m);h=Number.POSITIVE_INFINITY;for(g=0;g<m.length;g++){p=m[g];t=[];for(o=0;o<c.length;o++)n=c[o],n=p.distanceToSquared(n),t.push(n),n<h&&(h=n,f=g,k=o)}g=k-1>=0?k-1:c.length-1;h=f-1>=0?f-1:m.length-1;var v=[m[f],c[k],c[g]];o=THREE.FontUtils.Triangulate.area(v);var u=[m[f],m[h],c[k]];p=THREE.FontUtils.Triangulate.area(u);t=k;n=f;k+=1;f+=-1;k<0&&(k+=c.length);k%=
-c.length;f<0&&(f+=m.length);f%=m.length;g=k-1>=0?k-1:c.length-1;h=f-1>=0?f-1:m.length-1;v=[m[f],c[k],c[g]];v=THREE.FontUtils.Triangulate.area(v);u=[m[f],m[h],c[k]];u=THREE.FontUtils.Triangulate.area(u);o+p>v+u&&(k=t,f=n,k<0&&(k+=c.length),k%=c.length,f<0&&(f+=m.length),f%=m.length,g=k-1>=0?k-1:c.length-1,h=f-1>=0?f-1:m.length-1);o=c.slice(0,k);p=c.slice(k);t=m.slice(f);n=m.slice(0,f);h=[m[f],m[h],c[k]];x.push([m[f],c[k],c[g]]);x.push(h);c=o.concat(t).concat(n).concat(p)}return{shape:c,isolatedPts:x,
-allpoints:e}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),e=c.allpoints,g=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),h,f,k,l,m={};h=0;for(f=e.length;h<f;h++)l=e[h].x+":"+e[h].y,m[l]!==void 0&&console.log("Duplicate point",l),m[l]=h;h=0;for(f=c.length;h<f;h++){k=c[h];for(e=0;e<3;e++)l=k[e].x+":"+k[e].y,l=m[l],l!==void 0&&(k[e]=l)}h=0;for(f=g.length;h<f;h++){k=g[h];for(e=0;e<3;e++)l=k[e].x+":"+k[e].y,l=m[l],l!==void 0&&(k[e]=l)}return c.concat(g)},isClockWise:function(a){return THREE.FontUtils.Triangulate.area(a)<
-0},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,e){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,e)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,e,g){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,e)+this.b3p3(a,g)}};
-THREE.TextPath=function(a,b){THREE.Path.call(this);this.parameters=b||{};this.set(a)};THREE.TextPath.prototype.set=function(a,b){this.text=a;var b=b||this.parameters,c=b.curveSegments!==void 0?b.curveSegments:4,e=b.font!==void 0?b.font:"helvetiker",g=b.weight!==void 0?b.weight:"normal",h=b.style!==void 0?b.style:"normal";THREE.FontUtils.size=b.size!==void 0?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=e;THREE.FontUtils.weight=g;THREE.FontUtils.style=h};
+THREE.Shape.Utils={removeHoles:function(a,b){var c=a.concat(),e=c.concat(),h,g,f,k,l,m,n,o,p,t,x=[];for(l=0;l<b.length;l++){m=b[l];e=e.concat(m);g=Number.POSITIVE_INFINITY;for(h=0;h<m.length;h++){p=m[h];t=[];for(o=0;o<c.length;o++)n=c[o],n=p.distanceToSquared(n),t.push(n),n<g&&(g=n,f=h,k=o)}h=k-1>=0?k-1:c.length-1;g=f-1>=0?f-1:m.length-1;var v=[m[f],c[k],c[h]];o=THREE.FontUtils.Triangulate.area(v);var u=[m[f],m[g],c[k]];p=THREE.FontUtils.Triangulate.area(u);t=k;n=f;k+=1;f+=-1;k<0&&(k+=c.length);k%=
+c.length;f<0&&(f+=m.length);f%=m.length;h=k-1>=0?k-1:c.length-1;g=f-1>=0?f-1:m.length-1;v=[m[f],c[k],c[h]];v=THREE.FontUtils.Triangulate.area(v);u=[m[f],m[g],c[k]];u=THREE.FontUtils.Triangulate.area(u);o+p>v+u&&(k=t,f=n,k<0&&(k+=c.length),k%=c.length,f<0&&(f+=m.length),f%=m.length,h=k-1>=0?k-1:c.length-1,g=f-1>=0?f-1:m.length-1);o=c.slice(0,k);p=c.slice(k);t=m.slice(f);n=m.slice(0,f);g=[m[f],m[g],c[k]];x.push([m[f],c[k],c[h]]);x.push(g);c=o.concat(t).concat(n).concat(p)}return{shape:c,isolatedPts:x,
+allpoints:e}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),e=c.allpoints,h=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),g,f,k,l,m={};g=0;for(f=e.length;g<f;g++)l=e[g].x+":"+e[g].y,m[l]!==void 0&&console.log("Duplicate point",l),m[l]=g;g=0;for(f=c.length;g<f;g++){k=c[g];for(e=0;e<3;e++)l=k[e].x+":"+k[e].y,l=m[l],l!==void 0&&(k[e]=l)}g=0;for(f=h.length;g<f;g++){k=h[g];for(e=0;e<3;e++)l=k[e].x+":"+k[e].y,l=m[l],l!==void 0&&(k[e]=l)}return c.concat(h)},isClockWise:function(a){return THREE.FontUtils.Triangulate.area(a)<
+0},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,e){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,e)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,e,h){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,e)+this.b3p3(a,h)}};
+THREE.TextPath=function(a,b){THREE.Path.call(this);this.parameters=b||{};this.set(a)};THREE.TextPath.prototype.set=function(a,b){this.text=a;var b=b||this.parameters,c=b.curveSegments!==void 0?b.curveSegments:4,e=b.font!==void 0?b.font:"helvetiker",h=b.weight!==void 0?b.weight:"normal",g=b.style!==void 0?b.style:"normal";THREE.FontUtils.size=b.size!==void 0?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=e;THREE.FontUtils.weight=h;THREE.FontUtils.style=g};
 THREE.TextPath.prototype.toShapes=function(){for(var a=THREE.FontUtils.drawText(this.text).paths,b=[],c=0,e=a.length;c<e;c++)b=b.concat(a[c].toShapes());return b};
 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<
 0)a.hierarchy[c].keys[e].time=0;if(a.hierarchy[c].keys[e].rot!==void 0&&!(a.hierarchy[c].keys[e].rot instanceof THREE.Quaternion)){var k=a.hierarchy[c].keys[e].rot;a.hierarchy[c].keys[e].rot=new THREE.Quaternion(k[0],k[1],k[2],k[3])}}if(a.hierarchy[c].keys[0].morphTargets!==void 0){k={};for(e=0;e<a.hierarchy[c].keys.length;e++)for(var l=0;l<a.hierarchy[c].keys[e].morphTargets.length;l++){var m=a.hierarchy[c].keys[e].morphTargets[l];k[m]=-1}a.hierarchy[c].usedMorphTargets=k;for(e=0;e<a.hierarchy[c].keys.length;e++){var n=
 {};for(m in k){for(l=0;l<a.hierarchy[c].keys[e].morphTargets.length;l++)if(a.hierarchy[c].keys[e].morphTargets[l]===m){n[m]=a.hierarchy[c].keys[e].morphTargetsInfluences[l];break}l===a.hierarchy[c].keys[e].morphTargets.length&&(n[m]=0)}a.hierarchy[c].keys[e].morphTargetsInfluences=n}}for(e=1;e<a.hierarchy[c].keys.length;e++)a.hierarchy[c].keys[e].time===a.hierarchy[c].keys[e-1].time&&(a.hierarchy[c].keys.splice(e,1),e--);for(e=1;e<a.hierarchy[c].keys.length;e++)a.hierarchy[c].keys[e].index=e}e=parseInt(a.length*
 a.fps,10);a.JIT={};a.JIT.hierarchy=[];for(c=0;c<a.hierarchy.length;c++)a.JIT.hierarchy.push(Array(e));a.initialized=!0}},get:function(a){if(typeof a==="string")return b[a]?b[a]:(console.log("THREE.AnimationHandler.get: Couldn't find animation "+a),null)},parse:function(a){var c=[];if(a instanceof THREE.SkinnedMesh)for(var b=0;b<a.bones.length;b++)c.push(a.bones[b]);else e(a,c);return c}},e=function(a,c){c.push(a);for(var b=0;b<a.children.length;b++)e(a.children[b],c)};c.LINEAR=0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=
 2;return c}();THREE.Animation=function(a,b,c,e){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=c!==void 0?c:THREE.AnimationHandler.LINEAR;this.JITCompile=e!==void 0?e:!0;this.points=[];this.target=new THREE.Vector3};
-THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=a!==void 0?a:!0;this.currentTime=b!==void 0?b:0;var c,e=this.hierarchy.length,g;for(c=0;c<e;c++){g=this.hierarchy[c];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 h=g.animationCache.prevKey;g=g.animationCache.nextKey;h.pos=this.data.hierarchy[c].keys[0];h.rot=this.data.hierarchy[c].keys[0];h.scl=this.data.hierarchy[c].keys[0];g.pos=this.getNextKeyWith("pos",c,1);g.rot=this.getNextKeyWith("rot",c,1);g.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
+THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=a!==void 0?a:!0;this.currentTime=b!==void 0?b:0;var c,e=this.hierarchy.length,h;for(c=0;c<e;c++){h=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)h.useQuaternion=!0;h.matrixAutoUpdate=!0;if(h.animationCache===void 0)h.animationCache={},h.animationCache.prevKey={pos:0,rot:0,scl:0},h.animationCache.nextKey={pos:0,rot:0,scl:0},h.animationCache.originalMatrix=h instanceof
+THREE.Bone?h.skinMatrix:h.matrix;var g=h.animationCache.prevKey;h=h.animationCache.nextKey;g.pos=this.data.hierarchy[c].keys[0];g.rot=this.data.hierarchy[c].keys[0];g.scl=this.data.hierarchy[c].keys[0];h.pos=this.getNextKeyWith("pos",c,1);h.rot=this.getNextKeyWith("rot",c,1);h.scl=this.getNextKeyWith("scl",c,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.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(this.hierarchy[a].animationCache!==void 0)this.hierarchy[a]instanceof THREE.Bone?this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix:this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix,delete this.hierarchy[a].animationCache};
-THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,e,g,h,f,k,l,m,n=this.data.JIT.hierarchy,o,p;this.currentTime+=a*this.timeScale;p=this.currentTime;o=this.currentTime%=this.data.length;m=parseInt(Math.min(o*this.data.fps,this.data.length*this.data.fps),10);for(var t=0,x=this.hierarchy.length;t<x;t++)if(a=this.hierarchy[t],l=a.animationCache,this.JITCompile&&n[t][m]!==void 0)a instanceof THREE.Bone?(a.skinMatrix=n[t][m],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=
+THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,e,h,g,f,k,l,m,n=this.data.JIT.hierarchy,o,p;this.currentTime+=a*this.timeScale;p=this.currentTime;o=this.currentTime%=this.data.length;m=parseInt(Math.min(o*this.data.fps,this.data.length*this.data.fps),10);for(var t=0,x=this.hierarchy.length;t<x;t++)if(a=this.hierarchy[t],l=a.animationCache,this.JITCompile&&n[t][m]!==void 0)a instanceof THREE.Bone?(a.skinMatrix=n[t][m],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=
 !1):(a.matrix=n[t][m],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)a instanceof THREE.Bone?a.skinMatrix=a.animationCache.originalMatrix:a.matrix=a.animationCache.originalMatrix;for(var v=0;v<3;v++){c=b[v];f=l.prevKey[c];k=l.nextKey[c];if(k.time<=p){if(o<p)if(this.loop){f=this.data.hierarchy[t].keys[0];for(k=this.getNextKeyWith(c,t,1);k.time<o;)f=k,k=this.getNextKeyWith(c,t,k.index+1)}else{this.stop();return}else{do f=k,k=this.getNextKeyWith(c,t,k.index+1);while(k.time<
-o)}l.prevKey[c]=f;l.nextKey[c]=k}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;e=(o-f.time)/(k.time-f.time);g=f[c];h=k[c];if(e<0||e>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+t),e=e<0?0:1;if(c==="pos")if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=g[0]+(h[0]-g[0])*e,c.y=g[1]+(h[1]-g[1])*e,c.z=g[2]+(h[2]-g[2])*e;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
-this.getPrevKeyWith("pos",t,f.index-1).pos,this.points[1]=g,this.points[2]=h,this.points[3]=this.getNextKeyWith("pos",t,k.index+1).pos,e=e*0.33+0.33,g=this.interpolateCatmullRom(this.points,e),c.x=g[0],c.y=g[1],c.z=g[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)e=this.interpolateCatmullRom(this.points,e*1.01),this.target.set(e[0],e[1],e[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),e=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,e,0)}else if(c===
-"rot")THREE.Quaternion.slerp(g,h,a.quaternion,e);else if(c==="scl")c=a.scale,c.x=g[0]+(h[0]-g[0])*e,c.y=g[1]+(h[1]-g[1])*e,c.z=g[2]+(h[2]-g[2])*e}}if(this.JITCompile&&n[0][m]===void 0){this.hierarchy[0].update(void 0,!0);for(t=0;t<this.hierarchy.length;t++)n[t][m]=this.hierarchy[t]instanceof THREE.Bone?this.hierarchy[t].skinMatrix.clone():this.hierarchy[t].matrix.clone()}}};
-THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],e=[],g,h,f,k,l,m;g=(a.length-1)*b;h=Math.floor(g);g-=h;c[0]=h==0?h:h-1;c[1]=h;c[2]=h>a.length-2?h:h+1;c[3]=h>a.length-3?h:h+2;h=a[c[0]];k=a[c[1]];l=a[c[2]];m=a[c[3]];c=g*g;f=g*c;e[0]=this.interpolate(h[0],k[0],l[0],m[0],g,c,f);e[1]=this.interpolate(h[1],k[1],l[1],m[1],g,c,f);e[2]=this.interpolate(h[2],k[2],l[2],m[2],g,c,f);return e};
-THREE.Animation.prototype.interpolate=function(a,b,c,e,g,h,f){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*f+(-3*(b-c)-2*a-e)*h+a*g+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c<e.length-1?c:e.length-1:c%=e.length;c<e.length;c++)if(e[c][a]!==void 0)return e[c];return this.data.hierarchy[b].keys[0]};
+o)}l.prevKey[c]=f;l.nextKey[c]=k}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;e=(o-f.time)/(k.time-f.time);h=f[c];g=k[c];if(e<0||e>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+t),e=e<0?0:1;if(c==="pos")if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=h[0]+(g[0]-h[0])*e,c.y=h[1]+(g[1]-h[1])*e,c.z=h[2]+(g[2]-h[2])*e;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
+this.getPrevKeyWith("pos",t,f.index-1).pos,this.points[1]=h,this.points[2]=g,this.points[3]=this.getNextKeyWith("pos",t,k.index+1).pos,e=e*0.33+0.33,h=this.interpolateCatmullRom(this.points,e),c.x=h[0],c.y=h[1],c.z=h[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)e=this.interpolateCatmullRom(this.points,e*1.01),this.target.set(e[0],e[1],e[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),e=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,e,0)}else if(c===
+"rot")THREE.Quaternion.slerp(h,g,a.quaternion,e);else if(c==="scl")c=a.scale,c.x=h[0]+(g[0]-h[0])*e,c.y=h[1]+(g[1]-h[1])*e,c.z=h[2]+(g[2]-h[2])*e}}if(this.JITCompile&&n[0][m]===void 0){this.hierarchy[0].update(void 0,!0);for(t=0;t<this.hierarchy.length;t++)n[t][m]=this.hierarchy[t]instanceof THREE.Bone?this.hierarchy[t].skinMatrix.clone():this.hierarchy[t].matrix.clone()}}};
+THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],e=[],h,g,f,k,l,m;h=(a.length-1)*b;g=Math.floor(h);h-=g;c[0]=g==0?g:g-1;c[1]=g;c[2]=g>a.length-2?g:g+1;c[3]=g>a.length-3?g:g+2;g=a[c[0]];k=a[c[1]];l=a[c[2]];m=a[c[3]];c=h*h;f=h*c;e[0]=this.interpolate(g[0],k[0],l[0],m[0],h,c,f);e[1]=this.interpolate(g[1],k[1],l[1],m[1],h,c,f);e[2]=this.interpolate(g[2],k[2],l[2],m[2],h,c,f);return e};
+THREE.Animation.prototype.interpolate=function(a,b,c,e,h,g,f){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*f+(-3*(b-c)-2*a-e)*g+a*h+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c<e.length-1?c:e.length-1:c%=e.length;c<e.length;c++)if(e[c][a]!==void 0)return e[c];return this.data.hierarchy[b].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var e=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+e.length;c>=0;c--)if(e[c][a]!==void 0)return e[c];return this.data.hierarchy[b].keys[e.length-1]};
 THREE.FirstPersonCamera=function(a){function b(a,b){return function(){b.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.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(a){if(a.movementSpeed!==void 0)this.movementSpeed=
 a.movementSpeed;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.noFly!==void 0)this.noFly=a.noFly;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.autoForward!==void 0)this.autoForward=a.autoForward;if(a.activeLook!==void 0)this.activeLook=a.activeLook;if(a.heightSpeed!==void 0)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==void 0)this.heightCoef=a.heightCoef;if(a.heightMin!==void 0)this.heightMin=a.heightMin;if(a.heightMax!==void 0)this.heightMax=a.heightMax;if(a.constrainVertical!==
@@ -86,16 +86,16 @@ void 0)this.constrainVertical=a.constrainVertical;if(a.verticalMin!==void 0)this
 a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.mouseX=a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.onKeyDown=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=
 !0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}};this.update=
 function(){var a=(new Date).getTime();this.tdiff=(a-this.lastUpdate)/1E3;this.lastUpdate=a;if(!this.freeze){this.autoSpeedFactor=this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this.position.y>this.heightMax?this.heightMax:this.position.y)-this.heightMin)*this.heightCoef:0;var b=this.tdiff*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.translateZ(-(b+this.autoSpeedFactor));this.moveBackward&&this.translateZ(b);this.moveLeft&&this.translateX(-b);
-this.moveRight&&this.translateX(b);this.moveUp&&this.translateY(b);this.moveDown&&this.translateY(-b);b=this.tdiff*this.lookSpeed;this.activeLook||(b=0);this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var a=this.target.position,g=this.position;a.x=g.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=g.y+100*Math.cos(this.phi);a.z=g.z+100*Math.sin(this.phi)*Math.sin(this.theta)}a=
-1;this.constrainVertical&&(a=3.14/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b*a);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;a=this.target.position;g=this.position;a.x=g.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=g.y+100*Math.cos(this.phi);a.z=g.z+100*Math.sin(this.phi)*
+this.moveRight&&this.translateX(b);this.moveUp&&this.translateY(b);this.moveDown&&this.translateY(-b);b=this.tdiff*this.lookSpeed;this.activeLook||(b=0);this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var a=this.target.position,h=this.position;a.x=h.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=h.y+100*Math.cos(this.phi);a.z=h.z+100*Math.sin(this.phi)*Math.sin(this.theta)}a=
+1;this.constrainVertical&&(a=3.14/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b*a);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;a=this.target.position;h=this.position;a.x=h.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=h.y+100*Math.cos(this.phi);a.z=h.z+100*Math.sin(this.phi)*
 Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",b(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",b(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",b(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",b(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",b(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(a,b){this.matrix.rotateAxis(b);if(this.noFly)b.y=0;this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};
-THREE.PathCamera=function(a){function b(a,c,b,e){var f={name:b,fps:0.6,length:e,hierarchy:[]},h,g=c.getControlPointsArray(),k=c.getLength(),l=g.length,y=0;h=l-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[h]={time:e,pos:g[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h<l-1;h++)y=e*k.chunks[h]/k.total,c.keys[h]={time:y,pos:g[h]};f.hierarchy[0]=c;THREE.AnimationHandler.add(f);return new THREE.Animation(a,b,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function c(a,c){var b,
-e,f=new THREE.Geometry;for(b=0;b<a.points.length*c;b++)e=b/(a.points.length*c),e=a.getPoint(e),f.vertices[b]=new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z));return f}function e(a,b){var e=c(b,10),f=c(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,h);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.addChild(lineObj);particleObj.scale.set(1,1,1);a.addChild(particleObj);f=new THREE.SphereGeometry(1,
-16,8);h=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<b.points.length;i++)e=new THREE.Mesh(f,h),e.position.copy(b.points[i]),e.updateMatrix(),a.addChild(e)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookHorizontal=
+THREE.PathCamera=function(a){function b(a,c,b,e){var f={name:b,fps:0.6,length:e,hierarchy:[]},g,h=c.getControlPointsArray(),k=c.getLength(),l=h.length,y=0;g=l-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:h[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[g]={time:e,pos:h[g],rot:[0,0,0,1],scl:[1,1,1]};for(g=1;g<l-1;g++)y=e*k.chunks[g]/k.total,c.keys[g]={time:y,pos:h[g]};f.hierarchy[0]=c;THREE.AnimationHandler.add(f);return new THREE.Animation(a,b,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function c(a,c){var b,
+e,f=new THREE.Geometry;for(b=0;b<a.points.length*c;b++)e=b/(a.points.length*c),e=a.getPoint(e),f.vertices[b]=new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z));return f}function e(a,b){var e=c(b,10),f=c(b,10),g=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,g);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.addChild(lineObj);particleObj.scale.set(1,1,1);a.addChild(particleObj);f=new THREE.SphereGeometry(1,
+16,8);g=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<b.points.length;i++)e=new THREE.Mesh(f,g),e.position.copy(b.points[i]),e.updateMatrix(),a.addChild(e)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.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(a){if(a.duration!==void 0)this.duration=a.duration*1E3;if(a.waypoints!==void 0)this.waypoints=a.waypoints;if(a.useConstantSpeed!==void 0)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==void 0)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==void 0)this.createDebugPath=a.createDebugPath;if(a.createDebugDummy!==
 void 0)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==void 0)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==void 0)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==void 0)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
-window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var g=Math.PI*2,h=Math.PI/180;this.update=function(a,c,b){var e,f;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)*h;this.theta=this.lon*h;e=this.phi%g;this.phi=e>=0?e:e+g;e=this.verticalAngleMap.srcRange;f=this.verticalAngleMap.dstRange;var k=f[1]-f[0];this.phi=
+window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var h=Math.PI*2,g=Math.PI/180;this.update=function(a,c,b){var e,f;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)*g;this.theta=this.lon*g;e=this.phi%h;this.phi=e>=0?e:e+h;e=this.verticalAngleMap.srcRange;f=this.verticalAngleMap.dstRange;var k=f[1]-f[0];this.phi=
 TWEEN.Easing.Quadratic.EaseInOut(((this.phi-e[0])*(f[1]-f[0])/(e[1]-e[0])+f[0]-f[0])/k)*k+f[0];e=this.horizontalAngleMap.srcRange;f=this.horizontalAngleMap.dstRange;k=f[1]-f[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-e[0])*(f[1]-f[0])/(e[1]-e[0])+f[0]-f[0])/k)*k+f[0];e=this.target.position;e.x=100*Math.sin(this.phi)*Math.cos(this.theta);e.y=100*Math.cos(this.phi);e.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,a,c,b)};this.onMouseMove=function(a){this.mouseX=
 a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),f=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.CubeGeometry(10,10,20),l=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(k,a);a=new THREE.Mesh(l,f);a.position.set(0,10,0);this.animation=
 b(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else this.animation=b(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&e(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(a,c){return function(){c.apply(a,arguments)}}(this,this.onMouseMove),
@@ -104,195 +104,195 @@ THREE.FlyCamera=function(a){function b(a,b){return function(){b.apply(a,argument
 a.autoForward;if(a.domElement!==void 0)this.domElement=a.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(a){if(typeof this[a.type]=="function")this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=
 0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
 this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;
-case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(a.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}};this.mousemove=function(a){if(!this.dragToLook||this.mouseStatus>0){var b=this.getContainerDimensions(),g=b.size[0]/2,h=b.size[1]/2;this.moveState.yawLeft=-(a.clientX-b.offset[0]-g)/g;this.moveState.pitchDown=(a.clientY-
-b.offset[1]-h)/h;this.updateRotationVector()}};this.mouseup=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(){var a=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.tdiff=(a-this.lastUpdate)/1E3;this.lastUpdate=a;var a=this.tdiff*this.movementSpeed,b=this.tdiff*
+case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(a.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}};this.mousemove=function(a){if(!this.dragToLook||this.mouseStatus>0){var b=this.getContainerDimensions(),h=b.size[0]/2,g=b.size[1]/2;this.moveState.yawLeft=-(a.clientX-b.offset[0]-h)/h;this.moveState.pitchDown=(a.clientY-
+b.offset[1]-g)/g;this.updateRotationVector()}};this.mouseup=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(){var a=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.tdiff=(a-this.lastUpdate)/1E3;this.lastUpdate=a;var a=this.tdiff*this.movementSpeed,b=this.tdiff*
 this.rollSpeed;this.translateX(this.moveVector.x*a);this.translateY(this.moveVector.y*a);this.translateZ(this.moveVector.z*a);this.tmpQuaternion.set(this.rotationVector.x*b,this.rotationVector.y*b,this.rotationVector.z*b,1).normalize();this.quaternion.multiplySelf(this.tmpQuaternion);this.matrix.setPosition(this.position);this.matrix.setRotationFromQuaternion(this.quaternion);this.matrixWorldNeedsUpdate=!0;this.supr.update.call(this)};this.updateMovementVector=function(){var a=this.moveState.forward||
 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=-a+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",b(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",b(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",b(this,this.mouseup),!1);window.addEventListener("keydown",b(this,this.keydown),!1);window.addEventListener("keyup",b(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;
-THREE.RollCamera=function(a,b,c,e){THREE.Camera.call(this,a,b,c,e);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,h=new THREE.Vector3,f=new THREE.Vector3,k=new THREE.Matrix4,l=!1,m=1,n=0,o=0,p=0,t=0,x=0,v=window.innerWidth/2,u=window.innerHeight/2;this.update=
+THREE.RollCamera=function(a,b,c,e){THREE.Camera.call(this,a,b,c,e);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 h=new THREE.Vector3,g=new THREE.Vector3,f=new THREE.Vector3,k=new THREE.Matrix4,l=!1,m=1,n=0,o=0,p=0,t=0,x=0,v=window.innerWidth/2,u=window.innerHeight/2;this.update=
 function(){var a=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.delta=(a-this.lastUpdate)/1E3;this.lastUpdate=a;this.mouseLook&&(a=this.delta*this.lookSpeed,this.rotateHorizontally(a*t),this.rotateVertically(a*x));a=this.delta*this.movementSpeed;this.translateZ(a*(n>0||this.autoForward&&!(n<0)?1:n));this.translateX(a*o);this.translateY(a*p);l&&(this.roll+=this.rollSpeed*this.delta*m);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();f.copy(this.forward);h.set(0,1,0);g.cross(h,f).normalize();h.cross(f,g).normalize();this.matrix.n11=g.x;this.matrix.n12=h.x;this.matrix.n13=f.x;this.matrix.n21=g.y;this.matrix.n22=h.y;this.matrix.n23=f.y;this.matrix.n31=g.z;this.matrix.n32=h.z;this.matrix.n33=f.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();f.copy(this.forward);g.set(0,1,0);h.cross(g,f).normalize();g.cross(f,h).normalize();this.matrix.n11=h.x;this.matrix.n12=g.x;this.matrix.n13=f.x;this.matrix.n21=h.y;this.matrix.n22=g.y;this.matrix.n23=f.y;this.matrix.n31=h.z;this.matrix.n32=g.z;this.matrix.n33=f.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(a){this.position.x+=this.matrix.n11*a;this.position.y+=this.matrix.n21*a;this.position.z+=this.matrix.n31*a};this.translateY=function(a){this.position.x+=this.matrix.n12*a;this.position.y+=this.matrix.n22*a;this.position.z+=this.matrix.n32*a};this.translateZ=function(a){this.position.x-=this.matrix.n13*a;this.position.y-=
-this.matrix.n23*a;this.position.z-=this.matrix.n33*a};this.rotateHorizontally=function(a){g.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);g.multiplyScalar(a);this.forward.subSelf(g);this.forward.normalize()};this.rotateVertically=function(a){h.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);h.multiplyScalar(a);this.forward.addSelf(h);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",
+this.matrix.n23*a;this.position.z-=this.matrix.n33*a};this.rotateHorizontally=function(a){h.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);h.multiplyScalar(a);this.forward.subSelf(h);this.forward.normalize()};this.rotateVertically=function(a){g.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);g.multiplyScalar(a);this.forward.addSelf(g);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",
 function(a){t=(a.clientX-v)/window.innerWidth;x=(a.clientY-u)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:n=1;break;case 2:n=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:n=0;break;case 2:n=0}},!1);this.domElement.addEventListener("keydown",function(a){switch(a.keyCode){case 38:case 87:n=1;break;case 37:case 65:o=-1;break;
 case 40:case 83:n=-1;break;case 39:case 68:o=1;break;case 81:l=!0;m=1;break;case 69:l=!0;m=-1;break;case 82:p=1;break;case 70:p=-1}},!1);this.domElement.addEventListener("keyup",function(a){switch(a.keyCode){case 38:case 87:n=0;break;case 37:case 65:o=0;break;case 40:case 83:n=0;break;case 39:case 68:o=0;break;case 81:l=!1;break;case 69:l=!1;break;case 82:p=0;break;case 70:p=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
 THREE.RollCamera.prototype.supr=THREE.Camera.prototype;
 THREE.TrackballCamera=function(a){function b(a,c){return function(){c.apply(a,arguments)}}a=a||{};THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.domElement=a.domElement||document;this.screen=a.screen||{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=a.radius||(this.screen.width+this.screen.height)/4;this.rotateSpeed=a.rotateSpeed||1;this.zoomSpeed=a.zoomSpeed||1.2;this.panSpeed=a.panSpeed||0.3;this.noZoom=a.noZoom||!1;this.noPan=a.noPan||
-!1;this.staticMoving=a.staticMoving||!1;this.dynamicDampingFactor=a.dynamicDampingFactor||0.2;this.minDistance=a.minDistance||0;this.maxDistance=a.maxDistance||Infinity;this.keys=a.keys||[65,83,68];this.useTarget=!0;var c=!1,e=this.STATE.NONE,g=new THREE.Vector3,h=new THREE.Vector3,f=new THREE.Vector3,k=new THREE.Vector2,l=new THREE.Vector2,m=new THREE.Vector2,n=new THREE.Vector2;this.handleEvent=function(a){if(typeof this[a.type]=="function")this[a.type](a)};this.getMouseOnScreen=function(a,c){return new THREE.Vector2((a-
-this.screen.offsetLeft)/this.radius*0.5,(c-this.screen.offsetTop)/this.radius*0.5)};this.getMouseProjectionOnBall=function(a,c){var b=new THREE.Vector3((a-this.screen.width*0.5-this.screen.offsetLeft)/this.radius,(this.screen.height*0.5+this.screen.offsetTop-c)/this.radius,0),e=b.length();e>1?b.normalize():b.z=Math.sqrt(1-e*e);g=this.position.clone().subSelf(this.target.position);e=this.up.clone().setLength(b.y);e.addSelf(this.up.clone().crossSelf(g).setLength(b.x));e.addSelf(g.setLength(b.z));return e};
-this.rotateCamera=function(){var a=Math.acos(h.dot(f)/h.length()/f.length());if(a){var c=(new THREE.Vector3).cross(h,f).normalize(),b=new THREE.Quaternion;a*=this.rotateSpeed;b.setFromAxisAngle(c,-a);b.multiplyVector3(g);b.multiplyVector3(this.up);b.multiplyVector3(f);this.staticMoving?h=f:(b.setFromAxisAngle(c,a*(this.dynamicDampingFactor-1)),b.multiplyVector3(h))}};this.zoomCamera=function(){var a=1+(l.y-k.y)*this.zoomSpeed;a!==1&&a>0&&(g.multiplyScalar(a),this.staticMoving?k=l:k.y+=(l.y-k.y)*this.dynamicDampingFactor)};
-this.panCamera=function(){var a=n.clone().subSelf(m);if(a.lengthSq()){a.multiplyScalar(g.length()*this.panSpeed);var b=g.clone().crossSelf(this.up).setLength(a.x);b.addSelf(this.up.clone().setLength(a.y));this.position.addSelf(b);this.target.position.addSelf(b);this.staticMoving?m=n:m.addSelf(a.sub(n,m).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(a,b,c){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,a,b,c)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",
-b(this,function(a){c&&(h=f=this.getMouseProjectionOnBall(a.clientX,a.clientY),k=l=this.getMouseOnScreen(a.clientX,a.clientY),m=n=this.getMouseOnScreen(a.clientX,a.clientY),c=!1);e!==this.STATE.NONE&&(e===this.STATE.ROTATE?f=this.getMouseProjectionOnBall(a.clientX,a.clientY):e===this.STATE.ZOOM&&!this.noZoom?l=this.getMouseOnScreen(a.clientX,a.clientY):e===this.STATE.PAN&&!this.noPan&&(n=this.getMouseOnScreen(a.clientX,a.clientY)))}),!1);this.domElement.addEventListener("mousedown",b(this,function(a){a.preventDefault();
-a.stopPropagation();if(e===this.STATE.NONE)e=a.button,e===this.STATE.ROTATE?h=f=this.getMouseProjectionOnBall(a.clientX,a.clientY):e===this.STATE.ZOOM&&!this.noZoom?k=l=this.getMouseOnScreen(a.clientX,a.clientY):this.noPan||(m=n=this.getMouseOnScreen(a.clientX,a.clientY))}),!1);this.domElement.addEventListener("mouseup",b(this,function(a){a.preventDefault();a.stopPropagation();e=this.STATE.NONE}),!1);window.addEventListener("keydown",b(this,function(a){if(e===this.STATE.NONE){if(a.keyCode===this.keys[this.STATE.ROTATE])e=
+!1;this.staticMoving=a.staticMoving||!1;this.dynamicDampingFactor=a.dynamicDampingFactor||0.2;this.minDistance=a.minDistance||0;this.maxDistance=a.maxDistance||Infinity;this.keys=a.keys||[65,83,68];this.useTarget=!0;var c=!1,e=this.STATE.NONE,h=new THREE.Vector3,g=new THREE.Vector3,f=new THREE.Vector3,k=new THREE.Vector2,l=new THREE.Vector2,m=new THREE.Vector2,n=new THREE.Vector2;this.handleEvent=function(a){if(typeof this[a.type]=="function")this[a.type](a)};this.getMouseOnScreen=function(a,c){return new THREE.Vector2((a-
+this.screen.offsetLeft)/this.radius*0.5,(c-this.screen.offsetTop)/this.radius*0.5)};this.getMouseProjectionOnBall=function(a,c){var b=new THREE.Vector3((a-this.screen.width*0.5-this.screen.offsetLeft)/this.radius,(this.screen.height*0.5+this.screen.offsetTop-c)/this.radius,0),e=b.length();e>1?b.normalize():b.z=Math.sqrt(1-e*e);h=this.position.clone().subSelf(this.target.position);e=this.up.clone().setLength(b.y);e.addSelf(this.up.clone().crossSelf(h).setLength(b.x));e.addSelf(h.setLength(b.z));return e};
+this.rotateCamera=function(){var a=Math.acos(g.dot(f)/g.length()/f.length());if(a){var c=(new THREE.Vector3).cross(g,f).normalize(),b=new THREE.Quaternion;a*=this.rotateSpeed;b.setFromAxisAngle(c,-a);b.multiplyVector3(h);b.multiplyVector3(this.up);b.multiplyVector3(f);this.staticMoving?g=f:(b.setFromAxisAngle(c,a*(this.dynamicDampingFactor-1)),b.multiplyVector3(g))}};this.zoomCamera=function(){var a=1+(l.y-k.y)*this.zoomSpeed;a!==1&&a>0&&(h.multiplyScalar(a),this.staticMoving?k=l:k.y+=(l.y-k.y)*this.dynamicDampingFactor)};
+this.panCamera=function(){var a=n.clone().subSelf(m);if(a.lengthSq()){a.multiplyScalar(h.length()*this.panSpeed);var c=h.clone().crossSelf(this.up).setLength(a.x);c.addSelf(this.up.clone().setLength(a.y));this.position.addSelf(c);this.target.position.addSelf(c);this.staticMoving?m=n:m.addSelf(a.sub(n,m).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.position.lengthSq()>this.maxDistance*this.maxDistance&&this.position.setLength(this.maxDistance),
+h.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.position,h.setLength(this.minDistance))};this.update=function(a,c,b){h=this.position.clone().subSelf(this.target.position);this.rotateCamera();this.noZoom||this.zoomCamera();this.noPan||this.panCamera();this.position.add(this.target.position,h);this.checkDistances();this.supr.update.call(this,a,c,b)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",
+b(this,function(a){c&&(g=f=this.getMouseProjectionOnBall(a.clientX,a.clientY),k=l=this.getMouseOnScreen(a.clientX,a.clientY),m=n=this.getMouseOnScreen(a.clientX,a.clientY),c=!1);e!==this.STATE.NONE&&(e===this.STATE.ROTATE?f=this.getMouseProjectionOnBall(a.clientX,a.clientY):e===this.STATE.ZOOM&&!this.noZoom?l=this.getMouseOnScreen(a.clientX,a.clientY):e===this.STATE.PAN&&!this.noPan&&(n=this.getMouseOnScreen(a.clientX,a.clientY)))}),!1);this.domElement.addEventListener("mousedown",b(this,function(a){a.preventDefault();
+a.stopPropagation();if(e===this.STATE.NONE)e=a.button,e===this.STATE.ROTATE?g=f=this.getMouseProjectionOnBall(a.clientX,a.clientY):e===this.STATE.ZOOM&&!this.noZoom?k=l=this.getMouseOnScreen(a.clientX,a.clientY):this.noPan||(m=n=this.getMouseOnScreen(a.clientX,a.clientY))}),!1);this.domElement.addEventListener("mouseup",b(this,function(a){a.preventDefault();a.stopPropagation();e=this.STATE.NONE}),!1);window.addEventListener("keydown",b(this,function(a){if(e===this.STATE.NONE){if(a.keyCode===this.keys[this.STATE.ROTATE])e=
 this.STATE.ROTATE;else if(a.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)e=this.STATE.ZOOM;else if(a.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)e=this.STATE.PAN;e!==this.STATE.NONE&&(c=!0)}}),!1);window.addEventListener("keyup",b(this,function(){if(e!==this.STATE.NONE)e=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.CubeGeometry=function(a,b,c,e,g,h,f,k,l){function m(a,b,c,f,k,l,m,o){var t,p,x=e||1,v=g||1,D=k/2,J=l/2,L=n.vertices.length;if(a=="x"&&b=="y"||a=="y"&&b=="x")t="z";else if(a=="x"&&b=="z"||a=="z"&&b=="x")t="y",v=h||1;else if(a=="z"&&b=="y"||a=="y"&&b=="z")t="x",x=h||1;var N=x+1,K=v+1;k/=x;var P=l/v;for(p=0;p<K;p++)for(l=0;l<N;l++){var E=new THREE.Vector3;E[a]=(l*k-D)*c;E[b]=(p*P-J)*f;E[t]=m;n.vertices.push(new THREE.Vertex(E))}for(p=0;p<v;p++)for(l=0;l<x;l++)n.faces.push(new THREE.Face4(l+N*p+
+THREE.CubeGeometry=function(a,b,c,e,h,g,f,k,l){function m(a,c,b,f,k,l,m,o){var t,p,x=e||1,v=h||1,D=k/2,J=l/2,L=n.vertices.length;if(a=="x"&&c=="y"||a=="y"&&c=="x")t="z";else if(a=="x"&&c=="z"||a=="z"&&c=="x")t="y",v=g||1;else if(a=="z"&&c=="y"||a=="y"&&c=="z")t="x",x=g||1;var N=x+1,K=v+1;k/=x;var P=l/v;for(p=0;p<K;p++)for(l=0;l<N;l++){var E=new THREE.Vector3;E[a]=(l*k-D)*b;E[c]=(p*P-J)*f;E[t]=m;n.vertices.push(new THREE.Vertex(E))}for(p=0;p<v;p++)for(l=0;l<x;l++)n.faces.push(new THREE.Face4(l+N*p+
 L,l+N*(p+1)+L,l+1+N*(p+1)+L,l+1+N*p+L,null,null,o)),n.faceVertexUvs[0].push([new THREE.UV(l/x,p/v),new THREE.UV(l/x,(p+1)/v),new THREE.UV((l+1)/x,(p+1)/v),new THREE.UV((l+1)/x,p/v)])}THREE.Geometry.call(this);var n=this,o=a/2,p=b/2,t=c/2,k=k?-1:1;if(f!==void 0)if(f instanceof Array)this.materials=f;else{this.materials=[];for(var x=0;x<6;x++)this.materials.push([f])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(l!=void 0)for(var v in l)this.sides[v]!=void 0&&(this.sides[v]=
-l[v]);this.sides.px&&m("z","y",1*k,-1,c,b,-o,this.materials[0]);this.sides.nx&&m("z","y",-1*k,-1,c,b,o,this.materials[1]);this.sides.py&&m("x","z",1*k,1,a,c,p,this.materials[2]);this.sides.ny&&m("x","z",1*k,-1,a,c,-p,this.materials[3]);this.sides.pz&&m("x","y",1*k,-1,a,b,t,this.materials[4]);this.sides.nz&&m("x","y",-1*k,-1,a,b,-t,this.materials[5]);(function(){for(var a=[],b=[],c=0,e=n.vertices.length;c<e;c++){for(var f=n.vertices[c],h=!1,g=0,k=a.length;g<k;g++){var l=a[g];if(f.position.x==l.position.x&&
-f.position.y==l.position.y&&f.position.z==l.position.z){b[c]=g;h=!0;break}}if(!h)b[c]=a.length,a.push(new THREE.Vertex(f.position.clone()))}c=0;for(e=n.faces.length;c<e;c++)f=n.faces[c],f.a=b[f.a],f.b=b[f.b],f.c=b[f.c],f.d=b[f.d];n.vertices=a})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
-THREE.CylinderGeometry=function(a,b,c,e,g,h){function f(a,b,c){k.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}THREE.Geometry.call(this);var k=this,l,m=Math.PI*2,n=e/2;for(l=0;l<a;l++)f(Math.sin(m*l/a)*b,Math.cos(m*l/a)*b,-n);for(l=0;l<a;l++)f(Math.sin(m*l/a)*c,Math.cos(m*l/a)*c,n);var o,p,t,x,v=b-c;for(l=0;l<a;l++)o=new THREE.Vector3,o.copy(k.vertices[l].position),o.z=v,o.normalize(),p=new THREE.Vector3,p.copy(k.vertices[l+a].position),p.z=v,p.normalize(),t=new THREE.Vector3,t.copy(k.vertices[a+
-(l+1)%a].position),t.z=v,t.normalize(),x=new THREE.Vector3,x.copy(k.vertices[(l+1)%a].position),x.z=v,x.normalize(),k.faces.push(new THREE.Face4(l,l+a,a+(l+1)%a,(l+1)%a,[o,p,t,x]));if(c>0){c=new THREE.Vector3(0,0,-1);f(0,0,-n-(h||0));for(l=a;l<a+a/2;l++)k.faces.push(new THREE.Face4(2*a,(2*l-2*a)%a,(2*l-2*a+1)%a,(2*l-2*a+2)%a,[c,c,c,c]))}if(b>0){b=new THREE.Vector3(0,0,1);f(0,0,n+(g||0));for(l=a+a/2;l<2*a;l++)k.faces.push(new THREE.Face4(2*a+1,(2*l-2*a+2)%a+a,(2*l-2*a+1)%a+a,(2*l-2*a)%a+a,[b,b,b,b]))}l=
-0;for(a=this.faces.length;l<a;l++)g=[],n=this.faces[l],b=this.vertices[n.a],h=this.vertices[n.b],c=this.vertices[n.c],o=this.vertices[n.d],g.push(new THREE.UV(0.5+Math.atan2(b.position.x,b.position.y)/m,0.5+b.position.z/e)),g.push(new THREE.UV(0.5+Math.atan2(h.position.x,h.position.y)/m,0.5+h.position.z/e)),g.push(new THREE.UV(0.5+Math.atan2(c.position.x,c.position.y)/m,0.5+c.position.z/e)),n instanceof THREE.Face4&&g.push(new THREE.UV(0.5+Math.atan2(o.position.x,o.position.y)/m,0.5+o.position.z/
-e)),this.faceVertexUvs[0].push(g);this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.ExtrudeGeometry=function(a,b){if(typeof a!="undefined"){THREE.Geometry.call(this);var a=a instanceof Array?a:[a],c,e=a.length,g;this.shapebb=a[e-1].getBoundingBox();for(c=0;c<e;c++)g=a[c],this.addShape(g,b);this.computeCentroids();this.computeFaceNormals()}};
-THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
-THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).addSelf(a)}function e(a,b,c){var e=THREE.ExtrudeGeometry.__v1,f=THREE.ExtrudeGeometry.__v2,h=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,k=THREE.ExtrudeGeometry.__v5,l=THREE.ExtrudeGeometry.__v6;e.set(a.x-b.x,a.y-b.y);f.set(a.x-c.x,a.y-c.y);e=e.normalize();f=f.normalize();h.set(-e.y,e.x);g.set(f.y,-f.x);k.copy(a).addSelf(h);l.copy(a).addSelf(g);if(k.equals(l))return g.clone();
-k.copy(b).addSelf(h);l.copy(c).addSelf(g);h=e.dot(g);g=l.subSelf(k).dot(g);h==0&&(console.log("Either infinite or no solutions!"),g==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));g/=h;if(g<0)return b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=Math.PI*2),anglec=(b+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(g).addSelf(k).subSelf(a).clone()}function g(a){for(B=a.length;--B>=0;){T=B;R=B-1;R<0&&(R=a.length-
-1);for(var b=0,c=t+n*2,b=0;b<c;b++){var e=P*b,f=P*(b+1),h=Q+T+e,g=Q+T+f,m=h,e=Q+R+e,f=Q+R+f,o=g;m+=M;e+=M;f+=M;o+=M;H.faces.push(new THREE.Face4(m,e,f,o,null,null,A));A&&(m=b/c,e=(b+1)/c,f=k+l*2,h=(H.vertices[h].position.z+l)/f,g=(H.vertices[g].position.z+l)/f,H.faceVertexUvs[0].push([new THREE.UV(h,m),new THREE.UV(g,m),new THREE.UV(g,e),new THREE.UV(h,e)]))}}}function h(a,b,c){H.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}function f(a,b,c){a+=M;b+=M;c+=M;H.faces.push(new THREE.Face3(a,
-b,c,null,null,w));if(w){var e=C.maxY,f=C.maxX,h=H.vertices[b].position.x,b=H.vertices[b].position.y,g=H.vertices[c].position.x,c=H.vertices[c].position.y;H.faceVertexUvs[0].push([new THREE.UV(H.vertices[a].position.x/f,H.vertices[a].position.y/e),new THREE.UV(h/f,b/e),new THREE.UV(g/f,c/e)])}}var k=b.amount!==void 0?b.amount:100,l=b.bevelThickness!==void 0?b.bevelThickness:6,m=b.bevelSize!==void 0?b.bevelSize:l-2,n=b.bevelSegments!==void 0?b.bevelSegments:3,o=b.bevelEnabled!==void 0?b.bevelEnabled:
+l[v]);this.sides.px&&m("z","y",1*k,-1,c,b,-o,this.materials[0]);this.sides.nx&&m("z","y",-1*k,-1,c,b,o,this.materials[1]);this.sides.py&&m("x","z",1*k,1,a,c,p,this.materials[2]);this.sides.ny&&m("x","z",1*k,-1,a,c,-p,this.materials[3]);this.sides.pz&&m("x","y",1*k,-1,a,b,t,this.materials[4]);this.sides.nz&&m("x","y",-1*k,-1,a,b,-t,this.materials[5]);(function(){for(var a=[],c=[],b=0,e=n.vertices.length;b<e;b++){for(var f=n.vertices[b],g=!1,h=0,k=a.length;h<k;h++){var l=a[h];if(f.position.x==l.position.x&&
+f.position.y==l.position.y&&f.position.z==l.position.z){c[b]=h;g=!0;break}}if(!g)c[b]=a.length,a.push(new THREE.Vertex(f.position.clone()))}b=0;for(e=n.faces.length;b<e;b++)f=n.faces[b],f.a=c[f.a],f.b=c[f.b],f.c=c[f.c],f.d=c[f.d];n.vertices=a})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
+THREE.CylinderGeometry=function(a,b,c,e,h,g){THREE.Geometry.call(this);var a=a!=null?a:20,b=b!=null?b:20,c=c||100,f=c/2,e=e||8,h=h||1,k,l,m=[],n=[];for(l=0;l<=h;l++){var o=[],p=[],t=l/h,x=t*(b-a)+a;for(k=0;k<=e;k++){var v=k/e;this.vertices.push(new THREE.Vertex(new THREE.Vector3(x*Math.sin(v*Math.PI*2),-t*c+f,x*Math.cos(v*Math.PI*2))));o.push(this.vertices.length-1);p.push(new THREE.UV(v,t))}m.push(o);n.push(p)}for(l=0;l<h;l++)for(k=0;k<e;k++){var c=m[l][k],o=m[l+1][k],p=m[l+1][k+1],t=m[l][k+1],x=
+this.vertices[c].position.clone().setY(0).normalize(),v=this.vertices[o].position.clone().setY(0).normalize(),u=this.vertices[p].position.clone().setY(0).normalize(),z=this.vertices[t].position.clone().setY(0).normalize(),y=n[l][k].clone(),w=n[l+1][k].clone(),A=n[l+1][k+1].clone(),C=n[l][k+1].clone();this.faces.push(new THREE.Face4(c,o,p,t,[x,v,u,z]));this.faceVertexUvs[0].push([y,w,A,C])}if(!g&&a>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,f,0)));for(k=0;k<e;k++)c=m[0][k],o=m[0][k+
+1],p=this.vertices.length-1,x=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),y=n[0][k].clone(),w=n[0][k+1].clone(),A=new THREE.UV(w.u,0),this.faces.push(new THREE.Face3(c,o,p,[x,v,u])),this.faceVertexUvs[0].push([y,w,A])}if(!g&&b>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-f,0)));for(k=0;k<e;k++)c=m[l][k+1],o=m[l][k],p=this.vertices.length-1,x=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),y=n[l][k+1].clone(),w=n[l][k].clone(),
+A=new THREE.UV(w.u,1),this.faces.push(new THREE.Face3(c,o,p,[x,v,u])),this.faceVertexUvs[0].push([y,w,A])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
+THREE.ExtrudeGeometry=function(a,b){if(typeof a!="undefined"){THREE.Geometry.call(this);var a=a instanceof Array?a:[a],c,e=a.length,h;this.shapebb=a[e-1].getBoundingBox();for(c=0;c<e;c++)h=a[c],this.addShape(h,b);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
+THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,c,b){c||console.log("die");return c.clone().multiplyScalar(b).addSelf(a)}function e(a,c,b){var e=THREE.ExtrudeGeometry.__v1,f=THREE.ExtrudeGeometry.__v2,g=THREE.ExtrudeGeometry.__v3,h=THREE.ExtrudeGeometry.__v4,k=THREE.ExtrudeGeometry.__v5,l=THREE.ExtrudeGeometry.__v6;e.set(a.x-c.x,a.y-c.y);f.set(a.x-b.x,a.y-b.y);e=e.normalize();f=f.normalize();g.set(-e.y,e.x);h.set(f.y,-f.x);k.copy(a).addSelf(g);l.copy(a).addSelf(h);if(k.equals(l))return h.clone();
+k.copy(c).addSelf(g);l.copy(b).addSelf(h);g=e.dot(h);h=l.subSelf(k).dot(h);g==0&&(console.log("Either infinite or no solutions!"),h==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));h/=g;if(h<0)return c=Math.atan2(c.y-a.y,c.x-a.x),a=Math.atan2(b.y-a.y,b.x-a.x),c>a&&(a+=Math.PI*2),anglec=(c+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(h).addSelf(k).subSelf(a).clone()}function h(a){for(B=a.length;--B>=0;){T=B;R=B-1;R<0&&(R=a.length-
+1);for(var c=0,b=t+n*2,c=0;c<b;c++){var e=P*c,f=P*(c+1),g=Q+T+e,h=Q+T+f,m=g,e=Q+R+e,f=Q+R+f,o=h;m+=M;e+=M;f+=M;o+=M;H.faces.push(new THREE.Face4(m,e,f,o,null,null,A));A&&(m=c/b,e=(c+1)/b,f=k+l*2,g=(H.vertices[g].position.z+l)/f,h=(H.vertices[h].position.z+l)/f,H.faceVertexUvs[0].push([new THREE.UV(g,m),new THREE.UV(h,m),new THREE.UV(h,e),new THREE.UV(g,e)]))}}}function g(a,c,b){H.vertices.push(new THREE.Vertex(new THREE.Vector3(a,c,b)))}function f(a,c,b){a+=M;c+=M;b+=M;H.faces.push(new THREE.Face3(a,
+c,b,null,null,w));if(w){var e=C.maxY,f=C.maxX,g=H.vertices[c].position.x,c=H.vertices[c].position.y,h=H.vertices[b].position.x,b=H.vertices[b].position.y;H.faceVertexUvs[0].push([new THREE.UV(H.vertices[a].position.x/f,H.vertices[a].position.y/e),new THREE.UV(g/f,c/e),new THREE.UV(h/f,b/e)])}}var k=b.amount!==void 0?b.amount:100,l=b.bevelThickness!==void 0?b.bevelThickness:6,m=b.bevelSize!==void 0?b.bevelSize:l-2,n=b.bevelSegments!==void 0?b.bevelSegments:3,o=b.bevelEnabled!==void 0?b.bevelEnabled:
 !0,p=b.curveSegments!==void 0?b.curveSegments:12,t=b.steps!==void 0?b.steps:1,x=b.bendPath,v=b.extrudePath,u,z=!1,y=b.useSpacedPoints!==void 0?b.useSpacedPoints:!1,w=b.material,A=b.extrudeMaterial,C=this.shapebb;if(v)u=v.getPoints(p),t=u.length,z=!0,o=!1;o||(m=l=n=0);var F,G,I,H=this,M=this.vertices.length;x&&a.addWrapPath(x);p=y?a.extractAllSpacedPoints(p):a.extractAllPoints(p);x=p.shape;p=p.holes;if(v=!THREE.Shape.Utils.isClockWise(x)){x=x.reverse();G=0;for(I=p.length;G<I;G++)F=p[G],THREE.Shape.Utils.isClockWise(F)&&
 (p[G]=F.reverse());v=!1}v=THREE.Shape.Utils.triangulateShape(x,p);y=x;G=0;for(I=p.length;G<I;G++)F=p[G],x=x.concat(F);var B,D,J,L,N,K,P=x.length,E=v.length,S=[];B=0;D=y.length;T=D-1;for(R=B+1;B<D;B++,T++,R++)T==D&&(T=0),R==D&&(R=0),S[B]=e(y[B],y[T],y[R]);var O=[],U,W=S.concat();G=0;for(I=p.length;G<I;G++){F=p[G];U=[];B=0;D=F.length;T=D-1;for(R=B+1;B<D;B++,T++,R++)T==D&&(T=0),R==D&&(R=0),U[B]=e(F[B],F[T],F[R]);O.push(U);W=W.concat(U)}for(J=0;J<n;J++){L=J/n;N=l*(1-L);L=m*Math.sin(L*Math.PI/2);B=0;for(D=
-y.length;B<D;B++)K=c(y[B],S[B],L),h(K.x,K.y,-N);G=0;for(I=p.length;G<I;G++){F=p[G];U=O[G];B=0;for(D=F.length;B<D;B++)K=c(F[B],U[B],L),h(K.x,K.y,-N)}}L=m;for(B=0;B<P;B++)K=o?c(x[B],W[B],L):x[B],z?h(K.x,K.y+u[0].y,u[0].x):h(K.x,K.y,0);for(J=1;J<=t;J++)for(B=0;B<P;B++)K=o?c(x[B],W[B],L):x[B],z?h(K.x,K.y+u[J-1].y,u[J-1].x):h(K.x,K.y,k/t*J);for(J=n-1;J>=0;J--){L=J/n;N=l*(1-L);L=m*Math.sin(L*Math.PI/2);B=0;for(D=y.length;B<D;B++)K=c(y[B],S[B],L),h(K.x,K.y,k+N);G=0;for(I=p.length;G<I;G++){F=p[G];U=O[G];
-B=0;for(D=F.length;B<D;B++)K=c(F[B],U[B],L),z?h(K.x,K.y+u[t-1].y,u[t-1].x+N):h(K.x,K.y,k+N)}}if(o){o=P*0;for(B=0;B<E;B++)m=v[B],f(m[2]+o,m[1]+o,m[0]+o);o=P*(t+n*2);for(B=0;B<E;B++)m=v[B],f(m[0]+o,m[1]+o,m[2]+o)}else{for(B=0;B<E;B++)m=v[B],f(m[2],m[1],m[0]);for(B=0;B<E;B++)m=v[B],f(m[0]+P*t,m[1]+P*t,m[2]+P*t)}var T,R,Q=0;g(y);Q+=y.length;G=0;for(I=p.length;G<I;G++)F=p[G],g(F),Q+=F.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;
+y.length;B<D;B++)K=c(y[B],S[B],L),g(K.x,K.y,-N);G=0;for(I=p.length;G<I;G++){F=p[G];U=O[G];B=0;for(D=F.length;B<D;B++)K=c(F[B],U[B],L),g(K.x,K.y,-N)}}L=m;for(B=0;B<P;B++)K=o?c(x[B],W[B],L):x[B],z?g(K.x,K.y+u[0].y,u[0].x):g(K.x,K.y,0);for(J=1;J<=t;J++)for(B=0;B<P;B++)K=o?c(x[B],W[B],L):x[B],z?g(K.x,K.y+u[J-1].y,u[J-1].x):g(K.x,K.y,k/t*J);for(J=n-1;J>=0;J--){L=J/n;N=l*(1-L);L=m*Math.sin(L*Math.PI/2);B=0;for(D=y.length;B<D;B++)K=c(y[B],S[B],L),g(K.x,K.y,k+N);G=0;for(I=p.length;G<I;G++){F=p[G];U=O[G];
+B=0;for(D=F.length;B<D;B++)K=c(F[B],U[B],L),z?g(K.x,K.y+u[t-1].y,u[t-1].x+N):g(K.x,K.y,k+N)}}if(o){o=P*0;for(B=0;B<E;B++)m=v[B],f(m[2]+o,m[1]+o,m[0]+o);o=P*(t+n*2);for(B=0;B<E;B++)m=v[B],f(m[0]+o,m[1]+o,m[2]+o)}else{for(B=0;B<E;B++)m=v[B],f(m[2],m[1],m[0]);for(B=0;B<E;B++)m=v[B],f(m[0]+P*t,m[1]+P*t,m[2]+P*t)}var T,R,Q=0;h(y);Q+=y.length;G=0;for(I=p.length;G<I;G++)F=p[G],h(F),Q+=F.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.IcosahedronGeometry=function(a){function b(a,b,c){var e=Math.sqrt(a*a+b*b+c*c);return g.vertices.push(new THREE.Vertex(new THREE.Vector3(a/e,b/e,c/e)))-1}function c(a,b,c,e){e.faces.push(new THREE.Face3(a,b,c))}function e(a,c){var e=g.vertices[a].position,f=g.vertices[c].position;return b((e.x+f.x)/2,(e.y+f.y)/2,(e.z+f.z)/2)}var g=this,h=new THREE.Geometry;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;b(-1,a,0);b(1,a,0);b(-1,-a,0);b(1,-a,0);b(0,-1,a);b(0,1,a);b(0,-1,
--a);b(0,1,-a);b(a,0,-1);b(a,0,1);b(-a,0,-1);b(-a,0,1);c(0,11,5,h);c(0,5,1,h);c(0,1,7,h);c(0,7,10,h);c(0,10,11,h);c(1,5,9,h);c(5,11,4,h);c(11,10,2,h);c(10,7,6,h);c(7,1,8,h);c(3,9,4,h);c(3,4,2,h);c(3,2,6,h);c(3,6,8,h);c(3,8,9,h);c(4,9,5,h);c(2,4,11,h);c(6,2,10,h);c(8,6,7,h);c(9,8,1,h);for(var f=0;f<this.subdivisions;f++){var a=new THREE.Geometry,k;for(k in h.faces){var l=e(h.faces[k].a,h.faces[k].b),m=e(h.faces[k].b,h.faces[k].c),n=e(h.faces[k].c,h.faces[k].a);c(h.faces[k].a,l,n,a);c(h.faces[k].b,m,
-l,a);c(h.faces[k].c,n,m,a);c(l,m,n,a)}h.faces=a.faces}g.faces=h.faces;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
-THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],e=[],g=[],h=[],f=(new THREE.Matrix4).setRotationZ(b),k=0;k<a.length;k++)this.vertices.push(new THREE.Vertex(a[k])),c[k]=a[k].clone(),e[k]=this.vertices.length-1;for(var l=0;l<=this.angle+0.0010;l+=b){for(k=0;k<c.length;k++)l<this.angle?(c[k]=f.multiplyVector3(c[k].clone()),this.vertices.push(new THREE.Vertex(c[k])),g[k]=this.vertices.length-1):g=h;l==0&&(h=e);
-for(k=0;k<e.length-1;k++)this.faces.push(new THREE.Face4(g[k],g[k+1],e[k+1],e[k])),this.faceVertexUvs[0].push([new THREE.UV(1-l/this.angle,k/a.length),new THREE.UV(1-l/this.angle,(k+1)/a.length),new THREE.UV(1-(l-b)/this.angle,(k+1)/a.length),new THREE.UV(1-(l-b)/this.angle,k/a.length)]);e=g;g=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
-THREE.PlaneGeometry=function(a,b,c,e){THREE.Geometry.call(this);var g,h=a/2,f=b/2,c=c||1,e=e||1,k=c+1,l=e+1;a/=c;var m=b/e;for(g=0;g<l;g++)for(b=0;b<k;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*a-h,-(g*m-f),0)));for(g=0;g<e;g++)for(b=0;b<c;b++)this.faces.push(new THREE.Face4(b+k*g,b+k*(g+1),b+1+k*(g+1),b+1+k*g)),this.faceVertexUvs[0].push([new THREE.UV(b/c,g/e),new THREE.UV(b/c,(g+1)/e),new THREE.UV((b+1)/c,(g+1)/e),new THREE.UV((b+1)/c,g/e)]);this.computeCentroids();this.computeFaceNormals()};
+THREE.IcosahedronGeometry=function(a){function b(a,c,b){var e=Math.sqrt(a*a+c*c+b*b);return h.vertices.push(new THREE.Vertex(new THREE.Vector3(a/e,c/e,b/e)))-1}function c(a,c,b,e){e.faces.push(new THREE.Face3(a,c,b))}function e(a,c){var e=h.vertices[a].position,f=h.vertices[c].position;return b((e.x+f.x)/2,(e.y+f.y)/2,(e.z+f.z)/2)}var h=this,g=new THREE.Geometry;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;b(-1,a,0);b(1,a,0);b(-1,-a,0);b(1,-a,0);b(0,-1,a);b(0,1,a);b(0,-1,
+-a);b(0,1,-a);b(a,0,-1);b(a,0,1);b(-a,0,-1);b(-a,0,1);c(0,11,5,g);c(0,5,1,g);c(0,1,7,g);c(0,7,10,g);c(0,10,11,g);c(1,5,9,g);c(5,11,4,g);c(11,10,2,g);c(10,7,6,g);c(7,1,8,g);c(3,9,4,g);c(3,4,2,g);c(3,2,6,g);c(3,6,8,g);c(3,8,9,g);c(4,9,5,g);c(2,4,11,g);c(6,2,10,g);c(8,6,7,g);c(9,8,1,g);for(var f=0;f<this.subdivisions;f++){var a=new THREE.Geometry,k;for(k in g.faces){var l=e(g.faces[k].a,g.faces[k].b),m=e(g.faces[k].b,g.faces[k].c),n=e(g.faces[k].c,g.faces[k].a);c(g.faces[k].a,l,n,a);c(g.faces[k].b,m,
+l,a);c(g.faces[k].c,n,m,a);c(l,m,n,a)}g.faces=a.faces}h.faces=g.faces;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
+THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],e=[],h=[],g=[],f=(new THREE.Matrix4).setRotationZ(b),k=0;k<a.length;k++)this.vertices.push(new THREE.Vertex(a[k])),c[k]=a[k].clone(),e[k]=this.vertices.length-1;for(var l=0;l<=this.angle+0.0010;l+=b){for(k=0;k<c.length;k++)l<this.angle?(c[k]=f.multiplyVector3(c[k].clone()),this.vertices.push(new THREE.Vertex(c[k])),h[k]=this.vertices.length-1):h=g;l==0&&(g=e);
+for(k=0;k<e.length-1;k++)this.faces.push(new THREE.Face4(h[k],h[k+1],e[k+1],e[k])),this.faceVertexUvs[0].push([new THREE.UV(1-l/this.angle,k/a.length),new THREE.UV(1-l/this.angle,(k+1)/a.length),new THREE.UV(1-(l-b)/this.angle,(k+1)/a.length),new THREE.UV(1-(l-b)/this.angle,k/a.length)]);e=h;h=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.PlaneGeometry=function(a,b,c,e){THREE.Geometry.call(this);var h,g=a/2,f=b/2,c=c||1,e=e||1,k=c+1,l=e+1;a/=c;var m=b/e;for(h=0;h<l;h++)for(b=0;b<k;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*a-g,-(h*m-f),0)));for(h=0;h<e;h++)for(b=0;b<c;b++)this.faces.push(new THREE.Face4(b+k*h,b+k*(h+1),b+1+k*(h+1),b+1+k*h)),this.faceVertexUvs[0].push([new THREE.UV(b/c,h/e),new THREE.UV(b/c,(h+1)/e),new THREE.UV((b+1)/c,(h+1)/e),new THREE.UV((b+1)/c,h/e)]);this.computeCentroids();this.computeFaceNormals()};
 THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.SphereGeometry=function(a,b,c){THREE.Geometry.call(this);for(var a=a||50,e,g=Math.PI,h=Math.max(3,b||8),f=Math.max(2,c||6),b=[],c=0;c<f+1;c++){e=c/f;var k=a*Math.cos(e*g),l=a*Math.sin(e*g),m=[],n=0;for(e=0;e<h;e++){var o=2*e/h,p=l*Math.sin(o*g),o=l*Math.cos(o*g);(c==0||c==f)&&e>0||(n=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,k,p)))-1);m.push(n)}b.push(m)}for(var t,x,v,g=b.length,c=0;c<g;c++)if(h=b[c].length,c>0)for(e=0;e<h;e++){m=e==h-1;f=b[c][m?0:e+1];k=b[c][m?h-1:e];l=b[c-1][m?
-h-1:e];m=b[c-1][m?0:e+1];p=c/(g-1);t=(c-1)/(g-1);x=(e+1)/h;var o=e/h,n=new THREE.UV(1-x,p),p=new THREE.UV(1-o,p),o=new THREE.UV(1-o,t),u=new THREE.UV(1-x,t);c<b.length-1&&(t=this.vertices[f].position.clone(),x=this.vertices[k].position.clone(),v=this.vertices[l].position.clone(),t.normalize(),x.normalize(),v.normalize(),this.faces.push(new THREE.Face3(f,k,l,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(x.x,x.y,x.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([n,p,o]));c>1&&(t=
+THREE.SphereGeometry=function(a,b,c){THREE.Geometry.call(this);for(var a=a||50,e,h=Math.PI,g=Math.max(3,b||8),f=Math.max(2,c||6),b=[],c=0;c<f+1;c++){e=c/f;var k=a*Math.cos(e*h),l=a*Math.sin(e*h),m=[],n=0;for(e=0;e<g;e++){var o=2*e/g,p=l*Math.sin(o*h),o=l*Math.cos(o*h);(c==0||c==f)&&e>0||(n=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,k,p)))-1);m.push(n)}b.push(m)}for(var t,x,v,h=b.length,c=0;c<h;c++)if(g=b[c].length,c>0)for(e=0;e<g;e++){m=e==g-1;f=b[c][m?0:e+1];k=b[c][m?g-1:e];l=b[c-1][m?
+g-1:e];m=b[c-1][m?0:e+1];p=c/(h-1);t=(c-1)/(h-1);x=(e+1)/g;var o=e/g,n=new THREE.UV(1-x,p),p=new THREE.UV(1-o,p),o=new THREE.UV(1-o,t),u=new THREE.UV(1-x,t);c<b.length-1&&(t=this.vertices[f].position.clone(),x=this.vertices[k].position.clone(),v=this.vertices[l].position.clone(),t.normalize(),x.normalize(),v.normalize(),this.faces.push(new THREE.Face3(f,k,l,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(x.x,x.y,x.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([n,p,o]));c>1&&(t=
 this.vertices[f].position.clone(),x=this.vertices[l].position.clone(),v=this.vertices[m].position.clone(),t.normalize(),x.normalize(),v.normalize(),this.faces.push(new THREE.Face3(f,l,m,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(x.x,x.y,x.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([n,o,u]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;
 THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 THREE.TextGeometry=function(a,b){var c=(new THREE.TextPath(a,b)).toShapes();b.amount=b.height!==void 0?b.height:50;if(b.bevelThickness===void 0)b.bevelThickness=10;if(b.bevelSize===void 0)b.bevelSize=8;if(b.bevelEnabled===void 0)b.bevelEnabled=!1;if(b.bend){var e=c[c.length-1].getBoundingBox().maxX;b.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(e/2,120),new THREE.Vector2(e,0))}THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
 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(a,b){return(new TextPath(a,b)).toShapes()},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){for(var b=
-this.getFace(),c=this.size/b.resolution,e=0,g=String(a).split(""),h=g.length,f=[],a=0;a<h;a++){var k=new THREE.Path,k=this.extractGlyphPoints(g[a],b,c,e,k);e+=k.offset;f.push(k.path)}return{paths:f,offset:e/2}},extractGlyphPoints:function(a,b,c,e,g){var h=[],f,k,l,m,n,o,p,t,x,v,u=b.glyphs[a]||b.glyphs[ctxt.options.fallbackCharacter];if(u){if(u.o){b=u._cachedOutline||(u._cachedOutline=u.o.split(" "));l=b.length;for(a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+e;m=b[a++]*c;h.push(new THREE.Vector2(k,
-m));g.moveTo(k,m);break;case "l":k=b[a++]*c+e;m=b[a++]*c;h.push(new THREE.Vector2(k,m));g.lineTo(k,m);break;case "q":k=b[a++]*c+e;m=b[a++]*c;p=b[a++]*c+e;t=b[a++]*c;g.quadraticCurveTo(p,t,k,m);if(f=h[h.length-1]){n=f.x;o=f.y;f=1;for(divisions=this.divisions;f<=divisions;f++){var z=f/divisions,y=THREE.Shape.Utils.b2(z,n,p,k),z=THREE.Shape.Utils.b2(z,o,t,m);h.push(new THREE.Vector2(y,z))}}break;case "b":if(k=b[a++]*c+e,m=b[a++]*c,p=b[a++]*c+e,t=b[a++]*-c,x=b[a++]*c+e,v=b[a++]*-c,g.bezierCurveTo(k,m,
-p,t,x,v),f=h[h.length-1]){n=f.x;o=f.y;f=1;for(divisions=this.divisions;f<=divisions;f++)z=f/divisions,y=THREE.Shape.Utils.b3(z,n,p,x,k),z=THREE.Shape.Utils.b3(z,o,t,v,m),h.push(new THREE.Vector2(y,z))}}}return{offset:u.ha*c,points:h,path:g}}}};
-(function(a){var b=function(a){for(var b=a.length,g=0,h=b-1,f=0;f<b;h=f++)g+=a[h].x*a[f].y-a[f].x*a[h].y;return g*0.5};a.Triangulate=function(a,e){var g=a.length;if(g<3)return null;var h=[],f=[],k=[],l,m,n;if(b(a)>0)for(m=0;m<g;m++)f[m]=m;else for(m=0;m<g;m++)f[m]=g-1-m;var o=2*g;for(m=g-1;g>2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return k;return h}l=m;g<=l&&(l=0);m=l+1;g<=m&&(m=0);n=m+1;g<=n&&(n=0);var p;a:{p=a;var t=l,x=m,v=n,u=g,z=f,y=void 0,w=void 0,A=void 0,
-C=void 0,F=void 0,G=void 0,I=void 0,H=void 0,M=void 0,w=p[z[t]].x,A=p[z[t]].y,C=p[z[x]].x,F=p[z[x]].y,G=p[z[v]].x,I=p[z[v]].y;if(1.0E-10>(C-w)*(I-A)-(F-A)*(G-w))p=!1;else{for(y=0;y<u;y++)if(!(y==t||y==x||y==v)){var H=p[z[y]].x,M=p[z[y]].y,B=void 0,D=void 0,J=void 0,L=void 0,N=void 0,K=void 0,P=void 0,E=void 0,S=void 0,O=void 0,U=void 0,W=void 0,B=J=N=void 0,B=G-C,D=I-F,J=w-G,L=A-I,N=C-w,K=F-A,P=H-w,E=M-A,S=H-C,O=M-F,U=H-G,W=M-I,B=B*O-D*S,N=N*E-K*P,J=J*W-L*U;if(B>=0&&J>=0&&N>=0){p=!1;break a}}p=!0}}if(p){h.push([a[f[l]],
-a[f[m]],a[f[n]]]);k.push([f[l],f[m],f[n]]);l=m;for(n=m+1;n<g;l++,n++)f[l]=f[n];g--;o=2*g}}if(e)return k;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,g){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=e||6;this.arc=g||Math.PI*2;g=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,f=c/this.segmentsR*Math.PI*2;g.x=this.radius*Math.cos(h);g.y=this.radius*Math.sin(h);var k=new THREE.Vector3;k.x=(this.radius+this.tube*Math.cos(f))*Math.cos(h);k.y=(this.radius+this.tube*Math.cos(f))*Math.sin(h);k.z=
-this.tube*Math.sin(f);this.vertices.push(new THREE.Vertex(k));a.push(new THREE.UV(e/this.segmentsT,1-c/this.segmentsR));b.push(k.clone().subSelf(g).normalize())}for(c=1;c<=this.segmentsR;c++)for(e=1;e<=this.segmentsT;e++){var g=(this.segmentsT+1)*c+e-1,h=(this.segmentsT+1)*(c-1)+e-1,f=(this.segmentsT+1)*(c-1)+e,k=(this.segmentsT+1)*c+e,l=new THREE.Face4(g,h,f,k,[b[g],b[h],b[f],b[k]]);l.normal.addSelf(b[g]);l.normal.addSelf(b[h]);l.normal.addSelf(b[f]);l.normal.addSelf(b[k]);l.normal.normalize();this.faces.push(l);
-this.faceVertexUvs[0].push([a[g].clone(),a[h].clone(),a[f].clone(),a[k].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
-THREE.TorusKnotGeometry=function(a,b,c,e,g,h,f){function k(a,b,c,e,f,h){b=c/e*a;c=Math.cos(b);return new THREE.Vector3(f*(2+c)*0.5*Math.cos(a),f*(2+c)*Math.sin(a)*0.5,h*f*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=g||2;this.q=h||3;this.heightScale=f||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 l=a/this.segmentsR*2*this.p*Math.PI,f=b/this.segmentsT*2*Math.PI,g=k(l,f,this.q,this.p,this.radius,this.heightScale),l=k(l+0.01,f,this.q,this.p,this.radius,this.heightScale);c.x=l.x-g.x;c.y=l.y-g.y;c.z=l.z-g.z;e.x=l.x+g.x;e.y=l.y+g.y;e.z=l.z+g.z;h.cross(c,e);e.cross(h,c);h.normalize();e.normalize();l=-this.tube*Math.cos(f);f=this.tube*Math.sin(f);g.x+=l*e.x+f*h.x;g.y+=l*e.y+f*h.y;g.z+=l*e.z+f*h.z;this.grid[a][b]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(g.x,g.y,
-g.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,g=this.grid[a][b],c=this.grid[e][b],e=this.grid[e][h],h=this.grid[a][h],f=new THREE.UV(a/this.segmentsR,b/this.segmentsT),l=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT),m=new THREE.UV((a+1)/this.segmentsR,(b+1)/this.segmentsT),n=new THREE.UV(a/this.segmentsR,(b+1)/this.segmentsT);this.faces.push(new THREE.Face4(g,c,e,h));this.faceVertexUvs[0].push([f,l,m,n])}this.computeCentroids();
+this.getFace(),c=this.size/b.resolution,e=0,h=String(a).split(""),g=h.length,f=[],a=0;a<g;a++){var k=new THREE.Path,k=this.extractGlyphPoints(h[a],b,c,e,k);e+=k.offset;f.push(k.path)}return{paths:f,offset:e/2}},extractGlyphPoints:function(a,b,c,e,h){var g=[],f,k,l,m,n,o,p,t,x,v,u=b.glyphs[a]||b.glyphs[ctxt.options.fallbackCharacter];if(u){if(u.o){b=u._cachedOutline||(u._cachedOutline=u.o.split(" "));l=b.length;for(a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+e;m=b[a++]*c;g.push(new THREE.Vector2(k,
+m));h.moveTo(k,m);break;case "l":k=b[a++]*c+e;m=b[a++]*c;g.push(new THREE.Vector2(k,m));h.lineTo(k,m);break;case "q":k=b[a++]*c+e;m=b[a++]*c;p=b[a++]*c+e;t=b[a++]*c;h.quadraticCurveTo(p,t,k,m);if(f=g[g.length-1]){n=f.x;o=f.y;f=1;for(divisions=this.divisions;f<=divisions;f++){var z=f/divisions,y=THREE.Shape.Utils.b2(z,n,p,k),z=THREE.Shape.Utils.b2(z,o,t,m);g.push(new THREE.Vector2(y,z))}}break;case "b":if(k=b[a++]*c+e,m=b[a++]*c,p=b[a++]*c+e,t=b[a++]*-c,x=b[a++]*c+e,v=b[a++]*-c,h.bezierCurveTo(k,m,
+p,t,x,v),f=g[g.length-1]){n=f.x;o=f.y;f=1;for(divisions=this.divisions;f<=divisions;f++)z=f/divisions,y=THREE.Shape.Utils.b3(z,n,p,x,k),z=THREE.Shape.Utils.b3(z,o,t,v,m),g.push(new THREE.Vector2(y,z))}}}return{offset:u.ha*c,points:g,path:h}}}};
+(function(a){var b=function(a){for(var b=a.length,h=0,g=b-1,f=0;f<b;g=f++)h+=a[g].x*a[f].y-a[f].x*a[g].y;return h*0.5};a.Triangulate=function(a,e){var h=a.length;if(h<3)return null;var g=[],f=[],k=[],l,m,n;if(b(a)>0)for(m=0;m<h;m++)f[m]=m;else for(m=0;m<h;m++)f[m]=h-1-m;var o=2*h;for(m=h-1;h>2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return k;return g}l=m;h<=l&&(l=0);m=l+1;h<=m&&(m=0);n=m+1;h<=n&&(n=0);var p;a:{p=a;var t=l,x=m,v=n,u=h,z=f,y=void 0,w=void 0,A=void 0,
+C=void 0,F=void 0,G=void 0,I=void 0,H=void 0,M=void 0,w=p[z[t]].x,A=p[z[t]].y,C=p[z[x]].x,F=p[z[x]].y,G=p[z[v]].x,I=p[z[v]].y;if(1.0E-10>(C-w)*(I-A)-(F-A)*(G-w))p=!1;else{for(y=0;y<u;y++)if(!(y==t||y==x||y==v)){var H=p[z[y]].x,M=p[z[y]].y,B=void 0,D=void 0,J=void 0,L=void 0,N=void 0,K=void 0,P=void 0,E=void 0,S=void 0,O=void 0,U=void 0,W=void 0,B=J=N=void 0,B=G-C,D=I-F,J=w-G,L=A-I,N=C-w,K=F-A,P=H-w,E=M-A,S=H-C,O=M-F,U=H-G,W=M-I,B=B*O-D*S,N=N*E-K*P,J=J*W-L*U;if(B>=0&&J>=0&&N>=0){p=!1;break a}}p=!0}}if(p){g.push([a[f[l]],
+a[f[m]],a[f[n]]]);k.push([f[l],f[m],f[n]]);l=m;for(n=m+1;n<h;l++,n++)f[l]=f[n];h--;o=2*h}}if(e)return k;return g};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
+THREE.TorusGeometry=function(a,b,c,e,h){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=e||6;this.arc=h||Math.PI*2;h=new THREE.Vector3;a=[];b=[];for(c=0;c<=this.segmentsR;c++)for(e=0;e<=this.segmentsT;e++){var g=e/this.segmentsT*this.arc,f=c/this.segmentsR*Math.PI*2;h.x=this.radius*Math.cos(g);h.y=this.radius*Math.sin(g);var k=new THREE.Vector3;k.x=(this.radius+this.tube*Math.cos(f))*Math.cos(g);k.y=(this.radius+this.tube*Math.cos(f))*Math.sin(g);k.z=
+this.tube*Math.sin(f);this.vertices.push(new THREE.Vertex(k));a.push(new THREE.UV(e/this.segmentsT,1-c/this.segmentsR));b.push(k.clone().subSelf(h).normalize())}for(c=1;c<=this.segmentsR;c++)for(e=1;e<=this.segmentsT;e++){var h=(this.segmentsT+1)*c+e-1,g=(this.segmentsT+1)*(c-1)+e-1,f=(this.segmentsT+1)*(c-1)+e,k=(this.segmentsT+1)*c+e,l=new THREE.Face4(h,g,f,k,[b[h],b[g],b[f],b[k]]);l.normal.addSelf(b[h]);l.normal.addSelf(b[g]);l.normal.addSelf(b[f]);l.normal.addSelf(b[k]);l.normal.normalize();this.faces.push(l);
+this.faceVertexUvs[0].push([a[h].clone(),a[g].clone(),a[f].clone(),a[k].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
+THREE.TorusKnotGeometry=function(a,b,c,e,h,g,f){function k(a,c,b,e,f,g){c=b/e*a;b=Math.cos(c);return new THREE.Vector3(f*(2+b)*0.5*Math.cos(a),f*(2+b)*Math.sin(a)*0.5,g*f*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=a||200;this.tube=b||40;this.segmentsR=c||64;this.segmentsT=e||8;this.p=h||2;this.q=g||3;this.heightScale=f||1;this.grid=Array(this.segmentsR);c=new THREE.Vector3;e=new THREE.Vector3;g=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=Array(this.segmentsT);for(b=0;b<
+this.segmentsT;++b){var l=a/this.segmentsR*2*this.p*Math.PI,f=b/this.segmentsT*2*Math.PI,h=k(l,f,this.q,this.p,this.radius,this.heightScale),l=k(l+0.01,f,this.q,this.p,this.radius,this.heightScale);c.x=l.x-h.x;c.y=l.y-h.y;c.z=l.z-h.z;e.x=l.x+h.x;e.y=l.y+h.y;e.z=l.z+h.z;g.cross(c,e);e.cross(g,c);g.normalize();e.normalize();l=-this.tube*Math.cos(f);f=this.tube*Math.sin(f);h.x+=l*e.x+f*g.x;h.y+=l*e.y+f*g.y;h.z+=l*e.z+f*g.z;this.grid[a][b]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(h.x,h.y,
+h.z)))-1}}for(a=0;a<this.segmentsR;++a)for(b=0;b<this.segmentsT;++b){var e=(a+1)%this.segmentsR,g=(b+1)%this.segmentsT,h=this.grid[a][b],c=this.grid[e][b],e=this.grid[e][g],g=this.grid[a][g],f=new THREE.UV(a/this.segmentsR,b/this.segmentsT),l=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT),m=new THREE.UV((a+1)/this.segmentsR,(b+1)/this.segmentsT),n=new THREE.UV(a/this.segmentsR,(b+1)/this.segmentsT);this.faces.push(new THREE.Face4(h,c,e,g));this.faceVertexUvs[0].push([f,l,m,n])}this.computeCentroids();
 this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ";b+=a.total?(100*a.loaded/a.total).toFixed(0)+"%":(a.loaded/1E3).toFixed(2)+" KB";
 this.statusDomElement.innerHTML=b},extractUrlbase:function(a){a=a.split("/");a.pop();return a.join("/")},init_materials:function(a,b,c){a.materials=[];for(var e=0;e<b.length;++e)a.materials[e]=[THREE.Loader.prototype.createMaterial(b[e],c)]},hasNormals:function(a){var b,c,e=a.materials.length;for(c=0;c<e;c++)if(b=a.materials[c][0],b instanceof THREE.MeshShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.floor(a)==a}function e(a,b){var e=
-new Image;e.onload=function(){if(!c(this.width)||!c(this.height)){var b=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),e=Math.pow(2,Math.round(Math.log(this.height)/Math.LN2));a.image.width=b;a.image.height=e;a.image.getContext("2d").drawImage(this,0,0,b,e)}else a.image=this;a.needsUpdate=!0};e.src=b}function g(a,c,f,h,g,k){var l=document.createElement("canvas");a[c]=new THREE.Texture(l);a[c].sourceFile=f;if(h){a[c].repeat.set(h[0],h[1]);if(h[0]!=1)a[c].wrapS=THREE.RepeatWrapping;if(h[1]!=
-1)a[c].wrapT=THREE.RepeatWrapping}g&&a[c].offset.set(g[0],g[1]);if(k){h={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(h[k[0]]!==void 0)a[c].wrapS=h[k[0]];if(h[k[1]]!==void 0)a[c].wrapT=h[k[1]]}e(a[c],b+"/"+f)}function h(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}var f,k,l;k="MeshLambertMaterial";f={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:a.wireframe};a.shading&&(a.shading=="Phong"?k="MeshPhongMaterial":a.shading=="Basic"&&(k="MeshBasicMaterial"));
-if(a.blending)if(a.blending=="Additive")f.blending=THREE.AdditiveBlending;else if(a.blending=="Subtractive")f.blending=THREE.SubtractiveBlending;else if(a.blending=="Multiply")f.blending=THREE.MultiplyBlending;if(a.transparent!==void 0||a.opacity<1)f.transparent=a.transparent;if(a.depthTest!==void 0)f.depthTest=a.depthTest;if(a.vertexColors!==void 0)if(a.vertexColors=="face")f.vertexColors=THREE.FaceColors;else if(a.vertexColors)f.vertexColors=THREE.VertexColors;if(a.colorDiffuse)f.color=h(a.colorDiffuse);
-else if(a.DbgColor)f.color=a.DbgColor;if(a.colorSpecular)f.specular=h(a.colorSpecular);if(a.colorAmbient)f.ambient=h(a.colorAmbient);if(a.transparency)f.opacity=a.transparency;if(a.specularCoef)f.shininess=a.specularCoef;a.mapDiffuse&&b&&g(f,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap);a.mapLight&&b&&g(f,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap);a.mapNormal&&b&&g(f,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap);
-a.mapSpecular&&b&&g(f,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap);if(a.mapNormal){var m=THREE.ShaderUtils.lib.normal,n=THREE.UniformsUtils.clone(m.uniforms),o=f.color;k=f.specular;l=f.ambient;var p=f.shininess;n.tNormal.texture=f.normalMap;if(a.mapNormalFactor)n.uNormalScale.value=a.mapNormalFactor;if(f.map)n.tDiffuse.texture=f.map,n.enableDiffuse.value=!0;if(f.specularMap)n.tSpecular.texture=f.specularMap,n.enableSpecular.value=!0;if(f.lightMap)n.tAO.texture=
+new Image;e.onload=function(){if(!c(this.width)||!c(this.height)){var b=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),e=Math.pow(2,Math.round(Math.log(this.height)/Math.LN2));a.image.width=b;a.image.height=e;a.image.getContext("2d").drawImage(this,0,0,b,e)}else a.image=this;a.needsUpdate=!0};e.src=b}function h(a,c,f,g,h,k){var l=document.createElement("canvas");a[c]=new THREE.Texture(l);a[c].sourceFile=f;if(g){a[c].repeat.set(g[0],g[1]);if(g[0]!=1)a[c].wrapS=THREE.RepeatWrapping;if(g[1]!=
+1)a[c].wrapT=THREE.RepeatWrapping}h&&a[c].offset.set(h[0],h[1]);if(k){g={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(g[k[0]]!==void 0)a[c].wrapS=g[k[0]];if(g[k[1]]!==void 0)a[c].wrapT=g[k[1]]}e(a[c],b+"/"+f)}function g(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}var f,k,l;k="MeshLambertMaterial";f={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:a.wireframe};a.shading&&(a.shading=="Phong"?k="MeshPhongMaterial":a.shading=="Basic"&&(k="MeshBasicMaterial"));
+if(a.blending)if(a.blending=="Additive")f.blending=THREE.AdditiveBlending;else if(a.blending=="Subtractive")f.blending=THREE.SubtractiveBlending;else if(a.blending=="Multiply")f.blending=THREE.MultiplyBlending;if(a.transparent!==void 0||a.opacity<1)f.transparent=a.transparent;if(a.depthTest!==void 0)f.depthTest=a.depthTest;if(a.vertexColors!==void 0)if(a.vertexColors=="face")f.vertexColors=THREE.FaceColors;else if(a.vertexColors)f.vertexColors=THREE.VertexColors;if(a.colorDiffuse)f.color=g(a.colorDiffuse);
+else if(a.DbgColor)f.color=a.DbgColor;if(a.colorSpecular)f.specular=g(a.colorSpecular);if(a.colorAmbient)f.ambient=g(a.colorAmbient);if(a.transparency)f.opacity=a.transparency;if(a.specularCoef)f.shininess=a.specularCoef;a.mapDiffuse&&b&&h(f,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap);a.mapLight&&b&&h(f,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap);a.mapNormal&&b&&h(f,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap);
+a.mapSpecular&&b&&h(f,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap);if(a.mapNormal){var m=THREE.ShaderUtils.lib.normal,n=THREE.UniformsUtils.clone(m.uniforms),o=f.color;k=f.specular;l=f.ambient;var p=f.shininess;n.tNormal.texture=f.normalMap;if(a.mapNormalFactor)n.uNormalScale.value=a.mapNormalFactor;if(f.map)n.tDiffuse.texture=f.map,n.enableDiffuse.value=!0;if(f.specularMap)n.tSpecular.texture=f.specularMap,n.enableSpecular.value=!0;if(f.lightMap)n.tAO.texture=
 f.lightMap,n.enableAO.value=!0;n.uDiffuseColor.value.setHex(o);n.uSpecularColor.value.setHex(k);n.uAmbientColor.value.setHex(l);n.uShininess.value=p;if(f.opacity)n.uOpacity.value=f.opacity;f=new THREE.MeshShaderMaterial({fragmentShader:m.fragmentShader,vertexShader:m.vertexShader,uniforms:n,lights:!0,fog:!0})}else f=new THREE[k](f);return f},constructor:THREE.Loader};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};THREE.BinaryLoader.prototype=new THREE.Loader;
 THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
-THREE.BinaryLoader.prototype.load=function(a){var b=a.model,c=a.callback,e=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(b),g=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(b),a=(new Date).getTime(),b=new Worker(b),h=this.showProgress?THREE.Loader.prototype.updateProgress:null;b.onmessage=function(a){THREE.BinaryLoader.prototype.loadAjaxBuffers(a.data.buffers,a.data.materials,c,g,e,h)};b.onerror=function(a){alert("worker.onerror: "+a.message+"\n"+a.data);a.preventDefault()};
+THREE.BinaryLoader.prototype.load=function(a){var b=a.model,c=a.callback,e=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(b),h=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(b),a=(new Date).getTime(),b=new Worker(b),g=this.showProgress?THREE.Loader.prototype.updateProgress:null;b.onmessage=function(a){THREE.BinaryLoader.prototype.loadAjaxBuffers(a.data.buffers,a.data.materials,c,h,e,g)};b.onerror=function(a){alert("worker.onerror: "+a.message+"\n"+a.data);a.preventDefault()};
 b.postMessage(a)};
-THREE.BinaryLoader.prototype.loadAjaxBuffers=function(a,b,c,e,g,h){var f=new XMLHttpRequest,k=e+"/"+a,l=0;f.onreadystatechange=function(){f.readyState==4?f.status==200||f.status==0?THREE.BinaryLoader.prototype.createBinModel(f.responseText,c,g,b):alert("Couldn't load ["+k+"] ["+f.status+"]"):f.readyState==3?h&&(l==0&&(l=f.getResponseHeader("Content-Length")),h({total:l,loaded:f.responseText.length})):f.readyState==2&&(l=f.getResponseHeader("Content-Length"))};f.open("GET",k,!0);f.overrideMimeType("text/plain; charset=x-user-defined");
+THREE.BinaryLoader.prototype.loadAjaxBuffers=function(a,b,c,e,h,g){var f=new XMLHttpRequest,k=e+"/"+a,l=0;f.onreadystatechange=function(){f.readyState==4?f.status==200||f.status==0?THREE.BinaryLoader.prototype.createBinModel(f.responseText,c,h,b):alert("Couldn't load ["+k+"] ["+f.status+"]"):f.readyState==3?g&&(l==0&&(l=f.getResponseHeader("Content-Length")),g({total:l,loaded:f.responseText.length})):f.readyState==2&&(l=f.getResponseHeader("Content-Length"))};f.open("GET",k,!0);f.overrideMimeType("text/plain; charset=x-user-defined");
 f.setRequestHeader("Content-Type","text/plain");f.send(null)};
-THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,e){var g=function(b){function c(a,b){var e=n(a,b),f=n(a,b+1),g=n(a,b+2),h=n(a,b+3),k=(h<<1&255|g>>7)-127;e|=(g&127)<<16|f<<8;if(e==0&&k==-127)return 0;return(1-2*(h>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,k)}function g(a,b){var c=n(a,b),e=n(a,b+1),f=n(a,b+2);return(n(a,b+3)<<24)+(f<<16)+(e<<8)+c}function l(a,b){var c=n(a,b);return(n(a,b+1)<<8)+c}function m(a,b){var c=n(a,b);return c>127?c-256:c}function n(a,b){return a.charCodeAt(b)&255}function o(b){var c,
-e,f;c=g(a,b);e=g(a,b+F);f=g(a,b+G);b=l(a,b+I);z.faces.push(new THREE.Face3(c,e,f,null,null,z.materials[b]))}function p(b){var c,e,f,h,m,n;c=g(a,b);e=g(a,b+F);f=g(a,b+G);h=l(a,b+I);m=g(a,b+H);n=g(a,b+M);b=g(a,b+B);h=z.materials[h];var o=A[n*3],p=A[n*3+1];n=A[n*3+2];var t=A[b*3],ha=A[b*3+1],b=A[b*3+2];z.faces.push(new THREE.Face3(c,e,f,[new THREE.Vector3(A[m*3],A[m*3+1],A[m*3+2]),new THREE.Vector3(o,p,n),new THREE.Vector3(t,ha,b)],null,h))}function t(b){var c,e,f,h;c=g(a,b);e=g(a,b+D);f=g(a,b+J);h=
-g(a,b+L);b=l(a,b+N);z.faces.push(new THREE.Face4(c,e,f,h,null,null,z.materials[b]))}function x(b){var c,e,f,h,m,n,o,p;c=g(a,b);e=g(a,b+D);f=g(a,b+J);h=g(a,b+L);m=l(a,b+N);n=g(a,b+K);o=g(a,b+P);p=g(a,b+E);b=g(a,b+S);m=z.materials[m];var t=A[o*3],ha=A[o*3+1];o=A[o*3+2];var la=A[p*3],ma=A[p*3+1];p=A[p*3+2];var v=A[b*3],u=A[b*3+1],b=A[b*3+2];z.faces.push(new THREE.Face4(c,e,f,h,[new THREE.Vector3(A[n*3],A[n*3+1],A[n*3+2]),new THREE.Vector3(t,ha,o),new THREE.Vector3(la,ma,p),new THREE.Vector3(v,u,b)],
-null,m))}function v(b){var c,e,f,h;c=g(a,b);e=g(a,b+O);f=g(a,b+U);b=C[c*2];h=C[c*2+1];c=C[e*2];var l=z.faceVertexUvs[0];e=C[e*2+1];var m=C[f*2];f=C[f*2+1];var n=[];n.push(new THREE.UV(b,h));n.push(new THREE.UV(c,e));n.push(new THREE.UV(m,f));l.push(n)}function u(b){var c,e,f,h,l,m;c=g(a,b);e=g(a,b+W);f=g(a,b+T);h=g(a,b+R);b=C[c*2];l=C[c*2+1];c=C[e*2];m=C[e*2+1];e=C[f*2];var n=z.faceVertexUvs[0];f=C[f*2+1];var o=C[h*2];h=C[h*2+1];var p=[];p.push(new THREE.UV(b,l));p.push(new THREE.UV(c,m));p.push(new THREE.UV(e,
-f));p.push(new THREE.UV(o,h));n.push(p)}var z=this,y=0,w,A=[],C=[],F,G,I,H,M,B,D,J,L,N,K,P,E,S,O,U,W,T,R,Q,Z,X,Y,$,V;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(z,e,b);w={signature:a.substr(y,8),header_bytes:n(a,y+8),vertex_coordinate_bytes:n(a,y+9),normal_coordinate_bytes:n(a,y+10),uv_coordinate_bytes:n(a,y+11),vertex_index_bytes:n(a,y+12),normal_index_bytes:n(a,y+13),uv_index_bytes:n(a,y+14),material_index_bytes:n(a,y+15),nvertices:g(a,y+16),nnormals:g(a,y+16+4),nuvs:g(a,y+16+
-8),ntri_flat:g(a,y+16+12),ntri_smooth:g(a,y+16+16),ntri_flat_uv:g(a,y+16+20),ntri_smooth_uv:g(a,y+16+24),nquad_flat:g(a,y+16+28),nquad_smooth:g(a,y+16+32),nquad_flat_uv:g(a,y+16+36),nquad_smooth_uv:g(a,y+16+40)};y+=w.header_bytes;F=w.vertex_index_bytes;G=w.vertex_index_bytes*2;I=w.vertex_index_bytes*3;H=w.vertex_index_bytes*3+w.material_index_bytes;M=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes;B=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes*2;D=w.vertex_index_bytes;
-J=w.vertex_index_bytes*2;L=w.vertex_index_bytes*3;N=w.vertex_index_bytes*4;K=w.vertex_index_bytes*4+w.material_index_bytes;P=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes;E=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*2;S=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*3;O=w.uv_index_bytes;U=w.uv_index_bytes*2;W=w.uv_index_bytes;T=w.uv_index_bytes*2;R=w.uv_index_bytes*3;b=w.vertex_index_bytes*3+w.material_index_bytes;V=w.vertex_index_bytes*
-4+w.material_index_bytes;Q=w.ntri_flat*b;Z=w.ntri_smooth*(b+w.normal_index_bytes*3);X=w.ntri_flat_uv*(b+w.uv_index_bytes*3);Y=w.ntri_smooth_uv*(b+w.normal_index_bytes*3+w.uv_index_bytes*3);$=w.nquad_flat*V;b=w.nquad_smooth*(V+w.normal_index_bytes*4);V=w.nquad_flat_uv*(V+w.uv_index_bytes*4);y+=function(b){for(var e,h,g,k=w.vertex_coordinate_bytes*3,l=b+w.nvertices*k;b<l;b+=k)e=c(a,b),h=c(a,b+w.vertex_coordinate_bytes),g=c(a,b+w.vertex_coordinate_bytes*2),z.vertices.push(new THREE.Vertex(new THREE.Vector3(e,
-h,g)));return w.nvertices*k}(y);y+=function(b){for(var c,e,f,h=w.normal_coordinate_bytes*3,g=b+w.nnormals*h;b<g;b+=h)c=m(a,b),e=m(a,b+w.normal_coordinate_bytes),f=m(a,b+w.normal_coordinate_bytes*2),A.push(c/127,e/127,f/127);return w.nnormals*h}(y);y+=function(b){for(var e,h,g=w.uv_coordinate_bytes*2,k=b+w.nuvs*g;b<k;b+=g)e=c(a,b),h=c(a,b+w.uv_coordinate_bytes),C.push(e,h);return w.nuvs*g}(y);Q=y+Q;Z=Q+Z;X=Z+X;Y=X+Y;$=Y+$;b=$+b;V=b+V;(function(a){var b,c=w.vertex_index_bytes*3+w.material_index_bytes,
-e=c+w.uv_index_bytes*3,f=a+w.ntri_flat_uv*e;for(b=a;b<f;b+=e)o(b),v(b+c);return f-a})(Z);(function(a){var b,c=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes*3,e=c+w.uv_index_bytes*3,f=a+w.ntri_smooth_uv*e;for(b=a;b<f;b+=e)p(b),v(b+c);return f-a})(X);(function(a){var b,c=w.vertex_index_bytes*4+w.material_index_bytes,e=c+w.uv_index_bytes*4,f=a+w.nquad_flat_uv*e;for(b=a;b<f;b+=e)t(b),u(b+c);return f-a})(b);(function(a){var b,c=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*
-4,e=c+w.uv_index_bytes*4,f=a+w.nquad_smooth_uv*e;for(b=a;b<f;b+=e)x(b),u(b+c);return f-a})(V);(function(a){var b,c=w.vertex_index_bytes*3+w.material_index_bytes,e=a+w.ntri_flat*c;for(b=a;b<e;b+=c)o(b);return e-a})(y);(function(a){var b,c=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes*3,e=a+w.ntri_smooth*c;for(b=a;b<e;b+=c)p(b);return e-a})(Q);(function(a){var b,c=w.vertex_index_bytes*4+w.material_index_bytes,e=a+w.nquad_flat*c;for(b=a;b<e;b+=c)t(b);return e-a})(Y);(function(a){var b,
-c=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*4,e=a+w.nquad_smooth*c;for(b=a;b<e;b+=c)x(b);return e-a})($);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};g.prototype=new THREE.Geometry;g.prototype.constructor=g;b(new g(c))};
-var ColladaLoader=function(){function a(a,b,c){for(var a=Q.evaluate(a,Q,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),e={},f=a.iterateNext(),h=0;f;){f=(new b).parse(f);if(f.id.length==0)f.id=c+h++;e[f.id]=f;f=a.iterateNext()}return e}function b(){var a=1E6,b=-a,c=0,e;for(e in V)for(var f=V[e],h=0;h<f.sampler.length;h++){var g=f.sampler[h];g.create();a=Math.min(a,g.startTime);b=Math.max(b,g.endTime);c=Math.max(c,g.input.length)}return{start:a,end:b,frames:c}}function c(a,b,e,f){a.world=a.world||new THREE.Matrix4;
-a.world.copy(a.matrix);if(a.channels&&a.channels.length){var h=a.channels[0].sampler.output[e];h instanceof THREE.Matrix4&&a.world.copy(h)}f&&a.world.multiply(f,a.world);b.push(a);for(f=0;f<a.nodes.length;f++)c(a.nodes[f],b,e,a.world)}function e(a,e,f){var h=aa[e.url];if(!h||!h.skin)console.log("could not find skin controller!");else if(!e.skeleton||!e.skeleton.length)console.log("could not find the skeleton for the skin!");else{var g=b(),e=X.getChildById(e.skeleton[0],!0)||X.getChildBySid(e.skeleton[0],
-!0),k,l,m,n,o=new THREE.Vector3,p;for(k=0;k<a.vertices.length;k++)h.skin.bindShapeMatrix.multiplyVector3(a.vertices[k].position);for(f=0;f<g.frames;f++){var t=[],v=[];for(k=0;k<a.vertices.length;k++)v.push(new THREE.Vertex(new THREE.Vector3));c(e,t,f);k=t;l=h.skin;for(n=0;n<k.length;n++){m=k[n];p=-1;for(var u=0;u<l.joints.length;u++)if(m.sid==l.joints[u]){p=u;break}if(p>=0){u=l.invBindMatrices[p];m.invBindMatrix=u;m.skinningMatrix=new THREE.Matrix4;m.skinningMatrix.multiply(m.world,u);m.weights=[];
-for(u=0;u<l.weights.length;u++)for(var x=0;x<l.weights[u].length;x++){var w=l.weights[u][x];w.joint==p&&m.weights.push(w)}}else throw"could not find joint!";}for(k=0;k<t.length;k++)for(l=0;l<t[k].weights.length;l++)m=t[k].weights[l],n=m.index,m=m.weight,p=a.vertices[n],n=v[n],o.x=p.position.x,o.y=p.position.y,o.z=p.position.z,t[k].skinningMatrix.multiplyVector3(o),n.position.x+=o.x*m,n.position.y+=o.y*m,n.position.z+=o.z*m;a.morphTargets.push({name:"target_"+f,vertices:v})}}}function g(a){var b=new THREE.Object3D,
-c,f,h;b.name=a.id||"";b.matrixAutoUpdate=!1;b.matrix=a.matrix;for(h=0;h<a.controllers.length;h++){var k=aa[a.controllers[h].url];switch(k.type){case "skin":if(ba[k.skin.source]){var l=new x;l.url=k.skin.source;l.instance_material=a.controllers[h].instance_material;a.geometries.push(l);c=a.controllers[h]}else if(aa[k.skin.source]&&(f=k=aa[k.skin.source],k.morph&&ba[k.morph.source]))l=new x,l.url=k.morph.source,l.instance_material=a.controllers[h].instance_material,a.geometries.push(l);break;case "morph":if(ba[k.morph.source])l=
-new x,l.url=k.morph.source,l.instance_material=a.controllers[h].instance_material,a.geometries.push(l),f=a.controllers[h];console.log("DAE: morph-controller partially supported.")}}for(h=0;h<a.geometries.length;h++){var k=a.geometries[h],l=k.instance_material,k=ba[k.url],m={},n=0,o;if(k&&k.mesh&&k.mesh.primitives){if(b.name.length==0)b.name=k.id;if(l)for(j=0;j<l.length;j++){o=l[j];var t=fa[ea[o.target].instance_effect.url].shader;t.material.opacity=!t.material.opacity?1:t.material.opacity;o=m[o.symbol]=
-t.material;n++}l=o||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});k=k.mesh.geometry3js;if(n>1){l=new THREE.MeshFaceMaterial;for(j=0;j<k.faces.length;j++)n=k.faces[j],n.materials=[m[n.daeMaterial]]}if(c!==void 0)e(k,c),l.morphTargets=!0,l=new THREE.SkinnedMesh(k,l),l.skeleton=c.skeleton,l.skinController=aa[c.url],l.skinInstanceController=c,l.name="skin_"+da.length,da.push(l);else if(f!==void 0){m=k;n=f instanceof p?aa[f.url]:f;if(!n||!n.morph)console.log("could not find morph controller!");
-else{n=n.morph;for(t=0;t<n.targets.length;t++){var u=ba[n.targets[t]];if(u.mesh&&u.mesh.primitives&&u.mesh.primitives.length)u=u.mesh.primitives[0].geometry,u.vertices.length===m.vertices.length&&m.morphTargets.push({name:"target_1",vertices:u.vertices})}m.morphTargets.push({name:"target_Z",vertices:m.vertices})}l.morphTargets=!0;l=new THREE.Mesh(k,l);l.name="morph_"+ca.length;ca.push(l)}else l=new THREE.Mesh(k,l);b.addChild(l)}}for(h=0;h<a.nodes.length;h++)b.addChild(g(a.nodes[h],a));return b}function h(){this.init_from=
+THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,e){var h=function(c){function b(a,c){var e=n(a,c),f=n(a,c+1),g=n(a,c+2),h=n(a,c+3),k=(h<<1&255|g>>7)-127;e|=(g&127)<<16|f<<8;if(e==0&&k==-127)return 0;return(1-2*(h>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,k)}function h(a,c){var b=n(a,c),e=n(a,c+1),f=n(a,c+2);return(n(a,c+3)<<24)+(f<<16)+(e<<8)+b}function l(a,c){var b=n(a,c);return(n(a,c+1)<<8)+b}function m(a,c){var b=n(a,c);return b>127?b-256:b}function n(a,c){return a.charCodeAt(c)&255}function o(c){var b,
+e,f;b=h(a,c);e=h(a,c+F);f=h(a,c+G);c=l(a,c+I);z.faces.push(new THREE.Face3(b,e,f,null,null,z.materials[c]))}function p(c){var b,e,f,g,m,n;b=h(a,c);e=h(a,c+F);f=h(a,c+G);g=l(a,c+I);m=h(a,c+H);n=h(a,c+M);c=h(a,c+B);g=z.materials[g];var o=A[n*3],p=A[n*3+1];n=A[n*3+2];var t=A[c*3],ha=A[c*3+1],c=A[c*3+2];z.faces.push(new THREE.Face3(b,e,f,[new THREE.Vector3(A[m*3],A[m*3+1],A[m*3+2]),new THREE.Vector3(o,p,n),new THREE.Vector3(t,ha,c)],null,g))}function t(c){var b,e,f,g;b=h(a,c);e=h(a,c+D);f=h(a,c+J);g=
+h(a,c+L);c=l(a,c+N);z.faces.push(new THREE.Face4(b,e,f,g,null,null,z.materials[c]))}function x(c){var b,e,f,g,m,n,o,p;b=h(a,c);e=h(a,c+D);f=h(a,c+J);g=h(a,c+L);m=l(a,c+N);n=h(a,c+K);o=h(a,c+P);p=h(a,c+E);c=h(a,c+S);m=z.materials[m];var t=A[o*3],ha=A[o*3+1];o=A[o*3+2];var la=A[p*3],ma=A[p*3+1];p=A[p*3+2];var v=A[c*3],u=A[c*3+1],c=A[c*3+2];z.faces.push(new THREE.Face4(b,e,f,g,[new THREE.Vector3(A[n*3],A[n*3+1],A[n*3+2]),new THREE.Vector3(t,ha,o),new THREE.Vector3(la,ma,p),new THREE.Vector3(v,u,c)],
+null,m))}function v(c){var b,e,f,g;b=h(a,c);e=h(a,c+O);f=h(a,c+U);c=C[b*2];g=C[b*2+1];b=C[e*2];var l=z.faceVertexUvs[0];e=C[e*2+1];var m=C[f*2];f=C[f*2+1];var n=[];n.push(new THREE.UV(c,g));n.push(new THREE.UV(b,e));n.push(new THREE.UV(m,f));l.push(n)}function u(c){var b,e,f,g,l,m;b=h(a,c);e=h(a,c+W);f=h(a,c+T);g=h(a,c+R);c=C[b*2];l=C[b*2+1];b=C[e*2];m=C[e*2+1];e=C[f*2];var n=z.faceVertexUvs[0];f=C[f*2+1];var o=C[g*2];g=C[g*2+1];var p=[];p.push(new THREE.UV(c,l));p.push(new THREE.UV(b,m));p.push(new THREE.UV(e,
+f));p.push(new THREE.UV(o,g));n.push(p)}var z=this,y=0,w,A=[],C=[],F,G,I,H,M,B,D,J,L,N,K,P,E,S,O,U,W,T,R,Q,Z,X,Y,$,V;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(z,e,c);w={signature:a.substr(y,8),header_bytes:n(a,y+8),vertex_coordinate_bytes:n(a,y+9),normal_coordinate_bytes:n(a,y+10),uv_coordinate_bytes:n(a,y+11),vertex_index_bytes:n(a,y+12),normal_index_bytes:n(a,y+13),uv_index_bytes:n(a,y+14),material_index_bytes:n(a,y+15),nvertices:h(a,y+16),nnormals:h(a,y+16+4),nuvs:h(a,y+16+
+8),ntri_flat:h(a,y+16+12),ntri_smooth:h(a,y+16+16),ntri_flat_uv:h(a,y+16+20),ntri_smooth_uv:h(a,y+16+24),nquad_flat:h(a,y+16+28),nquad_smooth:h(a,y+16+32),nquad_flat_uv:h(a,y+16+36),nquad_smooth_uv:h(a,y+16+40)};y+=w.header_bytes;F=w.vertex_index_bytes;G=w.vertex_index_bytes*2;I=w.vertex_index_bytes*3;H=w.vertex_index_bytes*3+w.material_index_bytes;M=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes;B=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes*2;D=w.vertex_index_bytes;
+J=w.vertex_index_bytes*2;L=w.vertex_index_bytes*3;N=w.vertex_index_bytes*4;K=w.vertex_index_bytes*4+w.material_index_bytes;P=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes;E=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*2;S=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*3;O=w.uv_index_bytes;U=w.uv_index_bytes*2;W=w.uv_index_bytes;T=w.uv_index_bytes*2;R=w.uv_index_bytes*3;c=w.vertex_index_bytes*3+w.material_index_bytes;V=w.vertex_index_bytes*
+4+w.material_index_bytes;Q=w.ntri_flat*c;Z=w.ntri_smooth*(c+w.normal_index_bytes*3);X=w.ntri_flat_uv*(c+w.uv_index_bytes*3);Y=w.ntri_smooth_uv*(c+w.normal_index_bytes*3+w.uv_index_bytes*3);$=w.nquad_flat*V;c=w.nquad_smooth*(V+w.normal_index_bytes*4);V=w.nquad_flat_uv*(V+w.uv_index_bytes*4);y+=function(c){for(var e,g,h,k=w.vertex_coordinate_bytes*3,l=c+w.nvertices*k;c<l;c+=k)e=b(a,c),g=b(a,c+w.vertex_coordinate_bytes),h=b(a,c+w.vertex_coordinate_bytes*2),z.vertices.push(new THREE.Vertex(new THREE.Vector3(e,
+g,h)));return w.nvertices*k}(y);y+=function(c){for(var b,e,f,g=w.normal_coordinate_bytes*3,h=c+w.nnormals*g;c<h;c+=g)b=m(a,c),e=m(a,c+w.normal_coordinate_bytes),f=m(a,c+w.normal_coordinate_bytes*2),A.push(b/127,e/127,f/127);return w.nnormals*g}(y);y+=function(c){for(var e,g,h=w.uv_coordinate_bytes*2,k=c+w.nuvs*h;c<k;c+=h)e=b(a,c),g=b(a,c+w.uv_coordinate_bytes),C.push(e,g);return w.nuvs*h}(y);Q=y+Q;Z=Q+Z;X=Z+X;Y=X+Y;$=Y+$;c=$+c;V=c+V;(function(a){var c,b=w.vertex_index_bytes*3+w.material_index_bytes,
+e=b+w.uv_index_bytes*3,f=a+w.ntri_flat_uv*e;for(c=a;c<f;c+=e)o(c),v(c+b);return f-a})(Z);(function(a){var c,b=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes*3,e=b+w.uv_index_bytes*3,f=a+w.ntri_smooth_uv*e;for(c=a;c<f;c+=e)p(c),v(c+b);return f-a})(X);(function(a){var c,b=w.vertex_index_bytes*4+w.material_index_bytes,e=b+w.uv_index_bytes*4,f=a+w.nquad_flat_uv*e;for(c=a;c<f;c+=e)t(c),u(c+b);return f-a})(c);(function(a){var c,b=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*
+4,e=b+w.uv_index_bytes*4,f=a+w.nquad_smooth_uv*e;for(c=a;c<f;c+=e)x(c),u(c+b);return f-a})(V);(function(a){var c,b=w.vertex_index_bytes*3+w.material_index_bytes,e=a+w.ntri_flat*b;for(c=a;c<e;c+=b)o(c);return e-a})(y);(function(a){var c,b=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes*3,e=a+w.ntri_smooth*b;for(c=a;c<e;c+=b)p(c);return e-a})(Q);(function(a){var c,b=w.vertex_index_bytes*4+w.material_index_bytes,e=a+w.nquad_flat*b;for(c=a;c<e;c+=b)t(c);return e-a})(Y);(function(a){var c,
+b=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*4,e=a+w.nquad_smooth*b;for(c=a;c<e;c+=b)x(c);return e-a})($);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};h.prototype=new THREE.Geometry;h.prototype.constructor=h;b(new h(c))};
+var ColladaLoader=function(){function a(a,c,b){for(var a=Q.evaluate(a,Q,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),e={},f=a.iterateNext(),g=0;f;){f=(new c).parse(f);if(f.id.length==0)f.id=b+g++;e[f.id]=f;f=a.iterateNext()}return e}function b(){var a=1E6,c=-a,b=0,e;for(e in V)for(var f=V[e],g=0;g<f.sampler.length;g++){var h=f.sampler[g];h.create();a=Math.min(a,h.startTime);c=Math.max(c,h.endTime);b=Math.max(b,h.input.length)}return{start:a,end:c,frames:b}}function c(a,b,e,f){a.world=a.world||new THREE.Matrix4;
+a.world.copy(a.matrix);if(a.channels&&a.channels.length){var g=a.channels[0].sampler.output[e];g instanceof THREE.Matrix4&&a.world.copy(g)}f&&a.world.multiply(f,a.world);b.push(a);for(f=0;f<a.nodes.length;f++)c(a.nodes[f],b,e,a.world)}function e(a,e,f){var g=aa[e.url];if(!g||!g.skin)console.log("could not find skin controller!");else if(!e.skeleton||!e.skeleton.length)console.log("could not find the skeleton for the skin!");else{var h=b(),e=X.getChildById(e.skeleton[0],!0)||X.getChildBySid(e.skeleton[0],
+!0),k,l,m,n,o=new THREE.Vector3,p;for(k=0;k<a.vertices.length;k++)g.skin.bindShapeMatrix.multiplyVector3(a.vertices[k].position);for(f=0;f<h.frames;f++){var t=[],v=[];for(k=0;k<a.vertices.length;k++)v.push(new THREE.Vertex(new THREE.Vector3));c(e,t,f);k=t;l=g.skin;for(n=0;n<k.length;n++){m=k[n];p=-1;for(var u=0;u<l.joints.length;u++)if(m.sid==l.joints[u]){p=u;break}if(p>=0){u=l.invBindMatrices[p];m.invBindMatrix=u;m.skinningMatrix=new THREE.Matrix4;m.skinningMatrix.multiply(m.world,u);m.weights=[];
+for(u=0;u<l.weights.length;u++)for(var x=0;x<l.weights[u].length;x++){var w=l.weights[u][x];w.joint==p&&m.weights.push(w)}}else throw"could not find joint!";}for(k=0;k<t.length;k++)for(l=0;l<t[k].weights.length;l++)m=t[k].weights[l],n=m.index,m=m.weight,p=a.vertices[n],n=v[n],o.x=p.position.x,o.y=p.position.y,o.z=p.position.z,t[k].skinningMatrix.multiplyVector3(o),n.position.x+=o.x*m,n.position.y+=o.y*m,n.position.z+=o.z*m;a.morphTargets.push({name:"target_"+f,vertices:v})}}}function h(a){var c=new THREE.Object3D,
+b,f,g;c.name=a.id||"";c.matrixAutoUpdate=!1;c.matrix=a.matrix;for(g=0;g<a.controllers.length;g++){var k=aa[a.controllers[g].url];switch(k.type){case "skin":if(ba[k.skin.source]){var l=new x;l.url=k.skin.source;l.instance_material=a.controllers[g].instance_material;a.geometries.push(l);b=a.controllers[g]}else if(aa[k.skin.source]&&(f=k=aa[k.skin.source],k.morph&&ba[k.morph.source]))l=new x,l.url=k.morph.source,l.instance_material=a.controllers[g].instance_material,a.geometries.push(l);break;case "morph":if(ba[k.morph.source])l=
+new x,l.url=k.morph.source,l.instance_material=a.controllers[g].instance_material,a.geometries.push(l),f=a.controllers[g];console.log("DAE: morph-controller partially supported.")}}for(g=0;g<a.geometries.length;g++){var k=a.geometries[g],l=k.instance_material,k=ba[k.url],m={},n=0,o;if(k&&k.mesh&&k.mesh.primitives){if(c.name.length==0)c.name=k.id;if(l)for(j=0;j<l.length;j++){o=l[j];var t=fa[ea[o.target].instance_effect.url].shader;t.material.opacity=!t.material.opacity?1:t.material.opacity;o=m[o.symbol]=
+t.material;n++}l=o||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});k=k.mesh.geometry3js;if(n>1){l=new THREE.MeshFaceMaterial;for(j=0;j<k.faces.length;j++)n=k.faces[j],n.materials=[m[n.daeMaterial]]}if(b!==void 0)e(k,b),l.morphTargets=!0,l=new THREE.SkinnedMesh(k,l),l.skeleton=b.skeleton,l.skinController=aa[b.url],l.skinInstanceController=b,l.name="skin_"+da.length,da.push(l);else if(f!==void 0){m=k;n=f instanceof p?aa[f.url]:f;if(!n||!n.morph)console.log("could not find morph controller!");
+else{n=n.morph;for(t=0;t<n.targets.length;t++){var u=ba[n.targets[t]];if(u.mesh&&u.mesh.primitives&&u.mesh.primitives.length)u=u.mesh.primitives[0].geometry,u.vertices.length===m.vertices.length&&m.morphTargets.push({name:"target_1",vertices:u.vertices})}m.morphTargets.push({name:"target_Z",vertices:m.vertices})}l.morphTargets=!0;l=new THREE.Mesh(k,l);l.name="morph_"+ca.length;ca.push(l)}else l=new THREE.Mesh(k,l);c.addChild(l)}}for(g=0;g<a.nodes.length;g++)c.addChild(h(a.nodes[g],a));return c}function g(){this.init_from=
 this.id=""}function f(){this.type=this.name=this.id="";this.morph=this.skin=null}function k(){this.weights=this.targets=this.source=this.method=null}function l(){this.source="";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function m(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function n(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=[];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function o(){this.type=
 this.sid="";this.data=[];this.matrix=new THREE.Matrix4}function p(){this.url="";this.skeleton=[];this.instance_material=[]}function t(){this.target=this.symbol=""}function x(){this.url="";this.instance_material=[]}function v(){this.id="";this.mesh=null}function u(a){this.geometry=a.id;this.primitives=[];this.geometry3js=this.vertices=null}function z(){}function y(){this.material="";this.count=0;this.inputs=[];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function w(){this.source="";
-this.stride=this.count=0;this.params=[]}function A(){this.input={}}function C(){this.semantic="";this.offset=0;this.source="";this.set=0}function F(a){this.id=a;this.type=null}function G(){this.name=this.id="";this.instance_effect=null}function I(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texcoord=this.texture=null}function H(a,b){this.type=a;this.effect=b;this.material=null}function M(a){this.effect=a;this.format=this.init_from=
+this.stride=this.count=0;this.params=[]}function A(){this.input={}}function C(){this.semantic="";this.offset=0;this.source="";this.set=0}function F(a){this.id=a;this.type=null}function G(){this.name=this.id="";this.instance_effect=null}function I(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texcoord=this.texture=null}function H(a,c){this.type=a;this.effect=c;this.material=null}function M(a){this.effect=a;this.format=this.init_from=
 null}function B(a){this.effect=a;this.mipfilter=this.magfilter=this.minfilter=this.wrap_t=this.wrap_s=this.source=null}function D(){this.name=this.id="";this.sampler=this.surface=this.shader=null}function J(){this.url=""}function L(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function N(a){this.animation=a;this.target=this.source="";this.member=this.arrIndices=this.arrSyntax=this.dotSyntax=this.sid=null}function K(a){this.id="";this.animation=a;this.inputs=[];this.endTime=
-this.startTime=this.interpolation=this.output=this.input=null;this.duration=0}function P(a){var b=a.getAttribute("id");if(Y[b]!=void 0)return Y[b];Y[b]=(new F(b)).parse(a);return Y[b]}function E(a){if(a=="dae")return"http://www.collada.org/2005/11/COLLADASchema";return null}function S(a){for(var a=U(a).split(/\s+/),b=[],c=0;c<a.length;c++)b.push(parseFloat(a[c]));return b}function O(a){for(var a=U(a).split(/\s+/),b=[],c=0;c<a.length;c++)b.push(parseInt(a[c],10));return b}function U(a){return a.replace(/^\s+/,
-"").replace(/\s+$/,"")}function W(a,b,c){return a.hasAttribute(b)?parseInt(a.getAttribute(b),10):c}function T(a,b){if(a===void 0){for(var c="0.";c.length<b+2;)c+="0";return c}b=b||2;c=a.toString().split(".");for(c[1]=c.length>1?c[1].substr(0,b):"0";c[1].length<b;)c[1]+="0";return c.join(".")}function R(a,b){var c="";c+=T(a.x,b)+",";c+=T(a.y,b)+",";c+=T(a.z,b);return c}var Q=null,Z=null,X,Y={},$={},V={},aa={},ba={},ea={},fa={},ga,ia=null,ja,ca,da,ka=THREE.SmoothShading;h.prototype.parse=function(a){this.id=
-a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.nodeName=="init_from")this.init_from=c.textContent}return this};f.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.type="none";for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "skin":this.skin=(new l).parse(c);this.type=c.nodeName;break;case "morph":this.morph=(new k).parse(c),this.type=c.nodeName}}return this};k.prototype.parse=function(a){var b=
-{},c=[],e;this.method=a.getAttribute("method");this.source=a.getAttribute("source").replace(/^#/,"");for(e=0;e<a.childNodes.length;e++){var f=a.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "source":f=(new F).parse(f);b[f.id]=f;break;case "targets":c=this.parseInputs(f);break;default:console.log(f.nodeName)}}for(e=0;e<c.length;e++)switch(a=c[e],f=b[a.source],a.semantic){case "MORPH_TARGET":this.targets=f.read();break;case "MORPH_WEIGHT":this.weights=f.read()}return this};k.prototype.parseInputs=
-function(a){for(var b=[],c=0;c<a.childNodes.length;c++){var e=a.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "input":b.push((new C).parse(e))}}return b};l.prototype.parse=function(a){var b={},c,e;this.source=a.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var f=0;f<a.childNodes.length;f++){var h=a.childNodes[f];if(h.nodeType==1)switch(h.nodeName){case "bind_shape_matrix":h=S(h.textContent);this.bindShapeMatrix=new THREE.Matrix4;this.bindShapeMatrix.set(h[0],
-h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],h[10],h[11],h[12],h[13],h[14],h[15]);break;case "source":h=(new F).parse(h);b[h.id]=h;break;case "joints":c=h;break;case "vertex_weights":e=h;break;default:console.log(h.nodeName)}}this.parseJoints(c,b);this.parseWeights(e,b);return this};l.prototype.parseJoints=function(a,b){for(var c=0;c<a.childNodes.length;c++){var e=a.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "input":var e=(new C).parse(e),f=b[e.source];if(e.semantic=="JOINT")this.joints=
-f.read();else if(e.semantic=="INV_BIND_MATRIX")this.invBindMatrices=f.read()}}};l.prototype.parseWeights=function(a,b){for(var c,e,f=[],h=0;h<a.childNodes.length;h++){var g=a.childNodes[h];if(g.nodeType==1)switch(g.nodeName){case "input":f.push((new C).parse(g));break;case "v":c=O(g.textContent);break;case "vcount":e=O(g.textContent)}}for(h=g=0;h<e.length;h++){for(var k=e[h],l=[],m=0;m<k;m++){for(var n={},o=0;o<f.length;o++){var p=f[o],t=c[g+p.offset];switch(p.semantic){case "JOINT":n.joint=t;break;
-case "WEIGHT":n.weight=b[p.source].data[t]}}l.push(n);g+=f.length}for(m=0;m<l.length;m++)l[m].index=h;this.weights.push(l)}};m.prototype.getChildById=function(a,b){for(var c=0;c<this.nodes.length;c++){var e=this.nodes[c].getChildById(a,b);if(e)return e}return null};m.prototype.getChildBySid=function(a,b){for(var c=0;c<this.nodes.length;c++){var e=this.nodes[c].getChildBySid(a,b);if(e)return e}return null};m.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");
-this.nodes=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.nodeType==1)switch(c.nodeName){case "node":this.nodes.push((new n).parse(c))}}return this};n.prototype.getChannelForTransform=function(a){for(var b=0;b<this.channels.length;b++){var c=this.channels[b],e=c.target.split("/");e.shift();var f=e.shift(),h=f.indexOf(".")>=0,g=f.indexOf("(")>=0,k;if(h)e=f.split("."),f=e.shift(),e.shift();else if(g){k=f.split("(");f=k.shift();for(e=0;e<k.length;e++)k[e]=parseInt(k[e].replace(/\)/,
-""))}if(f==a)return c.info={sid:f,dotSyntax:h,arrSyntax:g,arrIndices:k},c}return null};n.prototype.getChildById=function(a,b){if(this.id==a)return this;if(b)for(var c=0;c<this.nodes.length;c++){var e=this.nodes[c].getChildById(a,b);if(e)return e}return null};n.prototype.getChildBySid=function(a,b){if(this.sid==a)return this;if(b)for(var c=0;c<this.nodes.length;c++){var e=this.nodes[c].getChildBySid(a,b);if(e)return e}return null};n.prototype.getTransformBySid=function(a){for(var b=0;b<this.transforms.length;b++)if(this.transforms[b].sid==
-a)return this.transforms[b];return null};n.prototype.parse=function(a){var b;this.id=a.getAttribute("id");this.sid=a.getAttribute("sid");this.name=a.getAttribute("name");this.type=a.getAttribute("type");this.type=this.type=="JOINT"?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var c=0;c<a.childNodes.length;c++)if(b=a.childNodes[c],b.nodeType==1)switch(b.nodeName){case "node":this.nodes.push((new n).parse(b));break;case "instance_camera":break;
-case "instance_controller":this.controllers.push((new p).parse(b));break;case "instance_geometry":this.geometries.push((new x).parse(b));break;case "instance_light":break;case "instance_node":b=b.getAttribute("url").replace(/^#/,"");(b=Q.evaluate(".//dae:library_nodes//dae:node[@id='"+b+"']",Q,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new n).parse(b));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new o).parse(b));
-break;case "extra":break;default:console.log(b.nodeName)}a=[];c=1E6;b=-1E6;for(var e in V)for(var f=V[e],h=0;h<f.channel.length;h++){var g=f.channel[h],k=f.sampler[h];e=g.target.split("/")[0];if(e==this.id)k.create(),g.sampler=k,c=Math.min(c,k.startTime),b=Math.max(b,k.endTime),a.push(g)}if(a.length)this.startTime=c,this.endTime=b;if((this.channels=a)&&this.channels.length){e=1E7;for(i=0;i<this.channels.length;i++){a=this.channels[i].sampler;for(c=0;c<a.input.length-1;c++)e=Math.min(e,a.input[c+1]-
-a.input[c])}c=[];for(a=this.startTime;a<this.endTime;a+=e){b=a;for(var f={},l=h=void 0,h=0;h<this.channels.length;h++)l=this.channels[h],f[l.sid]=l;g=new THREE.Matrix4;for(h=0;h<this.transforms.length;h++)if(k=this.transforms[h],l=f[k.sid],l!==void 0){for(var m=l.sampler,t,l=0;l<m.input.length-1;l++)if(m.input[l+1]>b){t=m.output[l];break}g=t!==void 0?t instanceof THREE.Matrix4?g.multiply(g,t):g.multiply(g,k.matrix):g.multiply(g,k.matrix)}else g=g.multiply(g,k.matrix);b=g;c.push({time:a,pos:[b.n14,
-b.n24,b.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=c}this.updateMatrix();return this};n.prototype.updateMatrix=function(){this.matrix.identity();for(var a=0;a<this.transforms.length;a++)this.matrix.multiply(this.matrix,this.transforms[a].matrix)};o.prototype.parse=function(a){this.sid=a.getAttribute("sid");this.type=a.nodeName;this.data=S(a.textContent);this.updateMatrix();return this};o.prototype.updateMatrix=function(){var a=0;this.matrix.identity();switch(this.type){case "matrix":this.matrix.set(this.data[0],
+this.startTime=this.interpolation=this.output=this.input=null;this.duration=0}function P(a){var c=a.getAttribute("id");if(Y[c]!=void 0)return Y[c];Y[c]=(new F(c)).parse(a);return Y[c]}function E(a){if(a=="dae")return"http://www.collada.org/2005/11/COLLADASchema";return null}function S(a){for(var a=U(a).split(/\s+/),c=[],b=0;b<a.length;b++)c.push(parseFloat(a[b]));return c}function O(a){for(var a=U(a).split(/\s+/),c=[],b=0;b<a.length;b++)c.push(parseInt(a[b],10));return c}function U(a){return a.replace(/^\s+/,
+"").replace(/\s+$/,"")}function W(a,c,b){return a.hasAttribute(c)?parseInt(a.getAttribute(c),10):b}function T(a,c){if(a===void 0){for(var b="0.";b.length<c+2;)b+="0";return b}c=c||2;b=a.toString().split(".");for(b[1]=b.length>1?b[1].substr(0,c):"0";b[1].length<c;)b[1]+="0";return b.join(".")}function R(a,c){var b="";b+=T(a.x,c)+",";b+=T(a.y,c)+",";b+=T(a.z,c);return b}var Q=null,Z=null,X,Y={},$={},V={},aa={},ba={},ea={},fa={},ga,ia=null,ja,ca,da,ka=THREE.SmoothShading;g.prototype.parse=function(a){this.id=
+a.getAttribute("id");for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];if(b.nodeName=="init_from")this.init_from=b.textContent}return this};f.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.type="none";for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];switch(b.nodeName){case "skin":this.skin=(new l).parse(b);this.type=b.nodeName;break;case "morph":this.morph=(new k).parse(b),this.type=b.nodeName}}return this};k.prototype.parse=function(a){var c=
+{},b=[],e;this.method=a.getAttribute("method");this.source=a.getAttribute("source").replace(/^#/,"");for(e=0;e<a.childNodes.length;e++){var f=a.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "source":f=(new F).parse(f);c[f.id]=f;break;case "targets":b=this.parseInputs(f);break;default:console.log(f.nodeName)}}for(e=0;e<b.length;e++)switch(a=b[e],f=c[a.source],a.semantic){case "MORPH_TARGET":this.targets=f.read();break;case "MORPH_WEIGHT":this.weights=f.read()}return this};k.prototype.parseInputs=
+function(a){for(var c=[],b=0;b<a.childNodes.length;b++){var e=a.childNodes[b];if(e.nodeType==1)switch(e.nodeName){case "input":c.push((new C).parse(e))}}return c};l.prototype.parse=function(a){var c={},b,e;this.source=a.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var f=0;f<a.childNodes.length;f++){var g=a.childNodes[f];if(g.nodeType==1)switch(g.nodeName){case "bind_shape_matrix":g=S(g.textContent);this.bindShapeMatrix=new THREE.Matrix4;this.bindShapeMatrix.set(g[0],
+g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]);break;case "source":g=(new F).parse(g);c[g.id]=g;break;case "joints":b=g;break;case "vertex_weights":e=g;break;default:console.log(g.nodeName)}}this.parseJoints(b,c);this.parseWeights(e,c);return this};l.prototype.parseJoints=function(a,c){for(var b=0;b<a.childNodes.length;b++){var e=a.childNodes[b];if(e.nodeType==1)switch(e.nodeName){case "input":var e=(new C).parse(e),f=c[e.source];if(e.semantic=="JOINT")this.joints=
+f.read();else if(e.semantic=="INV_BIND_MATRIX")this.invBindMatrices=f.read()}}};l.prototype.parseWeights=function(a,c){for(var b,e,f=[],g=0;g<a.childNodes.length;g++){var h=a.childNodes[g];if(h.nodeType==1)switch(h.nodeName){case "input":f.push((new C).parse(h));break;case "v":b=O(h.textContent);break;case "vcount":e=O(h.textContent)}}for(g=h=0;g<e.length;g++){for(var k=e[g],l=[],m=0;m<k;m++){for(var n={},o=0;o<f.length;o++){var p=f[o],t=b[h+p.offset];switch(p.semantic){case "JOINT":n.joint=t;break;
+case "WEIGHT":n.weight=c[p.source].data[t]}}l.push(n);h+=f.length}for(m=0;m<l.length;m++)l[m].index=g;this.weights.push(l)}};m.prototype.getChildById=function(a,c){for(var b=0;b<this.nodes.length;b++){var e=this.nodes[b].getChildById(a,c);if(e)return e}return null};m.prototype.getChildBySid=function(a,c){for(var b=0;b<this.nodes.length;b++){var e=this.nodes[b].getChildBySid(a,c);if(e)return e}return null};m.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");
+this.nodes=[];for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];if(b.nodeType==1)switch(b.nodeName){case "node":this.nodes.push((new n).parse(b))}}return this};n.prototype.getChannelForTransform=function(a){for(var c=0;c<this.channels.length;c++){var b=this.channels[c],e=b.target.split("/");e.shift();var f=e.shift(),g=f.indexOf(".")>=0,h=f.indexOf("(")>=0,k;if(g)e=f.split("."),f=e.shift(),e.shift();else if(h){k=f.split("(");f=k.shift();for(e=0;e<k.length;e++)k[e]=parseInt(k[e].replace(/\)/,
+""))}if(f==a)return b.info={sid:f,dotSyntax:g,arrSyntax:h,arrIndices:k},b}return null};n.prototype.getChildById=function(a,c){if(this.id==a)return this;if(c)for(var b=0;b<this.nodes.length;b++){var e=this.nodes[b].getChildById(a,c);if(e)return e}return null};n.prototype.getChildBySid=function(a,c){if(this.sid==a)return this;if(c)for(var b=0;b<this.nodes.length;b++){var e=this.nodes[b].getChildBySid(a,c);if(e)return e}return null};n.prototype.getTransformBySid=function(a){for(var c=0;c<this.transforms.length;c++)if(this.transforms[c].sid==
+a)return this.transforms[c];return null};n.prototype.parse=function(a){var c;this.id=a.getAttribute("id");this.sid=a.getAttribute("sid");this.name=a.getAttribute("name");this.type=a.getAttribute("type");this.type=this.type=="JOINT"?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var b=0;b<a.childNodes.length;b++)if(c=a.childNodes[b],c.nodeType==1)switch(c.nodeName){case "node":this.nodes.push((new n).parse(c));break;case "instance_camera":break;
+case "instance_controller":this.controllers.push((new p).parse(c));break;case "instance_geometry":this.geometries.push((new x).parse(c));break;case "instance_light":break;case "instance_node":c=c.getAttribute("url").replace(/^#/,"");(c=Q.evaluate(".//dae:library_nodes//dae:node[@id='"+c+"']",Q,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new n).parse(c));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new o).parse(c));
+break;case "extra":break;default:console.log(c.nodeName)}a=[];b=1E6;c=-1E6;for(var e in V)for(var f=V[e],g=0;g<f.channel.length;g++){var h=f.channel[g],k=f.sampler[g];e=h.target.split("/")[0];if(e==this.id)k.create(),h.sampler=k,b=Math.min(b,k.startTime),c=Math.max(c,k.endTime),a.push(h)}if(a.length)this.startTime=b,this.endTime=c;if((this.channels=a)&&this.channels.length){e=1E7;for(i=0;i<this.channels.length;i++){a=this.channels[i].sampler;for(b=0;b<a.input.length-1;b++)e=Math.min(e,a.input[b+1]-
+a.input[b])}b=[];for(a=this.startTime;a<this.endTime;a+=e){c=a;for(var f={},l=g=void 0,g=0;g<this.channels.length;g++)l=this.channels[g],f[l.sid]=l;h=new THREE.Matrix4;for(g=0;g<this.transforms.length;g++)if(k=this.transforms[g],l=f[k.sid],l!==void 0){for(var m=l.sampler,t,l=0;l<m.input.length-1;l++)if(m.input[l+1]>c){t=m.output[l];break}h=t!==void 0?t instanceof THREE.Matrix4?h.multiply(h,t):h.multiply(h,k.matrix):h.multiply(h,k.matrix)}else h=h.multiply(h,k.matrix);c=h;b.push({time:a,pos:[c.n14,
+c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=b}this.updateMatrix();return this};n.prototype.updateMatrix=function(){this.matrix.identity();for(var a=0;a<this.transforms.length;a++)this.matrix.multiply(this.matrix,this.transforms[a].matrix)};o.prototype.parse=function(a){this.sid=a.getAttribute("sid");this.type=a.nodeName;this.data=S(a.textContent);this.updateMatrix();return this};o.prototype.updateMatrix=function(){var a=0;this.matrix.identity();switch(this.type){case "matrix":this.matrix.set(this.data[0],
 this.data[1],this.data[2],this.data[3],this.data[4],this.data[5],this.data[6],this.data[7],this.data[8],this.data[9],this.data[10],this.data[11],this.data[12],this.data[13],this.data[14],this.data[15]);break;case "translate":this.matrix.setTranslation(this.data[0],this.data[1],this.data[2]);break;case "rotate":a=this.data[3]*(Math.PI/180);this.matrix.setRotationAxis(new THREE.Vector3(this.data[0],this.data[1],this.data[2]),a);break;case "scale":this.matrix.setScale(this.data[0],this.data[1],this.data[2])}return this.matrix};
-p.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.nodeType==1)switch(c.nodeName){case "skeleton":this.skeleton.push(c.textContent.replace(/^#/,""));break;case "bind_material":if(c=Q.evaluate(".//dae:instance_material",c,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(var e=c.iterateNext();e;)this.instance_material.push((new t).parse(e)),e=c.iterateNext()}}return this};
-t.prototype.parse=function(a){this.symbol=a.getAttribute("symbol");this.target=a.getAttribute("target").replace(/^#/,"");return this};x.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.nodeType==1&&c.nodeName=="bind_material"){if(a=Q.evaluate(".//dae:instance_material",c,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(b=a.iterateNext();b;)this.instance_material.push((new t).parse(b)),
-b=a.iterateNext();break}}return this};v.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "mesh":this.mesh=(new u(this)).parse(c)}}return this};u.prototype.parse=function(a){function b(a,c){var e=R(a.position);f[e]===void 0&&(f[e]={v:a,index:c});return f[e]}this.primitives=[];var c;for(c=0;c<a.childNodes.length;c++){var e=a.childNodes[c];switch(e.nodeName){case "source":P(e);break;case "vertices":this.vertices=
-(new A).parse(e);break;case "triangles":this.primitives.push((new y).parse(e));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new z).parse(e))}}var f={};this.geometry3js=new THREE.Geometry;e=Y[this.vertices.input.POSITION.source].data;for(a=c=0;c<e.length;c+=3,a++){var h=new THREE.Vertex(new THREE.Vector3(e[c],e[c+1],e[c+2]));b(h,a);this.geometry3js.vertices.push(h)}for(c=0;c<this.primitives.length;c++)primitive=this.primitives[c],primitive.setVertices(this.vertices),
-this.handlePrimitive(primitive,this.geometry3js,f);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.computeVertexNormals();this.geometry3js.computeBoundingBox();return this};u.prototype.handlePrimitive=function(a,b,c){var e=0,f,h,g=a.p,k=a.inputs,l,m,n,o=0,p=3,t=[];for(f=0;f<k.length;f++)l=k[f],l.semantic=="TEXCOORD"&&t.push(l.set);for(;e<g.length;){var u=[],v=[],x={};a.vcount&&(p=a.vcount[o++]);for(f=0;f<p;f++)for(h=0;h<k.length;h++)switch(l=k[h],source=
-Y[l.source],m=g[e+f*k.length+l.offset],numParams=source.accessor.params.length,n=m*numParams,l.semantic){case "VERTEX":l=R(b.vertices[m].position);u.push(c[l].index);break;case "NORMAL":v.push(new THREE.Vector3(source.data[n+0],source.data[n+1],source.data[n+2]));break;case "TEXCOORD":x[l.set]===void 0&&(x[l.set]=[]),x[l.set].push(new THREE.UV(source.data[n+0],source.data[n+1]))}h=new THREE.Face3(u[0],u[1],u[2],[v[0],v[1],v[2]]);h.daeMaterial=a.material;b.faces.push(h);for(h=0;h<t.length;h++)l=x[t[h]],
-b.faceVertexUvs[h].push([l[0],l[1],l[2]]);if(p>3)for(f=2;f<u.length-1;f++){h=new THREE.Face3(u[0],u[f],u[f+1],[v[0],v[f],v[f+1]]);h.daeMaterial=a.material;b.faces.push(h);for(h=0;h<t.length;h++)l=x[t[h]],b.faceVertexUvs[h].push([l[0],l[f],l[f+1]])}e+=k.length*p}};z.prototype=new y;z.prototype.constructor=z;y.prototype.setVertices=function(a){for(var b=0;b<this.inputs.length;b++)if(this.inputs[b].source==a.id)this.inputs[b].source=a.input.POSITION.source};y.prototype.parse=function(a){this.inputs=
-[];this.material=a.getAttribute("material");this.count=W(a,"count",0);for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "input":this.inputs.push((new C).parse(a.childNodes[b]));break;case "vcount":this.vcount=O(c.textContent);break;case "p":this.p=O(c.textContent)}}return this};w.prototype.parse=function(a){this.params=[];this.source=a.getAttribute("source");this.count=W(a,"count",0);this.stride=W(a,"stride",0);for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];
-if(c.nodeName=="param"){var e={};e.name=c.getAttribute("name");e.type=c.getAttribute("type");this.params.push(e)}}return this};A.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++)a.childNodes[b].nodeName=="input"&&(input=(new C).parse(a.childNodes[b]),this.input[input.semantic]=input);return this};C.prototype.parse=function(a){this.semantic=a.getAttribute("semantic");this.source=a.getAttribute("source").replace(/^#/,"");this.set=W(a,"set",-1);this.offset=
-W(a,"offset",0);if(this.semantic=="TEXCOORD"&&this.set<0)this.set=0;return this};F.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "bool_array":for(var e=U(c.textContent).split(/\s+/),f=[],h=0;h<e.length;h++)f.push(e[h]=="true"||e[h]=="1"?!0:!1);this.data=f;this.type=c.nodeName;break;case "float_array":this.data=S(c.textContent);this.type=c.nodeName;break;case "int_array":this.data=O(c.textContent);this.type=
-c.nodeName;break;case "IDREF_array":case "Name_array":this.data=U(c.textContent).split(/\s+/);this.type=c.nodeName;break;case "technique_common":for(e=0;e<c.childNodes.length;e++)if(c.childNodes[e].nodeName=="accessor"){this.accessor=(new w).parse(c.childNodes[e]);break}}}return this};F.prototype.read=function(){var a=[],b=this.accessor.params[0];switch(b.type){case "IDREF":case "Name":case "float":return this.data;case "float4x4":for(b=0;b<this.data.length;b+=16){var c=this.data.slice(b,b+16),e=
-new THREE.Matrix4;e.set(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]);a.push(e)}break;default:console.log("Dae::Source:read dont know how to read "+b.type)}return a};G.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");for(var b=0;b<a.childNodes.length;b++)if(a.childNodes[b].nodeName=="instance_effect"){this.instance_effect=(new J).parse(a.childNodes[b]);break}return this};I.prototype.isColor=function(){return this.texture==
-null};I.prototype.isTexture=function(){return this.texture!=null};I.prototype.parse=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.nodeType==1)switch(c.nodeName){case "color":c=S(c.textContent);this.color=new THREE.Color(0);this.color.setRGB(c[0],c[1],c[2]);this.color.a=c[3];break;case "texture":this.texture=c.getAttribute("texture"),this.texcoord=c.getAttribute("texcoord")}}return this};H.prototype.parse=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];
-if(c.nodeType==1)switch(c.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[c.nodeName]=(new I).parse(c);break;case "shininess":case "reflectivity":case "transparency":var e;e=Q.evaluate(".//dae:float",c,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var f=e.iterateNext(),h=[];f;)h.push(f),f=e.iterateNext();e=h;e.length>0&&(this[c.nodeName]=parseFloat(e[0].textContent))}}this.create();return this};H.prototype.create=function(){var a={},b=this.transparency!==
-void 0&&this.transparency<1,c;for(c in this)switch(c){case "ambient":case "emission":case "diffuse":case "specular":var e=this[c];if(e instanceof I)if(e.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(e=$[this.effect.surface.init_from]))a.map=THREE.ImageUtils.loadTexture(ja+e.init_from),a.map.wrapS=THREE.RepeatWrapping,a.map.wrapT=THREE.RepeatWrapping,a.map.repeat.x=1,a.map.repeat.y=-1}else c=="diffuse"?a.color=e.color.getHex():b||(a[c]=
-e.color.getHex());break;case "shininess":case "reflectivity":a[c]=this[c];break;case "transparency":if(b)a.transparent=!0,a.opacity=this[c],b=!0}a.shading=ka;return this.material=new THREE.MeshLambertMaterial(a)};M.prototype.parse=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.nodeType==1)switch(c.nodeName){case "init_from":this.init_from=c.textContent;break;case "format":this.format=c.textContent;break;default:console.log("unhandled Surface prop: "+c.nodeName)}}return this};
-B.prototype.parse=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.nodeType==1)switch(c.nodeName){case "source":this.source=c.textContent;break;case "minfilter":this.minfilter=c.textContent;break;case "magfilter":this.magfilter=c.textContent;break;case "mipfilter":this.mipfilter=c.textContent;break;case "wrap_s":this.wrap_s=c.textContent;break;case "wrap_t":this.wrap_t=c.textContent;break;default:console.log("unhandled Sampler2D prop: "+c.nodeName)}}return this};D.prototype.create=
-function(){if(this.shader==null)return null};D.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.shader=null;for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.nodeType==1)switch(c.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(c))}}return this};D.prototype.parseNewparam=function(a){for(var b=a.getAttribute("sid"),c=0;c<a.childNodes.length;c++){var e=a.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "surface":this.surface=
-(new M(this)).parse(e);this.surface.sid=b;break;case "sampler2D":this.sampler=(new B(this)).parse(e);this.sampler.sid=b;break;case "extra":break;default:console.log(e.nodeName)}}};D.prototype.parseProfileCOMMON=function(a){for(var b,c=0;c<a.childNodes.length;c++){var e=a.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "profile_COMMON":this.parseProfileCOMMON(e);break;case "technique":b=e;break;case "newparam":this.parseNewparam(e);break;case "extra":break;default:console.log(e.nodeName)}}return b};
-D.prototype.parseTechnique=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.nodeType==1)switch(c.nodeName){case "lambert":case "blinn":case "phong":this.shader=(new H(c.nodeName,this)).parse(c)}}};J.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");return this};L.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.source={};for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.nodeType==1)switch(c.nodeName){case "source":c=
-(new F).parse(c);this.source[c.id]=c;break;case "sampler":this.sampler.push((new K(this)).parse(c));break;case "channel":this.channel.push((new N(this)).parse(c))}}return this};N.prototype.parse=function(a){this.source=a.getAttribute("source").replace(/^#/,"");this.target=a.getAttribute("target");var b=this.target.split("/");b.shift();var a=b.shift(),c=a.indexOf(".")>=0,e=a.indexOf("(")>=0,f,h;if(c)b=a.split("."),a=b.shift(),h=b.shift();else if(e){f=a.split("(");a=f.shift();for(b=0;b<f.length;b++)f[b]=
-parseInt(f[b].replace(/\)/,""))}this.sid=a;this.dotSyntax=c;this.arrSyntax=e;this.arrIndices=f;this.member=h;return this};K.prototype.parse=function(a){this.id=a.getAttribute("id");this.inputs=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.nodeType==1)switch(c.nodeName){case "input":this.inputs.push((new C).parse(c))}}return this};K.prototype.create=function(){for(var a=0;a<this.inputs.length;a++){var b=this.inputs[a],c=this.animation.source[b.source];switch(b.semantic){case "INPUT":this.input=
-c.read();break;case "OUTPUT":this.output=c.read();break;case "INTERPOLATION":this.interpolation=c.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(b.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(a=0;a<this.input.length;a++)this.startTime=Math.min(this.startTime,this.input[a]),this.endTime=Math.max(this.endTime,this.input[a]);this.duration=this.endTime-this.startTime}};return{load:function(c,e){if(document.implementation&&
-document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);c+="?rnd="+Math.random();var k=new XMLHttpRequest;k.overrideMimeType&&k.overrideMimeType("text/xml");k.onreadystatechange=function(){if(k.readyState==4&&(k.status==0||k.status==200)){ia=e;var l,n=c;Q=k.responseXML;l=ia;n!==void 0&&(n=n.split("/"),n.pop(),ja=n.join("/")+"/");$=a("//dae:library_images/dae:image",h,"image");ea=a("//dae:library_materials/dae:material",
+p.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];if(b.nodeType==1)switch(b.nodeName){case "skeleton":this.skeleton.push(b.textContent.replace(/^#/,""));break;case "bind_material":if(b=Q.evaluate(".//dae:instance_material",b,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(var e=b.iterateNext();e;)this.instance_material.push((new t).parse(e)),e=b.iterateNext()}}return this};
+t.prototype.parse=function(a){this.symbol=a.getAttribute("symbol");this.target=a.getAttribute("target").replace(/^#/,"");return this};x.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];if(b.nodeType==1&&b.nodeName=="bind_material"){if(a=Q.evaluate(".//dae:instance_material",b,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(c=a.iterateNext();c;)this.instance_material.push((new t).parse(c)),
+c=a.iterateNext();break}}return this};v.prototype.parse=function(a){this.id=a.getAttribute("id");for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];switch(b.nodeName){case "mesh":this.mesh=(new u(this)).parse(b)}}return this};u.prototype.parse=function(a){function c(a,b){var e=R(a.position);f[e]===void 0&&(f[e]={v:a,index:b});return f[e]}this.primitives=[];var b;for(b=0;b<a.childNodes.length;b++){var e=a.childNodes[b];switch(e.nodeName){case "source":P(e);break;case "vertices":this.vertices=
+(new A).parse(e);break;case "triangles":this.primitives.push((new y).parse(e));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new z).parse(e))}}var f={};this.geometry3js=new THREE.Geometry;e=Y[this.vertices.input.POSITION.source].data;for(a=b=0;b<e.length;b+=3,a++){var g=new THREE.Vertex(new THREE.Vector3(e[b],e[b+1],e[b+2]));c(g,a);this.geometry3js.vertices.push(g)}for(b=0;b<this.primitives.length;b++)primitive=this.primitives[b],primitive.setVertices(this.vertices),
+this.handlePrimitive(primitive,this.geometry3js,f);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.computeVertexNormals();this.geometry3js.computeBoundingBox();return this};u.prototype.handlePrimitive=function(a,c,b){var e=0,f,g,h=a.p,k=a.inputs,l,m,n,o=0,p=3,t=[];for(f=0;f<k.length;f++)l=k[f],l.semantic=="TEXCOORD"&&t.push(l.set);for(;e<h.length;){var u=[],v=[],x={};a.vcount&&(p=a.vcount[o++]);for(f=0;f<p;f++)for(g=0;g<k.length;g++)switch(l=k[g],source=
+Y[l.source],m=h[e+f*k.length+l.offset],numParams=source.accessor.params.length,n=m*numParams,l.semantic){case "VERTEX":l=R(c.vertices[m].position);u.push(b[l].index);break;case "NORMAL":v.push(new THREE.Vector3(source.data[n+0],source.data[n+1],source.data[n+2]));break;case "TEXCOORD":x[l.set]===void 0&&(x[l.set]=[]),x[l.set].push(new THREE.UV(source.data[n+0],source.data[n+1]))}g=new THREE.Face3(u[0],u[1],u[2],[v[0],v[1],v[2]]);g.daeMaterial=a.material;c.faces.push(g);for(g=0;g<t.length;g++)l=x[t[g]],
+c.faceVertexUvs[g].push([l[0],l[1],l[2]]);if(p>3)for(f=2;f<u.length-1;f++){g=new THREE.Face3(u[0],u[f],u[f+1],[v[0],v[f],v[f+1]]);g.daeMaterial=a.material;c.faces.push(g);for(g=0;g<t.length;g++)l=x[t[g]],c.faceVertexUvs[g].push([l[0],l[f],l[f+1]])}e+=k.length*p}};z.prototype=new y;z.prototype.constructor=z;y.prototype.setVertices=function(a){for(var c=0;c<this.inputs.length;c++)if(this.inputs[c].source==a.id)this.inputs[c].source=a.input.POSITION.source};y.prototype.parse=function(a){this.inputs=
+[];this.material=a.getAttribute("material");this.count=W(a,"count",0);for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];switch(b.nodeName){case "input":this.inputs.push((new C).parse(a.childNodes[c]));break;case "vcount":this.vcount=O(b.textContent);break;case "p":this.p=O(b.textContent)}}return this};w.prototype.parse=function(a){this.params=[];this.source=a.getAttribute("source");this.count=W(a,"count",0);this.stride=W(a,"stride",0);for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];
+if(b.nodeName=="param"){var e={};e.name=b.getAttribute("name");e.type=b.getAttribute("type");this.params.push(e)}}return this};A.prototype.parse=function(a){this.id=a.getAttribute("id");for(var c=0;c<a.childNodes.length;c++)a.childNodes[c].nodeName=="input"&&(input=(new C).parse(a.childNodes[c]),this.input[input.semantic]=input);return this};C.prototype.parse=function(a){this.semantic=a.getAttribute("semantic");this.source=a.getAttribute("source").replace(/^#/,"");this.set=W(a,"set",-1);this.offset=
+W(a,"offset",0);if(this.semantic=="TEXCOORD"&&this.set<0)this.set=0;return this};F.prototype.parse=function(a){this.id=a.getAttribute("id");for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];switch(b.nodeName){case "bool_array":for(var e=U(b.textContent).split(/\s+/),f=[],g=0;g<e.length;g++)f.push(e[g]=="true"||e[g]=="1"?!0:!1);this.data=f;this.type=b.nodeName;break;case "float_array":this.data=S(b.textContent);this.type=b.nodeName;break;case "int_array":this.data=O(b.textContent);this.type=
+b.nodeName;break;case "IDREF_array":case "Name_array":this.data=U(b.textContent).split(/\s+/);this.type=b.nodeName;break;case "technique_common":for(e=0;e<b.childNodes.length;e++)if(b.childNodes[e].nodeName=="accessor"){this.accessor=(new w).parse(b.childNodes[e]);break}}}return this};F.prototype.read=function(){var a=[],c=this.accessor.params[0];switch(c.type){case "IDREF":case "Name":case "float":return this.data;case "float4x4":for(c=0;c<this.data.length;c+=16){var b=this.data.slice(c,c+16),e=
+new THREE.Matrix4;e.set(b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],b[9],b[10],b[11],b[12],b[13],b[14],b[15]);a.push(e)}break;default:console.log("Dae::Source:read dont know how to read "+c.type)}return a};G.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");for(var c=0;c<a.childNodes.length;c++)if(a.childNodes[c].nodeName=="instance_effect"){this.instance_effect=(new J).parse(a.childNodes[c]);break}return this};I.prototype.isColor=function(){return this.texture==
+null};I.prototype.isTexture=function(){return this.texture!=null};I.prototype.parse=function(a){for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];if(b.nodeType==1)switch(b.nodeName){case "color":b=S(b.textContent);this.color=new THREE.Color(0);this.color.setRGB(b[0],b[1],b[2]);this.color.a=b[3];break;case "texture":this.texture=b.getAttribute("texture"),this.texcoord=b.getAttribute("texcoord")}}return this};H.prototype.parse=function(a){for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];
+if(b.nodeType==1)switch(b.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[b.nodeName]=(new I).parse(b);break;case "shininess":case "reflectivity":case "transparency":var e;e=Q.evaluate(".//dae:float",b,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var f=e.iterateNext(),g=[];f;)g.push(f),f=e.iterateNext();e=g;e.length>0&&(this[b.nodeName]=parseFloat(e[0].textContent))}}this.create();return this};H.prototype.create=function(){var a={},c=this.transparency!==
+void 0&&this.transparency<1,b;for(b in this)switch(b){case "ambient":case "emission":case "diffuse":case "specular":var e=this[b];if(e instanceof I)if(e.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(e=$[this.effect.surface.init_from]))a.map=THREE.ImageUtils.loadTexture(ja+e.init_from),a.map.wrapS=THREE.RepeatWrapping,a.map.wrapT=THREE.RepeatWrapping,a.map.repeat.x=1,a.map.repeat.y=-1}else b=="diffuse"?a.color=e.color.getHex():c||(a[b]=
+e.color.getHex());break;case "shininess":case "reflectivity":a[b]=this[b];break;case "transparency":if(c)a.transparent=!0,a.opacity=this[b],c=!0}a.shading=ka;return this.material=new THREE.MeshLambertMaterial(a)};M.prototype.parse=function(a){for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];if(b.nodeType==1)switch(b.nodeName){case "init_from":this.init_from=b.textContent;break;case "format":this.format=b.textContent;break;default:console.log("unhandled Surface prop: "+b.nodeName)}}return this};
+B.prototype.parse=function(a){for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];if(b.nodeType==1)switch(b.nodeName){case "source":this.source=b.textContent;break;case "minfilter":this.minfilter=b.textContent;break;case "magfilter":this.magfilter=b.textContent;break;case "mipfilter":this.mipfilter=b.textContent;break;case "wrap_s":this.wrap_s=b.textContent;break;case "wrap_t":this.wrap_t=b.textContent;break;default:console.log("unhandled Sampler2D prop: "+b.nodeName)}}return this};D.prototype.create=
+function(){if(this.shader==null)return null};D.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.shader=null;for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];if(b.nodeType==1)switch(b.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(b))}}return this};D.prototype.parseNewparam=function(a){for(var c=a.getAttribute("sid"),b=0;b<a.childNodes.length;b++){var e=a.childNodes[b];if(e.nodeType==1)switch(e.nodeName){case "surface":this.surface=
+(new M(this)).parse(e);this.surface.sid=c;break;case "sampler2D":this.sampler=(new B(this)).parse(e);this.sampler.sid=c;break;case "extra":break;default:console.log(e.nodeName)}}};D.prototype.parseProfileCOMMON=function(a){for(var c,b=0;b<a.childNodes.length;b++){var e=a.childNodes[b];if(e.nodeType==1)switch(e.nodeName){case "profile_COMMON":this.parseProfileCOMMON(e);break;case "technique":c=e;break;case "newparam":this.parseNewparam(e);break;case "extra":break;default:console.log(e.nodeName)}}return c};
+D.prototype.parseTechnique=function(a){for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];if(b.nodeType==1)switch(b.nodeName){case "lambert":case "blinn":case "phong":this.shader=(new H(b.nodeName,this)).parse(b)}}};J.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");return this};L.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.source={};for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];if(b.nodeType==1)switch(b.nodeName){case "source":b=
+(new F).parse(b);this.source[b.id]=b;break;case "sampler":this.sampler.push((new K(this)).parse(b));break;case "channel":this.channel.push((new N(this)).parse(b))}}return this};N.prototype.parse=function(a){this.source=a.getAttribute("source").replace(/^#/,"");this.target=a.getAttribute("target");var c=this.target.split("/");c.shift();var a=c.shift(),b=a.indexOf(".")>=0,e=a.indexOf("(")>=0,f,g;if(b)c=a.split("."),a=c.shift(),g=c.shift();else if(e){f=a.split("(");a=f.shift();for(c=0;c<f.length;c++)f[c]=
+parseInt(f[c].replace(/\)/,""))}this.sid=a;this.dotSyntax=b;this.arrSyntax=e;this.arrIndices=f;this.member=g;return this};K.prototype.parse=function(a){this.id=a.getAttribute("id");this.inputs=[];for(var c=0;c<a.childNodes.length;c++){var b=a.childNodes[c];if(b.nodeType==1)switch(b.nodeName){case "input":this.inputs.push((new C).parse(b))}}return this};K.prototype.create=function(){for(var a=0;a<this.inputs.length;a++){var c=this.inputs[a],b=this.animation.source[c.source];switch(c.semantic){case "INPUT":this.input=
+b.read();break;case "OUTPUT":this.output=b.read();break;case "INTERPOLATION":this.interpolation=b.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(c.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(a=0;a<this.input.length;a++)this.startTime=Math.min(this.startTime,this.input[a]),this.endTime=Math.max(this.endTime,this.input[a]);this.duration=this.endTime-this.startTime}};return{load:function(c,e){if(document.implementation&&
+document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);c+="?rnd="+Math.random();var k=new XMLHttpRequest;k.overrideMimeType&&k.overrideMimeType("text/xml");k.onreadystatechange=function(){if(k.readyState==4&&(k.status==0||k.status==200)){ia=e;var l,n=c;Q=k.responseXML;l=ia;n!==void 0&&(n=n.split("/"),n.pop(),ja=n.join("/")+"/");$=a("//dae:library_images/dae:image",g,"image");ea=a("//dae:library_materials/dae:material",
 G,"material");fa=a("//dae:library_effects/dae:effect",D,"effect");ba=a("//dae:library_geometries/dae:geometry",v,"geometry");aa=a("//dae:library_controllers/dae:controller",f,"controller");V=a("//dae:library_animations/dae:animation",L,"animation");ga=a(".//dae:library_visual_scenes/dae:visual_scene",m,"visual_scene");ca=[];da=[];(n=Q.evaluate(".//dae:scene/dae:instance_visual_scene",Q,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(n=n.getAttribute("url").replace(/^#/,""),X=ga[n]):
-X=null;Z=new THREE.Object3D;for(n=0;n<X.nodes.length;n++)Z.addChild(g(X.nodes[n]));b();for(var o in V);o={scene:Z,morphs:ca,skins:da,dae:{images:$,materials:ea,effects:fa,geometries:ba,controllers:aa,animations:V,visualScenes:ga,scene:X}};l&&l(o)}};k.open("GET",c,!0);k.send(null)}else alert("Don't know how to parse XML!")},setPreferredShading:function(a){ka=a},applySkin:e,geometries:ba}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;
-THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(a){var b=this,c=a.model,e=a.callback,g=a.texture_path?a.texture_path:this.extractUrlbase(c),a=new Worker(c);a.onmessage=function(a){b.createModel(a.data,e,g);b.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
-THREE.JSONLoader.prototype.createModel=function(a,b,c){var e=new THREE.Geometry,g=a.scale!==void 0?1/a.scale:1;this.init_materials(e,a.materials,c);(function(b){if(a.version===void 0||a.version!=2)console.error("Deprecated file format.");else{var c,g,l,m,n,o,p,t,x,v,u,z,y,w,A=a.faces;o=a.vertices;var C=a.normals,F=a.colors,G=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&G++;for(c=0;c<G;c++)e.faceUvs[c]=[],e.faceVertexUvs[c]=[];m=0;for(n=o.length;m<n;)p=new THREE.Vertex,p.position.x=o[m++]*b,p.position.y=
-o[m++]*b,p.position.z=o[m++]*b,e.vertices.push(p);m=0;for(n=A.length;m<n;){b=A[m++];o=b&1;l=b&2;c=b&4;g=b&8;t=b&16;p=b&32;v=b&64;b&=128;o?(u=new THREE.Face4,u.a=A[m++],u.b=A[m++],u.c=A[m++],u.d=A[m++],o=4):(u=new THREE.Face3,u.a=A[m++],u.b=A[m++],u.c=A[m++],o=3);if(l)l=A[m++],u.materials=e.materials[l];l=e.faces.length;if(c)for(c=0;c<G;c++)z=a.uvs[c],x=A[m++],w=z[x*2],x=z[x*2+1],e.faceUvs[c][l]=new THREE.UV(w,x);if(g)for(c=0;c<G;c++){z=a.uvs[c];y=[];for(g=0;g<o;g++)x=A[m++],w=z[x*2],x=z[x*2+1],y[g]=
-new THREE.UV(w,x);e.faceVertexUvs[c][l]=y}if(t)t=A[m++]*3,g=new THREE.Vector3,g.x=C[t++],g.y=C[t++],g.z=C[t],u.normal=g;if(p)for(c=0;c<o;c++)t=A[m++]*3,g=new THREE.Vector3,g.x=C[t++],g.y=C[t++],g.z=C[t],u.vertexNormals.push(g);if(v)p=A[m++],p=new THREE.Color(F[p]),u.color=p;if(b)for(c=0;c<o;c++)p=A[m++],p=new THREE.Color(F[p]),u.vertexColors.push(p);e.faces.push(u)}}})(g);(function(){var b,c,g,l;if(a.skinWeights){b=0;for(c=a.skinWeights.length;b<c;b+=2)g=a.skinWeights[b],l=a.skinWeights[b+1],e.skinWeights.push(new THREE.Vector4(g,
-l,0,0))}if(a.skinIndices){b=0;for(c=a.skinIndices.length;b<c;b+=2)g=a.skinIndices[b],l=a.skinIndices[b+1],e.skinIndices.push(new THREE.Vector4(g,l,0,0))}e.bones=a.bones;e.animation=a.animation})();(function(b){if(a.morphTargets!==void 0){var c,g,l,m,n,o,p,t,x;c=0;for(g=a.morphTargets.length;c<g;c++){e.morphTargets[c]={};e.morphTargets[c].name=a.morphTargets[c].name;e.morphTargets[c].vertices=[];t=e.morphTargets[c].vertices;x=a.morphTargets[c].vertices;l=0;for(m=x.length;l<m;l+=3)n=x[l]*b,o=x[l+1]*
-b,p=x[l+2]*b,t.push(new THREE.Vertex(new THREE.Vector3(n,o,p)))}}if(a.morphColors!==void 0){c=0;for(g=a.morphColors.length;c<g;c++){e.morphColors[c]={};e.morphColors[c].name=a.morphColors[c].name;e.morphColors[c].colors=[];m=e.morphColors[c].colors;n=a.morphColors[c].colors;b=0;for(l=n.length;b<l;b+=3)o=new THREE.Color(16755200),o.setRGB(n[b],n[b+1],n[b+2]),m.push(o)}}})(g);(function(){if(a.edges!==void 0){var b,c,g;for(b=0;b<a.edges.length;b+=2)c=a.edges[b],g=a.edges[b+1],e.edges.push(new THREE.Edge(e.vertices[c],
-e.vertices[g],c,g))}})();e.computeCentroids();e.computeFaceNormals();this.hasNormals(e)&&e.computeTangents();b(e)};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
-THREE.SceneLoader.prototype={load:function(a,b){var c=this,e=new Worker(a);e.postMessage(0);var g=THREE.Loader.prototype.extractUrlbase(a);e.onmessage=function(a){function e(a,b){return b=="relativeToHTML"?a:g+"/"+a}function k(){for(t in D.objects)if(!E.objects[t])if(y=D.objects[t],y.geometry!==void 0){if(F=E.geometries[y.geometry]){var a=!1;M=[];for(O=0;O<y.materials.length;O++)M[O]=E.materials[y.materials[O]],a=M[O]instanceof THREE.MeshShaderMaterial;a&&F.computeTangents();w=y.position;r=y.rotation;
+X=null;Z=new THREE.Object3D;for(n=0;n<X.nodes.length;n++)Z.addChild(h(X.nodes[n]));b();for(var o in V);o={scene:Z,morphs:ca,skins:da,dae:{images:$,materials:ea,effects:fa,geometries:ba,controllers:aa,animations:V,visualScenes:ga,scene:X}};l&&l(o)}};k.open("GET",c,!0);k.send(null)}else alert("Don't know how to parse XML!")},setPreferredShading:function(a){ka=a},applySkin:e,geometries:ba}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;
+THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(a){var b=this,c=a.model,e=a.callback,h=a.texture_path?a.texture_path:this.extractUrlbase(c),a=new Worker(c);a.onmessage=function(a){b.createModel(a.data,e,h);b.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
+THREE.JSONLoader.prototype.createModel=function(a,b,c){var e=new THREE.Geometry,h=a.scale!==void 0?1/a.scale:1;this.init_materials(e,a.materials,c);(function(c){if(a.version===void 0||a.version!=2)console.error("Deprecated file format.");else{var b,h,l,m,n,o,p,t,x,v,u,z,y,w,A=a.faces;o=a.vertices;var C=a.normals,F=a.colors,G=0;for(b=0;b<a.uvs.length;b++)a.uvs[b].length&&G++;for(b=0;b<G;b++)e.faceUvs[b]=[],e.faceVertexUvs[b]=[];m=0;for(n=o.length;m<n;)p=new THREE.Vertex,p.position.x=o[m++]*c,p.position.y=
+o[m++]*c,p.position.z=o[m++]*c,e.vertices.push(p);m=0;for(n=A.length;m<n;){c=A[m++];o=c&1;l=c&2;b=c&4;h=c&8;t=c&16;p=c&32;v=c&64;c&=128;o?(u=new THREE.Face4,u.a=A[m++],u.b=A[m++],u.c=A[m++],u.d=A[m++],o=4):(u=new THREE.Face3,u.a=A[m++],u.b=A[m++],u.c=A[m++],o=3);if(l)l=A[m++],u.materials=e.materials[l];l=e.faces.length;if(b)for(b=0;b<G;b++)z=a.uvs[b],x=A[m++],w=z[x*2],x=z[x*2+1],e.faceUvs[b][l]=new THREE.UV(w,x);if(h)for(b=0;b<G;b++){z=a.uvs[b];y=[];for(h=0;h<o;h++)x=A[m++],w=z[x*2],x=z[x*2+1],y[h]=
+new THREE.UV(w,x);e.faceVertexUvs[b][l]=y}if(t)t=A[m++]*3,h=new THREE.Vector3,h.x=C[t++],h.y=C[t++],h.z=C[t],u.normal=h;if(p)for(b=0;b<o;b++)t=A[m++]*3,h=new THREE.Vector3,h.x=C[t++],h.y=C[t++],h.z=C[t],u.vertexNormals.push(h);if(v)p=A[m++],p=new THREE.Color(F[p]),u.color=p;if(c)for(b=0;b<o;b++)p=A[m++],p=new THREE.Color(F[p]),u.vertexColors.push(p);e.faces.push(u)}}})(h);(function(){var c,b,h,l;if(a.skinWeights){c=0;for(b=a.skinWeights.length;c<b;c+=2)h=a.skinWeights[c],l=a.skinWeights[c+1],e.skinWeights.push(new THREE.Vector4(h,
+l,0,0))}if(a.skinIndices){c=0;for(b=a.skinIndices.length;c<b;c+=2)h=a.skinIndices[c],l=a.skinIndices[c+1],e.skinIndices.push(new THREE.Vector4(h,l,0,0))}e.bones=a.bones;e.animation=a.animation})();(function(c){if(a.morphTargets!==void 0){var b,h,l,m,n,o,p,t,x;b=0;for(h=a.morphTargets.length;b<h;b++){e.morphTargets[b]={};e.morphTargets[b].name=a.morphTargets[b].name;e.morphTargets[b].vertices=[];t=e.morphTargets[b].vertices;x=a.morphTargets[b].vertices;l=0;for(m=x.length;l<m;l+=3)n=x[l]*c,o=x[l+1]*
+c,p=x[l+2]*c,t.push(new THREE.Vertex(new THREE.Vector3(n,o,p)))}}if(a.morphColors!==void 0){b=0;for(h=a.morphColors.length;b<h;b++){e.morphColors[b]={};e.morphColors[b].name=a.morphColors[b].name;e.morphColors[b].colors=[];m=e.morphColors[b].colors;n=a.morphColors[b].colors;c=0;for(l=n.length;c<l;c+=3)o=new THREE.Color(16755200),o.setRGB(n[c],n[c+1],n[c+2]),m.push(o)}}})(h);(function(){if(a.edges!==void 0){var c,b,h;for(c=0;c<a.edges.length;c+=2)b=a.edges[c],h=a.edges[c+1],e.edges.push(new THREE.Edge(e.vertices[b],
+e.vertices[h],b,h))}})();e.computeCentroids();e.computeFaceNormals();this.hasNormals(e)&&e.computeTangents();b(e)};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
+THREE.SceneLoader.prototype={load:function(a,b){var c=this,e=new Worker(a);e.postMessage(0);var h=THREE.Loader.prototype.extractUrlbase(a);e.onmessage=function(a){function e(a,c){return c=="relativeToHTML"?a:h+"/"+a}function k(){for(t in D.objects)if(!E.objects[t])if(y=D.objects[t],y.geometry!==void 0){if(F=E.geometries[y.geometry]){var a=!1;M=[];for(O=0;O<y.materials.length;O++)M[O]=E.materials[y.materials[O]],a=M[O]instanceof THREE.MeshShaderMaterial;a&&F.computeTangents();w=y.position;r=y.rotation;
 q=y.quaternion;s=y.scale;q=0;M.length==0&&(M[0]=new THREE.MeshFaceMaterial);M.length>1&&(M=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(F,M);object.name=t;object.position.set(w[0],w[1],w[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=y.visible;E.scene.addObject(object);E.objects[t]=object;y.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),E.scene.collisions.colliders.push(a));
 if(y.castsShadow)a=new THREE.ShadowVolume(F),E.scene.addChild(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;y.trigger&&y.trigger.toLowerCase()!="none"&&(a={type:y.trigger,object:y},E.triggers[object.name]=a)}}else w=y.position,r=y.rotation,q=y.quaternion,s=y.scale,q=0,object=new THREE.Object3D,object.name=t,object.position.set(w[0],w[1],w[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=y.visible!==void 0?y.visible:!1,E.scene.addObject(object),E.objects[t]=object,E.empties[t]=object,y.trigger&&y.trigger.toLowerCase()!="none"&&(a={type:y.trigger,object:y},E.triggers[object.name]=a)}function l(a){return function(b){E.geometries[a]=b;k();L-=1;c.onLoadComplete();n()}}function m(a){return function(b){E.geometries[a]=b}}function n(){c.callbackProgress({totalModels:K,totalTextures:P,loadedModels:K-L,loadedTextures:P-N},E);c.onLoadProgress();L==0&&N==0&&b(E)}var o,
+s[1],s[2]),object.visible=y.visible!==void 0?y.visible:!1,E.scene.addObject(object),E.objects[t]=object,E.empties[t]=object,y.trigger&&y.trigger.toLowerCase()!="none"&&(a={type:y.trigger,object:y},E.triggers[object.name]=a)}function l(a){return function(b){E.geometries[a]=b;k();L-=1;c.onLoadComplete();n()}}function m(a){return function(c){E.geometries[a]=c}}function n(){c.callbackProgress({totalModels:K,totalTextures:P,loadedModels:K-L,loadedTextures:P-N},E);c.onLoadProgress();L==0&&N==0&&b(E)}var o,
 p,t,x,v,u,z,y,w,A,C,F,G,I,H,M,B,D,J,L,N,K,P,E;D=a.data;H=new THREE.BinaryLoader;J=new THREE.JSONLoader;N=L=0;E={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(t in D.objects)if(y=D.objects[t],y.meshCollider){a=!0;break}if(a)E.scene.collisions=new THREE.CollisionSystem;if(D.transform){a=D.transform.position;A=D.transform.rotation;var S=D.transform.scale;a&&E.scene.position.set(a[0],a[1],a[2]);A&&E.scene.rotation.set(A[0],
 A[1],A[2]);S&&E.scene.scale.set(S[0],S[1],S[2]);(a||A||S)&&E.scene.updateMatrix()}a=function(){N-=1;n();c.onLoadComplete()};for(v in D.cameras){A=D.cameras[v];if(A.type=="perspective")G=new THREE.Camera(A.fov,A.aspect,A.near,A.far);else if(A.type=="ortho")G=new THREE.Camera,G.projectionMatrix=THREE.Matrix4.makeOrtho(A.left,A.right,A.top,A.bottom,A.near,A.far);w=A.position;A=A.target;G.position.set(w[0],w[1],w[2]);G.target.position.set(A[0],A[1],A[2]);E.cameras[v]=G}for(x in D.lights)v=D.lights[x],
 G=v.color!==void 0?v.color:16777215,A=v.intensity!==void 0?v.intensity:1,v.type=="directional"?(w=v.direction,B=new THREE.DirectionalLight(G,A),B.position.set(w[0],w[1],w[2]),B.position.normalize()):v.type=="point"?(w=v.position,d=v.distance,B=new THREE.PointLight(G,A,d),B.position.set(w[0],w[1],w[2])):v.type=="ambient"&&(B=new THREE.AmbientLight(G)),E.scene.addLight(B),E.lights[x]=B;for(u in D.fogs)x=D.fogs[u],x.type=="linear"?I=new THREE.Fog(0,x.near,x.far):x.type=="exp2"&&(I=new THREE.FogExp2(0,
 x.density)),A=x.color,I.color.setRGB(A[0],A[1],A[2]),E.fogs[u]=I;if(E.cameras&&D.defaults.camera)E.currentCamera=E.cameras[D.defaults.camera];if(E.fogs&&D.defaults.fog)E.scene.fog=E.fogs[D.defaults.fog];A=D.defaults.bgcolor;E.bgColor=new THREE.Color;E.bgColor.setRGB(A[0],A[1],A[2]);E.bgColorAlpha=D.defaults.bgalpha;for(o in D.geometries)if(u=D.geometries[o],u.type=="bin_mesh"||u.type=="ascii_mesh")L+=1,c.onLoadStart();K=L;for(o in D.geometries)u=D.geometries[o],u.type=="cube"?(F=new THREE.CubeGeometry(u.width,
-u.height,u.depth,u.segmentsWidth,u.segmentsHeight,u.segmentsDepth,null,u.flipped,u.sides),E.geometries[o]=F):u.type=="plane"?(F=new THREE.PlaneGeometry(u.width,u.height,u.segmentsWidth,u.segmentsHeight),E.geometries[o]=F):u.type=="sphere"?(F=new THREE.SphereGeometry(u.radius,u.segmentsWidth,u.segmentsHeight),E.geometries[o]=F):u.type=="cylinder"?(F=new THREE.CylinderGeometry(u.numSegs,u.topRad,u.botRad,u.height,u.topOffset,u.botOffset),E.geometries[o]=F):u.type=="torus"?(F=new THREE.TorusGeometry(u.radius,
-u.tube,u.segmentsR,u.segmentsT),E.geometries[o]=F):u.type=="icosahedron"?(F=new THREE.IcosahedronGeometry(u.subdivisions),E.geometries[o]=F):u.type=="bin_mesh"?H.load({model:e(u.url,D.urlBaseType),callback:l(o)}):u.type=="ascii_mesh"?J.load({model:e(u.url,D.urlBaseType),callback:l(o)}):u.type=="embedded_mesh"&&(u=D.embeds[u.id])&&J.createModel(u,m(o),"");for(z in D.textures)if(o=D.textures[z],o.url instanceof Array){N+=o.url.length;for(H=0;H<o.url.length;H++)c.onLoadStart()}else N+=1,c.onLoadStart();
-P=N;for(z in D.textures){o=D.textures[z];if(o.mapping!=void 0&&THREE[o.mapping]!=void 0)o.mapping=new THREE[o.mapping];if(o.url instanceof Array){H=[];for(var O=0;O<o.url.length;O++)H[O]=e(o.url[O],D.urlBaseType);H=THREE.ImageUtils.loadTextureCube(H,o.mapping,a)}else{H=THREE.ImageUtils.loadTexture(e(o.url,D.urlBaseType),o.mapping,a);if(THREE[o.minFilter]!=void 0)H.minFilter=THREE[o.minFilter];if(THREE[o.magFilter]!=void 0)H.magFilter=THREE[o.magFilter];if(o.repeat){H.repeat.set(o.repeat[0],o.repeat[1]);
+u.height,u.depth,u.segmentsWidth,u.segmentsHeight,u.segmentsDepth,null,u.flipped,u.sides),E.geometries[o]=F):u.type=="plane"?(F=new THREE.PlaneGeometry(u.width,u.height,u.segmentsWidth,u.segmentsHeight),E.geometries[o]=F):u.type=="sphere"?(F=new THREE.SphereGeometry(u.radius,u.segmentsWidth,u.segmentsHeight),E.geometries[o]=F):u.type=="cylinder"?(F=new THREE.CylinderGeometry(u.topRad,u.botRad,u.height,u.radSegs,u.heightSegs),E.geometries[o]=F):u.type=="torus"?(F=new THREE.TorusGeometry(u.radius,u.tube,
+u.segmentsR,u.segmentsT),E.geometries[o]=F):u.type=="icosahedron"?(F=new THREE.IcosahedronGeometry(u.subdivisions),E.geometries[o]=F):u.type=="bin_mesh"?H.load({model:e(u.url,D.urlBaseType),callback:l(o)}):u.type=="ascii_mesh"?J.load({model:e(u.url,D.urlBaseType),callback:l(o)}):u.type=="embedded_mesh"&&(u=D.embeds[u.id])&&J.createModel(u,m(o),"");for(z in D.textures)if(o=D.textures[z],o.url instanceof Array){N+=o.url.length;for(H=0;H<o.url.length;H++)c.onLoadStart()}else N+=1,c.onLoadStart();P=N;
+for(z in D.textures){o=D.textures[z];if(o.mapping!=void 0&&THREE[o.mapping]!=void 0)o.mapping=new THREE[o.mapping];if(o.url instanceof Array){H=[];for(var O=0;O<o.url.length;O++)H[O]=e(o.url[O],D.urlBaseType);H=THREE.ImageUtils.loadTextureCube(H,o.mapping,a)}else{H=THREE.ImageUtils.loadTexture(e(o.url,D.urlBaseType),o.mapping,a);if(THREE[o.minFilter]!=void 0)H.minFilter=THREE[o.minFilter];if(THREE[o.magFilter]!=void 0)H.magFilter=THREE[o.magFilter];if(o.repeat){H.repeat.set(o.repeat[0],o.repeat[1]);
 if(o.repeat[0]!=1)H.wrapS=THREE.RepeatWrapping;if(o.repeat[1]!=1)H.wrapT=THREE.RepeatWrapping}o.offset&&H.offset.set(o.offset[0],o.offset[1]);if(o.wrap){J={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(J[o.wrap[0]]!==void 0)H.wrapS=J[o.wrap[0]];if(J[o.wrap[1]]!==void 0)H.wrapT=J[o.wrap[1]]}}E.textures[z]=H}for(p in D.materials){z=D.materials[p];for(C in z.parameters)if(C=="envMap"||C=="map"||C=="lightMap")z.parameters[C]=E.textures[z.parameters[C]];else if(C=="shading")z.parameters[C]=
 z.parameters[C]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(C=="blending")z.parameters[C]=THREE[z.parameters[C]]?THREE[z.parameters[C]]:THREE.NormalBlending;else if(C=="combine")z.parameters[C]=z.parameters[C]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(C=="vertexColors")if(z.parameters[C]=="face")z.parameters[C]=THREE.FaceColors;else if(z.parameters[C])z.parameters[C]=THREE.VertexColors;if(z.parameters.opacity!==void 0&&z.parameters.opacity<1)z.parameters.transparent=
 !0;if(z.parameters.normalMap){o=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(o.uniforms);H=z.parameters.color;J=z.parameters.specular;u=z.parameters.ambient;I=z.parameters.shininess;a.tNormal.texture=E.textures[z.parameters.normalMap];if(z.parameters.normalMapFactor)a.uNormalScale.value=z.parameters.normalMapFactor;if(z.parameters.map)a.tDiffuse.texture=z.parameters.map,a.enableDiffuse.value=!0;if(z.parameters.lightMap)a.tAO.texture=z.parameters.lightMap,a.enableAO.value=!0;if(z.parameters.specularMap)a.tSpecular.texture=
 E.textures[z.parameters.specularMap],a.enableSpecular.value=!0;a.uDiffuseColor.value.setHex(H);a.uSpecularColor.value.setHex(J);a.uAmbientColor.value.setHex(u);a.uShininess.value=I;if(z.parameters.opacity)a.uOpacity.value=z.parameters.opacity;z=new THREE.MeshShaderMaterial({fragmentShader:o.fragmentShader,vertexShader:o.vertexShader,uniforms:a,lights:!0,fog:!0})}else z=new THREE[z.type](z.parameters);E.materials[p]=z}k();c.callbackSync(E)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};
 THREE.UTF8Loader.prototype=new THREE.UTF8Loader;THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
-THREE.UTF8Loader.prototype.load=function(a){var b=new XMLHttpRequest,c=a.model,e=a.callback,g=a.scale!==void 0?a.scale:1,h=a.offsetX!==void 0?a.offsetX:0,f=a.offsetY!==void 0?a.offsetY:0,k=a.offsetZ!==void 0?a.offsetZ:0;b.onreadystatechange=function(){b.readyState==4?b.status==200||b.status==0?THREE.UTF8Loader.prototype.createModel(b.responseText,e,g,h,f,k):alert("Couldn't load ["+c+"] ["+b.status+"]"):b.readyState!=3&&b.readyState==2&&b.getResponseHeader("Content-Length")};b.open("GET",c,!0);b.send(null)};
-THREE.UTF8Loader.prototype.decompressMesh=function(a){var b=a.charCodeAt(0);b>=57344&&(b-=2048);b++;for(var c=new Float32Array(8*b),e=1,g=0;g<8;g++){for(var h=0,f=0;f<b;++f){var k=a.charCodeAt(f+e);h+=k>>1^-(k&1);c[8*f+g]=h}e+=b}b=a.length-e;h=new Uint16Array(b);for(g=f=0;g<b;g++)k=a.charCodeAt(g+e),h[g]=f-k,k==0&&f++;return[c,h]};
-THREE.UTF8Loader.prototype.createModel=function(a,b,c,e,g,h){var f=function(){var b=this;b.materials=[];THREE.Geometry.call(this);var f=THREE.UTF8Loader.prototype.decompressMesh(a),m=[],n=[];(function(a,f,l){for(var m,n,u,z=a.length;l<z;l+=f)m=a[l],n=a[l+1],u=a[l+2],m=m/16383*c,n=n/16383*c,u=u/16383*c,m+=e,n+=g,u+=h,b.vertices.push(new THREE.Vertex(new THREE.Vector3(m,n,u)))})(f[0],8,0);(function(a,b,c){for(var e,f,g=a.length;c<g;c+=b)e=a[c],f=a[c+1],e/=1023,f/=1023,n.push(e,f)})(f[0],8,3);(function(a,
-b,c){for(var e,f,g,h=a.length;c<h;c+=b)e=a[c],f=a[c+1],g=a[c+2],e=(e-512)/511,f=(f-512)/511,g=(g-512)/511,m.push(e,f,g)})(f[0],8,5);(function(a){var c,e,f,g,h,l,y,w,A,C=a.length;for(c=0;c<C;c+=3){e=a[c];f=a[c+1];g=a[c+2];h=b;w=e;A=f;l=g;y=e;var F=f,G=g,I=h.materials[0],H=m[F*3],M=m[F*3+1],F=m[F*3+2],B=m[G*3],D=m[G*3+1],G=m[G*3+2];y=new THREE.Vector3(m[y*3],m[y*3+1],m[y*3+2]);F=new THREE.Vector3(H,M,F);G=new THREE.Vector3(B,D,G);h.faces.push(new THREE.Face3(w,A,l,[y,F,G],null,I));h=n[e*2];e=n[e*2+
+THREE.UTF8Loader.prototype.load=function(a){var b=new XMLHttpRequest,c=a.model,e=a.callback,h=a.scale!==void 0?a.scale:1,g=a.offsetX!==void 0?a.offsetX:0,f=a.offsetY!==void 0?a.offsetY:0,k=a.offsetZ!==void 0?a.offsetZ:0;b.onreadystatechange=function(){b.readyState==4?b.status==200||b.status==0?THREE.UTF8Loader.prototype.createModel(b.responseText,e,h,g,f,k):alert("Couldn't load ["+c+"] ["+b.status+"]"):b.readyState!=3&&b.readyState==2&&b.getResponseHeader("Content-Length")};b.open("GET",c,!0);b.send(null)};
+THREE.UTF8Loader.prototype.decompressMesh=function(a){var b=a.charCodeAt(0);b>=57344&&(b-=2048);b++;for(var c=new Float32Array(8*b),e=1,h=0;h<8;h++){for(var g=0,f=0;f<b;++f){var k=a.charCodeAt(f+e);g+=k>>1^-(k&1);c[8*f+h]=g}e+=b}b=a.length-e;g=new Uint16Array(b);for(h=f=0;h<b;h++)k=a.charCodeAt(h+e),g[h]=f-k,k==0&&f++;return[c,g]};
+THREE.UTF8Loader.prototype.createModel=function(a,b,c,e,h,g){var f=function(){var b=this;b.materials=[];THREE.Geometry.call(this);var f=THREE.UTF8Loader.prototype.decompressMesh(a),m=[],n=[];(function(a,f,l){for(var m,n,u,z=a.length;l<z;l+=f)m=a[l],n=a[l+1],u=a[l+2],m=m/16383*c,n=n/16383*c,u=u/16383*c,m+=e,n+=h,u+=g,b.vertices.push(new THREE.Vertex(new THREE.Vector3(m,n,u)))})(f[0],8,0);(function(a,c,b){for(var e,f,g=a.length;b<g;b+=c)e=a[b],f=a[b+1],e/=1023,f/=1023,n.push(e,f)})(f[0],8,3);(function(a,
+c,b){for(var e,f,g,h=a.length;b<h;b+=c)e=a[b],f=a[b+1],g=a[b+2],e=(e-512)/511,f=(f-512)/511,g=(g-512)/511,m.push(e,f,g)})(f[0],8,5);(function(a){var c,e,f,g,h,l,y,w,A,C=a.length;for(c=0;c<C;c+=3){e=a[c];f=a[c+1];g=a[c+2];h=b;w=e;A=f;l=g;y=e;var F=f,G=g,I=h.materials[0],H=m[F*3],M=m[F*3+1],F=m[F*3+2],B=m[G*3],D=m[G*3+1],G=m[G*3+2];y=new THREE.Vector3(m[y*3],m[y*3+1],m[y*3+2]);F=new THREE.Vector3(H,M,F);G=new THREE.Vector3(B,D,G);h.faces.push(new THREE.Face3(w,A,l,[y,F,G],null,I));h=n[e*2];e=n[e*2+
 1];l=n[f*2];y=n[f*2+1];w=n[g*2];A=n[g*2+1];g=b.faceVertexUvs[0];f=l;l=y;y=[];y.push(new THREE.UV(h,e));y.push(new THREE.UV(f,l));y.push(new THREE.UV(w,A));g.push(y)}})(f[1]);this.computeCentroids();this.computeFaceNormals()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;b(new f)};
 THREE.MarchingCubes=function(a,b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b];this.init=function(a){this.isolation=80;this.size=a;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(a,b,g){return a+(b-a)*g};this.VIntX=function(a,b,g,h,f,k,l,m,n,o){f=(f-n)/(o-n);n=this.normal_cache;b[h]=k+f*this.delta;b[h+1]=l;b[h+2]=m;g[h]=this.lerp(n[a],n[a+3],f);g[h+1]=this.lerp(n[a+1],n[a+4],f);g[h+2]=this.lerp(n[a+2],n[a+5],f)};this.VIntY=function(a,b,g,h,f,k,l,m,n,o){f=(f-n)/(o-n);n=this.normal_cache;b[h]=k;b[h+1]=l+f*this.delta;b[h+
-2]=m;b=a+this.yd*3;g[h]=this.lerp(n[a],n[b],f);g[h+1]=this.lerp(n[a+1],n[b+1],f);g[h+2]=this.lerp(n[a+2],n[b+2],f)};this.VIntZ=function(a,b,g,h,f,k,l,m,n,o){f=(f-n)/(o-n);n=this.normal_cache;b[h]=k;b[h+1]=l;b[h+2]=m+f*this.delta;b=a+this.zd*3;g[h]=this.lerp(n[a],n[b],f);g[h+1]=this.lerp(n[a+1],n[b+1],f);g[h+2]=this.lerp(n[a+2],n[b+2],f)};this.compNorm=function(a){var b=a*3;this.normal_cache[b]==0&&(this.normal_cache[b]=this.field[a-1]-this.field[a+1],this.normal_cache[b+1]=this.field[a-this.yd]-this.field[a+
-this.yd],this.normal_cache[b+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,b,g,h,f,k){var l=h+1,m=h+this.yd,n=h+this.zd,o=l+this.yd,p=l+this.zd,t=h+this.yd+this.zd,x=l+this.yd+this.zd,v=0,u=this.field[h],z=this.field[l],y=this.field[m],w=this.field[o],A=this.field[n],C=this.field[p],F=this.field[t],G=this.field[x];u<f&&(v|=1);z<f&&(v|=2);y<f&&(v|=8);w<f&&(v|=4);A<f&&(v|=16);C<f&&(v|=32);F<f&&(v|=128);G<f&&(v|=64);var I=THREE.edgeTable[v];if(I==0)return 0;var H=this.delta,
-M=a+H,B=b+H,H=g+H;I&1&&(this.compNorm(h),this.compNorm(l),this.VIntX(h*3,this.vlist,this.nlist,0,f,a,b,g,u,z));I&2&&(this.compNorm(l),this.compNorm(o),this.VIntY(l*3,this.vlist,this.nlist,3,f,M,b,g,z,w));I&4&&(this.compNorm(m),this.compNorm(o),this.VIntX(m*3,this.vlist,this.nlist,6,f,a,B,g,y,w));I&8&&(this.compNorm(h),this.compNorm(m),this.VIntY(h*3,this.vlist,this.nlist,9,f,a,b,g,u,y));I&16&&(this.compNorm(n),this.compNorm(p),this.VIntX(n*3,this.vlist,this.nlist,12,f,a,b,H,A,C));I&32&&(this.compNorm(p),
-this.compNorm(x),this.VIntY(p*3,this.vlist,this.nlist,15,f,M,b,H,C,G));I&64&&(this.compNorm(t),this.compNorm(x),this.VIntX(t*3,this.vlist,this.nlist,18,f,a,B,H,F,G));I&128&&(this.compNorm(n),this.compNorm(t),this.VIntY(n*3,this.vlist,this.nlist,21,f,a,b,H,A,F));I&256&&(this.compNorm(h),this.compNorm(n),this.VIntZ(h*3,this.vlist,this.nlist,24,f,a,b,g,u,A));I&512&&(this.compNorm(l),this.compNorm(p),this.VIntZ(l*3,this.vlist,this.nlist,27,f,M,b,g,z,C));I&1024&&(this.compNorm(o),this.compNorm(x),this.VIntZ(o*
-3,this.vlist,this.nlist,30,f,M,B,g,w,G));I&2048&&(this.compNorm(m),this.compNorm(t),this.VIntZ(m*3,this.vlist,this.nlist,33,f,a,B,g,y,F));v<<=4;for(f=h=0;THREE.triTable[v+f]!=-1;)a=v+f,b=a+1,g=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[b],3*THREE.triTable[g],k),f+=3,h++;return h};this.posnormtriv=function(a,b,g,h,f,k){var l=this.count*3;this.positionArray[l]=a[g];this.positionArray[l+1]=a[g+1];this.positionArray[l+2]=a[g+2];this.positionArray[l+3]=a[h];this.positionArray[l+
-4]=a[h+1];this.positionArray[l+5]=a[h+2];this.positionArray[l+6]=a[f];this.positionArray[l+7]=a[f+1];this.positionArray[l+8]=a[f+2];this.normalArray[l]=b[g];this.normalArray[l+1]=b[g+1];this.normalArray[l+2]=b[g+2];this.normalArray[l+3]=b[h];this.normalArray[l+4]=b[h+1];this.normalArray[l+5]=b[h+2];this.normalArray[l+6]=b[f];this.normalArray[l+7]=b[f+1];this.normalArray[l+8]=b[f+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(a){if(this.count!=0){for(var b=this.count*3;b<this.positionArray.length;b++)this.positionArray[b]=0;a(this)}};this.addBall=function(a,b,g,h,f){var k=this.size*Math.sqrt(h/f),l=g*this.size,m=b*this.size,n=a*this.size,o=Math.floor(l-k);o<1&&(o=1);l=Math.floor(l+k);l>this.size-1&&(l=this.size-1);var p=Math.floor(m-k);p<1&&(p=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var t=Math.floor(n-k);t<1&&(t=1);k=Math.floor(n+k);k>this.size-1&&(k=this.size-
-1);for(var x,v,u,z,y,w;o<l;o++){n=this.size2*o;v=o/this.size-g;y=v*v;for(v=p;v<m;v++){u=n+this.size*v;x=v/this.size-b;w=x*x;for(x=t;x<k;x++)z=x/this.size-a,z=h/(1.0E-6+z*z+w+y)-f,z>0&&(this.field[u+x]+=z)}}};this.addPlaneX=function(a,b){var g,h,f,k,l,m=this.size,n=this.yd,o=this.zd,p=this.field,t=m*Math.sqrt(a/b);t>m&&(t=m);for(g=0;g<t;g++)if(h=g/m,h*=h,k=a/(1.0E-4+h)-b,k>0)for(h=0;h<m;h++){l=g+h*n;for(f=0;f<m;f++)p[o*f+l]+=k}};this.addPlaneY=function(a,b){var g,h,f,k,l,m,n=this.size,o=this.yd,p=
-this.zd,t=this.field,x=n*Math.sqrt(a/b);x>n&&(x=n);for(h=0;h<x;h++)if(g=h/n,g*=g,k=a/(1.0E-4+g)-b,k>0){l=h*o;for(g=0;g<n;g++){m=l+g;for(f=0;f<n;f++)t[p*f+m]+=k}}};this.addPlaneZ=function(a,b){var g,h,f,k,l,m;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(a/b);dist>size&&(dist=size);for(f=0;f<dist;f++)if(g=f/size,g*=g,k=a/(1.0E-4+g)-b,k>0){l=zd*f;for(h=0;h<size;h++){m=l+h*yd;for(g=0;g<size;g++)field[m+g]+=k}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[a*
-3]=0,this.field[a]=0};this.render=function(a){this.begin();var b,g,h,f,k,l,m,n,o,p=this.size-2;for(f=1;f<p;f++){o=this.size2*f;m=(f-this.halfsize)/this.halfsize;for(h=1;h<p;h++){n=o+this.size*h;l=(h-this.halfsize)/this.halfsize;for(g=1;g<p;g++)k=(g-this.halfsize)/this.halfsize,b=n+g,this.polygonize(k,l,m,b,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,b=new THREE.Geometry,g=[];this.render(function(h){var f,k,l,m,n,o,p,t;for(f=0;f<h.count;f++)p=f*3,n=p+1,t=p+2,k=h.positionArray[p],
-l=h.positionArray[n],m=h.positionArray[t],o=new THREE.Vector3(k,l,m),k=h.normalArray[p],l=h.normalArray[n],m=h.normalArray[t],p=new THREE.Vector3(k,l,m),p.normalize(),n=new THREE.Vertex(o),b.vertices.push(n),g.push(p);nfaces=h.count/3;for(f=0;f<nfaces;f++)p=(a+f)*3,n=p+1,t=p+2,o=g[p],k=g[n],l=g[t],p=new THREE.Face3(p,n,t,[o,k,l]),b.faces.push(p);a+=nfaces;h.count=0});return b};this.init(a)};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(a,b,h){return a+(b-a)*h};this.VIntX=function(a,b,h,g,f,k,l,m,n,o){f=(f-n)/(o-n);n=this.normal_cache;b[g]=k+f*this.delta;b[g+1]=l;b[g+2]=m;h[g]=this.lerp(n[a],n[a+3],f);h[g+1]=this.lerp(n[a+1],n[a+4],f);h[g+2]=this.lerp(n[a+2],n[a+5],f)};this.VIntY=function(a,b,h,g,f,k,l,m,n,o){f=(f-n)/(o-n);n=this.normal_cache;b[g]=k;b[g+1]=l+f*this.delta;b[g+
+2]=m;b=a+this.yd*3;h[g]=this.lerp(n[a],n[b],f);h[g+1]=this.lerp(n[a+1],n[b+1],f);h[g+2]=this.lerp(n[a+2],n[b+2],f)};this.VIntZ=function(a,b,h,g,f,k,l,m,n,o){f=(f-n)/(o-n);n=this.normal_cache;b[g]=k;b[g+1]=l;b[g+2]=m+f*this.delta;b=a+this.zd*3;h[g]=this.lerp(n[a],n[b],f);h[g+1]=this.lerp(n[a+1],n[b+1],f);h[g+2]=this.lerp(n[a+2],n[b+2],f)};this.compNorm=function(a){var b=a*3;this.normal_cache[b]==0&&(this.normal_cache[b]=this.field[a-1]-this.field[a+1],this.normal_cache[b+1]=this.field[a-this.yd]-this.field[a+
+this.yd],this.normal_cache[b+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,b,h,g,f,k){var l=g+1,m=g+this.yd,n=g+this.zd,o=l+this.yd,p=l+this.zd,t=g+this.yd+this.zd,x=l+this.yd+this.zd,v=0,u=this.field[g],z=this.field[l],y=this.field[m],w=this.field[o],A=this.field[n],C=this.field[p],F=this.field[t],G=this.field[x];u<f&&(v|=1);z<f&&(v|=2);y<f&&(v|=8);w<f&&(v|=4);A<f&&(v|=16);C<f&&(v|=32);F<f&&(v|=128);G<f&&(v|=64);var I=THREE.edgeTable[v];if(I==0)return 0;var H=this.delta,
+M=a+H,B=b+H,H=h+H;I&1&&(this.compNorm(g),this.compNorm(l),this.VIntX(g*3,this.vlist,this.nlist,0,f,a,b,h,u,z));I&2&&(this.compNorm(l),this.compNorm(o),this.VIntY(l*3,this.vlist,this.nlist,3,f,M,b,h,z,w));I&4&&(this.compNorm(m),this.compNorm(o),this.VIntX(m*3,this.vlist,this.nlist,6,f,a,B,h,y,w));I&8&&(this.compNorm(g),this.compNorm(m),this.VIntY(g*3,this.vlist,this.nlist,9,f,a,b,h,u,y));I&16&&(this.compNorm(n),this.compNorm(p),this.VIntX(n*3,this.vlist,this.nlist,12,f,a,b,H,A,C));I&32&&(this.compNorm(p),
+this.compNorm(x),this.VIntY(p*3,this.vlist,this.nlist,15,f,M,b,H,C,G));I&64&&(this.compNorm(t),this.compNorm(x),this.VIntX(t*3,this.vlist,this.nlist,18,f,a,B,H,F,G));I&128&&(this.compNorm(n),this.compNorm(t),this.VIntY(n*3,this.vlist,this.nlist,21,f,a,b,H,A,F));I&256&&(this.compNorm(g),this.compNorm(n),this.VIntZ(g*3,this.vlist,this.nlist,24,f,a,b,h,u,A));I&512&&(this.compNorm(l),this.compNorm(p),this.VIntZ(l*3,this.vlist,this.nlist,27,f,M,b,h,z,C));I&1024&&(this.compNorm(o),this.compNorm(x),this.VIntZ(o*
+3,this.vlist,this.nlist,30,f,M,B,h,w,G));I&2048&&(this.compNorm(m),this.compNorm(t),this.VIntZ(m*3,this.vlist,this.nlist,33,f,a,B,h,y,F));v<<=4;for(f=g=0;THREE.triTable[v+f]!=-1;)a=v+f,b=a+1,h=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[b],3*THREE.triTable[h],k),f+=3,g++;return g};this.posnormtriv=function(a,b,h,g,f,k){var l=this.count*3;this.positionArray[l]=a[h];this.positionArray[l+1]=a[h+1];this.positionArray[l+2]=a[h+2];this.positionArray[l+3]=a[g];this.positionArray[l+
+4]=a[g+1];this.positionArray[l+5]=a[g+2];this.positionArray[l+6]=a[f];this.positionArray[l+7]=a[f+1];this.positionArray[l+8]=a[f+2];this.normalArray[l]=b[h];this.normalArray[l+1]=b[h+1];this.normalArray[l+2]=b[h+2];this.normalArray[l+3]=b[g];this.normalArray[l+4]=b[g+1];this.normalArray[l+5]=b[g+2];this.normalArray[l+6]=b[f];this.normalArray[l+7]=b[f+1];this.normalArray[l+8]=b[f+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(a){if(this.count!=0){for(var b=this.count*3;b<this.positionArray.length;b++)this.positionArray[b]=0;a(this)}};this.addBall=function(a,b,h,g,f){var k=this.size*Math.sqrt(g/f),l=h*this.size,m=b*this.size,n=a*this.size,o=Math.floor(l-k);o<1&&(o=1);l=Math.floor(l+k);l>this.size-1&&(l=this.size-1);var p=Math.floor(m-k);p<1&&(p=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var t=Math.floor(n-k);t<1&&(t=1);k=Math.floor(n+k);k>this.size-1&&(k=this.size-
+1);for(var x,v,u,z,y,w;o<l;o++){n=this.size2*o;v=o/this.size-h;y=v*v;for(v=p;v<m;v++){u=n+this.size*v;x=v/this.size-b;w=x*x;for(x=t;x<k;x++)z=x/this.size-a,z=g/(1.0E-6+z*z+w+y)-f,z>0&&(this.field[u+x]+=z)}}};this.addPlaneX=function(a,b){var h,g,f,k,l,m=this.size,n=this.yd,o=this.zd,p=this.field,t=m*Math.sqrt(a/b);t>m&&(t=m);for(h=0;h<t;h++)if(g=h/m,g*=g,k=a/(1.0E-4+g)-b,k>0)for(g=0;g<m;g++){l=h+g*n;for(f=0;f<m;f++)p[o*f+l]+=k}};this.addPlaneY=function(a,b){var h,g,f,k,l,m,n=this.size,o=this.yd,p=
+this.zd,t=this.field,x=n*Math.sqrt(a/b);x>n&&(x=n);for(g=0;g<x;g++)if(h=g/n,h*=h,k=a/(1.0E-4+h)-b,k>0){l=g*o;for(h=0;h<n;h++){m=l+h;for(f=0;f<n;f++)t[p*f+m]+=k}}};this.addPlaneZ=function(a,b){var h,g,f,k,l,m;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(a/b);dist>size&&(dist=size);for(f=0;f<dist;f++)if(h=f/size,h*=h,k=a/(1.0E-4+h)-b,k>0){l=zd*f;for(g=0;g<size;g++){m=l+g*yd;for(h=0;h<size;h++)field[m+h]+=k}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[a*
+3]=0,this.field[a]=0};this.render=function(a){this.begin();var b,h,g,f,k,l,m,n,o,p=this.size-2;for(f=1;f<p;f++){o=this.size2*f;m=(f-this.halfsize)/this.halfsize;for(g=1;g<p;g++){n=o+this.size*g;l=(g-this.halfsize)/this.halfsize;for(h=1;h<p;h++)k=(h-this.halfsize)/this.halfsize,b=n+h,this.polygonize(k,l,m,b,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,b=new THREE.Geometry,h=[];this.render(function(g){var f,k,l,m,n,o,p,t;for(f=0;f<g.count;f++)p=f*3,n=p+1,t=p+2,k=g.positionArray[p],
+l=g.positionArray[n],m=g.positionArray[t],o=new THREE.Vector3(k,l,m),k=g.normalArray[p],l=g.normalArray[n],m=g.normalArray[t],p=new THREE.Vector3(k,l,m),p.normalize(),n=new THREE.Vertex(o),b.vertices.push(n),h.push(p);nfaces=g.count/3;for(f=0;f<nfaces;f++)p=(a+f)*3,n=p+1,t=p+2,o=h[p],k=h[n],l=h[t],p=new THREE.Face3(p,n,t,[o,k,l]),b.faces.push(p);a+=nfaces;g.count=0});return b};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
 THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
 1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,
 419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]);
@@ -317,27 +317,26 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
 -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,
 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);
-THREE.Trident=function(a){function b(b){return new THREE.Mesh(new THREE.CylinderGeometry(30,0.1,a.length/20,a.length/5),new THREE.MeshBasicMaterial({color:b}))}function c(a,b){var c=new THREE.Geometry;c.vertices=[new THREE.Vertex,new THREE.Vertex(a)];return new THREE.Line(c,new THREE.LineBasicMaterial({color:b}))}THREE.Object3D.call(this);var e=Math.PI/2,g,a=a||THREE.Trident.defaultParams;if(a!==THREE.Trident.defaultParams)for(g in THREE.Trident.defaultParams)a.hasOwnProperty(g)||(a[g]=THREE.Trident.defaultParams[g]);
-this.scale=new THREE.Vector3(a.scale,a.scale,a.scale);this.addChild(c(new THREE.Vector3(a.length,0,0),a.xAxisColor));this.addChild(c(new THREE.Vector3(0,a.length,0),a.yAxisColor));this.addChild(c(new THREE.Vector3(0,0,a.length),a.zAxisColor));if(a.showArrows)g=b(a.xAxisColor),g.rotation.y=-e,g.position.x=a.length,this.addChild(g),g=b(a.yAxisColor),g.rotation.x=e,g.position.y=a.length,this.addChild(g),g=b(a.zAxisColor),g.rotation.y=Math.PI,g.position.z=a.length,this.addChild(g)};
-THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.Trident.defaultParams={xAxisColor:16711680,yAxisColor:65280,zAxisColor:255,showArrows:!0,length:100,scale:1};THREE.PlaneCollider=function(a,b){this.point=a;this.normal=b};THREE.SphereCollider=function(a,b){this.center=a;this.radius=b;this.radiusSq=b*b};THREE.BoxCollider=function(a,b){this.min=a;this.max=b;this.dynamic=!0;this.normal=new THREE.Vector3};
-THREE.MeshCollider=function(a,b){this.mesh=a;this.box=b;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;THREE.CollisionSystem.prototype.merge=function(a){this.colliders=this.colliders.concat(a.colliders);this.hits=this.hits.concat(a.hits)};
-THREE.CollisionSystem.prototype.rayCastAll=function(a){a.direction.normalize();this.hits.length=0;var b,c,e,g,h=0;b=0;for(c=this.colliders.length;b<c;b++)if(g=this.colliders[b],e=this.rayCast(a,g),e<Number.MAX_VALUE)g.distance=e,e>h?this.hits.push(g):this.hits.unshift(g),h=e;return this.hits};
+THREE.Trident=function(){THREE.Object3D.call(this);var a=new THREE.Geometry;a.vertices.push(new THREE.Vertex);a.vertices.push(new THREE.Vertex(new THREE.Vector3(0,100,0)));var b=new THREE.CylinderGeometry(0,5,25,5,1),c=new THREE.Line(a,new THREE.LineBasicMaterial({color:16711680}));c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:16711680}));c.position.x=100;c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Line(a,new THREE.LineBasicMaterial({color:65280}));
+this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:65280}));c.position.y=100;this.add(c);c=new THREE.Line(a,new THREE.LineBasicMaterial({color:255}));c.rotation.x=Math.PI/2;this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:255}));c.position.z=100;c.rotation.x=Math.PI/2;this.add(c)};THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.PlaneCollider=function(a,b){this.point=a;this.normal=b};
+THREE.SphereCollider=function(a,b){this.center=a;this.radius=b;this.radiusSq=b*b};THREE.BoxCollider=function(a,b){this.min=a;this.max=b;this.dynamic=!0;this.normal=new THREE.Vector3};THREE.MeshCollider=function(a,b){this.mesh=a;this.box=b;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;
+THREE.CollisionSystem.prototype.merge=function(a){this.colliders=this.colliders.concat(a.colliders);this.hits=this.hits.concat(a.hits)};THREE.CollisionSystem.prototype.rayCastAll=function(a){a.direction.normalize();this.hits.length=0;var b,c,e,h,g=0;b=0;for(c=this.colliders.length;b<c;b++)if(h=this.colliders[b],e=this.rayCast(a,h),e<Number.MAX_VALUE)h.distance=e,e>g?this.hits.push(h):this.hits.unshift(h),g=e;return this.hits};
 THREE.CollisionSystem.prototype.rayCastNearest=function(a){var b=this.rayCastAll(a);if(b.length==0)return null;for(var c=0;b[c]instanceof THREE.MeshCollider;){var e=this.rayMesh(a,b[c]);if(e.dist<Number.MAX_VALUE){b[c].distance=e.dist;b[c].faceIndex=e.faceIndex;break}c++}if(c>b.length)return null;return b[c]};
 THREE.CollisionSystem.prototype.rayCast=function(a,b){if(b instanceof THREE.PlaneCollider)return this.rayPlane(a,b);else if(b instanceof THREE.SphereCollider)return this.raySphere(a,b);else if(b instanceof THREE.BoxCollider)return this.rayBox(a,b);else if(b instanceof THREE.MeshCollider&&b.box)return this.rayBox(a,b.box)};
-THREE.CollisionSystem.prototype.rayMesh=function(a,b){for(var c=this.makeRayLocal(a,b.mesh),e=Number.MAX_VALUE,g,h=0;h<b.numFaces;h++){var f=b.mesh.geometry.faces[h],k=b.mesh.geometry.vertices[f.a].position,l=b.mesh.geometry.vertices[f.b].position,m=b.mesh.geometry.vertices[f.c].position,n=f instanceof THREE.Face4?b.mesh.geometry.vertices[f.d].position:null;f instanceof THREE.Face3?(f=this.rayTriangle(c,k,l,m,e,this.collisionNormal,b.mesh),f<e&&(e=f,g=h,b.normal.copy(this.collisionNormal),b.normal.normalize())):
-f instanceof THREE.Face4&&(f=this.rayTriangle(c,k,l,n,e,this.collisionNormal,b.mesh),f<e&&(e=f,g=h,b.normal.copy(this.collisionNormal),b.normal.normalize()),f=this.rayTriangle(c,l,m,n,e,this.collisionNormal,b.mesh),f<e&&(e=f,g=h,b.normal.copy(this.collisionNormal),b.normal.normalize()))}return{dist:e,faceIndex:g}};
-THREE.CollisionSystem.prototype.rayTriangle=function(a,b,c,e,g,h,f){var k=THREE.CollisionSystem.__v1,l=THREE.CollisionSystem.__v2;h.set(0,0,0);k.sub(c,b);l.sub(e,c);h.cross(k,l);k=h.dot(a.direction);if(!(k<0))if(f.doubleSided||f.flipSided)h.multiplyScalar(-1),k*=-1;else return Number.MAX_VALUE;f=h.dot(b)-h.dot(a.origin);if(!(f<=0))return Number.MAX_VALUE;if(!(f>=k*g))return Number.MAX_VALUE;f/=k;k=THREE.CollisionSystem.__v3;k.copy(a.direction);k.multiplyScalar(f);k.addSelf(a.origin);Math.abs(h.x)>
-Math.abs(h.y)?Math.abs(h.x)>Math.abs(h.z)?(a=k.y-b.y,h=c.y-b.y,g=e.y-b.y,k=k.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=k.x-b.x,h=c.x-b.x,g=e.x-b.x,k=k.y-b.y,c=c.y-b.y,e=e.y-b.y):Math.abs(h.y)>Math.abs(h.z)?(a=k.x-b.x,h=c.x-b.x,g=e.x-b.x,k=k.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=k.x-b.x,h=c.x-b.x,g=e.x-b.x,k=k.y-b.y,c=c.y-b.y,e=e.y-b.y);b=h*e-c*g;if(b==0)return Number.MAX_VALUE;b=1/b;e=(a*e-k*g)*b;if(!(e>=0))return Number.MAX_VALUE;b*=h*k-c*a;if(!(b>=0))return Number.MAX_VALUE;if(!(1-e-b>=0))return Number.MAX_VALUE;return f};
+THREE.CollisionSystem.prototype.rayMesh=function(a,b){for(var c=this.makeRayLocal(a,b.mesh),e=Number.MAX_VALUE,h,g=0;g<b.numFaces;g++){var f=b.mesh.geometry.faces[g],k=b.mesh.geometry.vertices[f.a].position,l=b.mesh.geometry.vertices[f.b].position,m=b.mesh.geometry.vertices[f.c].position,n=f instanceof THREE.Face4?b.mesh.geometry.vertices[f.d].position:null;f instanceof THREE.Face3?(f=this.rayTriangle(c,k,l,m,e,this.collisionNormal,b.mesh),f<e&&(e=f,h=g,b.normal.copy(this.collisionNormal),b.normal.normalize())):
+f instanceof THREE.Face4&&(f=this.rayTriangle(c,k,l,n,e,this.collisionNormal,b.mesh),f<e&&(e=f,h=g,b.normal.copy(this.collisionNormal),b.normal.normalize()),f=this.rayTriangle(c,l,m,n,e,this.collisionNormal,b.mesh),f<e&&(e=f,h=g,b.normal.copy(this.collisionNormal),b.normal.normalize()))}return{dist:e,faceIndex:h}};
+THREE.CollisionSystem.prototype.rayTriangle=function(a,b,c,e,h,g,f){var k=THREE.CollisionSystem.__v1,l=THREE.CollisionSystem.__v2;g.set(0,0,0);k.sub(c,b);l.sub(e,c);g.cross(k,l);k=g.dot(a.direction);if(!(k<0))if(f.doubleSided||f.flipSided)g.multiplyScalar(-1),k*=-1;else return Number.MAX_VALUE;f=g.dot(b)-g.dot(a.origin);if(!(f<=0))return Number.MAX_VALUE;if(!(f>=k*h))return Number.MAX_VALUE;f/=k;k=THREE.CollisionSystem.__v3;k.copy(a.direction);k.multiplyScalar(f);k.addSelf(a.origin);Math.abs(g.x)>
+Math.abs(g.y)?Math.abs(g.x)>Math.abs(g.z)?(a=k.y-b.y,g=c.y-b.y,h=e.y-b.y,k=k.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=k.x-b.x,g=c.x-b.x,h=e.x-b.x,k=k.y-b.y,c=c.y-b.y,e=e.y-b.y):Math.abs(g.y)>Math.abs(g.z)?(a=k.x-b.x,g=c.x-b.x,h=e.x-b.x,k=k.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=k.x-b.x,g=c.x-b.x,h=e.x-b.x,k=k.y-b.y,c=c.y-b.y,e=e.y-b.y);b=g*e-c*h;if(b==0)return Number.MAX_VALUE;b=1/b;e=(a*e-k*h)*b;if(!(e>=0))return Number.MAX_VALUE;b*=g*k-c*a;if(!(b>=0))return Number.MAX_VALUE;if(!(1-e-b>=0))return Number.MAX_VALUE;return f};
 THREE.CollisionSystem.prototype.makeRayLocal=function(a,b){var c=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(b.matrixWorld,c);var e=THREE.CollisionSystem.__r;e.origin.copy(a.origin);e.direction.copy(a.direction);c.multiplyVector3(e.origin);c.rotateAxis(e.direction);e.direction.normalize();return e};
-THREE.CollisionSystem.prototype.rayBox=function(a,b){var c;b.dynamic&&b.mesh&&b.mesh.matrixWorld?c=this.makeRayLocal(a,b.mesh):(c=THREE.CollisionSystem.__r,c.origin.copy(a.origin),c.direction.copy(a.direction));var e=0,g=0,h=0,f=0,k=0,l=0,m=!0;c.origin.x<b.min.x?(e=b.min.x-c.origin.x,e/=c.direction.x,m=!1,f=-1):c.origin.x>b.max.x&&(e=b.max.x-c.origin.x,e/=c.direction.x,m=!1,f=1);c.origin.y<b.min.y?(g=b.min.y-c.origin.y,g/=c.direction.y,m=!1,k=-1):c.origin.y>b.max.y&&(g=b.max.y-c.origin.y,g/=c.direction.y,
-m=!1,k=1);c.origin.z<b.min.z?(h=b.min.z-c.origin.z,h/=c.direction.z,m=!1,l=-1):c.origin.z>b.max.z&&(h=b.max.z-c.origin.z,h/=c.direction.z,m=!1,l=1);if(m)return-1;m=0;g>e&&(m=1,e=g);h>e&&(m=2,e=h);switch(m){case 0:k=c.origin.y+c.direction.y*e;if(k<b.min.y||k>b.max.y)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*e;if(c<b.min.z||c>b.max.z)return Number.MAX_VALUE;b.normal.set(f,0,0);break;case 1:f=c.origin.x+c.direction.x*e;if(f<b.min.x||f>b.max.x)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*
+THREE.CollisionSystem.prototype.rayBox=function(a,b){var c;b.dynamic&&b.mesh&&b.mesh.matrixWorld?c=this.makeRayLocal(a,b.mesh):(c=THREE.CollisionSystem.__r,c.origin.copy(a.origin),c.direction.copy(a.direction));var e=0,h=0,g=0,f=0,k=0,l=0,m=!0;c.origin.x<b.min.x?(e=b.min.x-c.origin.x,e/=c.direction.x,m=!1,f=-1):c.origin.x>b.max.x&&(e=b.max.x-c.origin.x,e/=c.direction.x,m=!1,f=1);c.origin.y<b.min.y?(h=b.min.y-c.origin.y,h/=c.direction.y,m=!1,k=-1):c.origin.y>b.max.y&&(h=b.max.y-c.origin.y,h/=c.direction.y,
+m=!1,k=1);c.origin.z<b.min.z?(g=b.min.z-c.origin.z,g/=c.direction.z,m=!1,l=-1):c.origin.z>b.max.z&&(g=b.max.z-c.origin.z,g/=c.direction.z,m=!1,l=1);if(m)return-1;m=0;h>e&&(m=1,e=h);g>e&&(m=2,e=g);switch(m){case 0:k=c.origin.y+c.direction.y*e;if(k<b.min.y||k>b.max.y)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*e;if(c<b.min.z||c>b.max.z)return Number.MAX_VALUE;b.normal.set(f,0,0);break;case 1:f=c.origin.x+c.direction.x*e;if(f<b.min.x||f>b.max.x)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*
 e;if(c<b.min.z||c>b.max.z)return Number.MAX_VALUE;b.normal.set(0,k,0);break;case 2:f=c.origin.x+c.direction.x*e;if(f<b.min.x||f>b.max.x)return Number.MAX_VALUE;k=c.origin.y+c.direction.y*e;if(k<b.min.y||k>b.max.y)return Number.MAX_VALUE;b.normal.set(0,0,l)}return e};THREE.CollisionSystem.prototype.rayPlane=function(a,b){var c=a.direction.dot(b.normal),e=b.point.dot(b.normal);if(c<0)c=(e-a.origin.dot(b.normal))/c;else return Number.MAX_VALUE;return c>0?c:Number.MAX_VALUE};
 THREE.CollisionSystem.prototype.raySphere=function(a,b){var c=b.center.clone().subSelf(a.origin);if(c.lengthSq<b.radiusSq)return-1;var e=c.dot(a.direction.clone());if(e<=0)return Number.MAX_VALUE;c=b.radiusSq-(c.lengthSq()-e*e);if(c>=0)return Math.abs(e)-Math.sqrt(c);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(a){a.geometry.computeBoundingBox();var b=a.geometry.boundingBox,c=new THREE.Vector3(b.x[0],b.y[0],b.z[0]),b=new THREE.Vector3(b.x[1],b.y[1],b.z[1]),c=new THREE.BoxCollider(c,b);c.mesh=a;return c};THREE.CollisionUtils.MeshAABB=function(a){var b=THREE.CollisionUtils.MeshOBB(a);b.min.addSelf(a.position);b.max.addSelf(a.position);b.dynamic=!1;return b};
 THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))};
-if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,e=this.render,g=new THREE.Camera,h=new THREE.Camera,f=new THREE.Matrix4,k=new THREE.Matrix4,l,m,n;g.useTarget=h.useTarget=!1;g.matrixAutoUpdate=h.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},o=new THREE.WebGLRenderTarget(512,512,a),p=new THREE.WebGLRenderTarget(512,512,a),t=new THREE.Camera(53,1,1,1E4);t.position.z=
+if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,e=this.render,h=new THREE.Camera,g=new THREE.Camera,f=new THREE.Matrix4,k=new THREE.Matrix4,l,m,n;h.useTarget=g.useTarget=!1;h.matrixAutoUpdate=g.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},o=new THREE.WebGLRenderTarget(512,512,a),p=new THREE.WebGLRenderTarget(512,512,a),t=new THREE.Camera(53,1,1,1E4);t.position.z=
 2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:o},mapRight:{type:"t",value:1,texture:p}},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 x=new THREE.Scene;x.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){c.call(b,a,e);o.width=a;o.height=e;p.width=a;p.height=e};this.render=function(a,c){c.update(null,!0);if(l!==c.aspect||m!==c.near||n!==c.fov){l=c.aspect;m=c.near;n=c.fov;var z=c.projectionMatrix.clone(),y=125/30*0.5,w=y*m/125,A=m*Math.tan(n*Math.PI/360),C;f.n14=y;k.n14=-y;y=-A*l+w;C=A*l+w;z.n11=2*m/(C-y);z.n13=(C+y)/(C-y);g.projectionMatrix=z.clone();y=-A*l-w;C=A*l-w;z.n11=2*m/(C-y);
-z.n13=(C+y)/(C-y);h.projectionMatrix=z.clone()}g.matrix=c.matrixWorld.clone().multiplySelf(k);g.update(null,!0);g.position.copy(c.position);g.near=m;g.far=c.far;e.call(b,a,g,o,!0);h.matrix=c.matrixWorld.clone().multiplySelf(f);h.update(null,!0);h.position.copy(c.position);h.near=m;h.far=c.far;e.call(b,a,h,p,!0);e.call(b,x,t)}};
-if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,e=this.render,g,h,f=new THREE.Camera,k=new THREE.Camera;b.separation=10;if(a&&a.separation!==void 0)b.separation=a.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(a,e){c.call(b,a,e);g=a/2;h=e};this.render=function(a,c){this.clear();f.fov=c.fov;f.aspect=0.5*c.aspect;f.near=c.near;f.far=c.far;
-f.updateProjectionMatrix();f.position.copy(c.position);f.target.position.copy(c.target.position);f.translateX(b.separation);k.projectionMatrix=f.projectionMatrix;k.position.copy(c.position);k.target.position.copy(c.target.position);k.translateX(-b.separation);this.setViewport(0,0,g,h);e.call(b,a,f);this.setViewport(g,0,g,h);e.call(b,a,k,!1)}};
+var x=new THREE.Scene;x.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){c.call(b,a,e);o.width=a;o.height=e;p.width=a;p.height=e};this.render=function(a,c){c.update(null,!0);if(l!==c.aspect||m!==c.near||n!==c.fov){l=c.aspect;m=c.near;n=c.fov;var z=c.projectionMatrix.clone(),y=125/30*0.5,w=y*m/125,A=m*Math.tan(n*Math.PI/360),C;f.n14=y;k.n14=-y;y=-A*l+w;C=A*l+w;z.n11=2*m/(C-y);z.n13=(C+y)/(C-y);h.projectionMatrix=z.clone();y=-A*l-w;C=A*l-w;z.n11=2*m/(C-y);
+z.n13=(C+y)/(C-y);g.projectionMatrix=z.clone()}h.matrix=c.matrixWorld.clone().multiplySelf(k);h.update(null,!0);h.position.copy(c.position);h.near=m;h.far=c.far;e.call(b,a,h,o,!0);g.matrix=c.matrixWorld.clone().multiplySelf(f);g.update(null,!0);g.position.copy(c.position);g.near=m;g.far=c.far;e.call(b,a,g,p,!0);e.call(b,x,t)}};
+if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,e=this.render,h,g,f=new THREE.Camera,k=new THREE.Camera;b.separation=10;if(a&&a.separation!==void 0)b.separation=a.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(a,e){c.call(b,a,e);h=a/2;g=e};this.render=function(a,c){this.clear();f.fov=c.fov;f.aspect=0.5*c.aspect;f.near=c.near;f.far=c.far;
+f.updateProjectionMatrix();f.position.copy(c.position);f.target.position.copy(c.target.position);f.translateX(b.separation);k.projectionMatrix=f.projectionMatrix;k.position.copy(c.position);k.target.position.copy(c.target.position);k.translateX(-b.separation);this.setViewport(0,0,h,g);e.call(b,a,f);this.setViewport(h,0,h,g);e.call(b,a,k,!1)}};

+ 6 - 6
build/custom/ThreeSVG.js

@@ -1,16 +1,16 @@
 // ThreeSVG.js r45dev - 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(!self.Int32Array)self.Int32Array=Array,self.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=
 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.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},
 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)},
 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=
-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*
-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.x=a||0;this.y=b||0;this.z=c||0;this.w=d||1};
+THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},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){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*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.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};

+ 6 - 6
build/custom/ThreeWebGL.js

@@ -1,16 +1,16 @@
 // ThreeWebGL.js r45dev - 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(!self.Int32Array)self.Int32Array=Array,self.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,j,h;if(d==0)this.r=this.g=this.b=0;else switch(e=Math.floor(b*6),j=b*6-e,b=d*(1-c),h=d*(1-c*j),c=d*(1-c*(1-j)),e){case 1:this.r=h;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=h;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=h;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.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},
 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)},
 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=
-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*
-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.x=b||0;this.y=c||0;this.z=d||0;this.w=e||1};
+THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(b,c,d){this.x=b;this.y=c;this.z=d;return this},setX:function(b){this.x=b;return this},setY:function(b){this.y=b;return this},setZ:function(b){this.z=b;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){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*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.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};

+ 6 - 6
examples/canvas_camera_orthographic.html

@@ -59,12 +59,12 @@
 
 					var line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } ) );
 					line.position.z = ( i * 50 ) - 500;
-					scene.addObject( line );
+					scene.add( line );
 
 					var line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } ) );
 					line.position.x = ( i * 50 ) - 500;
 					line.rotation.y = 90 * Math.PI / 180;
-					scene.addObject( line );
+					scene.add( line );
 
 				}
 
@@ -84,28 +84,28 @@
 					cube.position.y = ( cube.scale.y * 50 ) / 2;
 					cube.position.z = Math.floor( ( Math.random() * 1000 - 500 ) / 50 ) * 50 + 25;
 
-					scene.addObject(cube);
+					scene.add(cube);
 
 				}
 
 				// Lights
 
 				var ambientLight = new THREE.AmbientLight( Math.random() * 0x10 );
-				scene.addLight( ambientLight );
+				scene.add( ambientLight );
 
 				var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 1 - 1
examples/canvas_geometry_birds.html

@@ -361,7 +361,7 @@
 					bird.position = boids[ i ].position;
 					bird.doubleSided = true;
 					// bird.scale.x = bird.scale.y = bird.scale.z = 10;
-					scene.addObject( bird );
+					scene.add( bird );
 
 
 				}

+ 2 - 2
examples/canvas_geometry_cube.html

@@ -73,14 +73,14 @@
 				cube = new THREE.Mesh( new THREE.CubeGeometry( 200, 200, 200, 1, 1, 1, materials ), new THREE.MeshFaceMaterial() );
 				cube.position.y = 150;
 				cube.overdraw = true;
-				scene.addObject( cube );
+				scene.add( cube );
 
 				// Plane
 
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 200, 200 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0 } ) );
 				plane.rotation.x = - 90 * ( Math.PI / 180 );
 				plane.overdraw = true;
-				scene.addObject( plane );
+				scene.add( plane );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 2 - 2
examples/canvas_geometry_earth.html

@@ -67,11 +67,11 @@
 				mesh.overdraw = true;
 				mesh.position.y = - 250;
 				mesh.rotation.x = - 90 * Math.PI / 180;
-				scene.addObject(mesh);
+				scene.add(mesh);
 
 				mesh = new THREE.Mesh( new THREE.SphereGeometry( 200, 20, 20 ), new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/land_ocean_ice_cloud_2048.jpg' ) } ) );
 				mesh.overdraw = true;
-				scene.addObject(mesh);
+				scene.add(mesh);
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 2 - 2
examples/canvas_geometry_hierarchy.html

@@ -65,11 +65,11 @@
 					mesh.matrixAutoUpdate = false;
 					mesh.updateMatrix();
 
-					group.addChild( mesh );
+					group.add( mesh );
 
 				}
 
-				scene.addObject( group );
+				scene.add( group );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 1 - 1
examples/canvas_geometry_panorama.html

@@ -78,7 +78,7 @@
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 300, 300, 300, 7, 7, 7, materials, true ), new THREE.MeshFaceMaterial() );
 				mesh.overdraw = true;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 1 - 1
examples/canvas_geometry_panorama_fisheye.html

@@ -78,7 +78,7 @@
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 300, 300, 300, 7, 7, 7, materials, true ), new THREE.MeshFaceMaterial() );
 				mesh.overdraw = true;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				for ( var i = 0, l = mesh.geometry.vertices.length; i < l; i ++ ) {
 

+ 1 - 1
examples/canvas_geometry_terrain.html

@@ -84,7 +84,7 @@
 				mesh = new THREE.Mesh( plane, material );
 				mesh.rotation.x = -90 * Math.PI / 180;
 				mesh.overdraw = true;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 2 - 2
examples/canvas_geometry_text.html

@@ -104,9 +104,9 @@
 				text.overdraw = true;
 
 				parent = new THREE.Object3D();
-                parent.addChild( text );
+                parent.add( text );
 
-				scene.addObject( parent );
+				scene.add( parent );
 
 				renderer = new THREE.CanvasRenderer();
                 renderer.setSize( window.innerWidth, window.innerHeight );

+ 2 - 2
examples/canvas_interactive_cubes.html

@@ -63,7 +63,7 @@
 					object.rotation.x = ( Math.random() * 360 ) * Math.PI / 180;
 					object.rotation.y = ( Math.random() * 360 ) * Math.PI / 180;
 					object.rotation.z = ( Math.random() * 360 ) * Math.PI / 180;
-					scene.addObject( object );
+					scene.add( object );
 
 					objects.push( object );
 
@@ -118,7 +118,7 @@
 					var particle = new THREE.Particle( particleMaterial );
 					particle.position = intersects[ 0 ].point;
 					particle.scale.x = particle.scale.y = 8;
-					scene.addObject( particle );
+					scene.add( particle );
 
 				}
 

+ 1 - 1
examples/canvas_interactive_cubes_tween.html

@@ -61,7 +61,7 @@
 					object.rotation.x = ( Math.random() * 360 ) * Math.PI / 180;
 					object.rotation.y = ( Math.random() * 360 ) * Math.PI / 180;
 					object.rotation.z = ( Math.random() * 360 ) * Math.PI / 180;
-					scene.addObject( object );
+					scene.add( object );
 
 				}
 

+ 1 - 1
examples/canvas_interactive_particles.html

@@ -76,7 +76,7 @@
 					particle.position.y = Math.random() * 800 - 400;
 					particle.position.z = Math.random() * 800 - 400;
 					particle.scale.x = particle.scale.y = Math.random() * 10 + 10;
-					scene.addObject( particle );
+					scene.add( particle );
 
 				}
 

+ 8 - 8
examples/canvas_interactive_voxelpainter.html

@@ -62,12 +62,12 @@
 
 					var line = new THREE.Line( geometry, material );
 					line.position.z = ( i * 50 ) - 500;
-					scene.addObject( line );
+					scene.add( line );
 
 					var line = new THREE.Line( geometry, material );
 					line.position.x = ( i * 50 ) - 500;
 					line.rotation.y = 90 * Math.PI / 180;
-					scene.addObject( line );
+					scene.add( line );
 
 				}
 
@@ -75,7 +75,7 @@
 
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000, 20, 20 ), new THREE.MeshFaceMaterial() );
 				plane.rotation.x = - 90 * Math.PI / 180;
-				scene.addObject( plane );
+				scene.add( plane );
 
 				mouse2D = new THREE.Vector3( 0, 10000, 0.5 );
 				ray = new THREE.Ray( camera.position, null );
@@ -83,21 +83,21 @@
 				// Lights
 
 				var ambientLight = new THREE.AmbientLight( 0x606060 );
-				scene.addLight( ambientLight );
+				scene.add( ambientLight );
 
 				var directionalLight = new THREE.DirectionalLight( 0xffffff );
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				var directionalLight = new THREE.DirectionalLight( 0x808080 );
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );
@@ -137,7 +137,7 @@
 
 						if ( intersects[ 0 ].object != plane ) {
 
-							scene.removeObject( intersects[ 0 ].object );
+							scene.remove( intersects[ 0 ].object );
 
 						}
 
@@ -152,7 +152,7 @@
 						voxel.matrixAutoUpdate = false;
 						voxel.updateMatrix();
 						voxel.overdraw = true;
-						scene.addObject( voxel );
+						scene.add( voxel );
 
 					}
 

+ 8 - 8
examples/canvas_lights_pointlights.html

@@ -62,16 +62,16 @@
 
 				scene = new THREE.Scene();
 
-				scene.addLight( new THREE.AmbientLight( 0x00020 ) );
+				scene.add( new THREE.AmbientLight( 0x00020 ) );
 
 				light1 = new THREE.PointLight( 0xff0040, 1, 50 );
-				scene.addLight( light1 );
+				scene.add( light1 );
 
 				light2 = new THREE.PointLight( 0x0040ff, 1, 50 );
-				scene.addLight( light2 );
+				scene.add( light2 );
 
 				light3 = new THREE.PointLight( 0x80ff80, 1, 50 );
-				scene.addLight( light3 );
+				scene.add( light3 );
 
 				var PI2 = Math.PI * 2;
 				var program = function ( context ) {
@@ -85,19 +85,19 @@
 
 				particle1 = new THREE.Particle( new THREE.ParticleCanvasMaterial( { color: 0xff0040, program: program } ) );
 				particle1.scale.x = particle1.scale.y = particle1.scale.z = 0.5;
-				scene.addObject( particle1 );
+				scene.add( particle1 );
 
 				particle2 = new THREE.Particle( new THREE.ParticleCanvasMaterial( { color: 0x0040ff, program: program } ) );
 				particle2.scale.x = particle2.scale.y = particle2.scale.z = 0.5;
-				scene.addObject( particle2 );
+				scene.add( particle2 );
 
 				particle3 = new THREE.Particle( new THREE.ParticleCanvasMaterial( { color: 0x80ff80, program: program } ) );
 				particle3.scale.x = particle3.scale.y = particle3.scale.z = 0.5;
-				scene.addObject( particle3 );
+				scene.add( particle3 );
 
 				mesh = new THREE.Mesh( new WaltHead(), new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading } ) );
 				mesh.overdraw = true;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 8 - 8
examples/canvas_lights_pointlights_smooth.html

@@ -62,16 +62,16 @@
 
 				scene = new THREE.Scene();
 
-				scene.addLight( new THREE.AmbientLight( 0x00020 ) );
+				scene.add( new THREE.AmbientLight( 0x00020 ) );
 
 				light1 = new THREE.PointLight( 0xff0040, 1, 50 );
-				scene.addLight( light1 );
+				scene.add( light1 );
 
 				light2 = new THREE.PointLight( 0x0040ff, 1, 50 );
-				scene.addLight( light2 );
+				scene.add( light2 );
 
 				light3 = new THREE.PointLight( 0x80ff80, 1, 50 );
-				scene.addLight( light3 );
+				scene.add( light3 );
 
 				var PI2 = Math.PI * 2;
 				var program = function ( context ) {
@@ -85,22 +85,22 @@
 
 				particle1 = new THREE.Particle( new THREE.ParticleCanvasMaterial( { color: 0xff0040, program: program } ) );
 				particle1.scale.x = particle1.scale.y = particle1.scale.z = 0.5;
-				scene.addObject( particle1 );
+				scene.add( particle1 );
 
 				particle2 = new THREE.Particle( new THREE.ParticleCanvasMaterial( { color: 0x0040ff, program: program } ) );
 				particle2.scale.x = particle2.scale.y = particle2.scale.z = 0.5;
-				scene.addObject( particle2 );
+				scene.add( particle2 );
 
 				particle3 = new THREE.Particle( new THREE.ParticleCanvasMaterial( { color: 0x80ff80, program: program } ) );
 				particle3.scale.x = particle3.scale.y = particle3.scale.z = 0.5;
-				scene.addObject( particle3 );
+				scene.add( particle3 );
 
 				geometry = new WaltHead();
 				geometry.computeVertexNormals();
 
 				mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.SmoothShading } ) );
 				mesh.overdraw = true;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 2 - 2
examples/canvas_lines.html

@@ -83,7 +83,7 @@
 					particle.position.normalize();
 					particle.position.multiplyScalar( Math.random() * 10 + 450 );
 					particle.scale.x = particle.scale.y = 5;
-					scene.addObject( particle );
+					scene.add( particle );
 
 					geometry.vertices.push( new THREE.Vertex( particle.position ) );
 
@@ -92,7 +92,7 @@
 				// lines
 
 				var line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 0.5 } ) );
-				scene.addObject( line );
+				scene.add( line );
 
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
 				document.addEventListener( 'touchstart', onDocumentTouchStart, false );

+ 2 - 2
examples/canvas_lines_sphere.html

@@ -83,7 +83,7 @@
 					particle.position.z = Math.random() * 2 - 1;
 					particle.position.normalize();
 					particle.position.multiplyScalar( Math.random() * 10 + 450 );
-					scene.addObject( particle );
+					scene.add( particle );
 
 				}
 
@@ -105,7 +105,7 @@
 					geometry.vertices.push( new THREE.Vertex( vector2 ) );
 
 					var line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0xffffff, opacity: Math.random() } ) );
-					scene.addObject( line );
+					scene.add( line );
 				}
 
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );

+ 7 - 7
examples/canvas_materials.html

@@ -53,13 +53,13 @@
 					var line = new THREE.Line( geometry, material );
 					line.position.y = - 120;
 					line.position.z = ( i * 100 ) - 500;
-					scene.addObject( line );
+					scene.add( line );
 
 					var line = new THREE.Line( geometry, material );
 					line.position.x = ( i * 100 ) - 500;
 					line.position.y = - 120;
 					line.rotation.y = 90 * Math.PI / 180;
-					scene.addObject( line );
+					scene.add( line );
 
 				}
 
@@ -107,7 +107,7 @@
 
 					objects.push( sphere );
 
-					scene.addObject( sphere );
+					scene.add( sphere );
 
 				}
 
@@ -123,21 +123,21 @@
 
 				particleLight = new THREE.Particle( new THREE.ParticleCanvasMaterial( { color: 0xffffff, program: program } ) );
 				particleLight.scale.x = particleLight.scale.y = particleLight.scale.z = 4;
-				scene.addObject( particleLight );
+				scene.add( particleLight );
 
 				// Lights
 
-				scene.addLight( new THREE.AmbientLight( Math.random() * 0x202020 ) );
+				scene.add( new THREE.AmbientLight( Math.random() * 0x202020 ) );
 
 				var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				pointLight = new THREE.PointLight( 0xffffff, 1 );
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				renderer = new THREE.CanvasRenderer();
 				// renderer = new THREE.WebGLRenderer();

+ 5 - 5
examples/canvas_materials_depth.html

@@ -79,7 +79,7 @@
 				plane.rotation.x = - 90 * ( Math.PI / 180 );
 				plane.position.y = - 100;
 
-				scene.addObject( plane );
+				scene.add( plane );
 
 				// Spheres
 
@@ -108,24 +108,24 @@
 					cube.scale.x = cube.scale.y = cube.scale.z = Math.random() + 0.5;
 					*/
 
-					scene.addObject(cube);
+					scene.add(cube);
 
 				}
 
 				// Lights
 
 				var ambientLight = new THREE.AmbientLight( Math.random() * 0x202020 );
-				scene.addLight( ambientLight );
+				scene.add( ambientLight );
 
 				var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				var pointLight = new THREE.PointLight( 0xff0000, 1 );
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 1 - 1
examples/canvas_materials_normal.html

@@ -63,7 +63,7 @@
 				object = new THREE.Mesh( new WaltHead(), new THREE.MeshNormalMaterial() );
 				object.overdraw = true;
 				object.scale.x = object.scale.y = object.scale.z = 10;
-				scene.addObject( object );
+				scene.add( object );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 1 - 1
examples/canvas_materials_reflection.html

@@ -68,7 +68,7 @@
 
 				mesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { envMap: THREE.ImageUtils.loadTexture( 'textures/metal.jpg', new THREE.SphericalReflectionMapping() ) } ) );
 				mesh.overdraw = true;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 3 - 3
examples/canvas_materials_video.html

@@ -109,7 +109,7 @@
 				mesh = new THREE.Mesh( plane, material );
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 1.5;
 				mesh.overdraw = true;
-				scene.addObject(mesh);
+				scene.add(mesh);
 
 				mesh = new THREE.Mesh( plane, materialReflection );
 				mesh.position.y = -306;
@@ -117,7 +117,7 @@
 				mesh.rotation.x = 180 * Math.PI / 180;
 				mesh.doubleSided = true;
 				mesh.overdraw = true;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				//
 
@@ -148,7 +148,7 @@
 						particle.position.x = ix * separation - ( ( amountx * separation ) / 2 );
 						particle.position.y = -153
 						particle.position.z = iy * separation - ( ( amounty * separation ) / 2 );
-						scene.addObject( particle );
+						scene.add( particle );
 
 					}
 				}

+ 1 - 1
examples/canvas_particles_floor.html

@@ -71,7 +71,7 @@
 						particle = new THREE.Particle( material );
 						particle.position.x = ix * SEPARATION - ( ( AMOUNTX * SEPARATION ) / 2 );
 						particle.position.z = iy * SEPARATION - ( ( AMOUNTY * SEPARATION ) / 2 );
-						scene.addObject( particle );
+						scene.add( particle );
 					}
 				}
 

+ 2 - 2
examples/canvas_particles_random.html

@@ -56,7 +56,7 @@
 				}
 
 				group = new THREE.Object3D();
-				scene.addObject( group );
+				scene.add( group );
 
 				for ( var i = 0; i < 1000; i++ ) {
 
@@ -65,7 +65,7 @@
 					particle.position.y = Math.random() * 2000 - 1000;
 					particle.position.z = Math.random() * 2000 - 1000;
 					particle.scale.x = particle.scale.y = Math.random() * 10 + 5;
-					group.addChild( particle );
+					group.add( particle );
 				}
 
 				renderer = new THREE.CanvasRenderer();

+ 5 - 5
examples/canvas_particles_shapes.html

@@ -115,14 +115,14 @@
 				text.overdraw = true;
 
 				parent = new THREE.Object3D();
-                parent.addChild( text );
+                parent.add( text );
 
 				
 				particleCloud = new THREE.Object3D(); // Just a group
 				particleCloud.y = 800;
-				parent.addChild( particleCloud );
+				parent.add( particleCloud );
 				
-				scene.addObject( parent );
+				scene.add( parent );
 				
 				
 				// Create Particle Systems
@@ -184,7 +184,7 @@
 					particle = new THREE.Particle( material );
 
 					particle.scale.x = particle.scale.y = Math.random() * 20 +20;
-					particleCloud.addChild( particle );	
+					particleCloud.add( particle );	
 
 					return particle;
 				};
@@ -196,7 +196,7 @@
 			
 				var onParticleDead = function(particle) {
 					particle.target.visible = false;
-					particleCloud.removeChild(particle.target); 
+					particleCloud.remove(particle.target); 
 				};
 				
 				

+ 1 - 1
examples/canvas_particles_sprites.html

@@ -54,7 +54,7 @@
 
 					initParticle( particle, i * 10 );
 
-					scene.addObject( particle );
+					scene.add( particle );
 				}
 
 				renderer = new THREE.CanvasRenderer();

+ 1 - 1
examples/canvas_particles_waves.html

@@ -75,7 +75,7 @@
 						particle = particles[ i ++ ] = new THREE.Particle( material );
 						particle.position.x = ix * SEPARATION - ( ( AMOUNTX * SEPARATION ) / 2 );
 						particle.position.z = iy * SEPARATION - ( ( AMOUNTY * SEPARATION ) / 2 );
-						scene.addObject( particle );
+						scene.add( particle );
 
 					}
 

+ 6 - 6
examples/canvas_performance.html

@@ -63,12 +63,12 @@
 
 					var line = new THREE.Line( geometry, material );
 					line.position.z = ( i * 100 ) - 500;
-					scene.addObject( line );
+					scene.add( line );
 
 					var line = new THREE.Line( geometry, material );
 					line.position.x = ( i * 100 ) - 500;
 					line.rotation.y = 90 * Math.PI / 180;
-					scene.addObject( line );
+					scene.add( line );
 
 				}
 
@@ -85,23 +85,23 @@
 					sphere.position.x = ( i % 5 ) * 200 - 400;
 					sphere.position.z = Math.floor( i / 5 ) * 200 - 400;
 
-					scene.addObject( sphere );
+					scene.add( sphere );
 
 				}
 
 				// Lights
 
 				var ambientLight = new THREE.AmbientLight( Math.random() * 0x202020 );
-				scene.addLight( ambientLight );
+				scene.add( ambientLight );
 
 				var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
 				directionalLight.position.x = 0;
 				directionalLight.position.y = 1;
 				directionalLight.position.z = 0;
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				var pointLight = new THREE.PointLight( 0xff0000, 1, 500 );
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 6 - 6
examples/canvas_sandbox.html

@@ -178,12 +178,12 @@
 
 					var line = new THREE.Line( geometry, material );
 					line.position.z = ( i * 100 ) - 500;
-					scene.addObject( line );
+					scene.add( line );
 
 					var line = new THREE.Line( geometry, material );
 					line.position.x = ( i * 100 ) - 500;
 					line.rotation.y = 90 * Math.PI / 180;
-					scene.addObject( line );
+					scene.add( line );
 
 				}
 
@@ -211,24 +211,24 @@
 
 					objects.push( sphere );
 
-					scene.addObject( sphere );
+					scene.add( sphere );
 
 				}
 
 				// Lights
 
 				var ambientLight = new THREE.AmbientLight( Math.random() * 0x202020 );
-				scene.addLight( ambientLight );
+				scene.add( ambientLight );
 
 				var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				pointLight = new THREE.PointLight( 0xff0000, 1 );
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 5 - 5
examples/misc_camera_path.html

@@ -102,24 +102,24 @@
 									  
 					mesh.updateMatrix();
 					mesh.matrixAutoUpdate = false;
-					scene.addChild( mesh );
+					scene.add( mesh );
 					
 				}
 
-				scene.addObject( camera.animationParent );
+				scene.add( camera.animationParent );
 
 				// lights				
 
 				light = new THREE.DirectionalLight( 0xffffff );
 				light.position.set( 1, 1, 1 );
-				scene.addChild( light );
+				scene.add( light );
 
 				light = new THREE.DirectionalLight( 0x002288 );
 				light.position.set( -1, -1, -1 );
-				scene.addChild( light );
+				scene.add( light );
 
 				light = new THREE.AmbientLight( 0x222222 );
-				scene.addChild( light );
+				scene.add( light );
 
 
 				// renderer

+ 9 - 9
examples/misc_camera_roll.html

@@ -85,7 +85,7 @@
 									  
 					mesh.updateMatrix();
 					mesh.matrixAutoUpdate = false;
-					scene.addChild( mesh );
+					scene.add( mesh );
 					
 				}
 
@@ -100,37 +100,37 @@
 				var material = new THREE.MeshPhongMaterial( { color:0xff0000 } );
 				var mesh = new THREE.Mesh( new THREE.Cube( 40, 5, 5 ), material );
 				mesh.position.x = 20;
-				cross.addChild( mesh );
+				cross.add( mesh );
 
 				var material = new THREE.MeshPhongMaterial( { color:0x00ff00 } );
 				var mesh = new THREE.Mesh( new THREE.Cube( 5, 40, 5 ), material );
 				mesh.position.y = 20;
-				cross.addChild( mesh );
+				cross.add( mesh );
 
 				var material = new THREE.MeshPhongMaterial( { color:0x0000ff } );
 				var mesh = new THREE.Mesh( new THREE.Cube( 5, 5, 40 ), material );
 				mesh.position.z = 20;
 				
-				cross.addChild( mesh );
-				camera.addChild( cross );
+				cross.add( mesh );
+				camera.add( cross );
 
 				*/
 				
-				scene.addChild( camera );
+				scene.add( camera );
 
 
 				// lights				
 
 				light = new THREE.DirectionalLight( 0xffffff );
 				light.position.set( 1, 1, 1 );
-				scene.addChild( light );
+				scene.add( light );
 
 				light = new THREE.DirectionalLight( 0x002288 );
 				light.position.set( -1, -1, -1 );
-				scene.addChild( light );
+				scene.add( light );
 
 				light = new THREE.AmbientLight( 0x222222 );
-				scene.addChild( light );
+				scene.add( light );
 
 
 				// renderer

+ 8 - 8
examples/misc_camera_trackball.html

@@ -102,7 +102,7 @@
 									  
 					mesh.updateMatrix();
 					mesh.matrixAutoUpdate = false;
-					scene.addChild( mesh );
+					scene.add( mesh );
 					
 				}
 
@@ -117,19 +117,19 @@
 				var material = new THREE.MeshPhongMaterial( { color:0xff0000 } );
 				var mesh = new THREE.Mesh( new THREE.Cube( 40, 5, 5 ), material );
 				mesh.position.x = 20;
-				cross.addChild( mesh );
+				cross.add( mesh );
 
 				var material = new THREE.MeshPhongMaterial( { color:0x00ff00 } );
 				var mesh = new THREE.Mesh( new THREE.Cube( 5, 40, 5 ), material );
 				mesh.position.y = 20;
-				cross.addChild( mesh );
+				cross.add( mesh );
 
 				var material = new THREE.MeshPhongMaterial( { color:0x0000ff } );
 				var mesh = new THREE.Mesh( new THREE.Cube( 5, 5, 40 ), material );
 				mesh.position.z = 20;
 
-				cross.addChild( mesh );
-				camera.addChild( cross );
+				cross.add( mesh );
+				camera.add( cross );
 				*/
 
 
@@ -137,14 +137,14 @@
 
 				light = new THREE.DirectionalLight( 0xffffff );
 				light.position.set( 1, 1, 1 );
-				scene.addChild( light );
+				scene.add( light );
 
 				light = new THREE.DirectionalLight( 0x002288 );
 				light.position.set( -1, -1, -1 );
-				scene.addChild( light );
+				scene.add( light );
 
 				light = new THREE.AmbientLight( 0x222222 );
-				scene.addChild( light );
+				scene.add( light );
 
 
 				// renderer

+ 7 - 7
examples/misc_lights_test.html

@@ -101,7 +101,7 @@
 					mesh.position.z = 500 * ( Math.random() - 0.5 );
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = 0.25 * ( Math.random() + 0.5 );
 					mesh.overdraw = true;
-					scene.addObject( mesh );
+					scene.add( mesh );
 
 				}
 
@@ -109,30 +109,30 @@
 
 				mesh = new THREE.Mesh( new THREE.TorusGeometry( 100, 25, 15, 30 ), new THREE.MeshLambertMaterial( { color: 0xffffff } ) );
 				mesh.overdraw = true;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				// Lights
 
 				var ambient = new THREE.AmbientLight( 0x101010 );
-				scene.addLight( ambient );
+				scene.add( ambient );
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff );
 				directionalLight.position.y = -70;
 				directionalLight.position.z = 100;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				pointLight = new THREE.PointLight( 0xffaa00 );
 				pointLight.position.x = 0;
 				pointLight.position.y = 0;
 				pointLight.position.z = 0;
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				lightMesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 0xffaa00 } ) );
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;
 				lightMesh.position = pointLight.position;
 				lightMesh.overdraw = true;
-				scene.addObject(lightMesh);
+				scene.add(lightMesh);
 
 
 				if ( render_canvas ) {
@@ -193,7 +193,7 @@
 
 			function render() {
 
-				counter == 30 ? scene.removeLight( directionalLight ) : counter ++;
+				counter == 30 ? scene.remove( directionalLight ) : counter ++;
 
 				camera.position.x += ( mouseX - camera.position.x ) * .05;
 				camera.position.y += ( - mouseY - camera.position.y ) * .05;

+ 2 - 2
examples/misc_lookat.html

@@ -68,7 +68,7 @@
 				var material = new THREE.MeshNormalMaterial( { shading: THREE.SmoothShading } );
 
 				target = new THREE.Mesh( new THREE.SphereGeometry( 100, 20, 20 ), material );
-				scene.addObject( target );
+				scene.add( target );
 
 				for ( var i = 0; i < 1000; i ++ ) {
 
@@ -77,7 +77,7 @@
 					mesh.position.y = Math.random() * 4000 - 2000;
 					mesh.position.z = Math.random() * 4000 - 2000;
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = Math.random() * 4 + 2;
-					scene.addObject( mesh );
+					scene.add( mesh );
 
 				}
 

+ 9 - 15
examples/misc_materials_multimaterials.html

@@ -60,7 +60,7 @@
 
 			var mesh, zmesh, geometry;
 
-			var directionalLight, pointLight;
+			var directionalLight;
 
 			var mouseX = 0;
 			var mouseY = 0;
@@ -108,7 +108,7 @@
 					mesh.position.y = 500 * ( Math.random() - 0.5 );
 					mesh.position.z = 500 * ( Math.random() - 0.5 );
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = 0.25 * (Math.random() + 0.5);
-					scene.addObject(mesh);
+					scene.add(mesh);
 
 				}
 
@@ -116,24 +116,18 @@
 				// LIGHTS
 
 				var ambient = new THREE.AmbientLight( 0x101010 );
-				scene.addLight( ambient );
+				scene.add( ambient );
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff );
 				directionalLight.position.y = -70;
 				directionalLight.position.z = 100;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
-
-				pointLight = new THREE.PointLight( 0xffaa00 );
-				pointLight.position.x = 0;
-				pointLight.position.y = 0;
-				pointLight.position.z = 120;
-				//scene.addLight( pointLight );
+				scene.add( directionalLight );
 
 				mesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xff0000 } ) );
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 0.1;
-				mesh.position = pointLight.position;
-				scene.addObject(mesh);
+				mesh.position.set( 0, 0, 120 );
+				scene.add(mesh);
 
 				if ( render_gl ) {
 					try {
@@ -230,7 +224,7 @@
 				zmesh.scale.x = zmesh.scale.y = zmesh.scale.z = 3;
 				zmesh.overdraw = true;
 				zmesh.updateMatrix();
-				scene.addObject(zmesh);
+				scene.add(zmesh);
 
 				// PLANES with all materials from the model
 
@@ -250,7 +244,7 @@
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = 1;
 					mesh.doubleSided = true;
 					mesh.updateMatrix();
-					scene.addObject(mesh);
+					scene.add(mesh);
 
 					// number
 					var x = document.createElement( "canvas" );
@@ -272,7 +266,7 @@
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = 1;
 					mesh.doubleSided = true;
 					mesh.updateMatrix();
-					scene.addObject(mesh);
+					scene.add(mesh);
 				}
 
 			}

+ 4 - 4
examples/misc_sound.html

@@ -118,7 +118,7 @@
 				light = new THREE.DirectionalLight( 0xffffff );
 				light.position.set( 0, 0.5, 1 );
 				light.position.normalize();
-				scene.addLight( light );
+				scene.add( light );
 
 				var sphere = new THREE.SphereGeometry( 20, 32, 16 );
 
@@ -136,7 +136,7 @@
 				var mesh1 = new THREE.Mesh( sphere, material_sphere1 );
 				mesh1.position.set( -250, 30, 0 );
 				mesh1.scale.set( s, s, s );
-				scene.addObject( mesh1 );
+				scene.add( mesh1 );
 
 				sound1 = new Sound( [ 'sounds/358232_j_s_song.mp3', 'sounds/358232_j_s_song.ogg' ], 275, 1 );
 				sound1.position.copy( mesh1.position );
@@ -147,7 +147,7 @@
 				var mesh2 = new THREE.Mesh( sphere, material_sphere2 );
 				mesh2.position.set( 250, 30, 0 );
 				mesh2.scale.set( s, s, s );
-				scene.addObject( mesh2 );
+				scene.add( mesh2 );
 
 				sound2 = new Sound( [ 'sounds/376737_Skullbeatz___Bad_Cat_Maste.mp3', 'sounds/376737_Skullbeatz___Bad_Cat_Maste.ogg' ], 275, 1 );
 				sound2.position.copy( mesh2.position );
@@ -164,7 +164,7 @@
 				mesh = new THREE.Mesh( plane, material_wireframe );
 				mesh.position.y = 0.1;
 				mesh.rotation.x = -1.57;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 
 				renderer = new THREE.WebGLRenderer( { clearColor: 0x000000, clearAlpha: 1, antialias: false } );

+ 19 - 16
examples/misc_ubiquity_test.html

@@ -27,6 +27,7 @@
 		<script type="text/javascript" src="../src/core/Matrix3.js"></script>
 		<script type="text/javascript" src="../src/core/Matrix4.js"></script>
 		<script type="text/javascript" src="../src/core/Object3D.js"></script>
+		<script type="text/javascript" src="../src/core/Projector.js"></script>
 		<script type="text/javascript" src="../src/core/Quaternion.js"></script>
 		<script type="text/javascript" src="../src/core/Vertex.js"></script>
 		<script type="text/javascript" src="../src/core/Face3.js"></script>
@@ -36,6 +37,7 @@
 		<script type="text/javascript" src="../src/core/Spline.js"></script>
 		<script type="text/javascript" src="../src/core/Edge.js"></script>
 		<script type="text/javascript" src="../src/cameras/Camera.js"></script>
+		<script type="text/javascript" src="../src/cameras/OrthoCamera.js"></script>
 		<script type="text/javascript" src="../src/lights/Light.js"></script>
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
@@ -67,7 +69,6 @@
 		<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/FogExp2.js"></script>
-		<script type="text/javascript" src="../src/renderers/Projector.js"></script>
 		<script type="text/javascript" src="../src/renderers/DOMRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/CanvasRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/SVGRenderer.js"></script>
@@ -86,6 +87,11 @@
 		<script type="text/javascript" src="../src/extras/ImageUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/SceneUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/ShaderUtils.js"></script>
+		<script type="text/javascript" src="../src/extras/core/Curve.js"></script>
+		<script type="text/javascript" src="../src/extras/core/CurvePath.js"></script>
+		<script type="text/javascript" src="../src/extras/core/Path.js"></script>
+		<script type="text/javascript" src="../src/extras/core/Shape.js"></script>
+		<script type="text/javascript" src="../src/extras/core/TextPath.js"></script>
 		<script type="text/javascript" src="../src/extras/animation/AnimationHandler.js"></script>
 		<script type="text/javascript" src="../src/extras/animation/Animation.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/FirstPersonCamera.js"></script>
@@ -94,11 +100,6 @@
 		<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/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/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/CylinderGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/geometries/ExtrudeGeometry.js"></script>
@@ -110,8 +111,9 @@
 		<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/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/ColladaLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/loaders/JSONLoader.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>
@@ -163,7 +165,7 @@
 
 				qrcode = mesh = new THREE.Mesh( new Qrcode(), new THREE.MeshFaceMaterial() );
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				// CUBES
 
@@ -174,7 +176,7 @@
 				mesh.rotation.x = Math.random();
 				mesh.rotation.y = Math.random();
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				mesh = new THREE.Mesh( cube, new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } ) );
 				mesh.position.x = 500;
@@ -182,7 +184,7 @@
 				mesh.rotation.x = Math.random();
 				mesh.rotation.y = Math.random();
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				// PLANE
 
@@ -190,14 +192,15 @@
 				mesh.position.y = -500;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
 				mesh.doubleSided = true;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				// CYLINDER
 
-				mesh = new THREE.Mesh( new THREE.CylinderGeometry( 10, 20, 100, 200, - 50, - 20 ), new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } ) );
+				mesh = new THREE.Mesh( new THREE.CylinderGeometry( 20, 100, 200, 10 ), new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } ) );
 				mesh.position.x = -500;
+				mesh.rotation.x = - Math.PI / 2;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				// POLYFIELD
 
@@ -226,16 +229,16 @@
 				mesh = new THREE.Mesh( geometry, [ new THREE.MeshFaceMaterial(), new THREE.MeshBasicMaterial( { color: 0xff0000, opacity: 0.5, transparent: true, wireframe: true, wireframeLinewidth: 10 } ) ] );
 				mesh.doubleSided = true;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 
 				// LIGHTS
 
 				var ambient = new THREE.AmbientLight( 0x80ffff );
-				scene.addLight( ambient );
+				scene.add( ambient );
 
 				var directional = new THREE.DirectionalLight( 0xffff00 );
-				scene.addLight( directional );
+				scene.add( directional );
 
 				canvasRenderer = new THREE.CanvasRenderer();
 				canvasRenderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );

+ 7 - 9
examples/scenes/test_scene.js

@@ -73,7 +73,7 @@ var scene = {
 		"geometry" : "cone",
 		"materials": [ "lambert_blue" ],
 		"position" : [ -50, 15, -50 ],
-		"rotation" : [ 1.57, 0, 0 ],
+		"rotation" : [ 0, 0, 0 ],
 		"scale"	   : [ 1, 1, 1 ],
 		"visible"  : true
 	},
@@ -82,7 +82,7 @@ var scene = {
 		"geometry" : "cylinder",
 		"materials": [ "lambert_blue" ],
 		"position" : [ 50, 15, -50 ],
-		"rotation" : [ 1.57, 0, 0 ],
+		"rotation" : [ 0, 0, 0 ],
 		"scale"	   : [ 1, 1, 1 ],
 		"visible"  : true
 	},
@@ -186,22 +186,20 @@ var scene = {
 	
 	"cylinder": {
 		"type"    : "cylinder",
-		"numSegs"  : 32, 
 		"topRad"   : 5, 
 		"botRad"   : 5,
 		"height"   : 50,
-		"topOffset": 0,
-		"botOffset": 0
+		"radSegs"  : 32, 
+		"heightSegs": 1
 	},
 
 	"cone": {
 		"type"    : "cylinder",
-		"numSegs"  : 32, 
 		"topRad"   : 0, 
 		"botRad"   : 5,
 		"height"   : 50,
-		"topOffset": 0,
-		"botOffset": 0
+		"radSegs"  : 32, 
+		"heightSegs" : 1
 	},
 	
 	"WaltHead": {
@@ -492,4 +490,4 @@ var scene = {
 };
 
 postMessage( scene );
-close();
+close();

+ 4 - 4
examples/webgl_animation_skinning.html

@@ -86,7 +86,7 @@
 				light = new THREE.DirectionalLight( 0xffffff, 1.5 );
 				light.position.set( 0, 1, 1 );
 				light.position.normalize();
-				scene.addLight( light );
+				scene.add( light );
 
 				var planeSimple = new THREE.PlaneGeometry( 200, 300 );
 				var planeTesselated = new THREE.PlaneGeometry( 100, 300, 25, 40 );
@@ -98,12 +98,12 @@
 				floor.position.y = -10;
 				floor.rotation.x = -1.57;
 				floor.scale.set( 25, 25, 25 );
-				scene.addObject( floor );
+				scene.add( floor );
 
 				floor = new THREE.Mesh( planeTesselated, matWire );
 				floor.rotation.x = -1.57;
 				floor.scale.set( 25, 25, 25 );
-				scene.addObject( floor );
+				scene.add( floor );
 
 				renderer = new THREE.WebGLRenderer( { clearColor: 0xffffff, clearAlpha: 1 } );
 				renderer.setSize( window.innerWidth, height );
@@ -161,7 +161,7 @@
 						buffalo.position.y = buffalo.boundRadius * 0.5;
 						buffalo.rotation.y = 0.2 - Math.random() * 0.4;
 
-						scene.addObject( buffalo );
+						scene.add( buffalo );
 
 						buffalos.push( buffalo );
 

+ 6 - 6
examples/webgl_collada.html

@@ -76,29 +76,29 @@
 				}
 
 				var line = new THREE.Line( geometry, line_material, THREE.LinePieces );
-				scene.addObject( line );
+				scene.add( line );
 
 				// Add the COLLADA
 
-				scene.addObject( dae );
+				scene.add( dae );
 
 				particleLight = new THREE.Mesh( new THREE.SphereGeometry( 4, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xffffff } ) );
-				scene.addObject( particleLight );
+				scene.add( particleLight );
 
 				// Lights
 
-				scene.addLight( new THREE.AmbientLight( 0xcccccc ) );
+				scene.add( new THREE.AmbientLight( 0xcccccc ) );
 
 				var directionalLight = new THREE.DirectionalLight(/*Math.random() * 0xffffff*/0xeeeeee );
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				pointLight = new THREE.PointLight( 0xffffff, 4 );
 				pointLight.position.x = 10000;
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 3 - 3
examples/webgl_collisions_box.html

@@ -68,11 +68,11 @@ function init() {
 	container.appendChild(renderer.domElement);
 
 	var ambientLight = new THREE.AmbientLight( 0x606060 );
-	scene.addLight( ambientLight );
+	scene.add( ambientLight );
 
 	sun = new THREE.DirectionalLight( 0xffffff );
 	sun.position = camera.position.clone();
-	scene.addLight( sun );
+	scene.add( sun );
 
 	createCube( 200, new THREE.Vector3( 0,0,0 ) );
 
@@ -94,7 +94,7 @@ function createCube( s, p ) {
 	);
 
 	cube.position = p;
-	scene.addObject( cube );
+	scene.add( cube );
 
 	THREE.Collisions.colliders.push( THREE.CollisionUtils.MeshOBB( cube ) );
 

+ 3 - 3
examples/webgl_collisions_mesh.html

@@ -76,11 +76,11 @@ function init() {
 	container.appendChild( renderer.domElement );
 	
 	var ambientLight = new THREE.AmbientLight( 0x606060 );
-	scene.addLight( ambientLight );
+	scene.add( ambientLight );
 
 	sun = new THREE.DirectionalLight( 0xffffff );
 	sun.position = camera.position.clone();
-	scene.addLight( sun );
+	scene.add( sun );
 	
 	loadCube();
 
@@ -174,7 +174,7 @@ function addCube( p, g) {
 	//mesh.scale.y = Math.random() + 0.5;
 	//mesh.scale.z = Math.random() + 0.5;
 	
-	scene.addObject( mesh );
+	scene.add( mesh );
 	var mc = THREE.CollisionUtils.MeshColliderWBox(mesh);
 	THREE.Collisions.colliders.push( mc );
 	meshes.push( mesh );

+ 4 - 4
examples/webgl_collisions_normal.html

@@ -76,11 +76,11 @@ function init() {
 	container.appendChild( renderer.domElement );
 	
 	var ambientLight = new THREE.AmbientLight( 0x606060 );
-	scene.addLight( ambientLight );
+	scene.add( ambientLight );
 
 	sun = new THREE.DirectionalLight( 0xffffff );
 	sun.position = camera.position.clone();
-	scene.addLight( sun );
+	scene.add( sun );
 	
 	loadCube();
 	
@@ -91,7 +91,7 @@ function init() {
 	geom.vertices.push( new THREE.Vertex( new THREE.Vector3( 100, 0, 0) ) );
 	
 	line = new THREE.Line(geom, lineMat);
-	scene.addObject( line );
+	scene.add( line );
 
 	stats = new Stats();
 	stats.domElement.style.position = 'absolute';
@@ -127,7 +127,7 @@ function addCube( p, g) {
 	var mesh = new THREE.Mesh( g, new THREE.MeshLambertMaterial( { color: 0x003300 } ) );
 	mesh.position = p;
 
-	scene.addObject( mesh );
+	scene.add( mesh );
 	var mc = THREE.CollisionUtils.MeshColliderWBox(mesh);
 	THREE.Collisions.colliders.push( mc );
 	meshes.push( mesh );

+ 5 - 5
examples/webgl_collisions_primitives.html

@@ -73,10 +73,10 @@
                 container.appendChild(renderer.domElement);
 
                 var ambientLight = new THREE.AmbientLight(0x606060);
-                scene.addLight(ambientLight);
+                scene.add(ambientLight);
 
                 sun = new THREE.DirectionalLight(0xffffff);
-                scene.addLight(sun);
+                scene.add(sun);
 
                 //makeWall(480);
                 //makeWall(360);
@@ -91,7 +91,7 @@
                 plane = new THREE.Mesh( new THREE.PlaneGeometry( 30000, 30000, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0x003300 } ) );
                 plane.position.y = - 480;
                 plane.rotation.x = Math.PI / - 2;
-                scene.addObject( plane );
+                scene.add( plane );
                 geoms.push( plane );
 
                 var cplane = new THREE.PlaneCollider( plane.position, new THREE.Vector3( 0, 1, 0 ) );
@@ -123,7 +123,7 @@
             function createCube(s, p){
                 var cube = new THREE.Mesh(new THREE.CubeGeometry( s, s, s ), new THREE.MeshLambertMaterial( { color: 0x003300 } ) );
                 cube.position = p;
-                scene.addObject(cube);
+                scene.add(cube);
                 geoms.push(cube);
                 THREE.Collisions.colliders.push(THREE.CollisionUtils.MeshAABB(cube, p));
             }
@@ -131,7 +131,7 @@
             function createSphere(rad, p){
                 var sphere = new THREE.Mesh( new THREE.SphereGeometry( rad, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0x003300 } ) );
                 sphere.position = p;
-                scene.addObject(sphere);
+                scene.add(sphere);
                 geoms.push(sphere);
 
                 var sc = new THREE.SphereCollider(p, rad);

+ 5 - 5
examples/webgl_collisions_reaction.html

@@ -74,18 +74,18 @@
                 scene = new THREE.Scene();
 
                 sphere = new THREE.Mesh( new THREE.SphereGeometry( sphereSize, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0xff0000 } ) );
-                scene.addObject( sphere );
+                scene.add( sphere );
 
                 renderer = new THREE.WebGLRenderer();
                 renderer.setSize(window.innerWidth, window.innerHeight);
                 container.appendChild(renderer.domElement);
 
                 var ambientLight = new THREE.AmbientLight(0xdddddd);
-                scene.addLight(ambientLight);
+                scene.add(ambientLight);
 
                 sun = new THREE.DirectionalLight(0xffffff);
                 sun.position = new THREE.Vector3(1, -1, 1).normalize();
-                scene.addLight(sun);
+                scene.add(sun);
 
                 createObstacles();
 
@@ -93,7 +93,7 @@
 				geometry.vertices.push( new THREE.Vertex( new THREE.Vector3(0,  0,  0) ) );
 				geometry.vertices.push( new THREE.Vertex( new THREE.Vector3(10, 0,  0) ) );
 				debugNormal = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0xff0000 } ) );
-				scene.addObject( debugNormal );
+				scene.add( debugNormal );
 
                 container.onmousemove = onDocumentMouseMove;
                 animate();
@@ -110,7 +110,7 @@
                 var cube = new THREE.Mesh( new THREE.CubeGeometry( sx, sy, sz ), new THREE.MeshLambertMaterial( { color: 0x003300 } ) );
                 cube.position = p;
 		cube.rotation.y = ry;
-                scene.addObject(cube);
+                scene.add(cube);
                 THREE.Collisions.colliders.push( THREE.CollisionUtils.MeshOBB(cube) );
 				cubes.push(cube);
 				return cube;

+ 4 - 4
examples/webgl_collisions_terrain.html

@@ -69,18 +69,18 @@ function init() {
 	ray.direction = new THREE.Vector3(0, -1, 0);
 
 	sphere = new THREE.Mesh( new THREE.SphereGeometry( sphereSize, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0xff0000 } ) );
-	scene.addObject(sphere);
+	scene.add(sphere);
 
 	renderer = new THREE.WebGLRenderer();
 	renderer.setSize( window.innerWidth, window.innerHeight );
 	container.appendChild(renderer.domElement);
 
 	var ambientLight = new THREE.AmbientLight( 0x444444 );
-	scene.addLight( ambientLight );
+	scene.add( ambientLight );
 
 	sun = new THREE.DirectionalLight( 0xaaaaaa );
 	sun.position = new THREE.Vector3(-1,1, -1).normalize();
-	scene.addLight( sun );
+	scene.add( sun );
 
 	loadCube();
 
@@ -93,7 +93,7 @@ function init() {
 function loadCube(p) {
 	var onGeometry = function( geometry ) {
 		var mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0xf3e4b8 } ) );
-		scene.addObject( mesh );
+		scene.add( mesh );
 		THREE.Collisions.colliders.push( THREE.CollisionUtils.MeshColliderWBox(mesh) );
 	};
 

+ 4 - 4
examples/webgl_collisions_trigger.html

@@ -74,18 +74,18 @@
                 scene = new THREE.Scene();
 
                 sphere = new THREE.Mesh( new THREE.SphereGeometry( sphereSize, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0xff0000 } ) );
-                scene.addObject( sphere );
+                scene.add( sphere );
 
                 renderer = new THREE.WebGLRenderer();
                 renderer.setSize(window.innerWidth, window.innerHeight);
                 container.appendChild(renderer.domElement);
 
                 var ambientLight = new THREE.AmbientLight(0xdddddd);
-                scene.addLight(ambientLight);
+                scene.add(ambientLight);
 
                 sun = new THREE.DirectionalLight(0xffffff);
                 sun.position = new THREE.Vector3(1, -1, 1).normalize();
-                scene.addLight(sun);
+                scene.add(sun);
 
                 createObstacles();
 
@@ -102,7 +102,7 @@
             function createCube(sx, sy, sz, p){
                 var cube = new THREE.Mesh(new THREE.CubeGeometry( sx, sy, sz ), new THREE.MeshLambertMaterial( { color: 0x003300 } ) );
                 cube.position = p;
-                scene.addObject(cube);
+                scene.add(cube);
                 THREE.Collisions.colliders.push( THREE.CollisionUtils.MeshOBB(cube) );
 				cubes.push(cube);
 				return cube;

+ 1 - 1
examples/webgl_custom_attributes.html

@@ -149,7 +149,7 @@
 
 			}
 
-			scene.addChild( sphere );
+			scene.add( sphere );
 
 			renderer = new THREE.WebGLRenderer( { clearColor: 0x050505, clearAlpha: 1 } );
 			renderer.setSize( WIDTH, HEIGHT );

+ 2 - 2
examples/webgl_custom_attributes_particles.html

@@ -165,7 +165,7 @@
 
 			}
 
-			scene.addChild( sphere );
+			scene.add( sphere );
 
 			renderer = new THREE.WebGLRenderer( { clearColor: 0x000000, clearAlpha: 1 } );
 			renderer.setSize( WIDTH, HEIGHT );
@@ -221,4 +221,4 @@
 
 </body>
 
-</html>
+</html>

+ 2 - 2
examples/webgl_custom_attributes_particles2.html

@@ -162,7 +162,7 @@
 
 			}
 
-			scene.addChild( sphere );
+			scene.add( sphere );
 
 			renderer = new THREE.WebGLRenderer( { clearColor: 0x000000, clearAlpha: 1 } );
 			renderer.setSize( WIDTH, HEIGHT );
@@ -220,4 +220,4 @@
 
 </body>
 
-</html>
+</html>

+ 2 - 2
examples/webgl_custom_attributes_particles3.html

@@ -221,7 +221,7 @@
 
 			console.log( vertices.length );
 
-			scene.addObject( object );
+			scene.add( object );
 
 			renderer = new THREE.WebGLRenderer( { clearColor: 0x000000, clearAlpha: 1 } );
 			renderer.setSize( WIDTH, HEIGHT );
@@ -279,4 +279,4 @@
 
 </body>
 
-</html>
+</html>

+ 6 - 6
examples/webgl_flycamera_earth.html

@@ -106,10 +106,10 @@
         dirLight = new THREE.DirectionalLight( 0xffffff );
         dirLight.position.set( -1, 0, 1 );
         dirLight.position.normalize();
-        scene.addLight( dirLight );
+        scene.add( dirLight );
 
 		ambientLight = new THREE.AmbientLight( 0x000000 );
-		scene.addLight( ambientLight );
+		scene.add( ambientLight );
 
 		var planetTexture   = THREE.ImageUtils.loadTexture( "textures/planets/earth_atmos_2048.jpg" );
 		var cloudsTexture   = THREE.ImageUtils.loadTexture( "textures/planets/earth_clouds_1024.png" );
@@ -148,7 +148,7 @@
         meshPlanet = new THREE.Mesh( geometry, materialNormalMap );
 		meshPlanet.rotation.y = 1.3;
 		meshPlanet.rotation.z = tilt;
-        scene.addObject( meshPlanet );
+        scene.add( meshPlanet );
 
 		// clouds
 
@@ -157,7 +157,7 @@
 		meshClouds = new THREE.Mesh( geometry, materialClouds );
 		meshClouds.scale.set( cloudsScale, cloudsScale, cloudsScale );
 		meshClouds.rotation.z = tilt;
-        scene.addObject( meshClouds );
+        scene.add( meshClouds );
 
 		// moon
 
@@ -166,7 +166,7 @@
         meshMoon = new THREE.Mesh( geometry, materialMoon );
 		meshMoon.position.set( radius * 5, 0, 0 );
 		meshMoon.scale.set( moonScale, moonScale, moonScale );
-        scene.addObject( meshMoon );
+        scene.add( meshMoon );
 
 		// stars
 
@@ -214,7 +214,7 @@
 			stars.matrixAutoUpdate = false;
 			stars.updateMatrix();
 
-			scene.addObject( stars );
+			scene.add( stars );
 
 		}
 

+ 12 - 12
examples/webgl_geometries.html

@@ -49,11 +49,11 @@
 
 				var light, object, material;
 
-				scene.addLight( new THREE.AmbientLight( 0x404040 ) );
+				scene.add( new THREE.AmbientLight( 0x404040 ) );
 
 				light = new THREE.DirectionalLight( 0xffffff, 1 );
 				light.position.z = 1;
-				scene.addLight( light );
+				scene.add( light );
 
 				material = [
 					new THREE.MeshLambertMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/UV.jpg' ) } ),
@@ -63,25 +63,25 @@
 				objects[ 0 ] = object = new THREE.Mesh( new THREE.CubeGeometry( 100, 100, 100, 4, 4, 4 ), material );
 				object.position.x = - 200;
 				object.position.z = 200;
-				scene.addObject( object );
+				scene.add( object );
 
 
-				objects[ 1 ] = object = new THREE.Mesh( new THREE.CylinderGeometry( 50, 25, 75, 100 ), material );
+				objects[ 1 ] = object = new THREE.Mesh( new THREE.CylinderGeometry( 25, 75, 100, 40, 5 ), material );
 				object.position.z = 200;
-				scene.addObject( object );
+				scene.add( object );
 
 				objects[ 2 ] = object = new THREE.Mesh( new THREE.IcosahedronGeometry( 2 ), material );
 				object.position.x = 200;
 				object.position.z = 200;
 				object.scale.x = object.scale.y = object.scale.z = 75;
-				scene.addObject( object );
+				scene.add( object );
 
 				objects[ 3 ] = object = new THREE.Mesh( new THREE.PlaneGeometry( 100, 100, 4, 4 ), material );
 				object.position.x = - 200;
-				scene.addObject( object );
+				scene.add( object );
 
 				objects[ 4 ] = object = new THREE.Mesh( new THREE.SphereGeometry( 75, 20, 10 ), material );
-				scene.addObject( object );
+				scene.add( object );
 
 				var points = [];
 
@@ -93,22 +93,22 @@
 
 				objects[ 5 ] = object = new THREE.Mesh( new THREE.LatheGeometry( points, 20 ), material );
 				object.position.x = 200;
-				scene.addObject( object );
+				scene.add( object );
 
 				objects[ 6 ] = object = new THREE.Mesh( new THREE.TorusGeometry( 50, 20, 20, 20 ), material );
 				object.position.x = - 200;
 				object.position.z = - 200;
-				scene.addObject( object );
+				scene.add( object );
 
 				objects[ 7 ] = object = new THREE.Mesh( new THREE.TorusKnotGeometry( 50, 10, 50, 20 ), material );
 				object.position.z = - 200;
-				scene.addObject( object );
+				scene.add( object );
 
 				objects[ 8 ] = object = new THREE.Trident();
 				object.position.x = 200;
 				object.position.z = - 200;
 				object.scale.x = object.scale.y = object.scale.z = 0.5;
-				scene.addObject( object );
+				scene.add( object );
 
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 3 - 5
examples/webgl_geometry_blenderexport_colors.html

@@ -66,12 +66,10 @@
 
 				scene = new THREE.Scene();
 
-				//scene.addLight( new THREE.AmbientLight( 0x333333 )  );
-
 				light = new THREE.DirectionalLight( 0xffffff );
 				light.position.set( 0, 0, 1 );
 				light.position.normalize();
-				scene.addLight( light );
+				scene.add( light );
 
 				var loader = new THREE.JSONLoader();
 				loader.load( { model: "obj/cubecolors/cubecolors.js", callback: createScene1 } );
@@ -100,7 +98,7 @@
 				mesh = new THREE.Mesh( geometry, material );
 				mesh.position.x = 400;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 250;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 			}
 
@@ -113,7 +111,7 @@
 				mesh2 = new THREE.Mesh( geometry, material );
 				mesh2.position.x = - 400;
 				mesh2.scale.x = mesh2.scale.y = mesh2.scale.z = 250;
-				scene.addObject( mesh2 );
+				scene.add( mesh2 );
 
 			}
 

+ 7 - 7
examples/webgl_geometry_colors.html

@@ -69,7 +69,7 @@
 				light = new THREE.DirectionalLight( 0xffffff );
 				light.position.set( 0, 0, 1 );
 				light.position.normalize();
-				scene.addLight( light );
+				scene.add( light );
 
 				var shadowMaterial = new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/shadow.png' ) } );
 				var shadowGeo = new THREE.PlaneGeometry( 300, 300, 1, 1 );
@@ -77,19 +77,19 @@
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh.position.y = - 250;
 				mesh.rotation.x = - 90 * Math.PI / 180;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh.position.y = - 250;
 				mesh.position.x = - 400;
 				mesh.rotation.x = - 90 * Math.PI / 180;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh.position.y = - 250;
 				mesh.position.x = 400;
 				mesh.rotation.x = - 90 * Math.PI / 180;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				var faceIndices = [ 'a', 'b', 'c', 'd' ];
 
@@ -144,19 +144,19 @@
 				mesh.position.x = -400;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 200;
 				mesh.rotation.x = -1.87;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				mesh2 = new THREE.Mesh( geometry2, materials  );
 				mesh2.position.x = 400;
 				mesh2.rotation.x = 0;
 				mesh2.scale = mesh.scale;
-				scene.addObject( mesh2 );
+				scene.add( mesh2 );
 
 				mesh3 = new THREE.Mesh( geometry3, materials  );
 				mesh3.position.x = 0;
 				mesh3.rotation.x = 0;
 				mesh3.scale = mesh.scale;
-				scene.addObject( mesh3 );
+				scene.add( mesh3 );
 
 				renderer = new THREE.WebGLRenderer( { antialias: true } );
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 1 - 5
examples/webgl_geometry_dynamic.html

@@ -82,10 +82,6 @@
 				scene = new THREE.Scene();
 				scene.fog = new THREE.FogExp2( 0xaaccff, 0.0007 );
 
-				//var light = new THREE.PointLight( 0xffffff, 2 );
-				//light.position.y = 500;
-				//scene.addLight( light );
-
 				camera.position.y = 200;
 				camera.target.position.y = camera.position.y;
 
@@ -113,7 +109,7 @@
 
 				mesh = new THREE.Mesh( geometry, material );
 				mesh.rotation.x = - 90 * Math.PI / 180;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				renderer = new THREE.WebGLRenderer( { clearColor:0xaaccff, clearAlpha: 1 } );
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 2 - 2
examples/webgl_geometry_hierarchy.html

@@ -65,11 +65,11 @@
 					mesh.matrixAutoUpdate = false;
 					mesh.updateMatrix();
 
-					group.addChild( mesh );
+					group.add( mesh );
 
 				}
 
-				scene.addObject( group );
+				scene.add( group );
 
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 7 - 7
examples/webgl_geometry_hierarchy2.html

@@ -66,7 +66,7 @@
 					child = new THREE.Mesh( geometry, material );
 					child.position.x = 100;
 
-					object.addChild( child );
+					object.add( child );
 					object = child;
 
 					objects.push( child );
@@ -80,7 +80,7 @@
 					child = new THREE.Mesh( geometry, material );
 					child.position.x = - 100;
 
-					object.addChild( child );
+					object.add( child );
 					object = child;
 
 					objects.push( child );
@@ -94,7 +94,7 @@
 					child = new THREE.Mesh( geometry, material );
 					child.position.y = - 100;
 
-					object.addChild( child );
+					object.add( child );
 					object = child;
 
 					objects.push( child );
@@ -108,7 +108,7 @@
 					child = new THREE.Mesh( geometry, material );
 					child.position.y = 100;
 
-					object.addChild( child );
+					object.add( child );
 					object = child;
 
 					objects.push( child );
@@ -122,7 +122,7 @@
 					child = new THREE.Mesh( geometry, material );
 					child.position.z = - 100;
 
-					object.addChild( child );
+					object.add( child );
 					object = child;
 
 					objects.push( child );
@@ -136,14 +136,14 @@
 					child = new THREE.Mesh( geometry, material );
 					child.position.z = 100;
 
-					object.addChild( child );
+					object.add( child );
 					object = child;
 
 					objects.push( child );
 
 				}
 
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 5 - 5
examples/webgl_geometry_large_mesh.html

@@ -97,7 +97,7 @@
 				mesh.rotation.z = rz;
 				mesh.overdraw = true;
 				mesh.updateMatrix();
-				scene.addObject(mesh);
+				scene.add(mesh);
 
 			}
 
@@ -115,20 +115,20 @@
 				// LIGHTS
 
 				var ambient = new THREE.AmbientLight( 0x101010 );
-				scene.addLight( ambient );
+				scene.add( ambient );
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
 				directionalLight.position.x = 1;
 				directionalLight.position.y = 1;
 				directionalLight.position.z = 2;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				pointLight = new THREE.PointLight( 0xffaa00 );
 				pointLight.position.x = 0;
 				pointLight.position.y = 0;
 				pointLight.position.z = 0;
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				// light representation
 				sphere = new THREE.SphereGeometry( 100, 16, 8, 1 );
@@ -137,7 +137,7 @@
 				lightMesh.position = pointLight.position;
 				lightMesh.overdraw = true;
 				lightMesh.updateMatrix();
-				scene.addObject( lightMesh );
+				scene.add( lightMesh );
 
 
 				if ( render_gl ) {

+ 3 - 3
examples/webgl_geometry_minecraft.html

@@ -151,17 +151,17 @@
 				}
 
 				mesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial() );
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				var ambientLight = new THREE.AmbientLight( 0xcccccc );
-				scene.addLight( ambientLight );
+				scene.add( ambientLight );
 
 				var directionalLight = new THREE.DirectionalLight( 0xffffff, 1.5 );
 				directionalLight.position.x = 1;
 				directionalLight.position.y = 1;
 				directionalLight.position.z = 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 3 - 3
examples/webgl_geometry_minecraft_ao.html

@@ -438,17 +438,17 @@
 				}
 
 				mesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial() );
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				var ambientLight = new THREE.AmbientLight( 0xcccccc );
-				scene.addLight( ambientLight );
+				scene.add( ambientLight );
 
 				var directionalLight = new THREE.DirectionalLight( 0xffffff, 1.5 );
 				directionalLight.position.x = 1;
 				directionalLight.position.y = 1;
 				directionalLight.position.z = 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 8 - 8
examples/webgl_geometry_shapes.html

@@ -65,11 +65,11 @@
 				var light = new THREE.DirectionalLight( 0xffffff );
 				light.position.set( 0, 0, 1 );
 				light.position.normalize();
-				scene.addLight( light );
+				scene.add( light );
 
 				parent = new THREE.Object3D();
 				parent.position.y = 50;
-				scene.addChild( parent );
+				scene.add( parent );
 
 				function addGeometry( geometry, points, spacedPoints, color, x, y, z, rx, ry, rz, s ) {
 
@@ -79,7 +79,7 @@
 					mesh.position.set( x, y, z - 75 );
 					mesh.rotation.set( rx, ry, rz );
 					mesh.scale.set( s, s, s );
-					parent.addChild( mesh );
+					parent.add( mesh );
 
 					// solid line
 
@@ -87,7 +87,7 @@
 					line.position.set( x, y, z + 25 );
 					line.rotation.set( rx, ry, rz );
 					line.scale.set( s, s, s );
-					parent.addChild( line );
+					parent.add( line );
 
 					// transparent line from real points
 
@@ -95,7 +95,7 @@
 					line.position.set( x, y, z + 75 );
 					line.rotation.set( rx, ry, rz );
 					line.scale.set( s, s, s );
-					parent.addChild( line );
+					parent.add( line );
 
 					// vertices from real points
 
@@ -104,7 +104,7 @@
 					particles.position.set( x, y, z + 75 );
 					particles.rotation.set( rx, ry, rz );
 					particles.scale.set( s, s, s );
-					parent.addChild( particles );
+					parent.add( particles );
 
 					// transparent line from equidistance sampled points
 
@@ -112,7 +112,7 @@
 					line.position.set( x, y, z + 100 );
 					line.rotation.set( rx, ry, rz );
 					line.scale.set( s, s, s );
-					parent.addChild( line );
+					parent.add( line );
 
 					// equidistance sampled points
 
@@ -121,7 +121,7 @@
 					particles2.position.set( x, y, z + 100 );
 					particles2.rotation.set( rx, ry, rz );
 					particles2.scale.set( s, s, s );
-					parent.addChild( particles2 );
+					parent.add( particles2 );
 
 				}
 

+ 1 - 1
examples/webgl_geometry_terrain.html

@@ -96,7 +96,7 @@
 
 				mesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { map: texture } ) );
 				mesh.rotation.x = - 90 * Math.PI / 180;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 1 - 1
examples/webgl_geometry_terrain_fog.html

@@ -96,7 +96,7 @@
 
 				mesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { map: texture } ) );
 				mesh.rotation.x = - 90 * Math.PI / 180;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				renderer = new THREE.WebGLRenderer( { clearColor: 0xefd1b5, clearAlpha: 1 } );
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 8 - 8
examples/webgl_geometry_text.html

@@ -175,11 +175,11 @@
 				var dirLight = new THREE.DirectionalLight( 0xffffff, 0.125 );
 				dirLight.position.set( 0, 0, 1 );
 				dirLight.position.normalize();
-				scene.addLight( dirLight );
+				scene.add( dirLight );
 
 				var pointLight = new THREE.PointLight( 0xffffff, 1.5 );
 				pointLight.position.set( 0, 100, 90 );
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				//text = capitalize( font ) + " " + capitalize( weight );
 				//text = "abcdefghijklmnopqrstuvwxyz0123456789";
@@ -228,14 +228,14 @@
 				parent = new THREE.Object3D();
 				parent.position.y = 100;
 
-				scene.addChild( parent );
+				scene.add( parent );
 
 				createText();
 
 				var plane = new THREE.Mesh( new THREE.PlaneGeometry( 10000, 10000 ), new THREE.MeshBasicMaterial( { color: 0xffffff, opacity: 0.5, transparent: true } ) );
 				plane.rotation.x = -1.57;
 				plane.position.y = 100;
-				scene.addChild( plane );
+				scene.add( plane );
 
 				// RENDERER
 
@@ -499,7 +499,7 @@
 				textMesh1.rotation.x = 0;
 				textMesh1.rotation.y = Math.PI * 2;
 
-				parent.addChild( textMesh1 );
+				parent.add( textMesh1 );
 
 				if ( mirror ) {
 
@@ -512,7 +512,7 @@
 					textMesh2.rotation.x = Math.PI;
 					textMesh2.rotation.y = Math.PI * 2;
 
-					parent.addChild( textMesh2 );
+					parent.add( textMesh2 );
 
 				}
 
@@ -522,8 +522,8 @@
 
 				updatePermalink();
 
-				scene.removeChild( textMesh1 );
-				if ( mirror ) scene.removeChild( textMesh2 );
+				scene.remove( textMesh1 );
+				if ( mirror ) scene.remove( textMesh2 );
 
 				if ( !text ) return;
 

+ 2 - 2
examples/webgl_hdr.html

@@ -125,7 +125,7 @@
 				directionalLight.position.y = 0;
 				directionalLight.position.z = 1;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				var texture = THREE.ImageUtils.loadTexture( "textures/memorial.png" );
 				texture.minFilter = THREE.LinearFilter;
@@ -147,7 +147,7 @@
 
 				quad = new THREE.Mesh( plane, materialHDR );
 				quad.position.z = -100;
-				scene.addObject( quad );
+				scene.add( quad );
 
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 3 - 3
examples/webgl_interactive_cubes.html

@@ -53,14 +53,14 @@
 				light.position.y = 1;
 				light.position.z = 1;
 				light.position.normalize();
-				scene.addLight( light );
+				scene.add( light );
 
 				var light = new THREE.DirectionalLight( 0xffffff );
 				light.position.x = - 1;
 				light.position.y = - 1;
 				light.position.z = - 1;
 				light.position.normalize();
-				scene.addLight( light );
+				scene.add( light );
 
 				var geometry = new THREE.CubeGeometry( 20, 20, 20 );
 
@@ -76,7 +76,7 @@
 					object.scale.x = Math.random() * 2 + 1;
 					object.scale.y = Math.random() * 2 + 1;
 					object.scale.z = Math.random() * 2 + 1;
-					scene.addObject( object );
+					scene.add( object );
 
 				}
 

+ 7 - 7
examples/webgl_interactive_voxelpainter.html

@@ -64,7 +64,7 @@
 				rollOverGeo = new THREE.CubeGeometry( 50, 50, 50 );
 				rollOverMaterial = new THREE.MeshBasicMaterial( { color: 0xff0000, opacity: 0.5, transparent: true } );
 				rollOverMesh = new THREE.Mesh( rollOverGeo, rollOverMaterial );
-				scene.addObject( rollOverMesh );
+				scene.add( rollOverMesh );
 
 
 				// cubes
@@ -80,7 +80,7 @@
 
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000, 20, 20 ), new THREE.MeshBasicMaterial( { color: 0x555555, wireframe: true } ) );
 				plane.rotation.x = - 90 * Math.PI / 180;
-				scene.addObject( plane );
+				scene.add( plane );
 
 				mouse2D = new THREE.Vector3( 0, 10000, 0.5 );
 				ray = new THREE.Ray( camera.position, null );
@@ -88,21 +88,21 @@
 				// Lights
 
 				var ambientLight = new THREE.AmbientLight( 0x606060 );
-				scene.addLight( ambientLight );
+				scene.add( ambientLight );
 
 				var directionalLight = new THREE.DirectionalLight( 0xffffff );
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				var directionalLight = new THREE.DirectionalLight( 0x808080 );
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				renderer = new THREE.WebGLRenderer( { antialias: true } );
 				renderer.setSize( window.innerWidth, window.innerHeight );
@@ -176,7 +176,7 @@
 
 						if ( intersector.object != plane ) {
 
-							scene.removeObject( intersector.object );
+							scene.remove( intersector.object );
 
 						}
 
@@ -191,7 +191,7 @@
 						voxel.position.copy( voxelPosition );
 						voxel.matrixAutoUpdate = false;
 						voxel.updateMatrix();
-						scene.addObject( voxel );
+						scene.add( voxel );
 
 					}
 

+ 8 - 18
examples/webgl_lights_pointlights.html

@@ -77,48 +77,38 @@
 
 					object = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial( { ambient: 0x555555, color: 0x555555, specular: 0xffffff, shininess: 50, shading: THREE.SmoothShading }  )  );
 					object.scale.x = object.scale.y = object.scale.z = 0.80;
-					scene.addObject( object );
+					scene.add( object );
 
 					loader.statusDomElement.style.display = "none";
 
 				};
 
-				//loader.load( { model: "obj/walt/WaltHead_slim.js", callback: callback } );
 				loader.load( { model: "obj/walt/WaltHead_bin.js", callback: callback } );
 
-				/*
-				var directionalLight = new THREE.DirectionalLight( 0x111111, 0.9 );
-				directionalLight.position.x = 1;
-				directionalLight.position.y = 1;
-				directionalLight.position.z = 2;
-				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
-				*/
-
-				scene.addLight( new THREE.AmbientLight( 0x00000 ) );
+				scene.add( new THREE.AmbientLight( 0x00000 ) );
 
 				light1 = new THREE.PointLight( 0xff0040, 2, 50 );
-				scene.addLight( light1 );
+				scene.add( light1 );
 
 				light2 = new THREE.PointLight( 0x0040ff, 2, 50 );
-				scene.addLight( light2 );
+				scene.add( light2 );
 
 				light3 = new THREE.PointLight( 0x80ff80, 2, 50 );
-				scene.addLight( light3 );
+				scene.add( light3 );
 
 				var sphere = new THREE.SphereGeometry( 0.5, 16, 8 );
 
 				var l1 = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xff0040 } ) );
 				l1.position = light1.position;
-				scene.addObject( l1 );
+				scene.add( l1 );
 
 				var l2 = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0x0040ff } ) );
 				l2.position = light2.position;
-				scene.addObject( l2 );
+				scene.add( l2 );
 
 				var l3 = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0x80ff80 } ) );
 				l3.position = light3.position;
-				scene.addObject( l3 );
+				scene.add( l3 );
 
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 1 - 1
examples/webgl_lines_colors.html

@@ -135,7 +135,7 @@
 					line.position.x = p[ 2 ][ 0 ];
 					line.position.y = p[ 2 ][ 1 ];
 					line.position.z = p[ 2 ][ 2 ];
-					scene.addObject( line );
+					scene.add( line );
 
 				}
 

+ 1 - 1
examples/webgl_lines_cubes.html

@@ -112,7 +112,7 @@
 					line.position.x = p[ 2 ][ 0 ];
 					line.position.y = p[ 2 ][ 1 ];
 					line.position.z = p[ 2 ][ 2 ];
-					scene.addObject( line );
+					scene.add( line );
 
 				}
 

+ 1 - 1
examples/webgl_lines_sphere.html

@@ -111,7 +111,7 @@
 					line.originalScale = p[ 0 ];
 					line.rotation.y = Math.random() * Math.PI;
 					line.updateMatrix();
-					scene.addObject( line );
+					scene.add( line );
 
 				}
 

+ 1 - 1
examples/webgl_lines_splines.html

@@ -137,7 +137,7 @@
 					line.position.x = p[ 2 ][ 0 ];
 					line.position.y = p[ 2 ][ 1 ];
 					line.position.z = p[ 2 ][ 2 ];
-					scene.addObject( line );
+					scene.add( line );
 
 				}
 

+ 3 - 3
examples/webgl_lod.html

@@ -74,12 +74,12 @@
 
 				var light = new THREE.PointLight( 0xff2200 );
 				light.position.set( 0, 0, 0 );
-				scene.addLight( light );
+				scene.add( light );
 
 				var light = new THREE.DirectionalLight( 0xffffff );
 				light.position.set( 0, 0, 1 );
 				light.position.normalize();
-				scene.addLight( light );
+				scene.add( light );
 
 				var material = new THREE.MeshLambertMaterial( { color: 0xffffff, wireframe: true } );
 
@@ -113,7 +113,7 @@
 					lod.position.z = 10000 * ( 0.5 - Math.random() );
 					lod.updateMatrix();
 					lod.matrixAutoUpdate = false;
-					scene.addObject( lod );
+					scene.add( lod );
 
 				}
 

+ 3 - 3
examples/webgl_lod_text.html

@@ -89,12 +89,12 @@
 
 				var light = new THREE.PointLight( 0xff2200 );
 				light.position.set( 0, 0, 0 );
-				scene.addLight( light );
+				scene.add( light );
 
 				var light = new THREE.DirectionalLight( 0xffffff );
 				light.position.set( 0, 0, 1 );
 				light.position.normalize();
-				scene.addLight( light );
+				scene.add( light );
 
 				var wireMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, opacity: 0.5, wireframe: true } );
 				
@@ -154,7 +154,7 @@
 					lod.position.z = 10000 * ( 0.5 - Math.random() );
 					lod.updateMatrix();
 					lod.matrixAutoUpdate = false;
-					scene.addObject( lod );
+					scene.add( lod );
 
 				}
 

+ 6 - 6
examples/webgl_materials.html

@@ -63,7 +63,7 @@
 				}
 
 				var line = new THREE.Line( geometry, line_material, THREE.LinePieces );
-				scene.addObject( line );
+				scene.add( line );
 
 				// Materials
 
@@ -123,26 +123,26 @@
 
 					objects.push( sphere );
 
-					scene.addObject( sphere );
+					scene.add( sphere );
 
 				}
 
 				particleLight = new THREE.Mesh( new THREE.SphereGeometry( 4, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xffffff } ) );
-				scene.addObject( particleLight );
+				scene.add( particleLight );
 
 				// Lights
 
-				scene.addLight( new THREE.AmbientLight( 0x202020 ) );
+				scene.add( new THREE.AmbientLight( 0x202020 ) );
 
 				var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				pointLight = new THREE.PointLight( 0xffffff, 1 );
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );

+ 6 - 6
examples/webgl_materials_cars.html

@@ -174,27 +174,27 @@
 				// LIGHTS
 
 				var ambient = new THREE.AmbientLight( 0x555555 );
-				scene.addLight( ambient );
+				scene.add( ambient );
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff, 2 );
 				directionalLight.position.x = 2;
 				directionalLight.position.y = 1.2;
 				directionalLight.position.z = 10;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff, 1 );
 				directionalLight.position.x = - 2;
 				directionalLight.position.y = 1.2;
 				directionalLight.position.z = - 10;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				pointLight = new THREE.PointLight( 0xffaa00, 2 );
 				pointLight.position.x = 2000;
 				pointLight.position.y = 1200;
 				pointLight.position.z = 10000;
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				// Skybox
 
@@ -210,7 +210,7 @@
 				} ),
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 100000, 100000, 100000, 1, 1, 1, null, true ), material );
-				sceneCube.addObject( mesh );
+				sceneCube.add( mesh );
 
 				//
 
@@ -573,7 +573,7 @@
 				mesh.rotation.y = r[ 1 ];
 				mesh.rotation.z = r[ 2 ];
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				CARS[ car ].object = mesh;
 

+ 6 - 6
examples/webgl_materials_cars_anaglyph.html

@@ -170,27 +170,27 @@
 				// LIGHTS
 
 				var ambient = new THREE.AmbientLight( 0x555555 );
-				scene.addLight( ambient );
+				scene.add( ambient );
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff, 2 );
 				directionalLight.position.x = 2;
 				directionalLight.position.y = 1.2;
 				directionalLight.position.z = 10;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff, 1 );
 				directionalLight.position.x = - 2;
 				directionalLight.position.y = 1.2;
 				directionalLight.position.z = - 10;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				pointLight = new THREE.PointLight( 0xffaa00, 2 );
 				pointLight.position.x = 2000;
 				pointLight.position.y = 1200;
 				pointLight.position.z = 10000;
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				// Skybox
 
@@ -206,7 +206,7 @@
 				} ),
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 100000, 100000, 100000, 1, 1, 1, null, true ), material );
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				//
 
@@ -568,7 +568,7 @@
 				mesh.rotation.y = r[ 1 ];
 				mesh.rotation.z = r[ 2 ];
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				CARS[ car ].object = mesh;
 

+ 5 - 5
examples/webgl_materials_cars_camaro.html

@@ -76,20 +76,20 @@
 				// LIGHTS
 
 				var ambient = new THREE.AmbientLight( 0x555555 );
-				scene.addLight( ambient );
+				scene.add( ambient );
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff );
 				directionalLight.position.x = 1;
 				directionalLight.position.y = 1;
 				directionalLight.position.z = 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				pointLight = new THREE.PointLight( 0xffaa00 );
 				pointLight.position.x = 0;
 				pointLight.position.y = 0;
 				pointLight.position.z = 0;
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 
 				sphere = new THREE.SphereGeometry( 100, 16, 8, 1 );
@@ -98,7 +98,7 @@
 				lightMesh.position = pointLight.position;
 				lightMesh.overdraw = true;
 				lightMesh.updateMatrix();
-				scene.addObject(lightMesh);
+				scene.add(lightMesh);
 
 
 				webglRenderer = new THREE.WebGLRenderer();
@@ -190,7 +190,7 @@
 				var mesh = new THREE.Mesh( geometry, m );
 				mesh.rotation.y = 1;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				createButtons( materials.body, geometry );
 

+ 5 - 5
examples/webgl_materials_cars_camaro_crosseyed.html

@@ -79,20 +79,20 @@
 				// LIGHTS
 
 				var ambient = new THREE.AmbientLight( 0x555555 );
-				scene.addLight( ambient );
+				scene.add( ambient );
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff );
 				directionalLight.position.x = 1;
 				directionalLight.position.y = 1;
 				directionalLight.position.z = 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				pointLight = new THREE.PointLight( 0xffaa00 );
 				pointLight.position.x = 0;
 				pointLight.position.y = 0;
 				pointLight.position.z = 0;
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 
 				sphere = new THREE.SphereGeometry( 100, 16, 8, 1 );
@@ -101,7 +101,7 @@
 				lightMesh.position = pointLight.position;
 				lightMesh.overdraw = true;
 				lightMesh.updateMatrix();
-				scene.addObject(lightMesh);
+				scene.add(lightMesh);
 
 
 				webglRenderer = new THREE.CrosseyedWebGLRenderer( { separation: 20, antialias: true } );
@@ -195,7 +195,7 @@
 				var mesh = new THREE.Mesh( geometry, m );
 				mesh.rotation.y = 1;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				createButtons( materials.body, geometry );
 

+ 7 - 7
examples/webgl_materials_cubemap.html

@@ -84,17 +84,17 @@
 				// LIGHTS
 
 				var ambient = new THREE.AmbientLight( 0xffffff );
-				scene.addLight( ambient );
+				scene.add( ambient );
 
 				pointLight = new THREE.PointLight( 0xffffff, 2 );
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				// light representation
 				sphere = new THREE.SphereGeometry( 100, 16, 8 );
 				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color:0xffaa00 } ) );
 				lightMesh.position = pointLight.position;
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;
-				scene.addObject(lightMesh);
+				scene.add(lightMesh);
 
 				var path = "textures/cube/SwedishRoyalCastle/";
 				var format = '.jpg';
@@ -127,7 +127,7 @@
 				} ),
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 10, 10, 10, 1, 1, 1, null, true ), material );
-				sceneCube.addObject( mesh );
+				sceneCube.add( mesh );
 
 				//
 
@@ -156,19 +156,19 @@
 				var mesh = new THREE.Mesh( geometry, m1 );
 				mesh.position.z = - 100;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				var mesh = new THREE.Mesh( geometry, m2 );
 				mesh.position.x = - 900;
 				mesh.position.z = - 100;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				var mesh = new THREE.Mesh( geometry, m3 );
 				mesh.position.x = 900;
 				mesh.position.z = - 100;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				loader.statusDomElement.style.display = "none";
 

+ 2 - 2
examples/webgl_materials_cubemap_balls_reflection.html

@@ -97,7 +97,7 @@
 					mesh.position.y = Math.random() * 10000 - 5000;
 					mesh.position.z = Math.random() * 10000 - 5000;
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = Math.random() * 3 + 1;
-					scene.addObject( mesh );
+					scene.add( mesh );
 
 					spheres.push( mesh );
 
@@ -117,7 +117,7 @@
 				} ),
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 100000, 100000, 100000, 1, 1, 1, null, true ), material );
-				sceneCube.addObject( mesh );
+				sceneCube.add( mesh );
 
 				//
 

+ 2 - 2
examples/webgl_materials_cubemap_balls_reflection_anaglyph.html

@@ -93,7 +93,7 @@
 					mesh.position.y = Math.random() * 10000 - 5000;
 					mesh.position.z = Math.random() * 10000 - 5000;
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = Math.random() * 3 + 1;
-					scene.addObject( mesh );
+					scene.add( mesh );
 
 					spheres.push( mesh );
 
@@ -113,7 +113,7 @@
 				} ),
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 100000, 100000, 100000, 1, 1, 1, null, true ), material );
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				//
 

+ 2 - 2
examples/webgl_materials_cubemap_balls_refraction.html

@@ -96,7 +96,7 @@
 					mesh.position.y = Math.random() * 10000 - 5000;
 					mesh.position.z = Math.random() * 10000 - 5000;
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = Math.random() * 3 + 1;
-					scene.addObject( mesh );
+					scene.add( mesh );
 
 					spheres.push( mesh );
 
@@ -116,7 +116,7 @@
 				} ),
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 100000, 100000, 100000, 1, 1, 1, null, true ), material );
-				sceneCube.addObject( mesh );
+				sceneCube.add( mesh );
 
 				//
 

+ 2 - 2
examples/webgl_materials_cubemap_balls_refraction_crosseyed.html

@@ -95,7 +95,7 @@
 					mesh.position.y = Math.random() * 10000 - 5000;
 					mesh.position.z = Math.random() * 10000 - 5000;
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = Math.random() * 3 + 1;
-					scene.addObject( mesh );
+					scene.add( mesh );
 
 					spheres.push( mesh );
 
@@ -115,7 +115,7 @@
 				} ),
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 100000, 100000, 100000, 1, 1, 1, null, true ), material );
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				//
 

+ 2 - 2
examples/webgl_materials_cubemap_escher.html

@@ -85,7 +85,7 @@
 
 				var mesh = new THREE.Mesh( geometry, material );
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 16;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				// Skybox
 
@@ -101,7 +101,7 @@
 				} ),
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 6000, 6000, 6000, 1, 1, 1, null, true ), material );
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				//
 

+ 7 - 7
examples/webgl_materials_cubemap_refraction.html

@@ -82,10 +82,10 @@
 				// LIGHTS
 
 				var ambient = new THREE.AmbientLight( 0xffffff );
-				scene.addLight( ambient );
+				scene.add( ambient );
 
 				pointLight = new THREE.PointLight( 0xffffff, 2 );
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				// light representation
 
@@ -93,7 +93,7 @@
 				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color:0xffaa00 } ) );
 				lightMesh.position = pointLight.position;
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;
-				scene.addObject(lightMesh);
+				scene.add(lightMesh);
 
 				// material samples
 
@@ -123,7 +123,7 @@
 				} ),
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 100000, 100000, 100000, 1, 1, 1, null, true ), material );
-				sceneCube.addObject( mesh );
+				sceneCube.add( mesh );
 
 				//
 
@@ -154,19 +154,19 @@
 				var mesh = new THREE.Mesh( geometry, m1 );
 				mesh.position.z = z;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				var mesh = new THREE.Mesh( geometry, m2 );
 				mesh.position.x = - 900;
 				mesh.position.z = z;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				var mesh = new THREE.Mesh( geometry, m3 );
 				mesh.position.x = 900;
 				mesh.position.z = z;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 				loader.statusDomElement.style.display = "none";
 

+ 1 - 1
examples/webgl_materials_grass.html

@@ -50,7 +50,7 @@
 					mesh.materials[0].map.needsUpdate = true;
 					mesh.rotation.x = - 90 * ( Math.PI / 180 );
 					mesh.position.y = i * 0.25;
-					scene.addObject( mesh );
+					scene.add( mesh );
 
 				}
 

+ 6 - 6
examples/webgl_materials_normalmap.html

@@ -92,18 +92,18 @@
 				// LIGHTS
 
 				ambientLight = new THREE.AmbientLight( 0x111111 );
-				scene.addLight( ambientLight );
+				scene.add( ambientLight );
 
 				pointLight = new THREE.PointLight( 0xffff55 );
 				pointLight.position.z = 10000;
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				directionalLight = new THREE.DirectionalLight( 0xaaaa88 );
 				directionalLight.position.x = 1;
 				directionalLight.position.y = 1;
 				directionalLight.position.z = 0.5;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				// light representation
 
@@ -111,7 +111,7 @@
 				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xffaa00 } ) );
 				lightMesh.position = pointLight.position;
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;
-				scene.addObject(lightMesh);
+				scene.add(lightMesh);
 
 				// common material parameters
 
@@ -176,12 +176,12 @@
 				mesh1 = new THREE.Mesh( geometry, material1 );
 				mesh1.position.x = - scale * 12;
 				mesh1.scale.set( scale, scale, scale );
-				scene.addObject( mesh1 );
+				scene.add( mesh1 );
 
 				mesh2 = new THREE.Mesh( geometry, material2 );
 				mesh2.position.x = scale * 12;
 				mesh2.scale.set( scale, scale, scale );
-				scene.addObject( mesh2 );
+				scene.add( mesh2 );
 
 				loader.statusDomElement.style.display = "none";
 

+ 4 - 4
examples/webgl_materials_normalmap2.html

@@ -95,19 +95,19 @@
 				// LIGHTS
 
 				ambientLight = new THREE.AmbientLight( 0x444444 );
-				scene.addLight( ambientLight );
+				scene.add( ambientLight );
 
 				pointLight = new THREE.PointLight( 0xffffff );
 				pointLight.position.z = 600;
 
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff );
 				directionalLight.position.x = 1;
 				directionalLight.position.y = 1;
 				directionalLight.position.z = - 1;
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				// material parameters
 
@@ -164,7 +164,7 @@
 				mesh1 = new THREE.Mesh( geometry, material );
 				mesh1.position.y = - 50;
 				mesh1.scale.x = mesh1.scale.y = mesh1.scale.z = scale;
-				scene.addObject( mesh1 );
+				scene.add( mesh1 );
 
 				loader.statusDomElement.style.display = "none";
 

+ 5 - 5
examples/webgl_materials_shaders.html

@@ -86,7 +86,7 @@
 
 				mesh.overdraw = true;
 
-				scene.addObject( mesh );
+				scene.add( mesh );
 
 			}
 
@@ -104,15 +104,15 @@
 				// LIGHTS
 
 				var ambient = new THREE.AmbientLight( 0x101010 );
-				scene.addLight( ambient );
+				scene.add( ambient );
 
 				directionalLight = new THREE.DirectionalLight( 0xffffff );
 				directionalLight.position.set( 1, 1, 2 );
 				directionalLight.position.normalize();
-				scene.addLight( directionalLight );
+				scene.add( directionalLight );
 
 				pointLight = new THREE.PointLight( 0xffffff );
-				scene.addLight( pointLight );
+				scene.add( pointLight );
 
 				// light representation
 
@@ -121,7 +121,7 @@
 				lightMesh.scale.set( 0.05, 0.05, 0.05 );
 				lightMesh.position = pointLight.position;
 				lightMesh.overdraw = true;
-				scene.addObject( lightMesh );
+				scene.add( lightMesh );
 
 				// material samples
 

+ 2 - 2
examples/webgl_materials_shaders_fresnel.html

@@ -107,7 +107,7 @@
 					mesh.position.y = Math.random() * 10000 - 5000;
 					mesh.position.z = Math.random() * 10000 - 5000;
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = Math.random() * 3 + 1;
-					scene.addObject( mesh );
+					scene.add( mesh );
 
 					spheres.push( mesh );
 
@@ -129,7 +129,7 @@
 				} ),
 
 				mesh = new THREE.Mesh( new THREE.CubeGeometry( 100000, 100000, 100000, 1, 1, 1, null, true ), material );
-				sceneCube.addObject( mesh );
+				sceneCube.add( mesh );
 
 				//
 

+ 5 - 5
examples/webgl_materials_texture_filters.html

@@ -147,8 +147,8 @@
 					texturePainting2.image = image;
 					texturePainting2.needsUpdate = true;
 
-					scene.addObject( meshCanvas );
-					scene2.addObject( meshCanvas2 );
+					scene.add( meshCanvas );
+					scene2.add( meshCanvas2 );
 
 					var geometry = new THREE.PlaneGeometry( 100, 100 ),
 						mesh = new THREE.Mesh( geometry, materialPainting ),
@@ -162,14 +162,14 @@
 						zmesh.scale.x = image.width / 100;
 						zmesh.scale.y = image.height / 100;
 
-						zscene.addObject( zmesh );
+						zscene.add( zmesh );
 
 						var meshFrame = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 0x000000, polygonOffset: true, polygonOffsetFactor: 1, polygonOffsetUnits: 5 } )  );
 
 						meshFrame.scale.x = 1.1 * image.width / 100;
 						meshFrame.scale.y = 1.1 * image.height / 100;
 
-						zscene.addObject( meshFrame );
+						zscene.add( meshFrame );
 
 						var meshShadow = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.9, transparent: true } )  );
 
@@ -177,7 +177,7 @@
 						meshShadow.scale.x = 1.1 * image.width / 100;
 						meshShadow.scale.y = 1.1 * image.height / 100;
 						meshShadow.rotation.x = -Math.PI / 2;
-						zscene.addObject( meshShadow );
+						zscene.add( meshShadow );
 
 						meshShadow.position.y = - 1.1 * image.height/2;
 

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