Browse Source

Updated builds.

Mr.doob 13 years ago
parent
commit
e14722d2c8
4 changed files with 139 additions and 144 deletions
  1. 39 42
      build/Three.js
  2. 18 17
      build/custom/ThreeCanvas.js
  3. 72 76
      build/custom/ThreeExtras.js
  4. 10 9
      build/custom/ThreeWebGL.js

+ 39 - 42
build/Three.js

@@ -18,7 +18,8 @@ a).lengthSq()},getPositionFromMatrix:function(a){this.x=a.elements[12];this.y=a.
 this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1};
 this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1};
 THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w!==void 0?a.w:1;return this},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=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;this.w=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=
 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!==void 0?a.w:1;return this},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=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;this.w=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=
 this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;this.w=this.w-a.w;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a;this.w=this.w/a}else{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())},
 this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;this.w=this.w-a.w;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a;this.w=this.w/a}else{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=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;this.w=this.w+(a.w-this.w)*b;return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]};
+normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;this.w=this.w+(a.w-this.w)*b;return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};
+THREE.EventTarget=function(){var a={};this.addEventListener=function(b,c){a[b]===void 0&&(a[b]=[]);a[b].indexOf(c)===-1&&a[b].push(c)};this.dispatchEvent=function(b){for(var c in a[b.type])a[b.type][c](b)};this.removeEventListener=function(b,c){var d=a[b].indexOf(c);d!==-1&&a[b].splice(d,1)}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]};
 THREE.Frustum.prototype.setFromMatrix=function(a){var b,c=this.planes,d=a.elements,a=d[0];b=d[1];var e=d[2],f=d[3],g=d[4],h=d[5],j=d[6],k=d[7],l=d[8],o=d[9],m=d[10],p=d[11],r=d[12],n=d[13],q=d[14],d=d[15];c[0].set(f-a,k-g,p-l,d-r);c[1].set(f+a,k+g,p+l,d+r);c[2].set(f+b,k+h,p+o,d+n);c[3].set(f-b,k-h,p-o,d-n);c[4].set(f-e,k-j,p-m,d-q);c[5].set(f+e,k+j,p+m,d+q);for(a=0;a<6;a++){b=c[a];b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}};
 THREE.Frustum.prototype.setFromMatrix=function(a){var b,c=this.planes,d=a.elements,a=d[0];b=d[1];var e=d[2],f=d[3],g=d[4],h=d[5],j=d[6],k=d[7],l=d[8],o=d[9],m=d[10],p=d[11],r=d[12],n=d[13],q=d[14],d=d[15];c[0].set(f-a,k-g,p-l,d-r);c[1].set(f+a,k+g,p+l,d+r);c[2].set(f+b,k+h,p+o,d+n);c[3].set(f-b,k-h,p-o,d-n);c[4].set(f-e,k-j,p-m,d-q);c[5].set(f+e,k+j,p+m,d+q);for(a=0;a<6;a++){b=c[a];b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}};
 THREE.Frustum.prototype.contains=function(a){for(var b=this.planes,c=a.matrixWorld,d=c.elements,c=-a.geometry.boundingSphere.radius*c.getMaxScaleOnAxis(),e=0;e<6;e++){a=b[e].x*d[12]+b[e].y*d[13]+b[e].z*d[14]+b[e].w;if(a<=c)return false}return true};THREE.Frustum.__v1=new THREE.Vector3;
 THREE.Frustum.prototype.contains=function(a){for(var b=this.planes,c=a.matrixWorld,d=c.elements,c=-a.geometry.boundingSphere.radius*c.getMaxScaleOnAxis(),e=0;e<6;e++){a=b[e].x*d[12]+b[e].y*d[13]+b[e].z*d[14]+b[e].w;if(a<=c)return false}return true};THREE.Frustum.__v1=new THREE.Vector3;
 THREE.Ray=function(a,b){function c(a,b,c){n.sub(c,a);t=n.dot(b);y=q.add(a,u.copy(b).multiplyScalar(t));return s=c.distanceTo(y)}function d(a,b,c,d){n.sub(d,b);q.sub(c,b);u.sub(a,b);x=n.dot(n);E=n.dot(q);D=n.dot(u);A=q.dot(q);v=q.dot(u);H=1/(x*A-E*E);I=(A*D-E*v)*H;M=(x*v-E*D)*H;return I>=0&&M>=0&&I+M<1}this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;var e=1.0E-4;this.setPrecision=function(a){e=a};var f=new THREE.Vector3,g=new THREE.Vector3,h=new THREE.Vector3,j=new THREE.Vector3,
 THREE.Ray=function(a,b){function c(a,b,c){n.sub(c,a);t=n.dot(b);y=q.add(a,u.copy(b).multiplyScalar(t));return s=c.distanceTo(y)}function d(a,b,c,d){n.sub(d,b);q.sub(c,b);u.sub(a,b);x=n.dot(n);E=n.dot(q);D=n.dot(u);A=q.dot(q);v=q.dot(u);H=1/(x*A-E*E);I=(A*D-E*v)*H;M=(x*v-E*D)*H;return I>=0&&M>=0&&I+M<1}this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;var e=1.0E-4;this.setPrecision=function(a){e=a};var f=new THREE.Vector3,g=new THREE.Vector3,h=new THREE.Vector3,j=new THREE.Vector3,
@@ -62,7 +63,7 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,applyMatrix:function(a){thi
 this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.getRotationFromMatrix(this.matrix)},add:function(a){if(a===this)console.warn("THREE.Object3D.add: An object can't be added as a child of itself.");else if(a instanceof THREE.Object3D){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__addObject(a)}},remove:function(a){var b=
 this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.getRotationFromMatrix(this.matrix)},add:function(a){if(a===this)console.warn("THREE.Object3D.add: An object can't be added as a child of itself.");else if(a instanceof THREE.Object3D){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__addObject(a)}},remove:function(a){var b=
 this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__removeObject(a)}},getChildByName:function(a,b){var c,d,e;c=0;for(d=this.children.length;c<d;c++){e=this.children[c];if(e.name===a)return e;if(b){e=e.getChildByName(a,b);if(e!==void 0)return e}}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,
 this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__removeObject(a)}},getChildByName:function(a,b){var c,d,e;c=0;for(d=this.children.length;c<d;c++){e=this.children[c];if(e.name===a)return e;if(b){e=e.getChildByName(a,b);if(e!==void 0)return e}}},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=true},updateMatrixWorld:function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false;a=true}for(var b=0,c=this.children.length;b<
 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=true},updateMatrixWorld:function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false;a=true}for(var b=0,c=this.children.length;b<
-c;b++)this.children[b].updateMatrixWorld(a)},worldToLocal:function(a){if(!this.__inverseMatrixWorld)this.__inverseMatrixWorld=new THREE.Matrix4;return this.__inverseMatrixWorld.getInverse(this.matrixWorld).multiplyVector3(a)},localToWorld:function(a){return this.matrixWorld.multiplyVector3(a)}};THREE.Object3DCount=0;
+c;b++)this.children[b].updateMatrixWorld(a)},worldToLocal:function(a){return THREE.Object3D.__m1.getInverse(this.matrixWorld).multiplyVector3(a)},localToWorld:function(a){return this.matrixWorld.multiplyVector3(a)}};THREE.Object3D.__m1=new THREE.Matrix4;THREE.Object3DCount=0;
 THREE.Projector=function(){function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}function b(){var a=k[j]=k[j]||new THREE.RenderableVertex;j++;return a}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(e>=0&&f>=0&&g>=0&&h>=0)return true;if(e<0&&f<0||g<0&&h<0)return false;e<0?c=Math.max(c,e/(e-f)):f<0&&(d=Math.min(d,e/(e-f)));g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h)));if(d<c)return false;a.lerpSelf(b,c);b.lerpSelf(a,1-
 THREE.Projector=function(){function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}function b(){var a=k[j]=k[j]||new THREE.RenderableVertex;j++;return a}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(e>=0&&f>=0&&g>=0&&h>=0)return true;if(e<0&&f<0||g<0&&h<0)return false;e<0?c=Math.max(c,e/(e-f)):f<0&&(d=Math.min(d,e/(e-f)));g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h)));if(d<c)return false;a.lerpSelf(b,c);b.lerpSelf(a,1-
 d);return true}var e,f,g=[],h,j,k=[],l,o,m=[],p,r=[],n,q,u=[],t,y,s=[],x={objects:[],sprites:[],lights:[],elements:[]},E=new THREE.Vector3,D=new THREE.Vector4,A=new THREE.Matrix4,v=new THREE.Matrix4,H=new THREE.Frustum,I=new THREE.Vector4,M=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);A.multiply(b.projectionMatrix,b.matrixWorldInverse);A.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);
 d);return true}var e,f,g=[],h,j,k=[],l,o,m=[],p,r=[],n,q,u=[],t,y,s=[],x={objects:[],sprites:[],lights:[],elements:[]},E=new THREE.Vector3,D=new THREE.Vector4,A=new THREE.Matrix4,v=new THREE.Matrix4,H=new THREE.Frustum,I=new THREE.Vector4,M=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);A.multiply(b.projectionMatrix,b.matrixWorldInverse);A.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);
 A.multiply(b.matrixWorld,b.projectionMatrixInverse);A.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectGraph=function(b,d){f=0;x.objects.length=0;x.sprites.length=0;x.lights.length=0;var g=function(b){if(b.visible!==false){if((b instanceof THREE.Mesh||b instanceof THREE.Line)&&(b.frustumCulled===false||H.contains(b))){E.copy(b.matrixWorld.getPosition());
 A.multiply(b.matrixWorld,b.projectionMatrixInverse);A.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectGraph=function(b,d){f=0;x.objects.length=0;x.sprites.length=0;x.lights.length=0;var g=function(b){if(b.visible!==false){if((b instanceof THREE.Mesh||b instanceof THREE.Line)&&(b.frustumCulled===false||H.contains(b))){E.copy(b.matrixWorld.getPosition());
@@ -110,7 +111,7 @@ THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left
 THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a!==void 0?a:50;this.aspect=b!==void 0?b:1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;THREE.PerspectiveCamera.prototype.setLens=function(a,b){this.fov=2*Math.atan((b!==void 0?b:24)/(a*2))*(180/Math.PI);this.updateProjectionMatrix()};
 THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a!==void 0?a:50;this.aspect=b!==void 0?b:1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;THREE.PerspectiveCamera.prototype.setLens=function(a,b){this.fov=2*Math.atan((b!==void 0?b:24)/(a*2))*(180/Math.PI);this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};
-THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;
+THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;
 THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0;this.onlyShadow=this.castShadow=false;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=false;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;
 THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0;this.onlyShadow=this.castShadow=false;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=false;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;
 this.shadowCascade=false;this.shadowCascadeOffset=new THREE.Vector3(0,0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
 this.shadowCascade=false;this.shadowCascadeOffset=new THREE.Vector3(0,0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
 THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
 THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
@@ -136,7 +137,8 @@ g,h,i,[new THREE.Vector3(G[k*3],G[k*3+1],G[k*3+2]),new THREE.Vector3(p,r,l),new
 D(a,B+20+16);n=D(a,B+20+20);q=D(a,B+20+24);u=D(a,B+20+28);t=D(a,B+20+32);y=D(a,B+20+36);s=D(a,B+20+40);B=B+c;c=e*3+l;P=e*4+l;C=b*c;i=r*(c+j*3);e=n*(c+k*3);l=q*(c+j*3+k*3);c=u*P;j=t*(P+j*4);k=y*(P+k*4);B=B+function(b){var b=new Float32Array(a,b,o*3),c,d,e,f;for(c=0;c<o;c++){d=b[c*3];e=b[c*3+1];f=b[c*3+2];Z.vertices.push(new THREE.Vector3(d,e,f))}return o*3*Float32Array.BYTES_PER_ELEMENT}(B);B=B+function(b){if(m){var b=new Int8Array(a,b,m*3),c,d,e,f;for(c=0;c<m;c++){d=b[c*3];e=b[c*3+1];f=b[c*3+2];G.push(d/
 D(a,B+20+16);n=D(a,B+20+20);q=D(a,B+20+24);u=D(a,B+20+28);t=D(a,B+20+32);y=D(a,B+20+36);s=D(a,B+20+40);B=B+c;c=e*3+l;P=e*4+l;C=b*c;i=r*(c+j*3);e=n*(c+k*3);l=q*(c+j*3+k*3);c=u*P;j=t*(P+j*4);k=y*(P+k*4);B=B+function(b){var b=new Float32Array(a,b,o*3),c,d,e,f;for(c=0;c<o;c++){d=b[c*3];e=b[c*3+1];f=b[c*3+2];Z.vertices.push(new THREE.Vector3(d,e,f))}return o*3*Float32Array.BYTES_PER_ELEMENT}(B);B=B+function(b){if(m){var b=new Int8Array(a,b,m*3),c,d,e,f;for(c=0;c<m;c++){d=b[c*3];e=b[c*3+1];f=b[c*3+2];G.push(d/
 127,e/127,f/127)}}return m*3*Int8Array.BYTES_PER_ELEMENT}(B);B=B+x(m*3);B=B+function(b){if(p){var b=new Float32Array(a,b,p*2),c,d,e;for(c=0;c<p;c++){d=b[c*2];e=b[c*2+1];Q.push(d,e)}}return p*2*Float32Array.BYTES_PER_ELEMENT}(B);C=B+C+x(b*2);i=C+i+x(r*2);e=i+e+x(n*2);l=e+l+x(q*2);c=l+c+x(u*2);j=c+j+x(t*2);k=j+k+x(y*2);(function(a){if(n){var b=a+n*Uint32Array.BYTES_PER_ELEMENT*3;H(n,a,b+n*Uint32Array.BYTES_PER_ELEMENT*3);A(n,b)}})(i);(function(a){if(q){var b=a+q*Uint32Array.BYTES_PER_ELEMENT*3,c=b+
 127,e/127,f/127)}}return m*3*Int8Array.BYTES_PER_ELEMENT}(B);B=B+x(m*3);B=B+function(b){if(p){var b=new Float32Array(a,b,p*2),c,d,e;for(c=0;c<p;c++){d=b[c*2];e=b[c*2+1];Q.push(d,e)}}return p*2*Float32Array.BYTES_PER_ELEMENT}(B);C=B+C+x(b*2);i=C+i+x(r*2);e=i+e+x(n*2);l=e+l+x(q*2);c=l+c+x(u*2);j=c+j+x(t*2);k=j+k+x(y*2);(function(a){if(n){var b=a+n*Uint32Array.BYTES_PER_ELEMENT*3;H(n,a,b+n*Uint32Array.BYTES_PER_ELEMENT*3);A(n,b)}})(i);(function(a){if(q){var b=a+q*Uint32Array.BYTES_PER_ELEMENT*3,c=b+
 q*Uint32Array.BYTES_PER_ELEMENT*3;M(q,a,b,c+q*Uint32Array.BYTES_PER_ELEMENT*3);A(q,c)}})(e);(function(a){if(y){var b=a+y*Uint32Array.BYTES_PER_ELEMENT*4;I(y,a,b+y*Uint32Array.BYTES_PER_ELEMENT*4);v(y,b)}})(j);(function(a){if(s){var b=a+s*Uint32Array.BYTES_PER_ELEMENT*4,c=b+s*Uint32Array.BYTES_PER_ELEMENT*4;R(s,a,b,c+s*Uint32Array.BYTES_PER_ELEMENT*4);v(s,c)}})(k);b&&H(b,B,B+b*Uint32Array.BYTES_PER_ELEMENT*3);(function(a){if(r){var b=a+r*Uint32Array.BYTES_PER_ELEMENT*3;M(r,a,b,b+r*Uint32Array.BYTES_PER_ELEMENT*
 q*Uint32Array.BYTES_PER_ELEMENT*3;M(q,a,b,c+q*Uint32Array.BYTES_PER_ELEMENT*3);A(q,c)}})(e);(function(a){if(y){var b=a+y*Uint32Array.BYTES_PER_ELEMENT*4;I(y,a,b+y*Uint32Array.BYTES_PER_ELEMENT*4);v(y,b)}})(j);(function(a){if(s){var b=a+s*Uint32Array.BYTES_PER_ELEMENT*4,c=b+s*Uint32Array.BYTES_PER_ELEMENT*4;R(s,a,b,c+s*Uint32Array.BYTES_PER_ELEMENT*4);v(s,c)}})(k);b&&H(b,B,B+b*Uint32Array.BYTES_PER_ELEMENT*3);(function(a){if(r){var b=a+r*Uint32Array.BYTES_PER_ELEMENT*3;M(r,a,b,b+r*Uint32Array.BYTES_PER_ELEMENT*
-3)}})(C);u&&I(u,l,l+u*Uint32Array.BYTES_PER_ELEMENT*4);(function(a){if(t){var b=a+t*Uint32Array.BYTES_PER_ELEMENT*4;R(t,a,b,b+t*Uint32Array.BYTES_PER_ELEMENT*4)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;b(new e(c))};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;
+3)}})(C);u&&I(u,l,l+u*Uint32Array.BYTES_PER_ELEMENT*4);(function(a){if(t){var b=a+t*Uint32Array.BYTES_PER_ELEMENT*4;R(t,a,b,b+t*Uint32Array.BYTES_PER_ELEMENT*4)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;b(new e(c))};THREE.ImageLoader=function(){THREE.EventTarget.call(this)};
+THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,crossOrigin:"anonymous",load:function(a){var b=this,c=new Image;c.addEventListener("load",function(){b.dispatchEvent({type:"complete",image:c})},false);c.addEventListener("error",function(){b.dispatchEvent({type:"error"})},false);c.crossOrigin=this.crossOrigin;c.src=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;
 THREE.JSONLoader.prototype.load=function(a,b,c){c=c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.load=function(a,b,c){c=c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(f.status===200||f.status===0){if(f.responseText){var h=JSON.parse(f.responseText);a.createModel(h,c,d)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+f.status+"]");else if(f.readyState===f.LOADING){if(e){g===0&&(g=f.getResponseHeader("Content-Length"));
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(f.status===200||f.status===0){if(f.responseText){var h=JSON.parse(f.responseText);a.createModel(h,c,d)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+f.status+"]");else if(f.readyState===f.LOADING){if(e){g===0&&(g=f.getResponseHeader("Content-Length"));
 e({total:g,loaded:f.responseText.length})}}else f.readyState===f.HEADERS_RECEIVED&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,true);f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined");f.setRequestHeader("Content-Type","text/plain");f.send(null)};
 e({total:g,loaded:f.responseText.length})}}else f.readyState===f.HEADERS_RECEIVED&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,true);f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined");f.setRequestHeader("Content-Type","text/plain");f.send(null)};
@@ -191,9 +193,8 @@ THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.im
 THREE.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.ParticleBasicMaterial({color:Math.random()*16777215});this.sortParticles=false;if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius}this.frustumCulled=false};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;
 THREE.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.ParticleBasicMaterial({color:Math.random()*16777215});this.sortParticles=false;if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius}this.frustumCulled=false};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;
 THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.LineBasicMaterial({color:Math.random()*16777215});this.type=c!==void 0?c:THREE.LineStrip;this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere())};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
 THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.LineBasicMaterial({color:Math.random()*16777215});this.type=c!==void 0?c:THREE.LineStrip;this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere())};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
 THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.MeshBasicMaterial({color:Math.random()*16777215,wireframe:true});if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius;if(this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++){this.morphTargetInfluences.push(0);
 THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.MeshBasicMaterial({color:Math.random()*16777215,wireframe:true});if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius;if(this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++){this.morphTargetInfluences.push(0);
-this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}}}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
-THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
-THREE.Bone.prototype.update=function(a,b){this.matrixAutoUpdate&&(b=b|this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix);this.matrixWorldNeedsUpdate=false;b=true}var c,d=this.children.length;for(c=0;c<d;c++)this.children[c].update(this.skinMatrix,b)};
+this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}}}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4};
+THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.update=function(a,b){this.matrixAutoUpdate&&(b=b|this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix);this.matrixWorldNeedsUpdate=false;b=true}var c,d=this.children.length;for(c=0;c<d;c++)this.children[c].update(this.skinMatrix,b)};
 THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var c,d,e,f,g,h;if(this.geometry.bones!==void 0){for(c=0;c<this.geometry.bones.length;c++){e=this.geometry.bones[c];f=e.pos;g=e.rotq;h=e.scl;d=this.addBone();d.name=e.name;d.position.set(f[0],f[1],f[2]);d.quaternion.set(g[0],g[1],g[2],g[3]);d.useQuaternion=true;h!==void 0?d.scale.set(h[0],h[1],h[2]):d.scale.set(1,1,1)}for(c=0;c<this.bones.length;c++){e=this.geometry.bones[c];
 THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var c,d,e,f,g,h;if(this.geometry.bones!==void 0){for(c=0;c<this.geometry.bones.length;c++){e=this.geometry.bones[c];f=e.pos;g=e.rotq;h=e.scl;d=this.addBone();d.name=e.name;d.position.set(f[0],f[1],f[2]);d.quaternion.set(g[0],g[1],g[2],g[3]);d.useQuaternion=true;h!==void 0?d.scale.set(h[0],h[1],h[2]):d.scale.set(1,1,1)}for(c=0;c<this.bones.length;c++){e=this.geometry.bones[c];
 d=this.bones[c];e.parent===-1?this.add(d):this.bones[e.parent].add(d)}this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;THREE.SkinnedMesh.prototype.addBone=function(a){a===void 0&&(a=new THREE.Bone(this));this.bones.push(a);return a};
 d=this.bones[c];e.parent===-1?this.add(d):this.bones[e.parent].add(d)}this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;THREE.SkinnedMesh.prototype.addBone=function(a){a===void 0&&(a=new THREE.Bone(this));this.bones.push(a);return a};
 THREE.SkinnedMesh.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false}for(var a=0,b=this.children.length;a<b;a++){var c=this.children[a];c instanceof THREE.Bone?c.update(this.identityMatrix,false):c.updateMatrixWorld(true)}for(var b=this.bones.length,c=this.bones,d=this.boneMatrices,a=0;a<b;a++)c[a].skinMatrix.flattenToArrayOffset(d,
 THREE.SkinnedMesh.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false}for(var a=0,b=this.children.length;a<b;a++){var c=this.children[a];c instanceof THREE.Bone?c.update(this.identityMatrix,false):c.updateMatrixWorld(true)}for(var b=this.bones.length,c=this.bones,d=this.boneMatrices,a=0;a<b;a++)c[a].skinMatrix.flattenToArrayOffset(d,
@@ -206,7 +207,7 @@ THREE.MorphAnimMesh.prototype.parseAnimations=function(){var a=this.geometry;if(
 THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){if(!this.geometry.animations)this.geometry.animations={};this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];if(c){this.setFrameRange(c.start,c.end);this.duration=1E3*((c.end-c.start)/b);this.time=0}else console.warn("animation["+a+"] undefined")};
 THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){if(!this.geometry.animations)this.geometry.animations={};this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];if(c){this.setFrameRange(c.start,c.end);this.duration=1E3*((c.end-c.start)/b);this.time=0}else console.warn("animation["+a+"] undefined")};
 THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time=this.time+this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||this.time<0){this.direction=this.direction*-1;if(this.time>this.duration){this.time=this.duration;this.directionBackwards=true}if(this.time<0){this.time=0;this.directionBackwards=false}}}else{this.time=this.time%this.duration;if(this.time<0)this.time=this.time+this.duration}a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/
 THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time=this.time+this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||this.time<0){this.direction=this.direction*-1;if(this.time>this.duration){this.time=this.duration;this.directionBackwards=true}if(this.time<0){this.time=0;this.directionBackwards=false}}}else{this.time=this.time%this.duration;if(this.time<0)this.time=this.time+this.duration}a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/
 b),0,this.length-1);if(a!==this.currentKeyframe){this.morphTargetInfluences[this.lastKeyframe]=0;this.morphTargetInfluences[this.currentKeyframe]=1;this.morphTargetInfluences[a]=0;this.lastKeyframe=this.currentKeyframe;this.currentKeyframe=a}b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b};THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b};
 b),0,this.length-1);if(a!==this.currentKeyframe){this.morphTargetInfluences[this.lastKeyframe]=0;this.morphTargetInfluences[this.currentKeyframe]=1;this.morphTargetInfluences[a]=0;this.lastKeyframe=this.currentKeyframe;this.currentKeyframe=a}b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b};THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b};
-THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c<this.LODs.length;c++)if(b<this.LODs[c].visibleAtDistance)break;this.LODs.splice(c,0,{visibleAtDistance:b,object3D:a});this.add(a)};
+THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c<this.LODs.length;c++)if(b<this.LODs[c].visibleAtDistance)break;this.LODs.splice(c,0,{visibleAtDistance:b,object3D:a});this.add(a)};
 THREE.LOD.prototype.update=function(a){if(this.LODs.length>1){a.matrixWorldInverse.getInverse(a.matrixWorld);a=a.matrixWorldInverse;a=-(a.elements[2]*this.matrixWorld.elements[12]+a.elements[6]*this.matrixWorld.elements[13]+a.elements[10]*this.matrixWorld.elements[14]+a.elements[14]);this.LODs[0].object3D.visible=true;for(var b=1;b<this.LODs.length;b++)if(a>=this.LODs[b].visibleAtDistance){this.LODs[b-1].object3D.visible=false;this.LODs[b].object3D.visible=true}else break;for(;b<this.LODs.length;b++)this.LODs[b].object3D.visible=
 THREE.LOD.prototype.update=function(a){if(this.LODs.length>1){a.matrixWorldInverse.getInverse(a.matrixWorld);a=a.matrixWorldInverse;a=-(a.elements[2]*this.matrixWorld.elements[12]+a.elements[6]*this.matrixWorld.elements[13]+a.elements[10]*this.matrixWorld.elements[14]+a.elements[14]);this.LODs[0].object3D.visible=true;for(var b=1;b<this.LODs.length;b++)if(a>=this.LODs[b].visibleAtDistance){this.LODs[b-1].object3D.visible=false;this.LODs[b].object3D.visible=true}else break;for(;b<this.LODs.length;b++)this.LODs[b].object3D.visible=
 false}};
 false}};
 THREE.Sprite=function(a){THREE.Object3D.call(this);this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:new THREE.Texture;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.blendSrc=a.blendSrc!==void 0?a.blendSrc:THREE.SrcAlphaFactor;this.blendDst=a.blendDst!==void 0?a.blendDst:THREE.OneMinusSrcAlphaFactor;this.blendEquation=a.blendEquation!==void 0?a.blendEquation:THREE.AddEquation;this.useScreenCoordinates=a.useScreenCoordinates!==void 0?
 THREE.Sprite=function(a){THREE.Object3D.call(this);this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:new THREE.Texture;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.blendSrc=a.blendSrc!==void 0?a.blendSrc:THREE.SrcAlphaFactor;this.blendDst=a.blendDst!==void 0?a.blendDst:THREE.OneMinusSrcAlphaFactor;this.blendEquation=a.blendEquation!==void 0?a.blendEquation:THREE.AddEquation;this.useScreenCoordinates=a.useScreenCoordinates!==void 0?
@@ -237,15 +238,15 @@ $.r=Math.max(0,Math.min(m.color.r*$.r,1));$.g=Math.max(0,Math.min(m.color.g*$.g,
 ha.b,1));Ta=Cc($,U,Y,ha);x(B,G,Q,C,L,S);hc(B,G,Q,C,L,S,0,0,1,0,0,1,Ta);x(aa,N,i,P,ca,fa);hc(aa,N,i,P,ca,fa,1,0,1,1,0,1,Ta)}else{O.r=wa.r;O.g=wa.g;O.b=wa.b;o(j,n.centroidWorld,n.normalWorld,O);O.r=Math.max(0,Math.min(m.color.r*O.r,1));O.g=Math.max(0,Math.min(m.color.g*O.g,1));O.b=Math.max(0,Math.min(m.color.b*O.b,1));y(B,G,Q,C,i,P,L,S);m.wireframe?Mb(O,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Fb(O)}else{y(B,G,Q,C,i,P,L,S);m.wireframe?Mb(m.color,m.wireframeLinewidth,m.wireframeLinecap,
 ha.b,1));Ta=Cc($,U,Y,ha);x(B,G,Q,C,L,S);hc(B,G,Q,C,L,S,0,0,1,0,0,1,Ta);x(aa,N,i,P,ca,fa);hc(aa,N,i,P,ca,fa,1,0,1,1,0,1,Ta)}else{O.r=wa.r;O.g=wa.g;O.b=wa.b;o(j,n.centroidWorld,n.normalWorld,O);O.r=Math.max(0,Math.min(m.color.r*O.r,1));O.g=Math.max(0,Math.min(m.color.g*O.g,1));O.b=Math.max(0,Math.min(m.color.b*O.b,1));y(B,G,Q,C,i,P,L,S);m.wireframe?Mb(O,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Fb(O)}else{y(B,G,Q,C,i,P,L,S);m.wireframe?Mb(m.color,m.wireframeLinewidth,m.wireframeLinecap,
 m.wireframeLinejoin):Fb(m.color)}else if(m instanceof THREE.MeshNormalMaterial){O.r=ic(n.normalWorld.x);O.g=ic(n.normalWorld.y);O.b=ic(n.normalWorld.z);y(B,G,Q,C,i,P,L,S);m.wireframe?Mb(O,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Fb(O)}else if(m instanceof THREE.MeshDepthMaterial){Oa=l.near;oa=l.far;$.r=$.g=$.b=1-bc(a.positionScreen.z,Oa,oa);U.r=U.g=U.b=1-bc(d.positionScreen.z,Oa,oa);Y.r=Y.g=Y.b=1-bc(g.positionScreen.z,Oa,oa);ha.r=ha.g=ha.b=1-bc(e.positionScreen.z,Oa,oa);Ta=Cc($,
 m.wireframeLinejoin):Fb(m.color)}else if(m instanceof THREE.MeshNormalMaterial){O.r=ic(n.normalWorld.x);O.g=ic(n.normalWorld.y);O.b=ic(n.normalWorld.z);y(B,G,Q,C,i,P,L,S);m.wireframe?Mb(O,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Fb(O)}else if(m instanceof THREE.MeshDepthMaterial){Oa=l.near;oa=l.far;$.r=$.g=$.b=1-bc(a.positionScreen.z,Oa,oa);U.r=U.g=U.b=1-bc(d.positionScreen.z,Oa,oa);Y.r=Y.g=Y.b=1-bc(g.positionScreen.z,Oa,oa);ha.r=ha.g=ha.b=1-bc(e.positionScreen.z,Oa,oa);Ta=Cc($,
 U,Y,ha);x(B,G,Q,C,L,S);hc(B,G,Q,C,L,S,0,0,1,0,0,1,Ta);x(aa,N,i,P,ca,fa);hc(aa,N,i,P,ca,fa,1,0,1,1,0,1,Ta)}}}function x(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n.lineTo(e,f);n.lineTo(a,b)}function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n.lineTo(e,f);n.lineTo(g,i);n.lineTo(a,b)}function Mb(a,b,c,e){if(E!=b)n.lineWidth=E=b;if(D!=c)n.lineCap=D=c;if(A!=e)n.lineJoin=A=e;d(a.getContextStyle());n.stroke();ya.inflate(b*2)}function Fb(a){e(a.getContextStyle());n.fill()}
 U,Y,ha);x(B,G,Q,C,L,S);hc(B,G,Q,C,L,S,0,0,1,0,0,1,Ta);x(aa,N,i,P,ca,fa);hc(aa,N,i,P,ca,fa,1,0,1,1,0,1,Ta)}}}function x(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n.lineTo(e,f);n.lineTo(a,b)}function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n.lineTo(e,f);n.lineTo(g,i);n.lineTo(a,b)}function Mb(a,b,c,e){if(E!=b)n.lineWidth=E=b;if(D!=c)n.lineCap=D=c;if(A!=e)n.lineJoin=A=e;d(a.getContextStyle());n.stroke();ya.inflate(b*2)}function Fb(a){e(a.getContextStyle());n.fill()}
-function $c(a,b,c,d,f,g,i,h,j,k,l,m,o){if(o.image.width!=0){if(o.needsUpdate==true||Sa[o.id]==void 0){var p=o.wrapS==THREE.RepeatWrapping,Ja=o.wrapT==THREE.RepeatWrapping;Sa[o.id]=n.createPattern(o.image,p&&Ja?"repeat":p&&!Ja?"repeat-x":!p&&Ja?"repeat-y":"no-repeat");o.needsUpdate=false}e(Sa[o.id]);var p=o.offset.x/o.repeat.x,Ja=o.offset.y/o.repeat.y,r=o.image.width*o.repeat.x,q=o.image.height*o.repeat.y,i=(i+p)*r,h=(h+Ja)*q,c=c-a,d=d-b,f=f-a,g=g-b,j=(j+p)*r-i,k=(k+Ja)*q-h,l=(l+p)*r-i,m=(m+Ja)*q-
-h,p=j*m-l*k;if(p==0){if(Ma[o.id]===void 0){b=document.createElement("canvas");b.width=o.image.width;b.height=o.image.height;b=b.getContext("2d");b.drawImage(o.image,0,0);Ma[o.id]=b.getImageData(0,0,o.image.width,o.image.height).data}b=Ma[o.id];i=(Math.floor(i)+Math.floor(h)*o.image.width)*4;O.setRGB(b[i]/255,b[i+1]/255,b[i+2]/255);Fb(O)}else{p=1/p;o=(m*c-k*f)*p;k=(m*d-k*g)*p;c=(j*f-l*c)*p;d=(j*g-l*d)*p;a=a-o*i-c*h;i=b-k*i-d*h;n.save();n.transform(o,k,c,d,a,i);n.fill();n.restore()}}}function hc(a,
-b,c,d,e,f,g,i,h,j,k,l,m){var o,p;o=m.width-1;p=m.height-1;g=g*o;i=i*p;c=c-a;d=d-b;e=e-a;f=f-b;h=h*o-g;j=j*p-i;k=k*o-g;l=l*p-i;p=1/(h*l-k*j);o=(l*c-j*e)*p;j=(l*d-j*f)*p;c=(h*e-k*c)*p;d=(h*f-k*d)*p;a=a-o*g-c*i;b=b-j*g-d*i;n.save();n.transform(o,j,c,d,a,b);n.clip();n.drawImage(m,0,0);n.restore()}function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(b.r*255),i=~~(b.g*255),b=~~(b.b*255),h=~~(c.r*255),j=~~(c.g*255),c=~~(c.b*255),k=~~(d.r*255),l=~~(d.g*255),d=~~(d.b*255);Ja[0]=e<0?0:e>
-255?255:e;Ja[1]=f<0?0:f>255?255:f;Ja[2]=a<0?0:a>255?255:a;Ja[4]=g<0?0:g>255?255:g;Ja[5]=i<0?0:i>255?255:i;Ja[6]=b<0?0:b>255?255:b;Ja[8]=h<0?0:h>255?255:h;Ja[9]=j<0?0:j>255?255:j;Ja[10]=c<0?0:c>255?255:c;Ja[12]=k<0?0:k>255?255:k;Ja[13]=l<0?0:l>255?255:l;Ja[14]=d<0?0:d>255?255:d;$a.putImageData(ac,0,0);Bc.drawImage(ob,0,0);return pc}function bc(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function ic(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqrt(e);
-c=c*e;d=d*e;b.x=b.x+c;b.y=b.y+d;a.x=a.x-c;a.y=a.y-d}}var Dc,ad,Ka,hb;this.autoClear?this.clear():n.setTransform(1,0,0,-1,p,r);f.info.render.vertices=0;f.info.render.faces=0;g=k.projectScene(a,l,this.sortElements);h=g.elements;j=g.lights;(gb=j.length>0)&&m(j);Dc=0;for(ad=h.length;Dc<ad;Dc++){Ka=h[Dc];hb=Ka.material;hb=hb instanceof THREE.MeshFaceMaterial?Ka.faceMaterial:hb;if(!(hb===void 0||hb.visible===false)){ya.empty();if(Ka instanceof THREE.RenderableParticle){v=Ka;v.x=v.x*p;v.y=v.y*r;q(v,Ka,hb,
-a)}else if(Ka instanceof THREE.RenderableLine){v=Ka.v1;H=Ka.v2;v.positionScreen.x=v.positionScreen.x*p;v.positionScreen.y=v.positionScreen.y*r;H.positionScreen.x=H.positionScreen.x*p;H.positionScreen.y=H.positionScreen.y*r;ya.addPoint(v.positionScreen.x,v.positionScreen.y);ya.addPoint(H.positionScreen.x,H.positionScreen.y);ab.intersects(ya)&&s(v,H,Ka,hb,a)}else if(Ka instanceof THREE.RenderableFace3){v=Ka.v1;H=Ka.v2;I=Ka.v3;v.positionScreen.x=v.positionScreen.x*p;v.positionScreen.y=v.positionScreen.y*
-r;H.positionScreen.x=H.positionScreen.x*p;H.positionScreen.y=H.positionScreen.y*r;I.positionScreen.x=I.positionScreen.x*p;I.positionScreen.y=I.positionScreen.y*r;if(hb.overdraw){Nb(v.positionScreen,H.positionScreen);Nb(H.positionScreen,I.positionScreen);Nb(I.positionScreen,v.positionScreen)}ya.add3Points(v.positionScreen.x,v.positionScreen.y,H.positionScreen.x,H.positionScreen.y,I.positionScreen.x,I.positionScreen.y);ab.intersects(ya)&&t(v,H,I,0,1,2,Ka,hb,a)}else if(Ka instanceof THREE.RenderableFace4){v=
-Ka.v1;H=Ka.v2;I=Ka.v3;M=Ka.v4;v.positionScreen.x=v.positionScreen.x*p;v.positionScreen.y=v.positionScreen.y*r;H.positionScreen.x=H.positionScreen.x*p;H.positionScreen.y=H.positionScreen.y*r;I.positionScreen.x=I.positionScreen.x*p;I.positionScreen.y=I.positionScreen.y*r;M.positionScreen.x=M.positionScreen.x*p;M.positionScreen.y=M.positionScreen.y*r;R.positionScreen.copy(H.positionScreen);Z.positionScreen.copy(M.positionScreen);if(hb.overdraw){Nb(v.positionScreen,H.positionScreen);Nb(H.positionScreen,
-M.positionScreen);Nb(M.positionScreen,v.positionScreen);Nb(I.positionScreen,R.positionScreen);Nb(I.positionScreen,Z.positionScreen)}ya.addPoint(v.positionScreen.x,v.positionScreen.y);ya.addPoint(H.positionScreen.x,H.positionScreen.y);ya.addPoint(I.positionScreen.x,I.positionScreen.y);ya.addPoint(M.positionScreen.x,M.positionScreen.y);ab.intersects(ya)&&u(v,H,I,M,R,Z,Ka,hb,a)}Ba.addRectangle(ya)}}n.setTransform(1,0,0,1,0,0)}};
+function $c(a,b,c,d,f,g,i,h,j,k,l,m,o){if(!(o.image===void 0||o.image.width===0)){if(o.needsUpdate===true||Sa[o.id]===void 0){var p=o.wrapS==THREE.RepeatWrapping,Ja=o.wrapT==THREE.RepeatWrapping;Sa[o.id]=n.createPattern(o.image,p&&Ja?"repeat":p&&!Ja?"repeat-x":!p&&Ja?"repeat-y":"no-repeat");o.needsUpdate=false}e(Sa[o.id]);var p=o.offset.x/o.repeat.x,Ja=o.offset.y/o.repeat.y,r=o.image.width*o.repeat.x,q=o.image.height*o.repeat.y,i=(i+p)*r,h=(h+Ja)*q,c=c-a,d=d-b,f=f-a,g=g-b,j=(j+p)*r-i,k=(k+Ja)*q-h,
+l=(l+p)*r-i,m=(m+Ja)*q-h,p=j*m-l*k;if(p==0){if(Ma[o.id]===void 0){b=document.createElement("canvas");b.width=o.image.width;b.height=o.image.height;b=b.getContext("2d");b.drawImage(o.image,0,0);Ma[o.id]=b.getImageData(0,0,o.image.width,o.image.height).data}b=Ma[o.id];i=(Math.floor(i)+Math.floor(h)*o.image.width)*4;O.setRGB(b[i]/255,b[i+1]/255,b[i+2]/255);Fb(O)}else{p=1/p;o=(m*c-k*f)*p;k=(m*d-k*g)*p;c=(j*f-l*c)*p;d=(j*g-l*d)*p;a=a-o*i-c*h;i=b-k*i-d*h;n.save();n.transform(o,k,c,d,a,i);n.fill();n.restore()}}}
+function hc(a,b,c,d,e,f,g,i,h,j,k,l,m){var o,p;o=m.width-1;p=m.height-1;g=g*o;i=i*p;c=c-a;d=d-b;e=e-a;f=f-b;h=h*o-g;j=j*p-i;k=k*o-g;l=l*p-i;p=1/(h*l-k*j);o=(l*c-j*e)*p;j=(l*d-j*f)*p;c=(h*e-k*c)*p;d=(h*f-k*d)*p;a=a-o*g-c*i;b=b-j*g-d*i;n.save();n.transform(o,j,c,d,a,b);n.clip();n.drawImage(m,0,0);n.restore()}function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(b.r*255),i=~~(b.g*255),b=~~(b.b*255),h=~~(c.r*255),j=~~(c.g*255),c=~~(c.b*255),k=~~(d.r*255),l=~~(d.g*255),d=~~(d.b*255);
+Ja[0]=e<0?0:e>255?255:e;Ja[1]=f<0?0:f>255?255:f;Ja[2]=a<0?0:a>255?255:a;Ja[4]=g<0?0:g>255?255:g;Ja[5]=i<0?0:i>255?255:i;Ja[6]=b<0?0:b>255?255:b;Ja[8]=h<0?0:h>255?255:h;Ja[9]=j<0?0:j>255?255:j;Ja[10]=c<0?0:c>255?255:c;Ja[12]=k<0?0:k>255?255:k;Ja[13]=l<0?0:l>255?255:l;Ja[14]=d<0?0:d>255?255:d;$a.putImageData(ac,0,0);Bc.drawImage(ob,0,0);return pc}function bc(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function ic(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=
+0){e=1/Math.sqrt(e);c=c*e;d=d*e;b.x=b.x+c;b.y=b.y+d;a.x=a.x-c;a.y=a.y-d}}var Dc,ad,Ka,hb;this.autoClear?this.clear():n.setTransform(1,0,0,-1,p,r);f.info.render.vertices=0;f.info.render.faces=0;g=k.projectScene(a,l,this.sortElements);h=g.elements;j=g.lights;(gb=j.length>0)&&m(j);Dc=0;for(ad=h.length;Dc<ad;Dc++){Ka=h[Dc];hb=Ka.material;hb=hb instanceof THREE.MeshFaceMaterial?Ka.faceMaterial:hb;if(!(hb===void 0||hb.visible===false)){ya.empty();if(Ka instanceof THREE.RenderableParticle){v=Ka;v.x=v.x*
+p;v.y=v.y*r;q(v,Ka,hb,a)}else if(Ka instanceof THREE.RenderableLine){v=Ka.v1;H=Ka.v2;v.positionScreen.x=v.positionScreen.x*p;v.positionScreen.y=v.positionScreen.y*r;H.positionScreen.x=H.positionScreen.x*p;H.positionScreen.y=H.positionScreen.y*r;ya.addPoint(v.positionScreen.x,v.positionScreen.y);ya.addPoint(H.positionScreen.x,H.positionScreen.y);ab.intersects(ya)&&s(v,H,Ka,hb,a)}else if(Ka instanceof THREE.RenderableFace3){v=Ka.v1;H=Ka.v2;I=Ka.v3;v.positionScreen.x=v.positionScreen.x*p;v.positionScreen.y=
+v.positionScreen.y*r;H.positionScreen.x=H.positionScreen.x*p;H.positionScreen.y=H.positionScreen.y*r;I.positionScreen.x=I.positionScreen.x*p;I.positionScreen.y=I.positionScreen.y*r;if(hb.overdraw){Nb(v.positionScreen,H.positionScreen);Nb(H.positionScreen,I.positionScreen);Nb(I.positionScreen,v.positionScreen)}ya.add3Points(v.positionScreen.x,v.positionScreen.y,H.positionScreen.x,H.positionScreen.y,I.positionScreen.x,I.positionScreen.y);ab.intersects(ya)&&t(v,H,I,0,1,2,Ka,hb,a)}else if(Ka instanceof
+THREE.RenderableFace4){v=Ka.v1;H=Ka.v2;I=Ka.v3;M=Ka.v4;v.positionScreen.x=v.positionScreen.x*p;v.positionScreen.y=v.positionScreen.y*r;H.positionScreen.x=H.positionScreen.x*p;H.positionScreen.y=H.positionScreen.y*r;I.positionScreen.x=I.positionScreen.x*p;I.positionScreen.y=I.positionScreen.y*r;M.positionScreen.x=M.positionScreen.x*p;M.positionScreen.y=M.positionScreen.y*r;R.positionScreen.copy(H.positionScreen);Z.positionScreen.copy(M.positionScreen);if(hb.overdraw){Nb(v.positionScreen,H.positionScreen);
+Nb(H.positionScreen,M.positionScreen);Nb(M.positionScreen,v.positionScreen);Nb(I.positionScreen,R.positionScreen);Nb(I.positionScreen,Z.positionScreen)}ya.addPoint(v.positionScreen.x,v.positionScreen.y);ya.addPoint(H.positionScreen.x,H.positionScreen.y);ya.addPoint(I.positionScreen.x,I.positionScreen.y);ya.addPoint(M.positionScreen.x,M.positionScreen.y);ab.intersects(ya)&&u(v,H,I,M,R,Z,Ka,hb,a)}Ba.addRectangle(ya)}}n.setTransform(1,0,0,1,0,0)}};
 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",
 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 float flipEnvMap;\nuniform int combine;\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * vReflect.x, vReflect.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * vReflect.x, vReflect.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity );\n} else {\ngl_FragColor.xyz = gl_FragColor.xyz * cubeColor.xyz;\n}\n#endif",
 envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * vReflect.x, vReflect.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * vReflect.x, vReflect.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity );\n} else {\ngl_FragColor.xyz = gl_FragColor.xyz * cubeColor.xyz;\n}\n#endif",
 envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[ 0 ].xyz, objectMatrix[ 1 ].xyz, objectMatrix[ 2 ].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",
 envmap_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",
@@ -443,10 +444,10 @@ y.vertexNormals[2].copy(g);s.vertexNormals[0].copy(f);s.vertexNormals[3].copy(g)
 f.lerpSelf(e.vertexNormals[2],0.5);g=e.vertexNormals[3].clone();g.lerpSelf(e.vertexNormals[0],0.5);y.vertexNormals[2].copy(f);y.vertexNormals[3].copy(g);s.vertexNormals[0].copy(g);s.vertexNormals[1].copy(f)}if(e.vertexColors.length===4){f=e.vertexColors[1].clone();f.lerpSelf(e.vertexColors[2],0.5);g=e.vertexColors[3].clone();g.lerpSelf(e.vertexColors[0],0.5);y.vertexColors[2].copy(f);y.vertexColors[3].copy(g);s.vertexColors[0].copy(g);s.vertexColors[1].copy(f)}e=1}x.push(y,s);a.vertices.push(p,l);
 f.lerpSelf(e.vertexNormals[2],0.5);g=e.vertexNormals[3].clone();g.lerpSelf(e.vertexNormals[0],0.5);y.vertexNormals[2].copy(f);y.vertexNormals[3].copy(g);s.vertexNormals[0].copy(g);s.vertexNormals[1].copy(f)}if(e.vertexColors.length===4){f=e.vertexColors[1].clone();f.lerpSelf(e.vertexColors[2],0.5);g=e.vertexColors[3].clone();g.lerpSelf(e.vertexColors[0],0.5);y.vertexColors[2].copy(f);y.vertexColors[3].copy(g);s.vertexColors[0].copy(g);s.vertexColors[1].copy(f)}e=1}x.push(y,s);a.vertices.push(p,l);
 f=0;for(g=a.faceVertexUvs.length;f<g;f++)if(a.faceVertexUvs[f].length){k=a.faceVertexUvs[f][c];s=k[0];h=k[1];y=k[2];k=k[3];if(e===0){l=s.clone();l.lerpSelf(h,0.5);o=y.clone();o.lerpSelf(k,0.5);s=[s.clone(),l.clone(),o.clone(),k.clone()];h=[l.clone(),h.clone(),y.clone(),o.clone()]}else{l=h.clone();l.lerpSelf(y,0.5);o=k.clone();o.lerpSelf(s,0.5);s=[s.clone(),h.clone(),l.clone(),o.clone()];h=[o.clone(),l.clone(),y.clone(),k.clone()]}E[f].push(s,h)}}else{x.push(e);f=0;for(g=a.faceVertexUvs.length;f<g;f++)E[f].push(a.faceVertexUvs[f][c])}}}a.faces=
 f=0;for(g=a.faceVertexUvs.length;f<g;f++)if(a.faceVertexUvs[f].length){k=a.faceVertexUvs[f][c];s=k[0];h=k[1];y=k[2];k=k[3];if(e===0){l=s.clone();l.lerpSelf(h,0.5);o=y.clone();o.lerpSelf(k,0.5);s=[s.clone(),l.clone(),o.clone(),k.clone()];h=[l.clone(),h.clone(),y.clone(),o.clone()]}else{l=h.clone();l.lerpSelf(y,0.5);o=k.clone();o.lerpSelf(s,0.5);s=[s.clone(),h.clone(),l.clone(),o.clone()];h=[o.clone(),l.clone(),y.clone(),k.clone()]}E[f].push(s,h)}}else{x.push(e);f=0;for(g=a.faceVertexUvs.length;f<g;f++)E[f].push(a.faceVertexUvs[f][c])}}}a.faces=
 x;a.faceVertexUvs=E}};THREE.GeometryUtils.random=THREE.Math.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;
 x;a.faceVertexUvs=E}};THREE.GeometryUtils.random=THREE.Math.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;
-THREE.ImageUtils={crossOrigin:"anonymous",loadTexture:function(a,b,c){var d=new Image,e=new THREE.Texture(d,b);d.onload=function(){e.needsUpdate=true;c&&c(this)};d.crossOrigin=this.crossOrigin;d.src=a;return e},loadTextureCube:function(a,b,c){var d,e=[],f=new THREE.Texture(e,b),b=e.loadCount=0;for(d=a.length;b<d;++b){e[b]=new Image;e[b].onload=function(){e.loadCount=e.loadCount+1;if(e.loadCount===6)f.needsUpdate=true;c&&c(this)};e[b].crossOrigin=this.crossOrigin;e[b].src=a[b]}return f},getNormalMap:function(a,
-b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]},b=b|1,d=a.width,e=a.height,f=document.createElement("canvas");f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,j=g.createImageData(d,e),k=j.data,l=0;l<d;l++)for(var o=0;o<e;o++){var m=o-1<0?0:o-1,p=o+1>e-1?e-1:o+1,r=l-1<0?0:l-1,n=l+1>d-1?d-1:l+1,q=[],u=[0,0,h[(o*d+l)*4]/255*b];q.push([-1,0,h[(o*d+r)*4]/255*b]);q.push([-1,-1,h[(m*d+r)*4]/255*b]);q.push([0,
--1,h[(m*d+l)*4]/255*b]);q.push([1,-1,h[(m*d+n)*4]/255*b]);q.push([1,0,h[(o*d+n)*4]/255*b]);q.push([1,1,h[(p*d+n)*4]/255*b]);q.push([0,1,h[(p*d+l)*4]/255*b]);q.push([-1,1,h[(p*d+r)*4]/255*b]);m=[];r=q.length;for(p=0;p<r;p++){var n=q[p],t=q[(p+1)%r],n=[n[0]-u[0],n[1]-u[1],n[2]-u[2]],t=[t[0]-u[0],t[1]-u[1],t[2]-u[2]];m.push(c([n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]))}q=[0,0,0];for(p=0;p<m.length;p++){q[0]=q[0]+m[p][0];q[1]=q[1]+m[p][1];q[2]=q[2]+m[p][2]}q[0]=q[0]/m.length;q[1]=
-q[1]/m.length;q[2]=q[2]/m.length;u=(o*d+l)*4;k[u]=(q[0]+1)/2*255|0;k[u+1]=(q[1]+1)/2*255|0;k[u+2]=q[2]*255|0;k[u+3]=255}g.putImageData(j,0,0);return f},generateDataTexture:function(a,b,c){for(var d=a*b,e=new Uint8Array(3*d),f=Math.floor(c.r*255),g=Math.floor(c.g*255),c=Math.floor(c.b*255),h=0;h<d;h++){e[h*3]=f;e[h*3+1]=g;e[h*3+2]=c}a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=true;return a}};
+THREE.ImageUtils={crossOrigin:"anonymous",loadTexture:function(a,b,c){var d=new THREE.Texture(void 0,b),b=new THREE.ImageLoader;b.crossOrigin=this.crossOrigin;b.addEventListener("complete",function(a){d.image=a.image;d.needsUpdate=true;c&&c(this)});b.load(a);return d},loadTextureCube:function(a,b,c){var d,e=[],f=new THREE.Texture(e,b),b=e.loadCount=0;for(d=a.length;b<d;++b){e[b]=new Image;e[b].onload=function(){e.loadCount=e.loadCount+1;if(e.loadCount===6)f.needsUpdate=true;c&&c(this)};e[b].crossOrigin=
+this.crossOrigin;e[b].src=a[b]}return f},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]},b=b|1,d=a.width,e=a.height,f=document.createElement("canvas");f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,j=g.createImageData(d,e),k=j.data,l=0;l<d;l++)for(var o=0;o<e;o++){var m=o-1<0?0:o-1,p=o+1>e-1?e-1:o+1,r=l-1<0?0:l-1,n=l+1>d-1?d-1:l+1,q=[],u=[0,0,h[(o*d+l)*4]/255*b];q.push([-1,
+0,h[(o*d+r)*4]/255*b]);q.push([-1,-1,h[(m*d+r)*4]/255*b]);q.push([0,-1,h[(m*d+l)*4]/255*b]);q.push([1,-1,h[(m*d+n)*4]/255*b]);q.push([1,0,h[(o*d+n)*4]/255*b]);q.push([1,1,h[(p*d+n)*4]/255*b]);q.push([0,1,h[(p*d+l)*4]/255*b]);q.push([-1,1,h[(p*d+r)*4]/255*b]);m=[];r=q.length;for(p=0;p<r;p++){var n=q[p],t=q[(p+1)%r],n=[n[0]-u[0],n[1]-u[1],n[2]-u[2]],t=[t[0]-u[0],t[1]-u[1],t[2]-u[2]];m.push(c([n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]))}q=[0,0,0];for(p=0;p<m.length;p++){q[0]=q[0]+
+m[p][0];q[1]=q[1]+m[p][1];q[2]=q[2]+m[p][2]}q[0]=q[0]/m.length;q[1]=q[1]/m.length;q[2]=q[2]/m.length;u=(o*d+l)*4;k[u]=(q[0]+1)/2*255|0;k[u+1]=(q[1]+1)/2*255|0;k[u+2]=q[2]*255|0;k[u+3]=255}g.putImageData(j,0,0);return f},generateDataTexture:function(a,b,c){for(var d=a*b,e=new Uint8Array(3*d),f=Math.floor(c.r*255),g=Math.floor(c.g*255),c=Math.floor(c.b*255),h=0;h<d;h++){e[h*3]=f;e[h*3+1]=g;e[h*3+2]=c}a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=true;return a}};
 THREE.SceneUtils={showHierarchy:function(a,b){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=b})},traverseHierarchy:function(a,b){var c,d,e=a.children.length;for(d=0;d<e;d++){c=a.children[d];b(c);THREE.SceneUtils.traverseHierarchy(c,b)}},createMultiMaterialObject:function(a,b){var c,d=b.length,e=new THREE.Object3D;for(c=0;c<d;c++){var f=new THREE.Mesh(a,b[c]);e.add(f)}return e},cloneObject:function(a){var b;if(a instanceof THREE.MorphAnimMesh){b=new THREE.MorphAnimMesh(a.geometry,a.material);
 THREE.SceneUtils={showHierarchy:function(a,b){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=b})},traverseHierarchy:function(a,b){var c,d,e=a.children.length;for(d=0;d<e;d++){c=a.children[d];b(c);THREE.SceneUtils.traverseHierarchy(c,b)}},createMultiMaterialObject:function(a,b){var c,d=b.length,e=new THREE.Object3D;for(c=0;c<d;c++){var f=new THREE.Mesh(a,b[c]);e.add(f)}return e},cloneObject:function(a){var b;if(a instanceof THREE.MorphAnimMesh){b=new THREE.MorphAnimMesh(a.geometry,a.material);
 b.duration=a.duration;b.mirroredLoop=a.mirroredLoop;b.time=a.time;b.lastKeyframe=a.lastKeyframe;b.currentKeyframe=a.currentKeyframe;b.direction=a.direction;b.directionBackwards=a.directionBackwards}else if(a instanceof THREE.SkinnedMesh)b=new THREE.SkinnedMesh(a.geometry,a.material);else if(a instanceof THREE.Mesh)b=new THREE.Mesh(a.geometry,a.material);else if(a instanceof THREE.Line)b=new THREE.Line(a.geometry,a.material,a.type);else if(a instanceof THREE.Ribbon)b=new THREE.Ribbon(a.geometry,a.material);
 b.duration=a.duration;b.mirroredLoop=a.mirroredLoop;b.time=a.time;b.lastKeyframe=a.lastKeyframe;b.currentKeyframe=a.currentKeyframe;b.direction=a.direction;b.directionBackwards=a.directionBackwards}else if(a instanceof THREE.SkinnedMesh)b=new THREE.SkinnedMesh(a.geometry,a.material);else if(a instanceof THREE.Mesh)b=new THREE.Mesh(a.geometry,a.material);else if(a instanceof THREE.Line)b=new THREE.Line(a.geometry,a.material,a.type);else if(a instanceof THREE.Ribbon)b=new THREE.Ribbon(a.geometry,a.material);
 else if(a instanceof THREE.ParticleSystem){b=new THREE.ParticleSystem(a.geometry,a.material);b.sortParticles=a.sortParticles}else if(a instanceof THREE.Particle)b=new THREE.Particle(a.material);else if(a instanceof THREE.Sprite){b=new THREE.Sprite({});b.color.copy(a.color);b.map=a.map;b.blending=a.blending;b.useScreenCoordinates=a.useScreenCoordinates;b.mergeWith3D=a.mergeWith3D;b.affectedByDistance=a.affectedByDistance;b.scaleByViewport=a.scaleByViewport;b.alignment=a.alignment;b.rotation3d.copy(a.rotation3d);
 else if(a instanceof THREE.ParticleSystem){b=new THREE.ParticleSystem(a.geometry,a.material);b.sortParticles=a.sortParticles}else if(a instanceof THREE.Particle)b=new THREE.Particle(a.material);else if(a instanceof THREE.Sprite){b=new THREE.Sprite({});b.color.copy(a.color);b.map=a.map;b.blending=a.blending;b.useScreenCoordinates=a.useScreenCoordinates;b.mergeWith3D=a.mergeWith3D;b.affectedByDistance=a.affectedByDistance;b.scaleByViewport=a.scaleByViewport;b.alignment=a.alignment;b.rotation3d.copy(a.rotation3d);
@@ -462,6 +463,13 @@ THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"v
 THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;\nuniform vec2 uOffset;\nuniform vec2 uRepeat;\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;",
 THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;\nuniform vec2 uOffset;\nuniform vec2 uRepeat;\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;",
 THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvViewPosition = -mvPosition.xyz;\nvNormal = normalMatrix * normal;\nvTangent = normalMatrix * tangent.xyz;\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvUv = uv * uRepeat + uOffset;\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( normalize( vNormal.xyz ) * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif",
 THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvViewPosition = -mvPosition.xyz;\nvNormal = normalMatrix * normal;\nvTangent = normalMatrix * tangent.xyz;\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvUv = uv * uRepeat + uOffset;\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( normalize( vNormal.xyz ) * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif",
 THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:1,texture:null},tFlip:{type:"f",value:-1}},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;\nuniform float tFlip;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( tFlip * wPos.x, wPos.yz ) );\n}"}}});
 THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:1,texture:null},tFlip:{type:"f",value:-1}},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;\nuniform float tFlip;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( tFlip * wPos.x, wPos.yz ) );\n}"}}});
+THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},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,d=
+0,e=(""+a).split(""),f=e.length,g=[],a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,j,k,l,o,m,p,r,n,q,u=b.glyphs[a]||b.glyphs["?"];if(u){if(u.o){b=u._cachedOutline||(u._cachedOutline=u.o.split(" "));k=b.length;for(a=0;a<k;){j=b[a++];switch(j){case "m":j=b[a++]*c+d;l=b[a++]*c;e.moveTo(j,l);break;case "l":j=b[a++]*c+d;l=b[a++]*c;e.lineTo(j,l);break;case "q":j=b[a++]*
+c+d;l=b[a++]*c;p=b[a++]*c+d;r=b[a++]*c;e.quadraticCurveTo(p,r,j,l);if(g=f[f.length-1]){o=g.x;m=g.y;g=1;for(h=this.divisions;g<=h;g++){var t=g/h;THREE.Shape.Utils.b2(t,o,p,j);THREE.Shape.Utils.b2(t,m,r,l)}}break;case "b":j=b[a++]*c+d;l=b[a++]*c;p=b[a++]*c+d;r=b[a++]*-c;n=b[a++]*c+d;q=b[a++]*-c;e.bezierCurveTo(j,l,p,r,n,q);if(g=f[f.length-1]){o=g.x;m=g.y;g=1;for(h=this.divisions;g<=h;g++){t=g/h;THREE.Shape.Utils.b3(t,o,p,n,j);THREE.Shape.Utils.b3(t,m,r,q,l)}}}}}return{offset:u.ha*c,path:e}}}};
+THREE.FontUtils.generateShapes=function(a,b){var b=b||{},c=b.curveSegments!==void 0?b.curveSegments:4,d=b.font!==void 0?b.font:"helvetiker",e=b.weight!==void 0?b.weight:"normal",f=b.style!==void 0?b.style:"normal";THREE.FontUtils.size=b.size!==void 0?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
+(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e=e+(a[f].x*a[g].y-a[g].x*a[f].y);return e*0.5};a.Triangulate=function(a,d){var e=a.length;if(e<3)return null;var f=[],g=[],h=[],j,k,l;if(b(a)>0)for(k=0;k<e;k++)g[k]=k;else for(k=0;k<e;k++)g[k]=e-1-k;var o=2*e;for(k=e-1;e>2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");break}j=k;e<=j&&(j=0);k=j+1;e<=k&&(k=0);l=k+1;e<=l&&(l=0);var m;a:{m=a;var p=j,r=k,n=l,q=e,u=g,t=void 0,y=void 0,s=void 0,x=void 0,E=void 0,
+D=void 0,A=void 0,v=void 0,H=void 0,y=m[u[p]].x,s=m[u[p]].y,x=m[u[r]].x,E=m[u[r]].y,D=m[u[n]].x,A=m[u[n]].y;if(1.0E-10>(x-y)*(A-s)-(E-s)*(D-y))m=false;else{for(t=0;t<q;t++)if(!(t==p||t==r||t==n)){var v=m[u[t]].x,H=m[u[t]].y,I=void 0,M=void 0,R=void 0,Z=void 0,B=void 0,G=void 0,Q=void 0,C=void 0,i=void 0,P=void 0,L=void 0,S=void 0,I=R=B=void 0,I=D-x,M=A-E,R=y-D,Z=s-A,B=x-y,G=E-s,Q=v-y,C=H-s,i=v-x,P=H-E,L=v-D,S=H-A,I=I*P-M*i,B=B*C-G*Q,R=R*S-Z*L;if(I>=0&&R>=0&&B>=0){m=false;break a}}m=true}}if(m){f.push([a[g[j]],
+a[g[k]],a[g[l]]]);h.push([g[j],g[k],g[l]]);j=k;for(l=k+1;l<e;j++,l++)g[j]=g[l];e--;o=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 THREE.BufferGeometry=function(){this.id=THREE.GeometryCount++;this.vertexColorArray=this.vertexUvArray=this.vertexNormalArray=this.vertexPositionArray=this.vertexIndexArray=this.vertexColorBuffer=this.vertexUvBuffer=this.vertexNormalBuffer=this.vertexPositionBuffer=this.vertexIndexBuffer=null;this.dynamic=false;this.boundingSphere=this.boundingBox=null;this.morphTargets=[]};THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,computeBoundingBox:function(){},computeBoundingSphere:function(){}};
 THREE.BufferGeometry=function(){this.id=THREE.GeometryCount++;this.vertexColorArray=this.vertexUvArray=this.vertexNormalArray=this.vertexPositionArray=this.vertexIndexArray=this.vertexColorBuffer=this.vertexUvBuffer=this.vertexNormalBuffer=this.vertexPositionBuffer=this.vertexIndexBuffer=null;this.dynamic=false;this.boundingSphere=this.boundingBox=null;this.morphTargets=[]};THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,computeBoundingBox:function(){},computeBoundingSphere:function(){}};
 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=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=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=false;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++){c=this.getPoint(e/a);f=f+c.distanceTo(d);b.push(f);d=c}return this.cacheArcLengths=b};
 THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=false;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++){c=this.getPoint(e/a);f=f+c.distanceTo(d);b.push(f);d=c}return this.cacheArcLengths=b};
@@ -485,8 +493,7 @@ THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.
 THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e;b=c=Number.NEGATIVE_INFINITY;d=e=Number.POSITIVE_INFINITY;var f,g,h,j;j=new THREE.Vector2;g=0;for(h=a.length;g<h;g++){f=a[g];if(f.x>b)b=f.x;else if(f.x<d)d=f.x;if(f.y>c)c=f.y;else if(f.y<e)e=f.y;j.addSelf(f.x,f.y)}return{minX:d,minY:e,maxX:b,maxY:c,centroid:j.divideScalar(h)}};THREE.CurvePath.prototype.createPointsGeometry=function(a){return this.createGeometry(this.getPoints(a,true))};
 THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e;b=c=Number.NEGATIVE_INFINITY;d=e=Number.POSITIVE_INFINITY;var f,g,h,j;j=new THREE.Vector2;g=0;for(h=a.length;g<h;g++){f=a[g];if(f.x>b)b=f.x;else if(f.x<d)d=f.x;if(f.y>c)c=f.y;else if(f.y<e)e=f.y;j.addSelf(f.x,f.y)}return{minX:d,minY:e,maxX:b,maxY:c,centroid:j.divideScalar(h)}};THREE.CurvePath.prototype.createPointsGeometry=function(a){return this.createGeometry(this.getPoints(a,true))};
 THREE.CurvePath.prototype.createSpacedPointsGeometry=function(a){return this.createGeometry(this.getSpacedPoints(a,true))};THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(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.createSpacedPointsGeometry=function(a){return this.createGeometry(this.getSpacedPoints(a,true))};THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(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),d,e;if(!b)b=this.bends;d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),d,e;if(!b)b=this.bends;d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};
 THREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c=this.getPoints(a),d,e;if(!b)b=this.bends;d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),d,e;if(!b)b=this.bends;d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};
-THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),d,e,f,g,h,j;d=0;for(e=a.length;d<e;d++){f=a[d];g=f.x;h=f.y;j=g/c.maxX;j=b.getUtoTmapping(j,g);g=b.getPoint(j);h=b.getNormalVector(j).multiplyScalar(h);f.x=g.x+h.x;f.y=g.y+h.y}return a};
-THREE.EventTarget=function(){var a={};this.addEventListener=function(b,c){a[b]==void 0&&(a[b]=[]);a[b].indexOf(c)===-1&&a[b].push(c)};this.dispatchEvent=function(b){for(var c in a[b.type])a[b.type][c](b)};this.removeEventListener=function(b,c){var d=a[b].indexOf(c);d!==-1&&a[b].splice(d,1)}};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=new THREE.Object3D;THREE.Gyroscope.prototype.constructor=THREE.Gyroscope;
+THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),d,e,f,g,h,j;d=0;for(e=a.length;d<e;d++){f=a[d];g=f.x;h=f.y;j=g/c.maxX;j=b.getUtoTmapping(j,g);g=b.getPoint(j);h=b.getNormalVector(j).multiplyScalar(h);f.x=g.x+h.x;f.y=g.y+h.y}return a};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=new THREE.Object3D;THREE.Gyroscope.prototype.constructor=THREE.Gyroscope;
 THREE.Gyroscope.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){if(this.parent){this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix);this.matrixWorld.decompose(this.translationWorld,this.rotationWorld,this.scaleWorld);this.matrix.decompose(this.translationObject,this.rotationObject,this.scaleObject);this.matrixWorld.compose(this.translationWorld,this.rotationObject,this.scaleWorld)}else this.matrixWorld.copy(this.matrix);
 THREE.Gyroscope.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){if(this.parent){this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix);this.matrixWorld.decompose(this.translationWorld,this.rotationWorld,this.scaleWorld);this.matrix.decompose(this.translationObject,this.rotationObject,this.scaleObject);this.matrixWorld.compose(this.translationWorld,this.rotationObject,this.scaleWorld)}else this.matrixWorld.copy(this.matrix);
 this.matrixWorldNeedsUpdate=false;a=true}for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)};THREE.Gyroscope.prototype.translationWorld=new THREE.Vector3;THREE.Gyroscope.prototype.translationObject=new THREE.Vector3;THREE.Gyroscope.prototype.rotationWorld=new THREE.Quaternion;THREE.Gyroscope.prototype.rotationObject=new THREE.Quaternion;THREE.Gyroscope.prototype.scaleWorld=new THREE.Vector3;THREE.Gyroscope.prototype.scaleObject=new THREE.Vector3;
 this.matrixWorldNeedsUpdate=false;a=true}for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)};THREE.Gyroscope.prototype.translationWorld=new THREE.Vector3;THREE.Gyroscope.prototype.translationObject=new THREE.Vector3;THREE.Gyroscope.prototype.rotationWorld=new THREE.Quaternion;THREE.Gyroscope.prototype.rotationObject=new THREE.Quaternion;THREE.Gyroscope.prototype.scaleWorld=new THREE.Vector3;THREE.Gyroscope.prototype.scaleObject=new THREE.Vector3;
 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);for(var b=1,c=a.length;b<c;b++)this.lineTo(a[b].x,a[b].y)};
 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);for(var b=1,c=a.length;b<c;b++)this.lineTo(a[b].x,a[b].y)};
@@ -499,9 +506,7 @@ THREE.Path.prototype.absarc=function(a,b,c,d,e,f){var g=Array.prototype.slice.ca
 THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints){console.log("tata");return this.getSpacedPoints(a,b)}var a=a||12,c=[],d,e,f,g,h,j,k,l,o,m,p,r,n;d=0;for(e=this.actions.length;d<e;d++){f=this.actions[d];g=f.action;f=f.args;switch(g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];j=f[3];o=f[0];m=f[1];if(c.length>0){g=c[c.length-1];
 THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints){console.log("tata");return this.getSpacedPoints(a,b)}var a=a||12,c=[],d,e,f,g,h,j,k,l,o,m,p,r,n;d=0;for(e=this.actions.length;d<e;d++){f=this.actions[d];g=f.action;f=f.args;switch(g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];j=f[3];o=f[0];m=f[1];if(c.length>0){g=c[c.length-1];
 p=g.x;r=g.y}else{g=this.actions[d-1].args;p=g[g.length-2];r=g[g.length-1]}for(f=1;f<=a;f++){n=f/a;g=THREE.Shape.Utils.b2(n,p,o,h);n=THREE.Shape.Utils.b2(n,r,m,j);c.push(new THREE.Vector2(g,n))}break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];j=f[5];o=f[0];m=f[1];k=f[2];l=f[3];if(c.length>0){g=c[c.length-1];p=g.x;r=g.y}else{g=this.actions[d-1].args;p=g[g.length-2];r=g[g.length-1]}for(f=1;f<=a;f++){n=f/a;g=THREE.Shape.Utils.b3(n,p,o,k,h);n=THREE.Shape.Utils.b3(n,r,m,l,j);c.push(new THREE.Vector2(g,
 p=g.x;r=g.y}else{g=this.actions[d-1].args;p=g[g.length-2];r=g[g.length-1]}for(f=1;f<=a;f++){n=f/a;g=THREE.Shape.Utils.b2(n,p,o,h);n=THREE.Shape.Utils.b2(n,r,m,j);c.push(new THREE.Vector2(g,n))}break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];j=f[5];o=f[0];m=f[1];k=f[2];l=f[3];if(c.length>0){g=c[c.length-1];p=g.x;r=g.y}else{g=this.actions[d-1].args;p=g[g.length-2];r=g[g.length-1]}for(f=1;f<=a;f++){n=f/a;g=THREE.Shape.Utils.b3(n,p,o,k,h);n=THREE.Shape.Utils.b3(n,r,m,l,j);c.push(new THREE.Vector2(g,
 n))}break;case THREE.PathActions.CSPLINE_THRU:g=this.actions[d-1].args;n=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;n=n.concat(f[0]);n=new THREE.SplineCurve(n);for(f=1;f<=g;f++)c.push(n.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];j=f[1];k=f[2];o=f[3];m=!!f[5];l=f[4]-o;p=a*2;for(f=1;f<=p;f++){n=f/p;m||(n=1-n);n=o+n*l;g=h+k*Math.cos(n);n=j+k*Math.sin(n);c.push(new THREE.Vector2(g,n))}}}d=c[c.length-1];Math.abs(d.x-c[0].x)<1.0E-10&&Math.abs(d.y-c[0].y)<1.0E-10&&c.splice(c.length-
 n))}break;case THREE.PathActions.CSPLINE_THRU:g=this.actions[d-1].args;n=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;n=n.concat(f[0]);n=new THREE.SplineCurve(n);for(f=1;f<=g;f++)c.push(n.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];j=f[1];k=f[2];o=f[3];m=!!f[5];l=f[4]-o;p=a*2;for(f=1;f<=p;f++){n=f/p;m||(n=1-n);n=o+n*l;g=h+k*Math.cos(n);n=j+k*Math.sin(n);c.push(new THREE.Vector2(g,n))}}}d=c[c.length-1];Math.abs(d.x-c[0].x)<1.0E-10&&Math.abs(d.y-c[0].y)<1.0E-10&&c.splice(c.length-
-1,1);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,d,e,f){var g=this.getPoints(),h,j,k,l,o;h=0;for(j=g.length;h<j;h++){k=g[h];l=k.x;o=k.y;k.x=a*l+b*o+c;k.y=d*o+e*l+f}return g};
-THREE.Path.prototype.debug=function(a){var b=this.getBoundingBox();if(!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,d,e,a=0;for(c=this.actions.length;a<c;a++){d=this.actions[a];e=d.args;d=d.action;d!=THREE.PathActions.CSPLINE_THRU&&b[d].apply(b,e)}b.stroke();b.closePath();b.strokeStyle="red";
-d=this.getPoints();a=0;for(c=d.length;a<c;a++){e=d[a];b.beginPath();b.arc(e.x,e.y,1.5,0,Math.PI*2,false);b.stroke();b.closePath()}};
+1,1);b&&c.push(c[0]);return c};
 THREE.Path.prototype.toShapes=function(){var a,b,c,d,e=[],f=new THREE.Path;a=0;for(b=this.actions.length;a<b;a++){c=this.actions[a];d=c.args;c=c.action;if(c==THREE.PathActions.MOVE_TO&&f.actions.length!=0){e.push(f);f=new THREE.Path}f[c].apply(f,d)}f.actions.length!=0&&e.push(f);if(e.length==0)return[];var g;d=[];a=!THREE.Shape.Utils.isClockWise(e[0].getPoints());if(e.length==1){f=e[0];g=new THREE.Shape;g.actions=f.actions;g.curves=f.curves;d.push(g);return d}if(a){g=new THREE.Shape;a=0;for(b=e.length;a<
 THREE.Path.prototype.toShapes=function(){var a,b,c,d,e=[],f=new THREE.Path;a=0;for(b=this.actions.length;a<b;a++){c=this.actions[a];d=c.args;c=c.action;if(c==THREE.PathActions.MOVE_TO&&f.actions.length!=0){e.push(f);f=new THREE.Path}f[c].apply(f,d)}f.actions.length!=0&&e.push(f);if(e.length==0)return[];var g;d=[];a=!THREE.Shape.Utils.isClockWise(e[0].getPoints());if(e.length==1){f=e[0];g=new THREE.Shape;g.actions=f.actions;g.curves=f.curves;d.push(g);return d}if(a){g=new THREE.Shape;a=0;for(b=e.length;a<
 b;a++){f=e[a];if(THREE.Shape.Utils.isClockWise(f.getPoints())){g.actions=f.actions;g.curves=f.curves;d.push(g);g=new THREE.Shape}else g.holes.push(f)}}else{a=0;for(b=e.length;a<b;a++){f=e[a];if(THREE.Shape.Utils.isClockWise(f.getPoints())){g&&d.push(g);g=new THREE.Shape;g.actions=f.actions;g.curves=f.curves}else g.holes.push(f)}d.push(g)}return d};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;
 b;a++){f=e[a];if(THREE.Shape.Utils.isClockWise(f.getPoints())){g.actions=f.actions;g.curves=f.curves;d.push(g);g=new THREE.Shape}else g.holes.push(f)}}else{a=0;for(b=e.length;a<b;a++){f=e[a];if(THREE.Shape.Utils.isClockWise(f.getPoints())){g&&d.push(g);g=new THREE.Shape;g.actions=f.actions;g.curves=f.curves}else g.holes.push(f)}d.push(g)}return d};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,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
@@ -510,13 +515,12 @@ THREE.Shape.Utils={removeHoles:function(a,b){var c=a.concat(),d=c.concat(),e,f,g
 -1;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+k.length);g=g%k.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:k.length-1;n=[k[g],c[h],c[e]];n=THREE.FontUtils.Triangulate.area(n);q=[k[g],k[f],c[h]];q=THREE.FontUtils.Triangulate.area(q);if(o+m>n+q){h=p;g=l;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+k.length);g=g%k.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:k.length-1}o=c.slice(0,h);m=c.slice(h);p=k.slice(g);l=k.slice(0,g);f=[k[g],k[f],c[h]];r.push([k[g],c[h],c[e]]);r.push(f);c=o.concat(p).concat(l).concat(m)}return{shape:c,
 -1;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+k.length);g=g%k.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:k.length-1;n=[k[g],c[h],c[e]];n=THREE.FontUtils.Triangulate.area(n);q=[k[g],k[f],c[h]];q=THREE.FontUtils.Triangulate.area(q);if(o+m>n+q){h=p;g=l;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+k.length);g=g%k.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:k.length-1}o=c.slice(0,h);m=c.slice(h);p=k.slice(g);l=k.slice(0,g);f=[k[g],k[f],c[h]];r.push([k[g],c[h],c[e]]);r.push(f);c=o.concat(p).concat(l).concat(m)}return{shape:c,
 isolatedPts:r,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,false),f,g,h,j,k={};f=0;for(g=d.length;f<g;f++){j=d[f].x+":"+d[f].y;k[j]!==void 0&&console.log("Duplicate point",j);k[j]=f}f=0;for(g=c.length;f<g;f++){h=c[f];for(d=0;d<3;d++){j=h[d].x+":"+h[d].y;j=k[j];j!==void 0&&(h[d]=j)}}f=0;for(g=e.length;f<g;f++){h=e[f];for(d=0;d<3;d++){j=h[d].x+":"+h[d].y;j=k[j];j!==void 0&&(h[d]=j)}}return c.concat(e)},
 isolatedPts:r,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,false),f,g,h,j,k={};f=0;for(g=d.length;f<g;f++){j=d[f].x+":"+d[f].y;k[j]!==void 0&&console.log("Duplicate point",j);k[j]=f}f=0;for(g=c.length;f<g;f++){h=c[f];for(d=0;d<3;d++){j=h[d].x+":"+h[d].y;j=k[j];j!==void 0&&(h[d]=j)}}f=0;for(g=e.length;f<g;f++){h=e[f];for(d=0;d<3;d++){j=h[d].x+":"+h[d].y;j=k[j];j!==void 0&&(h[d]=j)}}return c.concat(e)},
 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,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},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,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+
 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,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},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,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+
-this.b3p3(a,e)}};THREE.TextPath=function(a,b){THREE.Path.call(this);this.parameters=b||{};this.set(a)};THREE.TextPath.prototype.set=function(a,b){b=b||this.parameters;this.text=a;var c=b.curveSegments!==void 0?b.curveSegments:4,d=b.font!==void 0?b.font:"helvetiker",e=b.weight!==void 0?b.weight:"normal",f=b.style!==void 0?b.style:"normal";THREE.FontUtils.size=b.size!==void 0?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f};
-THREE.TextPath.prototype.toShapes=function(){for(var a=THREE.FontUtils.drawText(this.text).paths,b=[],c=0,d=a.length;c<d;c++)Array.prototype.push.apply(b,a[c].toShapes());return b};
-THREE.AnimationHandler=function(){var a=[],b={},c={update:function(b){for(var c=0;c<a.length;c++)a[c].update(b)},addToUpdate:function(b){a.indexOf(b)===-1&&a.push(b)},removeFromUpdate:function(b){b=a.indexOf(b);b!==-1&&a.splice(b,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!==true){for(var c=0;c<a.hierarchy.length;c++){for(var d=0;d<a.hierarchy[c].keys.length;d++){if(a.hierarchy[c].keys[d].time<
-0)a.hierarchy[c].keys[d].time=0;if(a.hierarchy[c].keys[d].rot!==void 0&&!(a.hierarchy[c].keys[d].rot instanceof THREE.Quaternion)){var h=a.hierarchy[c].keys[d].rot;a.hierarchy[c].keys[d].rot=new THREE.Quaternion(h[0],h[1],h[2],h[3])}}if(a.hierarchy[c].keys.length&&a.hierarchy[c].keys[0].morphTargets!==void 0){h={};for(d=0;d<a.hierarchy[c].keys.length;d++)for(var j=0;j<a.hierarchy[c].keys[d].morphTargets.length;j++){var k=a.hierarchy[c].keys[d].morphTargets[j];h[k]=-1}a.hierarchy[c].usedMorphTargets=
-h;for(d=0;d<a.hierarchy[c].keys.length;d++){var l={};for(k in h){for(j=0;j<a.hierarchy[c].keys[d].morphTargets.length;j++)if(a.hierarchy[c].keys[d].morphTargets[j]===k){l[k]=a.hierarchy[c].keys[d].morphTargetsInfluences[j];break}j===a.hierarchy[c].keys[d].morphTargets.length&&(l[k]=0)}a.hierarchy[c].keys[d].morphTargetsInfluences=l}}for(d=1;d<a.hierarchy[c].keys.length;d++)if(a.hierarchy[c].keys[d].time===a.hierarchy[c].keys[d-1].time){a.hierarchy[c].keys.splice(d,1);d--}for(d=0;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].index=
-d}d=parseInt(a.length*a.fps,10);a.JIT={};a.JIT.hierarchy=[];for(c=0;c<a.hierarchy.length;c++)a.JIT.hierarchy.push(Array(d));a.initialized=true}},get:function(a){if(typeof a==="string"){if(b[a])return b[a];console.log("THREE.AnimationHandler.get: Couldn't find animation "+a);return null}},parse:function(a){var b=[];if(a instanceof THREE.SkinnedMesh)for(var c=0;c<a.bones.length;c++)b.push(a.bones[c]);else d(a,b);return b}},d=function(a,b){b.push(a);for(var c=0;c<a.children.length;c++)d(a.children[c],
-b)};c.LINEAR=0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(a,b,c,d){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=false;this.loop=this.isPaused=true;this.interpolationType=c!==void 0?c:THREE.AnimationHandler.LINEAR;this.JITCompile=d!==void 0?d:true;this.points=[];this.target=new THREE.Vector3};
+this.b3p3(a,e)}};
+THREE.AnimationHandler=function(){var a=[],b={},c={update:function(b){for(var c=0;c<a.length;c++)a[c].update(b)},addToUpdate:function(b){a.indexOf(b)===-1&&a.push(b)},removeFromUpdate:function(b){b=a.indexOf(b);b!==-1&&a.splice(b,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!==true){for(var c=0;c<a.hierarchy.length;c++){for(var d=0;d<a.hierarchy[c].keys.length;d++){if(a.hierarchy[c].keys[d].time<0)a.hierarchy[c].keys[d].time=
+0;if(a.hierarchy[c].keys[d].rot!==void 0&&!(a.hierarchy[c].keys[d].rot instanceof THREE.Quaternion)){var h=a.hierarchy[c].keys[d].rot;a.hierarchy[c].keys[d].rot=new THREE.Quaternion(h[0],h[1],h[2],h[3])}}if(a.hierarchy[c].keys.length&&a.hierarchy[c].keys[0].morphTargets!==void 0){h={};for(d=0;d<a.hierarchy[c].keys.length;d++)for(var j=0;j<a.hierarchy[c].keys[d].morphTargets.length;j++){var k=a.hierarchy[c].keys[d].morphTargets[j];h[k]=-1}a.hierarchy[c].usedMorphTargets=h;for(d=0;d<a.hierarchy[c].keys.length;d++){var l=
+{};for(k in h){for(j=0;j<a.hierarchy[c].keys[d].morphTargets.length;j++)if(a.hierarchy[c].keys[d].morphTargets[j]===k){l[k]=a.hierarchy[c].keys[d].morphTargetsInfluences[j];break}j===a.hierarchy[c].keys[d].morphTargets.length&&(l[k]=0)}a.hierarchy[c].keys[d].morphTargetsInfluences=l}}for(d=1;d<a.hierarchy[c].keys.length;d++)if(a.hierarchy[c].keys[d].time===a.hierarchy[c].keys[d-1].time){a.hierarchy[c].keys.splice(d,1);d--}for(d=0;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].index=d}d=parseInt(a.length*
+a.fps,10);a.JIT={};a.JIT.hierarchy=[];for(c=0;c<a.hierarchy.length;c++)a.JIT.hierarchy.push(Array(d));a.initialized=true}},get:function(a){if(typeof a==="string"){if(b[a])return b[a];console.log("THREE.AnimationHandler.get: Couldn't find animation "+a);return null}},parse:function(a){var b=[];if(a instanceof THREE.SkinnedMesh)for(var c=0;c<a.bones.length;c++)b.push(a.bones[c]);else d(a,b);return b}},d=function(a,b){b.push(a);for(var c=0;c<a.children.length;c++)d(a.children[c],b)};c.LINEAR=0;c.CATMULLROM=
+1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(a,b,c,d){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=false;this.loop=this.isPaused=true;this.interpolationType=c!==void 0?c:THREE.AnimationHandler.LINEAR;this.JITCompile=d!==void 0?d:true;this.points=[];this.target=new THREE.Vector3};
 THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=true;this.loop=a!==void 0?a:true;this.currentTime=b!==void 0?b:0;var c,d=this.hierarchy.length,e;for(c=0;c<d;c++){e=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)e.useQuaternion=true;e.matrixAutoUpdate=true;if(e.animationCache===void 0){e.animationCache={};e.animationCache.prevKey={pos:0,rot:0,scl:0};e.animationCache.nextKey={pos:0,rot:0,scl:0};e.animationCache.originalMatrix=
 THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=true;this.loop=a!==void 0?a:true;this.currentTime=b!==void 0?b:0;var c,d=this.hierarchy.length,e;for(c=0;c<d;c++){e=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)e.useQuaternion=true;e.matrixAutoUpdate=true;if(e.animationCache===void 0){e.animationCache={};e.animationCache.prevKey={pos:0,rot:0,scl:0};e.animationCache.nextKey={pos:0,rot:0,scl:0};e.animationCache.originalMatrix=
 e instanceof THREE.Bone?e.skinMatrix:e.matrix}var f=e.animationCache.prevKey;e=e.animationCache.nextKey;f.pos=this.data.hierarchy[c].keys[0];f.rot=this.data.hierarchy[c].keys[0];f.scl=this.data.hierarchy[c].keys[0];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=false;THREE.AnimationHandler.addToUpdate(this)};
 e instanceof THREE.Bone?e.skinMatrix:e.matrix}var f=e.animationCache.prevKey;e=e.animationCache.nextKey;f.pos=this.data.hierarchy[c].keys[0];f.rot=this.data.hierarchy[c].keys[0];f.scl=this.data.hierarchy[c].keys[0];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=false;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
@@ -620,15 +624,8 @@ THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var e=a/2,f=
 THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);var a=a||50,d=d!==void 0?d:0,e=e!==void 0?e:Math.PI*2,f=f!==void 0?f:0,g=g!==void 0?g:Math.PI,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),h,j,k=[],l=[];for(j=0;j<=c;j++){var o=[],m=[];for(h=0;h<=b;h++){var p=h/b,r=j/c,n=new THREE.Vector3;n.x=-a*Math.cos(d+p*e)*Math.sin(f+r*g);n.y=a*Math.cos(f+r*g);n.z=a*Math.sin(d+p*e)*Math.sin(f+r*g);this.vertices.push(n);o.push(this.vertices.length-1);m.push(new THREE.UV(p,
 THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);var a=a||50,d=d!==void 0?d:0,e=e!==void 0?e:Math.PI*2,f=f!==void 0?f:0,g=g!==void 0?g:Math.PI,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),h,j,k=[],l=[];for(j=0;j<=c;j++){var o=[],m=[];for(h=0;h<=b;h++){var p=h/b,r=j/c,n=new THREE.Vector3;n.x=-a*Math.cos(d+p*e)*Math.sin(f+r*g);n.y=a*Math.cos(f+r*g);n.z=a*Math.sin(d+p*e)*Math.sin(f+r*g);this.vertices.push(n);o.push(this.vertices.length-1);m.push(new THREE.UV(p,
 r))}k.push(o);l.push(m)}for(j=0;j<c;j++)for(h=0;h<b;h++){var d=k[j][h+1],e=k[j][h],f=k[j+1][h],g=k[j+1][h+1],o=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),p=this.vertices[f].clone().normalize(),r=this.vertices[g].clone().normalize(),n=l[j][h+1].clone(),q=l[j][h].clone(),u=l[j+1][h].clone(),t=l[j+1][h+1].clone();if(Math.abs(this.vertices[d].y)==a){this.faces.push(new THREE.Face3(d,f,g,[o,p,r]));this.faceVertexUvs[0].push([n,u,t])}else if(Math.abs(this.vertices[f].y)==
 r))}k.push(o);l.push(m)}for(j=0;j<c;j++)for(h=0;h<b;h++){var d=k[j][h+1],e=k[j][h],f=k[j+1][h],g=k[j+1][h+1],o=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),p=this.vertices[f].clone().normalize(),r=this.vertices[g].clone().normalize(),n=l[j][h+1].clone(),q=l[j][h].clone(),u=l[j+1][h].clone(),t=l[j+1][h+1].clone();if(Math.abs(this.vertices[d].y)==a){this.faces.push(new THREE.Face3(d,f,g,[o,p,r]));this.faceVertexUvs[0].push([n,u,t])}else if(Math.abs(this.vertices[f].y)==
 a){this.faces.push(new THREE.Face3(d,e,f,[o,m,p]));this.faceVertexUvs[0].push([n,q,u])}else{this.faces.push(new THREE.Face4(d,e,f,g,[o,m,p,r]));this.faceVertexUvs[0].push([n,q,u,t])}}this.computeCentroids();this.computeFaceNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 a){this.faces.push(new THREE.Face3(d,e,f,[o,m,p]));this.faceVertexUvs[0].push([n,q,u])}else{this.faces.push(new THREE.Face4(d,e,f,g,[o,m,p,r]));this.faceVertexUvs[0].push([n,q,u,t])}}this.computeCentroids();this.computeFaceNormals();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=false;if(b.bend){var d=c[c.length-1].getBoundingBox().maxX;b.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(d/2,120),new THREE.Vector2(d,0))}THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
+THREE.TextGeometry=function(a,b){var c=THREE.FontUtils.generateShapes(a,b);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=false;if(b.bend){var d=c[c.length-1].getBoundingBox().maxX;b.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(d/2,120),new THREE.Vector2(d,0))}THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
-THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},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,d=
-0,e=(""+a).split(""),f=e.length,g=[],a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,j,k,l,o,m,p,r,n,q,u=b.glyphs[a]||b.glyphs["?"];if(u){if(u.o){b=u._cachedOutline||(u._cachedOutline=u.o.split(" "));k=b.length;for(a=0;a<k;){j=b[a++];switch(j){case "m":j=b[a++]*c+d;l=b[a++]*c;f.push(new THREE.Vector2(j,l));e.moveTo(j,l);break;case "l":j=b[a++]*c+d;l=b[a++]*c;f.push(new THREE.Vector2(j,
-l));e.lineTo(j,l);break;case "q":j=b[a++]*c+d;l=b[a++]*c;p=b[a++]*c+d;r=b[a++]*c;e.quadraticCurveTo(p,r,j,l);if(g=f[f.length-1]){o=g.x;m=g.y;g=1;for(h=this.divisions;g<=h;g++){var t=g/h,y=THREE.Shape.Utils.b2(t,o,p,j),t=THREE.Shape.Utils.b2(t,m,r,l);f.push(new THREE.Vector2(y,t))}}break;case "b":j=b[a++]*c+d;l=b[a++]*c;p=b[a++]*c+d;r=b[a++]*-c;n=b[a++]*c+d;q=b[a++]*-c;e.bezierCurveTo(j,l,p,r,n,q);if(g=f[f.length-1]){o=g.x;m=g.y;g=1;for(h=this.divisions;g<=h;g++){t=g/h;y=THREE.Shape.Utils.b3(t,o,p,
-n,j);t=THREE.Shape.Utils.b3(t,m,r,q,l);f.push(new THREE.Vector2(y,t))}}}}}return{offset:u.ha*c,points:f,path:e}}}};
-(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e=e+(a[f].x*a[g].y-a[g].x*a[f].y);return e*0.5};a.Triangulate=function(a,d){var e=a.length;if(e<3)return null;var f=[],g=[],h=[],j,k,l;if(b(a)>0)for(k=0;k<e;k++)g[k]=k;else for(k=0;k<e;k++)g[k]=e-1-k;var o=2*e;for(k=e-1;e>2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");break}j=k;e<=j&&(j=0);k=j+1;e<=k&&(k=0);l=k+1;e<=l&&(l=0);var m;a:{m=a;var p=j,r=k,n=l,q=e,u=g,t=void 0,y=void 0,s=void 0,x=void 0,E=void 0,
-D=void 0,A=void 0,v=void 0,H=void 0,y=m[u[p]].x,s=m[u[p]].y,x=m[u[r]].x,E=m[u[r]].y,D=m[u[n]].x,A=m[u[n]].y;if(1.0E-10>(x-y)*(A-s)-(E-s)*(D-y))m=false;else{for(t=0;t<q;t++)if(!(t==p||t==r||t==n)){var v=m[u[t]].x,H=m[u[t]].y,I=void 0,M=void 0,R=void 0,Z=void 0,B=void 0,G=void 0,Q=void 0,C=void 0,i=void 0,P=void 0,L=void 0,S=void 0,I=R=B=void 0,I=D-x,M=A-E,R=y-D,Z=s-A,B=x-y,G=E-s,Q=v-y,C=H-s,i=v-x,P=H-E,L=v-D,S=H-A,I=I*P-M*i,B=B*C-G*Q,R=R*S-Z*L;if(I>=0&&R>=0&&B>=0){m=false;break a}}m=true}}if(m){f.push([a[g[j]],
-a[g[k]],a[g[l]]]);h.push([g[j],g[k],g[l]]);j=k;for(l=k+1;l<e;j++,l++)g[j]=g[l];e--;o=2*e}}return d?h:f};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,d,e){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=d||6;this.arc=e||Math.PI*2;e=new THREE.Vector3;a=[];b=[];for(c=0;c<=this.segmentsR;c++)for(d=0;d<=this.segmentsT;d++){var f=d/this.segmentsT*this.arc,g=c/this.segmentsR*Math.PI*2;e.x=this.radius*Math.cos(f);e.y=this.radius*Math.sin(f);var h=new THREE.Vector3;h.x=(this.radius+this.tube*Math.cos(g))*Math.cos(f);h.y=(this.radius+this.tube*Math.cos(g))*Math.sin(f);h.z=
 THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=d||6;this.arc=e||Math.PI*2;e=new THREE.Vector3;a=[];b=[];for(c=0;c<=this.segmentsR;c++)for(d=0;d<=this.segmentsT;d++){var f=d/this.segmentsT*this.arc,g=c/this.segmentsR*Math.PI*2;e.x=this.radius*Math.cos(f);e.y=this.radius*Math.sin(f);var h=new THREE.Vector3;h.x=(this.radius+this.tube*Math.cos(g))*Math.cos(f);h.y=(this.radius+this.tube*Math.cos(g))*Math.sin(f);h.z=
 this.tube*Math.sin(g);this.vertices.push(h);a.push(new THREE.UV(d/this.segmentsT,1-c/this.segmentsR));b.push(h.clone().subSelf(e).normalize())}for(c=1;c<=this.segmentsR;c++)for(d=1;d<=this.segmentsT;d++){var e=(this.segmentsT+1)*c+d-1,f=(this.segmentsT+1)*(c-1)+d-1,g=(this.segmentsT+1)*(c-1)+d,h=(this.segmentsT+1)*c+d,j=new THREE.Face4(e,f,g,h,[b[e],b[f],b[g],b[h]]);j.normal.addSelf(b[e]);j.normal.addSelf(b[f]);j.normal.addSelf(b[g]);j.normal.addSelf(b[h]);j.normal.normalize();this.faces.push(j);
 this.tube*Math.sin(g);this.vertices.push(h);a.push(new THREE.UV(d/this.segmentsT,1-c/this.segmentsR));b.push(h.clone().subSelf(e).normalize())}for(c=1;c<=this.segmentsR;c++)for(d=1;d<=this.segmentsT;d++){var e=(this.segmentsT+1)*c+d-1,f=(this.segmentsT+1)*(c-1)+d-1,g=(this.segmentsT+1)*(c-1)+d,h=(this.segmentsT+1)*c+d,j=new THREE.Face4(e,f,g,h,[b[e],b[f],b[g],b[h]]);j.normal.addSelf(b[e]);j.normal.addSelf(b[f]);j.normal.addSelf(b[g]);j.normal.addSelf(b[h]);j.normal.normalize();this.faces.push(j);
 this.faceVertexUvs[0].push([a[e].clone(),a[f].clone(),a[g].clone(),a[h].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
 this.faceVertexUvs[0].push([a[e].clone(),a[f].clone(),a[g].clone(),a[h].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
@@ -673,7 +670,7 @@ x[s];A=v[0];D=v[1];I=s.split("_");M=I[0];I=I[1];v=new THREE.Vector3;if(u[s]){v.a
 "12","2","23"];I=["123","23","3","31"];var Q=["123","31","1","12"],C=["1234","12","2","23"],i=["1234","23","3","34"],P=["1234","34","4","41"],L=["1234","41","1","12"];s=0;for(x=n.length;s<x;s++){A=r[s];v=y+s;if(A instanceof THREE.Face3){H=e(A.a,A.b);M=e(A.b,A.c);B=e(A.c,A.a);d(v,q[H],A.b,q[M],A,D,s);d(v,q[M],A.c,q[B],A,I,s);d(v,q[B],A.a,q[H],A,Q,s)}else if(A instanceof THREE.Face4){H=e(A.a,A.b);M=e(A.b,A.c);B=e(A.c,A.d);G=e(A.d,A.a);d(v,q[H],A.b,q[M],A,C,s);d(v,q[M],A.c,q[B],A,i,s);d(v,q[B],A.d,q[G],
 "12","2","23"];I=["123","23","3","31"];var Q=["123","31","1","12"],C=["1234","12","2","23"],i=["1234","23","3","34"],P=["1234","34","4","41"],L=["1234","41","1","12"];s=0;for(x=n.length;s<x;s++){A=r[s];v=y+s;if(A instanceof THREE.Face3){H=e(A.a,A.b);M=e(A.b,A.c);B=e(A.c,A.a);d(v,q[H],A.b,q[M],A,D,s);d(v,q[M],A.c,q[B],A,I,s);d(v,q[B],A.a,q[H],A,Q,s)}else if(A instanceof THREE.Face4){H=e(A.a,A.b);M=e(A.b,A.c);B=e(A.c,A.d);G=e(A.d,A.a);d(v,q[H],A.b,q[M],A,C,s);d(v,q[M],A.c,q[B],A,i,s);d(v,q[B],A.d,q[G],
 A,P,s);d(v,q[G],A.a,q[H],A,L,s)}else b("face should be a face!",A)}q=new THREE.Vector3;A=new THREE.Vector3;s=0;for(x=p.length;s<x;s++)if(R[s]!==void 0){q.set(0,0,0);A.set(0,0,0);M=new THREE.Vector3(0,0,0);v=0;for(E in Z[s]){q.addSelf(n[E]);v++}D=0;H=R[s].length;for(E=0;E<H;E++)u[e(R[s][E][0],R[s][E][1])]&&D++;if(D!=2){q.divideScalar(v);for(E=0;E<H;E++){v=R[s][E];v=p[v[0]].clone().addSelf(p[v[1]]).divideScalar(2);A.addSelf(v)}A.divideScalar(H);M.addSelf(p[s]);M.multiplyScalar(H-3);M.addSelf(q);M.addSelf(A.multiplyScalar(2));
 A,P,s);d(v,q[G],A.a,q[H],A,L,s)}else b("face should be a face!",A)}q=new THREE.Vector3;A=new THREE.Vector3;s=0;for(x=p.length;s<x;s++)if(R[s]!==void 0){q.set(0,0,0);A.set(0,0,0);M=new THREE.Vector3(0,0,0);v=0;for(E in Z[s]){q.addSelf(n[E]);v++}D=0;H=R[s].length;for(E=0;E<H;E++)u[e(R[s][E][0],R[s][E][1])]&&D++;if(D!=2){q.divideScalar(v);for(E=0;E<H;E++){v=R[s][E];v=p[v[0]].clone().addSelf(p[v[1]]).divideScalar(2);A.addSelf(v)}A.divideScalar(H);M.addSelf(p[s]);M.multiplyScalar(H-3);M.addSelf(q);M.addSelf(A.multiplyScalar(2));
 M.divideScalar(H);k[s]=M}}a.vertices=k;a.faces=l;a.faceVertexUvs[0]=o;delete a.__tmpVertices;a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals()};THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(){}};THREE.ImmediateRenderObject.prototype=new THREE.Object3D;THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;
 M.divideScalar(H);k[s]=M}}a.vertices=k;a.faces=l;a.faceVertexUvs[0]=o;delete a.__tmpVertices;a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals()};THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(){}};THREE.ImmediateRenderObject.prototype=new THREE.Object3D;THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;
-THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;a!==void 0&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=new THREE.Object3D;THREE.LensFlare.prototype.constructor=THREE.LensFlare;THREE.LensFlare.prototype.supr=THREE.Object3D.prototype;
+THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;a!==void 0&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=new THREE.Object3D;THREE.LensFlare.prototype.constructor=THREE.LensFlare;
 THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){b===void 0&&(b=-1);c===void 0&&(c=0);f===void 0&&(f=1);e===void 0&&(e=new THREE.Color(16777215));if(d===void 0)d=THREE.NormalBlending;c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})};
 THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){b===void 0&&(b=-1);c===void 0&&(c=0);f===void 0&&(f=1);e===void 0&&(e=new THREE.Color(16777215));if(d===void 0)d=THREE.NormalBlending;c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})};
 THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=-this.positionScreen.x*2,e=-this.positionScreen.y*2;for(a=0;a<b;a++){c=this.lensFlares[a];c.x=this.positionScreen.x+d*c.distance;c.y=this.positionScreen.y+e*c.distance;c.wantedRotation=c.x*Math.PI*0.25;c.rotation=c.rotation+(c.wantedRotation-c.rotation)*0.25}};
 THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=-this.positionScreen.x*2,e=-this.positionScreen.y*2;for(a=0;a<b;a++){c=this.lensFlares[a];c.x=this.positionScreen.x+d*c.distance;c.y=this.positionScreen.y+e*c.distance;c.wantedRotation=c.x*Math.PI*0.25;c.rotation=c.rotation+(c.wantedRotation-c.rotation)*0.25}};
 THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=new THREE.Mesh;THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh;
 THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=new THREE.Mesh;THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh;

+ 18 - 17
build/custom/ThreeCanvas.js

@@ -17,7 +17,8 @@ a).lengthSq()},getPositionFromMatrix:function(a){this.x=a.elements[12];this.y=a.
 this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1};
 this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1};
 THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w!==void 0?a.w:1;return this},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=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;this.w=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=
 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!==void 0?a.w:1;return this},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=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;this.w=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=
 this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;this.w=this.w-a.w;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a;this.w=this.w/a}else{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())},
 this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;this.w=this.w-a.w;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a;this.w=this.w/a}else{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=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;this.w=this.w+(a.w-this.w)*b;return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]};
+normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;this.w=this.w+(a.w-this.w)*b;return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};
+THREE.EventTarget=function(){var a={};this.addEventListener=function(b,c){a[b]===void 0&&(a[b]=[]);a[b].indexOf(c)===-1&&a[b].push(c)};this.dispatchEvent=function(b){for(var c in a[b.type])a[b.type][c](b)};this.removeEventListener=function(b,c){var d=a[b].indexOf(c);d!==-1&&a[b].splice(d,1)}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]};
 THREE.Frustum.prototype.setFromMatrix=function(a){var b,c=this.planes,d=a.elements,a=d[0];b=d[1];var e=d[2],f=d[3],g=d[4],k=d[5],m=d[6],i=d[7],h=d[8],j=d[9],o=d[10],n=d[11],q=d[12],l=d[13],p=d[14],d=d[15];c[0].set(f-a,i-g,n-h,d-q);c[1].set(f+a,i+g,n+h,d+q);c[2].set(f+b,i+k,n+j,d+l);c[3].set(f-b,i-k,n-j,d-l);c[4].set(f-e,i-m,n-o,d-p);c[5].set(f+e,i+m,n+o,d+p);for(a=0;a<6;a++){b=c[a];b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}};
 THREE.Frustum.prototype.setFromMatrix=function(a){var b,c=this.planes,d=a.elements,a=d[0];b=d[1];var e=d[2],f=d[3],g=d[4],k=d[5],m=d[6],i=d[7],h=d[8],j=d[9],o=d[10],n=d[11],q=d[12],l=d[13],p=d[14],d=d[15];c[0].set(f-a,i-g,n-h,d-q);c[1].set(f+a,i+g,n+h,d+q);c[2].set(f+b,i+k,n+j,d+l);c[3].set(f-b,i-k,n-j,d-l);c[4].set(f-e,i-m,n-o,d-p);c[5].set(f+e,i+m,n+o,d+p);for(a=0;a<6;a++){b=c[a];b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}};
 THREE.Frustum.prototype.contains=function(a){for(var b=this.planes,c=a.matrixWorld,d=c.elements,c=-a.geometry.boundingSphere.radius*c.getMaxScaleOnAxis(),e=0;e<6;e++){a=b[e].x*d[12]+b[e].y*d[13]+b[e].z*d[14]+b[e].w;if(a<=c)return false}return true};THREE.Frustum.__v1=new THREE.Vector3;
 THREE.Frustum.prototype.contains=function(a){for(var b=this.planes,c=a.matrixWorld,d=c.elements,c=-a.geometry.boundingSphere.radius*c.getMaxScaleOnAxis(),e=0;e<6;e++){a=b[e].x*d[12]+b[e].y*d[13]+b[e].z*d[14]+b[e].w;if(a<=c)return false}return true};THREE.Frustum.__v1=new THREE.Vector3;
 THREE.Ray=function(a,b){function c(a,b,c){l.sub(c,a);r=l.dot(b);z=p.add(a,u.copy(b).multiplyScalar(r));return A=c.distanceTo(z)}function d(a,b,c,d){l.sub(d,b);p.sub(c,b);u.sub(a,b);v=l.dot(l);D=l.dot(p);x=l.dot(u);G=p.dot(p);s=p.dot(u);y=1/(v*G-D*D);C=(G*x-D*s)*y;H=(v*s-D*x)*y;return C>=0&&H>=0&&C+H<1}this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;var e=1.0E-4;this.setPrecision=function(a){e=a};var f=new THREE.Vector3,g=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3,
 THREE.Ray=function(a,b){function c(a,b,c){l.sub(c,a);r=l.dot(b);z=p.add(a,u.copy(b).multiplyScalar(r));return A=c.distanceTo(z)}function d(a,b,c,d){l.sub(d,b);p.sub(c,b);u.sub(a,b);v=l.dot(l);D=l.dot(p);x=l.dot(u);G=p.dot(p);s=p.dot(u);y=1/(v*G-D*D);C=(G*x-D*s)*y;H=(v*s-D*x)*y;return C>=0&&H>=0&&C+H<1}this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;var e=1.0E-4;this.setPrecision=function(a){e=a};var f=new THREE.Vector3,g=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3,
@@ -61,7 +62,7 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,applyMatrix:function(a){thi
 this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.getRotationFromMatrix(this.matrix)},add:function(a){if(a===this)console.warn("THREE.Object3D.add: An object can't be added as a child of itself.");else if(a instanceof THREE.Object3D){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__addObject(a)}},remove:function(a){var b=
 this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.getRotationFromMatrix(this.matrix)},add:function(a){if(a===this)console.warn("THREE.Object3D.add: An object can't be added as a child of itself.");else if(a instanceof THREE.Object3D){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__addObject(a)}},remove:function(a){var b=
 this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__removeObject(a)}},getChildByName:function(a,b){var c,d,e;c=0;for(d=this.children.length;c<d;c++){e=this.children[c];if(e.name===a)return e;if(b){e=e.getChildByName(a,b);if(e!==void 0)return e}}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,
 this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__removeObject(a)}},getChildByName:function(a,b){var c,d,e;c=0;for(d=this.children.length;c<d;c++){e=this.children[c];if(e.name===a)return e;if(b){e=e.getChildByName(a,b);if(e!==void 0)return e}}},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=true},updateMatrixWorld:function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false;a=true}for(var b=0,c=this.children.length;b<
 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=true},updateMatrixWorld:function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false;a=true}for(var b=0,c=this.children.length;b<
-c;b++)this.children[b].updateMatrixWorld(a)},worldToLocal:function(a){if(!this.__inverseMatrixWorld)this.__inverseMatrixWorld=new THREE.Matrix4;return this.__inverseMatrixWorld.getInverse(this.matrixWorld).multiplyVector3(a)},localToWorld:function(a){return this.matrixWorld.multiplyVector3(a)}};THREE.Object3DCount=0;
+c;b++)this.children[b].updateMatrixWorld(a)},worldToLocal:function(a){return THREE.Object3D.__m1.getInverse(this.matrixWorld).multiplyVector3(a)},localToWorld:function(a){return this.matrixWorld.multiplyVector3(a)}};THREE.Object3D.__m1=new THREE.Matrix4;THREE.Object3DCount=0;
 THREE.Projector=function(){function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}function b(){var a=i[m]=i[m]||new THREE.RenderableVertex;m++;return a}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,f=a.z+a.w,e=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(f>=0&&e>=0&&g>=0&&h>=0)return true;if(f<0&&e<0||g<0&&h<0)return false;f<0?c=Math.max(c,f/(f-e)):e<0&&(d=Math.min(d,f/(f-e)));g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h)));if(d<c)return false;a.lerpSelf(b,c);b.lerpSelf(a,1-
 THREE.Projector=function(){function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}function b(){var a=i[m]=i[m]||new THREE.RenderableVertex;m++;return a}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,f=a.z+a.w,e=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(f>=0&&e>=0&&g>=0&&h>=0)return true;if(f<0&&e<0||g<0&&h<0)return false;f<0?c=Math.max(c,f/(f-e)):e<0&&(d=Math.min(d,f/(f-e)));g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h)));if(d<c)return false;a.lerpSelf(b,c);b.lerpSelf(a,1-
 d);return true}var e,f,g=[],k,m,i=[],h,j,o=[],n,q=[],l,p,u=[],r,z,A=[],v={objects:[],sprites:[],lights:[],elements:[]},D=new THREE.Vector3,x=new THREE.Vector4,G=new THREE.Matrix4,s=new THREE.Matrix4,y=new THREE.Frustum,C=new THREE.Vector4,H=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);G.multiply(b.projectionMatrix,b.matrixWorldInverse);G.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);
 d);return true}var e,f,g=[],k,m,i=[],h,j,o=[],n,q=[],l,p,u=[],r,z,A=[],v={objects:[],sprites:[],lights:[],elements:[]},D=new THREE.Vector3,x=new THREE.Vector4,G=new THREE.Matrix4,s=new THREE.Matrix4,y=new THREE.Frustum,C=new THREE.Vector4,H=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);G.multiply(b.projectionMatrix,b.matrixWorldInverse);G.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);
 G.multiply(b.matrixWorld,b.projectionMatrixInverse);G.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectGraph=function(b,d){f=0;v.objects.length=0;v.sprites.length=0;v.lights.length=0;var g=function(b){if(b.visible!==false){if((b instanceof THREE.Mesh||b instanceof THREE.Line)&&(b.frustumCulled===false||y.contains(b))){D.copy(b.matrixWorld.getPosition());
 G.multiply(b.matrixWorld,b.projectionMatrixInverse);G.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectGraph=function(b,d){f=0;v.objects.length=0;v.sprites.length=0;v.lights.length=0;var g=function(b){if(b.visible!==false){if((b instanceof THREE.Mesh||b instanceof THREE.Line)&&(b.frustumCulled===false||y.contains(b))){D.copy(b.matrixWorld.getPosition());
@@ -105,7 +106,7 @@ THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,thi
 THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a!==void 0?a:50;this.aspect=b!==void 0?b:1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;
 THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a!==void 0?a:50;this.aspect=b!==void 0?b:1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;
 THREE.PerspectiveCamera.prototype.setLens=function(a,b){this.fov=2*Math.atan((b!==void 0?b:24)/(a*2))*(180/Math.PI);this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.setLens=function(a,b){this.fov=2*Math.atan((b!==void 0?b:24)/(a*2))*(180/Math.PI);this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};
-THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;
+THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;
 THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0;this.onlyShadow=this.castShadow=false;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=false;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;
 THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0;this.onlyShadow=this.castShadow=false;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=false;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;
 this.shadowCascade=false;this.shadowCascadeOffset=new THREE.Vector3(0,0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
 this.shadowCascade=false;this.shadowCascadeOffset=new THREE.Vector3(0,0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
 THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
@@ -129,7 +130,8 @@ g,h,k,[new THREE.Vector3(E[i*3],E[i*3+1],E[i*3+2]),new THREE.Vector3(p,q,m),new
 x(a,t+20+16);l=x(a,t+20+20);p=x(a,t+20+24);u=x(a,t+20+28);r=x(a,t+20+32);z=x(a,t+20+36);A=x(a,t+20+40);t=t+c;c=e*3+h;O=e*4+h;I=b*c;Q=q*(c+m*3);e=l*(c+i*3);h=p*(c+m*3+i*3);c=u*O;m=r*(O+m*4);i=z*(O+i*4);t=t+function(b){var b=new Float32Array(a,b,j*3),c,d,f,e;for(c=0;c<j;c++){d=b[c*3];f=b[c*3+1];e=b[c*3+2];N.vertices.push(new THREE.Vector3(d,f,e))}return j*3*Float32Array.BYTES_PER_ELEMENT}(t);t=t+function(b){if(o){var b=new Int8Array(a,b,o*3),c,d,f,e;for(c=0;c<o;c++){d=b[c*3];f=b[c*3+1];e=b[c*3+2];E.push(d/
 x(a,t+20+16);l=x(a,t+20+20);p=x(a,t+20+24);u=x(a,t+20+28);r=x(a,t+20+32);z=x(a,t+20+36);A=x(a,t+20+40);t=t+c;c=e*3+h;O=e*4+h;I=b*c;Q=q*(c+m*3);e=l*(c+i*3);h=p*(c+m*3+i*3);c=u*O;m=r*(O+m*4);i=z*(O+i*4);t=t+function(b){var b=new Float32Array(a,b,j*3),c,d,f,e;for(c=0;c<j;c++){d=b[c*3];f=b[c*3+1];e=b[c*3+2];N.vertices.push(new THREE.Vector3(d,f,e))}return j*3*Float32Array.BYTES_PER_ELEMENT}(t);t=t+function(b){if(o){var b=new Int8Array(a,b,o*3),c,d,f,e;for(c=0;c<o;c++){d=b[c*3];f=b[c*3+1];e=b[c*3+2];E.push(d/
 127,f/127,e/127)}}return o*3*Int8Array.BYTES_PER_ELEMENT}(t);t=t+v(o*3);t=t+function(b){if(n){var b=new Float32Array(a,b,n*2),c,d,f;for(c=0;c<n;c++){d=b[c*2];f=b[c*2+1];F.push(d,f)}}return n*2*Float32Array.BYTES_PER_ELEMENT}(t);I=t+I+v(b*2);Q=I+Q+v(q*2);e=Q+e+v(l*2);h=e+h+v(p*2);c=h+c+v(u*2);m=c+m+v(r*2);i=m+i+v(z*2);(function(a){if(l){var b=a+l*Uint32Array.BYTES_PER_ELEMENT*3;y(l,a,b+l*Uint32Array.BYTES_PER_ELEMENT*3);G(l,b)}})(Q);(function(a){if(p){var b=a+p*Uint32Array.BYTES_PER_ELEMENT*3,c=b+
 127,f/127,e/127)}}return o*3*Int8Array.BYTES_PER_ELEMENT}(t);t=t+v(o*3);t=t+function(b){if(n){var b=new Float32Array(a,b,n*2),c,d,f;for(c=0;c<n;c++){d=b[c*2];f=b[c*2+1];F.push(d,f)}}return n*2*Float32Array.BYTES_PER_ELEMENT}(t);I=t+I+v(b*2);Q=I+Q+v(q*2);e=Q+e+v(l*2);h=e+h+v(p*2);c=h+c+v(u*2);m=c+m+v(r*2);i=m+i+v(z*2);(function(a){if(l){var b=a+l*Uint32Array.BYTES_PER_ELEMENT*3;y(l,a,b+l*Uint32Array.BYTES_PER_ELEMENT*3);G(l,b)}})(Q);(function(a){if(p){var b=a+p*Uint32Array.BYTES_PER_ELEMENT*3,c=b+
 p*Uint32Array.BYTES_PER_ELEMENT*3;H(p,a,b,c+p*Uint32Array.BYTES_PER_ELEMENT*3);G(p,c)}})(e);(function(a){if(z){var b=a+z*Uint32Array.BYTES_PER_ELEMENT*4;C(z,a,b+z*Uint32Array.BYTES_PER_ELEMENT*4);s(z,b)}})(m);(function(a){if(A){var b=a+A*Uint32Array.BYTES_PER_ELEMENT*4,c=b+A*Uint32Array.BYTES_PER_ELEMENT*4;R(A,a,b,c+A*Uint32Array.BYTES_PER_ELEMENT*4);s(A,c)}})(i);b&&y(b,t,t+b*Uint32Array.BYTES_PER_ELEMENT*3);(function(a){if(q){var b=a+q*Uint32Array.BYTES_PER_ELEMENT*3;H(q,a,b,b+q*Uint32Array.BYTES_PER_ELEMENT*
 p*Uint32Array.BYTES_PER_ELEMENT*3;H(p,a,b,c+p*Uint32Array.BYTES_PER_ELEMENT*3);G(p,c)}})(e);(function(a){if(z){var b=a+z*Uint32Array.BYTES_PER_ELEMENT*4;C(z,a,b+z*Uint32Array.BYTES_PER_ELEMENT*4);s(z,b)}})(m);(function(a){if(A){var b=a+A*Uint32Array.BYTES_PER_ELEMENT*4,c=b+A*Uint32Array.BYTES_PER_ELEMENT*4;R(A,a,b,c+A*Uint32Array.BYTES_PER_ELEMENT*4);s(A,c)}})(i);b&&y(b,t,t+b*Uint32Array.BYTES_PER_ELEMENT*3);(function(a){if(q){var b=a+q*Uint32Array.BYTES_PER_ELEMENT*3;H(q,a,b,b+q*Uint32Array.BYTES_PER_ELEMENT*
-3)}})(I);u&&C(u,h,h+u*Uint32Array.BYTES_PER_ELEMENT*4);(function(a){if(r){var b=a+r*Uint32Array.BYTES_PER_ELEMENT*4;R(r,a,b,b+r*Uint32Array.BYTES_PER_ELEMENT*4)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;b(new e(c))};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;
+3)}})(I);u&&C(u,h,h+u*Uint32Array.BYTES_PER_ELEMENT*4);(function(a){if(r){var b=a+r*Uint32Array.BYTES_PER_ELEMENT*4;R(r,a,b,b+r*Uint32Array.BYTES_PER_ELEMENT*4)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;b(new e(c))};THREE.ImageLoader=function(){THREE.EventTarget.call(this)};
+THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,crossOrigin:"anonymous",load:function(a){var b=this,c=new Image;c.addEventListener("load",function(){b.dispatchEvent({type:"complete",image:c})},false);c.addEventListener("error",function(){b.dispatchEvent({type:"error"})},false);c.crossOrigin=this.crossOrigin;c.src=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;
 THREE.JSONLoader.prototype.load=function(a,b,c){c=c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.load=function(a,b,c){c=c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(f.status===200||f.status===0){if(f.responseText){var k=JSON.parse(f.responseText);a.createModel(k,c,d)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+f.status+"]");else if(f.readyState===f.LOADING){if(e){g===0&&(g=f.getResponseHeader("Content-Length"));
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(f.status===200||f.status===0){if(f.responseText){var k=JSON.parse(f.responseText);a.createModel(k,c,d)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+f.status+"]");else if(f.readyState===f.LOADING){if(e){g===0&&(g=f.getResponseHeader("Content-Length"));
 e({total:g,loaded:f.responseText.length})}}else f.readyState===f.HEADERS_RECEIVED&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,true);f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined");f.setRequestHeader("Content-Type","text/plain");f.send(null)};
 e({total:g,loaded:f.responseText.length})}}else f.readyState===f.HEADERS_RECEIVED&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,true);f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined");f.setRequestHeader("Content-Type","text/plain");f.send(null)};
@@ -180,9 +182,8 @@ THREE.UnsignedShort4444Type=16;THREE.UnsignedShort5551Type=17;THREE.UnsignedShor
 THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.image.data,this.image.width,this.image.height,this.format,this.type,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};THREE.Particle=function(a){THREE.Object3D.call(this);this.material=a};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
 THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.image.data,this.image.width,this.image.height,this.format,this.type,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};THREE.Particle=function(a){THREE.Object3D.call(this);this.material=a};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
 THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.LineBasicMaterial({color:Math.random()*16777215});this.type=c!==void 0?c:THREE.LineStrip;this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere())};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
 THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.LineBasicMaterial({color:Math.random()*16777215});this.type=c!==void 0?c:THREE.LineStrip;this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere())};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
 THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.MeshBasicMaterial({color:Math.random()*16777215,wireframe:true});if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius;if(this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++){this.morphTargetInfluences.push(0);
 THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.MeshBasicMaterial({color:Math.random()*16777215,wireframe:true});if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius;if(this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++){this.morphTargetInfluences.push(0);
-this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}}}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
-THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
-THREE.Bone.prototype.update=function(a,b){this.matrixAutoUpdate&&(b=b|this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix);this.matrixWorldNeedsUpdate=false;b=true}var c,d=this.children.length;for(c=0;c<d;c++)this.children[c].update(this.skinMatrix,b)};
+this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}}}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4};
+THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.update=function(a,b){this.matrixAutoUpdate&&(b=b|this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix);this.matrixWorldNeedsUpdate=false;b=true}var c,d=this.children.length;for(c=0;c<d;c++)this.children[c].update(this.skinMatrix,b)};
 THREE.Sprite=function(a){THREE.Object3D.call(this);this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:new THREE.Texture;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.blendSrc=a.blendSrc!==void 0?a.blendSrc:THREE.SrcAlphaFactor;this.blendDst=a.blendDst!==void 0?a.blendDst:THREE.OneMinusSrcAlphaFactor;this.blendEquation=a.blendEquation!==void 0?a.blendEquation:THREE.AddEquation;this.useScreenCoordinates=a.useScreenCoordinates!==
 THREE.Sprite=function(a){THREE.Object3D.call(this);this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:new THREE.Texture;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.blendSrc=a.blendSrc!==void 0?a.blendSrc:THREE.SrcAlphaFactor;this.blendDst=a.blendDst!==void 0?a.blendDst:THREE.OneMinusSrcAlphaFactor;this.blendEquation=a.blendEquation!==void 0?a.blendEquation:THREE.AddEquation;this.useScreenCoordinates=a.useScreenCoordinates!==
 void 0?a.useScreenCoordinates:true;this.mergeWith3D=a.mergeWith3D!==void 0?a.mergeWith3D:!this.useScreenCoordinates;this.affectedByDistance=a.affectedByDistance!==void 0?a.affectedByDistance:!this.useScreenCoordinates;this.scaleByViewport=a.scaleByViewport!==void 0?a.scaleByViewport:!this.affectedByDistance;this.alignment=a.alignment instanceof THREE.Vector2?a.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=
 void 0?a.useScreenCoordinates:true;this.mergeWith3D=a.mergeWith3D!==void 0?a.mergeWith3D:!this.useScreenCoordinates;this.affectedByDistance=a.affectedByDistance!==void 0?a.affectedByDistance:!this.useScreenCoordinates;this.scaleByViewport=a.scaleByViewport!==void 0?a.scaleByViewport:!this.affectedByDistance;this.alignment=a.alignment instanceof THREE.Vector2?a.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=
 new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1){this.matrix.scale(this.scale);this.boundRadiusScale=Math.max(this.scale.x,this.scale.y)}this.matrixWorldNeedsUpdate=true};THREE.SpriteAlignment={};
 new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1){this.matrix.scale(this.scale);this.boundRadiusScale=Math.max(this.scale.x,this.scale.y)}this.matrixWorldNeedsUpdate=true};THREE.SpriteAlignment={};
@@ -209,16 +210,16 @@ THREE.MeshLambertMaterial)if(xa)if(!j.wireframe&&j.shading==THREE.SmoothShading&
 Math.max(0,Math.min(j.color.r*J.r,1));J.g=Math.max(0,Math.min(j.color.g*J.g,1));J.b=Math.max(0,Math.min(j.color.b*J.b,1));L.r=Math.max(0,Math.min(j.color.r*L.r,1));L.g=Math.max(0,Math.min(j.color.g*L.g,1));L.b=Math.max(0,Math.min(j.color.b*L.b,1));S.r=Math.max(0,Math.min(j.color.r*S.r,1));S.g=Math.max(0,Math.min(j.color.g*S.g,1));S.b=Math.max(0,Math.min(j.color.b*S.b,1));ca=va(K,J,L,S);z(t,E,F,I,w,P);pa(t,E,F,I,w,P,0,0,1,0,0,1,ca);z(M,U,Q,O,T,W);pa(M,U,Q,O,T,W,1,0,1,1,0,1,ca)}else{B.r=Y.r;B.g=Y.g;
 Math.max(0,Math.min(j.color.r*J.r,1));J.g=Math.max(0,Math.min(j.color.g*J.g,1));J.b=Math.max(0,Math.min(j.color.b*J.b,1));L.r=Math.max(0,Math.min(j.color.r*L.r,1));L.g=Math.max(0,Math.min(j.color.g*L.g,1));L.b=Math.max(0,Math.min(j.color.b*L.b,1));S.r=Math.max(0,Math.min(j.color.r*S.r,1));S.g=Math.max(0,Math.min(j.color.g*S.g,1));S.b=Math.max(0,Math.min(j.color.b*S.b,1));ca=va(K,J,L,S);z(t,E,F,I,w,P);pa(t,E,F,I,w,P,0,0,1,0,0,1,ca);z(M,U,Q,O,T,W);pa(M,U,Q,O,T,W,1,0,1,1,0,1,ca)}else{B.r=Y.r;B.g=Y.g;
 B.b=Y.b;o(m,l.centroidWorld,l.normalWorld,B);B.r=Math.max(0,Math.min(j.color.r*B.r,1));B.g=Math.max(0,Math.min(j.color.g*B.g,1));B.b=Math.max(0,Math.min(j.color.b*B.b,1));A(t,E,F,I,Q,O,w,P);j.wireframe?ha(B,j.wireframeLinewidth,j.wireframeLinecap,j.wireframeLinejoin):ga(B)}else{A(t,E,F,I,Q,O,w,P);j.wireframe?ha(j.color,j.wireframeLinewidth,j.wireframeLinecap,j.wireframeLinejoin):ga(j.color)}else if(j instanceof THREE.MeshNormalMaterial){B.r=qa(l.normalWorld.x);B.g=qa(l.normalWorld.y);B.b=qa(l.normalWorld.z);
 B.b=Y.b;o(m,l.centroidWorld,l.normalWorld,B);B.r=Math.max(0,Math.min(j.color.r*B.r,1));B.g=Math.max(0,Math.min(j.color.g*B.g,1));B.b=Math.max(0,Math.min(j.color.b*B.b,1));A(t,E,F,I,Q,O,w,P);j.wireframe?ha(B,j.wireframeLinewidth,j.wireframeLinecap,j.wireframeLinejoin):ga(B)}else{A(t,E,F,I,Q,O,w,P);j.wireframe?ha(j.color,j.wireframeLinewidth,j.wireframeLinecap,j.wireframeLinejoin):ga(j.color)}else if(j instanceof THREE.MeshNormalMaterial){B.r=qa(l.normalWorld.x);B.g=qa(l.normalWorld.y);B.b=qa(l.normalWorld.z);
 A(t,E,F,I,Q,O,w,P);j.wireframe?ha(B,j.wireframeLinewidth,j.wireframeLinecap,j.wireframeLinejoin):ga(B)}else if(j instanceof THREE.MeshDepthMaterial){ea=h.near;fa=h.far;K.r=K.g=K.b=1-oa(a.positionScreen.z,ea,fa);J.r=J.g=J.b=1-oa(d.positionScreen.z,ea,fa);L.r=L.g=L.b=1-oa(g.positionScreen.z,ea,fa);S.r=S.g=S.b=1-oa(e.positionScreen.z,ea,fa);ca=va(K,J,L,S);z(t,E,F,I,w,P);pa(t,E,F,I,w,P,0,0,1,0,0,1,ca);z(M,U,Q,O,T,W);pa(M,U,Q,O,T,W,1,0,1,1,0,1,ca)}}}function z(a,b,c,d,e,f){l.beginPath();l.moveTo(a,b);
 A(t,E,F,I,Q,O,w,P);j.wireframe?ha(B,j.wireframeLinewidth,j.wireframeLinecap,j.wireframeLinejoin):ga(B)}else if(j instanceof THREE.MeshDepthMaterial){ea=h.near;fa=h.far;K.r=K.g=K.b=1-oa(a.positionScreen.z,ea,fa);J.r=J.g=J.b=1-oa(d.positionScreen.z,ea,fa);L.r=L.g=L.b=1-oa(g.positionScreen.z,ea,fa);S.r=S.g=S.b=1-oa(e.positionScreen.z,ea,fa);ca=va(K,J,L,S);z(t,E,F,I,w,P);pa(t,E,F,I,w,P,0,0,1,0,0,1,ca);z(M,U,Q,O,T,W);pa(M,U,Q,O,T,W,1,0,1,1,0,1,ca)}}}function z(a,b,c,d,e,f){l.beginPath();l.moveTo(a,b);
-l.lineTo(c,d);l.lineTo(e,f);l.lineTo(a,b)}function A(a,b,c,d,e,f,g,h){l.beginPath();l.moveTo(a,b);l.lineTo(c,d);l.lineTo(e,f);l.lineTo(g,h);l.lineTo(a,b)}function ha(a,b,c,e){if(D!=b)l.lineWidth=D=b;if(x!=c)l.lineCap=x=c;if(G!=e)l.lineJoin=G=e;d(a.getContextStyle());l.stroke();Z.inflate(b*2)}function ga(a){e(a.getContextStyle());l.fill()}function Fa(a,b,c,d,f,g,h,i,j,k,m,o,n){if(n.image.width!=0){if(n.needsUpdate==true||ja[n.id]==void 0){var p=n.wrapS==THREE.RepeatWrapping,q=n.wrapT==THREE.RepeatWrapping;
-ja[n.id]=l.createPattern(n.image,p&&q?"repeat":p&&!q?"repeat-x":!p&&q?"repeat-y":"no-repeat");n.needsUpdate=false}e(ja[n.id]);var p=n.offset.x/n.repeat.x,q=n.offset.y/n.repeat.y,r=n.image.width*n.repeat.x,s=n.image.height*n.repeat.y,h=(h+p)*r,i=(i+q)*s,c=c-a,d=d-b,f=f-a,g=g-b,j=(j+p)*r-h,k=(k+q)*s-i,m=(m+p)*r-h,o=(o+q)*s-i,p=j*o-m*k;if(p==0){if(da[n.id]===void 0){b=document.createElement("canvas");b.width=n.image.width;b.height=n.image.height;b=b.getContext("2d");b.drawImage(n.image,0,0);da[n.id]=
-b.getImageData(0,0,n.image.width,n.image.height).data}b=da[n.id];h=(Math.floor(h)+Math.floor(i)*n.image.width)*4;B.setRGB(b[h]/255,b[h+1]/255,b[h+2]/255);ga(B)}else{p=1/p;n=(o*c-k*f)*p;k=(o*d-k*g)*p;c=(j*f-m*c)*p;d=(j*g-m*d)*p;a=a-n*h-c*i;h=b-k*h-d*i;l.save();l.transform(n,k,c,d,a,h);l.fill();l.restore()}}}function pa(a,b,c,d,e,f,g,h,i,j,k,m,n){var o,p;o=n.width-1;p=n.height-1;g=g*o;h=h*p;c=c-a;d=d-b;e=e-a;f=f-b;i=i*o-g;j=j*p-h;k=k*o-g;m=m*p-h;p=1/(i*m-k*j);o=(m*c-j*e)*p;j=(m*d-j*f)*p;c=(i*e-k*c)*
-p;d=(i*f-k*d)*p;a=a-o*g-c*h;b=b-j*g-d*h;l.save();l.transform(o,j,c,d,a,b);l.clip();l.drawImage(n,0,0);l.restore()}function va(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),i=~~(c.r*255),j=~~(c.g*255),c=~~(c.b*255),k=~~(d.r*255),l=~~(d.g*255),d=~~(d.b*255);aa[0]=e<0?0:e>255?255:e;aa[1]=f<0?0:f>255?255:f;aa[2]=a<0?0:a>255?255:a;aa[4]=g<0?0:g>255?255:g;aa[5]=h<0?0:h>255?255:h;aa[6]=b<0?0:b>255?255:b;aa[8]=i<0?0:i>255?255:i;aa[9]=j<0?0:j>255?255:j;aa[10]=
-c<0?0:c>255?255:c;aa[12]=k<0?0:k>255?255:k;aa[13]=l<0?0:l>255?255:l;aa[14]=d<0?0:d>255?255:d;sa.putImageData(ya,0,0);ua.drawImage(ra,0,0);return ta}function oa(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function qa(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function ia(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqrt(e);c=c*e;d=d*e;b.x=b.x+c;b.y=b.y+d;a.x=a.x-c;a.y=a.y-d}}var wa,Ga,X,ba;this.autoClear?this.clear():l.setTransform(1,0,0,-1,n,q);f.info.render.vertices=0;f.info.render.faces=0;g=i.projectScene(a,
-h,this.sortElements);k=g.elements;m=g.lights;(xa=m.length>0)&&j(m);wa=0;for(Ga=k.length;wa<Ga;wa++){X=k[wa];ba=X.material;ba=ba instanceof THREE.MeshFaceMaterial?X.faceMaterial:ba;if(!(ba===void 0||ba.visible===false)){Z.empty();if(X instanceof THREE.RenderableParticle){s=X;s.x=s.x*n;s.y=s.y*q;p(s,X,ba,a)}else if(X instanceof THREE.RenderableLine){s=X.v1;y=X.v2;s.positionScreen.x=s.positionScreen.x*n;s.positionScreen.y=s.positionScreen.y*q;y.positionScreen.x=y.positionScreen.x*n;y.positionScreen.y=
-y.positionScreen.y*q;Z.addPoint(s.positionScreen.x,s.positionScreen.y);Z.addPoint(y.positionScreen.x,y.positionScreen.y);la.intersects(Z)&&r(s,y,X,ba,a)}else if(X instanceof THREE.RenderableFace3){s=X.v1;y=X.v2;C=X.v3;s.positionScreen.x=s.positionScreen.x*n;s.positionScreen.y=s.positionScreen.y*q;y.positionScreen.x=y.positionScreen.x*n;y.positionScreen.y=y.positionScreen.y*q;C.positionScreen.x=C.positionScreen.x*n;C.positionScreen.y=C.positionScreen.y*q;if(ba.overdraw){ia(s.positionScreen,y.positionScreen);
-ia(y.positionScreen,C.positionScreen);ia(C.positionScreen,s.positionScreen)}Z.add3Points(s.positionScreen.x,s.positionScreen.y,y.positionScreen.x,y.positionScreen.y,C.positionScreen.x,C.positionScreen.y);la.intersects(Z)&&u(s,y,C,0,1,2,X,ba,a)}else if(X instanceof THREE.RenderableFace4){s=X.v1;y=X.v2;C=X.v3;H=X.v4;s.positionScreen.x=s.positionScreen.x*n;s.positionScreen.y=s.positionScreen.y*q;y.positionScreen.x=y.positionScreen.x*n;y.positionScreen.y=y.positionScreen.y*q;C.positionScreen.x=C.positionScreen.x*
-n;C.positionScreen.y=C.positionScreen.y*q;H.positionScreen.x=H.positionScreen.x*n;H.positionScreen.y=H.positionScreen.y*q;R.positionScreen.copy(y.positionScreen);N.positionScreen.copy(H.positionScreen);if(ba.overdraw){ia(s.positionScreen,y.positionScreen);ia(y.positionScreen,H.positionScreen);ia(H.positionScreen,s.positionScreen);ia(C.positionScreen,R.positionScreen);ia(C.positionScreen,N.positionScreen)}Z.addPoint(s.positionScreen.x,s.positionScreen.y);Z.addPoint(y.positionScreen.x,y.positionScreen.y);
-Z.addPoint(C.positionScreen.x,C.positionScreen.y);Z.addPoint(H.positionScreen.x,H.positionScreen.y);la.intersects(Z)&&v(s,y,C,H,R,N,X,ba,a)}$.addRectangle(Z)}}l.setTransform(1,0,0,1,0,0)}};THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=true};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
+l.lineTo(c,d);l.lineTo(e,f);l.lineTo(a,b)}function A(a,b,c,d,e,f,g,h){l.beginPath();l.moveTo(a,b);l.lineTo(c,d);l.lineTo(e,f);l.lineTo(g,h);l.lineTo(a,b)}function ha(a,b,c,e){if(D!=b)l.lineWidth=D=b;if(x!=c)l.lineCap=x=c;if(G!=e)l.lineJoin=G=e;d(a.getContextStyle());l.stroke();Z.inflate(b*2)}function ga(a){e(a.getContextStyle());l.fill()}function Fa(a,b,c,d,f,g,h,i,j,k,m,o,n){if(!(n.image===void 0||n.image.width===0)){if(n.needsUpdate===true||ja[n.id]===void 0){var p=n.wrapS==THREE.RepeatWrapping,
+q=n.wrapT==THREE.RepeatWrapping;ja[n.id]=l.createPattern(n.image,p&&q?"repeat":p&&!q?"repeat-x":!p&&q?"repeat-y":"no-repeat");n.needsUpdate=false}e(ja[n.id]);var p=n.offset.x/n.repeat.x,q=n.offset.y/n.repeat.y,r=n.image.width*n.repeat.x,s=n.image.height*n.repeat.y,h=(h+p)*r,i=(i+q)*s,c=c-a,d=d-b,f=f-a,g=g-b,j=(j+p)*r-h,k=(k+q)*s-i,m=(m+p)*r-h,o=(o+q)*s-i,p=j*o-m*k;if(p==0){if(da[n.id]===void 0){b=document.createElement("canvas");b.width=n.image.width;b.height=n.image.height;b=b.getContext("2d");b.drawImage(n.image,
+0,0);da[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data}b=da[n.id];h=(Math.floor(h)+Math.floor(i)*n.image.width)*4;B.setRGB(b[h]/255,b[h+1]/255,b[h+2]/255);ga(B)}else{p=1/p;n=(o*c-k*f)*p;k=(o*d-k*g)*p;c=(j*f-m*c)*p;d=(j*g-m*d)*p;a=a-n*h-c*i;h=b-k*h-d*i;l.save();l.transform(n,k,c,d,a,h);l.fill();l.restore()}}}function pa(a,b,c,d,e,f,g,h,i,j,k,m,n){var o,p;o=n.width-1;p=n.height-1;g=g*o;h=h*p;c=c-a;d=d-b;e=e-a;f=f-b;i=i*o-g;j=j*p-h;k=k*o-g;m=m*p-h;p=1/(i*m-k*j);o=(m*c-j*e)*p;j=(m*d-j*f)*
+p;c=(i*e-k*c)*p;d=(i*f-k*d)*p;a=a-o*g-c*h;b=b-j*g-d*h;l.save();l.transform(o,j,c,d,a,b);l.clip();l.drawImage(n,0,0);l.restore()}function va(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),i=~~(c.r*255),j=~~(c.g*255),c=~~(c.b*255),k=~~(d.r*255),l=~~(d.g*255),d=~~(d.b*255);aa[0]=e<0?0:e>255?255:e;aa[1]=f<0?0:f>255?255:f;aa[2]=a<0?0:a>255?255:a;aa[4]=g<0?0:g>255?255:g;aa[5]=h<0?0:h>255?255:h;aa[6]=b<0?0:b>255?255:b;aa[8]=i<0?0:i>255?255:i;aa[9]=j<0?0:
+j>255?255:j;aa[10]=c<0?0:c>255?255:c;aa[12]=k<0?0:k>255?255:k;aa[13]=l<0?0:l>255?255:l;aa[14]=d<0?0:d>255?255:d;sa.putImageData(ya,0,0);ua.drawImage(ra,0,0);return ta}function oa(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function qa(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function ia(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqrt(e);c=c*e;d=d*e;b.x=b.x+c;b.y=b.y+d;a.x=a.x-c;a.y=a.y-d}}var wa,Ga,X,ba;this.autoClear?this.clear():l.setTransform(1,0,0,-1,n,q);f.info.render.vertices=0;f.info.render.faces=
+0;g=i.projectScene(a,h,this.sortElements);k=g.elements;m=g.lights;(xa=m.length>0)&&j(m);wa=0;for(Ga=k.length;wa<Ga;wa++){X=k[wa];ba=X.material;ba=ba instanceof THREE.MeshFaceMaterial?X.faceMaterial:ba;if(!(ba===void 0||ba.visible===false)){Z.empty();if(X instanceof THREE.RenderableParticle){s=X;s.x=s.x*n;s.y=s.y*q;p(s,X,ba,a)}else if(X instanceof THREE.RenderableLine){s=X.v1;y=X.v2;s.positionScreen.x=s.positionScreen.x*n;s.positionScreen.y=s.positionScreen.y*q;y.positionScreen.x=y.positionScreen.x*
+n;y.positionScreen.y=y.positionScreen.y*q;Z.addPoint(s.positionScreen.x,s.positionScreen.y);Z.addPoint(y.positionScreen.x,y.positionScreen.y);la.intersects(Z)&&r(s,y,X,ba,a)}else if(X instanceof THREE.RenderableFace3){s=X.v1;y=X.v2;C=X.v3;s.positionScreen.x=s.positionScreen.x*n;s.positionScreen.y=s.positionScreen.y*q;y.positionScreen.x=y.positionScreen.x*n;y.positionScreen.y=y.positionScreen.y*q;C.positionScreen.x=C.positionScreen.x*n;C.positionScreen.y=C.positionScreen.y*q;if(ba.overdraw){ia(s.positionScreen,
+y.positionScreen);ia(y.positionScreen,C.positionScreen);ia(C.positionScreen,s.positionScreen)}Z.add3Points(s.positionScreen.x,s.positionScreen.y,y.positionScreen.x,y.positionScreen.y,C.positionScreen.x,C.positionScreen.y);la.intersects(Z)&&u(s,y,C,0,1,2,X,ba,a)}else if(X instanceof THREE.RenderableFace4){s=X.v1;y=X.v2;C=X.v3;H=X.v4;s.positionScreen.x=s.positionScreen.x*n;s.positionScreen.y=s.positionScreen.y*q;y.positionScreen.x=y.positionScreen.x*n;y.positionScreen.y=y.positionScreen.y*q;C.positionScreen.x=
+C.positionScreen.x*n;C.positionScreen.y=C.positionScreen.y*q;H.positionScreen.x=H.positionScreen.x*n;H.positionScreen.y=H.positionScreen.y*q;R.positionScreen.copy(y.positionScreen);N.positionScreen.copy(H.positionScreen);if(ba.overdraw){ia(s.positionScreen,y.positionScreen);ia(y.positionScreen,H.positionScreen);ia(H.positionScreen,s.positionScreen);ia(C.positionScreen,R.positionScreen);ia(C.positionScreen,N.positionScreen)}Z.addPoint(s.positionScreen.x,s.positionScreen.y);Z.addPoint(y.positionScreen.x,
+y.positionScreen.y);Z.addPoint(C.positionScreen.x,C.positionScreen.y);Z.addPoint(H.positionScreen.x,H.positionScreen.y);la.intersects(Z)&&v(s,y,C,H,R,N,X,ba,a)}$.addRectangle(Z)}}l.setTransform(1,0,0,1,0,0)}};THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=true};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
 THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterial=this.material=null;this.uvs=[[]];this.z=null};
 THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterial=this.material=null;this.uvs=[[]];this.z=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterial=this.material=null;this.uvs=[[]];this.z=null};THREE.RenderableObject=function(){this.z=this.object=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterial=this.material=null;this.uvs=[[]];this.z=null};THREE.RenderableObject=function(){this.z=this.object=null};
 THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.material=null};
 THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.material=null};

+ 72 - 76
build/custom/ThreeExtras.js

@@ -2,8 +2,8 @@
 'use strict';THREE.ColorUtils={adjustHSV:function(b,a,c,d){var e=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,e);e.h=THREE.Math.clamp(e.h+a,0,1);e.s=THREE.Math.clamp(e.s+c,0,1);e.v=THREE.Math.clamp(e.v+d,0,1);b.setHSV(e.h,e.s,e.v)},rgbToHsv:function(b,a){var c=b.r,d=b.g,e=b.b,f=Math.max(Math.max(c,d),e),g=Math.min(Math.min(c,d),e);if(g===f)g=c=0;else{var h=f-g,g=h/f,c=(c===f?(d-e)/h:d===f?2+(e-c)/h:4+(c-d)/h)/6;0>c&&(c+=1);1<c&&(c-=1)}void 0===a&&(a={h:0,s:0,v:0});a.h=c;a.s=g;a.v=f;return a}};
 'use strict';THREE.ColorUtils={adjustHSV:function(b,a,c,d){var e=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,e);e.h=THREE.Math.clamp(e.h+a,0,1);e.s=THREE.Math.clamp(e.s+c,0,1);e.v=THREE.Math.clamp(e.v+d,0,1);b.setHSV(e.h,e.s,e.v)},rgbToHsv:function(b,a){var c=b.r,d=b.g,e=b.b,f=Math.max(Math.max(c,d),e),g=Math.min(Math.min(c,d),e);if(g===f)g=c=0;else{var h=f-g,g=h/f,c=(c===f?(d-e)/h:d===f?2+(e-c)/h:4+(c-d)/h)/6;0>c&&(c+=1);1<c&&(c-=1)}void 0===a&&(a={h:0,s:0,v:0});a.h=c;a.s=g;a.v=f;return a}};
 THREE.ColorUtils.__hsv={h:0,s:0,v:0};
 THREE.ColorUtils.__hsv={h:0,s:0,v:0};
 THREE.GeometryUtils={merge:function(b,a){for(var c,d,e=b.vertices.length,f=a instanceof THREE.Mesh?a.geometry:a,g=b.vertices,h=f.vertices,i=b.faces,j=f.faces,l=b.faceVertexUvs[0],n=f.faceVertexUvs[0],k={},m=0;m<b.materials.length;m++)k[b.materials[m].id]=m;a instanceof THREE.Mesh&&(a.matrixAutoUpdate&&a.updateMatrix(),c=a.matrix,d=new THREE.Matrix4,d.extractRotation(c,a.scale));for(var m=0,p=h.length;m<p;m++){var q=h[m].clone();c&&c.multiplyVector3(q);g.push(q)}m=0;for(p=j.length;m<p;m++){var g=j[m],
 THREE.GeometryUtils={merge:function(b,a){for(var c,d,e=b.vertices.length,f=a instanceof THREE.Mesh?a.geometry:a,g=b.vertices,h=f.vertices,i=b.faces,j=f.faces,l=b.faceVertexUvs[0],n=f.faceVertexUvs[0],k={},m=0;m<b.materials.length;m++)k[b.materials[m].id]=m;a instanceof THREE.Mesh&&(a.matrixAutoUpdate&&a.updateMatrix(),c=a.matrix,d=new THREE.Matrix4,d.extractRotation(c,a.scale));for(var m=0,p=h.length;m<p;m++){var q=h[m].clone();c&&c.multiplyVector3(q);g.push(q)}m=0;for(p=j.length;m<p;m++){var g=j[m],
-r,t,s=g.vertexNormals,v=g.vertexColors;g instanceof THREE.Face3?r=new THREE.Face3(g.a+e,g.b+e,g.c+e):g instanceof THREE.Face4&&(r=new THREE.Face4(g.a+e,g.b+e,g.c+e,g.d+e));r.normal.copy(g.normal);d&&d.multiplyVector3(r.normal);h=0;for(q=s.length;h<q;h++)t=s[h].clone(),d&&d.multiplyVector3(t),r.vertexNormals.push(t);r.color.copy(g.color);h=0;for(q=v.length;h<q;h++)t=v[h],r.vertexColors.push(t.clone());void 0!==g.materialIndex&&(h=f.materials[g.materialIndex],q=h.id,v=k[q],void 0===v&&(v=b.materials.length,
-k[q]=v,b.materials.push(h)),r.materialIndex=v);r.centroid.copy(g.centroid);c&&c.multiplyVector3(r.centroid);i.push(r)}m=0;for(p=n.length;m<p;m++){c=n[m];d=[];h=0;for(q=c.length;h<q;h++)d.push(new THREE.UV(c[h].u,c[h].v));l.push(d)}},clone:function(b){var a=new THREE.Geometry,c,d=b.vertices,e=b.faces,f=b.faceVertexUvs[0];b.materials&&(a.materials=b.materials.slice());b=0;for(c=d.length;b<c;b++)a.vertices.push(d[b].clone());b=0;for(c=e.length;b<c;b++)a.faces.push(e[b].clone());b=0;for(c=f.length;b<
+r,s,t=g.vertexNormals,w=g.vertexColors;g instanceof THREE.Face3?r=new THREE.Face3(g.a+e,g.b+e,g.c+e):g instanceof THREE.Face4&&(r=new THREE.Face4(g.a+e,g.b+e,g.c+e,g.d+e));r.normal.copy(g.normal);d&&d.multiplyVector3(r.normal);h=0;for(q=t.length;h<q;h++)s=t[h].clone(),d&&d.multiplyVector3(s),r.vertexNormals.push(s);r.color.copy(g.color);h=0;for(q=w.length;h<q;h++)s=w[h],r.vertexColors.push(s.clone());void 0!==g.materialIndex&&(h=f.materials[g.materialIndex],q=h.id,w=k[q],void 0===w&&(w=b.materials.length,
+k[q]=w,b.materials.push(h)),r.materialIndex=w);r.centroid.copy(g.centroid);c&&c.multiplyVector3(r.centroid);i.push(r)}m=0;for(p=n.length;m<p;m++){c=n[m];d=[];h=0;for(q=c.length;h<q;h++)d.push(new THREE.UV(c[h].u,c[h].v));l.push(d)}},clone:function(b){var a=new THREE.Geometry,c,d=b.vertices,e=b.faces,f=b.faceVertexUvs[0];b.materials&&(a.materials=b.materials.slice());b=0;for(c=d.length;b<c;b++)a.vertices.push(d[b].clone());b=0;for(c=e.length;b<c;b++)a.faces.push(e[b].clone());b=0;for(c=f.length;b<
 c;b++){for(var d=f[b],e=[],g=0,h=d.length;g<h;g++)e.push(new THREE.UV(d[g].u,d[g].v));a.faceVertexUvs[0].push(e)}return a},randomPointInTriangle:function(b,a,c){var d,e,f,g=new THREE.Vector3,h=THREE.GeometryUtils.__v1;d=THREE.GeometryUtils.random();e=THREE.GeometryUtils.random();1<d+e&&(d=1-d,e=1-e);f=1-d-e;g.copy(b);g.multiplyScalar(d);h.copy(a);h.multiplyScalar(e);g.addSelf(h);h.copy(c);h.multiplyScalar(f);g.addSelf(h);return g},randomPointInFace:function(b,a,c){var d,e,f;if(b instanceof THREE.Face3)return d=
 c;b++){for(var d=f[b],e=[],g=0,h=d.length;g<h;g++)e.push(new THREE.UV(d[g].u,d[g].v));a.faceVertexUvs[0].push(e)}return a},randomPointInTriangle:function(b,a,c){var d,e,f,g=new THREE.Vector3,h=THREE.GeometryUtils.__v1;d=THREE.GeometryUtils.random();e=THREE.GeometryUtils.random();1<d+e&&(d=1-d,e=1-e);f=1-d-e;g.copy(b);g.multiplyScalar(d);h.copy(a);h.multiplyScalar(e);g.addSelf(h);h.copy(c);h.multiplyScalar(f);g.addSelf(h);return g},randomPointInFace:function(b,a,c){var d,e,f;if(b instanceof THREE.Face3)return d=
 a.vertices[b.a],e=a.vertices[b.b],f=a.vertices[b.c],THREE.GeometryUtils.randomPointInTriangle(d,e,f);if(b instanceof THREE.Face4){d=a.vertices[b.a];e=a.vertices[b.b];f=a.vertices[b.c];var a=a.vertices[b.d],g;c?b._area1&&b._area2?(c=b._area1,g=b._area2):(c=THREE.GeometryUtils.triangleArea(d,e,a),g=THREE.GeometryUtils.triangleArea(e,f,a),b._area1=c,b._area2=g):(c=THREE.GeometryUtils.triangleArea(d,e,a),g=THREE.GeometryUtils.triangleArea(e,f,a));return THREE.GeometryUtils.random()*(c+g)<c?THREE.GeometryUtils.randomPointInTriangle(d,
 a.vertices[b.a],e=a.vertices[b.b],f=a.vertices[b.c],THREE.GeometryUtils.randomPointInTriangle(d,e,f);if(b instanceof THREE.Face4){d=a.vertices[b.a];e=a.vertices[b.b];f=a.vertices[b.c];var a=a.vertices[b.d],g;c?b._area1&&b._area2?(c=b._area1,g=b._area2):(c=THREE.GeometryUtils.triangleArea(d,e,a),g=THREE.GeometryUtils.triangleArea(e,f,a),b._area1=c,b._area2=g):(c=THREE.GeometryUtils.triangleArea(d,e,a),g=THREE.GeometryUtils.triangleArea(e,f,a));return THREE.GeometryUtils.random()*(c+g)<c?THREE.GeometryUtils.randomPointInTriangle(d,
 e,a):THREE.GeometryUtils.randomPointInTriangle(e,f,a)}},randomPointsInGeometry:function(b,a){function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2);return j[e]>a?b(c,e-1):j[e]<a?b(e+1,d):e}return b(0,j.length-1)}var d,e,f=b.faces,g=b.vertices,h=f.length,i=0,j=[],l,n,k,m;for(e=0;e<h;e++)d=f[e],d instanceof THREE.Face3?(l=g[d.a],n=g[d.b],k=g[d.c],d._area=THREE.GeometryUtils.triangleArea(l,n,k)):d instanceof THREE.Face4&&(l=g[d.a],n=g[d.b],k=g[d.c],m=g[d.d],d._area1=THREE.GeometryUtils.triangleArea(l,
 e,a):THREE.GeometryUtils.randomPointInTriangle(e,f,a)}},randomPointsInGeometry:function(b,a){function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2);return j[e]>a?b(c,e-1):j[e]<a?b(e+1,d):e}return b(0,j.length-1)}var d,e,f=b.faces,g=b.vertices,h=f.length,i=0,j=[],l,n,k,m;for(e=0;e<h;e++)d=f[e],d instanceof THREE.Face3?(l=g[d.a],n=g[d.b],k=g[d.c],d._area=THREE.GeometryUtils.triangleArea(l,n,k)):d instanceof THREE.Face4&&(l=g[d.a],n=g[d.b],k=g[d.c],m=g[d.d],d._area1=THREE.GeometryUtils.triangleArea(l,
@@ -12,19 +12,19 @@ a.max);c.multiplyScalar(-0.5);b.applyMatrix((new THREE.Matrix4).makeTranslation(
 b.faces[a],d instanceof THREE.Face4){e=d.a;var i=d.b,j=d.c,l=d.d,n=new THREE.Face3,k=new THREE.Face3;n.color.copy(d.color);k.color.copy(d.color);n.materialIndex=d.materialIndex;k.materialIndex=d.materialIndex;n.a=e;n.b=i;n.c=l;k.a=i;k.b=j;k.c=l;4===d.vertexColors.length&&(n.vertexColors[0]=d.vertexColors[0].clone(),n.vertexColors[1]=d.vertexColors[1].clone(),n.vertexColors[2]=d.vertexColors[3].clone(),k.vertexColors[0]=d.vertexColors[1].clone(),k.vertexColors[1]=d.vertexColors[2].clone(),k.vertexColors[2]=
 b.faces[a],d instanceof THREE.Face4){e=d.a;var i=d.b,j=d.c,l=d.d,n=new THREE.Face3,k=new THREE.Face3;n.color.copy(d.color);k.color.copy(d.color);n.materialIndex=d.materialIndex;k.materialIndex=d.materialIndex;n.a=e;n.b=i;n.c=l;k.a=i;k.b=j;k.c=l;4===d.vertexColors.length&&(n.vertexColors[0]=d.vertexColors[0].clone(),n.vertexColors[1]=d.vertexColors[1].clone(),n.vertexColors[2]=d.vertexColors[3].clone(),k.vertexColors[0]=d.vertexColors[1].clone(),k.vertexColors[1]=d.vertexColors[2].clone(),k.vertexColors[2]=
 d.vertexColors[3].clone());f.push(n,k);d=0;for(e=b.faceVertexUvs.length;d<e;d++)b.faceVertexUvs[d].length&&(n=b.faceVertexUvs[d][a],i=n[1],j=n[2],l=n[3],n=[n[0].clone(),i.clone(),l.clone()],i=[i.clone(),j.clone(),l.clone()],h[d].push(n,i));d=0;for(e=b.faceUvs.length;d<e;d++)b.faceUvs[d].length&&(i=b.faceUvs[d][a],g[d].push(i,i))}else{f.push(d);d=0;for(e=b.faceUvs.length;d<e;d++)g[d].push(b.faceUvs[d]);d=0;for(e=b.faceVertexUvs.length;d<e;d++)h[d].push(b.faceVertexUvs[d])}b.faces=f;b.faceUvs=g;b.faceVertexUvs=
 d.vertexColors[3].clone());f.push(n,k);d=0;for(e=b.faceVertexUvs.length;d<e;d++)b.faceVertexUvs[d].length&&(n=b.faceVertexUvs[d][a],i=n[1],j=n[2],l=n[3],n=[n[0].clone(),i.clone(),l.clone()],i=[i.clone(),j.clone(),l.clone()],h[d].push(n,i));d=0;for(e=b.faceUvs.length;d<e;d++)b.faceUvs[d].length&&(i=b.faceUvs[d][a],g[d].push(i,i))}else{f.push(d);d=0;for(e=b.faceUvs.length;d<e;d++)g[d].push(b.faceUvs[d]);d=0;for(e=b.faceVertexUvs.length;d<e;d++)h[d].push(b.faceVertexUvs[d])}b.faces=f;b.faceUvs=g;b.faceVertexUvs=
 h;b.computeCentroids();b.computeFaceNormals();b.computeVertexNormals();b.hasTangents&&b.computeTangents()},explode:function(b){for(var a=[],c=0,d=b.faces.length;c<d;c++){var e=a.length,f=b.faces[c];if(f instanceof THREE.Face4){var g=f.a,h=f.b,i=f.c,g=b.vertices[g],h=b.vertices[h],i=b.vertices[i],j=b.vertices[f.d];a.push(g.clone());a.push(h.clone());a.push(i.clone());a.push(j.clone());f.a=e;f.b=e+1;f.c=e+2;f.d=e+3}else g=f.a,h=f.b,i=f.c,g=b.vertices[g],h=b.vertices[h],i=b.vertices[i],a.push(g.clone()),
 h;b.computeCentroids();b.computeFaceNormals();b.computeVertexNormals();b.hasTangents&&b.computeTangents()},explode:function(b){for(var a=[],c=0,d=b.faces.length;c<d;c++){var e=a.length,f=b.faces[c];if(f instanceof THREE.Face4){var g=f.a,h=f.b,i=f.c,g=b.vertices[g],h=b.vertices[h],i=b.vertices[i],j=b.vertices[f.d];a.push(g.clone());a.push(h.clone());a.push(i.clone());a.push(j.clone());f.a=e;f.b=e+1;f.c=e+2;f.d=e+3}else g=f.a,h=f.b,i=f.c,g=b.vertices[g],h=b.vertices[h],i=b.vertices[i],a.push(g.clone()),
-a.push(h.clone()),a.push(i.clone()),f.a=e,f.b=e+1,f.c=e+2}b.vertices=a;delete b.__tmpVertices},tessellate:function(b,a){var c,d,e,f,g,h,i,j,l,n,k,m,p,q,r,t,s,v,o,x=[],z=[];c=0;for(d=b.faceVertexUvs.length;c<d;c++)z[c]=[];c=0;for(d=b.faces.length;c<d;c++)if(e=b.faces[c],e instanceof THREE.Face3)if(f=e.a,g=e.b,h=e.c,j=b.vertices[f],l=b.vertices[g],n=b.vertices[h],m=j.distanceTo(l),p=l.distanceTo(n),k=j.distanceTo(n),m>a||p>a||k>a){i=b.vertices.length;v=e.clone();o=e.clone();m>=p&&m>=k?(j=j.clone(),
-j.lerpSelf(l,0.5),v.a=f,v.b=i,v.c=h,o.a=i,o.b=g,o.c=h,3===e.vertexNormals.length&&(f=e.vertexNormals[0].clone(),f.lerpSelf(e.vertexNormals[1],0.5),v.vertexNormals[1].copy(f),o.vertexNormals[0].copy(f)),3===e.vertexColors.length&&(f=e.vertexColors[0].clone(),f.lerpSelf(e.vertexColors[1],0.5),v.vertexColors[1].copy(f),o.vertexColors[0].copy(f)),e=0):p>=m&&p>=k?(j=l.clone(),j.lerpSelf(n,0.5),v.a=f,v.b=g,v.c=i,o.a=i,o.b=h,o.c=f,3===e.vertexNormals.length&&(f=e.vertexNormals[1].clone(),f.lerpSelf(e.vertexNormals[2],
-0.5),v.vertexNormals[2].copy(f),o.vertexNormals[0].copy(f),o.vertexNormals[1].copy(e.vertexNormals[2]),o.vertexNormals[2].copy(e.vertexNormals[0])),3===e.vertexColors.length&&(f=e.vertexColors[1].clone(),f.lerpSelf(e.vertexColors[2],0.5),v.vertexColors[2].copy(f),o.vertexColors[0].copy(f),o.vertexColors[1].copy(e.vertexColors[2]),o.vertexColors[2].copy(e.vertexColors[0])),e=1):(j=j.clone(),j.lerpSelf(n,0.5),v.a=f,v.b=g,v.c=i,o.a=i,o.b=g,o.c=h,3===e.vertexNormals.length&&(f=e.vertexNormals[0].clone(),
-f.lerpSelf(e.vertexNormals[2],0.5),v.vertexNormals[2].copy(f),o.vertexNormals[0].copy(f)),3===e.vertexColors.length&&(f=e.vertexColors[0].clone(),f.lerpSelf(e.vertexColors[2],0.5),v.vertexColors[2].copy(f),o.vertexColors[0].copy(f)),e=2);x.push(v,o);b.vertices.push(j);f=0;for(g=b.faceVertexUvs.length;f<g;f++)b.faceVertexUvs[f].length&&(j=b.faceVertexUvs[f][c],o=j[0],h=j[1],v=j[2],0===e?(l=o.clone(),l.lerpSelf(h,0.5),j=[o.clone(),l.clone(),v.clone()],h=[l.clone(),h.clone(),v.clone()]):1===e?(l=h.clone(),
-l.lerpSelf(v,0.5),j=[o.clone(),h.clone(),l.clone()],h=[l.clone(),v.clone(),o.clone()]):(l=o.clone(),l.lerpSelf(v,0.5),j=[o.clone(),h.clone(),l.clone()],h=[l.clone(),h.clone(),v.clone()]),z[f].push(j,h))}else{x.push(e);f=0;for(g=b.faceVertexUvs.length;f<g;f++)z[f].push(b.faceVertexUvs[f][c])}else if(f=e.a,g=e.b,h=e.c,i=e.d,j=b.vertices[f],l=b.vertices[g],n=b.vertices[h],k=b.vertices[i],m=j.distanceTo(l),p=l.distanceTo(n),q=n.distanceTo(k),r=j.distanceTo(k),m>a||p>a||q>a||r>a){t=b.vertices.length;s=
-b.vertices.length+1;v=e.clone();o=e.clone();m>=p&&m>=q&&m>=r||q>=p&&q>=m&&q>=r?(m=j.clone(),m.lerpSelf(l,0.5),l=n.clone(),l.lerpSelf(k,0.5),v.a=f,v.b=t,v.c=s,v.d=i,o.a=t,o.b=g,o.c=h,o.d=s,4===e.vertexNormals.length&&(f=e.vertexNormals[0].clone(),f.lerpSelf(e.vertexNormals[1],0.5),g=e.vertexNormals[2].clone(),g.lerpSelf(e.vertexNormals[3],0.5),v.vertexNormals[1].copy(f),v.vertexNormals[2].copy(g),o.vertexNormals[0].copy(f),o.vertexNormals[3].copy(g)),4===e.vertexColors.length&&(f=e.vertexColors[0].clone(),
-f.lerpSelf(e.vertexColors[1],0.5),g=e.vertexColors[2].clone(),g.lerpSelf(e.vertexColors[3],0.5),v.vertexColors[1].copy(f),v.vertexColors[2].copy(g),o.vertexColors[0].copy(f),o.vertexColors[3].copy(g)),e=0):(m=l.clone(),m.lerpSelf(n,0.5),l=k.clone(),l.lerpSelf(j,0.5),v.a=f,v.b=g,v.c=t,v.d=s,o.a=s,o.b=t,o.c=h,o.d=i,4===e.vertexNormals.length&&(f=e.vertexNormals[1].clone(),f.lerpSelf(e.vertexNormals[2],0.5),g=e.vertexNormals[3].clone(),g.lerpSelf(e.vertexNormals[0],0.5),v.vertexNormals[2].copy(f),v.vertexNormals[3].copy(g),
-o.vertexNormals[0].copy(g),o.vertexNormals[1].copy(f)),4===e.vertexColors.length&&(f=e.vertexColors[1].clone(),f.lerpSelf(e.vertexColors[2],0.5),g=e.vertexColors[3].clone(),g.lerpSelf(e.vertexColors[0],0.5),v.vertexColors[2].copy(f),v.vertexColors[3].copy(g),o.vertexColors[0].copy(g),o.vertexColors[1].copy(f)),e=1);x.push(v,o);b.vertices.push(m,l);f=0;for(g=b.faceVertexUvs.length;f<g;f++)b.faceVertexUvs[f].length&&(j=b.faceVertexUvs[f][c],o=j[0],h=j[1],v=j[2],j=j[3],0===e?(l=o.clone(),l.lerpSelf(h,
-0.5),n=v.clone(),n.lerpSelf(j,0.5),o=[o.clone(),l.clone(),n.clone(),j.clone()],h=[l.clone(),h.clone(),v.clone(),n.clone()]):(l=h.clone(),l.lerpSelf(v,0.5),n=j.clone(),n.lerpSelf(o,0.5),o=[o.clone(),h.clone(),l.clone(),n.clone()],h=[n.clone(),l.clone(),v.clone(),j.clone()]),z[f].push(o,h))}else{x.push(e);f=0;for(g=b.faceVertexUvs.length;f<g;f++)z[f].push(b.faceVertexUvs[f][c])}b.faces=x;b.faceVertexUvs=z}};THREE.GeometryUtils.random=THREE.Math.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;
-THREE.ImageUtils={crossOrigin:"anonymous",loadTexture:function(b,a,c){var d=new Image,e=new THREE.Texture(d,a);d.onload=function(){e.needsUpdate=!0;c&&c(this)};d.crossOrigin=this.crossOrigin;d.src=b;return e},loadTextureCube:function(b,a,c){var d,e=[],f=new THREE.Texture(e,a),a=e.loadCount=0;for(d=b.length;a<d;++a)e[a]=new Image,e[a].onload=function(){e.loadCount+=1;6===e.loadCount&&(f.needsUpdate=!0);c&&c(this)},e[a].crossOrigin=this.crossOrigin,e[a].src=b[a];return f},getNormalMap:function(b,a){var c=
-function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]},a=a|1,d=b.width,e=b.height,f=document.createElement("canvas");f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(b,0,0);for(var h=g.getImageData(0,0,d,e).data,i=g.createImageData(d,e),j=i.data,l=0;l<d;l++)for(var n=0;n<e;n++){var k=0>n-1?0:n-1,m=n+1>e-1?e-1:n+1,p=0>l-1?0:l-1,q=l+1>d-1?d-1:l+1,r=[],t=[0,0,h[4*(n*d+l)]/255*a];r.push([-1,0,h[4*(n*d+p)]/255*a]);r.push([-1,-1,h[4*(k*d+p)]/255*a]);r.push([0,
--1,h[4*(k*d+l)]/255*a]);r.push([1,-1,h[4*(k*d+q)]/255*a]);r.push([1,0,h[4*(n*d+q)]/255*a]);r.push([1,1,h[4*(m*d+q)]/255*a]);r.push([0,1,h[4*(m*d+l)]/255*a]);r.push([-1,1,h[4*(m*d+p)]/255*a]);k=[];p=r.length;for(m=0;m<p;m++){var q=r[m],s=r[(m+1)%p],q=[q[0]-t[0],q[1]-t[1],q[2]-t[2]],s=[s[0]-t[0],s[1]-t[1],s[2]-t[2]];k.push(c([q[1]*s[2]-q[2]*s[1],q[2]*s[0]-q[0]*s[2],q[0]*s[1]-q[1]*s[0]]))}r=[0,0,0];for(m=0;m<k.length;m++)r[0]+=k[m][0],r[1]+=k[m][1],r[2]+=k[m][2];r[0]/=k.length;r[1]/=k.length;r[2]/=k.length;
-t=4*(n*d+l);j[t]=255*((r[0]+1)/2)|0;j[t+1]=255*((r[1]+1)/2)|0;j[t+2]=255*r[2]|0;j[t+3]=255}g.putImageData(i,0,0);return f},generateDataTexture:function(b,a,c){for(var d=b*a,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g),c=Math.floor(255*c.b),h=0;h<d;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;b=new THREE.DataTexture(e,b,a,THREE.RGBFormat);b.needsUpdate=!0;return b}};
+a.push(h.clone()),a.push(i.clone()),f.a=e,f.b=e+1,f.c=e+2}b.vertices=a;delete b.__tmpVertices},tessellate:function(b,a){var c,d,e,f,g,h,i,j,l,n,k,m,p,q,r,s,t,w,o,x=[],z=[];c=0;for(d=b.faceVertexUvs.length;c<d;c++)z[c]=[];c=0;for(d=b.faces.length;c<d;c++)if(e=b.faces[c],e instanceof THREE.Face3)if(f=e.a,g=e.b,h=e.c,j=b.vertices[f],l=b.vertices[g],n=b.vertices[h],m=j.distanceTo(l),p=l.distanceTo(n),k=j.distanceTo(n),m>a||p>a||k>a){i=b.vertices.length;w=e.clone();o=e.clone();m>=p&&m>=k?(j=j.clone(),
+j.lerpSelf(l,0.5),w.a=f,w.b=i,w.c=h,o.a=i,o.b=g,o.c=h,3===e.vertexNormals.length&&(f=e.vertexNormals[0].clone(),f.lerpSelf(e.vertexNormals[1],0.5),w.vertexNormals[1].copy(f),o.vertexNormals[0].copy(f)),3===e.vertexColors.length&&(f=e.vertexColors[0].clone(),f.lerpSelf(e.vertexColors[1],0.5),w.vertexColors[1].copy(f),o.vertexColors[0].copy(f)),e=0):p>=m&&p>=k?(j=l.clone(),j.lerpSelf(n,0.5),w.a=f,w.b=g,w.c=i,o.a=i,o.b=h,o.c=f,3===e.vertexNormals.length&&(f=e.vertexNormals[1].clone(),f.lerpSelf(e.vertexNormals[2],
+0.5),w.vertexNormals[2].copy(f),o.vertexNormals[0].copy(f),o.vertexNormals[1].copy(e.vertexNormals[2]),o.vertexNormals[2].copy(e.vertexNormals[0])),3===e.vertexColors.length&&(f=e.vertexColors[1].clone(),f.lerpSelf(e.vertexColors[2],0.5),w.vertexColors[2].copy(f),o.vertexColors[0].copy(f),o.vertexColors[1].copy(e.vertexColors[2]),o.vertexColors[2].copy(e.vertexColors[0])),e=1):(j=j.clone(),j.lerpSelf(n,0.5),w.a=f,w.b=g,w.c=i,o.a=i,o.b=g,o.c=h,3===e.vertexNormals.length&&(f=e.vertexNormals[0].clone(),
+f.lerpSelf(e.vertexNormals[2],0.5),w.vertexNormals[2].copy(f),o.vertexNormals[0].copy(f)),3===e.vertexColors.length&&(f=e.vertexColors[0].clone(),f.lerpSelf(e.vertexColors[2],0.5),w.vertexColors[2].copy(f),o.vertexColors[0].copy(f)),e=2);x.push(w,o);b.vertices.push(j);f=0;for(g=b.faceVertexUvs.length;f<g;f++)b.faceVertexUvs[f].length&&(j=b.faceVertexUvs[f][c],o=j[0],h=j[1],w=j[2],0===e?(l=o.clone(),l.lerpSelf(h,0.5),j=[o.clone(),l.clone(),w.clone()],h=[l.clone(),h.clone(),w.clone()]):1===e?(l=h.clone(),
+l.lerpSelf(w,0.5),j=[o.clone(),h.clone(),l.clone()],h=[l.clone(),w.clone(),o.clone()]):(l=o.clone(),l.lerpSelf(w,0.5),j=[o.clone(),h.clone(),l.clone()],h=[l.clone(),h.clone(),w.clone()]),z[f].push(j,h))}else{x.push(e);f=0;for(g=b.faceVertexUvs.length;f<g;f++)z[f].push(b.faceVertexUvs[f][c])}else if(f=e.a,g=e.b,h=e.c,i=e.d,j=b.vertices[f],l=b.vertices[g],n=b.vertices[h],k=b.vertices[i],m=j.distanceTo(l),p=l.distanceTo(n),q=n.distanceTo(k),r=j.distanceTo(k),m>a||p>a||q>a||r>a){s=b.vertices.length;t=
+b.vertices.length+1;w=e.clone();o=e.clone();m>=p&&m>=q&&m>=r||q>=p&&q>=m&&q>=r?(m=j.clone(),m.lerpSelf(l,0.5),l=n.clone(),l.lerpSelf(k,0.5),w.a=f,w.b=s,w.c=t,w.d=i,o.a=s,o.b=g,o.c=h,o.d=t,4===e.vertexNormals.length&&(f=e.vertexNormals[0].clone(),f.lerpSelf(e.vertexNormals[1],0.5),g=e.vertexNormals[2].clone(),g.lerpSelf(e.vertexNormals[3],0.5),w.vertexNormals[1].copy(f),w.vertexNormals[2].copy(g),o.vertexNormals[0].copy(f),o.vertexNormals[3].copy(g)),4===e.vertexColors.length&&(f=e.vertexColors[0].clone(),
+f.lerpSelf(e.vertexColors[1],0.5),g=e.vertexColors[2].clone(),g.lerpSelf(e.vertexColors[3],0.5),w.vertexColors[1].copy(f),w.vertexColors[2].copy(g),o.vertexColors[0].copy(f),o.vertexColors[3].copy(g)),e=0):(m=l.clone(),m.lerpSelf(n,0.5),l=k.clone(),l.lerpSelf(j,0.5),w.a=f,w.b=g,w.c=s,w.d=t,o.a=t,o.b=s,o.c=h,o.d=i,4===e.vertexNormals.length&&(f=e.vertexNormals[1].clone(),f.lerpSelf(e.vertexNormals[2],0.5),g=e.vertexNormals[3].clone(),g.lerpSelf(e.vertexNormals[0],0.5),w.vertexNormals[2].copy(f),w.vertexNormals[3].copy(g),
+o.vertexNormals[0].copy(g),o.vertexNormals[1].copy(f)),4===e.vertexColors.length&&(f=e.vertexColors[1].clone(),f.lerpSelf(e.vertexColors[2],0.5),g=e.vertexColors[3].clone(),g.lerpSelf(e.vertexColors[0],0.5),w.vertexColors[2].copy(f),w.vertexColors[3].copy(g),o.vertexColors[0].copy(g),o.vertexColors[1].copy(f)),e=1);x.push(w,o);b.vertices.push(m,l);f=0;for(g=b.faceVertexUvs.length;f<g;f++)b.faceVertexUvs[f].length&&(j=b.faceVertexUvs[f][c],o=j[0],h=j[1],w=j[2],j=j[3],0===e?(l=o.clone(),l.lerpSelf(h,
+0.5),n=w.clone(),n.lerpSelf(j,0.5),o=[o.clone(),l.clone(),n.clone(),j.clone()],h=[l.clone(),h.clone(),w.clone(),n.clone()]):(l=h.clone(),l.lerpSelf(w,0.5),n=j.clone(),n.lerpSelf(o,0.5),o=[o.clone(),h.clone(),l.clone(),n.clone()],h=[n.clone(),l.clone(),w.clone(),j.clone()]),z[f].push(o,h))}else{x.push(e);f=0;for(g=b.faceVertexUvs.length;f<g;f++)z[f].push(b.faceVertexUvs[f][c])}b.faces=x;b.faceVertexUvs=z}};THREE.GeometryUtils.random=THREE.Math.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;
+THREE.ImageUtils={crossOrigin:"anonymous",loadTexture:function(b,a,c){var d=new THREE.Texture(void 0,a),a=new THREE.ImageLoader;a.crossOrigin=this.crossOrigin;a.addEventListener("complete",function(a){d.image=a.image;d.needsUpdate=!0;c&&c(this)});a.load(b);return d},loadTextureCube:function(b,a,c){var d,e=[],f=new THREE.Texture(e,a),a=e.loadCount=0;for(d=b.length;a<d;++a)e[a]=new Image,e[a].onload=function(){e.loadCount+=1;6===e.loadCount&&(f.needsUpdate=!0);c&&c(this)},e[a].crossOrigin=this.crossOrigin,
+e[a].src=b[a];return f},getNormalMap:function(b,a){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]},a=a|1,d=b.width,e=b.height,f=document.createElement("canvas");f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(b,0,0);for(var h=g.getImageData(0,0,d,e).data,i=g.createImageData(d,e),j=i.data,l=0;l<d;l++)for(var n=0;n<e;n++){var k=0>n-1?0:n-1,m=n+1>e-1?e-1:n+1,p=0>l-1?0:l-1,q=l+1>d-1?d-1:l+1,r=[],s=[0,0,h[4*(n*d+l)]/255*a];r.push([-1,0,h[4*(n*d+
+p)]/255*a]);r.push([-1,-1,h[4*(k*d+p)]/255*a]);r.push([0,-1,h[4*(k*d+l)]/255*a]);r.push([1,-1,h[4*(k*d+q)]/255*a]);r.push([1,0,h[4*(n*d+q)]/255*a]);r.push([1,1,h[4*(m*d+q)]/255*a]);r.push([0,1,h[4*(m*d+l)]/255*a]);r.push([-1,1,h[4*(m*d+p)]/255*a]);k=[];p=r.length;for(m=0;m<p;m++){var q=r[m],t=r[(m+1)%p],q=[q[0]-s[0],q[1]-s[1],q[2]-s[2]],t=[t[0]-s[0],t[1]-s[1],t[2]-s[2]];k.push(c([q[1]*t[2]-q[2]*t[1],q[2]*t[0]-q[0]*t[2],q[0]*t[1]-q[1]*t[0]]))}r=[0,0,0];for(m=0;m<k.length;m++)r[0]+=k[m][0],r[1]+=k[m][1],
+r[2]+=k[m][2];r[0]/=k.length;r[1]/=k.length;r[2]/=k.length;s=4*(n*d+l);j[s]=255*((r[0]+1)/2)|0;j[s+1]=255*((r[1]+1)/2)|0;j[s+2]=255*r[2]|0;j[s+3]=255}g.putImageData(i,0,0);return f},generateDataTexture:function(b,a,c){for(var d=b*a,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g),c=Math.floor(255*c.b),h=0;h<d;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;b=new THREE.DataTexture(e,b,a,THREE.RGBFormat);b.needsUpdate=!0;return b}};
 THREE.SceneUtils={showHierarchy:function(b,a){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=a})},traverseHierarchy:function(b,a){var c,d,e=b.children.length;for(d=0;d<e;d++)c=b.children[d],a(c),THREE.SceneUtils.traverseHierarchy(c,a)},createMultiMaterialObject:function(b,a){var c,d=a.length,e=new THREE.Object3D;for(c=0;c<d;c++){var f=new THREE.Mesh(b,a[c]);e.add(f)}return e},cloneObject:function(b){var a;b instanceof THREE.MorphAnimMesh?(a=new THREE.MorphAnimMesh(b.geometry,b.material),
 THREE.SceneUtils={showHierarchy:function(b,a){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=a})},traverseHierarchy:function(b,a){var c,d,e=b.children.length;for(d=0;d<e;d++)c=b.children[d],a(c),THREE.SceneUtils.traverseHierarchy(c,a)},createMultiMaterialObject:function(b,a){var c,d=a.length,e=new THREE.Object3D;for(c=0;c<d;c++){var f=new THREE.Mesh(b,a[c]);e.add(f)}return e},cloneObject:function(b){var a;b instanceof THREE.MorphAnimMesh?(a=new THREE.MorphAnimMesh(b.geometry,b.material),
 a.duration=b.duration,a.mirroredLoop=b.mirroredLoop,a.time=b.time,a.lastKeyframe=b.lastKeyframe,a.currentKeyframe=b.currentKeyframe,a.direction=b.direction,a.directionBackwards=b.directionBackwards):b instanceof THREE.SkinnedMesh?a=new THREE.SkinnedMesh(b.geometry,b.material):b instanceof THREE.Mesh?a=new THREE.Mesh(b.geometry,b.material):b instanceof THREE.Line?a=new THREE.Line(b.geometry,b.material,b.type):b instanceof THREE.Ribbon?a=new THREE.Ribbon(b.geometry,b.material):b instanceof THREE.ParticleSystem?
 a.duration=b.duration,a.mirroredLoop=b.mirroredLoop,a.time=b.time,a.lastKeyframe=b.lastKeyframe,a.currentKeyframe=b.currentKeyframe,a.direction=b.direction,a.directionBackwards=b.directionBackwards):b instanceof THREE.SkinnedMesh?a=new THREE.SkinnedMesh(b.geometry,b.material):b instanceof THREE.Mesh?a=new THREE.Mesh(b.geometry,b.material):b instanceof THREE.Line?a=new THREE.Line(b.geometry,b.material,b.type):b instanceof THREE.Ribbon?a=new THREE.Ribbon(b.geometry,b.material):b instanceof THREE.ParticleSystem?
 (a=new THREE.ParticleSystem(b.geometry,b.material),a.sortParticles=b.sortParticles):b instanceof THREE.Particle?a=new THREE.Particle(b.material):b instanceof THREE.Sprite?(a=new THREE.Sprite({}),a.color.copy(b.color),a.map=b.map,a.blending=b.blending,a.useScreenCoordinates=b.useScreenCoordinates,a.mergeWith3D=b.mergeWith3D,a.affectedByDistance=b.affectedByDistance,a.scaleByViewport=b.scaleByViewport,a.alignment=b.alignment,a.rotation3d.copy(b.rotation3d),a.rotation=b.rotation,a.opacity=b.opacity,
 (a=new THREE.ParticleSystem(b.geometry,b.material),a.sortParticles=b.sortParticles):b instanceof THREE.Particle?a=new THREE.Particle(b.material):b instanceof THREE.Sprite?(a=new THREE.Sprite({}),a.color.copy(b.color),a.map=b.map,a.blending=b.blending,a.useScreenCoordinates=b.useScreenCoordinates,a.mergeWith3D=b.mergeWith3D,a.affectedByDistance=b.affectedByDistance,a.scaleByViewport=b.scaleByViewport,a.alignment=b.alignment,a.rotation3d.copy(b.rotation3d),a.rotation=b.rotation,a.opacity=b.opacity,
@@ -40,6 +40,13 @@ THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"v
 THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;\nuniform vec2 uOffset;\nuniform vec2 uRepeat;\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;",
 THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;\nuniform vec2 uOffset;\nuniform vec2 uRepeat;\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;",
 THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvViewPosition = -mvPosition.xyz;\nvNormal = normalMatrix * normal;\nvTangent = normalMatrix * tangent.xyz;\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvUv = uv * uRepeat + uOffset;\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( normalize( vNormal.xyz ) * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif",
 THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvViewPosition = -mvPosition.xyz;\nvNormal = normalMatrix * normal;\nvTangent = normalMatrix * tangent.xyz;\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvUv = uv * uRepeat + uOffset;\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( normalize( vNormal.xyz ) * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif",
 THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:1,texture:null},tFlip:{type:"f",value:-1}},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;\nuniform float tFlip;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( tFlip * wPos.x, wPos.yz ) );\n}"}}});
 THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:1,texture:null},tFlip:{type:"f",value:-1}},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;\nuniform float tFlip;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( tFlip * wPos.x, wPos.yz ) );\n}"}}});
+THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(b){var a=b.familyName.toLowerCase();this.faces[a]=this.faces[a]||{};this.faces[a][b.cssFontWeight]=this.faces[a][b.cssFontWeight]||{};this.faces[a][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[a][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var a=this.getFace(),c=this.size/a.resolution,d=
+0,e=(""+b).split(""),f=e.length,g=[],b=0;b<f;b++){var h=new THREE.Path,h=this.extractGlyphPoints(e[b],a,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(b,a,c,d,e){var f=[],g,h,i,j,l,n,k,m,p,q,r,s=a.glyphs[b]||a.glyphs["?"];if(s){if(s.o){a=s._cachedOutline||(s._cachedOutline=s.o.split(" "));j=a.length;for(b=0;b<j;){i=a[b++];switch(i){case "m":i=a[b++]*c+d;l=a[b++]*c;e.moveTo(i,l);break;case "l":i=a[b++]*c+d;l=a[b++]*c;e.lineTo(i,l);break;case "q":i=a[b++]*
+c+d;l=a[b++]*c;m=a[b++]*c+d;p=a[b++]*c;e.quadraticCurveTo(m,p,i,l);if(g=f[f.length-1]){n=g.x;k=g.y;g=1;for(h=this.divisions;g<=h;g++){var t=g/h;THREE.Shape.Utils.b2(t,n,m,i);THREE.Shape.Utils.b2(t,k,p,l)}}break;case "b":i=a[b++]*c+d;l=a[b++]*c;m=a[b++]*c+d;p=a[b++]*-c;q=a[b++]*c+d;r=a[b++]*-c;e.bezierCurveTo(i,l,m,p,q,r);if(g=f[f.length-1]){n=g.x;k=g.y;g=1;for(h=this.divisions;g<=h;g++){t=g/h;THREE.Shape.Utils.b3(t,n,m,q,i);THREE.Shape.Utils.b3(t,k,p,r,l)}}}}}return{offset:s.ha*c,path:e}}}};
+THREE.FontUtils.generateShapes=function(b,a){var a=a||{},c=a.curveSegments!==void 0?a.curveSegments:4,d=a.font!==void 0?a.font:"helvetiker",e=a.weight!==void 0?a.weight:"normal",f=a.style!==void 0?a.style:"normal";THREE.FontUtils.size=a.size!==void 0?a.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(b).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
+(function(b){var a=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e=e+(a[f].x*a[g].y-a[g].x*a[f].y);return e*0.5};b.Triangulate=function(b,d){var e=b.length;if(e<3)return null;var f=[],g=[],h=[],i,j,l;if(a(b)>0)for(j=0;j<e;j++)g[j]=j;else for(j=0;j<e;j++)g[j]=e-1-j;var n=2*e;for(j=e-1;e>2;){if(n--<=0){console.log("Warning, unable to triangulate polygon!");break}i=j;e<=i&&(i=0);j=i+1;e<=j&&(j=0);l=j+1;e<=l&&(l=0);var k;a:{k=b;var m=i,p=j,q=l,r=e,s=g,t=void 0,w=void 0,o=void 0,x=void 0,z=void 0,
+A=void 0,v=void 0,u=void 0,C=void 0,w=k[s[m]].x,o=k[s[m]].y,x=k[s[p]].x,z=k[s[p]].y,A=k[s[q]].x,v=k[s[q]].y;if(1.0E-10>(x-w)*(v-o)-(z-o)*(A-w))k=false;else{for(t=0;t<r;t++)if(!(t==m||t==p||t==q)){var u=k[s[t]].x,C=k[s[t]].y,B=void 0,E=void 0,G=void 0,L=void 0,H=void 0,D=void 0,K=void 0,F=void 0,N=void 0,I=void 0,M=void 0,J=void 0,B=G=H=void 0,B=A-x,E=v-z,G=w-A,L=o-v,H=x-w,D=z-o,K=u-w,F=C-o,N=u-x,I=C-z,M=u-A,J=C-v,B=B*I-E*N,H=H*F-D*K,G=G*J-L*M;if(B>=0&&G>=0&&H>=0){k=false;break a}}k=true}}if(k){f.push([b[g[i]],
+b[g[j]],b[g[l]]]);h.push([g[i],g[j],g[l]]);i=j;for(l=j+1;l<e;i++,l++)g[i]=g[l];e--;n=2*e}}return d?h:f};b.Triangulate.area=a;return b})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 THREE.BufferGeometry=function(){this.id=THREE.GeometryCount++;this.vertexColorArray=this.vertexUvArray=this.vertexNormalArray=this.vertexPositionArray=this.vertexIndexArray=this.vertexColorBuffer=this.vertexUvBuffer=this.vertexNormalBuffer=this.vertexPositionBuffer=this.vertexIndexBuffer=null;this.dynamic=false;this.boundingSphere=this.boundingBox=null;this.morphTargets=[]};THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,computeBoundingBox:function(){},computeBoundingSphere:function(){}};
 THREE.BufferGeometry=function(){this.id=THREE.GeometryCount++;this.vertexColorArray=this.vertexUvArray=this.vertexNormalArray=this.vertexPositionArray=this.vertexIndexArray=this.vertexColorBuffer=this.vertexUvBuffer=this.vertexNormalBuffer=this.vertexPositionBuffer=this.vertexIndexBuffer=null;this.dynamic=false;this.boundingSphere=this.boundingBox=null;this.morphTargets=[]};THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,computeBoundingBox:function(){},computeBoundingSphere:function(){}};
 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 a,c=[];for(a=0;a<=b;a++)c.push(this.getPoint(a/b));return c};THREE.Curve.prototype.getSpacedPoints=function(b){b||(b=5);var a,c=[];for(a=0;a<=b;a++)c.push(this.getPointAt(a/b));return c};
 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 a,c=[];for(a=0;a<=b;a++)c.push(this.getPoint(a/b));return c};THREE.Curve.prototype.getSpacedPoints=function(b){b||(b=5);var a,c=[];for(a=0;a<=b;a++)c.push(this.getPointAt(a/b));return c};
 THREE.Curve.prototype.getLength=function(){var b=this.getLengths();return b[b.length-1]};THREE.Curve.prototype.getLengths=function(b){b||(b=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==b+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=false;var a=[],c,d=this.getPoint(0),e,f=0;a.push(0);for(e=1;e<=b;e++){c=this.getPoint(e/b);f=f+c.distanceTo(d);a.push(f);d=c}return this.cacheArcLengths=a};
 THREE.Curve.prototype.getLength=function(){var b=this.getLengths();return b[b.length-1]};THREE.Curve.prototype.getLengths=function(b){b||(b=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==b+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=false;var a=[],c,d=this.getPoint(0),e,f=0;a.push(0);for(e=1;e<=b;e++){c=this.getPoint(e/b);f=f+c.distanceTo(d);a.push(f);d=c}return this.cacheArcLengths=a};
@@ -63,8 +70,7 @@ THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.
 THREE.CurvePath.prototype.getBoundingBox=function(){var b=this.getPoints(),a,c,d,e;a=c=Number.NEGATIVE_INFINITY;d=e=Number.POSITIVE_INFINITY;var f,g,h,i;i=new THREE.Vector2;g=0;for(h=b.length;g<h;g++){f=b[g];if(f.x>a)a=f.x;else if(f.x<d)d=f.x;if(f.y>c)c=f.y;else if(f.y<e)e=f.y;i.addSelf(f.x,f.y)}return{minX:d,minY:e,maxX:a,maxY:c,centroid:i.divideScalar(h)}};THREE.CurvePath.prototype.createPointsGeometry=function(b){return this.createGeometry(this.getPoints(b,true))};
 THREE.CurvePath.prototype.getBoundingBox=function(){var b=this.getPoints(),a,c,d,e;a=c=Number.NEGATIVE_INFINITY;d=e=Number.POSITIVE_INFINITY;var f,g,h,i;i=new THREE.Vector2;g=0;for(h=b.length;g<h;g++){f=b[g];if(f.x>a)a=f.x;else if(f.x<d)d=f.x;if(f.y>c)c=f.y;else if(f.y<e)e=f.y;i.addSelf(f.x,f.y)}return{minX:d,minY:e,maxX:a,maxY:c,centroid:i.divideScalar(h)}};THREE.CurvePath.prototype.createPointsGeometry=function(b){return this.createGeometry(this.getPoints(b,true))};
 THREE.CurvePath.prototype.createSpacedPointsGeometry=function(b){return this.createGeometry(this.getSpacedPoints(b,true))};THREE.CurvePath.prototype.createGeometry=function(b){for(var a=new THREE.Geometry,c=0;c<b.length;c++)a.vertices.push(new THREE.Vector3(b[c].x,b[c].y,0));return a};THREE.CurvePath.prototype.addWrapPath=function(b){this.bends.push(b)};
 THREE.CurvePath.prototype.createSpacedPointsGeometry=function(b){return this.createGeometry(this.getSpacedPoints(b,true))};THREE.CurvePath.prototype.createGeometry=function(b){for(var a=new THREE.Geometry,c=0;c<b.length;c++)a.vertices.push(new THREE.Vector3(b[c].x,b[c].y,0));return a};THREE.CurvePath.prototype.addWrapPath=function(b){this.bends.push(b)};
 THREE.CurvePath.prototype.getTransformedPoints=function(b,a){var c=this.getPoints(b),d,e;if(!a)a=this.bends;d=0;for(e=a.length;d<e;d++)c=this.getWrapPoints(c,a[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(b,a){var c=this.getSpacedPoints(b),d,e;if(!a)a=this.bends;d=0;for(e=a.length;d<e;d++)c=this.getWrapPoints(c,a[d]);return c};
 THREE.CurvePath.prototype.getTransformedPoints=function(b,a){var c=this.getPoints(b),d,e;if(!a)a=this.bends;d=0;for(e=a.length;d<e;d++)c=this.getWrapPoints(c,a[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(b,a){var c=this.getSpacedPoints(b),d,e;if(!a)a=this.bends;d=0;for(e=a.length;d<e;d++)c=this.getWrapPoints(c,a[d]);return c};
-THREE.CurvePath.prototype.getWrapPoints=function(b,a){var c=this.getBoundingBox(),d,e,f,g,h,i;d=0;for(e=b.length;d<e;d++){f=b[d];g=f.x;h=f.y;i=g/c.maxX;i=a.getUtoTmapping(i,g);g=a.getPoint(i);h=a.getNormalVector(i).multiplyScalar(h);f.x=g.x+h.x;f.y=g.y+h.y}return b};
-THREE.EventTarget=function(){var b={};this.addEventListener=function(a,c){b[a]==void 0&&(b[a]=[]);b[a].indexOf(c)===-1&&b[a].push(c)};this.dispatchEvent=function(a){for(var c in b[a.type])b[a.type][c](a)};this.removeEventListener=function(a,c){var d=b[a].indexOf(c);d!==-1&&b[a].splice(d,1)}};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=new THREE.Object3D;THREE.Gyroscope.prototype.constructor=THREE.Gyroscope;
+THREE.CurvePath.prototype.getWrapPoints=function(b,a){var c=this.getBoundingBox(),d,e,f,g,h,i;d=0;for(e=b.length;d<e;d++){f=b[d];g=f.x;h=f.y;i=g/c.maxX;i=a.getUtoTmapping(i,g);g=a.getPoint(i);h=a.getNormalVector(i).multiplyScalar(h);f.x=g.x+h.x;f.y=g.y+h.y}return b};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=new THREE.Object3D;THREE.Gyroscope.prototype.constructor=THREE.Gyroscope;
 THREE.Gyroscope.prototype.updateMatrixWorld=function(b){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||b){if(this.parent){this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix);this.matrixWorld.decompose(this.translationWorld,this.rotationWorld,this.scaleWorld);this.matrix.decompose(this.translationObject,this.rotationObject,this.scaleObject);this.matrixWorld.compose(this.translationWorld,this.rotationObject,this.scaleWorld)}else this.matrixWorld.copy(this.matrix);
 THREE.Gyroscope.prototype.updateMatrixWorld=function(b){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||b){if(this.parent){this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix);this.matrixWorld.decompose(this.translationWorld,this.rotationWorld,this.scaleWorld);this.matrix.decompose(this.translationObject,this.rotationObject,this.scaleObject);this.matrixWorld.compose(this.translationWorld,this.rotationObject,this.scaleWorld)}else this.matrixWorld.copy(this.matrix);
 this.matrixWorldNeedsUpdate=false;b=true}for(var a=0,c=this.children.length;a<c;a++)this.children[a].updateMatrixWorld(b)};THREE.Gyroscope.prototype.translationWorld=new THREE.Vector3;THREE.Gyroscope.prototype.translationObject=new THREE.Vector3;THREE.Gyroscope.prototype.rotationWorld=new THREE.Quaternion;THREE.Gyroscope.prototype.rotationObject=new THREE.Quaternion;THREE.Gyroscope.prototype.scaleWorld=new THREE.Vector3;THREE.Gyroscope.prototype.scaleObject=new THREE.Vector3;
 this.matrixWorldNeedsUpdate=false;b=true}for(var a=0,c=this.children.length;a<c;a++)this.children[a].updateMatrixWorld(b)};THREE.Gyroscope.prototype.translationWorld=new THREE.Vector3;THREE.Gyroscope.prototype.translationObject=new THREE.Vector3;THREE.Gyroscope.prototype.rotationWorld=new THREE.Quaternion;THREE.Gyroscope.prototype.rotationObject=new THREE.Quaternion;THREE.Gyroscope.prototype.scaleWorld=new THREE.Vector3;THREE.Gyroscope.prototype.scaleObject=new THREE.Vector3;
 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);for(var a=1,c=b.length;a<c;a++)this.lineTo(b[a].x,b[a].y)};
 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);for(var a=1,c=b.length;a<c;a++)this.lineTo(b[a].x,b[a].y)};
@@ -77,9 +83,7 @@ THREE.Path.prototype.absarc=function(b,a,c,d,e,f){var g=Array.prototype.slice.ca
 THREE.Path.prototype.getPoints=function(b,a){if(this.useSpacedPoints){console.log("tata");return this.getSpacedPoints(b,a)}var b=b||12,c=[],d,e,f,g,h,i,j,l,n,k,m,p,q;d=0;for(e=this.actions.length;d<e;d++){f=this.actions[d];g=f.action;f=f.args;switch(g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];i=f[3];n=f[0];k=f[1];if(c.length>0){g=c[c.length-1];
 THREE.Path.prototype.getPoints=function(b,a){if(this.useSpacedPoints){console.log("tata");return this.getSpacedPoints(b,a)}var b=b||12,c=[],d,e,f,g,h,i,j,l,n,k,m,p,q;d=0;for(e=this.actions.length;d<e;d++){f=this.actions[d];g=f.action;f=f.args;switch(g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];i=f[3];n=f[0];k=f[1];if(c.length>0){g=c[c.length-1];
 m=g.x;p=g.y}else{g=this.actions[d-1].args;m=g[g.length-2];p=g[g.length-1]}for(f=1;f<=b;f++){q=f/b;g=THREE.Shape.Utils.b2(q,m,n,h);q=THREE.Shape.Utils.b2(q,p,k,i);c.push(new THREE.Vector2(g,q))}break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];i=f[5];n=f[0];k=f[1];j=f[2];l=f[3];if(c.length>0){g=c[c.length-1];m=g.x;p=g.y}else{g=this.actions[d-1].args;m=g[g.length-2];p=g[g.length-1]}for(f=1;f<=b;f++){q=f/b;g=THREE.Shape.Utils.b3(q,m,n,j,h);q=THREE.Shape.Utils.b3(q,p,k,l,i);c.push(new THREE.Vector2(g,
 m=g.x;p=g.y}else{g=this.actions[d-1].args;m=g[g.length-2];p=g[g.length-1]}for(f=1;f<=b;f++){q=f/b;g=THREE.Shape.Utils.b2(q,m,n,h);q=THREE.Shape.Utils.b2(q,p,k,i);c.push(new THREE.Vector2(g,q))}break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];i=f[5];n=f[0];k=f[1];j=f[2];l=f[3];if(c.length>0){g=c[c.length-1];m=g.x;p=g.y}else{g=this.actions[d-1].args;m=g[g.length-2];p=g[g.length-1]}for(f=1;f<=b;f++){q=f/b;g=THREE.Shape.Utils.b3(q,m,n,j,h);q=THREE.Shape.Utils.b3(q,p,k,l,i);c.push(new THREE.Vector2(g,
 q))}break;case THREE.PathActions.CSPLINE_THRU:g=this.actions[d-1].args;q=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=b*f[0].length;q=q.concat(f[0]);q=new THREE.SplineCurve(q);for(f=1;f<=g;f++)c.push(q.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];i=f[1];j=f[2];n=f[3];k=!!f[5];l=f[4]-n;m=b*2;for(f=1;f<=m;f++){q=f/m;k||(q=1-q);q=n+q*l;g=h+j*Math.cos(q);q=i+j*Math.sin(q);c.push(new THREE.Vector2(g,q))}}}d=c[c.length-1];Math.abs(d.x-c[0].x)<1.0E-10&&Math.abs(d.y-c[0].y)<1.0E-10&&c.splice(c.length-
 q))}break;case THREE.PathActions.CSPLINE_THRU:g=this.actions[d-1].args;q=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=b*f[0].length;q=q.concat(f[0]);q=new THREE.SplineCurve(q);for(f=1;f<=g;f++)c.push(q.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];i=f[1];j=f[2];n=f[3];k=!!f[5];l=f[4]-n;m=b*2;for(f=1;f<=m;f++){q=f/m;k||(q=1-q);q=n+q*l;g=h+j*Math.cos(q);q=i+j*Math.sin(q);c.push(new THREE.Vector2(g,q))}}}d=c[c.length-1];Math.abs(d.x-c[0].x)<1.0E-10&&Math.abs(d.y-c[0].y)<1.0E-10&&c.splice(c.length-
-1,1);a&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(b,a){this.getBoundingBox();return this.getWrapPoints(this.getPoints(a),b)};THREE.Path.prototype.nltransform=function(b,a,c,d,e,f){var g=this.getPoints(),h,i,j,l,n;h=0;for(i=g.length;h<i;h++){j=g[h];l=j.x;n=j.y;j.x=b*l+a*n+c;j.y=d*n+e*l+f}return g};
-THREE.Path.prototype.debug=function(b){var a=this.getBoundingBox();if(!b){b=document.createElement("canvas");b.setAttribute("width",a.maxX+100);b.setAttribute("height",a.maxY+100);document.body.appendChild(b)}a=b.getContext("2d");a.fillStyle="white";a.fillRect(0,0,b.width,b.height);a.strokeStyle="black";a.beginPath();var c,d,e,b=0;for(c=this.actions.length;b<c;b++){d=this.actions[b];e=d.args;d=d.action;d!=THREE.PathActions.CSPLINE_THRU&&a[d].apply(a,e)}a.stroke();a.closePath();a.strokeStyle="red";
-d=this.getPoints();b=0;for(c=d.length;b<c;b++){e=d[b];a.beginPath();a.arc(e.x,e.y,1.5,0,Math.PI*2,false);a.stroke();a.closePath()}};
+1,1);a&&c.push(c[0]);return c};
 THREE.Path.prototype.toShapes=function(){var b,a,c,d,e=[],f=new THREE.Path;b=0;for(a=this.actions.length;b<a;b++){c=this.actions[b];d=c.args;c=c.action;if(c==THREE.PathActions.MOVE_TO&&f.actions.length!=0){e.push(f);f=new THREE.Path}f[c].apply(f,d)}f.actions.length!=0&&e.push(f);if(e.length==0)return[];var g;d=[];b=!THREE.Shape.Utils.isClockWise(e[0].getPoints());if(e.length==1){f=e[0];g=new THREE.Shape;g.actions=f.actions;g.curves=f.curves;d.push(g);return d}if(b){g=new THREE.Shape;b=0;for(a=e.length;b<
 THREE.Path.prototype.toShapes=function(){var b,a,c,d,e=[],f=new THREE.Path;b=0;for(a=this.actions.length;b<a;b++){c=this.actions[b];d=c.args;c=c.action;if(c==THREE.PathActions.MOVE_TO&&f.actions.length!=0){e.push(f);f=new THREE.Path}f[c].apply(f,d)}f.actions.length!=0&&e.push(f);if(e.length==0)return[];var g;d=[];b=!THREE.Shape.Utils.isClockWise(e[0].getPoints());if(e.length==1){f=e[0];g=new THREE.Shape;g.actions=f.actions;g.curves=f.curves;d.push(g);return d}if(b){g=new THREE.Shape;b=0;for(a=e.length;b<
 a;b++){f=e[b];if(THREE.Shape.Utils.isClockWise(f.getPoints())){g.actions=f.actions;g.curves=f.curves;d.push(g);g=new THREE.Shape}else g.holes.push(f)}}else{b=0;for(a=e.length;b<a;b++){f=e[b];if(THREE.Shape.Utils.isClockWise(f.getPoints())){g&&d.push(g);g=new THREE.Shape;g.actions=f.actions;g.curves=f.curves}else g.holes.push(f)}d.push(g)}return d};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;
 a;b++){f=e[b];if(THREE.Shape.Utils.isClockWise(f.getPoints())){g.actions=f.actions;g.curves=f.curves;d.push(g);g=new THREE.Shape}else g.holes.push(f)}}else{b=0;for(a=e.length;b<a;b++){f=e[b];if(THREE.Shape.Utils.isClockWise(f.getPoints())){g&&d.push(g);g=new THREE.Shape;g.actions=f.actions;g.curves=f.curves}else g.holes.push(f)}d.push(g)}return d};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 a,c=this.holes.length,d=[];for(a=0;a<c;a++)d[a]=this.holes[a].getTransformedPoints(b,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(b){var a,c=this.holes.length,d=[];for(a=0;a<c;a++)d[a]=this.holes[a].getTransformedSpacedPoints(b,this.bends);return d};
 THREE.Shape.prototype.extrude=function(b){return new THREE.ExtrudeGeometry(this,b)};THREE.Shape.prototype.getPointsHoles=function(b){var a,c=this.holes.length,d=[];for(a=0;a<c;a++)d[a]=this.holes[a].getTransformedPoints(b,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(b){var a,c=this.holes.length,d=[];for(a=0;a<c;a++)d[a]=this.holes[a].getTransformedSpacedPoints(b,this.bends);return d};
@@ -88,13 +92,12 @@ THREE.Shape.Utils={removeHoles:function(b,a){var c=b.concat(),d=c.concat(),e,f,g
 -1;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+j.length);g=g%j.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:j.length-1;q=[j[g],c[h],c[e]];q=THREE.FontUtils.Triangulate.area(q);r=[j[g],j[f],c[h]];r=THREE.FontUtils.Triangulate.area(r);if(n+k>q+r){h=m;g=l;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+j.length);g=g%j.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:j.length-1}n=c.slice(0,h);k=c.slice(h);m=j.slice(g);l=j.slice(0,g);f=[j[g],j[f],c[h]];p.push([j[g],c[h],c[e]]);p.push(f);c=n.concat(m).concat(l).concat(k)}return{shape:c,
 -1;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+j.length);g=g%j.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:j.length-1;q=[j[g],c[h],c[e]];q=THREE.FontUtils.Triangulate.area(q);r=[j[g],j[f],c[h]];r=THREE.FontUtils.Triangulate.area(r);if(n+k>q+r){h=m;g=l;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+j.length);g=g%j.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:j.length-1}n=c.slice(0,h);k=c.slice(h);m=j.slice(g);l=j.slice(0,g);f=[j[g],j[f],c[h]];p.push([j[g],c[h],c[e]]);p.push(f);c=n.concat(m).concat(l).concat(k)}return{shape:c,
 isolatedPts:p,allpoints:d}},triangulateShape:function(b,a){var c=THREE.Shape.Utils.removeHoles(b,a),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,false),f,g,h,i,j={};f=0;for(g=d.length;f<g;f++){i=d[f].x+":"+d[f].y;j[i]!==void 0&&console.log("Duplicate point",i);j[i]=f}f=0;for(g=c.length;f<g;f++){h=c[f];for(d=0;d<3;d++){i=h[d].x+":"+h[d].y;i=j[i];i!==void 0&&(h[d]=i)}}f=0;for(g=e.length;f<g;f++){h=e[f];for(d=0;d<3;d++){i=h[d].x+":"+h[d].y;i=j[i];i!==void 0&&(h[d]=i)}}return c.concat(e)},
 isolatedPts:p,allpoints:d}},triangulateShape:function(b,a){var c=THREE.Shape.Utils.removeHoles(b,a),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,false),f,g,h,i,j={};f=0;for(g=d.length;f<g;f++){i=d[f].x+":"+d[f].y;j[i]!==void 0&&console.log("Duplicate point",i);j[i]=f}f=0;for(g=c.length;f<g;f++){h=c[f];for(d=0;d<3;d++){i=h[d].x+":"+h[d].y;i=j[i];i!==void 0&&(h[d]=i)}}f=0;for(g=e.length;f<g;f++){h=e[f];for(d=0;d<3;d++){i=h[d].x+":"+h[d].y;i=j[i];i!==void 0&&(h[d]=i)}}return c.concat(e)},
 isClockWise:function(b){return THREE.FontUtils.Triangulate.area(b)<0},b2p0:function(b,a){var c=1-b;return c*c*a},b2p1:function(b,a){return 2*(1-b)*b*a},b2p2:function(b,a){return b*b*a},b2:function(b,a,c,d){return this.b2p0(b,a)+this.b2p1(b,c)+this.b2p2(b,d)},b3p0:function(b,a){var c=1-b;return c*c*c*a},b3p1:function(b,a){var c=1-b;return 3*c*c*b*a},b3p2:function(b,a){return 3*(1-b)*b*b*a},b3p3:function(b,a){return b*b*b*a},b3:function(b,a,c,d,e){return this.b3p0(b,a)+this.b3p1(b,c)+this.b3p2(b,d)+
 isClockWise:function(b){return THREE.FontUtils.Triangulate.area(b)<0},b2p0:function(b,a){var c=1-b;return c*c*a},b2p1:function(b,a){return 2*(1-b)*b*a},b2p2:function(b,a){return b*b*a},b2:function(b,a,c,d){return this.b2p0(b,a)+this.b2p1(b,c)+this.b2p2(b,d)},b3p0:function(b,a){var c=1-b;return c*c*c*a},b3p1:function(b,a){var c=1-b;return 3*c*c*b*a},b3p2:function(b,a){return 3*(1-b)*b*b*a},b3p3:function(b,a){return b*b*b*a},b3:function(b,a,c,d,e){return this.b3p0(b,a)+this.b3p1(b,c)+this.b3p2(b,d)+
-this.b3p3(b,e)}};THREE.TextPath=function(b,a){THREE.Path.call(this);this.parameters=a||{};this.set(b)};THREE.TextPath.prototype.set=function(b,a){a=a||this.parameters;this.text=b;var c=a.curveSegments!==void 0?a.curveSegments:4,d=a.font!==void 0?a.font:"helvetiker",e=a.weight!==void 0?a.weight:"normal",f=a.style!==void 0?a.style:"normal";THREE.FontUtils.size=a.size!==void 0?a.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f};
-THREE.TextPath.prototype.toShapes=function(){for(var b=THREE.FontUtils.drawText(this.text).paths,a=[],c=0,d=b.length;c<d;c++)Array.prototype.push.apply(a,b[c].toShapes());return a};
-THREE.AnimationHandler=function(){var b=[],a={},c={update:function(a){for(var c=0;c<b.length;c++)b[c].update(a)},addToUpdate:function(a){b.indexOf(a)===-1&&b.push(a)},removeFromUpdate:function(a){a=b.indexOf(a);a!==-1&&b.splice(a,1)},add:function(b){a[b.name]!==void 0&&console.log("THREE.AnimationHandler.add: Warning! "+b.name+" already exists in library. Overwriting.");a[b.name]=b;if(b.initialized!==true){for(var c=0;c<b.hierarchy.length;c++){for(var d=0;d<b.hierarchy[c].keys.length;d++){if(b.hierarchy[c].keys[d].time<
-0)b.hierarchy[c].keys[d].time=0;if(b.hierarchy[c].keys[d].rot!==void 0&&!(b.hierarchy[c].keys[d].rot instanceof THREE.Quaternion)){var h=b.hierarchy[c].keys[d].rot;b.hierarchy[c].keys[d].rot=new THREE.Quaternion(h[0],h[1],h[2],h[3])}}if(b.hierarchy[c].keys.length&&b.hierarchy[c].keys[0].morphTargets!==void 0){h={};for(d=0;d<b.hierarchy[c].keys.length;d++)for(var i=0;i<b.hierarchy[c].keys[d].morphTargets.length;i++){var j=b.hierarchy[c].keys[d].morphTargets[i];h[j]=-1}b.hierarchy[c].usedMorphTargets=
-h;for(d=0;d<b.hierarchy[c].keys.length;d++){var l={};for(j in h){for(i=0;i<b.hierarchy[c].keys[d].morphTargets.length;i++)if(b.hierarchy[c].keys[d].morphTargets[i]===j){l[j]=b.hierarchy[c].keys[d].morphTargetsInfluences[i];break}i===b.hierarchy[c].keys[d].morphTargets.length&&(l[j]=0)}b.hierarchy[c].keys[d].morphTargetsInfluences=l}}for(d=1;d<b.hierarchy[c].keys.length;d++)if(b.hierarchy[c].keys[d].time===b.hierarchy[c].keys[d-1].time){b.hierarchy[c].keys.splice(d,1);d--}for(d=0;d<b.hierarchy[c].keys.length;d++)b.hierarchy[c].keys[d].index=
-d}d=parseInt(b.length*b.fps,10);b.JIT={};b.JIT.hierarchy=[];for(c=0;c<b.hierarchy.length;c++)b.JIT.hierarchy.push(Array(d));b.initialized=true}},get:function(b){if(typeof b==="string"){if(a[b])return a[b];console.log("THREE.AnimationHandler.get: Couldn't find animation "+b);return null}},parse:function(a){var b=[];if(a instanceof THREE.SkinnedMesh)for(var c=0;c<a.bones.length;c++)b.push(a.bones[c]);else d(a,b);return b}},d=function(a,b){b.push(a);for(var c=0;c<a.children.length;c++)d(a.children[c],
-b)};c.LINEAR=0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(b,a,c,d){this.root=b;this.data=THREE.AnimationHandler.get(a);this.hierarchy=THREE.AnimationHandler.parse(b);this.currentTime=0;this.timeScale=1;this.isPlaying=false;this.loop=this.isPaused=true;this.interpolationType=c!==void 0?c:THREE.AnimationHandler.LINEAR;this.JITCompile=d!==void 0?d:true;this.points=[];this.target=new THREE.Vector3};
+this.b3p3(b,e)}};
+THREE.AnimationHandler=function(){var b=[],a={},c={update:function(a){for(var c=0;c<b.length;c++)b[c].update(a)},addToUpdate:function(a){b.indexOf(a)===-1&&b.push(a)},removeFromUpdate:function(a){a=b.indexOf(a);a!==-1&&b.splice(a,1)},add:function(b){a[b.name]!==void 0&&console.log("THREE.AnimationHandler.add: Warning! "+b.name+" already exists in library. Overwriting.");a[b.name]=b;if(b.initialized!==true){for(var c=0;c<b.hierarchy.length;c++){for(var d=0;d<b.hierarchy[c].keys.length;d++){if(b.hierarchy[c].keys[d].time<0)b.hierarchy[c].keys[d].time=
+0;if(b.hierarchy[c].keys[d].rot!==void 0&&!(b.hierarchy[c].keys[d].rot instanceof THREE.Quaternion)){var h=b.hierarchy[c].keys[d].rot;b.hierarchy[c].keys[d].rot=new THREE.Quaternion(h[0],h[1],h[2],h[3])}}if(b.hierarchy[c].keys.length&&b.hierarchy[c].keys[0].morphTargets!==void 0){h={};for(d=0;d<b.hierarchy[c].keys.length;d++)for(var i=0;i<b.hierarchy[c].keys[d].morphTargets.length;i++){var j=b.hierarchy[c].keys[d].morphTargets[i];h[j]=-1}b.hierarchy[c].usedMorphTargets=h;for(d=0;d<b.hierarchy[c].keys.length;d++){var l=
+{};for(j in h){for(i=0;i<b.hierarchy[c].keys[d].morphTargets.length;i++)if(b.hierarchy[c].keys[d].morphTargets[i]===j){l[j]=b.hierarchy[c].keys[d].morphTargetsInfluences[i];break}i===b.hierarchy[c].keys[d].morphTargets.length&&(l[j]=0)}b.hierarchy[c].keys[d].morphTargetsInfluences=l}}for(d=1;d<b.hierarchy[c].keys.length;d++)if(b.hierarchy[c].keys[d].time===b.hierarchy[c].keys[d-1].time){b.hierarchy[c].keys.splice(d,1);d--}for(d=0;d<b.hierarchy[c].keys.length;d++)b.hierarchy[c].keys[d].index=d}d=parseInt(b.length*
+b.fps,10);b.JIT={};b.JIT.hierarchy=[];for(c=0;c<b.hierarchy.length;c++)b.JIT.hierarchy.push(Array(d));b.initialized=true}},get:function(b){if(typeof b==="string"){if(a[b])return a[b];console.log("THREE.AnimationHandler.get: Couldn't find animation "+b);return null}},parse:function(a){var b=[];if(a instanceof THREE.SkinnedMesh)for(var c=0;c<a.bones.length;c++)b.push(a.bones[c]);else d(a,b);return b}},d=function(a,b){b.push(a);for(var c=0;c<a.children.length;c++)d(a.children[c],b)};c.LINEAR=0;c.CATMULLROM=
+1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(b,a,c,d){this.root=b;this.data=THREE.AnimationHandler.get(a);this.hierarchy=THREE.AnimationHandler.parse(b);this.currentTime=0;this.timeScale=1;this.isPlaying=false;this.loop=this.isPaused=true;this.interpolationType=c!==void 0?c:THREE.AnimationHandler.LINEAR;this.JITCompile=d!==void 0?d:true;this.points=[];this.target=new THREE.Vector3};
 THREE.Animation.prototype.play=function(b,a){if(!this.isPlaying){this.isPlaying=true;this.loop=b!==void 0?b:true;this.currentTime=a!==void 0?a:0;var c,d=this.hierarchy.length,e;for(c=0;c<d;c++){e=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)e.useQuaternion=true;e.matrixAutoUpdate=true;if(e.animationCache===void 0){e.animationCache={};e.animationCache.prevKey={pos:0,rot:0,scl:0};e.animationCache.nextKey={pos:0,rot:0,scl:0};e.animationCache.originalMatrix=
 THREE.Animation.prototype.play=function(b,a){if(!this.isPlaying){this.isPlaying=true;this.loop=b!==void 0?b:true;this.currentTime=a!==void 0?a:0;var c,d=this.hierarchy.length,e;for(c=0;c<d;c++){e=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)e.useQuaternion=true;e.matrixAutoUpdate=true;if(e.animationCache===void 0){e.animationCache={};e.animationCache.prevKey={pos:0,rot:0,scl:0};e.animationCache.nextKey={pos:0,rot:0,scl:0};e.animationCache.originalMatrix=
 e instanceof THREE.Bone?e.skinMatrix:e.matrix}var f=e.animationCache.prevKey;e=e.animationCache.nextKey;f.pos=this.data.hierarchy[c].keys[0];f.rot=this.data.hierarchy[c].keys[0];f.scl=this.data.hierarchy[c].keys[0];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=false;THREE.AnimationHandler.addToUpdate(this)};
 e instanceof THREE.Bone?e.skinMatrix:e.matrix}var f=e.animationCache.prevKey;e=e.animationCache.nextKey;f.pos=this.data.hierarchy[c].keys[0];f.rot=this.data.hierarchy[c].keys[0];f.scl=this.data.hierarchy[c].keys[0];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=false;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
@@ -136,7 +139,7 @@ this.moveRight&&this.object.translateX(b);this.moveUp&&this.object.translateY(b)
 Math.sin(this.theta);b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon=this.lon+this.mouseX*a;if(this.lookVertical)this.lat=this.lat-this.mouseY*a*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=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);b=this.target;c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+
 Math.sin(this.theta);b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon=this.lon+this.mouseX*a;if(this.lookVertical)this.lat=this.lat-this.mouseY*a*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=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);b=this.target;c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+
 100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(b)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},false);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),false);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),false);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),false);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),false);this.domElement.addEventListener("keyup",
 100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(b)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},false);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),false);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),false);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),false);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),false);this.domElement.addEventListener("keyup",
 c(this,this.onKeyUp),false)};
 c(this,this.onKeyUp),false)};
-THREE.PathControls=function(b,a){function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}function d(a,b){return function(){b.apply(a,arguments)}}function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.getControlPointsArray(),h=b.getLength(),r=g.length,t=0;f=r-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[f]={time:d,pos:g[f],rot:[0,0,0,1],scl:[1,1,1]};for(f=1;f<r-1;f++){t=d*h.chunks[f]/h.total;b.keys[f]={time:t,pos:g[f]}}e.hierarchy[0]=b;THREE.AnimationHandler.add(e);
+THREE.PathControls=function(b,a){function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}function d(a,b){return function(){b.apply(a,arguments)}}function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.getControlPointsArray(),h=b.getLength(),r=g.length,s=0;f=r-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[f]={time:d,pos:g[f],rot:[0,0,0,1],scl:[1,1,1]};for(f=1;f<r-1;f++){s=d*h.chunks[f]/h.total;b.keys[f]={time:s,pos:g[f]}}e.hierarchy[0]=b;THREE.AnimationHandler.add(e);
 return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,false)}function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b;c++){d=c/(a.points.length*b);d=a.getPoint(d);e.vertices[c]=new THREE.Vector3(d.x,d.y,d.z)}return e}this.object=b;this.domElement=a!==void 0?a:document;this.id="PathControls"+THREE.PathControlsIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=true;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;
 return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,false)}function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b;c++){d=c/(a.points.length*b);d=a.getPoint(d);e.vertices[c]=new THREE.Vector3(d.x,d.y,d.z)}return e}this.object=b;this.domElement=a!==void 0?a:document;this.id="PathControls"+THREE.PathControlsIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=true;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;
 this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=this.lookVertical=true;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;if(this.domElement===document){this.viewHalfX=window.innerWidth/2;this.viewHalfY=window.innerHeight/2}else{this.viewHalfX=this.domElement.offsetWidth/2;this.viewHalfY=
 this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=this.lookVertical=true;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;if(this.domElement===document){this.viewHalfX=window.innerWidth/2;this.viewHalfY=window.innerHeight/2}else{this.viewHalfX=this.domElement.offsetWidth/2;this.viewHalfY=
 this.domElement.offsetHeight/2;this.domElement.setAttribute("tabindex",-1)}var g=Math.PI*2,h=Math.PI/180;this.update=function(a){var b;if(this.lookHorizontal)this.lon=this.lon+this.mouseX*this.lookSpeed*a;if(this.lookVertical)this.lat=this.lat-this.mouseY*this.lookSpeed*a;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;a=this.phi%g;this.phi=a>=0?a:a+g;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange;
 this.domElement.offsetHeight/2;this.domElement.setAttribute("tabindex",-1)}var g=Math.PI*2,h=Math.PI/180;this.update=function(a){var b;if(this.lookHorizontal)this.lon=this.lon+this.mouseX*this.lookSpeed*a;if(this.lookVertical)this.lat=this.lat-this.mouseY*this.lookSpeed*a;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;a=this.phi%g;this.phi=a>=0?a:a+g;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange;
@@ -170,24 +173,24 @@ b.addSelf(c.object.up.clone().setLength(a.y));c.object.position.addSelf(b);c.tar
 c.noRotate||c.rotateCamera();c.noZoom||c.zoomCamera();c.noPan||c.panCamera();c.object.position.add(c.target,g);c.checkDistances();c.object.lookAt(c.target);if(d.distanceTo(c.object.position)>0){c.dispatchEvent(m);d.copy(c.object.position)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},false);this.domElement.addEventListener("mousemove",function(a){if(c.enabled){if(e){h=i=c.getMouseProjectionOnBall(a.clientX,a.clientY);j=l=c.getMouseOnScreen(a.clientX,a.clientY);n=
 c.noRotate||c.rotateCamera();c.noZoom||c.zoomCamera();c.noPan||c.panCamera();c.object.position.add(c.target,g);c.checkDistances();c.object.lookAt(c.target);if(d.distanceTo(c.object.position)>0){c.dispatchEvent(m);d.copy(c.object.position)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},false);this.domElement.addEventListener("mousemove",function(a){if(c.enabled){if(e){h=i=c.getMouseProjectionOnBall(a.clientX,a.clientY);j=l=c.getMouseOnScreen(a.clientX,a.clientY);n=
 k=c.getMouseOnScreen(a.clientX,a.clientY);e=false}f!==-1&&(f===0&&!c.noRotate?i=c.getMouseProjectionOnBall(a.clientX,a.clientY):f===1&&!c.noZoom?l=c.getMouseOnScreen(a.clientX,a.clientY):f===2&&!c.noPan&&(k=c.getMouseOnScreen(a.clientX,a.clientY)))}},false);this.domElement.addEventListener("mousedown",function(a){if(c.enabled){a.preventDefault();a.stopPropagation();if(f===-1){f=a.button;f===0&&!c.noRotate?h=i=c.getMouseProjectionOnBall(a.clientX,a.clientY):f===1&&!c.noZoom?j=l=c.getMouseOnScreen(a.clientX,
 k=c.getMouseOnScreen(a.clientX,a.clientY);e=false}f!==-1&&(f===0&&!c.noRotate?i=c.getMouseProjectionOnBall(a.clientX,a.clientY):f===1&&!c.noZoom?l=c.getMouseOnScreen(a.clientX,a.clientY):f===2&&!c.noPan&&(k=c.getMouseOnScreen(a.clientX,a.clientY)))}},false);this.domElement.addEventListener("mousedown",function(a){if(c.enabled){a.preventDefault();a.stopPropagation();if(f===-1){f=a.button;f===0&&!c.noRotate?h=i=c.getMouseProjectionOnBall(a.clientX,a.clientY):f===1&&!c.noZoom?j=l=c.getMouseOnScreen(a.clientX,
 a.clientY):this.noPan||(n=k=c.getMouseOnScreen(a.clientX,a.clientY))}}},false);this.domElement.addEventListener("mouseup",function(a){if(c.enabled){a.preventDefault();a.stopPropagation();f=-1}},false);window.addEventListener("keydown",function(a){if(c.enabled&&f===-1){a.keyCode===c.keys[0]&&!c.noRotate?f=0:a.keyCode===c.keys[1]&&!c.noZoom?f=1:a.keyCode===c.keys[2]&&!c.noPan&&(f=2);f!==-1&&(e=true)}},false);window.addEventListener("keyup",function(){c.enabled&&f!==-1&&(f=-1)},false)};
 a.clientY):this.noPan||(n=k=c.getMouseOnScreen(a.clientX,a.clientY))}}},false);this.domElement.addEventListener("mouseup",function(a){if(c.enabled){a.preventDefault();a.stopPropagation();f=-1}},false);window.addEventListener("keydown",function(a){if(c.enabled&&f===-1){a.keyCode===c.keys[0]&&!c.noRotate?f=0:a.keyCode===c.keys[1]&&!c.noZoom?f=1:a.keyCode===c.keys[2]&&!c.noPan&&(f=2);f!==-1&&(e=true)}},false);window.addEventListener("keyup",function(){c.enabled&&f!==-1&&(f=-1)},false)};
-THREE.CubeGeometry=function(b,a,c,d,e,f,g,h){function i(a,b,c,g,h,i,k,l){var m,n=d||1,p=e||1,q=h/2,r=i/2,t=j.vertices.length;if(a==="x"&&b==="y"||a==="y"&&b==="x")m="z";else if(a==="x"&&b==="z"||a==="z"&&b==="x"){m="y";p=f||1}else if(a==="z"&&b==="y"||a==="y"&&b==="z"){m="x";n=f||1}var s=n+1,v=p+1,I=h/n,M=i/p,J=new THREE.Vector3;J[m]=k>0?1:-1;for(h=0;h<v;h++)for(i=0;i<s;i++){var O=new THREE.Vector3;O[a]=(i*I-q)*c;O[b]=(h*M-r)*g;O[m]=k;j.vertices.push(O)}for(h=0;h<p;h++)for(i=0;i<n;i++){a=new THREE.Face4(i+
-s*h+t,i+s*(h+1)+t,i+1+s*(h+1)+t,i+1+s*h+t);a.normal.copy(J);a.vertexNormals.push(J.clone(),J.clone(),J.clone(),J.clone());a.materialIndex=l;j.faces.push(a);j.faceVertexUvs[0].push([new THREE.UV(i/n,h/p),new THREE.UV(i/n,(h+1)/p),new THREE.UV((i+1)/n,(h+1)/p),new THREE.UV((i+1)/n,h/p)])}}THREE.Geometry.call(this);var j=this,l=b/2,n=a/2,k=c/2,m,p,q,r,t,s;if(g!==void 0){if(g instanceof Array)this.materials=g;else{this.materials=[];for(m=0;m<6;m++)this.materials.push(g)}m=0;r=1;p=2;t=3;q=4;s=5}else this.materials=
-[];this.sides={px:true,nx:true,py:true,ny:true,pz:true,nz:true};if(h!=void 0)for(var v in h)this.sides[v]!==void 0&&(this.sides[v]=h[v]);this.sides.px&&i("z","y",-1,-1,c,a,l,m);this.sides.nx&&i("z","y",1,-1,c,a,-l,r);this.sides.py&&i("x","z",1,1,b,c,n,p);this.sides.ny&&i("x","z",1,-1,b,c,-n,t);this.sides.pz&&i("x","y",1,-1,b,a,k,q);this.sides.nz&&i("x","y",-1,-1,b,a,-k,s);this.computeCentroids();this.mergeVertices()};THREE.CubeGeometry.prototype=new THREE.Geometry;
+THREE.CubeGeometry=function(b,a,c,d,e,f,g,h){function i(a,b,c,g,h,i,k,m){var l,n=d||1,p=e||1,q=h/2,r=i/2,s=j.vertices.length;if(a==="x"&&b==="y"||a==="y"&&b==="x")l="z";else if(a==="x"&&b==="z"||a==="z"&&b==="x"){l="y";p=f||1}else if(a==="z"&&b==="y"||a==="y"&&b==="z"){l="x";n=f||1}var t=n+1,w=p+1,I=h/n,M=i/p,J=new THREE.Vector3;J[l]=k>0?1:-1;for(h=0;h<w;h++)for(i=0;i<t;i++){var O=new THREE.Vector3;O[a]=(i*I-q)*c;O[b]=(h*M-r)*g;O[l]=k;j.vertices.push(O)}for(h=0;h<p;h++)for(i=0;i<n;i++){a=new THREE.Face4(i+
+t*h+s,i+t*(h+1)+s,i+1+t*(h+1)+s,i+1+t*h+s);a.normal.copy(J);a.vertexNormals.push(J.clone(),J.clone(),J.clone(),J.clone());a.materialIndex=m;j.faces.push(a);j.faceVertexUvs[0].push([new THREE.UV(i/n,h/p),new THREE.UV(i/n,(h+1)/p),new THREE.UV((i+1)/n,(h+1)/p),new THREE.UV((i+1)/n,h/p)])}}THREE.Geometry.call(this);var j=this,l=b/2,n=a/2,k=c/2,m,p,q,r,s,t;if(g!==void 0){if(g instanceof Array)this.materials=g;else{this.materials=[];for(m=0;m<6;m++)this.materials.push(g)}m=0;r=1;p=2;s=3;q=4;t=5}else this.materials=
+[];this.sides={px:true,nx:true,py:true,ny:true,pz:true,nz:true};if(h!=void 0)for(var w in h)this.sides[w]!==void 0&&(this.sides[w]=h[w]);this.sides.px&&i("z","y",-1,-1,c,a,l,m);this.sides.nx&&i("z","y",1,-1,c,a,-l,r);this.sides.py&&i("x","z",1,1,b,c,n,p);this.sides.ny&&i("x","z",1,-1,b,c,-n,s);this.sides.pz&&i("x","y",1,-1,b,a,k,q);this.sides.nz&&i("x","y",-1,-1,b,a,-k,t);this.computeCentroids();this.mergeVertices()};THREE.CubeGeometry.prototype=new THREE.Geometry;
 THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
 THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
 THREE.CylinderGeometry=function(b,a,c,d,e,f){THREE.Geometry.call(this);var b=b!==void 0?b:20,a=a!==void 0?a:20,c=c!==void 0?c:100,g=c/2,d=d||8,e=e||1,h,i,j=[],l=[];for(i=0;i<=e;i++){var n=[],k=[],m=i/e,p=m*(a-b)+b;for(h=0;h<=d;h++){var q=h/d,r=new THREE.Vector3;r.x=p*Math.sin(q*Math.PI*2);r.y=-m*c+g;r.z=p*Math.cos(q*Math.PI*2);this.vertices.push(r);n.push(this.vertices.length-1);k.push(new THREE.UV(q,m))}j.push(n);l.push(k)}c=(a-b)/c;for(h=0;h<d;h++){if(b!==0){n=this.vertices[j[0][h]].clone();k=this.vertices[j[0][h+
 THREE.CylinderGeometry=function(b,a,c,d,e,f){THREE.Geometry.call(this);var b=b!==void 0?b:20,a=a!==void 0?a:20,c=c!==void 0?c:100,g=c/2,d=d||8,e=e||1,h,i,j=[],l=[];for(i=0;i<=e;i++){var n=[],k=[],m=i/e,p=m*(a-b)+b;for(h=0;h<=d;h++){var q=h/d,r=new THREE.Vector3;r.x=p*Math.sin(q*Math.PI*2);r.y=-m*c+g;r.z=p*Math.cos(q*Math.PI*2);this.vertices.push(r);n.push(this.vertices.length-1);k.push(new THREE.UV(q,m))}j.push(n);l.push(k)}c=(a-b)/c;for(h=0;h<d;h++){if(b!==0){n=this.vertices[j[0][h]].clone();k=this.vertices[j[0][h+
-1]].clone()}else{n=this.vertices[j[1][h]].clone();k=this.vertices[j[1][h+1]].clone()}n.setY(Math.sqrt(n.x*n.x+n.z*n.z)*c).normalize();k.setY(Math.sqrt(k.x*k.x+k.z*k.z)*c).normalize();for(i=0;i<e;i++){var m=j[i][h],p=j[i+1][h],q=j[i+1][h+1],r=j[i][h+1],t=n.clone(),s=n.clone(),v=k.clone(),o=k.clone(),x=l[i][h].clone(),z=l[i+1][h].clone(),A=l[i+1][h+1].clone(),w=l[i][h+1].clone();this.faces.push(new THREE.Face4(m,p,q,r,[t,s,v,o]));this.faceVertexUvs[0].push([x,z,A,w])}}if(!f&&b>0){this.vertices.push(new THREE.Vector3(0,
-g,0));for(h=0;h<d;h++){m=j[0][h];p=j[0][h+1];q=this.vertices.length-1;t=new THREE.Vector3(0,1,0);s=new THREE.Vector3(0,1,0);v=new THREE.Vector3(0,1,0);x=l[0][h].clone();z=l[0][h+1].clone();A=new THREE.UV(z.u,0);this.faces.push(new THREE.Face3(m,p,q,[t,s,v]));this.faceVertexUvs[0].push([x,z,A])}}if(!f&&a>0){this.vertices.push(new THREE.Vector3(0,-g,0));for(h=0;h<d;h++){m=j[i][h+1];p=j[i][h];q=this.vertices.length-1;t=new THREE.Vector3(0,-1,0);s=new THREE.Vector3(0,-1,0);v=new THREE.Vector3(0,-1,0);
-x=l[i][h+1].clone();z=l[i][h].clone();A=new THREE.UV(z.u,1);this.faces.push(new THREE.Face3(m,p,q,[t,s,v]));this.faceVertexUvs[0].push([x,z,A])}}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
+1]].clone()}else{n=this.vertices[j[1][h]].clone();k=this.vertices[j[1][h+1]].clone()}n.setY(Math.sqrt(n.x*n.x+n.z*n.z)*c).normalize();k.setY(Math.sqrt(k.x*k.x+k.z*k.z)*c).normalize();for(i=0;i<e;i++){var m=j[i][h],p=j[i+1][h],q=j[i+1][h+1],r=j[i][h+1],s=n.clone(),t=n.clone(),w=k.clone(),o=k.clone(),x=l[i][h].clone(),z=l[i+1][h].clone(),A=l[i+1][h+1].clone(),v=l[i][h+1].clone();this.faces.push(new THREE.Face4(m,p,q,r,[s,t,w,o]));this.faceVertexUvs[0].push([x,z,A,v])}}if(!f&&b>0){this.vertices.push(new THREE.Vector3(0,
+g,0));for(h=0;h<d;h++){m=j[0][h];p=j[0][h+1];q=this.vertices.length-1;s=new THREE.Vector3(0,1,0);t=new THREE.Vector3(0,1,0);w=new THREE.Vector3(0,1,0);x=l[0][h].clone();z=l[0][h+1].clone();A=new THREE.UV(z.u,0);this.faces.push(new THREE.Face3(m,p,q,[s,t,w]));this.faceVertexUvs[0].push([x,z,A])}}if(!f&&a>0){this.vertices.push(new THREE.Vector3(0,-g,0));for(h=0;h<d;h++){m=j[i][h+1];p=j[i][h];q=this.vertices.length-1;s=new THREE.Vector3(0,-1,0);t=new THREE.Vector3(0,-1,0);w=new THREE.Vector3(0,-1,0);
+x=l[i][h+1].clone();z=l[i][h].clone();A=new THREE.UV(z.u,1);this.faces.push(new THREE.Face3(m,p,q,[s,t,w]));this.faceVertexUvs[0].push([x,z,A])}}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
 THREE.ExtrudeGeometry=function(b,a){if(typeof b!=="undefined"){THREE.Geometry.call(this);b=b instanceof Array?b:[b];this.shapebb=b[b.length-1].getBoundingBox();this.addShapeList(b,a);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(b,a){for(var c=b.length,d=0;d<c;d++)this.addShape(b[d],a)};
 THREE.ExtrudeGeometry=function(b,a){if(typeof b!=="undefined"){THREE.Geometry.call(this);b=b instanceof Array?b:[b];this.shapebb=b[b.length-1].getBoundingBox();this.addShapeList(b,a);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(b,a){for(var c=b.length,d=0;d<c;d++)this.addShape(b[d],a)};
 THREE.ExtrudeGeometry.prototype.addShape=function(b,a){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).addSelf(a)}function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,f=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,i=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();f.set(-d.y,d.x);g.set(e.y,-e.x);h.copy(a).addSelf(f);i.copy(a).addSelf(g);if(h.equals(i))return g.clone();
 THREE.ExtrudeGeometry.prototype.addShape=function(b,a){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).addSelf(a)}function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,f=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,i=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();f.set(-d.y,d.x);g.set(e.y,-e.x);h.copy(a).addSelf(f);i.copy(a).addSelf(g);if(h.equals(i))return g.clone();
 h.copy(b).addSelf(f);i.copy(c).addSelf(g);f=d.dot(g);g=i.subSelf(h).dot(g);if(f===0){console.log("Either infinite or no solutions!");g===0?console.log("Its finite solutions."):console.log("Too bad, no solutions.")}g=g/f;if(g<0){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=a+Math.PI*2);c=(b+a)/2;a=-Math.cos(c);c=-Math.sin(c);a=new THREE.Vector2(a,c)}else a=d.multiplyScalar(g).addSelf(h).subSelf(a).clone();return a}function e(c,d){var e,f;for(y=c.length;--y>=0;){e=y;f=y-1;f<0&&
 h.copy(b).addSelf(f);i.copy(c).addSelf(g);f=d.dot(g);g=i.subSelf(h).dot(g);if(f===0){console.log("Either infinite or no solutions!");g===0?console.log("Its finite solutions."):console.log("Too bad, no solutions.")}g=g/f;if(g<0){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=a+Math.PI*2);c=(b+a)/2;a=-Math.cos(c);c=-Math.sin(c);a=new THREE.Vector2(a,c)}else a=d.multiplyScalar(g).addSelf(h).subSelf(a).clone();return a}function e(c,d){var e,f;for(y=c.length;--y>=0;){e=y;f=y-1;f<0&&
-(f=c.length-1);for(var g=0,h=k+l*2,g=0;g<h;g++){var i=M*g,j=M*(g+1),n=d+e+i,i=d+f+i,m=d+f+j,j=d+e+j,p=c,q=g,o=h,r=e,t=f,n=n+E,i=i+E,m=m+E,j=j+E;B.faces.push(new THREE.Face4(n,i,m,j,null,null,s));n=v.generateSideWallUV(B,b,p,a,n,i,m,j,q,o,r,t);B.faceVertexUvs[0].push(n)}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c=c+E;d=d+E;e=e+E;B.faces.push(new THREE.Face3(c,d,e,null,null,t));c=f?v.generateBottomUV(B,b,a,c,d,e):v.generateTopUV(B,b,a,c,d,e);B.faceVertexUvs[0].push(c)}
-var h=a.amount!==void 0?a.amount:100,i=a.bevelThickness!==void 0?a.bevelThickness:6,j=a.bevelSize!==void 0?a.bevelSize:i-2,l=a.bevelSegments!==void 0?a.bevelSegments:3,n=a.bevelEnabled!==void 0?a.bevelEnabled:true,k=a.steps!==void 0?a.steps:1,m=a.bendPath,p=a.extrudePath,q,r=false,t=a.material,s=a.extrudeMaterial,v=a.UVGenerator!==void 0?a.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,o,x,z,A;if(p){q=p.getSpacedPoints(k);r=true;n=false;o=a.frames!==void 0?a.frames:new THREE.TubeGeometry.FrenetFrames(p,
-k,false);x=new THREE.Vector3;z=new THREE.Vector3;A=new THREE.Vector3}if(!n)j=i=l=0;var w,u,C,B=this,E=this.vertices.length;m&&b.addWrapPath(m);var p=b.extractPoints(),m=p.shape,G=p.holes;if(p=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();u=0;for(C=G.length;u<C;u++){w=G[u];THREE.Shape.Utils.isClockWise(w)&&(G[u]=w.reverse())}p=false}var L=THREE.Shape.Utils.triangulateShape(m,G),H=m;u=0;for(C=G.length;u<C;u++){w=G[u];m=m.concat(w)}var D,K,F,N,I,M=m.length,J,O=L.length,p=[],y=0;F=H.length;D=F-1;for(K=
-y+1;y<F;y++,D++,K++){D===F&&(D=0);K===F&&(K=0);p[y]=d(H[y],H[D],H[K])}var R=[],P,Q=p.concat();u=0;for(C=G.length;u<C;u++){w=G[u];P=[];y=0;F=w.length;D=F-1;for(K=y+1;y<F;y++,D++,K++){D===F&&(D=0);K===F&&(K=0);P[y]=d(w[y],w[D],w[K])}R.push(P);Q=Q.concat(P)}for(D=0;D<l;D++){F=D/l;N=i*(1-F);K=j*Math.sin(F*Math.PI/2);y=0;for(F=H.length;y<F;y++){I=c(H[y],p[y],K);f(I.x,I.y,-N)}u=0;for(C=G.length;u<C;u++){w=G[u];P=R[u];y=0;for(F=w.length;y<F;y++){I=c(w[y],P[y],K);f(I.x,I.y,-N)}}}K=j;for(y=0;y<M;y++){I=n?
+(f=c.length-1);for(var g=0,h=k+l*2,g=0;g<h;g++){var i=M*g,j=M*(g+1),n=d+e+i,i=d+f+i,m=d+f+j,j=d+e+j,p=c,q=g,o=h,r=e,s=f,n=n+E,i=i+E,m=m+E,j=j+E;B.faces.push(new THREE.Face4(n,i,m,j,null,null,t));n=w.generateSideWallUV(B,b,p,a,n,i,m,j,q,o,r,s);B.faceVertexUvs[0].push(n)}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c=c+E;d=d+E;e=e+E;B.faces.push(new THREE.Face3(c,d,e,null,null,s));c=f?w.generateBottomUV(B,b,a,c,d,e):w.generateTopUV(B,b,a,c,d,e);B.faceVertexUvs[0].push(c)}
+var h=a.amount!==void 0?a.amount:100,i=a.bevelThickness!==void 0?a.bevelThickness:6,j=a.bevelSize!==void 0?a.bevelSize:i-2,l=a.bevelSegments!==void 0?a.bevelSegments:3,n=a.bevelEnabled!==void 0?a.bevelEnabled:true,k=a.steps!==void 0?a.steps:1,m=a.bendPath,p=a.extrudePath,q,r=false,s=a.material,t=a.extrudeMaterial,w=a.UVGenerator!==void 0?a.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,o,x,z,A;if(p){q=p.getSpacedPoints(k);r=true;n=false;o=a.frames!==void 0?a.frames:new THREE.TubeGeometry.FrenetFrames(p,
+k,false);x=new THREE.Vector3;z=new THREE.Vector3;A=new THREE.Vector3}if(!n)j=i=l=0;var v,u,C,B=this,E=this.vertices.length;m&&b.addWrapPath(m);var p=b.extractPoints(),m=p.shape,G=p.holes;if(p=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();u=0;for(C=G.length;u<C;u++){v=G[u];THREE.Shape.Utils.isClockWise(v)&&(G[u]=v.reverse())}p=false}var L=THREE.Shape.Utils.triangulateShape(m,G),H=m;u=0;for(C=G.length;u<C;u++){v=G[u];m=m.concat(v)}var D,K,F,N,I,M=m.length,J,O=L.length,p=[],y=0;F=H.length;D=F-1;for(K=
+y+1;y<F;y++,D++,K++){D===F&&(D=0);K===F&&(K=0);p[y]=d(H[y],H[D],H[K])}var R=[],P,Q=p.concat();u=0;for(C=G.length;u<C;u++){v=G[u];P=[];y=0;F=v.length;D=F-1;for(K=y+1;y<F;y++,D++,K++){D===F&&(D=0);K===F&&(K=0);P[y]=d(v[y],v[D],v[K])}R.push(P);Q=Q.concat(P)}for(D=0;D<l;D++){F=D/l;N=i*(1-F);K=j*Math.sin(F*Math.PI/2);y=0;for(F=H.length;y<F;y++){I=c(H[y],p[y],K);f(I.x,I.y,-N)}u=0;for(C=G.length;u<C;u++){v=G[u];P=R[u];y=0;for(F=v.length;y<F;y++){I=c(v[y],P[y],K);f(I.x,I.y,-N)}}}K=j;for(y=0;y<M;y++){I=n?
 c(m[y],Q[y],K):m[y];if(r){z.copy(o.normals[0]).multiplyScalar(I.x);x.copy(o.binormals[0]).multiplyScalar(I.y);A.copy(q[0]).addSelf(z).addSelf(x);f(A.x,A.y,A.z)}else f(I.x,I.y,0)}for(F=1;F<=k;F++)for(y=0;y<M;y++){I=n?c(m[y],Q[y],K):m[y];if(r){z.copy(o.normals[F]).multiplyScalar(I.x);x.copy(o.binormals[F]).multiplyScalar(I.y);A.copy(q[F]).addSelf(z).addSelf(x);f(A.x,A.y,A.z)}else f(I.x,I.y,h/k*F)}for(D=l-1;D>=0;D--){F=D/l;N=i*(1-F);K=j*Math.sin(F*Math.PI/2);y=0;for(F=H.length;y<F;y++){I=c(H[y],p[y],
 c(m[y],Q[y],K):m[y];if(r){z.copy(o.normals[0]).multiplyScalar(I.x);x.copy(o.binormals[0]).multiplyScalar(I.y);A.copy(q[0]).addSelf(z).addSelf(x);f(A.x,A.y,A.z)}else f(I.x,I.y,0)}for(F=1;F<=k;F++)for(y=0;y<M;y++){I=n?c(m[y],Q[y],K):m[y];if(r){z.copy(o.normals[F]).multiplyScalar(I.x);x.copy(o.binormals[F]).multiplyScalar(I.y);A.copy(q[F]).addSelf(z).addSelf(x);f(A.x,A.y,A.z)}else f(I.x,I.y,h/k*F)}for(D=l-1;D>=0;D--){F=D/l;N=i*(1-F);K=j*Math.sin(F*Math.PI/2);y=0;for(F=H.length;y<F;y++){I=c(H[y],p[y],
-K);f(I.x,I.y,h+N)}u=0;for(C=G.length;u<C;u++){w=G[u];P=R[u];y=0;for(F=w.length;y<F;y++){I=c(w[y],P[y],K);r?f(I.x,I.y+q[k-1].y,q[k-1].x+N):f(I.x,I.y,h+N)}}}(function(){if(n){var a;a=M*0;for(y=0;y<O;y++){J=L[y];g(J[2]+a,J[1]+a,J[0]+a,true)}a=k+l*2;a=M*a;for(y=0;y<O;y++){J=L[y];g(J[0]+a,J[1]+a,J[2]+a,false)}}else{for(y=0;y<O;y++){J=L[y];g(J[2],J[1],J[0],true)}for(y=0;y<O;y++){J=L[y];g(J[0]+M*k,J[1]+M*k,J[2]+M*k,false)}}})();(function(){var a=0;e(H,a);a=a+H.length;u=0;for(C=G.length;u<C;u++){w=G[u];e(w,
-a);a=a+w.length}})()};
+K);f(I.x,I.y,h+N)}u=0;for(C=G.length;u<C;u++){v=G[u];P=R[u];y=0;for(F=v.length;y<F;y++){I=c(v[y],P[y],K);r?f(I.x,I.y+q[k-1].y,q[k-1].x+N):f(I.x,I.y,h+N)}}}(function(){if(n){var a;a=M*0;for(y=0;y<O;y++){J=L[y];g(J[2]+a,J[1]+a,J[0]+a,true)}a=k+l*2;a=M*a;for(y=0;y<O;y++){J=L[y];g(J[0]+a,J[1]+a,J[2]+a,false)}}else{for(y=0;y<O;y++){J=L[y];g(J[2],J[1],J[0],true)}for(y=0;y<O;y++){J=L[y];g(J[0]+M*k,J[1]+M*k,J[2]+M*k,false)}}})();(function(){var a=0;e(H,a);a=a+H.length;u=0;for(C=G.length;u<C;u++){v=G[u];e(v,
+a);a=a+v.length}})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(b,a,c,d,e,f){a=b.vertices[e].x;e=b.vertices[e].y;c=b.vertices[f].x;f=b.vertices[f].y;return[new THREE.UV(b.vertices[d].x,1-b.vertices[d].y),new THREE.UV(a,1-e),new THREE.UV(c,1-f)]},generateBottomUV:function(b,a,c,d,e,f){return this.generateTopUV(b,a,c,d,e,f)},generateSideWallUV:function(b,a,c,d,e,f,g,h){var a=b.vertices[e].x,c=b.vertices[e].y,e=b.vertices[e].z,d=b.vertices[f].x,i=b.vertices[f].y,f=b.vertices[f].z,j=b.vertices[g].x,l=
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(b,a,c,d,e,f){a=b.vertices[e].x;e=b.vertices[e].y;c=b.vertices[f].x;f=b.vertices[f].y;return[new THREE.UV(b.vertices[d].x,1-b.vertices[d].y),new THREE.UV(a,1-e),new THREE.UV(c,1-f)]},generateBottomUV:function(b,a,c,d,e,f){return this.generateTopUV(b,a,c,d,e,f)},generateSideWallUV:function(b,a,c,d,e,f,g,h){var a=b.vertices[e].x,c=b.vertices[e].y,e=b.vertices[e].z,d=b.vertices[f].x,i=b.vertices[f].y,f=b.vertices[f].z,j=b.vertices[g].x,l=
 b.vertices[g].y,g=b.vertices[g].z,n=b.vertices[h].x,k=b.vertices[h].y,b=b.vertices[h].z;return Math.abs(c-i)<0.01?[new THREE.UV(a,e),new THREE.UV(d,f),new THREE.UV(j,g),new THREE.UV(n,b)]:[new THREE.UV(c,e),new THREE.UV(i,f),new THREE.UV(l,g),new THREE.UV(k,b)]}};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;
 b.vertices[g].y,g=b.vertices[g].z,n=b.vertices[h].x,k=b.vertices[h].y,b=b.vertices[h].z;return Math.abs(c-i)<0.01?[new THREE.UV(a,e),new THREE.UV(d,f),new THREE.UV(j,g),new THREE.UV(n,b)]:[new THREE.UV(c,e),new THREE.UV(i,f),new THREE.UV(l,g),new THREE.UV(k,b)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
@@ -196,17 +199,10 @@ THREE.LatheGeometry=function(b,a,c){THREE.Geometry.call(this);for(var a=a||12,c=
 THREE.PlaneGeometry=function(b,a,c,d){THREE.Geometry.call(this);for(var e=b/2,f=a/2,c=c||1,d=d||1,g=c+1,h=d+1,i=b/c,j=a/d,l=new THREE.Vector3(0,1,0),b=0;b<h;b++)for(a=0;a<g;a++)this.vertices.push(new THREE.Vector3(a*i-e,0,b*j-f));for(b=0;b<d;b++)for(a=0;a<c;a++){e=new THREE.Face4(a+g*b,a+g*(b+1),a+1+g*(b+1),a+1+g*b);e.normal.copy(l);e.vertexNormals.push(l.clone(),l.clone(),l.clone(),l.clone());this.faces.push(e);this.faceVertexUvs[0].push([new THREE.UV(a/c,b/d),new THREE.UV(a/c,(b+1)/d),new THREE.UV((a+
 THREE.PlaneGeometry=function(b,a,c,d){THREE.Geometry.call(this);for(var e=b/2,f=a/2,c=c||1,d=d||1,g=c+1,h=d+1,i=b/c,j=a/d,l=new THREE.Vector3(0,1,0),b=0;b<h;b++)for(a=0;a<g;a++)this.vertices.push(new THREE.Vector3(a*i-e,0,b*j-f));for(b=0;b<d;b++)for(a=0;a<c;a++){e=new THREE.Face4(a+g*b,a+g*(b+1),a+1+g*(b+1),a+1+g*b);e.normal.copy(l);e.vertexNormals.push(l.clone(),l.clone(),l.clone(),l.clone());this.faces.push(e);this.faceVertexUvs[0].push([new THREE.UV(a/c,b/d),new THREE.UV(a/c,(b+1)/d),new THREE.UV((a+
 1)/c,(b+1)/d),new THREE.UV((a+1)/c,b/d)])}this.computeCentroids()};THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
 1)/c,(b+1)/d),new THREE.UV((a+1)/c,b/d)])}this.computeCentroids()};THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
 THREE.SphereGeometry=function(b,a,c,d,e,f,g){THREE.Geometry.call(this);var b=b||50,d=d!==void 0?d:0,e=e!==void 0?e:Math.PI*2,f=f!==void 0?f:0,g=g!==void 0?g:Math.PI,a=Math.max(3,Math.floor(a)||8),c=Math.max(2,Math.floor(c)||6),h,i,j=[],l=[];for(i=0;i<=c;i++){var n=[],k=[];for(h=0;h<=a;h++){var m=h/a,p=i/c,q=new THREE.Vector3;q.x=-b*Math.cos(d+m*e)*Math.sin(f+p*g);q.y=b*Math.cos(f+p*g);q.z=b*Math.sin(d+m*e)*Math.sin(f+p*g);this.vertices.push(q);n.push(this.vertices.length-1);k.push(new THREE.UV(m,
 THREE.SphereGeometry=function(b,a,c,d,e,f,g){THREE.Geometry.call(this);var b=b||50,d=d!==void 0?d:0,e=e!==void 0?e:Math.PI*2,f=f!==void 0?f:0,g=g!==void 0?g:Math.PI,a=Math.max(3,Math.floor(a)||8),c=Math.max(2,Math.floor(c)||6),h,i,j=[],l=[];for(i=0;i<=c;i++){var n=[],k=[];for(h=0;h<=a;h++){var m=h/a,p=i/c,q=new THREE.Vector3;q.x=-b*Math.cos(d+m*e)*Math.sin(f+p*g);q.y=b*Math.cos(f+p*g);q.z=b*Math.sin(d+m*e)*Math.sin(f+p*g);this.vertices.push(q);n.push(this.vertices.length-1);k.push(new THREE.UV(m,
-p))}j.push(n);l.push(k)}for(i=0;i<c;i++)for(h=0;h<a;h++){var d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1],n=this.vertices[d].clone().normalize(),k=this.vertices[e].clone().normalize(),m=this.vertices[f].clone().normalize(),p=this.vertices[g].clone().normalize(),q=l[i][h+1].clone(),r=l[i][h].clone(),t=l[i+1][h].clone(),s=l[i+1][h+1].clone();if(Math.abs(this.vertices[d].y)==b){this.faces.push(new THREE.Face3(d,f,g,[n,m,p]));this.faceVertexUvs[0].push([q,t,s])}else if(Math.abs(this.vertices[f].y)==
-b){this.faces.push(new THREE.Face3(d,e,f,[n,k,m]));this.faceVertexUvs[0].push([q,r,t])}else{this.faces.push(new THREE.Face4(d,e,f,g,[n,k,m,p]));this.faceVertexUvs[0].push([q,r,t,s])}}this.computeCentroids();this.computeFaceNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
-THREE.TextGeometry=function(b,a){var c=(new THREE.TextPath(b,a)).toShapes();a.amount=a.height!==void 0?a.height:50;if(a.bevelThickness===void 0)a.bevelThickness=10;if(a.bevelSize===void 0)a.bevelSize=8;if(a.bevelEnabled===void 0)a.bevelEnabled=false;if(a.bend){var d=c[c.length-1].getBoundingBox().maxX;a.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(d/2,120),new THREE.Vector2(d,0))}THREE.ExtrudeGeometry.call(this,c,a)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
+p))}j.push(n);l.push(k)}for(i=0;i<c;i++)for(h=0;h<a;h++){var d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1],n=this.vertices[d].clone().normalize(),k=this.vertices[e].clone().normalize(),m=this.vertices[f].clone().normalize(),p=this.vertices[g].clone().normalize(),q=l[i][h+1].clone(),r=l[i][h].clone(),s=l[i+1][h].clone(),t=l[i+1][h+1].clone();if(Math.abs(this.vertices[d].y)==b){this.faces.push(new THREE.Face3(d,f,g,[n,m,p]));this.faceVertexUvs[0].push([q,s,t])}else if(Math.abs(this.vertices[f].y)==
+b){this.faces.push(new THREE.Face3(d,e,f,[n,k,m]));this.faceVertexUvs[0].push([q,r,s])}else{this.faces.push(new THREE.Face4(d,e,f,g,[n,k,m,p]));this.faceVertexUvs[0].push([q,r,s,t])}}this.computeCentroids();this.computeFaceNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
+THREE.TextGeometry=function(b,a){var c=THREE.FontUtils.generateShapes(b,a);a.amount=a.height!==void 0?a.height:50;if(a.bevelThickness===void 0)a.bevelThickness=10;if(a.bevelSize===void 0)a.bevelSize=8;if(a.bevelEnabled===void 0)a.bevelEnabled=false;if(a.bend){var d=c[c.length-1].getBoundingBox().maxX;a.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(d/2,120),new THREE.Vector2(d,0))}THREE.ExtrudeGeometry.call(this,c,a)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
-THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(b){var a=b.familyName.toLowerCase();this.faces[a]=this.faces[a]||{};this.faces[a][b.cssFontWeight]=this.faces[a][b.cssFontWeight]||{};this.faces[a][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[a][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var a=this.getFace(),c=this.size/a.resolution,d=
-0,e=(""+b).split(""),f=e.length,g=[],b=0;b<f;b++){var h=new THREE.Path,h=this.extractGlyphPoints(e[b],a,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(b,a,c,d,e){var f=[],g,h,i,j,l,n,k,m,p,q,r,t=a.glyphs[b]||a.glyphs["?"];if(t){if(t.o){a=t._cachedOutline||(t._cachedOutline=t.o.split(" "));j=a.length;for(b=0;b<j;){i=a[b++];switch(i){case "m":i=a[b++]*c+d;l=a[b++]*c;f.push(new THREE.Vector2(i,l));e.moveTo(i,l);break;case "l":i=a[b++]*c+d;l=a[b++]*c;f.push(new THREE.Vector2(i,
-l));e.lineTo(i,l);break;case "q":i=a[b++]*c+d;l=a[b++]*c;m=a[b++]*c+d;p=a[b++]*c;e.quadraticCurveTo(m,p,i,l);if(g=f[f.length-1]){n=g.x;k=g.y;g=1;for(h=this.divisions;g<=h;g++){var s=g/h,v=THREE.Shape.Utils.b2(s,n,m,i),s=THREE.Shape.Utils.b2(s,k,p,l);f.push(new THREE.Vector2(v,s))}}break;case "b":i=a[b++]*c+d;l=a[b++]*c;m=a[b++]*c+d;p=a[b++]*-c;q=a[b++]*c+d;r=a[b++]*-c;e.bezierCurveTo(i,l,m,p,q,r);if(g=f[f.length-1]){n=g.x;k=g.y;g=1;for(h=this.divisions;g<=h;g++){s=g/h;v=THREE.Shape.Utils.b3(s,n,m,
-q,i);s=THREE.Shape.Utils.b3(s,k,p,r,l);f.push(new THREE.Vector2(v,s))}}}}}return{offset:t.ha*c,points:f,path:e}}}};
-(function(b){var a=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e=e+(a[f].x*a[g].y-a[g].x*a[f].y);return e*0.5};b.Triangulate=function(b,d){var e=b.length;if(e<3)return null;var f=[],g=[],h=[],i,j,l;if(a(b)>0)for(j=0;j<e;j++)g[j]=j;else for(j=0;j<e;j++)g[j]=e-1-j;var n=2*e;for(j=e-1;e>2;){if(n--<=0){console.log("Warning, unable to triangulate polygon!");break}i=j;e<=i&&(i=0);j=i+1;e<=j&&(j=0);l=j+1;e<=l&&(l=0);var k;a:{k=b;var m=i,p=j,q=l,r=e,t=g,s=void 0,v=void 0,o=void 0,x=void 0,z=void 0,
-A=void 0,w=void 0,u=void 0,C=void 0,v=k[t[m]].x,o=k[t[m]].y,x=k[t[p]].x,z=k[t[p]].y,A=k[t[q]].x,w=k[t[q]].y;if(1.0E-10>(x-v)*(w-o)-(z-o)*(A-v))k=false;else{for(s=0;s<r;s++)if(!(s==m||s==p||s==q)){var u=k[t[s]].x,C=k[t[s]].y,B=void 0,E=void 0,G=void 0,L=void 0,H=void 0,D=void 0,K=void 0,F=void 0,N=void 0,I=void 0,M=void 0,J=void 0,B=G=H=void 0,B=A-x,E=w-z,G=v-A,L=o-w,H=x-v,D=z-o,K=u-v,F=C-o,N=u-x,I=C-z,M=u-A,J=C-w,B=B*I-E*N,H=H*F-D*K,G=G*J-L*M;if(B>=0&&G>=0&&H>=0){k=false;break a}}k=true}}if(k){f.push([b[g[i]],
-b[g[j]],b[g[l]]]);h.push([g[i],g[j],g[l]]);i=j;for(l=j+1;l<e;i++,l++)g[i]=g[l];e--;n=2*e}}return d?h:f};b.Triangulate.area=a;return b})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 THREE.TorusGeometry=function(b,a,c,d,e){THREE.Geometry.call(this);this.radius=b||100;this.tube=a||40;this.segmentsR=c||8;this.segmentsT=d||6;this.arc=e||Math.PI*2;e=new THREE.Vector3;b=[];a=[];for(c=0;c<=this.segmentsR;c++)for(d=0;d<=this.segmentsT;d++){var f=d/this.segmentsT*this.arc,g=c/this.segmentsR*Math.PI*2;e.x=this.radius*Math.cos(f);e.y=this.radius*Math.sin(f);var h=new THREE.Vector3;h.x=(this.radius+this.tube*Math.cos(g))*Math.cos(f);h.y=(this.radius+this.tube*Math.cos(g))*Math.sin(f);h.z=
 THREE.TorusGeometry=function(b,a,c,d,e){THREE.Geometry.call(this);this.radius=b||100;this.tube=a||40;this.segmentsR=c||8;this.segmentsT=d||6;this.arc=e||Math.PI*2;e=new THREE.Vector3;b=[];a=[];for(c=0;c<=this.segmentsR;c++)for(d=0;d<=this.segmentsT;d++){var f=d/this.segmentsT*this.arc,g=c/this.segmentsR*Math.PI*2;e.x=this.radius*Math.cos(f);e.y=this.radius*Math.sin(f);var h=new THREE.Vector3;h.x=(this.radius+this.tube*Math.cos(g))*Math.cos(f);h.y=(this.radius+this.tube*Math.cos(g))*Math.sin(f);h.z=
 this.tube*Math.sin(g);this.vertices.push(h);b.push(new THREE.UV(d/this.segmentsT,1-c/this.segmentsR));a.push(h.clone().subSelf(e).normalize())}for(c=1;c<=this.segmentsR;c++)for(d=1;d<=this.segmentsT;d++){var e=(this.segmentsT+1)*c+d-1,f=(this.segmentsT+1)*(c-1)+d-1,g=(this.segmentsT+1)*(c-1)+d,h=(this.segmentsT+1)*c+d,i=new THREE.Face4(e,f,g,h,[a[e],a[f],a[g],a[h]]);i.normal.addSelf(a[e]);i.normal.addSelf(a[f]);i.normal.addSelf(a[g]);i.normal.addSelf(a[h]);i.normal.normalize();this.faces.push(i);
 this.tube*Math.sin(g);this.vertices.push(h);b.push(new THREE.UV(d/this.segmentsT,1-c/this.segmentsR));a.push(h.clone().subSelf(e).normalize())}for(c=1;c<=this.segmentsR;c++)for(d=1;d<=this.segmentsT;d++){var e=(this.segmentsT+1)*c+d-1,f=(this.segmentsT+1)*(c-1)+d-1,g=(this.segmentsT+1)*(c-1)+d,h=(this.segmentsT+1)*c+d,i=new THREE.Face4(e,f,g,h,[a[e],a[f],a[g],a[h]]);i.normal.addSelf(a[e]);i.normal.addSelf(a[f]);i.normal.addSelf(a[g]);i.normal.addSelf(a[h]);i.normal.normalize();this.faces.push(i);
 this.faceVertexUvs[0].push([b[e].clone(),b[f].clone(),b[g].clone(),b[h].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
 this.faceVertexUvs[0].push([b[e].clone(),b[f].clone(),b[g].clone(),b[h].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
@@ -228,8 +224,8 @@ THREE.OctahedronGeometry=function(b,a){THREE.PolyhedronGeometry.call(this,[[1,0,
 THREE.TetrahedronGeometry.prototype=new THREE.Geometry;THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;
 THREE.TetrahedronGeometry.prototype=new THREE.Geometry;THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;
 THREE.ParametricGeometry=function(b,a,c,d){THREE.Geometry.call(this);var e=this.vertices,f=this.faces,g=this.faceVertexUvs[0],d=d===void 0?false:d,h,i,j,l,n=a+1;for(h=0;h<=c;h++){l=h/c;for(i=0;i<=a;i++){j=i/a;j=b(j,l);e.push(j)}}var k,m,p,q;for(h=0;h<c;h++)for(i=0;i<a;i++){b=h*n+i;e=h*n+i+1;l=(h+1)*n+i;j=(h+1)*n+i+1;k=new THREE.UV(i/a,h/c);m=new THREE.UV((i+1)/a,h/c);p=new THREE.UV(i/a,(h+1)/c);q=new THREE.UV((i+1)/a,(h+1)/c);if(d){f.push(new THREE.Face3(b,e,l));f.push(new THREE.Face3(e,j,l));g.push([k,
 THREE.ParametricGeometry=function(b,a,c,d){THREE.Geometry.call(this);var e=this.vertices,f=this.faces,g=this.faceVertexUvs[0],d=d===void 0?false:d,h,i,j,l,n=a+1;for(h=0;h<=c;h++){l=h/c;for(i=0;i<=a;i++){j=i/a;j=b(j,l);e.push(j)}}var k,m,p,q;for(h=0;h<c;h++)for(i=0;i<a;i++){b=h*n+i;e=h*n+i+1;l=(h+1)*n+i;j=(h+1)*n+i+1;k=new THREE.UV(i/a,h/c);m=new THREE.UV((i+1)/a,h/c);p=new THREE.UV(i/a,(h+1)/c);q=new THREE.UV((i+1)/a,(h+1)/c);if(d){f.push(new THREE.Face3(b,e,l));f.push(new THREE.Face3(e,j,l));g.push([k,
 m,p]);g.push([m,q,p])}else{f.push(new THREE.Face4(b,e,j,l));g.push([k,m,q,p])}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=new THREE.Geometry;THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
 m,p]);g.push([m,q,p])}else{f.push(new THREE.Face4(b,e,j,l));g.push([k,m,q,p])}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=new THREE.Geometry;THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
-THREE.ConvexGeometry=function(b){function a(a){var d=b[a].clone(),f=d.length();d.x=d.x+f*c();d.y=d.y+f*c();d.z=d.z+f*c();for(var f=[],g=0;g<e.length;){var h=e[g],i=d,j=b[h[0]],t;t=j;var s=b[h[1]],v=b[h[2]],o=new THREE.Vector3,x=new THREE.Vector3;o.sub(v,s);x.sub(t,s);o.crossSelf(x);o.isZero()||o.normalize();t=o;j=t.dot(j);if(t.dot(i)>=j){for(i=0;i<3;i++){j=[h[i],h[(i+1)%3]];t=true;for(s=0;s<f.length;s++)if(f[s][0]===j[1]&&f[s][1]===j[0]){f[s]=f[f.length-1];f.pop();t=false;break}t&&f.push(j)}e[g]=
-e[e.length-1];e.pop()}else g++}for(s=0;s<f.length;s++)e.push([f[s][0],f[s][1],a])}function c(){return(Math.random()-0.5)*2.0E-6}function d(a){var b=a.length();return new THREE.UV(a.x/b,a.y/b)}THREE.Geometry.call(this);for(var e=[[0,1,2],[0,2,1]],f=3;f<b.length;f++)a(f);for(var g=0,h=Array(b.length),f=0;f<e.length;f++)for(var i=e[f],j=0;j<3;j++){if(h[i[j]]===void 0){h[i[j]]=g++;this.vertices.push(b[i[j]])}i[j]=h[i[j]]}for(f=0;f<e.length;f++)this.faces.push(new THREE.Face3(e[f][0],e[f][1],e[f][2]));
+THREE.ConvexGeometry=function(b){function a(a){var d=b[a].clone(),f=d.length();d.x=d.x+f*c();d.y=d.y+f*c();d.z=d.z+f*c();for(var f=[],g=0;g<e.length;){var h=e[g],i=d,j=b[h[0]],s;s=j;var t=b[h[1]],w=b[h[2]],o=new THREE.Vector3,x=new THREE.Vector3;o.sub(w,t);x.sub(s,t);o.crossSelf(x);o.isZero()||o.normalize();s=o;j=s.dot(j);if(s.dot(i)>=j){for(i=0;i<3;i++){j=[h[i],h[(i+1)%3]];s=true;for(t=0;t<f.length;t++)if(f[t][0]===j[1]&&f[t][1]===j[0]){f[t]=f[f.length-1];f.pop();s=false;break}s&&f.push(j)}e[g]=
+e[e.length-1];e.pop()}else g++}for(t=0;t<f.length;t++)e.push([f[t][0],f[t][1],a])}function c(){return(Math.random()-0.5)*2.0E-6}function d(a){var b=a.length();return new THREE.UV(a.x/b,a.y/b)}THREE.Geometry.call(this);for(var e=[[0,1,2],[0,2,1]],f=3;f<b.length;f++)a(f);for(var g=0,h=Array(b.length),f=0;f<e.length;f++)for(var i=e[f],j=0;j<3;j++){if(h[i[j]]===void 0){h[i[j]]=g++;this.vertices.push(b[i[j]])}i[j]=h[i[j]]}for(f=0;f<e.length;f++)this.faces.push(new THREE.Face3(e[f][0],e[f][1],e[f][2]));
 for(f=0;f<this.faces.length;f++){i=this.faces[f];this.faceVertexUvs[0].push([d(this.vertices[i.a]),d(this.vertices[i.b]),d(this.vertices[i.c])])}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.ConvexGeometry.prototype=new THREE.Geometry;THREE.ConvexGeometry.prototype.constructor=THREE.ConvexGeometry;
 for(f=0;f<this.faces.length;f++){i=this.faces[f];this.faceVertexUvs[0].push([d(this.vertices[i.a]),d(this.vertices[i.b]),d(this.vertices[i.c])])}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.ConvexGeometry.prototype=new THREE.Geometry;THREE.ConvexGeometry.prototype.constructor=THREE.ConvexGeometry;
 THREE.AxisHelper=function(){THREE.Object3D.call(this);var b=new THREE.Geometry;b.vertices.push(new THREE.Vector3);b.vertices.push(new THREE.Vector3(0,100,0));var a=new THREE.CylinderGeometry(0,5,25,5,1),c;c=new THREE.Line(b,new THREE.LineBasicMaterial({color:16711680}));c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Mesh(a,new THREE.MeshBasicMaterial({color:16711680}));c.position.x=100;c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Line(b,new THREE.LineBasicMaterial({color:65280}));this.add(c);
 THREE.AxisHelper=function(){THREE.Object3D.call(this);var b=new THREE.Geometry;b.vertices.push(new THREE.Vector3);b.vertices.push(new THREE.Vector3(0,100,0));var a=new THREE.CylinderGeometry(0,5,25,5,1),c;c=new THREE.Line(b,new THREE.LineBasicMaterial({color:16711680}));c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Mesh(a,new THREE.MeshBasicMaterial({color:16711680}));c.position.x=100;c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Line(b,new THREE.LineBasicMaterial({color:65280}));this.add(c);
 c=new THREE.Mesh(a,new THREE.MeshBasicMaterial({color:65280}));c.position.y=100;this.add(c);c=new THREE.Line(b,new THREE.LineBasicMaterial({color:255}));c.rotation.x=Math.PI/2;this.add(c);c=new THREE.Mesh(a,new THREE.MeshBasicMaterial({color:255}));c.position.z=100;c.rotation.x=Math.PI/2;this.add(c)};THREE.AxisHelper.prototype=new THREE.Object3D;THREE.AxisHelper.prototype.constructor=THREE.AxisHelper;
 c=new THREE.Mesh(a,new THREE.MeshBasicMaterial({color:65280}));c.position.y=100;this.add(c);c=new THREE.Line(b,new THREE.LineBasicMaterial({color:255}));c.rotation.x=Math.PI/2;this.add(c);c=new THREE.Mesh(a,new THREE.MeshBasicMaterial({color:255}));c.position.z=100;c.rotation.x=Math.PI/2;this.add(c)};THREE.AxisHelper.prototype=new THREE.Object3D;THREE.AxisHelper.prototype.constructor=THREE.AxisHelper;
@@ -243,15 +239,15 @@ THREE.CameraHelper.prototype.update=function(){function b(b,d,e,f){THREE.CameraH
 1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,-1);b("u2",-0.7,1.1,-1);b("u3",0,2,-1);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,-1);b("cn2",1,0,-1);b("cn3",0,-1,-1);b("cn4",0,1,-1);this.lineGeometry.verticesNeedUpdate=true};THREE.CameraHelper.__projector=new THREE.Projector;THREE.CameraHelper.__v=new THREE.Vector3;THREE.CameraHelper.__c=new THREE.Camera;
 1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,-1);b("u2",-0.7,1.1,-1);b("u3",0,2,-1);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,-1);b("cn2",1,0,-1);b("cn3",0,-1,-1);b("cn4",0,1,-1);this.lineGeometry.verticesNeedUpdate=true};THREE.CameraHelper.__projector=new THREE.Projector;THREE.CameraHelper.__v=new THREE.Vector3;THREE.CameraHelper.__c=new THREE.Camera;
 THREE.SubdivisionModifier=function(b){this.subdivisions=b===void 0?1:b;this.useOldVertexColors=false;this.supportUVs=true;this.debug=false};THREE.SubdivisionModifier.prototype.constructor=THREE.SubdivisionModifier;THREE.SubdivisionModifier.prototype.modify=function(b){for(var a=this.subdivisions;a-- >0;)this.smooth(b)};
 THREE.SubdivisionModifier=function(b){this.subdivisions=b===void 0?1:b;this.useOldVertexColors=false;this.supportUVs=true;this.debug=false};THREE.SubdivisionModifier.prototype.constructor=THREE.SubdivisionModifier;THREE.SubdivisionModifier.prototype.modify=function(b){for(var a=this.subdivisions;a-- >0;)this.smooth(b)};
 THREE.SubdivisionModifier.prototype.smooth=function(b){function a(){k.debug&&console.log.apply(console,arguments)}function c(){console&&console.log.apply(console,arguments)}function d(b,c,d,e,g,h,i){var j=new THREE.Face4(b,c,d,e,null,g.color,g.materialIndex);if(k.useOldVertexColors){j.vertexColors=[];for(var m,p,o,q=0;q<4;q++){o=h[q];m=new THREE.Color;m.setRGB(0,0,0);for(var r=0;r<o.length;r++){p=g.vertexColors[o[r]-1];m.r=m.r+p.r;m.g=m.g+p.g;m.b=m.b+p.b}m.r=m.r/o.length;m.g=m.g/o.length;m.b=m.b/
 THREE.SubdivisionModifier.prototype.smooth=function(b){function a(){k.debug&&console.log.apply(console,arguments)}function c(){console&&console.log.apply(console,arguments)}function d(b,c,d,e,g,h,i){var j=new THREE.Face4(b,c,d,e,null,g.color,g.materialIndex);if(k.useOldVertexColors){j.vertexColors=[];for(var m,p,o,q=0;q<4;q++){o=h[q];m=new THREE.Color;m.setRGB(0,0,0);for(var r=0;r<o.length;r++){p=g.vertexColors[o[r]-1];m.r=m.r+p.r;m.g=m.g+p.g;m.b=m.b+p.b}m.r=m.r/o.length;m.g=m.g/o.length;m.b=m.b/
-o.length;j.vertexColors[q]=m}}l.push(j);if(k.supportUVs){g=[f(b,""),f(c,i),f(d,i),f(e,i)];g[0]?g[1]?g[2]?g[3]?n.push(g):a("d :( ",e+":"+i):a("c :( ",d+":"+i):a("b :( ",c+":"+i):a("a :( ",b+":"+i)}}function e(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}function f(b,d){var e=b+":"+d,f=s[e];if(!f){b>=v&&b<v+p.length?a("face pt"):a("edge pt");c("warning, UV not found for",e);return null}return f}function g(a,b,d){var e=a+":"+b;e in s?c("dup vertexNo",a,"oldFaceNo",b,"value",d,"key",e,s[e]):s[e]=d}function h(a,
-b){G[a]===void 0&&(G[a]=[]);G[a].push(b)}function i(a,b,c){L[a]===void 0&&(L[a]={});L[a][b]=c}var j=[],l=[],n=[],k=this,m=b.vertices,p=b.faces,j=m.concat(),q=[],r={},t={},s={},v=m.length,o,x,z,A,w,u=b.faceVertexUvs[0],C;a("originalFaces, uvs, originalVerticesLength",p.length,u.length,v);if(k.supportUVs){o=0;for(x=u.length;o<x;o++){z=0;for(A=u[o].length;z<A;z++){C=p[o]["abcd".charAt(z)];g(C,o,u[o][z])}}}if(u.length==0)k.supportUVs=false;o=0;for(w in s)o++;if(!o){k.supportUVs=false;a("no uvs")}a("-- Original Faces + Vertices UVs completed",
-s,"vs",u.length);o=0;for(x=p.length;o<x;o++){w=p[o];q.push(w.centroid);j.push(w.centroid);if(k.supportUVs){u=new THREE.UV;if(w instanceof THREE.Face3){u.u=f(w.a,o).u+f(w.b,o).u+f(w.c,o).u;u.v=f(w.a,o).v+f(w.b,o).v+f(w.c,o).v;u.u=u.u/3;u.v=u.v/3}else if(w instanceof THREE.Face4){u.u=f(w.a,o).u+f(w.b,o).u+f(w.c,o).u+f(w.d,o).u;u.v=f(w.a,o).v+f(w.b,o).v+f(w.c,o).v+f(w.d,o).v;u.u=u.u/4;u.v=u.v/4}g(v+o,"",u)}}a("-- added UVs for new Faces",s);x=function(a){function b(a,c){h[a]===void 0&&(h[a]=[]);h[a].push(c)}
-var c,d,f,g,h={};c=0;for(d=a.faces.length;c<d;c++){f=a.faces[c];if(f instanceof THREE.Face3){g=e(f.a,f.b);b(g,c);g=e(f.b,f.c);b(g,c);g=e(f.c,f.a);b(g,c)}else if(f instanceof THREE.Face4){g=e(f.a,f.b);b(g,c);g=e(f.b,f.c);b(g,c);g=e(f.c,f.d);b(g,c);g=e(f.d,f.a);b(g,c)}}return h}(b);C=0;var B,E,G={},L={};for(o in x){u=x[o];B=o.split("_");E=B[0];B=B[1];h(E,[E,B]);h(B,[E,B]);z=0;for(A=u.length;z<A;z++){w=u[z];i(E,w,o);i(B,w,o)}u.length<2&&(t[o]=true)}a("vertexEdgeMap",G,"vertexFaceMap",L);for(o in x){u=
-x[o];w=u[0];A=u[1];B=o.split("_");E=B[0];B=B[1];u=new THREE.Vector3;if(t[o]){u.addSelf(m[E]);u.addSelf(m[B]);u.multiplyScalar(0.5)}else{u.addSelf(q[w]);u.addSelf(q[A]);u.addSelf(m[E]);u.addSelf(m[B]);u.multiplyScalar(0.25)}r[o]=v+p.length+C;j.push(u);C++;if(k.supportUVs){u=new THREE.UV;u.u=f(E,w).u+f(B,w).u;u.v=f(E,w).v+f(B,w).v;u.u=u.u/2;u.v=u.v/2;g(r[o],w,u);if(!t[o]){u=new THREE.UV;u.u=f(E,A).u+f(B,A).u;u.v=f(E,A).v+f(B,A).v;u.u=u.u/2;u.v=u.v/2;g(r[o],A,u)}}}a("-- Step 2 done");var H,D;A=["123",
-"12","2","23"];B=["123","23","3","31"];var K=["123","31","1","12"],F=["1234","12","2","23"],N=["1234","23","3","34"],I=["1234","34","4","41"],M=["1234","41","1","12"];o=0;for(x=q.length;o<x;o++){w=p[o];u=v+o;if(w instanceof THREE.Face3){C=e(w.a,w.b);E=e(w.b,w.c);H=e(w.c,w.a);d(u,r[C],w.b,r[E],w,A,o);d(u,r[E],w.c,r[H],w,B,o);d(u,r[H],w.a,r[C],w,K,o)}else if(w instanceof THREE.Face4){C=e(w.a,w.b);E=e(w.b,w.c);H=e(w.c,w.d);D=e(w.d,w.a);d(u,r[C],w.b,r[E],w,F,o);d(u,r[E],w.c,r[H],w,N,o);d(u,r[H],w.d,r[D],
-w,I,o);d(u,r[D],w.a,r[C],w,M,o)}else a("face should be a face!",w)}r=new THREE.Vector3;w=new THREE.Vector3;o=0;for(x=m.length;o<x;o++)if(G[o]!==void 0){r.set(0,0,0);w.set(0,0,0);E=new THREE.Vector3(0,0,0);u=0;for(z in L[o]){r.addSelf(q[z]);u++}A=0;C=G[o].length;for(z=0;z<C;z++)t[e(G[o][z][0],G[o][z][1])]&&A++;if(A!=2){r.divideScalar(u);for(z=0;z<C;z++){u=G[o][z];u=m[u[0]].clone().addSelf(m[u[1]]).divideScalar(2);w.addSelf(u)}w.divideScalar(C);E.addSelf(m[o]);E.multiplyScalar(C-3);E.addSelf(r);E.addSelf(w.multiplyScalar(2));
+o.length;j.vertexColors[q]=m}}l.push(j);if(k.supportUVs){g=[f(b,""),f(c,i),f(d,i),f(e,i)];g[0]?g[1]?g[2]?g[3]?n.push(g):a("d :( ",e+":"+i):a("c :( ",d+":"+i):a("b :( ",c+":"+i):a("a :( ",b+":"+i)}}function e(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}function f(b,d){var e=b+":"+d,f=t[e];if(!f){b>=w&&b<w+p.length?a("face pt"):a("edge pt");c("warning, UV not found for",e);return null}return f}function g(a,b,d){var e=a+":"+b;e in t?c("dup vertexNo",a,"oldFaceNo",b,"value",d,"key",e,t[e]):t[e]=d}function h(a,
+b){G[a]===void 0&&(G[a]=[]);G[a].push(b)}function i(a,b,c){L[a]===void 0&&(L[a]={});L[a][b]=c}var j=[],l=[],n=[],k=this,m=b.vertices,p=b.faces,j=m.concat(),q=[],r={},s={},t={},w=m.length,o,x,z,A,v,u=b.faceVertexUvs[0],C;a("originalFaces, uvs, originalVerticesLength",p.length,u.length,w);if(k.supportUVs){o=0;for(x=u.length;o<x;o++){z=0;for(A=u[o].length;z<A;z++){C=p[o]["abcd".charAt(z)];g(C,o,u[o][z])}}}if(u.length==0)k.supportUVs=false;o=0;for(v in t)o++;if(!o){k.supportUVs=false;a("no uvs")}a("-- Original Faces + Vertices UVs completed",
+t,"vs",u.length);o=0;for(x=p.length;o<x;o++){v=p[o];q.push(v.centroid);j.push(v.centroid);if(k.supportUVs){u=new THREE.UV;if(v instanceof THREE.Face3){u.u=f(v.a,o).u+f(v.b,o).u+f(v.c,o).u;u.v=f(v.a,o).v+f(v.b,o).v+f(v.c,o).v;u.u=u.u/3;u.v=u.v/3}else if(v instanceof THREE.Face4){u.u=f(v.a,o).u+f(v.b,o).u+f(v.c,o).u+f(v.d,o).u;u.v=f(v.a,o).v+f(v.b,o).v+f(v.c,o).v+f(v.d,o).v;u.u=u.u/4;u.v=u.v/4}g(w+o,"",u)}}a("-- added UVs for new Faces",t);x=function(a){function b(a,c){h[a]===void 0&&(h[a]=[]);h[a].push(c)}
+var c,d,f,g,h={};c=0;for(d=a.faces.length;c<d;c++){f=a.faces[c];if(f instanceof THREE.Face3){g=e(f.a,f.b);b(g,c);g=e(f.b,f.c);b(g,c);g=e(f.c,f.a);b(g,c)}else if(f instanceof THREE.Face4){g=e(f.a,f.b);b(g,c);g=e(f.b,f.c);b(g,c);g=e(f.c,f.d);b(g,c);g=e(f.d,f.a);b(g,c)}}return h}(b);C=0;var B,E,G={},L={};for(o in x){u=x[o];B=o.split("_");E=B[0];B=B[1];h(E,[E,B]);h(B,[E,B]);z=0;for(A=u.length;z<A;z++){v=u[z];i(E,v,o);i(B,v,o)}u.length<2&&(s[o]=true)}a("vertexEdgeMap",G,"vertexFaceMap",L);for(o in x){u=
+x[o];v=u[0];A=u[1];B=o.split("_");E=B[0];B=B[1];u=new THREE.Vector3;if(s[o]){u.addSelf(m[E]);u.addSelf(m[B]);u.multiplyScalar(0.5)}else{u.addSelf(q[v]);u.addSelf(q[A]);u.addSelf(m[E]);u.addSelf(m[B]);u.multiplyScalar(0.25)}r[o]=w+p.length+C;j.push(u);C++;if(k.supportUVs){u=new THREE.UV;u.u=f(E,v).u+f(B,v).u;u.v=f(E,v).v+f(B,v).v;u.u=u.u/2;u.v=u.v/2;g(r[o],v,u);if(!s[o]){u=new THREE.UV;u.u=f(E,A).u+f(B,A).u;u.v=f(E,A).v+f(B,A).v;u.u=u.u/2;u.v=u.v/2;g(r[o],A,u)}}}a("-- Step 2 done");var H,D;A=["123",
+"12","2","23"];B=["123","23","3","31"];var K=["123","31","1","12"],F=["1234","12","2","23"],N=["1234","23","3","34"],I=["1234","34","4","41"],M=["1234","41","1","12"];o=0;for(x=q.length;o<x;o++){v=p[o];u=w+o;if(v instanceof THREE.Face3){C=e(v.a,v.b);E=e(v.b,v.c);H=e(v.c,v.a);d(u,r[C],v.b,r[E],v,A,o);d(u,r[E],v.c,r[H],v,B,o);d(u,r[H],v.a,r[C],v,K,o)}else if(v instanceof THREE.Face4){C=e(v.a,v.b);E=e(v.b,v.c);H=e(v.c,v.d);D=e(v.d,v.a);d(u,r[C],v.b,r[E],v,F,o);d(u,r[E],v.c,r[H],v,N,o);d(u,r[H],v.d,r[D],
+v,I,o);d(u,r[D],v.a,r[C],v,M,o)}else a("face should be a face!",v)}r=new THREE.Vector3;v=new THREE.Vector3;o=0;for(x=m.length;o<x;o++)if(G[o]!==void 0){r.set(0,0,0);v.set(0,0,0);E=new THREE.Vector3(0,0,0);u=0;for(z in L[o]){r.addSelf(q[z]);u++}A=0;C=G[o].length;for(z=0;z<C;z++)s[e(G[o][z][0],G[o][z][1])]&&A++;if(A!=2){r.divideScalar(u);for(z=0;z<C;z++){u=G[o][z];u=m[u[0]].clone().addSelf(m[u[1]]).divideScalar(2);v.addSelf(u)}v.divideScalar(C);E.addSelf(m[o]);E.multiplyScalar(C-3);E.addSelf(r);E.addSelf(v.multiplyScalar(2));
 E.divideScalar(C);j[o]=E}}b.vertices=j;b.faces=l;b.faceVertexUvs[0]=n;delete b.__tmpVertices;b.computeCentroids();b.computeFaceNormals();b.computeVertexNormals()};THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(){}};THREE.ImmediateRenderObject.prototype=new THREE.Object3D;THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;
 E.divideScalar(C);j[o]=E}}b.vertices=j;b.faces=l;b.faceVertexUvs[0]=n;delete b.__tmpVertices;b.computeCentroids();b.computeFaceNormals();b.computeVertexNormals()};THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(){}};THREE.ImmediateRenderObject.prototype=new THREE.Object3D;THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;
-THREE.LensFlare=function(b,a,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;b!==void 0&&this.add(b,a,c,d,e)};THREE.LensFlare.prototype=new THREE.Object3D;THREE.LensFlare.prototype.constructor=THREE.LensFlare;THREE.LensFlare.prototype.supr=THREE.Object3D.prototype;
+THREE.LensFlare=function(b,a,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;b!==void 0&&this.add(b,a,c,d,e)};THREE.LensFlare.prototype=new THREE.Object3D;THREE.LensFlare.prototype.constructor=THREE.LensFlare;
 THREE.LensFlare.prototype.add=function(b,a,c,d,e,f){a===void 0&&(a=-1);c===void 0&&(c=0);f===void 0&&(f=1);e===void 0&&(e=new THREE.Color(16777215));if(d===void 0)d=THREE.NormalBlending;c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:b,size:a,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})};
 THREE.LensFlare.prototype.add=function(b,a,c,d,e,f){a===void 0&&(a=-1);c===void 0&&(c=0);f===void 0&&(f=1);e===void 0&&(e=new THREE.Color(16777215));if(d===void 0)d=THREE.NormalBlending;c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:b,size:a,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})};
 THREE.LensFlare.prototype.updateLensFlares=function(){var b,a=this.lensFlares.length,c,d=-this.positionScreen.x*2,e=-this.positionScreen.y*2;for(b=0;b<a;b++){c=this.lensFlares[b];c.x=this.positionScreen.x+d*c.distance;c.y=this.positionScreen.y+e*c.distance;c.wantedRotation=c.x*Math.PI*0.25;c.rotation=c.rotation+(c.wantedRotation-c.rotation)*0.25}};
 THREE.LensFlare.prototype.updateLensFlares=function(){var b,a=this.lensFlares.length,c,d=-this.positionScreen.x*2,e=-this.positionScreen.y*2;for(b=0;b<a;b++){c=this.lensFlares[b];c.x=this.positionScreen.x+d*c.distance;c.y=this.positionScreen.y+e*c.distance;c.wantedRotation=c.x*Math.PI*0.25;c.rotation=c.rotation+(c.wantedRotation-c.rotation)*0.25}};
 THREE.MorphBlendMesh=function(b,a){THREE.Mesh.call(this,b,a);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=new THREE.Mesh;THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh;
 THREE.MorphBlendMesh=function(b,a){THREE.Mesh.call(this,b,a);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=new THREE.Mesh;THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh;
@@ -266,29 +262,29 @@ THREE.LensFlarePlugin=function(){function b(b){var c=a.createProgram(),d=a.creat
 0;d[p++]=1;d[p++]=1;d[p++]=1;d[p++]=1;d[p++]=-1;d[p++]=1;d[p++]=0;d[p++]=1;p=0;e[p++]=0;e[p++]=1;e[p++]=2;e[p++]=0;e[p++]=2;e[p++]=3;f=a.createBuffer();g=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,f);a.bufferData(a.ARRAY_BUFFER,d,a.STATIC_DRAW);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,g);a.bufferData(a.ELEMENT_ARRAY_BUFFER,e,a.STATIC_DRAW);h=a.createTexture();i=a.createTexture();a.bindTexture(a.TEXTURE_2D,h);a.texImage2D(a.TEXTURE_2D,0,a.RGB,16,16,0,a.RGB,a.UNSIGNED_BYTE,null);a.texParameteri(a.TEXTURE_2D,
 0;d[p++]=1;d[p++]=1;d[p++]=1;d[p++]=1;d[p++]=-1;d[p++]=1;d[p++]=0;d[p++]=1;p=0;e[p++]=0;e[p++]=1;e[p++]=2;e[p++]=0;e[p++]=2;e[p++]=3;f=a.createBuffer();g=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,f);a.bufferData(a.ARRAY_BUFFER,d,a.STATIC_DRAW);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,g);a.bufferData(a.ELEMENT_ARRAY_BUFFER,e,a.STATIC_DRAW);h=a.createTexture();i=a.createTexture();a.bindTexture(a.TEXTURE_2D,h);a.texImage2D(a.TEXTURE_2D,0,a.RGB,16,16,0,a.RGB,a.UNSIGNED_BYTE,null);a.texParameteri(a.TEXTURE_2D,
 a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST);a.bindTexture(a.TEXTURE_2D,i);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,16,16,0,a.RGBA,a.UNSIGNED_BYTE,null);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST);
 a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST);a.bindTexture(a.TEXTURE_2D,i);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,16,16,0,a.RGBA,a.UNSIGNED_BYTE,null);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST);
 a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST);if(a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS)<=0){j=false;l=b(THREE.ShaderFlares.lensFlare)}else{j=true;l=b(THREE.ShaderFlares.lensFlareVertexTexture)}n={};k={};n.vertex=a.getAttribLocation(l,"position");n.uv=a.getAttribLocation(l,"uv");k.renderType=a.getUniformLocation(l,"renderType");k.map=a.getUniformLocation(l,"map");k.occlusionMap=a.getUniformLocation(l,"occlusionMap");k.opacity=a.getUniformLocation(l,"opacity");k.color=a.getUniformLocation(l,
 a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST);if(a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS)<=0){j=false;l=b(THREE.ShaderFlares.lensFlare)}else{j=true;l=b(THREE.ShaderFlares.lensFlareVertexTexture)}n={};k={};n.vertex=a.getAttribLocation(l,"position");n.uv=a.getAttribLocation(l,"uv");k.renderType=a.getUniformLocation(l,"renderType");k.map=a.getUniformLocation(l,"map");k.occlusionMap=a.getUniformLocation(l,"occlusionMap");k.opacity=a.getUniformLocation(l,"opacity");k.color=a.getUniformLocation(l,
-"color");k.scale=a.getUniformLocation(l,"scale");k.rotation=a.getUniformLocation(l,"rotation");k.screenPosition=a.getUniformLocation(l,"screenPosition");m=false};this.render=function(b,d,e,t){var b=b.__webglFlares,s=b.length;if(s){var v=new THREE.Vector3,o=t/e,x=e*0.5,z=t*0.5,A=16/t,w=new THREE.Vector2(A*o,A),u=new THREE.Vector3(1,1,0),C=new THREE.Vector2(1,1),B=k,A=n;a.useProgram(l);if(!m){a.enableVertexAttribArray(n.vertex);a.enableVertexAttribArray(n.uv);m=true}a.uniform1i(B.occlusionMap,0);a.uniform1i(B.map,
-1);a.bindBuffer(a.ARRAY_BUFFER,f);a.vertexAttribPointer(A.vertex,2,a.FLOAT,false,16,0);a.vertexAttribPointer(A.uv,2,a.FLOAT,false,16,8);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,g);a.disable(a.CULL_FACE);a.depthMask(false);var E,G,L,H,D;for(E=0;E<s;E++){A=16/t;w.set(A*o,A);H=b[E];v.set(H.matrixWorld.elements[12],H.matrixWorld.elements[13],H.matrixWorld.elements[14]);d.matrixWorldInverse.multiplyVector3(v);d.projectionMatrix.multiplyVector3(v);u.copy(v);C.x=u.x*x+x;C.y=u.y*z+z;if(j||C.x>0&&C.x<e&&C.y>0&&
-C.y<t){a.activeTexture(a.TEXTURE1);a.bindTexture(a.TEXTURE_2D,h);a.copyTexImage2D(a.TEXTURE_2D,0,a.RGB,C.x-8,C.y-8,16,16,0);a.uniform1i(B.renderType,0);a.uniform2f(B.scale,w.x,w.y);a.uniform3f(B.screenPosition,u.x,u.y,u.z);a.disable(a.BLEND);a.enable(a.DEPTH_TEST);a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);a.activeTexture(a.TEXTURE0);a.bindTexture(a.TEXTURE_2D,i);a.copyTexImage2D(a.TEXTURE_2D,0,a.RGBA,C.x-8,C.y-8,16,16,0);a.uniform1i(B.renderType,1);a.disable(a.DEPTH_TEST);a.activeTexture(a.TEXTURE1);
-a.bindTexture(a.TEXTURE_2D,h);a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);H.positionScreen.copy(u);H.customUpdateCallback?H.customUpdateCallback(H):H.updateLensFlares();a.uniform1i(B.renderType,2);a.enable(a.BLEND);G=0;for(L=H.lensFlares.length;G<L;G++){D=H.lensFlares[G];if(D.opacity>0.001&&D.scale>0.001){u.x=D.x;u.y=D.y;u.z=D.z;A=D.size*D.scale/t;w.x=A*o;w.y=A;a.uniform3f(B.screenPosition,u.x,u.y,u.z);a.uniform2f(B.scale,w.x,w.y);a.uniform1f(B.rotation,D.rotation);a.uniform1f(B.opacity,D.opacity);
+"color");k.scale=a.getUniformLocation(l,"scale");k.rotation=a.getUniformLocation(l,"rotation");k.screenPosition=a.getUniformLocation(l,"screenPosition");m=false};this.render=function(b,d,e,s){var b=b.__webglFlares,t=b.length;if(t){var w=new THREE.Vector3,o=s/e,x=e*0.5,z=s*0.5,A=16/s,v=new THREE.Vector2(A*o,A),u=new THREE.Vector3(1,1,0),C=new THREE.Vector2(1,1),B=k,A=n;a.useProgram(l);if(!m){a.enableVertexAttribArray(n.vertex);a.enableVertexAttribArray(n.uv);m=true}a.uniform1i(B.occlusionMap,0);a.uniform1i(B.map,
+1);a.bindBuffer(a.ARRAY_BUFFER,f);a.vertexAttribPointer(A.vertex,2,a.FLOAT,false,16,0);a.vertexAttribPointer(A.uv,2,a.FLOAT,false,16,8);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,g);a.disable(a.CULL_FACE);a.depthMask(false);var E,G,L,H,D;for(E=0;E<t;E++){A=16/s;v.set(A*o,A);H=b[E];w.set(H.matrixWorld.elements[12],H.matrixWorld.elements[13],H.matrixWorld.elements[14]);d.matrixWorldInverse.multiplyVector3(w);d.projectionMatrix.multiplyVector3(w);u.copy(w);C.x=u.x*x+x;C.y=u.y*z+z;if(j||C.x>0&&C.x<e&&C.y>0&&
+C.y<s){a.activeTexture(a.TEXTURE1);a.bindTexture(a.TEXTURE_2D,h);a.copyTexImage2D(a.TEXTURE_2D,0,a.RGB,C.x-8,C.y-8,16,16,0);a.uniform1i(B.renderType,0);a.uniform2f(B.scale,v.x,v.y);a.uniform3f(B.screenPosition,u.x,u.y,u.z);a.disable(a.BLEND);a.enable(a.DEPTH_TEST);a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);a.activeTexture(a.TEXTURE0);a.bindTexture(a.TEXTURE_2D,i);a.copyTexImage2D(a.TEXTURE_2D,0,a.RGBA,C.x-8,C.y-8,16,16,0);a.uniform1i(B.renderType,1);a.disable(a.DEPTH_TEST);a.activeTexture(a.TEXTURE1);
+a.bindTexture(a.TEXTURE_2D,h);a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);H.positionScreen.copy(u);H.customUpdateCallback?H.customUpdateCallback(H):H.updateLensFlares();a.uniform1i(B.renderType,2);a.enable(a.BLEND);G=0;for(L=H.lensFlares.length;G<L;G++){D=H.lensFlares[G];if(D.opacity>0.001&&D.scale>0.001){u.x=D.x;u.y=D.y;u.z=D.z;A=D.size*D.scale/s;v.x=A*o;v.y=A;a.uniform3f(B.screenPosition,u.x,u.y,u.z);a.uniform2f(B.scale,v.x,v.y);a.uniform1f(B.rotation,D.rotation);a.uniform1f(B.opacity,D.opacity);
 a.uniform3f(B.color,D.color.r,D.color.g,D.color.b);c.setBlending(D.blending,D.blendEquation,D.blendSrc,D.blendDst);c.setTexture(D.texture,1);a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0)}}}}a.enable(a.CULL_FACE);a.enable(a.DEPTH_TEST);a.depthMask(true)}}};
 a.uniform3f(B.color,D.color.r,D.color.g,D.color.b);c.setBlending(D.blending,D.blendEquation,D.blendSrc,D.blendDst);c.setTexture(D.texture,1);a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0)}}}}a.enable(a.CULL_FACE);a.enable(a.DEPTH_TEST);a.depthMask(true)}}};
 THREE.ShadowMapPlugin=function(){var b,a,c,d,e=new THREE.Frustum,f=new THREE.Matrix4,g=new THREE.Vector3,h=new THREE.Vector3;this.init=function(e){b=e.context;a=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:true});c._shadowPass=true;d._shadowPass=true};this.render=
 THREE.ShadowMapPlugin=function(){var b,a,c,d,e=new THREE.Frustum,f=new THREE.Matrix4,g=new THREE.Vector3,h=new THREE.Vector3;this.init=function(e){b=e.context;a=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:true});c._shadowPass=true;d._shadowPass=true};this.render=
-function(b,c){a.shadowMapEnabled&&a.shadowMapAutoUpdate&&this.update(b,c)};this.update=function(i,j){var l,n,k,m,p,q,r,t,s,v=[];m=0;b.clearColor(1,1,1,1);b.disable(b.BLEND);b.enable(b.CULL_FACE);a.shadowMapCullFrontFaces?b.cullFace(b.FRONT):b.cullFace(b.BACK);a.setDepthTest(true);l=0;for(n=i.__lights.length;l<n;l++){k=i.__lights[l];if(k.castShadow)if(k instanceof THREE.DirectionalLight&&k.shadowCascade)for(p=0;p<k.shadowCascadeCount;p++){var o;if(k.shadowCascadeArray[p])o=k.shadowCascadeArray[p];
-else{s=k;r=p;o=new THREE.DirectionalLight;o.isVirtual=true;o.onlyShadow=true;o.castShadow=true;o.shadowCameraNear=s.shadowCameraNear;o.shadowCameraFar=s.shadowCameraFar;o.shadowCameraLeft=s.shadowCameraLeft;o.shadowCameraRight=s.shadowCameraRight;o.shadowCameraBottom=s.shadowCameraBottom;o.shadowCameraTop=s.shadowCameraTop;o.shadowCameraVisible=s.shadowCameraVisible;o.shadowDarkness=s.shadowDarkness;o.shadowBias=s.shadowCascadeBias[r];o.shadowMapWidth=s.shadowCascadeWidth[r];o.shadowMapHeight=s.shadowCascadeHeight[r];
-o.pointsWorld=[];o.pointsFrustum=[];t=o.pointsWorld;q=o.pointsFrustum;for(var x=0;x<8;x++){t[x]=new THREE.Vector3;q[x]=new THREE.Vector3}t=s.shadowCascadeNearZ[r];s=s.shadowCascadeFarZ[r];q[0].set(-1,-1,t);q[1].set(1,-1,t);q[2].set(-1,1,t);q[3].set(1,1,t);q[4].set(-1,-1,s);q[5].set(1,-1,s);q[6].set(-1,1,s);q[7].set(1,1,s);o.originalCamera=j;q=new THREE.Gyroscope;q.position=k.shadowCascadeOffset;q.add(o);q.add(o.target);j.add(q);k.shadowCascadeArray[p]=o;console.log("Created virtualLight",o)}r=k;t=
-p;s=r.shadowCascadeArray[t];s.position.copy(r.position);s.target.position.copy(r.target.position);s.lookAt(s.target);s.shadowCameraVisible=r.shadowCameraVisible;s.shadowDarkness=r.shadowDarkness;s.shadowBias=r.shadowCascadeBias[t];q=r.shadowCascadeNearZ[t];r=r.shadowCascadeFarZ[t];s=s.pointsFrustum;s[0].z=q;s[1].z=q;s[2].z=q;s[3].z=q;s[4].z=r;s[5].z=r;s[6].z=r;s[7].z=r;v[m]=o;m++}else{v[m]=k;m++}}l=0;for(n=v.length;l<n;l++){k=v[l];if(!k.shadowMap){k.shadowMap=new THREE.WebGLRenderTarget(k.shadowMapWidth,
+function(b,c){a.shadowMapEnabled&&a.shadowMapAutoUpdate&&this.update(b,c)};this.update=function(i,j){var l,n,k,m,p,q,r,s,t,w=[];m=0;b.clearColor(1,1,1,1);b.disable(b.BLEND);b.enable(b.CULL_FACE);a.shadowMapCullFrontFaces?b.cullFace(b.FRONT):b.cullFace(b.BACK);a.setDepthTest(true);l=0;for(n=i.__lights.length;l<n;l++){k=i.__lights[l];if(k.castShadow)if(k instanceof THREE.DirectionalLight&&k.shadowCascade)for(p=0;p<k.shadowCascadeCount;p++){var o;if(k.shadowCascadeArray[p])o=k.shadowCascadeArray[p];
+else{t=k;r=p;o=new THREE.DirectionalLight;o.isVirtual=true;o.onlyShadow=true;o.castShadow=true;o.shadowCameraNear=t.shadowCameraNear;o.shadowCameraFar=t.shadowCameraFar;o.shadowCameraLeft=t.shadowCameraLeft;o.shadowCameraRight=t.shadowCameraRight;o.shadowCameraBottom=t.shadowCameraBottom;o.shadowCameraTop=t.shadowCameraTop;o.shadowCameraVisible=t.shadowCameraVisible;o.shadowDarkness=t.shadowDarkness;o.shadowBias=t.shadowCascadeBias[r];o.shadowMapWidth=t.shadowCascadeWidth[r];o.shadowMapHeight=t.shadowCascadeHeight[r];
+o.pointsWorld=[];o.pointsFrustum=[];s=o.pointsWorld;q=o.pointsFrustum;for(var x=0;x<8;x++){s[x]=new THREE.Vector3;q[x]=new THREE.Vector3}s=t.shadowCascadeNearZ[r];t=t.shadowCascadeFarZ[r];q[0].set(-1,-1,s);q[1].set(1,-1,s);q[2].set(-1,1,s);q[3].set(1,1,s);q[4].set(-1,-1,t);q[5].set(1,-1,t);q[6].set(-1,1,t);q[7].set(1,1,t);o.originalCamera=j;q=new THREE.Gyroscope;q.position=k.shadowCascadeOffset;q.add(o);q.add(o.target);j.add(q);k.shadowCascadeArray[p]=o;console.log("Created virtualLight",o)}r=k;s=
+p;t=r.shadowCascadeArray[s];t.position.copy(r.position);t.target.position.copy(r.target.position);t.lookAt(t.target);t.shadowCameraVisible=r.shadowCameraVisible;t.shadowDarkness=r.shadowDarkness;t.shadowBias=r.shadowCascadeBias[s];q=r.shadowCascadeNearZ[s];r=r.shadowCascadeFarZ[s];t=t.pointsFrustum;t[0].z=q;t[1].z=q;t[2].z=q;t[3].z=q;t[4].z=r;t[5].z=r;t[6].z=r;t[7].z=r;w[m]=o;m++}else{w[m]=k;m++}}l=0;for(n=w.length;l<n;l++){k=w[l];if(!k.shadowMap){k.shadowMap=new THREE.WebGLRenderTarget(k.shadowMapWidth,
 k.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat});k.shadowMapSize=new THREE.Vector2(k.shadowMapWidth,k.shadowMapHeight);k.shadowMatrix=new THREE.Matrix4}if(!k.shadowCamera){if(k instanceof THREE.SpotLight)k.shadowCamera=new THREE.PerspectiveCamera(k.shadowCameraFov,k.shadowMapWidth/k.shadowMapHeight,k.shadowCameraNear,k.shadowCameraFar);else if(k instanceof THREE.DirectionalLight)k.shadowCamera=new THREE.OrthographicCamera(k.shadowCameraLeft,k.shadowCameraRight,
 k.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat});k.shadowMapSize=new THREE.Vector2(k.shadowMapWidth,k.shadowMapHeight);k.shadowMatrix=new THREE.Matrix4}if(!k.shadowCamera){if(k instanceof THREE.SpotLight)k.shadowCamera=new THREE.PerspectiveCamera(k.shadowCameraFov,k.shadowMapWidth/k.shadowMapHeight,k.shadowCameraNear,k.shadowCameraFar);else if(k instanceof THREE.DirectionalLight)k.shadowCamera=new THREE.OrthographicCamera(k.shadowCameraLeft,k.shadowCameraRight,
-k.shadowCameraTop,k.shadowCameraBottom,k.shadowCameraNear,k.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}i.add(k.shadowCamera);a.autoUpdateScene&&i.updateMatrixWorld()}if(k.shadowCameraVisible&&!k.cameraHelper){k.cameraHelper=new THREE.CameraHelper(k.shadowCamera);k.shadowCamera.add(k.cameraHelper)}if(k.isVirtual&&o.originalCamera==j){p=j;m=k.shadowCamera;q=k.pointsFrustum;s=k.pointsWorld;g.set(Infinity,Infinity,Infinity);h.set(-Infinity,-Infinity,-Infinity);for(r=
-0;r<8;r++){t=s[r];t.copy(q[r]);THREE.ShadowMapPlugin.__projector.unprojectVector(t,p);m.matrixWorldInverse.multiplyVector3(t);if(t.x<g.x)g.x=t.x;if(t.x>h.x)h.x=t.x;if(t.y<g.y)g.y=t.y;if(t.y>h.y)h.y=t.y;if(t.z<g.z)g.z=t.z;if(t.z>h.z)h.z=t.z}m.left=g.x;m.right=h.x;m.top=h.y;m.bottom=g.y;m.updateProjectionMatrix()}m=k.shadowMap;q=k.shadowMatrix;p=k.shadowCamera;p.position.copy(k.matrixWorld.getPosition());p.lookAt(k.target.matrixWorld.getPosition());p.updateMatrixWorld();p.matrixWorldInverse.getInverse(p.matrixWorld);
+k.shadowCameraTop,k.shadowCameraBottom,k.shadowCameraNear,k.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}i.add(k.shadowCamera);a.autoUpdateScene&&i.updateMatrixWorld()}if(k.shadowCameraVisible&&!k.cameraHelper){k.cameraHelper=new THREE.CameraHelper(k.shadowCamera);k.shadowCamera.add(k.cameraHelper)}if(k.isVirtual&&o.originalCamera==j){p=j;m=k.shadowCamera;q=k.pointsFrustum;t=k.pointsWorld;g.set(Infinity,Infinity,Infinity);h.set(-Infinity,-Infinity,-Infinity);for(r=
+0;r<8;r++){s=t[r];s.copy(q[r]);THREE.ShadowMapPlugin.__projector.unprojectVector(s,p);m.matrixWorldInverse.multiplyVector3(s);if(s.x<g.x)g.x=s.x;if(s.x>h.x)h.x=s.x;if(s.y<g.y)g.y=s.y;if(s.y>h.y)h.y=s.y;if(s.z<g.z)g.z=s.z;if(s.z>h.z)h.z=s.z}m.left=g.x;m.right=h.x;m.top=h.y;m.bottom=g.y;m.updateProjectionMatrix()}m=k.shadowMap;q=k.shadowMatrix;p=k.shadowCamera;p.position.copy(k.matrixWorld.getPosition());p.lookAt(k.target.matrixWorld.getPosition());p.updateMatrixWorld();p.matrixWorldInverse.getInverse(p.matrixWorld);
 if(k.cameraHelper)k.cameraHelper.lines.visible=k.shadowCameraVisible;k.shadowCameraVisible&&k.cameraHelper.update();q.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);q.multiplySelf(p.projectionMatrix);q.multiplySelf(p.matrixWorldInverse);if(!p._viewMatrixArray)p._viewMatrixArray=new Float32Array(16);if(!p._projectionMatrixArray)p._projectionMatrixArray=new Float32Array(16);p.matrixWorldInverse.flattenToArray(p._viewMatrixArray);p.projectionMatrix.flattenToArray(p._projectionMatrixArray);f.multiply(p.projectionMatrix,
 if(k.cameraHelper)k.cameraHelper.lines.visible=k.shadowCameraVisible;k.shadowCameraVisible&&k.cameraHelper.update();q.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);q.multiplySelf(p.projectionMatrix);q.multiplySelf(p.matrixWorldInverse);if(!p._viewMatrixArray)p._viewMatrixArray=new Float32Array(16);if(!p._projectionMatrixArray)p._projectionMatrixArray=new Float32Array(16);p.matrixWorldInverse.flattenToArray(p._viewMatrixArray);p.projectionMatrix.flattenToArray(p._projectionMatrixArray);f.multiply(p.projectionMatrix,
-p.matrixWorldInverse);e.setFromMatrix(f);a.setRenderTarget(m);a.clear();s=i.__webglObjects;k=0;for(m=s.length;k<m;k++){r=s[k];q=r.object;r.render=false;if(q.visible&&q.castShadow&&(!(q instanceof THREE.Mesh)||!q.frustumCulled||e.contains(q))){q._modelViewMatrix.multiply(p.matrixWorldInverse,q.matrixWorld);r.render=true}}k=0;for(m=s.length;k<m;k++){r=s[k];if(r.render){q=r.object;r=r.buffer;t=q.customDepthMaterial?q.customDepthMaterial:q.geometry.morphTargets.length?d:c;r instanceof THREE.BufferGeometry?
-a.renderBufferDirect(p,i.__lights,null,t,r,q):a.renderBuffer(p,i.__lights,null,t,r,q)}}s=i.__webglObjectsImmediate;k=0;for(m=s.length;k<m;k++){r=s[k];q=r.object;if(q.visible&&q.castShadow){q._modelViewMatrix.multiply(p.matrixWorldInverse,q.matrixWorld);a.renderImmediateObject(p,i.__lights,null,c,q)}}}l=a.getClearColor();n=a.getClearAlpha();b.clearColor(l.r,l.g,l.b,n);b.enable(b.BLEND);a.shadowMapCullFrontFaces&&b.cullFace(b.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;
+p.matrixWorldInverse);e.setFromMatrix(f);a.setRenderTarget(m);a.clear();t=i.__webglObjects;k=0;for(m=t.length;k<m;k++){r=t[k];q=r.object;r.render=false;if(q.visible&&q.castShadow&&(!(q instanceof THREE.Mesh)||!q.frustumCulled||e.contains(q))){q._modelViewMatrix.multiply(p.matrixWorldInverse,q.matrixWorld);r.render=true}}k=0;for(m=t.length;k<m;k++){r=t[k];if(r.render){q=r.object;r=r.buffer;s=q.customDepthMaterial?q.customDepthMaterial:q.geometry.morphTargets.length?d:c;r instanceof THREE.BufferGeometry?
+a.renderBufferDirect(p,i.__lights,null,s,r,q):a.renderBuffer(p,i.__lights,null,s,r,q)}}t=i.__webglObjectsImmediate;k=0;for(m=t.length;k<m;k++){r=t[k];q=r.object;if(q.visible&&q.castShadow){q._modelViewMatrix.multiply(p.matrixWorldInverse,q.matrixWorld);a.renderImmediateObject(p,i.__lights,null,c,q)}}}l=a.getClearColor();n=a.getClearAlpha();b.clearColor(l.r,l.g,l.b,n);b.enable(b.BLEND);a.shadowMapCullFrontFaces&&b.cullFace(b.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;
 THREE.SpritePlugin=function(){function b(a,b){return b.z-a.z}var a,c,d,e,f,g,h,i,j,l;this.init=function(b){a=b.context;c=b;d=new Float32Array(16);e=new Uint16Array(6);b=0;d[b++]=-1;d[b++]=-1;d[b++]=0;d[b++]=1;d[b++]=1;d[b++]=-1;d[b++]=1;d[b++]=1;d[b++]=1;d[b++]=1;d[b++]=1;d[b++]=0;d[b++]=-1;d[b++]=1;d[b++]=0;b=d[b++]=0;e[b++]=0;e[b++]=1;e[b++]=2;e[b++]=0;e[b++]=2;e[b++]=3;f=a.createBuffer();g=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,f);a.bufferData(a.ARRAY_BUFFER,d,a.STATIC_DRAW);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
 THREE.SpritePlugin=function(){function b(a,b){return b.z-a.z}var a,c,d,e,f,g,h,i,j,l;this.init=function(b){a=b.context;c=b;d=new Float32Array(16);e=new Uint16Array(6);b=0;d[b++]=-1;d[b++]=-1;d[b++]=0;d[b++]=1;d[b++]=1;d[b++]=-1;d[b++]=1;d[b++]=1;d[b++]=1;d[b++]=1;d[b++]=1;d[b++]=0;d[b++]=-1;d[b++]=1;d[b++]=0;b=d[b++]=0;e[b++]=0;e[b++]=1;e[b++]=2;e[b++]=0;e[b++]=2;e[b++]=3;f=a.createBuffer();g=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,f);a.bufferData(a.ARRAY_BUFFER,d,a.STATIC_DRAW);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
 g);a.bufferData(a.ELEMENT_ARRAY_BUFFER,e,a.STATIC_DRAW);var b=THREE.ShaderSprite.sprite,k=a.createProgram(),m=a.createShader(a.FRAGMENT_SHADER),p=a.createShader(a.VERTEX_SHADER);a.shaderSource(m,b.fragmentShader);a.shaderSource(p,b.vertexShader);a.compileShader(m);a.compileShader(p);a.attachShader(k,m);a.attachShader(k,p);a.linkProgram(k);h=k;i={};j={};i.position=a.getAttribLocation(h,"position");i.uv=a.getAttribLocation(h,"uv");j.uvOffset=a.getUniformLocation(h,"uvOffset");j.uvScale=a.getUniformLocation(h,
 g);a.bufferData(a.ELEMENT_ARRAY_BUFFER,e,a.STATIC_DRAW);var b=THREE.ShaderSprite.sprite,k=a.createProgram(),m=a.createShader(a.FRAGMENT_SHADER),p=a.createShader(a.VERTEX_SHADER);a.shaderSource(m,b.fragmentShader);a.shaderSource(p,b.vertexShader);a.compileShader(m);a.compileShader(p);a.attachShader(k,m);a.attachShader(k,p);a.linkProgram(k);h=k;i={};j={};i.position=a.getAttribLocation(h,"position");i.uv=a.getAttribLocation(h,"uv");j.uvOffset=a.getUniformLocation(h,"uvOffset");j.uvScale=a.getUniformLocation(h,
 "uvScale");j.rotation=a.getUniformLocation(h,"rotation");j.scale=a.getUniformLocation(h,"scale");j.alignment=a.getUniformLocation(h,"alignment");j.color=a.getUniformLocation(h,"color");j.map=a.getUniformLocation(h,"map");j.opacity=a.getUniformLocation(h,"opacity");j.useScreenCoordinates=a.getUniformLocation(h,"useScreenCoordinates");j.affectedByDistance=a.getUniformLocation(h,"affectedByDistance");j.screenPosition=a.getUniformLocation(h,"screenPosition");j.modelViewMatrix=a.getUniformLocation(h,"modelViewMatrix");
 "uvScale");j.rotation=a.getUniformLocation(h,"rotation");j.scale=a.getUniformLocation(h,"scale");j.alignment=a.getUniformLocation(h,"alignment");j.color=a.getUniformLocation(h,"color");j.map=a.getUniformLocation(h,"map");j.opacity=a.getUniformLocation(h,"opacity");j.useScreenCoordinates=a.getUniformLocation(h,"useScreenCoordinates");j.affectedByDistance=a.getUniformLocation(h,"affectedByDistance");j.screenPosition=a.getUniformLocation(h,"screenPosition");j.modelViewMatrix=a.getUniformLocation(h,"modelViewMatrix");
-j.projectionMatrix=a.getUniformLocation(h,"projectionMatrix");l=false};this.render=function(d,e,m,p){var d=d.__webglSprites,q=d.length;if(q){var r=i,t=j,s=p/m,m=m*0.5,v=p*0.5,o=true;a.useProgram(h);if(!l){a.enableVertexAttribArray(r.position);a.enableVertexAttribArray(r.uv);l=true}a.disable(a.CULL_FACE);a.enable(a.BLEND);a.depthMask(true);a.bindBuffer(a.ARRAY_BUFFER,f);a.vertexAttribPointer(r.position,2,a.FLOAT,false,16,0);a.vertexAttribPointer(r.uv,2,a.FLOAT,false,16,8);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
-g);a.uniformMatrix4fv(t.projectionMatrix,false,e._projectionMatrixArray);a.activeTexture(a.TEXTURE0);a.uniform1i(t.map,0);for(var x,z=[],r=0;r<q;r++){x=d[r];if(x.visible&&x.opacity!==0)if(x.useScreenCoordinates)x.z=-x.position.z;else{x._modelViewMatrix.multiply(e.matrixWorldInverse,x.matrixWorld);x.z=-x._modelViewMatrix.elements[14]}}d.sort(b);for(r=0;r<q;r++){x=d[r];if(x.visible&&x.opacity!==0&&x.map&&x.map.image&&x.map.image.width){if(x.useScreenCoordinates){a.uniform1i(t.useScreenCoordinates,1);
-a.uniform3f(t.screenPosition,(x.position.x-m)/m,(v-x.position.y)/v,Math.max(0,Math.min(1,x.position.z)))}else{a.uniform1i(t.useScreenCoordinates,0);a.uniform1i(t.affectedByDistance,x.affectedByDistance?1:0);a.uniformMatrix4fv(t.modelViewMatrix,false,x._modelViewMatrix.elements)}e=x.map.image.width/(x.scaleByViewport?p:1);z[0]=e*s*x.scale.x;z[1]=e*x.scale.y;a.uniform2f(t.uvScale,x.uvScale.x,x.uvScale.y);a.uniform2f(t.uvOffset,x.uvOffset.x,x.uvOffset.y);a.uniform2f(t.alignment,x.alignment.x,x.alignment.y);
-a.uniform1f(t.opacity,x.opacity);a.uniform3f(t.color,x.color.r,x.color.g,x.color.b);a.uniform1f(t.rotation,x.rotation);a.uniform2fv(t.scale,z);if(x.mergeWith3D&&!o){a.enable(a.DEPTH_TEST);o=true}else if(!x.mergeWith3D&&o){a.disable(a.DEPTH_TEST);o=false}c.setBlending(x.blending,x.blendEquation,x.blendSrc,x.blendDst);c.setTexture(x.map,0);a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0)}}a.enable(a.CULL_FACE);a.enable(a.DEPTH_TEST);a.depthMask(true)}}};
+j.projectionMatrix=a.getUniformLocation(h,"projectionMatrix");l=false};this.render=function(d,e,m,p){var d=d.__webglSprites,q=d.length;if(q){var r=i,s=j,t=p/m,m=m*0.5,w=p*0.5,o=true;a.useProgram(h);if(!l){a.enableVertexAttribArray(r.position);a.enableVertexAttribArray(r.uv);l=true}a.disable(a.CULL_FACE);a.enable(a.BLEND);a.depthMask(true);a.bindBuffer(a.ARRAY_BUFFER,f);a.vertexAttribPointer(r.position,2,a.FLOAT,false,16,0);a.vertexAttribPointer(r.uv,2,a.FLOAT,false,16,8);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
+g);a.uniformMatrix4fv(s.projectionMatrix,false,e._projectionMatrixArray);a.activeTexture(a.TEXTURE0);a.uniform1i(s.map,0);for(var x,z=[],r=0;r<q;r++){x=d[r];if(x.visible&&x.opacity!==0)if(x.useScreenCoordinates)x.z=-x.position.z;else{x._modelViewMatrix.multiply(e.matrixWorldInverse,x.matrixWorld);x.z=-x._modelViewMatrix.elements[14]}}d.sort(b);for(r=0;r<q;r++){x=d[r];if(x.visible&&x.opacity!==0&&x.map&&x.map.image&&x.map.image.width){if(x.useScreenCoordinates){a.uniform1i(s.useScreenCoordinates,1);
+a.uniform3f(s.screenPosition,(x.position.x-m)/m,(w-x.position.y)/w,Math.max(0,Math.min(1,x.position.z)))}else{a.uniform1i(s.useScreenCoordinates,0);a.uniform1i(s.affectedByDistance,x.affectedByDistance?1:0);a.uniformMatrix4fv(s.modelViewMatrix,false,x._modelViewMatrix.elements)}e=x.map.image.width/(x.scaleByViewport?p:1);z[0]=e*t*x.scale.x;z[1]=e*x.scale.y;a.uniform2f(s.uvScale,x.uvScale.x,x.uvScale.y);a.uniform2f(s.uvOffset,x.uvOffset.x,x.uvOffset.y);a.uniform2f(s.alignment,x.alignment.x,x.alignment.y);
+a.uniform1f(s.opacity,x.opacity);a.uniform3f(s.color,x.color.r,x.color.g,x.color.b);a.uniform1f(s.rotation,x.rotation);a.uniform2fv(s.scale,z);if(x.mergeWith3D&&!o){a.enable(a.DEPTH_TEST);o=true}else if(!x.mergeWith3D&&o){a.disable(a.DEPTH_TEST);o=false}c.setBlending(x.blending,x.blendEquation,x.blendSrc,x.blendDst);c.setTexture(x.map,0);a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0)}}a.enable(a.CULL_FACE);a.enable(a.DEPTH_TEST);a.depthMask(true)}}};
 THREE.DepthPassPlugin=function(){this.enabled=false;this.renderTarget=null;var b,a,c,d,e=new THREE.Frustum,f=new THREE.Matrix4;this.init=function(e){b=e.context;a=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:true});c._shadowPass=true;d._shadowPass=true};this.render=
 THREE.DepthPassPlugin=function(){this.enabled=false;this.renderTarget=null;var b,a,c,d,e=new THREE.Frustum,f=new THREE.Matrix4;this.init=function(e){b=e.context;a=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:true});c._shadowPass=true;d._shadowPass=true};this.render=
 function(a,b){this.enabled&&this.update(a,b)};this.update=function(g,h){var i,j,l,n,k,m;b.clearColor(1,1,1,1);b.disable(b.BLEND);a.setDepthTest(true);a.autoUpdateScene&&g.updateMatrixWorld();if(!h._viewMatrixArray)h._viewMatrixArray=new Float32Array(16);if(!h._projectionMatrixArray)h._projectionMatrixArray=new Float32Array(16);h.matrixWorldInverse.getInverse(h.matrixWorld);h.matrixWorldInverse.flattenToArray(h._viewMatrixArray);h.projectionMatrix.flattenToArray(h._projectionMatrixArray);f.multiply(h.projectionMatrix,
 function(a,b){this.enabled&&this.update(a,b)};this.update=function(g,h){var i,j,l,n,k,m;b.clearColor(1,1,1,1);b.disable(b.BLEND);a.setDepthTest(true);a.autoUpdateScene&&g.updateMatrixWorld();if(!h._viewMatrixArray)h._viewMatrixArray=new Float32Array(16);if(!h._projectionMatrixArray)h._projectionMatrixArray=new Float32Array(16);h.matrixWorldInverse.getInverse(h.matrixWorld);h.matrixWorldInverse.flattenToArray(h._viewMatrixArray);h.projectionMatrix.flattenToArray(h._projectionMatrixArray);f.multiply(h.projectionMatrix,
 h.matrixWorldInverse);e.setFromMatrix(f);a.setRenderTarget(this.renderTarget);a.clear();m=g.__webglObjects;i=0;for(j=m.length;i<j;i++){l=m[i];k=l.object;l.render=false;if(k.visible&&(!(k instanceof THREE.Mesh)||!k.frustumCulled||e.contains(k))){k._modelViewMatrix.multiply(h.matrixWorldInverse,k.matrixWorld);l.render=true}}i=0;for(j=m.length;i<j;i++){l=m[i];if(l.render){k=l.object;l=l.buffer;a.setObjectFaces(k);n=k.customDepthMaterial?k.customDepthMaterial:k.geometry.morphTargets.length?d:c;l instanceof
 h.matrixWorldInverse);e.setFromMatrix(f);a.setRenderTarget(this.renderTarget);a.clear();m=g.__webglObjects;i=0;for(j=m.length;i<j;i++){l=m[i];k=l.object;l.render=false;if(k.visible&&(!(k instanceof THREE.Mesh)||!k.frustumCulled||e.contains(k))){k._modelViewMatrix.multiply(h.matrixWorldInverse,k.matrixWorld);l.render=true}}i=0;for(j=m.length;i<j;i++){l=m[i];if(l.render){k=l.object;l=l.buffer;a.setObjectFaces(k);n=k.customDepthMaterial?k.customDepthMaterial:k.geometry.morphTargets.length?d:c;l instanceof

+ 10 - 9
build/custom/ThreeWebGL.js

@@ -17,7 +17,8 @@ a).lengthSq()},getPositionFromMatrix:function(a){this.x=a.elements[12];this.y=a.
 this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1};
 this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1};
 THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w!==void 0?a.w:1;return this},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=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;this.w=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=
 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!==void 0?a.w:1;return this},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=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;this.w=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=
 this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;this.w=this.w-a.w;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a;this.w=this.w/a}else{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())},
 this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;this.w=this.w-a.w;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a;this.w=this.w/a}else{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=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;this.w=this.w+(a.w-this.w)*b;return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]};
+normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;this.w=this.w+(a.w-this.w)*b;return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};
+THREE.EventTarget=function(){var a={};this.addEventListener=function(b,c){a[b]===void 0&&(a[b]=[]);a[b].indexOf(c)===-1&&a[b].push(c)};this.dispatchEvent=function(b){for(var c in a[b.type])a[b.type][c](b)};this.removeEventListener=function(b,c){var d=a[b].indexOf(c);d!==-1&&a[b].splice(d,1)}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]};
 THREE.Frustum.prototype.setFromMatrix=function(a){var b,c=this.planes,d=a.elements,a=d[0];b=d[1];var f=d[2],g=d[3],i=d[4],k=d[5],m=d[6],j=d[7],h=d[8],o=d[9],l=d[10],v=d[11],r=d[12],n=d[13],q=d[14],d=d[15];c[0].set(g-a,j-i,v-h,d-r);c[1].set(g+a,j+i,v+h,d+r);c[2].set(g+b,j+k,v+o,d+n);c[3].set(g-b,j-k,v-o,d-n);c[4].set(g-f,j-m,v-l,d-q);c[5].set(g+f,j+m,v+l,d+q);for(a=0;a<6;a++){b=c[a];b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}};
 THREE.Frustum.prototype.setFromMatrix=function(a){var b,c=this.planes,d=a.elements,a=d[0];b=d[1];var f=d[2],g=d[3],i=d[4],k=d[5],m=d[6],j=d[7],h=d[8],o=d[9],l=d[10],v=d[11],r=d[12],n=d[13],q=d[14],d=d[15];c[0].set(g-a,j-i,v-h,d-r);c[1].set(g+a,j+i,v+h,d+r);c[2].set(g+b,j+k,v+o,d+n);c[3].set(g-b,j-k,v-o,d-n);c[4].set(g-f,j-m,v-l,d-q);c[5].set(g+f,j+m,v+l,d+q);for(a=0;a<6;a++){b=c[a];b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}};
 THREE.Frustum.prototype.contains=function(a){for(var b=this.planes,c=a.matrixWorld,d=c.elements,c=-a.geometry.boundingSphere.radius*c.getMaxScaleOnAxis(),f=0;f<6;f++){a=b[f].x*d[12]+b[f].y*d[13]+b[f].z*d[14]+b[f].w;if(a<=c)return false}return true};THREE.Frustum.__v1=new THREE.Vector3;
 THREE.Frustum.prototype.contains=function(a){for(var b=this.planes,c=a.matrixWorld,d=c.elements,c=-a.geometry.boundingSphere.radius*c.getMaxScaleOnAxis(),f=0;f<6;f++){a=b[f].x*d[12]+b[f].y*d[13]+b[f].z*d[14]+b[f].w;if(a<=c)return false}return true};THREE.Frustum.__v1=new THREE.Vector3;
 THREE.Ray=function(a,b){function c(a,b,c){n.sub(c,a);p=n.dot(b);H=q.add(a,w.copy(b).multiplyScalar(p));return C=c.distanceTo(H)}function d(a,b,c,d){n.sub(d,b);q.sub(c,b);w.sub(a,b);s=n.dot(n);L=n.dot(q);A=n.dot(w);G=q.dot(q);D=q.dot(w);M=1/(s*G-L*L);Q=(G*A-L*D)*M;R=(s*D-L*A)*M;return Q>=0&&R>=0&&Q+R<1}this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;var f=1.0E-4;this.setPrecision=function(a){f=a};var g=new THREE.Vector3,i=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3,
 THREE.Ray=function(a,b){function c(a,b,c){n.sub(c,a);p=n.dot(b);H=q.add(a,w.copy(b).multiplyScalar(p));return C=c.distanceTo(H)}function d(a,b,c,d){n.sub(d,b);q.sub(c,b);w.sub(a,b);s=n.dot(n);L=n.dot(q);A=n.dot(w);G=q.dot(q);D=q.dot(w);M=1/(s*G-L*L);Q=(G*A-L*D)*M;R=(s*D-L*A)*M;return Q>=0&&R>=0&&Q+R<1}this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;var f=1.0E-4;this.setPrecision=function(a){f=a};var g=new THREE.Vector3,i=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3,
@@ -61,7 +62,7 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,applyMatrix:function(a){thi
 this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.getRotationFromMatrix(this.matrix)},add:function(a){if(a===this)console.warn("THREE.Object3D.add: An object can't be added as a child of itself.");else if(a instanceof THREE.Object3D){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__addObject(a)}},remove:function(a){var b=
 this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.getRotationFromMatrix(this.matrix)},add:function(a){if(a===this)console.warn("THREE.Object3D.add: An object can't be added as a child of itself.");else if(a instanceof THREE.Object3D){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__addObject(a)}},remove:function(a){var b=
 this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__removeObject(a)}},getChildByName:function(a,b){var c,d,f;c=0;for(d=this.children.length;c<d;c++){f=this.children[c];if(f.name===a)return f;if(b){f=f.getChildByName(a,b);if(f!==void 0)return f}}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,
 this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__removeObject(a)}},getChildByName:function(a,b){var c,d,f;c=0;for(d=this.children.length;c<d;c++){f=this.children[c];if(f.name===a)return f;if(b){f=f.getChildByName(a,b);if(f!==void 0)return f}}},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=true},updateMatrixWorld:function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false;a=true}for(var b=0,c=this.children.length;b<
 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=true},updateMatrixWorld:function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false;a=true}for(var b=0,c=this.children.length;b<
-c;b++)this.children[b].updateMatrixWorld(a)},worldToLocal:function(a){if(!this.__inverseMatrixWorld)this.__inverseMatrixWorld=new THREE.Matrix4;return this.__inverseMatrixWorld.getInverse(this.matrixWorld).multiplyVector3(a)},localToWorld:function(a){return this.matrixWorld.multiplyVector3(a)}};THREE.Object3DCount=0;
+c;b++)this.children[b].updateMatrixWorld(a)},worldToLocal:function(a){return THREE.Object3D.__m1.getInverse(this.matrixWorld).multiplyVector3(a)},localToWorld:function(a){return this.matrixWorld.multiplyVector3(a)}};THREE.Object3D.__m1=new THREE.Matrix4;THREE.Object3DCount=0;
 THREE.Projector=function(){function a(){var a=i[g]=i[g]||new THREE.RenderableObject;g++;return a}function b(){var a=j[m]=j[m]||new THREE.RenderableVertex;m++;return a}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,f=a.z+a.w,g=b.z+b.w,e=-a.z+a.w,i=-b.z+b.w;if(f>=0&&g>=0&&e>=0&&i>=0)return true;if(f<0&&g<0||e<0&&i<0)return false;f<0?c=Math.max(c,f/(f-g)):g<0&&(d=Math.min(d,f/(f-g)));e<0?c=Math.max(c,e/(e-i)):i<0&&(d=Math.min(d,e/(e-i)));if(d<c)return false;a.lerpSelf(b,c);b.lerpSelf(a,1-
 THREE.Projector=function(){function a(){var a=i[g]=i[g]||new THREE.RenderableObject;g++;return a}function b(){var a=j[m]=j[m]||new THREE.RenderableVertex;m++;return a}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,f=a.z+a.w,g=b.z+b.w,e=-a.z+a.w,i=-b.z+b.w;if(f>=0&&g>=0&&e>=0&&i>=0)return true;if(f<0&&g<0||e<0&&i<0)return false;f<0?c=Math.max(c,f/(f-g)):g<0&&(d=Math.min(d,f/(f-g)));e<0?c=Math.max(c,e/(e-i)):i<0&&(d=Math.min(d,e/(e-i)));if(d<c)return false;a.lerpSelf(b,c);b.lerpSelf(a,1-
 d);return true}var f,g,i=[],k,m,j=[],h,o,l=[],v,r=[],n,q,w=[],p,H,C=[],s={objects:[],sprites:[],lights:[],elements:[]},L=new THREE.Vector3,A=new THREE.Vector4,G=new THREE.Matrix4,D=new THREE.Matrix4,M=new THREE.Frustum,Q=new THREE.Vector4,R=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);G.multiply(b.projectionMatrix,b.matrixWorldInverse);G.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);
 d);return true}var f,g,i=[],k,m,j=[],h,o,l=[],v,r=[],n,q,w=[],p,H,C=[],s={objects:[],sprites:[],lights:[],elements:[]},L=new THREE.Vector3,A=new THREE.Vector4,G=new THREE.Matrix4,D=new THREE.Matrix4,M=new THREE.Frustum,Q=new THREE.Vector4,R=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);G.multiply(b.projectionMatrix,b.matrixWorldInverse);G.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);
 G.multiply(b.matrixWorld,b.projectionMatrixInverse);G.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectGraph=function(b,d){g=0;s.objects.length=0;s.sprites.length=0;s.lights.length=0;var i=function(b){if(b.visible!==false){if((b instanceof THREE.Mesh||b instanceof THREE.Line)&&(b.frustumCulled===false||M.contains(b))){L.copy(b.matrixWorld.getPosition());
 G.multiply(b.matrixWorld,b.projectionMatrixInverse);G.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectGraph=function(b,d){g=0;s.objects.length=0;s.sprites.length=0;s.lights.length=0;var i=function(b){if(b.visible!==false){if((b instanceof THREE.Mesh||b instanceof THREE.Line)&&(b.frustumCulled===false||M.contains(b))){L.copy(b.matrixWorld.getPosition());
@@ -109,7 +110,7 @@ THREE.OrthographicCamera=function(a,b,c,d,f,g){THREE.Camera.call(this);this.left
 THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a!==void 0?a:50;this.aspect=b!==void 0?b:1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;THREE.PerspectiveCamera.prototype.setLens=function(a,b){this.fov=2*Math.atan((b!==void 0?b:24)/(a*2))*(180/Math.PI);this.updateProjectionMatrix()};
 THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a!==void 0?a:50;this.aspect=b!==void 0?b:1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;THREE.PerspectiveCamera.prototype.setLens=function(a,b){this.fov=2*Math.atan((b!==void 0?b:24)/(a*2))*(180/Math.PI);this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,f,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=f;this.height=g;this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,f,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=f;this.height=g;this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};
 THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};
-THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;
+THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;
 THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0;this.onlyShadow=this.castShadow=false;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=false;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;
 THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0;this.onlyShadow=this.castShadow=false;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=false;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;
 this.shadowCascade=false;this.shadowCascadeOffset=new THREE.Vector3(0,0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
 this.shadowCascade=false;this.shadowCascadeOffset=new THREE.Vector3(0,0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
 THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
 THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
@@ -135,7 +136,8 @@ g,i,h,[new THREE.Vector3(K[l*3],K[l*3+1],K[l*3+2]),new THREE.Vector3(q,r,j),new
 A(a,z+20+16);n=A(a,z+20+20);q=A(a,z+20+24);w=A(a,z+20+28);p=A(a,z+20+32);H=A(a,z+20+36);C=A(a,z+20+40);z=z+c;c=f*3+h;W=f*4+h;E=b*c;e=r*(c+m*3);f=n*(c+j*3);h=q*(c+m*3+j*3);c=w*W;m=p*(W+m*4);j=H*(W+j*4);z=z+function(b){var b=new Float32Array(a,b,o*3),c,e,d,f;for(c=0;c<o;c++){e=b[c*3];d=b[c*3+1];f=b[c*3+2];S.vertices.push(new THREE.Vector3(e,d,f))}return o*3*Float32Array.BYTES_PER_ELEMENT}(z);z=z+function(b){if(l){var b=new Int8Array(a,b,l*3),c,e,d,f;for(c=0;c<l;c++){e=b[c*3];d=b[c*3+1];f=b[c*3+2];K.push(e/
 A(a,z+20+16);n=A(a,z+20+20);q=A(a,z+20+24);w=A(a,z+20+28);p=A(a,z+20+32);H=A(a,z+20+36);C=A(a,z+20+40);z=z+c;c=f*3+h;W=f*4+h;E=b*c;e=r*(c+m*3);f=n*(c+j*3);h=q*(c+m*3+j*3);c=w*W;m=p*(W+m*4);j=H*(W+j*4);z=z+function(b){var b=new Float32Array(a,b,o*3),c,e,d,f;for(c=0;c<o;c++){e=b[c*3];d=b[c*3+1];f=b[c*3+2];S.vertices.push(new THREE.Vector3(e,d,f))}return o*3*Float32Array.BYTES_PER_ELEMENT}(z);z=z+function(b){if(l){var b=new Int8Array(a,b,l*3),c,e,d,f;for(c=0;c<l;c++){e=b[c*3];d=b[c*3+1];f=b[c*3+2];K.push(e/
 127,d/127,f/127)}}return l*3*Int8Array.BYTES_PER_ELEMENT}(z);z=z+s(l*3);z=z+function(b){if(v){var b=new Float32Array(a,b,v*2),c,e,d;for(c=0;c<v;c++){e=b[c*2];d=b[c*2+1];I.push(e,d)}}return v*2*Float32Array.BYTES_PER_ELEMENT}(z);E=z+E+s(b*2);e=E+e+s(r*2);f=e+f+s(n*2);h=f+h+s(q*2);c=h+c+s(w*2);m=c+m+s(p*2);j=m+j+s(H*2);(function(a){if(n){var b=a+n*Uint32Array.BYTES_PER_ELEMENT*3;M(n,a,b+n*Uint32Array.BYTES_PER_ELEMENT*3);G(n,b)}})(e);(function(a){if(q){var b=a+q*Uint32Array.BYTES_PER_ELEMENT*3,c=b+
 127,d/127,f/127)}}return l*3*Int8Array.BYTES_PER_ELEMENT}(z);z=z+s(l*3);z=z+function(b){if(v){var b=new Float32Array(a,b,v*2),c,e,d;for(c=0;c<v;c++){e=b[c*2];d=b[c*2+1];I.push(e,d)}}return v*2*Float32Array.BYTES_PER_ELEMENT}(z);E=z+E+s(b*2);e=E+e+s(r*2);f=e+f+s(n*2);h=f+h+s(q*2);c=h+c+s(w*2);m=c+m+s(p*2);j=m+j+s(H*2);(function(a){if(n){var b=a+n*Uint32Array.BYTES_PER_ELEMENT*3;M(n,a,b+n*Uint32Array.BYTES_PER_ELEMENT*3);G(n,b)}})(e);(function(a){if(q){var b=a+q*Uint32Array.BYTES_PER_ELEMENT*3,c=b+
 q*Uint32Array.BYTES_PER_ELEMENT*3;R(q,a,b,c+q*Uint32Array.BYTES_PER_ELEMENT*3);G(q,c)}})(f);(function(a){if(H){var b=a+H*Uint32Array.BYTES_PER_ELEMENT*4;Q(H,a,b+H*Uint32Array.BYTES_PER_ELEMENT*4);D(H,b)}})(m);(function(a){if(C){var b=a+C*Uint32Array.BYTES_PER_ELEMENT*4,c=b+C*Uint32Array.BYTES_PER_ELEMENT*4;Z(C,a,b,c+C*Uint32Array.BYTES_PER_ELEMENT*4);D(C,c)}})(j);b&&M(b,z,z+b*Uint32Array.BYTES_PER_ELEMENT*3);(function(a){if(r){var b=a+r*Uint32Array.BYTES_PER_ELEMENT*3;R(r,a,b,b+r*Uint32Array.BYTES_PER_ELEMENT*
 q*Uint32Array.BYTES_PER_ELEMENT*3;R(q,a,b,c+q*Uint32Array.BYTES_PER_ELEMENT*3);G(q,c)}})(f);(function(a){if(H){var b=a+H*Uint32Array.BYTES_PER_ELEMENT*4;Q(H,a,b+H*Uint32Array.BYTES_PER_ELEMENT*4);D(H,b)}})(m);(function(a){if(C){var b=a+C*Uint32Array.BYTES_PER_ELEMENT*4,c=b+C*Uint32Array.BYTES_PER_ELEMENT*4;Z(C,a,b,c+C*Uint32Array.BYTES_PER_ELEMENT*4);D(C,c)}})(j);b&&M(b,z,z+b*Uint32Array.BYTES_PER_ELEMENT*3);(function(a){if(r){var b=a+r*Uint32Array.BYTES_PER_ELEMENT*3;R(r,a,b,b+r*Uint32Array.BYTES_PER_ELEMENT*
-3)}})(E);w&&Q(w,h,h+w*Uint32Array.BYTES_PER_ELEMENT*4);(function(a){if(p){var b=a+p*Uint32Array.BYTES_PER_ELEMENT*4;Z(p,a,b,b+p*Uint32Array.BYTES_PER_ELEMENT*4)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;b(new f(c))};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;
+3)}})(E);w&&Q(w,h,h+w*Uint32Array.BYTES_PER_ELEMENT*4);(function(a){if(p){var b=a+p*Uint32Array.BYTES_PER_ELEMENT*4;Z(p,a,b,b+p*Uint32Array.BYTES_PER_ELEMENT*4)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;b(new f(c))};THREE.ImageLoader=function(){THREE.EventTarget.call(this)};
+THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,crossOrigin:"anonymous",load:function(a){var b=this,c=new Image;c.addEventListener("load",function(){b.dispatchEvent({type:"complete",image:c})},false);c.addEventListener("error",function(){b.dispatchEvent({type:"error"})},false);c.crossOrigin=this.crossOrigin;c.src=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;
 THREE.JSONLoader.prototype.load=function(a,b,c){c=c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.load=function(a,b,c){c=c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,f){var g=new XMLHttpRequest,i=0;g.onreadystatechange=function(){if(g.readyState===g.DONE)if(g.status===200||g.status===0){if(g.responseText){var k=JSON.parse(g.responseText);a.createModel(k,c,d)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+g.status+"]");else if(g.readyState===g.LOADING){if(f){i===0&&(i=g.getResponseHeader("Content-Length"));
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,f){var g=new XMLHttpRequest,i=0;g.onreadystatechange=function(){if(g.readyState===g.DONE)if(g.status===200||g.status===0){if(g.responseText){var k=JSON.parse(g.responseText);a.createModel(k,c,d)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+g.status+"]");else if(g.readyState===g.LOADING){if(f){i===0&&(i=g.getResponseHeader("Content-Length"));
 f({total:i,loaded:g.responseText.length})}}else g.readyState===g.HEADERS_RECEIVED&&(i=g.getResponseHeader("Content-Length"))};g.open("GET",b,true);g.overrideMimeType&&g.overrideMimeType("text/plain; charset=x-user-defined");g.setRequestHeader("Content-Type","text/plain");g.send(null)};
 f({total:i,loaded:g.responseText.length})}}else g.readyState===g.HEADERS_RECEIVED&&(i=g.getResponseHeader("Content-Length"))};g.open("GET",b,true);g.overrideMimeType&&g.overrideMimeType("text/plain; charset=x-user-defined");g.setRequestHeader("Content-Type","text/plain");g.send(null)};
@@ -189,16 +191,15 @@ THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.im
 THREE.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.ParticleBasicMaterial({color:Math.random()*16777215});this.sortParticles=false;if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius}this.frustumCulled=false};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;
 THREE.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.ParticleBasicMaterial({color:Math.random()*16777215});this.sortParticles=false;if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius}this.frustumCulled=false};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;
 THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.LineBasicMaterial({color:Math.random()*16777215});this.type=c!==void 0?c:THREE.LineStrip;this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere())};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
 THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.LineBasicMaterial({color:Math.random()*16777215});this.type=c!==void 0?c:THREE.LineStrip;this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere())};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
 THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.MeshBasicMaterial({color:Math.random()*16777215,wireframe:true});if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius;if(this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++){this.morphTargetInfluences.push(0);
 THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.MeshBasicMaterial({color:Math.random()*16777215,wireframe:true});if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius;if(this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++){this.morphTargetInfluences.push(0);
-this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}}}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
-THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
-THREE.Bone.prototype.update=function(a,b){this.matrixAutoUpdate&&(b=b|this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix);this.matrixWorldNeedsUpdate=false;b=true}var c,d=this.children.length;for(c=0;c<d;c++)this.children[c].update(this.skinMatrix,b)};
+this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}}}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4};
+THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.update=function(a,b){this.matrixAutoUpdate&&(b=b|this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix);this.matrixWorldNeedsUpdate=false;b=true}var c,d=this.children.length;for(c=0;c<d;c++)this.children[c].update(this.skinMatrix,b)};
 THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var c,d,f,g,i,k;if(this.geometry.bones!==void 0){for(c=0;c<this.geometry.bones.length;c++){f=this.geometry.bones[c];g=f.pos;i=f.rotq;k=f.scl;d=this.addBone();d.name=f.name;d.position.set(g[0],g[1],g[2]);d.quaternion.set(i[0],i[1],i[2],i[3]);d.useQuaternion=true;k!==void 0?d.scale.set(k[0],k[1],k[2]):d.scale.set(1,1,1)}for(c=0;c<this.bones.length;c++){f=this.geometry.bones[c];
 THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var c,d,f,g,i,k;if(this.geometry.bones!==void 0){for(c=0;c<this.geometry.bones.length;c++){f=this.geometry.bones[c];g=f.pos;i=f.rotq;k=f.scl;d=this.addBone();d.name=f.name;d.position.set(g[0],g[1],g[2]);d.quaternion.set(i[0],i[1],i[2],i[3]);d.useQuaternion=true;k!==void 0?d.scale.set(k[0],k[1],k[2]):d.scale.set(1,1,1)}for(c=0;c<this.bones.length;c++){f=this.geometry.bones[c];
 d=this.bones[c];f.parent===-1?this.add(d):this.bones[f.parent].add(d)}this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;THREE.SkinnedMesh.prototype.addBone=function(a){a===void 0&&(a=new THREE.Bone(this));this.bones.push(a);return a};
 d=this.bones[c];f.parent===-1?this.add(d):this.bones[f.parent].add(d)}this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;THREE.SkinnedMesh.prototype.addBone=function(a){a===void 0&&(a=new THREE.Bone(this));this.bones.push(a);return a};
 THREE.SkinnedMesh.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false}for(var a=0,b=this.children.length;a<b;a++){var c=this.children[a];c instanceof THREE.Bone?c.update(this.identityMatrix,false):c.updateMatrixWorld(true)}for(var b=this.bones.length,c=this.bones,d=this.boneMatrices,a=0;a<b;a++)c[a].skinMatrix.flattenToArrayOffset(d,
 THREE.SkinnedMesh.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false}for(var a=0,b=this.children.length;a<b;a++){var c=this.children[a];c instanceof THREE.Bone?c.update(this.identityMatrix,false):c.updateMatrixWorld(true)}for(var b=this.bones.length,c=this.bones,d=this.boneMatrices,a=0;a<b;a++)c[a].skinMatrix.flattenToArrayOffset(d,
 a*16)};
 a*16)};
 THREE.SkinnedMesh.prototype.pose=function(){this.updateMatrixWorld(true);for(var a,b=[],c=0;c<this.bones.length;c++){a=this.bones[c];var d=new THREE.Matrix4;d.getInverse(a.skinMatrix);b.push(d);a.skinMatrix.flattenToArrayOffset(this.boneMatrices,c*16)}if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];for(a=0;a<this.geometry.skinIndices.length;a++){var c=this.geometry.vertices[a],f=this.geometry.skinIndices[a].x,g=this.geometry.skinIndices[a].y,d=
 THREE.SkinnedMesh.prototype.pose=function(){this.updateMatrixWorld(true);for(var a,b=[],c=0;c<this.bones.length;c++){a=this.bones[c];var d=new THREE.Matrix4;d.getInverse(a.skinMatrix);b.push(d);a.skinMatrix.flattenToArrayOffset(this.boneMatrices,c*16)}if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];for(a=0;a<this.geometry.skinIndices.length;a++){var c=this.geometry.vertices[a],f=this.geometry.skinIndices[a].x,g=this.geometry.skinIndices[a].y,d=
 new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesA.push(b[f].multiplyVector3(d));d=new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesB.push(b[g].multiplyVector3(d));if(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1){c=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5;this.geometry.skinWeights[a].x=this.geometry.skinWeights[a].x+c;this.geometry.skinWeights[a].y=this.geometry.skinWeights[a].y+c}}}};
 new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesA.push(b[f].multiplyVector3(d));d=new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesB.push(b[g].multiplyVector3(d));if(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1){c=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5;this.geometry.skinWeights[a].x=this.geometry.skinWeights[a].x+c;this.geometry.skinWeights[a].y=this.geometry.skinWeights[a].y+c}}}};
-THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b};THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;
+THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b};THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;
 THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c<this.LODs.length;c++)if(b<this.LODs[c].visibleAtDistance)break;this.LODs.splice(c,0,{visibleAtDistance:b,object3D:a});this.add(a)};
 THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c<this.LODs.length;c++)if(b<this.LODs[c].visibleAtDistance)break;this.LODs.splice(c,0,{visibleAtDistance:b,object3D:a});this.add(a)};
 THREE.LOD.prototype.update=function(a){if(this.LODs.length>1){a.matrixWorldInverse.getInverse(a.matrixWorld);a=a.matrixWorldInverse;a=-(a.elements[2]*this.matrixWorld.elements[12]+a.elements[6]*this.matrixWorld.elements[13]+a.elements[10]*this.matrixWorld.elements[14]+a.elements[14]);this.LODs[0].object3D.visible=true;for(var b=1;b<this.LODs.length;b++)if(a>=this.LODs[b].visibleAtDistance){this.LODs[b-1].object3D.visible=false;this.LODs[b].object3D.visible=true}else break;for(;b<this.LODs.length;b++)this.LODs[b].object3D.visible=
 THREE.LOD.prototype.update=function(a){if(this.LODs.length>1){a.matrixWorldInverse.getInverse(a.matrixWorld);a=a.matrixWorldInverse;a=-(a.elements[2]*this.matrixWorld.elements[12]+a.elements[6]*this.matrixWorld.elements[13]+a.elements[10]*this.matrixWorld.elements[14]+a.elements[14]);this.LODs[0].object3D.visible=true;for(var b=1;b<this.LODs.length;b++)if(a>=this.LODs[b].visibleAtDistance){this.LODs[b-1].object3D.visible=false;this.LODs[b].object3D.visible=true}else break;for(;b<this.LODs.length;b++)this.LODs[b].object3D.visible=
 false}};
 false}};
@@ -393,7 +394,7 @@ THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d
 this.lines=new THREE.Line(this.lineGeometry,this.lineMaterial,THREE.LinePieces);this.add(this.lines)};THREE.CameraHelper.prototype=new THREE.Object3D;THREE.CameraHelper.prototype.constructor=THREE.CameraHelper;
 this.lines=new THREE.Line(this.lineGeometry,this.lineMaterial,THREE.LinePieces);this.add(this.lines)};THREE.CameraHelper.prototype=new THREE.Object3D;THREE.CameraHelper.prototype.constructor=THREE.CameraHelper;
 THREE.CameraHelper.prototype.update=function(){function a(a,d,f,g){THREE.CameraHelper.__v.set(d,f,g);THREE.CameraHelper.__projector.unprojectVector(THREE.CameraHelper.__v,THREE.CameraHelper.__c);a=b.pointMap[a];if(a!==void 0){d=0;for(f=a.length;d<f;d++)b.lineGeometry.vertices[a[d]].copy(THREE.CameraHelper.__v)}}var b=this;THREE.CameraHelper.__c.projectionMatrix.copy(this.camera.projectionMatrix);a("c",0,0,-1);a("t",0,0,1);a("n1",-1,-1,-1);a("n2",1,-1,-1);a("n3",-1,1,-1);a("n4",1,1,-1);a("f1",-1,-1,
 THREE.CameraHelper.prototype.update=function(){function a(a,d,f,g){THREE.CameraHelper.__v.set(d,f,g);THREE.CameraHelper.__projector.unprojectVector(THREE.CameraHelper.__v,THREE.CameraHelper.__c);a=b.pointMap[a];if(a!==void 0){d=0;for(f=a.length;d<f;d++)b.lineGeometry.vertices[a[d]].copy(THREE.CameraHelper.__v)}}var b=this;THREE.CameraHelper.__c.projectionMatrix.copy(this.camera.projectionMatrix);a("c",0,0,-1);a("t",0,0,1);a("n1",-1,-1,-1);a("n2",1,-1,-1);a("n3",-1,1,-1);a("n4",1,1,-1);a("f1",-1,-1,
 1);a("f2",1,-1,1);a("f3",-1,1,1);a("f4",1,1,1);a("u1",0.7,1.1,-1);a("u2",-0.7,1.1,-1);a("u3",0,2,-1);a("cf1",-1,0,1);a("cf2",1,0,1);a("cf3",0,-1,1);a("cf4",0,1,1);a("cn1",-1,0,-1);a("cn2",1,0,-1);a("cn3",0,-1,-1);a("cn4",0,1,-1);this.lineGeometry.verticesNeedUpdate=true};THREE.CameraHelper.__projector=new THREE.Projector;THREE.CameraHelper.__v=new THREE.Vector3;THREE.CameraHelper.__c=new THREE.Camera;
 1);a("f2",1,-1,1);a("f3",-1,1,1);a("f4",1,1,1);a("u1",0.7,1.1,-1);a("u2",-0.7,1.1,-1);a("u3",0,2,-1);a("cf1",-1,0,1);a("cf2",1,0,1);a("cf3",0,-1,1);a("cf4",0,1,1);a("cn1",-1,0,-1);a("cn2",1,0,-1);a("cn3",0,-1,-1);a("cn4",0,1,-1);this.lineGeometry.verticesNeedUpdate=true};THREE.CameraHelper.__projector=new THREE.Projector;THREE.CameraHelper.__v=new THREE.Vector3;THREE.CameraHelper.__c=new THREE.Camera;
-THREE.LensFlare=function(a,b,c,d,f){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;a!==void 0&&this.add(a,b,c,d,f)};THREE.LensFlare.prototype=new THREE.Object3D;THREE.LensFlare.prototype.constructor=THREE.LensFlare;THREE.LensFlare.prototype.supr=THREE.Object3D.prototype;
+THREE.LensFlare=function(a,b,c,d,f){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;a!==void 0&&this.add(a,b,c,d,f)};THREE.LensFlare.prototype=new THREE.Object3D;THREE.LensFlare.prototype.constructor=THREE.LensFlare;
 THREE.LensFlare.prototype.add=function(a,b,c,d,f,g){b===void 0&&(b=-1);c===void 0&&(c=0);g===void 0&&(g=1);f===void 0&&(f=new THREE.Color(16777215));if(d===void 0)d=THREE.NormalBlending;c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:g,color:f,blending:d})};
 THREE.LensFlare.prototype.add=function(a,b,c,d,f,g){b===void 0&&(b=-1);c===void 0&&(c=0);g===void 0&&(g=1);f===void 0&&(f=new THREE.Color(16777215));if(d===void 0)d=THREE.NormalBlending;c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:g,color:f,blending:d})};
 THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=-this.positionScreen.x*2,f=-this.positionScreen.y*2;for(a=0;a<b;a++){c=this.lensFlares[a];c.x=this.positionScreen.x+d*c.distance;c.y=this.positionScreen.y+f*c.distance;c.wantedRotation=c.x*Math.PI*0.25;c.rotation=c.rotation+(c.wantedRotation-c.rotation)*0.25}};THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(){}};THREE.ImmediateRenderObject.prototype=new THREE.Object3D;
 THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=-this.positionScreen.x*2,f=-this.positionScreen.y*2;for(a=0;a<b;a++){c=this.lensFlares[a];c.x=this.positionScreen.x+d*c.distance;c.y=this.positionScreen.y+f*c.distance;c.wantedRotation=c.x*Math.PI*0.25;c.rotation=c.rotation+(c.wantedRotation-c.rotation)*0.25}};THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(){}};THREE.ImmediateRenderObject.prototype=new THREE.Object3D;
 THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;
 THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;