Browse Source

Moved QuakeCamera and PathCamera into extras/cameras.

alteredq 14 years ago
parent
commit
1c466f26e7

+ 23 - 24
build/Three.js

@@ -82,29 +82,9 @@ THREE.Animation.prototype.getPrevKeyWith=function(a,c,b){var d=this.data.hierarc
 THREE.Camera=function(a,c,b,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=c||1;this.near=b||0.1;this.far=d||2E3;this.target=e||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;
 THREE.Camera.prototype.translate=function(a,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(a));this.target.position.addSelf(c.multiplyScalar(a))};THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Camera.prototype.updateMatrix=function(){this.update(undefined,!0)};
 THREE.Camera.prototype.update=function(a,c,b){if(this.useTarget){this.matrix.lookAt(this.position,this.target.position,this.up);this.matrix.setPosition(this.position);a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);c=!0}else{this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=
-!1;c=!0;THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse)}}for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,c,b)};
-THREE.QuakeCamera=function(a){function c(b,d){return function(){d.apply(b,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.dragToLook=!1;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.domElement=document;if(a){if(a.movementSpeed!==undefined)this.movementSpeed=a.movementSpeed;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.noFly!==undefined)this.noFly=
-a.noFly;if(a.lookVertical!==undefined)this.lookVertical=a.lookVertical;if(a.autoForward!==undefined)this.autoForward=a.autoForward;if(a.dragToLook!==undefined)this.dragToLook=a.dragToLook;if(a.heightSpeed!==undefined)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==undefined)this.heightCoef=a.heightCoef;if(a.heightMin!==undefined)this.heightMin=a.heightMin;if(a.heightMax!==undefined)this.heightMax=a.heightMax;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=
-this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.moveForward=!1;this.moveBackward=!1;this.moveLeft=!1;this.moveRight=!1;this.mouseDragOn=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(b){b.preventDefault();b.stopPropagation();if(!this.dragToLook)switch(b.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(b){b.preventDefault();b.stopPropagation();if(!this.dragToLook)switch(b.button){case 0:this.moveForward=
-!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(b){this.mouseX=b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.onKeyDown=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0}};this.onKeyUp=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=
-!1;break;case 39:case 68:this.moveRight=!1}};this.update=function(){this.autoSpeedFactor=this.heightSpeed?((this.position.y<this.heightMin?this.heightMin:this.position.y>this.heightMax?this.heightMax:this.position.y)-this.heightMin)*this.heightCoef:0;(this.moveForward||this.autoForward)&&this.translateZ(-(this.movementSpeed+this.autoSpeedFactor));this.moveBackward&&this.translateZ(this.movementSpeed);this.moveLeft&&this.translateX(-this.movementSpeed);this.moveRight&&this.translateX(this.movementSpeed);
-var b=this.lookSpeed;this.dragToLook&&!this.mouseDragOn&&(b=0);this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;b=this.target.position;var d=this.position;b.x=d.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=d.y+100*Math.cos(this.phi);b.z=d.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},
-!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
-THREE.QuakeCamera.prototype.translate=function(a,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(a));this.target.position.addSelf(c.multiplyScalar(a))};
-THREE.PathCamera=function(a){function c(o,w){var y=o[0]-w[0],B=o[1]-w[1],u=o[2]-w[2];return Math.sqrt(y*y+B*B+u*u)}function b(o,w,y,B){var u={name:y,fps:0.6,length:B,hierarchy:[]},E,x,M=w.length,I=g(w),W=0;E=M-1;x={parent:-1,keys:[]};x.keys[0]={time:0,pos:w[0],rot:[0,0,0,1],scl:[1,1,1]};x.keys[E]={time:B,pos:w[E],rot:[0,0,0,1],scl:[1,1,1]};for(E=1;E<M-1;E++){W=B*I.chunks[E]/I.total;x.keys[E]={time:W,pos:w[E]}}u.hierarchy[0]=x;THREE.AnimationHandler.add(u);return new THREE.Animation(o,y,THREE.AnimationHandler.CATMULLROM_FORWARD,
-!1)}function d(o){var w,y,B=o.length,u=[];for(w=0;w<B;w++){y=o[w];u[w]={x:y[0],y:y[1],z:y[2]}}return u}function e(o,w){var y,B,u,E,x,M,I=[],W=d(o),N=new THREE.Spline,f=g(o);I.push(o[0]);for(y=1;y<o.length;y++){linearDistance=c(o[y],o[y-1]);realDistance=f.chunks[y]-f.chunks[y-1];M=Math.ceil(w*realDistance/f.total);E=(y-1)/(o.length-1);x=y/(o.length-1);for(B=1;B<M-1;B++){u=E+B*(1/M)*(x-E);position=N.getPoint(W,u);I.push([position.x,position.y,position.z])}I.push(o[y])}return I}function g(o){var w,y=
-d(o),B=new THREE.Spline,u=w=w=0,E=[0],x=0,M=[o[0][0],o[0][1],o[0][2]];for(o=1;o<y.length*100;o++){w=o/(y.length*100);position=B.getPoint(y,w);x+=c([position.x,position.y,position.z],M);M=[position.x,position.y,position.z];w*=y.length-1;w=Math.floor(w);if(w!=u){E[w]=x;u=w}}E[E.length]=x;return{chunks:E,total:x}}function h(o,w){var y,B,u=new THREE.Geometry,E=new THREE.Spline,x=d(o);for(y=0;y<x.length*w;y++){B=y/(x.length*w);B=E.getPoint(x,B);u.vertices[y]=new THREE.Vertex(new THREE.Vector3(B.x,B.y,
-B.z))}return u}function j(o,w){var y=h(w,10),B=h(w,10),u=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(y,u);particleObj=new THREE.ParticleSystem(B,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);o.addChild(lineObj);particleObj.scale.set(1,1,1);o.addChild(particleObj);B=new Sphere(1,16,8);u=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<w.length;i++){y=new THREE.Mesh(B,u);y.position.set(w[i][0],w[i][1],w[i][2]);y.updateMatrix();
-o.addChild(y)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookVertical=!0;this.lookHorizontal=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};
-this.domElement=document;if(a){if(a.duration!==undefined)this.duration=a.duration*1E3;if(a.waypoints!==undefined)this.waypoints=a.waypoints;if(a.useConstantSpeed!==undefined)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==undefined)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==undefined)this.createDebugPath=a.createDebugPath;if(a.createDebugDummy!==undefined)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==
-undefined)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==undefined)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==undefined)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==undefined)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var k=Math.PI*2,n=Math.PI/180;this.update=
-function(o,w,y){var B,u;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*n;this.theta=this.lon*n;B=this.phi%k;this.phi=B>=0?B:B+k;B=this.verticalAngleMap.srcRange;u=this.verticalAngleMap.dstRange;this.phi=(this.phi-B[0])*(u[1]-u[0])/(B[1]-B[0])+u[0];B=this.horizontalAngleMap.srcRange;u=this.horizontalAngleMap.dstRange;
-this.theta=(this.theta-B[0])*(u[1]-u[0])/(B[1]-B[0])+u[0];B=this.target.position;B.x=100*Math.sin(this.phi)*Math.cos(this.theta);B.y=100*Math.cos(this.phi);B.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,o,w,y)};this.onMouseMove=function(o){this.mouseX=o.clientX-this.windowHalfX;this.mouseY=o.clientY-this.windowHalfY};if(this.useConstantSpeed)this.waypoints=e(this.waypoints,this.resamplingCoef);if(this.createDebugDummy){a=new THREE.MeshLambertMaterial({color:30719});var t=
-new THREE.MeshLambertMaterial({color:65280}),z=new Cube(10,10,20),v=new Cube(2,2,10);this.animationParent=new THREE.Mesh(z,a);a=new THREE.Mesh(v,t);a.position.set(0,10,0);this.animation=b(this.animationParent,this.waypoints,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else{this.animation=b(this.animationParent,this.waypoints,this.id,this.duration);this.animationParent.addChild(this.target);this.animationParent.addChild(this)}this.createDebugPath&&
-j(this.debugPath,this.waypoints);this.domElement.addEventListener("mousemove",function(o,w){return function(){w.apply(o,arguments)}}(this,this.onMouseMove),!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;
-THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=c||1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
-THREE.PointLight=function(a,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=c||1};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.FlatShading=0;THREE.SmoothShading=1;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.BillboardBlending=3;THREE.ReverseSubtractiveBlending=4;THREE.MaterialCounter={value:0};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};
-THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};
+!1;c=!0;THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse)}}for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,c,b)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;
+THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=c||1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=c||1};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
+THREE.FlatShading=0;THREE.SmoothShading=1;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.BillboardBlending=3;THREE.ReverseSubtractiveBlending=4;THREE.MaterialCounter={value:0};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};
 THREE.LineBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.blending=THREE.NormalBlending;this.depthTest=!0;this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=!1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.linewidth!==undefined)this.linewidth=
 a.linewidth;if(a.linecap!==undefined)this.linecap=a.linecap;if(a.linejoin!==undefined)this.linejoin=a.linejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors}};
 THREE.MeshBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=!1;this.skinning=!1;if(a){a.color!==undefined&&
@@ -371,7 +351,26 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 2,11,1,5,1,11,-1,0,2,5,0,5,9,2,11,5,4,5,8,11,8,5,-1,9,4,5,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,5,10,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1,5,10,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1,3,10,2,3,5,10,3,8,5,4,5,8,0,1,9,-1,5,10,2,5,2,4,1,9,2,9,4,2,-1,-1,-1,-1,8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1,0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,4,5,8,5,3,9,0,5,0,3,5,-1,-1,-1,-1,9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,11,7,4,9,11,9,10,11,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,7,9,11,7,9,10,11,-1,-1,-1,-1,1,10,11,1,11,
 4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
 -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,
-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?this.addStatusElement():null};
+2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);
+THREE.QuakeCamera=function(a){function c(b,d){return function(){d.apply(b,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.dragToLook=!1;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.domElement=document;if(a){if(a.movementSpeed!==undefined)this.movementSpeed=a.movementSpeed;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.noFly!==undefined)this.noFly=
+a.noFly;if(a.lookVertical!==undefined)this.lookVertical=a.lookVertical;if(a.autoForward!==undefined)this.autoForward=a.autoForward;if(a.dragToLook!==undefined)this.dragToLook=a.dragToLook;if(a.heightSpeed!==undefined)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==undefined)this.heightCoef=a.heightCoef;if(a.heightMin!==undefined)this.heightMin=a.heightMin;if(a.heightMax!==undefined)this.heightMax=a.heightMax;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=
+this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.moveForward=!1;this.moveBackward=!1;this.moveLeft=!1;this.moveRight=!1;this.mouseDragOn=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(b){b.preventDefault();b.stopPropagation();if(!this.dragToLook)switch(b.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(b){b.preventDefault();b.stopPropagation();if(!this.dragToLook)switch(b.button){case 0:this.moveForward=
+!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(b){this.mouseX=b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.onKeyDown=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0}};this.onKeyUp=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=
+!1;break;case 39:case 68:this.moveRight=!1}};this.update=function(){this.autoSpeedFactor=this.heightSpeed?((this.position.y<this.heightMin?this.heightMin:this.position.y>this.heightMax?this.heightMax:this.position.y)-this.heightMin)*this.heightCoef:0;(this.moveForward||this.autoForward)&&this.translateZ(-(this.movementSpeed+this.autoSpeedFactor));this.moveBackward&&this.translateZ(this.movementSpeed);this.moveLeft&&this.translateX(-this.movementSpeed);this.moveRight&&this.translateX(this.movementSpeed);
+var b=this.lookSpeed;this.dragToLook&&!this.mouseDragOn&&(b=0);this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;b=this.target.position;var d=this.position;b.x=d.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=d.y+100*Math.cos(this.phi);b.z=d.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},
+!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
+THREE.QuakeCamera.prototype.translate=function(a,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(a));this.target.position.addSelf(c.multiplyScalar(a))};
+THREE.PathCamera=function(a){function c(o,w){var y=o[0]-w[0],B=o[1]-w[1],u=o[2]-w[2];return Math.sqrt(y*y+B*B+u*u)}function b(o,w,y,B){var u={name:y,fps:0.6,length:B,hierarchy:[]},E,x,M=w.length,I=g(w),W=0;E=M-1;x={parent:-1,keys:[]};x.keys[0]={time:0,pos:w[0],rot:[0,0,0,1],scl:[1,1,1]};x.keys[E]={time:B,pos:w[E],rot:[0,0,0,1],scl:[1,1,1]};for(E=1;E<M-1;E++){W=B*I.chunks[E]/I.total;x.keys[E]={time:W,pos:w[E]}}u.hierarchy[0]=x;THREE.AnimationHandler.add(u);return new THREE.Animation(o,y,THREE.AnimationHandler.CATMULLROM_FORWARD,
+!1)}function d(o){var w,y,B=o.length,u=[];for(w=0;w<B;w++){y=o[w];u[w]={x:y[0],y:y[1],z:y[2]}}return u}function e(o,w){var y,B,u,E,x,M,I=[],W=d(o),N=new THREE.Spline,f=g(o);I.push(o[0]);for(y=1;y<o.length;y++){linearDistance=c(o[y],o[y-1]);realDistance=f.chunks[y]-f.chunks[y-1];M=Math.ceil(w*realDistance/f.total);E=(y-1)/(o.length-1);x=y/(o.length-1);for(B=1;B<M-1;B++){u=E+B*(1/M)*(x-E);position=N.getPoint(W,u);I.push([position.x,position.y,position.z])}I.push(o[y])}return I}function g(o){var w,y=
+d(o),B=new THREE.Spline,u=w=w=0,E=[0],x=0,M=[o[0][0],o[0][1],o[0][2]];for(o=1;o<y.length*100;o++){w=o/(y.length*100);position=B.getPoint(y,w);x+=c([position.x,position.y,position.z],M);M=[position.x,position.y,position.z];w*=y.length-1;w=Math.floor(w);if(w!=u){E[w]=x;u=w}}E[E.length]=x;return{chunks:E,total:x}}function h(o,w){var y,B,u=new THREE.Geometry,E=new THREE.Spline,x=d(o);for(y=0;y<x.length*w;y++){B=y/(x.length*w);B=E.getPoint(x,B);u.vertices[y]=new THREE.Vertex(new THREE.Vector3(B.x,B.y,
+B.z))}return u}function j(o,w){var y=h(w,10),B=h(w,10),u=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(y,u);particleObj=new THREE.ParticleSystem(B,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);o.addChild(lineObj);particleObj.scale.set(1,1,1);o.addChild(particleObj);B=new Sphere(1,16,8);u=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<w.length;i++){y=new THREE.Mesh(B,u);y.position.set(w[i][0],w[i][1],w[i][2]);y.updateMatrix();
+o.addChild(y)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookVertical=!0;this.lookHorizontal=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};
+this.domElement=document;if(a){if(a.duration!==undefined)this.duration=a.duration*1E3;if(a.waypoints!==undefined)this.waypoints=a.waypoints;if(a.useConstantSpeed!==undefined)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==undefined)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==undefined)this.createDebugPath=a.createDebugPath;if(a.createDebugDummy!==undefined)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==
+undefined)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==undefined)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==undefined)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==undefined)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var k=Math.PI*2,n=Math.PI/180;this.update=
+function(o,w,y){var B,u;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*n;this.theta=this.lon*n;B=this.phi%k;this.phi=B>=0?B:B+k;B=this.verticalAngleMap.srcRange;u=this.verticalAngleMap.dstRange;this.phi=(this.phi-B[0])*(u[1]-u[0])/(B[1]-B[0])+u[0];B=this.horizontalAngleMap.srcRange;u=this.horizontalAngleMap.dstRange;
+this.theta=(this.theta-B[0])*(u[1]-u[0])/(B[1]-B[0])+u[0];B=this.target.position;B.x=100*Math.sin(this.phi)*Math.cos(this.theta);B.y=100*Math.cos(this.phi);B.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,o,w,y)};this.onMouseMove=function(o){this.mouseX=o.clientX-this.windowHalfX;this.mouseY=o.clientY-this.windowHalfY};if(this.useConstantSpeed)this.waypoints=e(this.waypoints,this.resamplingCoef);if(this.createDebugDummy){a=new THREE.MeshLambertMaterial({color:30719});var t=
+new THREE.MeshLambertMaterial({color:65280}),z=new Cube(10,10,20),v=new Cube(2,2,10);this.animationParent=new THREE.Mesh(z,a);a=new THREE.Mesh(v,t);a.position.set(0,10,0);this.animation=b(this.animationParent,this.waypoints,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else{this.animation=b(this.animationParent,this.waypoints,this.id,this.duration);this.animationParent.addChild(this.target);this.animationParent.addChild(this)}this.createDebugPath&&
+j(this.debugPath,this.waypoints);this.domElement.addEventListener("mousemove",function(o,w){return function(){w.apply(o,arguments)}}(this,this.onMouseMove),!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?this.addStatusElement():null};
 THREE.Loader.prototype={addStatusElement:function(){var a=document.createElement("div");a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="#b00";a.style.color="#fff";a.style.width="140px";a.style.padding="0.25em 0.25em 0.25em 0.5em";a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var c="Loaded ";c+=a.total?(100*a.loaded/a.total).toFixed(0)+"%":(a.loaded/1E3).toFixed(2)+" KB";this.statusDomElement.innerHTML=
 c},loadAsciiOld:function(a,c){var b=document.createElement("script");b.type="text/javascript";b.onload=c;b.src=a;document.getElementsByTagName("head")[0].appendChild(b)},loadAscii:function(a){var c=a.model,b=a.callback,d=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(c);a=(new Date).getTime();c=new Worker(c);c.onmessage=function(e){THREE.Loader.prototype.createModel(e.data,b,d)};c.postMessage(a)},loadBinary:function(a){var c=a.model,b=a.callback,d=a.texture_path?a.texture_path:
 THREE.Loader.prototype.extractUrlbase(c),e=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(c);a=(new Date).getTime();c=new Worker(c);var g=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(h){THREE.Loader.prototype.loadAjaxBuffers(h.data.buffers,h.data.materials,b,e,d,g)};c.onerror=function(h){alert("worker.onerror: "+h.message+"\n"+h.data);h.preventDefault()};c.postMessage(a)},loadAjaxBuffers:function(a,c,b,d,e,g){var h=new XMLHttpRequest,j=d+"/"+a,k=0;

File diff suppressed because it is too large
+ 14 - 14
build/custom/ThreeExtras.js


+ 107 - 127
build/custom/ThreeWebGL.js

@@ -1,6 +1,6 @@
 // ThreeWebGL.js r36 - http://github.com/mrdoob/three.js
 var THREE=THREE||{};THREE.Color=function(a){this.setHex(a)};
-THREE.Color.prototype={autoUpdate:!0,setRGB:function(a,b,d){this.r=a;this.g=b;this.b=d;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,d){var e,g,l,m,p,o;if(d==0)e=g=l=0;else{m=Math.floor(a*6);p=a*6-m;a=d*(1-b);o=d*(1-b*p);b=d*(1-b*(1-p));switch(m){case 1:e=o;g=d;l=a;break;case 2:e=a;g=d;l=b;break;case 3:e=a;g=o;l=d;break;case 4:e=b;g=a;l=d;break;case 5:e=d;g=a;l=o;break;case 6:case 0:e=d;g=b;l=a}}this.r=e;this.g=g;this.b=l;if(this.autoUpdate){this.updateHex();
+THREE.Color.prototype={autoUpdate:!0,setRGB:function(a,b,d){this.r=a;this.g=b;this.b=d;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,d){var e,g,k,l,o,n;if(d==0)e=g=k=0;else{l=Math.floor(a*6);o=a*6-l;a=d*(1-b);n=d*(1-b*o);b=d*(1-b*(1-o));switch(l){case 1:e=n;g=d;k=a;break;case 2:e=a;g=d;k=b;break;case 3:e=a;g=n;k=d;break;case 4:e=b;g=a;k=d;break;case 5:e=d;g=a;k=n;break;case 6:case 0:e=d;g=b;k=a}}this.r=e;this.g=g;this.b=k;if(this.autoUpdate){this.updateHex();
 this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)}};
 THREE.Vector2=function(a,b){this.set(a||0,b||0)};
 THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.set(a.x,a.y);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a);return this},negate:function(){this.set(-this.x,-this.y);return this},unit:function(){this.multiplyScalar(1/
@@ -12,82 +12,62 @@ this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setPosit
 1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,d,e){this.set(a||0,b||0,d||0,e||1)};
 THREE.Vector4.prototype={set:function(a,b,d,e){this.x=a;this.y=b;this.z=d;this.w=e;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z,a.w+b.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z,a.w-b.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x*
 a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,b){this.set(this.x+(a.x-this.x)*b,this.y+(a.y-this.y)*b,this.z+(a.z-this.z)*b,this.w+(a.w-this.w)*b)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
-THREE.Ray.prototype={intersectScene:function(a){var b,d,e=a.objects,g=[];a=0;for(b=e.length;a<b;a++){d=e[a];d instanceof THREE.Mesh&&(g=g.concat(this.intersectObject(d)))}g.sort(function(l,m){return l.distance-m.distance});return g},intersectObject:function(a){function b(B,H,L,P){P=P.clone().subSelf(H);L=L.clone().subSelf(H);var T=B.clone().subSelf(H);B=P.dot(P);H=P.dot(L);P=P.dot(T);var U=L.dot(L);L=L.dot(T);T=1/(B*U-H*H);U=(U*P-H*L)*T;B=(B*L-H*P)*T;return U>0&&B>0&&U+B<1}var d,e,g,l,m,p,o,z,D,C,
-J,u=a.geometry,y=u.vertices,A=[];d=0;for(e=u.faces.length;d<e;d++){g=u.faces[d];C=this.origin.clone();J=this.direction.clone();o=a.matrixWorld;l=o.multiplyVector3(y[g.a].position.clone());m=o.multiplyVector3(y[g.b].position.clone());p=o.multiplyVector3(y[g.c].position.clone());o=g instanceof THREE.Face4?o.multiplyVector3(y[g.d].position.clone()):null;z=a.matrixRotationWorld.multiplyVector3(g.normal.clone());D=J.dot(z);if(D<0){z=z.dot((new THREE.Vector3).sub(l,C))/D;C=C.addSelf(J.multiplyScalar(z));
-if(g instanceof THREE.Face3){if(b(C,l,m,p)){g={distance:this.origin.distanceTo(C),point:C,face:g,object:a};A.push(g)}}else if(g instanceof THREE.Face4&&(b(C,l,m,o)||b(C,m,p,o))){g={distance:this.origin.distanceTo(C),point:C,face:g,object:a};A.push(g)}}}return A}};
-THREE.Rectangle=function(){function a(){l=e-b;m=g-d}var b,d,e,g,l,m,p=!0;this.getX=function(){return b};this.getY=function(){return d};this.getWidth=function(){return l};this.getHeight=function(){return m};this.getLeft=function(){return b};this.getTop=function(){return d};this.getRight=function(){return e};this.getBottom=function(){return g};this.set=function(o,z,D,C){p=!1;b=o;d=z;e=D;g=C;a()};this.addPoint=function(o,z){if(p){p=!1;b=o;d=z;e=o;g=z}else{b=b<o?b:o;d=d<z?d:z;e=e>o?e:o;g=g>z?g:z}a()};
-this.add3Points=function(o,z,D,C,J,u){if(p){p=!1;b=o<D?o<J?o:J:D<J?D:J;d=z<C?z<u?z:u:C<u?C:u;e=o>D?o>J?o:J:D>J?D:J;g=z>C?z>u?z:u:C>u?C:u}else{b=o<D?o<J?o<b?o:b:J<b?J:b:D<J?D<b?D:b:J<b?J:b;d=z<C?z<u?z<d?z:d:u<d?u:d:C<u?C<d?C:d:u<d?u:d;e=o>D?o>J?o>e?o:e:J>e?J:e:D>J?D>e?D:e:J>e?J:e;g=z>C?z>u?z>g?z:g:u>g?u:g:C>u?C>g?C:g:u>g?u:g}a()};this.addRectangle=function(o){if(p){p=!1;b=o.getLeft();d=o.getTop();e=o.getRight();g=o.getBottom()}else{b=b<o.getLeft()?b:o.getLeft();d=d<o.getTop()?d:o.getTop();e=e>o.getRight()?
-e:o.getRight();g=g>o.getBottom()?g:o.getBottom()}a()};this.inflate=function(o){b-=o;d-=o;e+=o;g+=o;a()};this.minSelf=function(o){b=b>o.getLeft()?b:o.getLeft();d=d>o.getTop()?d:o.getTop();e=e<o.getRight()?e:o.getRight();g=g<o.getBottom()?g:o.getBottom();a()};this.instersects=function(o){return Math.min(e,o.getRight())-Math.max(b,o.getLeft())>=0&&Math.min(g,o.getBottom())-Math.max(d,o.getTop())>=0};this.empty=function(){p=!0;g=e=d=b=0;a()};this.isEmpty=function(){return p}};
+THREE.Ray.prototype={intersectScene:function(a){var b,d,e=a.objects,g=[];a=0;for(b=e.length;a<b;a++){d=e[a];d instanceof THREE.Mesh&&(g=g.concat(this.intersectObject(d)))}g.sort(function(k,l){return k.distance-l.distance});return g},intersectObject:function(a){function b(L,M,V,X){X=X.clone().subSelf(M);V=V.clone().subSelf(M);var da=L.clone().subSelf(M);L=X.dot(X);M=X.dot(V);X=X.dot(da);var aa=V.dot(V);V=V.dot(da);da=1/(L*aa-M*M);aa=(aa*X-M*V)*da;L=(L*V-M*X)*da;return aa>0&&L>0&&aa+L<1}var d,e,g,k,
+l,o,n,w,z,x,D,E=a.geometry,F=E.vertices,H=[];d=0;for(e=E.faces.length;d<e;d++){g=E.faces[d];x=this.origin.clone();D=this.direction.clone();n=a.matrixWorld;k=n.multiplyVector3(F[g.a].position.clone());l=n.multiplyVector3(F[g.b].position.clone());o=n.multiplyVector3(F[g.c].position.clone());n=g instanceof THREE.Face4?n.multiplyVector3(F[g.d].position.clone()):null;w=a.matrixRotationWorld.multiplyVector3(g.normal.clone());z=D.dot(w);if(z<0){w=w.dot((new THREE.Vector3).sub(k,x))/z;x=x.addSelf(D.multiplyScalar(w));
+if(g instanceof THREE.Face3){if(b(x,k,l,o)){g={distance:this.origin.distanceTo(x),point:x,face:g,object:a};H.push(g)}}else if(g instanceof THREE.Face4&&(b(x,k,l,n)||b(x,l,o,n))){g={distance:this.origin.distanceTo(x),point:x,face:g,object:a};H.push(g)}}}return H}};
+THREE.Rectangle=function(){function a(){k=e-b;l=g-d}var b,d,e,g,k,l,o=!0;this.getX=function(){return b};this.getY=function(){return d};this.getWidth=function(){return k};this.getHeight=function(){return l};this.getLeft=function(){return b};this.getTop=function(){return d};this.getRight=function(){return e};this.getBottom=function(){return g};this.set=function(n,w,z,x){o=!1;b=n;d=w;e=z;g=x;a()};this.addPoint=function(n,w){if(o){o=!1;b=n;d=w;e=n;g=w}else{b=b<n?b:n;d=d<w?d:w;e=e>n?e:n;g=g>w?g:w}a()};
+this.add3Points=function(n,w,z,x,D,E){if(o){o=!1;b=n<z?n<D?n:D:z<D?z:D;d=w<x?w<E?w:E:x<E?x:E;e=n>z?n>D?n:D:z>D?z:D;g=w>x?w>E?w:E:x>E?x:E}else{b=n<z?n<D?n<b?n:b:D<b?D:b:z<D?z<b?z:b:D<b?D:b;d=w<x?w<E?w<d?w:d:E<d?E:d:x<E?x<d?x:d:E<d?E:d;e=n>z?n>D?n>e?n:e:D>e?D:e:z>D?z>e?z:e:D>e?D:e;g=w>x?w>E?w>g?w:g:E>g?E:g:x>E?x>g?x:g:E>g?E:g}a()};this.addRectangle=function(n){if(o){o=!1;b=n.getLeft();d=n.getTop();e=n.getRight();g=n.getBottom()}else{b=b<n.getLeft()?b:n.getLeft();d=d<n.getTop()?d:n.getTop();e=e>n.getRight()?
+e:n.getRight();g=g>n.getBottom()?g:n.getBottom()}a()};this.inflate=function(n){b-=n;d-=n;e+=n;g+=n;a()};this.minSelf=function(n){b=b>n.getLeft()?b:n.getLeft();d=d>n.getTop()?d:n.getTop();e=e<n.getRight()?e:n.getRight();g=g<n.getBottom()?g:n.getBottom();a()};this.instersects=function(n){return Math.min(e,n.getRight())-Math.max(b,n.getLeft())>=0&&Math.min(g,n.getBottom())-Math.max(d,n.getTop())>=0};this.empty=function(){o=!0;g=e=d=b=0;a()};this.isEmpty=function(){return o}};
 THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};
-THREE.Matrix4=function(a,b,d,e,g,l,m,p,o,z,D,C,J,u,y,A){this.set(a||1,b||0,d||0,e||0,g||0,l||1,m||0,p||0,o||0,z||0,D||1,C||0,J||0,u||0,y||0,A||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={set:function(a,b,d,e,g,l,m,p,o,z,D,C,J,u,y,A){this.n11=a;this.n12=b;this.n13=d;this.n14=e;this.n21=g;this.n22=l;this.n23=m;this.n24=p;this.n31=o;this.n32=z;this.n33=D;this.n34=C;this.n41=J;this.n42=u;this.n43=y;this.n44=A;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,b,d){var e=THREE.Matrix4.__v1,
-g=THREE.Matrix4.__v2,l=THREE.Matrix4.__v3;l.sub(a,b).normalize();if(l.length()===0)l.z=1;e.cross(d,l).normalize();if(e.length()===0){l.x+=1.0E-4;e.cross(d,l).normalize()}g.cross(l,e).normalize();this.n11=e.x;this.n12=g.x;this.n13=l.x;this.n21=e.y;this.n22=g.y;this.n23=l.y;this.n31=e.z;this.n32=g.z;this.n33=l.z;return this},multiplyVector3:function(a){var b=a.x,d=a.y,e=a.z,g=1/(this.n41*b+this.n42*d+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*d+this.n13*e+this.n14)*g;a.y=(this.n21*b+this.n22*d+this.n23*
+THREE.Matrix4=function(a,b,d,e,g,k,l,o,n,w,z,x,D,E,F,H){this.set(a||1,b||0,d||0,e||0,g||0,k||1,l||0,o||0,n||0,w||0,z||1,x||0,D||0,E||0,F||0,H||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={set:function(a,b,d,e,g,k,l,o,n,w,z,x,D,E,F,H){this.n11=a;this.n12=b;this.n13=d;this.n14=e;this.n21=g;this.n22=k;this.n23=l;this.n24=o;this.n31=n;this.n32=w;this.n33=z;this.n34=x;this.n41=D;this.n42=E;this.n43=F;this.n44=H;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,b,d){var e=THREE.Matrix4.__v1,
+g=THREE.Matrix4.__v2,k=THREE.Matrix4.__v3;k.sub(a,b).normalize();if(k.length()===0)k.z=1;e.cross(d,k).normalize();if(e.length()===0){k.x+=1.0E-4;e.cross(d,k).normalize()}g.cross(k,e).normalize();this.n11=e.x;this.n12=g.x;this.n13=k.x;this.n21=e.y;this.n22=g.y;this.n23=k.y;this.n31=e.z;this.n32=g.z;this.n33=k.z;return this},multiplyVector3:function(a){var b=a.x,d=a.y,e=a.z,g=1/(this.n41*b+this.n42*d+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*d+this.n13*e+this.n14)*g;a.y=(this.n21*b+this.n22*d+this.n23*
 e+this.n24)*g;a.z=(this.n31*b+this.n32*d+this.n33*e+this.n34)*g;return a},multiplyVector4:function(a){var b=a.x,d=a.y,e=a.z,g=a.w;a.x=this.n11*b+this.n12*d+this.n13*e+this.n14*g;a.y=this.n21*b+this.n22*d+this.n23*e+this.n24*g;a.z=this.n31*b+this.n32*d+this.n33*e+this.n34*g;a.w=this.n41*b+this.n42*d+this.n43*e+this.n44*g;return a},rotateAxis:function(a){var b=a.x,d=a.y,e=a.z;a.x=b*this.n11+d*this.n12+e*this.n13;a.y=b*this.n21+d*this.n22+e*this.n23;a.z=b*this.n31+d*this.n32+e*this.n33;a.normalize();
-return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var d=a.n11,e=a.n12,g=a.n13,l=a.n14,m=a.n21,p=a.n22,o=a.n23,z=a.n24,D=a.n31,C=a.n32,J=a.n33,u=a.n34,y=a.n41,A=a.n42,B=a.n43,H=a.n44,L=b.n11,P=b.n12,T=b.n13,U=b.n14,$=b.n21,ea=b.n22,
-c=b.n23,pa=b.n24,na=b.n31,va=b.n32,qa=b.n33,ra=b.n34;this.n11=d*L+e*$+g*na;this.n12=d*P+e*ea+g*va;this.n13=d*T+e*c+g*qa;this.n14=d*U+e*pa+g*ra+l;this.n21=m*L+p*$+o*na;this.n22=m*P+p*ea+o*va;this.n23=m*T+p*c+o*qa;this.n24=m*U+p*pa+o*ra+z;this.n31=D*L+C*$+J*na;this.n32=D*P+C*ea+J*va;this.n33=D*T+C*c+J*qa;this.n34=D*U+C*pa+J*ra+u;this.n41=y*L+A*$+B*na;this.n42=y*P+A*ea+B*va;this.n43=y*T+A*c+B*qa;this.n44=y*U+A*pa+B*ra+H;return this},multiplyToArray:function(a,b,d){this.multiply(a,b);d[0]=this.n11;d[1]=
-this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34;d[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=
-a;return this},determinant:function(){var a=this.n11,b=this.n12,d=this.n13,e=this.n14,g=this.n21,l=this.n22,m=this.n23,p=this.n24,o=this.n31,z=this.n32,D=this.n33,C=this.n34,J=this.n41,u=this.n42,y=this.n43,A=this.n44;return e*m*z*J-d*p*z*J-e*l*D*J+b*p*D*J+d*l*C*J-b*m*C*J-e*m*o*u+d*p*o*u+e*g*D*u-a*p*D*u-d*g*C*u+a*m*C*u+e*l*o*y-b*p*o*y-e*g*z*y+a*p*z*y+b*g*C*y-a*l*C*y-d*l*o*A+b*m*o*A+d*g*z*A-a*m*z*A-b*g*D*A+a*l*D*A},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=
+return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var d=a.n11,e=a.n12,g=a.n13,k=a.n14,l=a.n21,o=a.n22,n=a.n23,w=a.n24,z=a.n31,x=a.n32,D=a.n33,E=a.n34,F=a.n41,H=a.n42,L=a.n43,M=a.n44,V=b.n11,X=b.n12,da=b.n13,aa=b.n14,Y=b.n21,ea=b.n22,
+c=b.n23,oa=b.n24,ma=b.n31,ua=b.n32,pa=b.n33,qa=b.n34;this.n11=d*V+e*Y+g*ma;this.n12=d*X+e*ea+g*ua;this.n13=d*da+e*c+g*pa;this.n14=d*aa+e*oa+g*qa+k;this.n21=l*V+o*Y+n*ma;this.n22=l*X+o*ea+n*ua;this.n23=l*da+o*c+n*pa;this.n24=l*aa+o*oa+n*qa+w;this.n31=z*V+x*Y+D*ma;this.n32=z*X+x*ea+D*ua;this.n33=z*da+x*c+D*pa;this.n34=z*aa+x*oa+D*qa+E;this.n41=F*V+H*Y+L*ma;this.n42=F*X+H*ea+L*ua;this.n43=F*da+H*c+L*pa;this.n44=F*aa+H*oa+L*qa+M;return this},multiplyToArray:function(a,b,d){this.multiply(a,b);d[0]=this.n11;
+d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34;d[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=
+a;return this},determinant:function(){var a=this.n11,b=this.n12,d=this.n13,e=this.n14,g=this.n21,k=this.n22,l=this.n23,o=this.n24,n=this.n31,w=this.n32,z=this.n33,x=this.n34,D=this.n41,E=this.n42,F=this.n43,H=this.n44;return e*l*w*D-d*o*w*D-e*k*z*D+b*o*z*D+d*k*x*D-b*l*x*D-e*l*n*E+d*o*n*E+e*g*z*E-a*o*z*E-d*g*x*E+a*l*x*E+e*k*n*F-b*o*n*F-e*g*w*F+a*o*w*F+b*g*x*F-a*k*x*F-d*k*n*H+b*l*n*H+d*g*w*H-a*l*w*H-b*g*z*H+a*k*z*H},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=
 this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=
 this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;
 a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;a[b+15]=this.n44;return a},setTranslation:function(a,b,d){this.set(1,0,0,a,0,1,0,b,0,0,1,d,0,0,
 0,1);return this},setScale:function(a,b,d){this.set(a,0,0,0,0,b,0,0,0,0,d,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var d=Math.cos(b),e=Math.sin(b),g=
-1-d,l=a.x,m=a.y,p=a.z,o=g*l,z=g*m;this.set(o*l+d,o*m-e*p,o*p+e*m,0,o*m+e*p,z*m+d,z*p-e*l,0,o*p-e*m,z*p+e*l,g*p*p+d,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},setRotationFromEuler:function(a){var b=a.x,d=a.y,e=a.z;a=Math.cos(b);b=Math.sin(b);var g=Math.cos(d);d=Math.sin(d);var l=Math.cos(e);e=Math.sin(e);var m=a*d,p=b*d;this.n11=g*l;this.n12=-g*e;this.n13=d;this.n21=p*l+a*e;this.n22=-p*e+a*l;this.n23=-b*g;this.n31=-m*l+b*e;this.n32=m*e+b*l;this.n33=
-a*g;return this},setRotationFromQuaternion:function(a){var b=a.x,d=a.y,e=a.z,g=a.w,l=b+b,m=d+d,p=e+e;a=b*l;var o=b*m;b*=p;var z=d*m;d*=p;e*=p;l*=g;m*=g;g*=p;this.n11=1-(z+e);this.n12=o-g;this.n13=b+m;this.n21=o+g;this.n22=1-(a+e);this.n23=d-l;this.n31=b-m;this.n32=d+l;this.n33=1-(a+z);return this},scale:function(a){var b=a.x,d=a.y;a=a.z;this.n11*=b;this.n12*=d;this.n13*=a;this.n21*=b;this.n22*=d;this.n23*=a;this.n31*=b;this.n32*=d;this.n33*=a;this.n41*=b;this.n42*=d;this.n43*=a;return this},extractPosition:function(a){this.n14=
+1-d,k=a.x,l=a.y,o=a.z,n=g*k,w=g*l;this.set(n*k+d,n*l-e*o,n*o+e*l,0,n*l+e*o,w*l+d,w*o-e*k,0,n*o-e*l,w*o+e*k,g*o*o+d,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},setRotationFromEuler:function(a){var b=a.x,d=a.y,e=a.z;a=Math.cos(b);b=Math.sin(b);var g=Math.cos(d);d=Math.sin(d);var k=Math.cos(e);e=Math.sin(e);var l=a*d,o=b*d;this.n11=g*k;this.n12=-g*e;this.n13=d;this.n21=o*k+a*e;this.n22=-o*e+a*k;this.n23=-b*g;this.n31=-l*k+b*e;this.n32=l*e+b*k;this.n33=
+a*g;return this},setRotationFromQuaternion:function(a){var b=a.x,d=a.y,e=a.z,g=a.w,k=b+b,l=d+d,o=e+e;a=b*k;var n=b*l;b*=o;var w=d*l;d*=o;e*=o;k*=g;l*=g;g*=o;this.n11=1-(w+e);this.n12=n-g;this.n13=b+l;this.n21=n+g;this.n22=1-(a+e);this.n23=d-k;this.n31=b-l;this.n32=d+k;this.n33=1-(a+w);return this},scale:function(a){var b=a.x,d=a.y;a=a.z;this.n11*=b;this.n12*=d;this.n13*=a;this.n21*=b;this.n22*=d;this.n23*=a;this.n31*=b;this.n32*=d;this.n33*=a;this.n41*=b;this.n42*=d;this.n43*=a;return this},extractPosition:function(a){this.n14=
 a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var d=1/b.x,e=1/b.y,g=1/b.z;this.n11=a.n11*d;this.n21=a.n21*d;this.n31=a.n31*d;this.n12=a.n12*e;this.n22=a.n22*e;this.n32=a.n32*e;this.n13=a.n13*g;this.n23=a.n23*g;this.n33=a.n33*g}};
-THREE.Matrix4.makeInvert=function(a,b){var d=a.n11,e=a.n12,g=a.n13,l=a.n14,m=a.n21,p=a.n22,o=a.n23,z=a.n24,D=a.n31,C=a.n32,J=a.n33,u=a.n34,y=a.n41,A=a.n42,B=a.n43,H=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=o*u*A-z*J*A+z*C*B-p*u*B-o*C*H+p*J*H;b.n12=l*J*A-g*u*A-l*C*B+e*u*B+g*C*H-e*J*H;b.n13=g*z*A-l*o*A+l*p*B-e*z*B-g*p*H+e*o*H;b.n14=l*o*C-g*z*C-l*p*J+e*z*J+g*p*u-e*o*u;b.n21=z*J*y-o*u*y-z*D*B+m*u*B+o*D*H-m*J*H;b.n22=g*u*y-l*J*y+l*D*B-d*u*B-g*D*H+d*J*H;b.n23=l*o*y-g*z*y-l*m*B+d*z*B+g*m*H-d*o*H;
-b.n24=g*z*D-l*o*D+l*m*J-d*z*J-g*m*u+d*o*u;b.n31=p*u*y-z*C*y+z*D*A-m*u*A-p*D*H+m*C*H;b.n32=l*C*y-e*u*y-l*D*A+d*u*A+e*D*H-d*C*H;b.n33=g*z*y-l*p*y+l*m*A-d*z*A-e*m*H+d*p*H;b.n34=l*p*D-e*z*D-l*m*C+d*z*C+e*m*u-d*p*u;b.n41=o*C*y-p*J*y-o*D*A+m*J*A+p*D*B-m*C*B;b.n42=e*J*y-g*C*y+g*D*A-d*J*A-e*D*B+d*C*B;b.n43=g*p*y-e*o*y-g*m*A+d*o*A+e*m*B-d*p*B;b.n44=e*o*D-g*p*D+g*m*C-d*o*C-e*m*J+d*p*J;b.multiplyScalar(1/a.determinant());return b};
-THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,d=b.m,e=a.n33*a.n22-a.n32*a.n23,g=-a.n33*a.n21+a.n31*a.n23,l=a.n32*a.n21-a.n31*a.n22,m=-a.n33*a.n12+a.n32*a.n13,p=a.n33*a.n11-a.n31*a.n13,o=-a.n32*a.n11+a.n31*a.n12,z=a.n23*a.n12-a.n22*a.n13,D=-a.n23*a.n11+a.n21*a.n13,C=a.n22*a.n11-a.n21*a.n12;a=a.n11*e+a.n21*m+a.n31*z;if(a==0)throw"matrix not invertible";a=1/a;d[0]=a*e;d[1]=a*g;d[2]=a*l;d[3]=a*m;d[4]=a*p;d[5]=a*o;d[6]=a*z;d[7]=a*D;d[8]=a*C;return b};
-THREE.Matrix4.makeFrustum=function(a,b,d,e,g,l){var m;m=new THREE.Matrix4;m.n11=2*g/(b-a);m.n12=0;m.n13=(b+a)/(b-a);m.n14=0;m.n21=0;m.n22=2*g/(e-d);m.n23=(e+d)/(e-d);m.n24=0;m.n31=0;m.n32=0;m.n33=-(l+g)/(l-g);m.n34=-2*l*g/(l-g);m.n41=0;m.n42=0;m.n43=-1;m.n44=0;return m};THREE.Matrix4.makePerspective=function(a,b,d,e){var g;a=d*Math.tan(a*Math.PI/360);g=-a;return THREE.Matrix4.makeFrustum(g*b,a*b,g,a,d,e)};
-THREE.Matrix4.makeOrtho=function(a,b,d,e,g,l){var m,p,o,z;m=new THREE.Matrix4;p=b-a;o=d-e;z=l-g;m.n11=2/p;m.n12=0;m.n13=0;m.n14=-((b+a)/p);m.n21=0;m.n22=2/o;m.n23=0;m.n24=-((d+e)/o);m.n31=0;m.n32=0;m.n33=-2/z;m.n34=-((l+g)/z);m.n41=0;m.n42=0;m.n43=0;m.n44=1;return m};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;
+THREE.Matrix4.makeInvert=function(a,b){var d=a.n11,e=a.n12,g=a.n13,k=a.n14,l=a.n21,o=a.n22,n=a.n23,w=a.n24,z=a.n31,x=a.n32,D=a.n33,E=a.n34,F=a.n41,H=a.n42,L=a.n43,M=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=n*E*H-w*D*H+w*x*L-o*E*L-n*x*M+o*D*M;b.n12=k*D*H-g*E*H-k*x*L+e*E*L+g*x*M-e*D*M;b.n13=g*w*H-k*n*H+k*o*L-e*w*L-g*o*M+e*n*M;b.n14=k*n*x-g*w*x-k*o*D+e*w*D+g*o*E-e*n*E;b.n21=w*D*F-n*E*F-w*z*L+l*E*L+n*z*M-l*D*M;b.n22=g*E*F-k*D*F+k*z*L-d*E*L-g*z*M+d*D*M;b.n23=k*n*F-g*w*F-k*l*L+d*w*L+g*l*M-d*n*M;
+b.n24=g*w*z-k*n*z+k*l*D-d*w*D-g*l*E+d*n*E;b.n31=o*E*F-w*x*F+w*z*H-l*E*H-o*z*M+l*x*M;b.n32=k*x*F-e*E*F-k*z*H+d*E*H+e*z*M-d*x*M;b.n33=g*w*F-k*o*F+k*l*H-d*w*H-e*l*M+d*o*M;b.n34=k*o*z-e*w*z-k*l*x+d*w*x+e*l*E-d*o*E;b.n41=n*x*F-o*D*F-n*z*H+l*D*H+o*z*L-l*x*L;b.n42=e*D*F-g*x*F+g*z*H-d*D*H-e*z*L+d*x*L;b.n43=g*o*F-e*n*F-g*l*H+d*n*H+e*l*L-d*o*L;b.n44=e*n*z-g*o*z+g*l*x-d*n*x-e*l*D+d*o*D;b.multiplyScalar(1/a.determinant());return b};
+THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,d=b.m,e=a.n33*a.n22-a.n32*a.n23,g=-a.n33*a.n21+a.n31*a.n23,k=a.n32*a.n21-a.n31*a.n22,l=-a.n33*a.n12+a.n32*a.n13,o=a.n33*a.n11-a.n31*a.n13,n=-a.n32*a.n11+a.n31*a.n12,w=a.n23*a.n12-a.n22*a.n13,z=-a.n23*a.n11+a.n21*a.n13,x=a.n22*a.n11-a.n21*a.n12;a=a.n11*e+a.n21*l+a.n31*w;if(a==0)throw"matrix not invertible";a=1/a;d[0]=a*e;d[1]=a*g;d[2]=a*k;d[3]=a*l;d[4]=a*o;d[5]=a*n;d[6]=a*w;d[7]=a*z;d[8]=a*x;return b};
+THREE.Matrix4.makeFrustum=function(a,b,d,e,g,k){var l;l=new THREE.Matrix4;l.n11=2*g/(b-a);l.n12=0;l.n13=(b+a)/(b-a);l.n14=0;l.n21=0;l.n22=2*g/(e-d);l.n23=(e+d)/(e-d);l.n24=0;l.n31=0;l.n32=0;l.n33=-(k+g)/(k-g);l.n34=-2*k*g/(k-g);l.n41=0;l.n42=0;l.n43=-1;l.n44=0;return l};THREE.Matrix4.makePerspective=function(a,b,d,e){var g;a=d*Math.tan(a*Math.PI/360);g=-a;return THREE.Matrix4.makeFrustum(g*b,a*b,g,a,d,e)};
+THREE.Matrix4.makeOrtho=function(a,b,d,e,g,k){var l,o,n,w;l=new THREE.Matrix4;o=b-a;n=d-e;w=k-g;l.n11=2/o;l.n12=0;l.n13=0;l.n14=-((b+a)/o);l.n21=0;l.n22=2/n;l.n23=0;l.n24=-((d+e)/n);l.n31=0;l.n32=0;l.n33=-2/w;l.n34=-((k+g)/w);l.n41=0;l.n42=0;l.n43=0;l.n44=1;return l};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;
 THREE.Object3D=function(){this.parent=undefined;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=
 !0;this._vector=new THREE.Vector3};
 THREE.Object3D.prototype={translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(a){if(this.children.indexOf(a)===-1){a.parent!==
 undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b instanceof THREE.Scene===!1&&b!==undefined;)b=b.parent;b!==undefined&&b.addChildRecurse(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=undefined;this.children.splice(b,1)}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation);if(this.scale.x!==1||this.scale.y!==
 1||this.scale.z!==1){this.matrix.scale(this.scale);this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z))}this.matrixWorldNeedsUpdate=!0},update:function(a,b,d){if(this.visible){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||b){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale);this.matrixWorldNeedsUpdate=!1;b=!0}a=0;for(var e=this.children.length;a<
 e;a++)this.children[a].update(this.matrixWorld,b,d)}}};THREE.Quaternion=function(a,b,d,e){this.set(a||0,b||0,d||0,e!==undefined?e:1)};
-THREE.Quaternion.prototype={set:function(a,b,d,e){this.x=a;this.y=b;this.z=d;this.w=e;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,d=a.x*b,e=a.y*b,g=a.z*b;a=Math.cos(e);e=Math.sin(e);b=Math.cos(-g);g=Math.sin(-g);var l=Math.cos(d);d=Math.sin(d);var m=a*b,p=e*g;this.w=m*l-p*d;this.x=m*d+p*l;this.y=e*b*l+a*g*d;this.z=a*g*l-e*b*d;return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=
--1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a==0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x*=a;this.y*=a;this.z*=a;this.w*=a}return this},multiplySelf:function(a){var b=this.x,d=this.y,e=this.z,g=this.w,l=a.x,m=a.y,p=a.z;a=a.w;this.x=b*a+g*l+d*p-e*m;this.y=d*a+g*m+e*l-b*p;this.z=e*a+g*p+b*m-d*l;this.w=g*a-b*l-d*m-e*p;return this},
-multiplyVector3:function(a,b){b||(b=a);var d=a.x,e=a.y,g=a.z,l=this.x,m=this.y,p=this.z,o=this.w,z=o*d+m*g-p*e,D=o*e+p*d-l*g,C=o*g+l*e-m*d;d=-l*d-m*e-p*g;b.x=z*o+d*-l+D*-p-C*-m;b.y=D*o+d*-m+C*-l-z*-p;b.z=C*o+d*-p+z*-m-D*-l;return b}};
-THREE.Quaternion.slerp=function(a,b,d,e){var g=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(g)>=1){d.w=a.w;d.x=a.x;d.y=a.y;d.z=a.z;return d}var l=Math.acos(g),m=Math.sqrt(1-g*g);if(Math.abs(m)<0.0010){d.w=0.5*(a.w+b.w);d.x=0.5*(a.x+b.x);d.y=0.5*(a.y+b.y);d.z=0.5*(a.z+b.z);return d}g=Math.sin((1-e)*l)/m;e=Math.sin(e*l)/m;d.w=a.w*g+b.w*e;d.x=a.x*g+b.x*e;d.y=a.y*g+b.y*e;d.z=a.z*g+b.z*e;return d};
+THREE.Quaternion.prototype={set:function(a,b,d,e){this.x=a;this.y=b;this.z=d;this.w=e;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,d=a.x*b,e=a.y*b,g=a.z*b;a=Math.cos(e);e=Math.sin(e);b=Math.cos(-g);g=Math.sin(-g);var k=Math.cos(d);d=Math.sin(d);var l=a*b,o=e*g;this.w=l*k-o*d;this.x=l*d+o*k;this.y=e*b*k+a*g*d;this.z=a*g*k-e*b*d;return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=
+-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a==0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x*=a;this.y*=a;this.z*=a;this.w*=a}return this},multiplySelf:function(a){var b=this.x,d=this.y,e=this.z,g=this.w,k=a.x,l=a.y,o=a.z;a=a.w;this.x=b*a+g*k+d*o-e*l;this.y=d*a+g*l+e*k-b*o;this.z=e*a+g*o+b*l-d*k;this.w=g*a-b*k-d*l-e*o;return this},
+multiplyVector3:function(a,b){b||(b=a);var d=a.x,e=a.y,g=a.z,k=this.x,l=this.y,o=this.z,n=this.w,w=n*d+l*g-o*e,z=n*e+o*d-k*g,x=n*g+k*e-l*d;d=-k*d-l*e-o*g;b.x=w*n+d*-k+z*-o-x*-l;b.y=z*n+d*-l+x*-k-w*-o;b.z=x*n+d*-o+w*-l-z*-k;return b}};
+THREE.Quaternion.slerp=function(a,b,d,e){var g=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(g)>=1){d.w=a.w;d.x=a.x;d.y=a.y;d.z=a.z;return d}var k=Math.acos(g),l=Math.sqrt(1-g*g);if(Math.abs(l)<0.0010){d.w=0.5*(a.w+b.w);d.x=0.5*(a.x+b.x);d.y=0.5*(a.y+b.y);d.z=0.5*(a.z+b.z);return d}g=Math.sin((1-e)*k)/l;e=Math.sin(e*k)/l;d.w=a.w*g+b.w*e;d.x=a.x*g+b.x*e;d.y=a.y*g+b.y*e;d.z=a.z*g+b.z*e;return d};
 THREE.Vertex=function(a,b){this.position=a||new THREE.Vector3;this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.normal=b||new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.normalScreen=new THREE.Vector3;this.tangent=new THREE.Vector4;this.__visible=!0};
-THREE.Face3=function(a,b,d,e,g){this.a=a;this.b=b;this.c=d;this.centroid=new THREE.Vector3;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.materials=g instanceof Array?g:[g]};THREE.Face4=function(a,b,d,e,g,l){this.a=a;this.b=b;this.c=d;this.d=e;this.centroid=new THREE.Vector3;this.normal=g instanceof THREE.Vector3?g:new THREE.Vector3;this.vertexNormals=g instanceof Array?g:[];this.materials=l instanceof Array?l:[l]};
+THREE.Face3=function(a,b,d,e,g){this.a=a;this.b=b;this.c=d;this.centroid=new THREE.Vector3;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.materials=g instanceof Array?g:[g]};THREE.Face4=function(a,b,d,e,g,k){this.a=a;this.b=b;this.c=d;this.d=e;this.centroid=new THREE.Vector3;this.normal=g instanceof THREE.Vector3?g:new THREE.Vector3;this.vertexNormals=g instanceof Array?g:[];this.materials=k instanceof Array?k:[k]};
 THREE.UV=function(a,b){this.set(a||0,b||0)};THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.faces=[];this.uvs=[];this.uvs2=[];this.colors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
 THREE.Geometry.prototype={computeCentroids:function(){var a,b,d;a=0;for(b=this.faces.length;a<b;a++){d=this.faces[a];d.centroid.set(0,0,0);if(d instanceof THREE.Face3){d.centroid.addSelf(this.vertices[d.a].position);d.centroid.addSelf(this.vertices[d.b].position);d.centroid.addSelf(this.vertices[d.c].position);d.centroid.divideScalar(3)}else if(d instanceof THREE.Face4){d.centroid.addSelf(this.vertices[d.a].position);d.centroid.addSelf(this.vertices[d.b].position);d.centroid.addSelf(this.vertices[d.c].position);
-d.centroid.addSelf(this.vertices[d.d].position);d.centroid.divideScalar(4)}}},computeFaceNormals:function(a){var b,d,e,g,l,m,p=new THREE.Vector3,o=new THREE.Vector3;e=0;for(g=this.vertices.length;e<g;e++){l=this.vertices[e];l.normal.set(0,0,0)}e=0;for(g=this.faces.length;e<g;e++){l=this.faces[e];if(a&&l.vertexNormals.length){p.set(0,0,0);b=0;for(d=l.vertexNormals.length;b<d;b++)p.addSelf(l.vertexNormals[b]);p.divideScalar(3)}else{b=this.vertices[l.a];d=this.vertices[l.b];m=this.vertices[l.c];p.sub(m.position,
-d.position);o.sub(b.position,d.position);p.crossSelf(o)}p.isZero()||p.normalize();l.normal.copy(p)}},computeVertexNormals:function(){var a,b,d,e;if(this.__tmpVertices==undefined){e=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)e[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++){d=this.faces[a];if(d instanceof THREE.Face3)d.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(d instanceof THREE.Face4)d.vertexNormals=[new THREE.Vector3,
+d.centroid.addSelf(this.vertices[d.d].position);d.centroid.divideScalar(4)}}},computeFaceNormals:function(a){var b,d,e,g,k,l,o=new THREE.Vector3,n=new THREE.Vector3;e=0;for(g=this.vertices.length;e<g;e++){k=this.vertices[e];k.normal.set(0,0,0)}e=0;for(g=this.faces.length;e<g;e++){k=this.faces[e];if(a&&k.vertexNormals.length){o.set(0,0,0);b=0;for(d=k.vertexNormals.length;b<d;b++)o.addSelf(k.vertexNormals[b]);o.divideScalar(3)}else{b=this.vertices[k.a];d=this.vertices[k.b];l=this.vertices[k.c];o.sub(l.position,
+d.position);n.sub(b.position,d.position);o.crossSelf(n)}o.isZero()||o.normalize();k.normal.copy(o)}},computeVertexNormals:function(){var a,b,d,e;if(this.__tmpVertices==undefined){e=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)e[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++){d=this.faces[a];if(d instanceof THREE.Face3)d.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(d instanceof THREE.Face4)d.vertexNormals=[new THREE.Vector3,
 new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}}else{e=this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)e[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++){d=this.faces[a];if(d instanceof THREE.Face3){e[d.a].addSelf(d.normal);e[d.b].addSelf(d.normal);e[d.c].addSelf(d.normal)}else if(d instanceof THREE.Face4){e[d.a].addSelf(d.normal);e[d.b].addSelf(d.normal);e[d.c].addSelf(d.normal);e[d.d].addSelf(d.normal)}}a=0;for(b=this.vertices.length;a<b;a++)e[a].normalize();a=0;for(b=this.faces.length;a<
-b;a++){d=this.faces[a];if(d instanceof THREE.Face3){d.vertexNormals[0].copy(e[d.a]);d.vertexNormals[1].copy(e[d.b]);d.vertexNormals[2].copy(e[d.c])}else if(d instanceof THREE.Face4){d.vertexNormals[0].copy(e[d.a]);d.vertexNormals[1].copy(e[d.b]);d.vertexNormals[2].copy(e[d.c]);d.vertexNormals[3].copy(e[d.d])}}},computeTangents:function(){function a(ra,Ba,Ca,xa,Fa,Ga,Ha){l=ra.vertices[Ba].position;m=ra.vertices[Ca].position;p=ra.vertices[xa].position;o=g[Fa];z=g[Ga];D=g[Ha];C=m.x-l.x;J=p.x-l.x;u=m.y-
-l.y;y=p.y-l.y;A=m.z-l.z;B=p.z-l.z;H=z.u-o.u;L=D.u-o.u;P=z.v-o.v;T=D.v-o.v;U=1/(H*T-L*P);c.set((T*C-P*J)*U,(T*u-P*y)*U,(T*A-P*B)*U);pa.set((H*J-L*C)*U,(H*y-L*u)*U,(H*B-L*A)*U);$[Ba].addSelf(c);$[Ca].addSelf(c);$[xa].addSelf(c);ea[Ba].addSelf(pa);ea[Ca].addSelf(pa);ea[xa].addSelf(pa)}var b,d,e,g,l,m,p,o,z,D,C,J,u,y,A,B,H,L,P,T,U,$=[],ea=[],c=new THREE.Vector3,pa=new THREE.Vector3,na=new THREE.Vector3,va=new THREE.Vector3,qa=new THREE.Vector3;b=0;for(d=this.vertices.length;b<d;b++){$[b]=new THREE.Vector3;
-ea[b]=new THREE.Vector3}b=0;for(d=this.faces.length;b<d;b++){e=this.faces[b];g=this.uvs[b];if(e instanceof THREE.Face3){a(this,e.a,e.b,e.c,0,1,2);this.vertices[e.a].normal.copy(e.vertexNormals[0]);this.vertices[e.b].normal.copy(e.vertexNormals[1]);this.vertices[e.c].normal.copy(e.vertexNormals[2])}else if(e instanceof THREE.Face4){a(this,e.a,e.b,e.c,0,1,2);a(this,e.a,e.b,e.d,0,1,3);this.vertices[e.a].normal.copy(e.vertexNormals[0]);this.vertices[e.b].normal.copy(e.vertexNormals[1]);this.vertices[e.c].normal.copy(e.vertexNormals[2]);
-this.vertices[e.d].normal.copy(e.vertexNormals[3])}}b=0;for(d=this.vertices.length;b<d;b++){qa.copy(this.vertices[b].normal);e=$[b];na.copy(e);na.subSelf(qa.multiplyScalar(qa.dot(e))).normalize();va.cross(this.vertices[b].normal,e);e=va.dot(ea[b]);e=e<0?-1:1;this.vertices[b].tangent.set(na.x,na.y,na.z,e)}this.hasTangents=!0},computeBoundingBox:function(){var a;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],
-z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,d=this.vertices.length;b<d;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>
-this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,b=0,d=this.vertices.length;b<d;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}}};THREE.GeometryIdCounter=0;
+b;a++){d=this.faces[a];if(d instanceof THREE.Face3){d.vertexNormals[0].copy(e[d.a]);d.vertexNormals[1].copy(e[d.b]);d.vertexNormals[2].copy(e[d.c])}else if(d instanceof THREE.Face4){d.vertexNormals[0].copy(e[d.a]);d.vertexNormals[1].copy(e[d.b]);d.vertexNormals[2].copy(e[d.c]);d.vertexNormals[3].copy(e[d.d])}}},computeTangents:function(){function a(qa,Aa,Ba,wa,Ea,Fa,Ga){k=qa.vertices[Aa].position;l=qa.vertices[Ba].position;o=qa.vertices[wa].position;n=g[Ea];w=g[Fa];z=g[Ga];x=l.x-k.x;D=o.x-k.x;E=l.y-
+k.y;F=o.y-k.y;H=l.z-k.z;L=o.z-k.z;M=w.u-n.u;V=z.u-n.u;X=w.v-n.v;da=z.v-n.v;aa=1/(M*da-V*X);c.set((da*x-X*D)*aa,(da*E-X*F)*aa,(da*H-X*L)*aa);oa.set((M*D-V*x)*aa,(M*F-V*E)*aa,(M*L-V*H)*aa);Y[Aa].addSelf(c);Y[Ba].addSelf(c);Y[wa].addSelf(c);ea[Aa].addSelf(oa);ea[Ba].addSelf(oa);ea[wa].addSelf(oa)}var b,d,e,g,k,l,o,n,w,z,x,D,E,F,H,L,M,V,X,da,aa,Y=[],ea=[],c=new THREE.Vector3,oa=new THREE.Vector3,ma=new THREE.Vector3,ua=new THREE.Vector3,pa=new THREE.Vector3;b=0;for(d=this.vertices.length;b<d;b++){Y[b]=
+new THREE.Vector3;ea[b]=new THREE.Vector3}b=0;for(d=this.faces.length;b<d;b++){e=this.faces[b];g=this.uvs[b];if(e instanceof THREE.Face3){a(this,e.a,e.b,e.c,0,1,2);this.vertices[e.a].normal.copy(e.vertexNormals[0]);this.vertices[e.b].normal.copy(e.vertexNormals[1]);this.vertices[e.c].normal.copy(e.vertexNormals[2])}else if(e instanceof THREE.Face4){a(this,e.a,e.b,e.c,0,1,2);a(this,e.a,e.b,e.d,0,1,3);this.vertices[e.a].normal.copy(e.vertexNormals[0]);this.vertices[e.b].normal.copy(e.vertexNormals[1]);
+this.vertices[e.c].normal.copy(e.vertexNormals[2]);this.vertices[e.d].normal.copy(e.vertexNormals[3])}}b=0;for(d=this.vertices.length;b<d;b++){pa.copy(this.vertices[b].normal);e=Y[b];ma.copy(e);ma.subSelf(pa.multiplyScalar(pa.dot(e))).normalize();ua.cross(this.vertices[b].normal,e);e=ua.dot(ea[b]);e=e<0?-1:1;this.vertices[b].tangent.set(ma.x,ma.y,ma.z,e)}this.hasTangents=!0},computeBoundingBox:function(){var a;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],
+y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,d=this.vertices.length;b<d;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<
+this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,b=0,d=this.vertices.length;b<d;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}}};THREE.GeometryIdCounter=0;
 THREE.Camera=function(a,b,d,e,g){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=d||0.1;this.far=e||2E3;this.target=g||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;
 THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Camera.prototype.updateMatrix=function(){this.update(undefined,!0)};
 THREE.Camera.prototype.update=function(a,b,d){if(this.useTarget){this.matrix.lookAt(this.position,this.target.position,this.up);this.matrix.setPosition(this.position);a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);b=!0}else{this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=
-!1;b=!0;THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse)}}for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,d)};
-THREE.QuakeCamera=function(a){function b(d,e){return function(){e.apply(d,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.dragToLook=!1;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.domElement=document;if(a){if(a.movementSpeed!==undefined)this.movementSpeed=a.movementSpeed;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.noFly!==undefined)this.noFly=
-a.noFly;if(a.lookVertical!==undefined)this.lookVertical=a.lookVertical;if(a.autoForward!==undefined)this.autoForward=a.autoForward;if(a.dragToLook!==undefined)this.dragToLook=a.dragToLook;if(a.heightSpeed!==undefined)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==undefined)this.heightCoef=a.heightCoef;if(a.heightMin!==undefined)this.heightMin=a.heightMin;if(a.heightMax!==undefined)this.heightMax=a.heightMax;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=
-this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.moveForward=!1;this.moveBackward=!1;this.moveLeft=!1;this.moveRight=!1;this.mouseDragOn=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(d){d.preventDefault();d.stopPropagation();if(!this.dragToLook)switch(d.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(d){d.preventDefault();d.stopPropagation();if(!this.dragToLook)switch(d.button){case 0:this.moveForward=
-!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(d){this.mouseX=d.clientX-this.windowHalfX;this.mouseY=d.clientY-this.windowHalfY};this.onKeyDown=function(d){switch(d.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0}};this.onKeyUp=function(d){switch(d.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=
-!1;break;case 39:case 68:this.moveRight=!1}};this.update=function(){this.autoSpeedFactor=this.heightSpeed?((this.position.y<this.heightMin?this.heightMin:this.position.y>this.heightMax?this.heightMax:this.position.y)-this.heightMin)*this.heightCoef:0;(this.moveForward||this.autoForward)&&this.translateZ(-(this.movementSpeed+this.autoSpeedFactor));this.moveBackward&&this.translateZ(this.movementSpeed);this.moveLeft&&this.translateX(-this.movementSpeed);this.moveRight&&this.translateX(this.movementSpeed);
-var d=this.lookSpeed;this.dragToLook&&!this.mouseDragOn&&(d=0);this.lon+=this.mouseX*d;this.lookVertical&&(this.lat-=this.mouseY*d);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;d=this.target.position;var e=this.position;d.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);d.y=e.y+100*Math.cos(this.phi);d.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(d){d.preventDefault()},
-!1);this.domElement.addEventListener("mousemove",b(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",b(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",b(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",b(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",b(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
-THREE.QuakeCamera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);if(this.noFly)b.y=0;this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};
-THREE.PathCamera=function(a){function b(u,y){var A=u[0]-y[0],B=u[1]-y[1],H=u[2]-y[2];return Math.sqrt(A*A+B*B+H*H)}function d(u,y,A,B){var H={name:A,fps:0.6,length:B,hierarchy:[]},L,P,T=y.length,U=l(y),$=0;L=T-1;P={parent:-1,keys:[]};P.keys[0]={time:0,pos:y[0],rot:[0,0,0,1],scl:[1,1,1]};P.keys[L]={time:B,pos:y[L],rot:[0,0,0,1],scl:[1,1,1]};for(L=1;L<T-1;L++){$=B*U.chunks[L]/U.total;P.keys[L]={time:$,pos:y[L]}}H.hierarchy[0]=P;THREE.AnimationHandler.add(H);return new THREE.Animation(u,A,THREE.AnimationHandler.CATMULLROM_FORWARD,
-!1)}function e(u){var y,A,B=u.length,H=[];for(y=0;y<B;y++){A=u[y];H[y]={x:A[0],y:A[1],z:A[2]}}return H}function g(u,y){var A,B,H,L,P,T,U=[],$=e(u),ea=new THREE.Spline,c=l(u);U.push(u[0]);for(A=1;A<u.length;A++){linearDistance=b(u[A],u[A-1]);realDistance=c.chunks[A]-c.chunks[A-1];T=Math.ceil(y*realDistance/c.total);L=(A-1)/(u.length-1);P=A/(u.length-1);for(B=1;B<T-1;B++){H=L+B*(1/T)*(P-L);position=ea.getPoint($,H);U.push([position.x,position.y,position.z])}U.push(u[A])}return U}function l(u){var y,
-A=e(u),B=new THREE.Spline,H=y=y=0,L=[0],P=0,T=[u[0][0],u[0][1],u[0][2]];for(u=1;u<A.length*100;u++){y=u/(A.length*100);position=B.getPoint(A,y);P+=b([position.x,position.y,position.z],T);T=[position.x,position.y,position.z];y*=A.length-1;y=Math.floor(y);if(y!=H){L[y]=P;H=y}}L[L.length]=P;return{chunks:L,total:P}}function m(u,y){var A,B,H=new THREE.Geometry,L=new THREE.Spline,P=e(u);for(A=0;A<P.length*y;A++){B=A/(P.length*y);B=L.getPoint(P,B);H.vertices[A]=new THREE.Vertex(new THREE.Vector3(B.x,B.y,
-B.z))}return H}function p(u,y){var A=m(y,10),B=m(y,10),H=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(A,H);particleObj=new THREE.ParticleSystem(B,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);u.addChild(lineObj);particleObj.scale.set(1,1,1);u.addChild(particleObj);B=new Sphere(1,16,8);H=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<y.length;i++){A=new THREE.Mesh(B,H);A.position.set(y[i][0],y[i][1],y[i][2]);A.updateMatrix();
-u.addChild(A)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookVertical=!0;this.lookHorizontal=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};
-this.domElement=document;if(a){if(a.duration!==undefined)this.duration=a.duration*1E3;if(a.waypoints!==undefined)this.waypoints=a.waypoints;if(a.useConstantSpeed!==undefined)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==undefined)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==undefined)this.createDebugPath=a.createDebugPath;if(a.createDebugDummy!==undefined)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==
-undefined)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==undefined)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==undefined)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==undefined)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var o=Math.PI*2,z=Math.PI/180;this.update=
-function(u,y,A){var B,H;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*z;this.theta=this.lon*z;B=this.phi%o;this.phi=B>=0?B:B+o;B=this.verticalAngleMap.srcRange;H=this.verticalAngleMap.dstRange;this.phi=(this.phi-B[0])*(H[1]-H[0])/(B[1]-B[0])+H[0];B=this.horizontalAngleMap.srcRange;H=this.horizontalAngleMap.dstRange;
-this.theta=(this.theta-B[0])*(H[1]-H[0])/(B[1]-B[0])+H[0];B=this.target.position;B.x=100*Math.sin(this.phi)*Math.cos(this.theta);B.y=100*Math.cos(this.phi);B.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,u,y,A)};this.onMouseMove=function(u){this.mouseX=u.clientX-this.windowHalfX;this.mouseY=u.clientY-this.windowHalfY};if(this.useConstantSpeed)this.waypoints=g(this.waypoints,this.resamplingCoef);if(this.createDebugDummy){a=new THREE.MeshLambertMaterial({color:30719});var D=
-new THREE.MeshLambertMaterial({color:65280}),C=new Cube(10,10,20),J=new Cube(2,2,10);this.animationParent=new THREE.Mesh(C,a);a=new THREE.Mesh(J,D);a.position.set(0,10,0);this.animation=d(this.animationParent,this.waypoints,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else{this.animation=d(this.animationParent,this.waypoints,this.id,this.duration);this.animationParent.addChild(this.target);this.animationParent.addChild(this)}this.createDebugPath&&
-p(this.debugPath,this.waypoints);this.domElement.addEventListener("mousemove",function(u,y){return function(){y.apply(u,arguments)}}(this,this.onMouseMove),!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;
-THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
-THREE.PointLight=function(a,b){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.FlatShading=0;THREE.SmoothShading=1;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.BillboardBlending=3;THREE.ReverseSubtractiveBlending=4;THREE.MaterialCounter={value:0};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};
-THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};
+!1;b=!0;THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse)}}for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,d)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;
+THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
+THREE.FlatShading=0;THREE.SmoothShading=1;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.BillboardBlending=3;THREE.ReverseSubtractiveBlending=4;THREE.MaterialCounter={value:0};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};
 THREE.LineBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.blending=THREE.NormalBlending;this.depthTest=!0;this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=!1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.linewidth!==undefined)this.linewidth=
 a.linewidth;if(a.linecap!==undefined)this.linecap=a.linecap;if(a.linejoin!==undefined)this.linejoin=a.linejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors}};
 THREE.MeshBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=!1;this.skinning=!1;if(a){a.color!==undefined&&
@@ -109,7 +89,7 @@ a.vertexShader;if(a.uniforms!==undefined)this.uniforms=a.uniforms;if(a.opacity!=
 undefined)this.wireframeLinejoin=a.wireframeLinejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors;if(a.skinning!==undefined)this.skinning=a.skinning}};
 THREE.ParticleBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.map=null;this.size=1;this.sizeAttenuation=!0;this.blending=THREE.NormalBlending;this.depthTest=!0;this.offset=new THREE.Vector2;this.vertexColors=!1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.size!==undefined)this.size=a.size;if(a.sizeAttenuation!==undefined)this.sizeAttenuation=
 a.sizeAttenuation;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors}};THREE.ParticleCircleMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.blending=THREE.NormalBlending;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending}};
-THREE.Texture=function(a,b,d,e,g,l){this.image=a;this.mapping=b!==undefined?b:new THREE.UVMapping;this.wrapS=d!==undefined?d:THREE.ClampToEdgeWrapping;this.wrapT=e!==undefined?e:THREE.ClampToEdgeWrapping;this.magFilter=g!==undefined?g:THREE.LinearFilter;this.minFilter=l!==undefined?l:THREE.LinearMipMapLinearFilter;this.needsUpdate=!1};THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter)}};
+THREE.Texture=function(a,b,d,e,g,k){this.image=a;this.mapping=b!==undefined?b:new THREE.UVMapping;this.wrapS=d!==undefined?d:THREE.ClampToEdgeWrapping;this.wrapT=e!==undefined?e:THREE.ClampToEdgeWrapping;this.magFilter=g!==undefined?g:THREE.LinearFilter;this.minFilter=k!==undefined?k:THREE.LinearMipMapLinearFilter;this.needsUpdate=!1};THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter)}};
 THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;
 THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;
 THREE.RenderTarget=function(a,b,d){this.width=a;this.height=b;d=d||{};this.wrapS=d.wrapS!==undefined?d.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=d.wrapT!==undefined?d.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=d.magFilter!==undefined?d.magFilter:THREE.LinearFilter;this.minFilter=d.minFilter!==undefined?d.minFilter:THREE.LinearMipMapLinearFilter;this.format=d.format!==undefined?d.format:THREE.RGBFormat;this.type=d.type!==undefined?d.type:THREE.UnsignedByteType};
@@ -119,12 +99,12 @@ THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.L
 THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
 THREE.Bone.prototype.update=function(a,b,d){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;b=!0}var e,g=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(e=0;e<g;e++){a=this.children[e];a instanceof THREE.Bone?a.update(this.skinMatrix,b,d):a.update(this.matrixWorld,!0,d)}}else for(e=0;e<g;e++)this.children[e].update(this.skinMatrix,
 b,d)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);if(!(a instanceof THREE.Bone))this.hasNoneBoneChildren=!0}};if(!window.Float32Array)window.Float32Array=Array;
-THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var d,e,g,l,m,p;if(this.geometry.bones!==undefined){for(d=0;d<this.geometry.bones.length;d++){g=this.geometry.bones[d];l=g.pos;m=g.rotq;p=g.scl;e=this.addBone();e.name=g.name;e.position.set(l[0],l[1],l[2]);e.quaternion.set(m[0],m[1],m[2],m[3]);e.useQuaternion=!0;p!==undefined?e.scale.set(p[0],p[1],p[2]):e.scale.set(1,1,1)}for(d=0;d<this.bones.length;d++){g=this.geometry.bones[d];
+THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var d,e,g,k,l,o;if(this.geometry.bones!==undefined){for(d=0;d<this.geometry.bones.length;d++){g=this.geometry.bones[d];k=g.pos;l=g.rotq;o=g.scl;e=this.addBone();e.name=g.name;e.position.set(k[0],k[1],k[2]);e.quaternion.set(l[0],l[1],l[2],l[3]);e.useQuaternion=!0;o!==undefined?e.scale.set(o[0],o[1],o[2]):e.scale.set(1,1,1)}for(d=0;d<this.bones.length;d++){g=this.geometry.bones[d];
 e=this.bones[d];g.parent===-1?this.addChild(e):this.bones[g.parent].addChild(e)}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.update=function(a,b,d){if(this.visible){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;b=!0}var e,g=this.children.length;for(e=0;e<g;e++){a=this.children[e];a instanceof THREE.Bone?a.update(this.identityMatrix,!1,d):a.update(this.matrixWorld,b,d)}d=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(b=0;b<d;b++)ba[b].skinMatrix.flattenToArrayOffset(bm,
 b*16)}};THREE.SkinnedMesh.prototype.addBone=function(a){a===undefined&&(a=new THREE.Bone(this));this.bones.push(a);return a};
-THREE.SkinnedMesh.prototype.pose=function(){this.update(undefined,!0);for(var a,b=[],d=0;d<this.bones.length;d++){a=this.bones[d];b.push(THREE.Matrix4.makeInvert(a.skinMatrix));a.skinMatrix.flattenToArrayOffset(this.boneMatrices,d*16)}if(this.geometry.skinVerticesA===undefined){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var e;for(a=0;a<this.geometry.skinIndices.length;a++){d=this.geometry.vertices[a].position;var g=this.geometry.skinIndices[a].x,l=this.geometry.skinIndices[a].y;
-e=new THREE.Vector3(d.x,d.y,d.z);this.geometry.skinVerticesA.push(b[g].multiplyVector3(e));e=new THREE.Vector3(d.x,d.y,d.z);this.geometry.skinVerticesB.push(b[l].multiplyVector3(e));if(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1){d=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5;this.geometry.skinWeights[a].x+=d;this.geometry.skinWeights[a].y+=d}}}};
+THREE.SkinnedMesh.prototype.pose=function(){this.update(undefined,!0);for(var a,b=[],d=0;d<this.bones.length;d++){a=this.bones[d];b.push(THREE.Matrix4.makeInvert(a.skinMatrix));a.skinMatrix.flattenToArrayOffset(this.boneMatrices,d*16)}if(this.geometry.skinVerticesA===undefined){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var e;for(a=0;a<this.geometry.skinIndices.length;a++){d=this.geometry.vertices[a].position;var g=this.geometry.skinIndices[a].x,k=this.geometry.skinIndices[a].y;
+e=new THREE.Vector3(d.x,d.y,d.z);this.geometry.skinVerticesA.push(b[g].multiplyVector3(e));e=new THREE.Vector3(d.x,d.y,d.z);this.geometry.skinVerticesB.push(b[k].multiplyVector3(e));if(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1){d=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5;this.geometry.skinWeights[a].x+=d;this.geometry.skinWeights[a].y+=d}}}};
 THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.flipSided=!1;this.doubleSided=!1};THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;
 THREE.Sound=function(a,b,d,e){THREE.Object3D.call(this);this.isLoaded=!1;this.isAddedToDOM=!1;this.isPlaying=!1;this.duration=-1;this.radius=b!==undefined?Math.abs(b):100;this.volume=Math.min(1,Math.max(0,d!==undefined?d:1));this.domElement=document.createElement("audio");this.domElement.volume=0;this.domElement.pan=0;this.domElement.loop=e!==undefined?e:!0;this.sources=a instanceof Array?a:[a];var g;d=this.sources.length;for(a=0;a<d;a++){b=this.sources[a];b.toLowerCase();if(b.indexOf(".mp3")!==-1)g=
 "audio/mpeg";else if(b.indexOf(".ogg")!==-1)g="audio/ogg";else b.indexOf(".wav")!==-1&&(g="audio/wav");if(this.domElement.canPlayType(g)){g=document.createElement("source");g.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(g);this.domElement.addEventListener("canplay",this.onLoad,!0);this.domElement.load();break}}};THREE.Sound.prototype=new THREE.Object3D;THREE.Sound.prototype.constructor=THREE.Sound;THREE.Sound.prototype.supr=THREE.Object3D.prototype;
@@ -159,70 +139,70 @@ THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,
 THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,"#ifndef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\n#endif\nvViewPosition = cameraPosition - mPosition.xyz;\nvec3 transformedNormal = normalize( normalMatrix * normal );\nvNormal = transformedNormal;",
 THREE.ShaderChunk.lights_vertex,THREE.ShaderChunk.skinning_vertex,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsLib.particle,fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["uniform float size;\nuniform float scale;",
 THREE.ShaderChunk.color_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;\n}"].join("\n")}};
-THREE.WebGLRenderer=function(a){function b(f,k,n){var h,j,v,q=f.vertices,t=q.length,F=f.colors,s=F.length,x=f.__vertexArray,N=f.__colorArray,S=f.__sortArray,Q=f.__dirtyVertices,M=f.__dirtyColors;if(n.sortParticles){Ia.multiplySelf(n.matrixWorld);for(h=0;h<t;h++){j=q[h].position;Da.copy(j);Ia.multiplyVector3(Da);S[h]=[Da.z,h]}S.sort(function(O,K){return K[0]-O[0]});for(h=0;h<t;h++){j=q[S[h][1]].position;v=h*3;x[v]=j.x;x[v+1]=j.y;x[v+2]=j.z}for(h=0;h<s;h++){v=h*3;color=F[S[h][1]];N[v]=color.r;N[v+1]=
-color.g;N[v+2]=color.b}}else{if(Q)for(h=0;h<t;h++){j=q[h].position;v=h*3;x[v]=j.x;x[v+1]=j.y;x[v+2]=j.z}if(M)for(h=0;h<s;h++){color=F[h];v=h*3;N[v]=color.r;N[v+1]=color.g;N[v+2]=color.b}}if(Q||n.sortParticles){c.bindBuffer(c.ARRAY_BUFFER,f.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,x,k)}if(M||n.sortParticles){c.bindBuffer(c.ARRAY_BUFFER,f.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,N,k)}}function d(f,k){f.fragmentShader=k.fragmentShader;f.vertexShader=k.vertexShader;f.uniforms=Uniforms.clone(k.uniforms)}
-function e(f,k,n,h,j){h.program||va.initMaterial(h,k,n,j);var v=h.program,q=v.uniforms,t=h.uniforms;if(v!=pa){c.useProgram(v);pa=v}c.uniformMatrix4fv(q.projectionMatrix,!1,Ra);if(n&&(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial||h instanceof THREE.LineBasicMaterial||h instanceof THREE.ParticleBasicMaterial)){t.fogColor.value.setHex(n.color.hex);if(n instanceof THREE.Fog){t.fogNear.value=n.near;t.fogFar.value=n.far}else if(n instanceof
-THREE.FogExp2)t.fogDensity.value=n.density}if(h instanceof THREE.MeshPhongMaterial||h instanceof THREE.MeshLambertMaterial){var F,s,x=0,N=0,S=0,Q,M,O,K=Sa,ja=K.directional.colors,w=K.directional.positions,ga=K.point.colors,fa=K.point.positions,ia=0,E=0;n=s=s=0;for(F=k.length;n<F;n++){s=k[n];Q=s.color;M=s.position;O=s.intensity;if(s instanceof THREE.AmbientLight){x+=Q.r;N+=Q.g;S+=Q.b}else if(s instanceof THREE.DirectionalLight){s=ia*3;ja[s]=Q.r*O;ja[s+1]=Q.g*O;ja[s+2]=Q.b*O;w[s]=M.x;w[s+1]=M.y;w[s+
-2]=M.z;ia+=1}else if(s instanceof THREE.PointLight){s=E*3;ga[s]=Q.r*O;ga[s+1]=Q.g*O;ga[s+2]=Q.b*O;fa[s]=M.x;fa[s+1]=M.y;fa[s+2]=M.z;E+=1}}for(n=ia*3;n<ja.length;n++)ja[n]=0;for(n=E*3;n<ga.length;n++)ga[n]=0;K.point.length=E;K.directional.length=ia;K.ambient[0]=x;K.ambient[1]=N;K.ambient[2]=S;k=Sa;t.enableLighting.value=k.directional.length+k.point.length;t.ambientLightColor.value=k.ambient;t.directionalLightColor.value=k.directional.colors;t.directionalLightDirection.value=k.directional.positions;
-t.pointLightColor.value=k.point.colors;t.pointLightPosition.value=k.point.positions}if(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial){t.diffuse.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);t.opacity.value=h.opacity;t.map.texture=h.map;t.lightMap.texture=h.lightMap;t.envMap.texture=h.envMap;t.reflectivity.value=h.reflectivity;t.refractionRatio.value=h.refractionRatio;t.combine.value=h.combine;t.useRefract.value=
-h.envMap&&h.envMap.mapping instanceof THREE.CubeRefractionMapping}if(h instanceof THREE.LineBasicMaterial){t.diffuse.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);t.opacity.value=h.opacity}else if(h instanceof THREE.ParticleBasicMaterial){t.psColor.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);t.opacity.value=h.opacity;t.size.value=h.size;t.scale.value=ea.height/2;t.map.texture=h.map}else if(h instanceof THREE.MeshPhongMaterial){t.ambient.value.setRGB(h.ambient.r,
-h.ambient.g,h.ambient.b);t.specular.value.setRGB(h.specular.r,h.specular.g,h.specular.b);t.shininess.value=h.shininess}else if(h instanceof THREE.MeshDepthMaterial){t.mNear.value=f.near;t.mFar.value=f.far;t.opacity.value=h.opacity}else if(h instanceof THREE.MeshNormalMaterial)t.opacity.value=h.opacity;for(var G in t)if(x=v.uniforms[G]){n=t[G];F=n.type;k=n.value;if(F=="i")c.uniform1i(x,k);else if(F=="f")c.uniform1f(x,k);else if(F=="fv1")c.uniform1fv(x,k);else if(F=="fv")c.uniform3fv(x,k);else if(F==
-"v2")c.uniform2f(x,k.x,k.y);else if(F=="v3")c.uniform3f(x,k.x,k.y,k.z);else if(F=="c")c.uniform3f(x,k.r,k.g,k.b);else if(F=="t"){c.uniform1i(x,k);if(n=n.texture)if(n.image instanceof Array&&n.image.length==6){if(n.image.length==6){if(n.needsUpdate){if(n.__wasSetOnce){c.bindTexture(c.TEXTURE_CUBE_MAP,n.image.__webGLTextureCube);for(F=0;F<6;++F)c.texSubImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,0,0,c.RGBA,c.UNSIGNED_BYTE,n.image[F])}else{n.image.__webGLTextureCube=c.createTexture();c.bindTexture(c.TEXTURE_CUBE_MAP,
-n.image.__webGLTextureCube);for(F=0;F<6;++F)c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,n.image[F]);n.__wasSetOnce=!0}L(c.TEXTURE_CUBE_MAP,n,n.image[0]);c.bindTexture(c.TEXTURE_CUBE_MAP,null);n.needsUpdate=!1}c.activeTexture(c.TEXTURE0+k);c.bindTexture(c.TEXTURE_CUBE_MAP,n.image.__webGLTextureCube)}}else{if(n.needsUpdate){if(n.__wasSetOnce){c.bindTexture(c.TEXTURE_2D,n.__webGLTexture);c.texSubImage2D(c.TEXTURE_2D,0,0,0,c.RGBA,c.UNSIGNED_BYTE,n.image)}else{n.__webGLTexture=
-c.createTexture();c.bindTexture(c.TEXTURE_2D,n.__webGLTexture);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,n.image);n.__wasSetOnce=!0}L(c.TEXTURE_2D,n,n.image);c.bindTexture(c.TEXTURE_2D,null);n.needsUpdate=!1}c.activeTexture(c.TEXTURE0+k);c.bindTexture(c.TEXTURE_2D,n.__webGLTexture)}}}c.uniformMatrix4fv(q.modelViewMatrix,!1,j._modelViewMatrixArray);c.uniformMatrix3fv(q.normalMatrix,!1,j._normalMatrixArray);(h instanceof THREE.MeshShaderMaterial||h instanceof THREE.MeshPhongMaterial||
-h.envMap)&&c.uniform3f(q.cameraPosition,f.position.x,f.position.y,f.position.z);(h instanceof THREE.MeshShaderMaterial||h.envMap||h.skinning)&&c.uniformMatrix4fv(q.objectMatrix,!1,j._objectMatrixArray);(h instanceof THREE.MeshPhongMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshShaderMaterial||h.skinning)&&c.uniformMatrix4fv(q.viewMatrix,!1,La);if(h.skinning){c.uniformMatrix4fv(q.cameraInverseMatrix,!1,La);c.uniformMatrix4fv(q.boneGlobalMatrices,!1,j.boneMatrices)}return v}
-function g(f,k,n,h,j,v){if(h.opacity!=0){f=e(f,k,n,h,v).attributes;c.bindBuffer(c.ARRAY_BUFFER,j.__webGLVertexBuffer);c.vertexAttribPointer(f.position,3,c.FLOAT,!1,0,0);if(f.color>=0){c.bindBuffer(c.ARRAY_BUFFER,j.__webGLColorBuffer);c.vertexAttribPointer(f.color,3,c.FLOAT,!1,0,0)}if(f.normal>=0){c.bindBuffer(c.ARRAY_BUFFER,j.__webGLNormalBuffer);c.vertexAttribPointer(f.normal,3,c.FLOAT,!1,0,0)}if(f.tangent>=0){c.bindBuffer(c.ARRAY_BUFFER,j.__webGLTangentBuffer);c.vertexAttribPointer(f.tangent,4,
-c.FLOAT,!1,0,0)}if(f.uv>=0)if(j.__webGLUVBuffer){c.bindBuffer(c.ARRAY_BUFFER,j.__webGLUVBuffer);c.vertexAttribPointer(f.uv,2,c.FLOAT,!1,0,0);c.enableVertexAttribArray(f.uv)}else c.disableVertexAttribArray(f.uv);if(f.uv2>=0)if(j.__webGLUV2Buffer){c.bindBuffer(c.ARRAY_BUFFER,j.__webGLUV2Buffer);c.vertexAttribPointer(f.uv2,2,c.FLOAT,!1,0,0);c.enableVertexAttribArray(f.uv2)}else c.disableVertexAttribArray(f.uv2);if(h.skinning&&f.skinVertexA>=0&&f.skinVertexB>=0&&f.skinIndex>=0&&f.skinWeight>=0){c.bindBuffer(c.ARRAY_BUFFER,
-j.__webGLSkinVertexABuffer);c.vertexAttribPointer(f.skinVertexA,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,j.__webGLSkinVertexBBuffer);c.vertexAttribPointer(f.skinVertexB,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,j.__webGLSkinIndicesBuffer);c.vertexAttribPointer(f.skinIndex,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,j.__webGLSkinWeightsBuffer);c.vertexAttribPointer(f.skinWeight,4,c.FLOAT,!1,0,0)}if(v instanceof THREE.Mesh)if(h.wireframe){c.lineWidth(h.wireframeLinewidth);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,
-j.__webGLLineBuffer);c.drawElements(c.LINES,j.__webGLLineCount,c.UNSIGNED_SHORT,0)}else{c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,j.__webGLFaceBuffer);c.drawElements(c.TRIANGLES,j.__webGLFaceCount,c.UNSIGNED_SHORT,0)}else if(v instanceof THREE.Line){v=v.type==THREE.LineStrip?c.LINE_STRIP:c.LINES;c.lineWidth(h.linewidth);c.drawArrays(v,0,j.__webGLLineCount)}else if(v instanceof THREE.ParticleSystem)c.drawArrays(c.POINTS,0,j.__webGLParticleCount);else v instanceof THREE.Ribbon&&c.drawArrays(c.TRIANGLE_STRIP,
-0,j.__webGLVertexCount)}}function l(f,k){if(!f.__webGLVertexBuffer)f.__webGLVertexBuffer=c.createBuffer();if(!f.__webGLNormalBuffer)f.__webGLNormalBuffer=c.createBuffer();if(f.hasPos){c.bindBuffer(c.ARRAY_BUFFER,f.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,f.positionArray,c.DYNAMIC_DRAW);c.enableVertexAttribArray(k.attributes.position);c.vertexAttribPointer(k.attributes.position,3,c.FLOAT,!1,0,0)}if(f.hasNormal){c.bindBuffer(c.ARRAY_BUFFER,f.__webGLNormalBuffer);c.bufferData(c.ARRAY_BUFFER,
-f.normalArray,c.DYNAMIC_DRAW);c.enableVertexAttribArray(k.attributes.normal);c.vertexAttribPointer(k.attributes.normal,3,c.FLOAT,!1,0,0)}c.drawArrays(c.TRIANGLES,0,f.count);f.count=0}function m(f){if(qa!=f.doubleSided){f.doubleSided?c.disable(c.CULL_FACE):c.enable(c.CULL_FACE);qa=f.doubleSided}if(ra!=f.flipSided){f.flipSided?c.frontFace(c.CW):c.frontFace(c.CCW);ra=f.flipSided}}function p(f){if(Ca!=f){f?c.enable(c.DEPTH_TEST):c.disable(c.DEPTH_TEST);Ca=f}}function o(f){sa[0].set(f.n41-f.n11,f.n42-
-f.n12,f.n43-f.n13,f.n44-f.n14);sa[1].set(f.n41+f.n11,f.n42+f.n12,f.n43+f.n13,f.n44+f.n14);sa[2].set(f.n41+f.n21,f.n42+f.n22,f.n43+f.n23,f.n44+f.n24);sa[3].set(f.n41-f.n21,f.n42-f.n22,f.n43-f.n23,f.n44-f.n24);sa[4].set(f.n41-f.n31,f.n42-f.n32,f.n43-f.n33,f.n44-f.n34);sa[5].set(f.n41+f.n31,f.n42+f.n32,f.n43+f.n33,f.n44+f.n34);var k;for(f=0;f<6;f++){k=sa[f];k.divideScalar(Math.sqrt(k.x*k.x+k.y*k.y+k.z*k.z))}}function z(f){for(var k=f.matrixWorld,n=-f.geometry.boundingSphere.radius*Math.max(f.scale.x,
-Math.max(f.scale.y,f.scale.z)),h=0;h<6;h++){f=sa[h].x*k.n14+sa[h].y*k.n24+sa[h].z*k.n34+sa[h].w;if(f<=n)return!1}return!0}function D(f,k){f.list[f.count]=k;f.count+=1}function C(f){var k,n,h=f.object,j=f.opaque,v=f.transparent;v.count=0;f=j.count=0;for(k=h.materials.length;f<k;f++){n=h.materials[f];n.opacity&&n.opacity<1||n.blending!=THREE.NormalBlending?D(v,n):D(j,n)}}function J(f){var k,n,h,j,v=f.object,q=f.buffer,t=f.opaque,F=f.transparent;F.count=0;f=t.count=0;for(h=v.materials.length;f<h;f++){k=
-v.materials[f];if(k instanceof THREE.MeshFaceMaterial){k=0;for(n=q.materials.length;k<n;k++)(j=q.materials[k])&&(j.opacity&&j.opacity<1||j.blending!=THREE.NormalBlending?D(F,j):D(t,j))}else{j=k;j.opacity&&j.opacity<1||j.blending!=THREE.NormalBlending?D(F,j):D(t,j)}}}function u(f,k){return k.z-f.z}function y(f,k){f._modelViewMatrix.multiplyToArray(k.matrixWorldInverse,f.matrixWorld,f._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(f._modelViewMatrix).transposeIntoArray(f._normalMatrixArray)}function A(f){function k(N){var S=
-[];n=0;for(h=N.length;n<h;n++)N[n]==undefined?S.push("undefined"):S.push(N[n].id);return S.join("_")}var n,h,j,v,q,t,F,s,x={};f.geometryGroups={};j=0;for(v=f.faces.length;j<v;j++){q=f.faces[j];t=q.materials;F=k(t);x[F]==undefined&&(x[F]={hash:F,counter:0});s=x[F].hash+"_"+x[F].counter;f.geometryGroups[s]==undefined&&(f.geometryGroups[s]={faces:[],materials:t,vertices:0});q=q instanceof THREE.Face3?3:4;if(f.geometryGroups[s].vertices+q>65535){x[F].counter+=1;s=x[F].hash+"_"+x[F].counter;f.geometryGroups[s]==
-undefined&&(f.geometryGroups[s]={faces:[],materials:t,vertices:0})}f.geometryGroups[s].faces.push(j);f.geometryGroups[s].vertices+=q}}function B(f,k,n){f.push({buffer:k,object:n,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function H(f){if(f!=Ba){switch(f){case THREE.AdditiveBlending:c.blendEquation(c.FUNC_ADD);c.blendFunc(c.ONE,c.ONE);break;case THREE.SubtractiveBlending:c.blendFunc(c.DST_COLOR,c.ZERO);break;case THREE.BillboardBlending:c.blendEquation(c.FUNC_ADD);c.blendFunc(c.SRC_ALPHA,
-c.ONE_MINUS_SRC_ALPHA);break;case THREE.ReverseSubtractiveBlending:c.blendEquation(c.FUNC_REVERSE_SUBTRACT);c.blendFunc(c.ONE,c.ONE);break;default:c.blendEquation(c.FUNC_ADD);c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA)}Ba=f}}function L(f,k,n){if((n.width&n.width-1)==0&&(n.height&n.height-1)==0){c.texParameteri(f,c.TEXTURE_WRAP_S,$(k.wrapS));c.texParameteri(f,c.TEXTURE_WRAP_T,$(k.wrapT));c.texParameteri(f,c.TEXTURE_MAG_FILTER,$(k.magFilter));c.texParameteri(f,c.TEXTURE_MIN_FILTER,$(k.minFilter));c.generateMipmap(f)}else{c.texParameteri(f,
-c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(f,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(f,c.TEXTURE_MAG_FILTER,U(k.magFilter));c.texParameteri(f,c.TEXTURE_MIN_FILTER,U(k.minFilter))}}function P(f){if(f&&!f.__webGLFramebuffer){f.__webGLFramebuffer=c.createFramebuffer();f.__webGLRenderbuffer=c.createRenderbuffer();f.__webGLTexture=c.createTexture();c.bindRenderbuffer(c.RENDERBUFFER,f.__webGLRenderbuffer);c.renderbufferStorage(c.RENDERBUFFER,c.DEPTH_COMPONENT16,f.width,f.height);c.bindTexture(c.TEXTURE_2D,
-f.__webGLTexture);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,$(f.wrapS));c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,$(f.wrapT));c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,$(f.magFilter));c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,$(f.minFilter));c.texImage2D(c.TEXTURE_2D,0,$(f.format),f.width,f.height,0,$(f.format),$(f.type),null);c.bindFramebuffer(c.FRAMEBUFFER,f.__webGLFramebuffer);c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,f.__webGLTexture,0);c.framebufferRenderbuffer(c.FRAMEBUFFER,
-c.DEPTH_ATTACHMENT,c.RENDERBUFFER,f.__webGLRenderbuffer);c.bindTexture(c.TEXTURE_2D,null);c.bindRenderbuffer(c.RENDERBUFFER,null);c.bindFramebuffer(c.FRAMEBUFFER,null)}var k,n;if(f){k=f.__webGLFramebuffer;n=f.width;f=f.height}else{k=null;n=Ga;f=Ha}if(k!=na){c.bindFramebuffer(c.FRAMEBUFFER,k);c.viewport(xa,Fa,n,f);na=k}}function T(f,k){var n;if(f=="fragment")n=c.createShader(c.FRAGMENT_SHADER);else f=="vertex"&&(n=c.createShader(c.VERTEX_SHADER));c.shaderSource(n,k);c.compileShader(n);if(!c.getShaderParameter(n,
-c.COMPILE_STATUS)){alert(c.getShaderInfoLog(n));return null}return n}function U(f){switch(f){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return c.NEAREST;case THREE.LinearFilter:case THREE.LinearMipMapNearestFilter:case THREE.LinearMipMapLinearFilter:return c.LINEAR}}function $(f){switch(f){case THREE.RepeatWrapping:return c.REPEAT;case THREE.ClampToEdgeWrapping:return c.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return c.MIRRORED_REPEAT;
+THREE.WebGLRenderer=function(a){function b(f,j,m){var h,i,t,p=f.vertices,s=p.length,A=f.colors,r=A.length,v=f.__vertexArray,J=f.__colorArray,P=f.__sortArray,N=f.__dirtyVertices,I=f.__dirtyColors;if(m.sortParticles){Ha.multiplySelf(m.matrixWorld);for(h=0;h<s;h++){i=p[h].position;Ca.copy(i);Ha.multiplyVector3(Ca);P[h]=[Ca.z,h]}P.sort(function(K,G){return G[0]-K[0]});for(h=0;h<s;h++){i=p[P[h][1]].position;t=h*3;v[t]=i.x;v[t+1]=i.y;v[t+2]=i.z}for(h=0;h<r;h++){t=h*3;color=A[P[h][1]];J[t]=color.r;J[t+1]=
+color.g;J[t+2]=color.b}}else{if(N)for(h=0;h<s;h++){i=p[h].position;t=h*3;v[t]=i.x;v[t+1]=i.y;v[t+2]=i.z}if(I)for(h=0;h<r;h++){color=A[h];t=h*3;J[t]=color.r;J[t+1]=color.g;J[t+2]=color.b}}if(N||m.sortParticles){c.bindBuffer(c.ARRAY_BUFFER,f.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,v,j)}if(I||m.sortParticles){c.bindBuffer(c.ARRAY_BUFFER,f.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,J,j)}}function d(f,j){f.fragmentShader=j.fragmentShader;f.vertexShader=j.vertexShader;f.uniforms=Uniforms.clone(j.uniforms)}
+function e(f,j,m,h,i){h.program||ua.initMaterial(h,j,m,i);var t=h.program,p=t.uniforms,s=h.uniforms;if(t!=oa){c.useProgram(t);oa=t}c.uniformMatrix4fv(p.projectionMatrix,!1,Qa);if(m&&(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial||h instanceof THREE.LineBasicMaterial||h instanceof THREE.ParticleBasicMaterial)){s.fogColor.value.setHex(m.color.hex);if(m instanceof THREE.Fog){s.fogNear.value=m.near;s.fogFar.value=m.far}else if(m instanceof
+THREE.FogExp2)s.fogDensity.value=m.density}if(h instanceof THREE.MeshPhongMaterial||h instanceof THREE.MeshLambertMaterial){var A,r,v=0,J=0,P=0,N,I,K,G=Ra,ia=G.directional.colors,u=G.directional.positions,fa=G.point.colors,ca=G.point.positions,ha=0,y=0;m=r=r=0;for(A=j.length;m<A;m++){r=j[m];N=r.color;I=r.position;K=r.intensity;if(r instanceof THREE.AmbientLight){v+=N.r;J+=N.g;P+=N.b}else if(r instanceof THREE.DirectionalLight){r=ha*3;ia[r]=N.r*K;ia[r+1]=N.g*K;ia[r+2]=N.b*K;u[r]=I.x;u[r+1]=I.y;u[r+
+2]=I.z;ha+=1}else if(r instanceof THREE.PointLight){r=y*3;fa[r]=N.r*K;fa[r+1]=N.g*K;fa[r+2]=N.b*K;ca[r]=I.x;ca[r+1]=I.y;ca[r+2]=I.z;y+=1}}for(m=ha*3;m<ia.length;m++)ia[m]=0;for(m=y*3;m<fa.length;m++)fa[m]=0;G.point.length=y;G.directional.length=ha;G.ambient[0]=v;G.ambient[1]=J;G.ambient[2]=P;j=Ra;s.enableLighting.value=j.directional.length+j.point.length;s.ambientLightColor.value=j.ambient;s.directionalLightColor.value=j.directional.colors;s.directionalLightDirection.value=j.directional.positions;
+s.pointLightColor.value=j.point.colors;s.pointLightPosition.value=j.point.positions}if(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial){s.diffuse.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);s.opacity.value=h.opacity;s.map.texture=h.map;s.lightMap.texture=h.lightMap;s.envMap.texture=h.envMap;s.reflectivity.value=h.reflectivity;s.refractionRatio.value=h.refractionRatio;s.combine.value=h.combine;s.useRefract.value=
+h.envMap&&h.envMap.mapping instanceof THREE.CubeRefractionMapping}if(h instanceof THREE.LineBasicMaterial){s.diffuse.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);s.opacity.value=h.opacity}else if(h instanceof THREE.ParticleBasicMaterial){s.psColor.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);s.opacity.value=h.opacity;s.size.value=h.size;s.scale.value=ea.height/2;s.map.texture=h.map}else if(h instanceof THREE.MeshPhongMaterial){s.ambient.value.setRGB(h.ambient.r,
+h.ambient.g,h.ambient.b);s.specular.value.setRGB(h.specular.r,h.specular.g,h.specular.b);s.shininess.value=h.shininess}else if(h instanceof THREE.MeshDepthMaterial){s.mNear.value=f.near;s.mFar.value=f.far;s.opacity.value=h.opacity}else if(h instanceof THREE.MeshNormalMaterial)s.opacity.value=h.opacity;for(var B in s)if(v=t.uniforms[B]){m=s[B];A=m.type;j=m.value;if(A=="i")c.uniform1i(v,j);else if(A=="f")c.uniform1f(v,j);else if(A=="fv1")c.uniform1fv(v,j);else if(A=="fv")c.uniform3fv(v,j);else if(A==
+"v2")c.uniform2f(v,j.x,j.y);else if(A=="v3")c.uniform3f(v,j.x,j.y,j.z);else if(A=="c")c.uniform3f(v,j.r,j.g,j.b);else if(A=="t"){c.uniform1i(v,j);if(m=m.texture)if(m.image instanceof Array&&m.image.length==6){if(m.image.length==6){if(m.needsUpdate){if(m.__wasSetOnce){c.bindTexture(c.TEXTURE_CUBE_MAP,m.image.__webGLTextureCube);for(A=0;A<6;++A)c.texSubImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+A,0,0,0,c.RGBA,c.UNSIGNED_BYTE,m.image[A])}else{m.image.__webGLTextureCube=c.createTexture();c.bindTexture(c.TEXTURE_CUBE_MAP,
+m.image.__webGLTextureCube);for(A=0;A<6;++A)c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+A,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,m.image[A]);m.__wasSetOnce=!0}V(c.TEXTURE_CUBE_MAP,m,m.image[0]);c.bindTexture(c.TEXTURE_CUBE_MAP,null);m.needsUpdate=!1}c.activeTexture(c.TEXTURE0+j);c.bindTexture(c.TEXTURE_CUBE_MAP,m.image.__webGLTextureCube)}}else{if(m.needsUpdate){if(m.__wasSetOnce){c.bindTexture(c.TEXTURE_2D,m.__webGLTexture);c.texSubImage2D(c.TEXTURE_2D,0,0,0,c.RGBA,c.UNSIGNED_BYTE,m.image)}else{m.__webGLTexture=
+c.createTexture();c.bindTexture(c.TEXTURE_2D,m.__webGLTexture);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,m.image);m.__wasSetOnce=!0}V(c.TEXTURE_2D,m,m.image);c.bindTexture(c.TEXTURE_2D,null);m.needsUpdate=!1}c.activeTexture(c.TEXTURE0+j);c.bindTexture(c.TEXTURE_2D,m.__webGLTexture)}}}c.uniformMatrix4fv(p.modelViewMatrix,!1,i._modelViewMatrixArray);c.uniformMatrix3fv(p.normalMatrix,!1,i._normalMatrixArray);(h instanceof THREE.MeshShaderMaterial||h instanceof THREE.MeshPhongMaterial||
+h.envMap)&&c.uniform3f(p.cameraPosition,f.position.x,f.position.y,f.position.z);(h instanceof THREE.MeshShaderMaterial||h.envMap||h.skinning)&&c.uniformMatrix4fv(p.objectMatrix,!1,i._objectMatrixArray);(h instanceof THREE.MeshPhongMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshShaderMaterial||h.skinning)&&c.uniformMatrix4fv(p.viewMatrix,!1,Ka);if(h.skinning){c.uniformMatrix4fv(p.cameraInverseMatrix,!1,Ka);c.uniformMatrix4fv(p.boneGlobalMatrices,!1,i.boneMatrices)}return t}
+function g(f,j,m,h,i,t){if(h.opacity!=0){f=e(f,j,m,h,t).attributes;c.bindBuffer(c.ARRAY_BUFFER,i.__webGLVertexBuffer);c.vertexAttribPointer(f.position,3,c.FLOAT,!1,0,0);if(f.color>=0){c.bindBuffer(c.ARRAY_BUFFER,i.__webGLColorBuffer);c.vertexAttribPointer(f.color,3,c.FLOAT,!1,0,0)}if(f.normal>=0){c.bindBuffer(c.ARRAY_BUFFER,i.__webGLNormalBuffer);c.vertexAttribPointer(f.normal,3,c.FLOAT,!1,0,0)}if(f.tangent>=0){c.bindBuffer(c.ARRAY_BUFFER,i.__webGLTangentBuffer);c.vertexAttribPointer(f.tangent,4,
+c.FLOAT,!1,0,0)}if(f.uv>=0)if(i.__webGLUVBuffer){c.bindBuffer(c.ARRAY_BUFFER,i.__webGLUVBuffer);c.vertexAttribPointer(f.uv,2,c.FLOAT,!1,0,0);c.enableVertexAttribArray(f.uv)}else c.disableVertexAttribArray(f.uv);if(f.uv2>=0)if(i.__webGLUV2Buffer){c.bindBuffer(c.ARRAY_BUFFER,i.__webGLUV2Buffer);c.vertexAttribPointer(f.uv2,2,c.FLOAT,!1,0,0);c.enableVertexAttribArray(f.uv2)}else c.disableVertexAttribArray(f.uv2);if(h.skinning&&f.skinVertexA>=0&&f.skinVertexB>=0&&f.skinIndex>=0&&f.skinWeight>=0){c.bindBuffer(c.ARRAY_BUFFER,
+i.__webGLSkinVertexABuffer);c.vertexAttribPointer(f.skinVertexA,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,i.__webGLSkinVertexBBuffer);c.vertexAttribPointer(f.skinVertexB,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,i.__webGLSkinIndicesBuffer);c.vertexAttribPointer(f.skinIndex,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,i.__webGLSkinWeightsBuffer);c.vertexAttribPointer(f.skinWeight,4,c.FLOAT,!1,0,0)}if(t instanceof THREE.Mesh)if(h.wireframe){c.lineWidth(h.wireframeLinewidth);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,
+i.__webGLLineBuffer);c.drawElements(c.LINES,i.__webGLLineCount,c.UNSIGNED_SHORT,0)}else{c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,i.__webGLFaceBuffer);c.drawElements(c.TRIANGLES,i.__webGLFaceCount,c.UNSIGNED_SHORT,0)}else if(t instanceof THREE.Line){t=t.type==THREE.LineStrip?c.LINE_STRIP:c.LINES;c.lineWidth(h.linewidth);c.drawArrays(t,0,i.__webGLLineCount)}else if(t instanceof THREE.ParticleSystem)c.drawArrays(c.POINTS,0,i.__webGLParticleCount);else t instanceof THREE.Ribbon&&c.drawArrays(c.TRIANGLE_STRIP,
+0,i.__webGLVertexCount)}}function k(f,j){if(!f.__webGLVertexBuffer)f.__webGLVertexBuffer=c.createBuffer();if(!f.__webGLNormalBuffer)f.__webGLNormalBuffer=c.createBuffer();if(f.hasPos){c.bindBuffer(c.ARRAY_BUFFER,f.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,f.positionArray,c.DYNAMIC_DRAW);c.enableVertexAttribArray(j.attributes.position);c.vertexAttribPointer(j.attributes.position,3,c.FLOAT,!1,0,0)}if(f.hasNormal){c.bindBuffer(c.ARRAY_BUFFER,f.__webGLNormalBuffer);c.bufferData(c.ARRAY_BUFFER,
+f.normalArray,c.DYNAMIC_DRAW);c.enableVertexAttribArray(j.attributes.normal);c.vertexAttribPointer(j.attributes.normal,3,c.FLOAT,!1,0,0)}c.drawArrays(c.TRIANGLES,0,f.count);f.count=0}function l(f){if(pa!=f.doubleSided){f.doubleSided?c.disable(c.CULL_FACE):c.enable(c.CULL_FACE);pa=f.doubleSided}if(qa!=f.flipSided){f.flipSided?c.frontFace(c.CW):c.frontFace(c.CCW);qa=f.flipSided}}function o(f){if(Ba!=f){f?c.enable(c.DEPTH_TEST):c.disable(c.DEPTH_TEST);Ba=f}}function n(f){ra[0].set(f.n41-f.n11,f.n42-
+f.n12,f.n43-f.n13,f.n44-f.n14);ra[1].set(f.n41+f.n11,f.n42+f.n12,f.n43+f.n13,f.n44+f.n14);ra[2].set(f.n41+f.n21,f.n42+f.n22,f.n43+f.n23,f.n44+f.n24);ra[3].set(f.n41-f.n21,f.n42-f.n22,f.n43-f.n23,f.n44-f.n24);ra[4].set(f.n41-f.n31,f.n42-f.n32,f.n43-f.n33,f.n44-f.n34);ra[5].set(f.n41+f.n31,f.n42+f.n32,f.n43+f.n33,f.n44+f.n34);var j;for(f=0;f<6;f++){j=ra[f];j.divideScalar(Math.sqrt(j.x*j.x+j.y*j.y+j.z*j.z))}}function w(f){for(var j=f.matrixWorld,m=-f.geometry.boundingSphere.radius*Math.max(f.scale.x,
+Math.max(f.scale.y,f.scale.z)),h=0;h<6;h++){f=ra[h].x*j.n14+ra[h].y*j.n24+ra[h].z*j.n34+ra[h].w;if(f<=m)return!1}return!0}function z(f,j){f.list[f.count]=j;f.count+=1}function x(f){var j,m,h=f.object,i=f.opaque,t=f.transparent;t.count=0;f=i.count=0;for(j=h.materials.length;f<j;f++){m=h.materials[f];m.opacity&&m.opacity<1||m.blending!=THREE.NormalBlending?z(t,m):z(i,m)}}function D(f){var j,m,h,i,t=f.object,p=f.buffer,s=f.opaque,A=f.transparent;A.count=0;f=s.count=0;for(h=t.materials.length;f<h;f++){j=
+t.materials[f];if(j instanceof THREE.MeshFaceMaterial){j=0;for(m=p.materials.length;j<m;j++)(i=p.materials[j])&&(i.opacity&&i.opacity<1||i.blending!=THREE.NormalBlending?z(A,i):z(s,i))}else{i=j;i.opacity&&i.opacity<1||i.blending!=THREE.NormalBlending?z(A,i):z(s,i)}}}function E(f,j){return j.z-f.z}function F(f,j){f._modelViewMatrix.multiplyToArray(j.matrixWorldInverse,f.matrixWorld,f._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(f._modelViewMatrix).transposeIntoArray(f._normalMatrixArray)}function H(f){function j(J){var P=
+[];m=0;for(h=J.length;m<h;m++)J[m]==undefined?P.push("undefined"):P.push(J[m].id);return P.join("_")}var m,h,i,t,p,s,A,r,v={};f.geometryGroups={};i=0;for(t=f.faces.length;i<t;i++){p=f.faces[i];s=p.materials;A=j(s);v[A]==undefined&&(v[A]={hash:A,counter:0});r=v[A].hash+"_"+v[A].counter;f.geometryGroups[r]==undefined&&(f.geometryGroups[r]={faces:[],materials:s,vertices:0});p=p instanceof THREE.Face3?3:4;if(f.geometryGroups[r].vertices+p>65535){v[A].counter+=1;r=v[A].hash+"_"+v[A].counter;f.geometryGroups[r]==
+undefined&&(f.geometryGroups[r]={faces:[],materials:s,vertices:0})}f.geometryGroups[r].faces.push(i);f.geometryGroups[r].vertices+=p}}function L(f,j,m){f.push({buffer:j,object:m,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function M(f){if(f!=Aa){switch(f){case THREE.AdditiveBlending:c.blendEquation(c.FUNC_ADD);c.blendFunc(c.ONE,c.ONE);break;case THREE.SubtractiveBlending:c.blendFunc(c.DST_COLOR,c.ZERO);break;case THREE.BillboardBlending:c.blendEquation(c.FUNC_ADD);c.blendFunc(c.SRC_ALPHA,
+c.ONE_MINUS_SRC_ALPHA);break;case THREE.ReverseSubtractiveBlending:c.blendEquation(c.FUNC_REVERSE_SUBTRACT);c.blendFunc(c.ONE,c.ONE);break;default:c.blendEquation(c.FUNC_ADD);c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA)}Aa=f}}function V(f,j,m){if((m.width&m.width-1)==0&&(m.height&m.height-1)==0){c.texParameteri(f,c.TEXTURE_WRAP_S,Y(j.wrapS));c.texParameteri(f,c.TEXTURE_WRAP_T,Y(j.wrapT));c.texParameteri(f,c.TEXTURE_MAG_FILTER,Y(j.magFilter));c.texParameteri(f,c.TEXTURE_MIN_FILTER,Y(j.minFilter));c.generateMipmap(f)}else{c.texParameteri(f,
+c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(f,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(f,c.TEXTURE_MAG_FILTER,aa(j.magFilter));c.texParameteri(f,c.TEXTURE_MIN_FILTER,aa(j.minFilter))}}function X(f){if(f&&!f.__webGLFramebuffer){f.__webGLFramebuffer=c.createFramebuffer();f.__webGLRenderbuffer=c.createRenderbuffer();f.__webGLTexture=c.createTexture();c.bindRenderbuffer(c.RENDERBUFFER,f.__webGLRenderbuffer);c.renderbufferStorage(c.RENDERBUFFER,c.DEPTH_COMPONENT16,f.width,f.height);c.bindTexture(c.TEXTURE_2D,
+f.__webGLTexture);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,Y(f.wrapS));c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,Y(f.wrapT));c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,Y(f.magFilter));c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,Y(f.minFilter));c.texImage2D(c.TEXTURE_2D,0,Y(f.format),f.width,f.height,0,Y(f.format),Y(f.type),null);c.bindFramebuffer(c.FRAMEBUFFER,f.__webGLFramebuffer);c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,f.__webGLTexture,0);c.framebufferRenderbuffer(c.FRAMEBUFFER,
+c.DEPTH_ATTACHMENT,c.RENDERBUFFER,f.__webGLRenderbuffer);c.bindTexture(c.TEXTURE_2D,null);c.bindRenderbuffer(c.RENDERBUFFER,null);c.bindFramebuffer(c.FRAMEBUFFER,null)}var j,m;if(f){j=f.__webGLFramebuffer;m=f.width;f=f.height}else{j=null;m=Fa;f=Ga}if(j!=ma){c.bindFramebuffer(c.FRAMEBUFFER,j);c.viewport(wa,Ea,m,f);ma=j}}function da(f,j){var m;if(f=="fragment")m=c.createShader(c.FRAGMENT_SHADER);else f=="vertex"&&(m=c.createShader(c.VERTEX_SHADER));c.shaderSource(m,j);c.compileShader(m);if(!c.getShaderParameter(m,
+c.COMPILE_STATUS)){alert(c.getShaderInfoLog(m));return null}return m}function aa(f){switch(f){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return c.NEAREST;case THREE.LinearFilter:case THREE.LinearMipMapNearestFilter:case THREE.LinearMipMapLinearFilter:return c.LINEAR}}function Y(f){switch(f){case THREE.RepeatWrapping:return c.REPEAT;case THREE.ClampToEdgeWrapping:return c.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return c.MIRRORED_REPEAT;
 case THREE.NearestFilter:return c.NEAREST;case THREE.NearestMipMapNearestFilter:return c.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return c.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return c.LINEAR;case THREE.LinearMipMapNearestFilter:return c.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return c.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return c.BYTE;case THREE.UnsignedByteType:return c.UNSIGNED_BYTE;case THREE.ShortType:return c.SHORT;case THREE.UnsignedShortType:return c.UNSIGNED_SHORT;
-case THREE.IntType:return c.INT;case THREE.UnsignedShortType:return c.UNSIGNED_INT;case THREE.FloatType:return c.FLOAT;case THREE.AlphaFormat:return c.ALPHA;case THREE.RGBFormat:return c.RGB;case THREE.RGBAFormat:return c.RGBA;case THREE.LuminanceFormat:return c.LUMINANCE;case THREE.LuminanceAlphaFormat:return c.LUMINANCE_ALPHA}return 0}var ea=document.createElement("canvas"),c,pa=null,na=null,va=this,qa=null,ra=null,Ba=null,Ca=null,xa=0,Fa=0,Ga=0,Ha=0,sa=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,
-new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ia=new THREE.Matrix4,Ra=new Float32Array(16),La=new Float32Array(16),Da=new THREE.Vector4,Sa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[]}},Ta=!0,Ua=new THREE.Color(0),Va=0;if(a){if(a.antialias!==undefined)Ta=a.antialias;a.clearColor!==undefined&&Ua.setHex(a.clearColor);if(a.clearAlpha!==undefined)Va=a.clearAlpha}this.domElement=ea;this.autoClear=!0;this.sortObjects=!0;(function(f,k,n){try{if(!(c=
-ea.getContext("experimental-webgl",{antialias:f})))throw"Error creating WebGL context.";}catch(h){console.error(h)}c.clearColor(0,0,0,1);c.clearDepth(1);c.enable(c.DEPTH_TEST);c.depthFunc(c.LEQUAL);c.frontFace(c.CCW);c.cullFace(c.BACK);c.enable(c.CULL_FACE);c.enable(c.BLEND);c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA);c.clearColor(k.r,k.g,k.b,n);_cullEnabled=!0})(Ta,Ua,Va);this.context=c;this.setSize=function(f,k){ea.width=f;ea.height=k;this.setViewport(0,0,ea.width,ea.height)};this.setViewport=function(f,
-k,n,h){xa=f;Fa=k;Ga=n;Ha=h;c.viewport(xa,Fa,Ga,Ha)};this.setScissor=function(f,k,n,h){c.scissor(f,k,n,h)};this.enableScissorTest=function(f){f?c.enable(c.SCISSOR_TEST):c.disable(c.SCISSOR_TEST)};this.enableDepthBufferWrite=function(f){c.depthMask(f)};this.setClearColorHex=function(f,k){var n=new THREE.Color(f);c.clearColor(n.r,n.g,n.b,k)};this.setClearColor=function(f,k){c.clearColor(f.r,f.g,f.b,k)};this.clear=function(){c.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT)};this.initMaterial=function(f,
-k,n,h){var j;if(f instanceof THREE.MeshDepthMaterial)d(f,THREE.ShaderLib.depth);else if(f instanceof THREE.MeshNormalMaterial)d(f,THREE.ShaderLib.normal);else if(f instanceof THREE.MeshBasicMaterial)d(f,THREE.ShaderLib.basic);else if(f instanceof THREE.MeshLambertMaterial)d(f,THREE.ShaderLib.lambert);else if(f instanceof THREE.MeshPhongMaterial)d(f,THREE.ShaderLib.phong);else if(f instanceof THREE.LineBasicMaterial)d(f,THREE.ShaderLib.basic);else f instanceof THREE.ParticleBasicMaterial&&d(f,THREE.ShaderLib.particle_basic);
-var v,q,t,F,s;v=F=s=0;for(q=k.length;v<q;v++){t=k[v];t instanceof THREE.DirectionalLight&&F++;t instanceof THREE.PointLight&&s++}if(s+F<=4)k=F;else{k=Math.ceil(4*F/(s+F));s=4-k}k={directional:k,point:s};v=50;if(h!==undefined&&h instanceof THREE.SkinnedMesh)v=h.bones.length;h=f.fragmentShader;s=f.vertexShader;v={fog:n,map:f.map,envMap:f.envMap,lightMap:f.lightMap,vertexColors:f.vertexColors,sizeAttenuation:f.sizeAttenuation,skinning:f.skinning,maxDirLights:k.directional,maxPointLights:k.point,maxBones:v};
-n=c.createProgram();k=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+v.maxDirLights,"#define MAX_POINT_LIGHTS "+v.maxPointLights,v.fog?"#define USE_FOG":"",v.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",v.map?"#define USE_MAP":"",v.envMap?"#define USE_ENVMAP":"",v.lightMap?"#define USE_LIGHTMAP":"",v.vertexColors?"#define USE_COLOR":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");v=[c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0?"#define VERTEX_TEXTURES":
-"","#define MAX_DIR_LIGHTS "+v.maxDirLights,"#define MAX_POINT_LIGHTS "+v.maxPointLights,"#define MAX_BONES "+v.maxBones,v.map?"#define USE_MAP":"",v.envMap?"#define USE_ENVMAP":"",v.lightMap?"#define USE_LIGHTMAP":"",v.vertexColors?"#define USE_COLOR":"",v.skinning?"#define USE_SKINNING":"",v.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n"].join("\n");
-c.attachShader(n,T("fragment",k+h));c.attachShader(n,T("vertex",v+s));c.linkProgram(n);c.getProgramParameter(n,c.LINK_STATUS)||alert("Could not initialise shaders\nVALIDATE_STATUS: "+c.getProgramParameter(n,c.VALIDATE_STATUS)+", gl error ["+c.getError()+"]");n.uniforms={};n.attributes={};f.program=n;n=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices"];for(j in f.uniforms)n.push(j);j=f.program;h=0;for(s=n.length;h<
-s;h++){k=n[h];j.uniforms[k]=c.getUniformLocation(j,k)}j=f.program;n=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];h=0;for(s=n.length;h<s;h++){k=n[h];j.attributes[k]=c.getAttribLocation(j,k)}j=f.program.attributes;c.enableVertexAttribArray(j.position);j.color>=0&&c.enableVertexAttribArray(j.color);j.normal>=0&&c.enableVertexAttribArray(j.normal);j.tangent>=0&&c.enableVertexAttribArray(j.tangent);if(f.skinning&&j.skinVertexA>=0&&j.skinVertexB>=
-0&&j.skinIndex>=0&&j.skinWeight>=0){c.enableVertexAttribArray(j.skinVertexA);c.enableVertexAttribArray(j.skinVertexB);c.enableVertexAttribArray(j.skinIndex);c.enableVertexAttribArray(j.skinWeight)}};this.render=function(f,k,n,h){var j,v,q,t,F,s,x,N,S=f.lights,Q=f.fog;k.matrixAutoUpdate&&k.updateMatrix();f.update(undefined,!1,k);k.matrixWorldInverse.flattenToArray(La);k.projectionMatrix.flattenToArray(Ra);Ia.multiply(k.projectionMatrix,k.matrixWorldInverse);o(Ia);this.initWebGLObjects(f);P(n);(this.autoClear||
-h)&&this.clear();F=f.__webglObjects.length;for(h=0;h<F;h++){j=f.__webglObjects[h];x=j.object;if(x.visible)if(!(x instanceof THREE.Mesh)||z(x)){x.matrixWorld.flattenToArray(x._objectMatrixArray);y(x,k);J(j);j.render=!0;if(this.sortObjects){Da.copy(x.position);Ia.multiplyVector3(Da);j.z=Da.z}}else j.render=!1;else j.render=!1}this.sortObjects&&f.__webglObjects.sort(u);s=f.__webglObjectsImmediate.length;for(h=0;h<s;h++){j=f.__webglObjectsImmediate[h];x=j.object;if(x.visible){x.matrixAutoUpdate&&x.matrixWorld.flattenToArray(x._objectMatrixArray);
-y(x,k);C(j)}}H(THREE.NormalBlending);for(h=0;h<F;h++){j=f.__webglObjects[h];if(j.render){x=j.object;N=j.buffer;q=j.opaque;m(x);for(j=0;j<q.count;j++){t=q.list[j];p(t.depthTest);g(k,S,Q,t,N,x)}}}for(h=0;h<s;h++){j=f.__webglObjectsImmediate[h];x=j.object;if(x.visible){q=j.opaque;m(x);for(j=0;j<q.count;j++){t=q.list[j];p(t.depthTest);v=e(k,S,Q,t,x);x.render(function(M){l(M,v)})}}}for(h=0;h<F;h++){j=f.__webglObjects[h];if(j.render){x=j.object;N=j.buffer;q=j.transparent;m(x);for(j=0;j<q.count;j++){t=q.list[j];
-H(t.blending);p(t.depthTest);g(k,S,Q,t,N,x)}}}for(h=0;h<s;h++){j=f.__webglObjectsImmediate[h];x=j.object;if(x.visible){q=j.transparent;m(x);for(j=0;j<q.count;j++){t=q.list[j];H(t.blending);p(t.depthTest);v=e(k,S,Q,t,x);x.render(function(M){l(M,v)})}}}if(n&&n.minFilter!==THREE.NearestFilter&&n.minFilter!==THREE.LinearFilter){c.bindTexture(c.TEXTURE_2D,n.__webGLTexture);c.generateMipmap(c.TEXTURE_2D);c.bindTexture(c.TEXTURE_2D,null)}};this.initWebGLObjects=function(f){if(!f.__webglObjects){f.__webglObjects=
-[];f.__webglObjectsImmediate=[]}for(;f.__objectsAdded.length;){var k=f.__objectsAdded[0],n=f,h=void 0,j=void 0,v=void 0;if(k._modelViewMatrix==undefined){k._modelViewMatrix=new THREE.Matrix4;k._normalMatrixArray=new Float32Array(9);k._modelViewMatrixArray=new Float32Array(16);k._objectMatrixArray=new Float32Array(16);k.matrixWorld.flattenToArray(k._objectMatrixArray)}if(k instanceof THREE.Mesh){j=k.geometry;j.geometryGroups==undefined&&A(j);for(h in j.geometryGroups){v=j.geometryGroups[h];if(!v.__webGLVertexBuffer){var q=
-v;q.__webGLVertexBuffer=c.createBuffer();q.__webGLNormalBuffer=c.createBuffer();q.__webGLTangentBuffer=c.createBuffer();q.__webGLColorBuffer=c.createBuffer();q.__webGLUVBuffer=c.createBuffer();q.__webGLUV2Buffer=c.createBuffer();q.__webGLSkinVertexABuffer=c.createBuffer();q.__webGLSkinVertexBBuffer=c.createBuffer();q.__webGLSkinIndicesBuffer=c.createBuffer();q.__webGLSkinWeightsBuffer=c.createBuffer();q.__webGLFaceBuffer=c.createBuffer();q.__webGLLineBuffer=c.createBuffer();q=v;var t=k,F=void 0,s=
-void 0,x=0,N=0,S=0,Q=t.geometry.faces,M=q.faces;F=0;for(s=M.length;F<s;F++){fi=M[F];face=Q[fi];if(face instanceof THREE.Face3){x+=3;N+=1;S+=3}else if(face instanceof THREE.Face4){x+=4;N+=2;S+=4}}q.__vertexArray=new Float32Array(x*3);q.__normalArray=new Float32Array(x*3);q.__tangentArray=new Float32Array(x*4);q.__colorArray=new Float32Array(x*3);q.__uvArray=new Float32Array(x*2);q.__uv2Array=new Float32Array(x*2);q.__skinVertexAArray=new Float32Array(x*4);q.__skinVertexBArray=new Float32Array(x*4);
-q.__skinIndexArray=new Float32Array(x*4);q.__skinWeightArray=new Float32Array(x*4);q.__faceArray=new Uint16Array(N*3);q.__lineArray=new Uint16Array(S*2);s=F=q;x=void 0;Q=void 0;var O=void 0,K=void 0;O=void 0;M=!1;x=0;for(Q=t.materials.length;x<Q;x++){O=t.materials[x];if(O instanceof THREE.MeshFaceMaterial){O=0;for(K=s.materials.length;O<K;O++)if(s.materials[O]&&s.materials[O].shading!=undefined&&s.materials[O].shading==THREE.SmoothShading){M=!0;break}}else if(O&&O.shading!=undefined&&O.shading==THREE.SmoothShading){M=
-!0;break}if(M)break}F.__needsSmoothNormals=M;q.__webGLFaceCount=N*3;q.__webGLLineCount=S*2;j.__dirtyVertices=!0;j.__dirtyElements=!0;j.__dirtyUvs=!0;j.__dirtyNormals=!0;j.__dirtyTangents=!0;j.__dirtyColors=!0}B(n.__webglObjects,v,k)}}else if(k instanceof THREE.Ribbon){j=k.geometry;if(!j.__webGLVertexBuffer){h=j;h.__webGLVertexBuffer=c.createBuffer();h.__webGLColorBuffer=c.createBuffer();h=j;v=h.vertices.length;h.__vertexArray=new Float32Array(v*3);h.__colorArray=new Float32Array(v*3);h.__webGLVertexCount=
-v;j.__dirtyVertices=!0;j.__dirtyColors=!0}B(n.__webglObjects,j,k)}else if(k instanceof THREE.Line){j=k.geometry;if(!j.__webGLVertexBuffer){h=j;h.__webGLVertexBuffer=c.createBuffer();h.__webGLColorBuffer=c.createBuffer();h=j;v=h.vertices.length;h.__vertexArray=new Float32Array(v*3);h.__colorArray=new Float32Array(v*3);h.__webGLLineCount=v;j.__dirtyVertices=!0;j.__dirtyColors=!0}B(n.__webglObjects,j,k)}else if(k instanceof THREE.ParticleSystem){j=k.geometry;if(!j.__webGLVertexBuffer){h=j;h.__webGLVertexBuffer=
-c.createBuffer();h.__webGLColorBuffer=c.createBuffer();h=j;v=h.vertices.length;h.__vertexArray=new Float32Array(v*3);h.__colorArray=new Float32Array(v*3);h.__sortArray=[];h.__webGLParticleCount=v;j.__dirtyVertices=!0;j.__dirtyColors=!0}B(n.__webglObjects,j,k)}else THREE.MarchingCubes!==undefined&&k instanceof THREE.MarchingCubes&&n.__webglObjectsImmediate.push({object:k,opaque:{list:[],count:0},transparent:{list:[],count:0}});f.__objectsAdded.splice(0,1)}for(;f.__objectsRemoved.length;){k=f.__objectsRemoved[0];
-n=f;j=void 0;h=void 0;for(j=n.__webglObjects.length-1;j>=0;j--){h=n.__webglObjects[j].object;k==h&&n.__webglObjects.splice(j,1)}f.__objectsRemoved.splice(0,1)}k=0;for(n=f.__webglObjects.length;k<n;k++){h=f.__webglObjects[k].object;v=void 0;j=void 0;q=void 0;if(h instanceof THREE.Mesh){j=h.geometry;for(v in j.geometryGroups){q=j.geometryGroups[v];if(j.__dirtyVertices||j.__dirtyElements||j.__dirtyUvs||j.__dirtyNormals||j.__dirtyColors||j.__dirtyTangents){N=c.DYNAMIC_DRAW;S=void 0;F=void 0;var ja=void 0,
-w=void 0,ga=void 0,fa=void 0,ia=void 0;ja=void 0;var E=void 0,G=void 0,I=void 0,R=void 0;E=void 0;G=void 0;I=void 0;w=void 0;E=void 0;G=void 0;I=void 0;R=void 0;E=void 0;G=void 0;I=void 0;R=void 0;E=void 0;G=void 0;I=void 0;R=void 0;E=void 0;G=void 0;I=void 0;R=void 0;E=void 0;G=void 0;I=void 0;R=void 0;w=void 0;fa=void 0;ga=void 0;ia=void 0;var ka=K=O=M=Q=x=t=s=0,aa=0,r=0,ca=q.__vertexArray,Ja=q.__uvArray,Ka=q.__uv2Array,oa=q.__normalArray,V=q.__tangentArray,da=q.__colorArray,W=q.__skinVertexAArray,
-X=q.__skinVertexBArray,Y=q.__skinIndexArray,Z=q.__skinWeightArray,ta=q.__faceArray,la=q.__lineArray,Wa=q.__needsSmoothNormals,ha=h.geometry,Ma=ha.__dirtyVertices,Na=ha.__dirtyElements,Ea=ha.__dirtyUvs,Oa=ha.__dirtyNormals,Pa=ha.__dirtyTangents,Qa=ha.__dirtyColors,ma=ha.vertices,Xa=q.faces,Ya=ha.faces,Za=ha.uvs,$a=ha.uvs2,ua=ha.colors,ya=ha.skinVerticesA,za=ha.skinVerticesB,Aa=ha.skinIndices,wa=ha.skinWeights;S=0;for(F=Xa.length;S<F;S++){ja=Xa[S];w=Ya[ja];ia=Za[ja];ja=$a[ja];ga=w.vertexNormals;fa=
-w.normal;if(w instanceof THREE.Face3){if(Ma){E=ma[w.a].position;G=ma[w.b].position;I=ma[w.c].position;ca[t]=E.x;ca[t+1]=E.y;ca[t+2]=E.z;ca[t+3]=G.x;ca[t+4]=G.y;ca[t+5]=G.z;ca[t+6]=I.x;ca[t+7]=I.y;ca[t+8]=I.z;t+=9}if(wa.length){E=wa[w.a];G=wa[w.b];I=wa[w.c];Z[r]=E.x;Z[r+1]=E.y;Z[r+2]=E.z;Z[r+3]=E.w;Z[r+4]=G.x;Z[r+5]=G.y;Z[r+6]=G.z;Z[r+7]=G.w;Z[r+8]=I.x;Z[r+9]=I.y;Z[r+10]=I.z;Z[r+11]=I.w;E=Aa[w.a];G=Aa[w.b];I=Aa[w.c];Y[r]=E.x;Y[r+1]=E.y;Y[r+2]=E.z;Y[r+3]=E.w;Y[r+4]=G.x;Y[r+5]=G.y;Y[r+6]=G.z;Y[r+7]=
-G.w;Y[r+8]=I.x;Y[r+9]=I.y;Y[r+10]=I.z;Y[r+11]=I.w;E=ya[w.a];G=ya[w.b];I=ya[w.c];W[r]=E.x;W[r+1]=E.y;W[r+2]=E.z;W[r+3]=1;W[r+4]=G.x;W[r+5]=G.y;W[r+6]=G.z;W[r+7]=1;W[r+8]=I.x;W[r+9]=I.y;W[r+10]=I.z;W[r+11]=1;E=za[w.a];G=za[w.b];I=za[w.c];X[r]=E.x;X[r+1]=E.y;X[r+2]=E.z;X[r+3]=1;X[r+4]=G.x;X[r+5]=G.y;X[r+6]=G.z;X[r+7]=1;X[r+8]=I.x;X[r+9]=I.y;X[r+10]=I.z;X[r+11]=1;r+=12}if(Qa&&ua.length){E=ua[w.a];G=ua[w.b];I=ua[w.c];da[aa]=E.r;da[aa+1]=E.g;da[aa+2]=E.b;da[aa+3]=G.r;da[aa+4]=G.g;da[aa+5]=G.b;da[aa+6]=
-I.r;da[aa+7]=I.g;da[aa+8]=I.b;aa+=9}if(Pa&&ha.hasTangents){E=ma[w.a].tangent;G=ma[w.b].tangent;I=ma[w.c].tangent;V[K]=E.x;V[K+1]=E.y;V[K+2]=E.z;V[K+3]=E.w;V[K+4]=G.x;V[K+5]=G.y;V[K+6]=G.z;V[K+7]=G.w;V[K+8]=I.x;V[K+9]=I.y;V[K+10]=I.z;V[K+11]=I.w;K+=12}if(Oa)if(ga.length==3&&Wa)for(w=0;w<3;w++){fa=ga[w];oa[O]=fa.x;oa[O+1]=fa.y;oa[O+2]=fa.z;O+=3}else for(w=0;w<3;w++){oa[O]=fa.x;oa[O+1]=fa.y;oa[O+2]=fa.z;O+=3}if(Ea&&ia)for(w=0;w<3;w++){ga=ia[w];Ja[x]=ga.u;Ja[x+1]=ga.v;x+=2}if(Ea&&ja)for(w=0;w<3;w++){ia=
-ja[w];Ka[Q]=ia.u;Ka[Q+1]=ia.v;Q+=2}if(Na){ta[M]=s;ta[M+1]=s+1;ta[M+2]=s+2;M+=3;la[ka]=s;la[ka+1]=s+1;la[ka+2]=s;la[ka+3]=s+2;la[ka+4]=s+1;la[ka+5]=s+2;ka+=6;s+=3}}else if(w instanceof THREE.Face4){if(Ma){E=ma[w.a].position;G=ma[w.b].position;I=ma[w.c].position;R=ma[w.d].position;ca[t]=E.x;ca[t+1]=E.y;ca[t+2]=E.z;ca[t+3]=G.x;ca[t+4]=G.y;ca[t+5]=G.z;ca[t+6]=I.x;ca[t+7]=I.y;ca[t+8]=I.z;ca[t+9]=R.x;ca[t+10]=R.y;ca[t+11]=R.z;t+=12}if(wa.length){E=wa[w.a];G=wa[w.b];I=wa[w.c];R=wa[w.d];Z[r]=E.x;Z[r+1]=E.y;
-Z[r+2]=E.z;Z[r+3]=E.w;Z[r+4]=G.x;Z[r+5]=G.y;Z[r+6]=G.z;Z[r+7]=G.w;Z[r+8]=I.x;Z[r+9]=I.y;Z[r+10]=I.z;Z[r+11]=I.w;Z[r+12]=R.x;Z[r+13]=R.y;Z[r+14]=R.z;Z[r+15]=R.w;E=Aa[w.a];G=Aa[w.b];I=Aa[w.c];R=Aa[w.d];Y[r]=E.x;Y[r+1]=E.y;Y[r+2]=E.z;Y[r+3]=E.w;Y[r+4]=G.x;Y[r+5]=G.y;Y[r+6]=G.z;Y[r+7]=G.w;Y[r+8]=I.x;Y[r+9]=I.y;Y[r+10]=I.z;Y[r+11]=I.w;Y[r+12]=R.x;Y[r+13]=R.y;Y[r+14]=R.z;Y[r+15]=R.w;E=ya[w.a];G=ya[w.b];I=ya[w.c];R=ya[w.d];W[r]=E.x;W[r+1]=E.y;W[r+2]=E.z;W[r+3]=1;W[r+4]=G.x;W[r+5]=G.y;W[r+6]=G.z;W[r+7]=1;
-W[r+8]=I.x;W[r+9]=I.y;W[r+10]=I.z;W[r+11]=1;W[r+12]=R.x;W[r+13]=R.y;W[r+14]=R.z;W[r+15]=1;E=za[w.a];G=za[w.b];I=za[w.c];R=za[w.d];X[r]=E.x;X[r+1]=E.y;X[r+2]=E.z;X[r+3]=1;X[r+4]=G.x;X[r+5]=G.y;X[r+6]=G.z;X[r+7]=1;X[r+8]=I.x;X[r+9]=I.y;X[r+10]=I.z;X[r+11]=1;X[r+12]=R.x;X[r+13]=R.y;X[r+14]=R.z;X[r+15]=1;r+=16}if(Qa&&ua.length){E=ua[w.a];G=ua[w.b];I=ua[w.c];R=ua[w.d];da[aa]=E.r;da[aa+1]=E.g;da[aa+2]=E.b;da[aa+3]=G.r;da[aa+4]=G.g;da[aa+5]=G.b;da[aa+6]=I.r;da[aa+7]=I.g;da[aa+8]=I.b;da[aa+9]=R.r;da[aa+10]=
-R.g;da[aa+11]=R.b;aa+=12}if(Pa&&ha.hasTangents){E=ma[w.a].tangent;G=ma[w.b].tangent;I=ma[w.c].tangent;w=ma[w.d].tangent;V[K]=E.x;V[K+1]=E.y;V[K+2]=E.z;V[K+3]=E.w;V[K+4]=G.x;V[K+5]=G.y;V[K+6]=G.z;V[K+7]=G.w;V[K+8]=I.x;V[K+9]=I.y;V[K+10]=I.z;V[K+11]=I.w;V[K+12]=w.x;V[K+13]=w.y;V[K+14]=w.z;V[K+15]=w.w;K+=16}if(Oa)if(ga.length==4&&Wa)for(w=0;w<4;w++){fa=ga[w];oa[O]=fa.x;oa[O+1]=fa.y;oa[O+2]=fa.z;O+=3}else for(w=0;w<4;w++){oa[O]=fa.x;oa[O+1]=fa.y;oa[O+2]=fa.z;O+=3}if(Ea&&ia)for(w=0;w<4;w++){ga=ia[w];Ja[x]=
-ga.u;Ja[x+1]=ga.v;x+=2}if(Ea&&ja)for(w=0;w<4;w++){ia=ja[w];Ka[Q]=ia.u;Ka[Q+1]=ia.v;Q+=2}if(Na){ta[M]=s;ta[M+1]=s+1;ta[M+2]=s+2;ta[M+3]=s;ta[M+4]=s+2;ta[M+5]=s+3;M+=6;la[ka]=s;la[ka+1]=s+1;la[ka+2]=s;la[ka+3]=s+3;la[ka+4]=s+1;la[ka+5]=s+2;la[ka+6]=s+2;la[ka+7]=s+3;ka+=8;s+=4}}}if(Ma){c.bindBuffer(c.ARRAY_BUFFER,q.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,ca,N)}if(Qa&&ua.length){c.bindBuffer(c.ARRAY_BUFFER,q.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,da,N)}if(Oa){c.bindBuffer(c.ARRAY_BUFFER,
-q.__webGLNormalBuffer);c.bufferData(c.ARRAY_BUFFER,oa,N)}if(Pa&&ha.hasTangents){c.bindBuffer(c.ARRAY_BUFFER,q.__webGLTangentBuffer);c.bufferData(c.ARRAY_BUFFER,V,N)}if(Ea&&x>0){c.bindBuffer(c.ARRAY_BUFFER,q.__webGLUVBuffer);c.bufferData(c.ARRAY_BUFFER,Ja,N)}if(Ea&&Q>0){c.bindBuffer(c.ARRAY_BUFFER,q.__webGLUV2Buffer);c.bufferData(c.ARRAY_BUFFER,Ka,N)}if(Na){c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,q.__webGLFaceBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,ta,N);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,q.__webGLLineBuffer);
-c.bufferData(c.ELEMENT_ARRAY_BUFFER,la,N)}if(r>0){c.bindBuffer(c.ARRAY_BUFFER,q.__webGLSkinVertexABuffer);c.bufferData(c.ARRAY_BUFFER,W,N);c.bindBuffer(c.ARRAY_BUFFER,q.__webGLSkinVertexBBuffer);c.bufferData(c.ARRAY_BUFFER,X,N);c.bindBuffer(c.ARRAY_BUFFER,q.__webGLSkinIndicesBuffer);c.bufferData(c.ARRAY_BUFFER,Y,N);c.bindBuffer(c.ARRAY_BUFFER,q.__webGLSkinWeightsBuffer);c.bufferData(c.ARRAY_BUFFER,Z,N)}}}j.__dirtyVertices=!1;j.__dirtyElements=!1;j.__dirtyUvs=!1;j.__dirtyNormals=!1;j.__dirtyTangents=
-!1;j.__dirtyColors=!1}else if(h instanceof THREE.Ribbon){j=h.geometry;if(j.__dirtyVertices||j.__dirtyColors){h=j;v=c.DYNAMIC_DRAW;s=void 0;s=void 0;t=void 0;q=void 0;x=h.vertices;N=h.colors;Q=x.length;S=N.length;M=h.__vertexArray;F=h.__colorArray;O=h.__dirtyColors;if(h.__dirtyVertices){for(s=0;s<Q;s++){t=x[s].position;q=s*3;M[q]=t.x;M[q+1]=t.y;M[q+2]=t.z}c.bindBuffer(c.ARRAY_BUFFER,h.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,M,v)}if(O){for(s=0;s<S;s++){color=N[s];q=s*3;F[q]=color.r;F[q+1]=
-color.g;F[q+2]=color.b}c.bindBuffer(c.ARRAY_BUFFER,h.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,F,v)}}j.__dirtyVertices=!1;j.__dirtyColors=!1}else if(h instanceof THREE.Line){j=h.geometry;if(j.__dirtyVertices||j.__dirtyColors){h=j;v=c.DYNAMIC_DRAW;s=void 0;s=void 0;t=void 0;q=void 0;x=h.vertices;N=h.colors;Q=x.length;S=N.length;M=h.__vertexArray;F=h.__colorArray;O=h.__dirtyColors;if(h.__dirtyVertices){for(s=0;s<Q;s++){t=x[s].position;q=s*3;M[q]=t.x;M[q+1]=t.y;M[q+2]=t.z}c.bindBuffer(c.ARRAY_BUFFER,
-h.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,M,v)}if(O){for(s=0;s<S;s++){color=N[s];q=s*3;F[q]=color.r;F[q+1]=color.g;F[q+2]=color.b}c.bindBuffer(c.ARRAY_BUFFER,h.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,F,v)}}j.__dirtyVertices=!1;j.__dirtyColors=!1}else if(h instanceof THREE.ParticleSystem){j=h.geometry;(j.__dirtyVertices||j.__dirtyColors||h.sortParticles)&&b(j,c.DYNAMIC_DRAW,h);j.__dirtyVertices=!1;j.__dirtyColors=!1}}};this.setFaceCulling=function(f,k){if(f){!k||k=="ccw"?c.frontFace(c.CCW):
-c.frontFace(c.CW);if(f=="back")c.cullFace(c.BACK);else f=="front"?c.cullFace(c.FRONT):c.cullFace(c.FRONT_AND_BACK);c.enable(c.CULL_FACE)}else c.disable(c.CULL_FACE)};this.supportsVertexTextures=function(){return c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0}};
+case THREE.IntType:return c.INT;case THREE.UnsignedShortType:return c.UNSIGNED_INT;case THREE.FloatType:return c.FLOAT;case THREE.AlphaFormat:return c.ALPHA;case THREE.RGBFormat:return c.RGB;case THREE.RGBAFormat:return c.RGBA;case THREE.LuminanceFormat:return c.LUMINANCE;case THREE.LuminanceAlphaFormat:return c.LUMINANCE_ALPHA}return 0}var ea=document.createElement("canvas"),c,oa=null,ma=null,ua=this,pa=null,qa=null,Aa=null,Ba=null,wa=0,Ea=0,Fa=0,Ga=0,ra=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,
+new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ha=new THREE.Matrix4,Qa=new Float32Array(16),Ka=new Float32Array(16),Ca=new THREE.Vector4,Ra={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[]}},Sa=!0,Ta=new THREE.Color(0),Ua=0;if(a){if(a.antialias!==undefined)Sa=a.antialias;a.clearColor!==undefined&&Ta.setHex(a.clearColor);if(a.clearAlpha!==undefined)Ua=a.clearAlpha}this.domElement=ea;this.autoClear=!0;this.sortObjects=!0;(function(f,j,m){try{if(!(c=
+ea.getContext("experimental-webgl",{antialias:f})))throw"Error creating WebGL context.";}catch(h){console.error(h)}c.clearColor(0,0,0,1);c.clearDepth(1);c.enable(c.DEPTH_TEST);c.depthFunc(c.LEQUAL);c.frontFace(c.CCW);c.cullFace(c.BACK);c.enable(c.CULL_FACE);c.enable(c.BLEND);c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA);c.clearColor(j.r,j.g,j.b,m);_cullEnabled=!0})(Sa,Ta,Ua);this.context=c;this.setSize=function(f,j){ea.width=f;ea.height=j;this.setViewport(0,0,ea.width,ea.height)};this.setViewport=function(f,
+j,m,h){wa=f;Ea=j;Fa=m;Ga=h;c.viewport(wa,Ea,Fa,Ga)};this.setScissor=function(f,j,m,h){c.scissor(f,j,m,h)};this.enableScissorTest=function(f){f?c.enable(c.SCISSOR_TEST):c.disable(c.SCISSOR_TEST)};this.enableDepthBufferWrite=function(f){c.depthMask(f)};this.setClearColorHex=function(f,j){var m=new THREE.Color(f);c.clearColor(m.r,m.g,m.b,j)};this.setClearColor=function(f,j){c.clearColor(f.r,f.g,f.b,j)};this.clear=function(){c.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT)};this.initMaterial=function(f,
+j,m,h){var i;if(f instanceof THREE.MeshDepthMaterial)d(f,THREE.ShaderLib.depth);else if(f instanceof THREE.MeshNormalMaterial)d(f,THREE.ShaderLib.normal);else if(f instanceof THREE.MeshBasicMaterial)d(f,THREE.ShaderLib.basic);else if(f instanceof THREE.MeshLambertMaterial)d(f,THREE.ShaderLib.lambert);else if(f instanceof THREE.MeshPhongMaterial)d(f,THREE.ShaderLib.phong);else if(f instanceof THREE.LineBasicMaterial)d(f,THREE.ShaderLib.basic);else f instanceof THREE.ParticleBasicMaterial&&d(f,THREE.ShaderLib.particle_basic);
+var t,p,s,A,r;t=A=r=0;for(p=j.length;t<p;t++){s=j[t];s instanceof THREE.DirectionalLight&&A++;s instanceof THREE.PointLight&&r++}if(r+A<=4)j=A;else{j=Math.ceil(4*A/(r+A));r=4-j}j={directional:j,point:r};t=50;if(h!==undefined&&h instanceof THREE.SkinnedMesh)t=h.bones.length;h=f.fragmentShader;r=f.vertexShader;t={fog:m,map:f.map,envMap:f.envMap,lightMap:f.lightMap,vertexColors:f.vertexColors,sizeAttenuation:f.sizeAttenuation,skinning:f.skinning,maxDirLights:j.directional,maxPointLights:j.point,maxBones:t};
+m=c.createProgram();j=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+t.maxDirLights,"#define MAX_POINT_LIGHTS "+t.maxPointLights,t.fog?"#define USE_FOG":"",t.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.lightMap?"#define USE_LIGHTMAP":"",t.vertexColors?"#define USE_COLOR":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");t=[c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0?"#define VERTEX_TEXTURES":
+"","#define MAX_DIR_LIGHTS "+t.maxDirLights,"#define MAX_POINT_LIGHTS "+t.maxPointLights,"#define MAX_BONES "+t.maxBones,t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.lightMap?"#define USE_LIGHTMAP":"",t.vertexColors?"#define USE_COLOR":"",t.skinning?"#define USE_SKINNING":"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n"].join("\n");
+c.attachShader(m,da("fragment",j+h));c.attachShader(m,da("vertex",t+r));c.linkProgram(m);c.getProgramParameter(m,c.LINK_STATUS)||alert("Could not initialise shaders\nVALIDATE_STATUS: "+c.getProgramParameter(m,c.VALIDATE_STATUS)+", gl error ["+c.getError()+"]");m.uniforms={};m.attributes={};f.program=m;m=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices"];for(i in f.uniforms)m.push(i);i=f.program;h=0;for(r=m.length;h<
+r;h++){j=m[h];i.uniforms[j]=c.getUniformLocation(i,j)}i=f.program;m=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];h=0;for(r=m.length;h<r;h++){j=m[h];i.attributes[j]=c.getAttribLocation(i,j)}i=f.program.attributes;c.enableVertexAttribArray(i.position);i.color>=0&&c.enableVertexAttribArray(i.color);i.normal>=0&&c.enableVertexAttribArray(i.normal);i.tangent>=0&&c.enableVertexAttribArray(i.tangent);if(f.skinning&&i.skinVertexA>=0&&i.skinVertexB>=
+0&&i.skinIndex>=0&&i.skinWeight>=0){c.enableVertexAttribArray(i.skinVertexA);c.enableVertexAttribArray(i.skinVertexB);c.enableVertexAttribArray(i.skinIndex);c.enableVertexAttribArray(i.skinWeight)}};this.render=function(f,j,m,h){var i,t,p,s,A,r,v,J,P=f.lights,N=f.fog;j.matrixAutoUpdate&&j.updateMatrix();f.update(undefined,!1,j);j.matrixWorldInverse.flattenToArray(Ka);j.projectionMatrix.flattenToArray(Qa);Ha.multiply(j.projectionMatrix,j.matrixWorldInverse);n(Ha);this.initWebGLObjects(f);X(m);(this.autoClear||
+h)&&this.clear();A=f.__webglObjects.length;for(h=0;h<A;h++){i=f.__webglObjects[h];v=i.object;if(v.visible)if(!(v instanceof THREE.Mesh)||w(v)){v.matrixWorld.flattenToArray(v._objectMatrixArray);F(v,j);D(i);i.render=!0;if(this.sortObjects){Ca.copy(v.position);Ha.multiplyVector3(Ca);i.z=Ca.z}}else i.render=!1;else i.render=!1}this.sortObjects&&f.__webglObjects.sort(E);r=f.__webglObjectsImmediate.length;for(h=0;h<r;h++){i=f.__webglObjectsImmediate[h];v=i.object;if(v.visible){v.matrixAutoUpdate&&v.matrixWorld.flattenToArray(v._objectMatrixArray);
+F(v,j);x(i)}}M(THREE.NormalBlending);for(h=0;h<A;h++){i=f.__webglObjects[h];if(i.render){v=i.object;J=i.buffer;p=i.opaque;l(v);for(i=0;i<p.count;i++){s=p.list[i];o(s.depthTest);g(j,P,N,s,J,v)}}}for(h=0;h<r;h++){i=f.__webglObjectsImmediate[h];v=i.object;if(v.visible){p=i.opaque;l(v);for(i=0;i<p.count;i++){s=p.list[i];o(s.depthTest);t=e(j,P,N,s,v);v.render(function(I){k(I,t)})}}}for(h=0;h<A;h++){i=f.__webglObjects[h];if(i.render){v=i.object;J=i.buffer;p=i.transparent;l(v);for(i=0;i<p.count;i++){s=p.list[i];
+M(s.blending);o(s.depthTest);g(j,P,N,s,J,v)}}}for(h=0;h<r;h++){i=f.__webglObjectsImmediate[h];v=i.object;if(v.visible){p=i.transparent;l(v);for(i=0;i<p.count;i++){s=p.list[i];M(s.blending);o(s.depthTest);t=e(j,P,N,s,v);v.render(function(I){k(I,t)})}}}if(m&&m.minFilter!==THREE.NearestFilter&&m.minFilter!==THREE.LinearFilter){c.bindTexture(c.TEXTURE_2D,m.__webGLTexture);c.generateMipmap(c.TEXTURE_2D);c.bindTexture(c.TEXTURE_2D,null)}};this.initWebGLObjects=function(f){if(!f.__webglObjects){f.__webglObjects=
+[];f.__webglObjectsImmediate=[]}for(;f.__objectsAdded.length;){var j=f.__objectsAdded[0],m=f,h=void 0,i=void 0,t=void 0;if(j._modelViewMatrix==undefined){j._modelViewMatrix=new THREE.Matrix4;j._normalMatrixArray=new Float32Array(9);j._modelViewMatrixArray=new Float32Array(16);j._objectMatrixArray=new Float32Array(16);j.matrixWorld.flattenToArray(j._objectMatrixArray)}if(j instanceof THREE.Mesh){i=j.geometry;i.geometryGroups==undefined&&H(i);for(h in i.geometryGroups){t=i.geometryGroups[h];if(!t.__webGLVertexBuffer){var p=
+t;p.__webGLVertexBuffer=c.createBuffer();p.__webGLNormalBuffer=c.createBuffer();p.__webGLTangentBuffer=c.createBuffer();p.__webGLColorBuffer=c.createBuffer();p.__webGLUVBuffer=c.createBuffer();p.__webGLUV2Buffer=c.createBuffer();p.__webGLSkinVertexABuffer=c.createBuffer();p.__webGLSkinVertexBBuffer=c.createBuffer();p.__webGLSkinIndicesBuffer=c.createBuffer();p.__webGLSkinWeightsBuffer=c.createBuffer();p.__webGLFaceBuffer=c.createBuffer();p.__webGLLineBuffer=c.createBuffer();p=t;var s=j,A=void 0,r=
+void 0,v=0,J=0,P=0,N=s.geometry.faces,I=p.faces;A=0;for(r=I.length;A<r;A++){fi=I[A];face=N[fi];if(face instanceof THREE.Face3){v+=3;J+=1;P+=3}else if(face instanceof THREE.Face4){v+=4;J+=2;P+=4}}p.__vertexArray=new Float32Array(v*3);p.__normalArray=new Float32Array(v*3);p.__tangentArray=new Float32Array(v*4);p.__colorArray=new Float32Array(v*3);p.__uvArray=new Float32Array(v*2);p.__uv2Array=new Float32Array(v*2);p.__skinVertexAArray=new Float32Array(v*4);p.__skinVertexBArray=new Float32Array(v*4);
+p.__skinIndexArray=new Float32Array(v*4);p.__skinWeightArray=new Float32Array(v*4);p.__faceArray=new Uint16Array(J*3);p.__lineArray=new Uint16Array(P*2);r=A=p;v=void 0;N=void 0;var K=void 0,G=void 0;K=void 0;I=!1;v=0;for(N=s.materials.length;v<N;v++){K=s.materials[v];if(K instanceof THREE.MeshFaceMaterial){K=0;for(G=r.materials.length;K<G;K++)if(r.materials[K]&&r.materials[K].shading!=undefined&&r.materials[K].shading==THREE.SmoothShading){I=!0;break}}else if(K&&K.shading!=undefined&&K.shading==THREE.SmoothShading){I=
+!0;break}if(I)break}A.__needsSmoothNormals=I;p.__webGLFaceCount=J*3;p.__webGLLineCount=P*2;i.__dirtyVertices=!0;i.__dirtyElements=!0;i.__dirtyUvs=!0;i.__dirtyNormals=!0;i.__dirtyTangents=!0;i.__dirtyColors=!0}L(m.__webglObjects,t,j)}}else if(j instanceof THREE.Ribbon){i=j.geometry;if(!i.__webGLVertexBuffer){h=i;h.__webGLVertexBuffer=c.createBuffer();h.__webGLColorBuffer=c.createBuffer();h=i;t=h.vertices.length;h.__vertexArray=new Float32Array(t*3);h.__colorArray=new Float32Array(t*3);h.__webGLVertexCount=
+t;i.__dirtyVertices=!0;i.__dirtyColors=!0}L(m.__webglObjects,i,j)}else if(j instanceof THREE.Line){i=j.geometry;if(!i.__webGLVertexBuffer){h=i;h.__webGLVertexBuffer=c.createBuffer();h.__webGLColorBuffer=c.createBuffer();h=i;t=h.vertices.length;h.__vertexArray=new Float32Array(t*3);h.__colorArray=new Float32Array(t*3);h.__webGLLineCount=t;i.__dirtyVertices=!0;i.__dirtyColors=!0}L(m.__webglObjects,i,j)}else if(j instanceof THREE.ParticleSystem){i=j.geometry;if(!i.__webGLVertexBuffer){h=i;h.__webGLVertexBuffer=
+c.createBuffer();h.__webGLColorBuffer=c.createBuffer();h=i;t=h.vertices.length;h.__vertexArray=new Float32Array(t*3);h.__colorArray=new Float32Array(t*3);h.__sortArray=[];h.__webGLParticleCount=t;i.__dirtyVertices=!0;i.__dirtyColors=!0}L(m.__webglObjects,i,j)}else THREE.MarchingCubes!==undefined&&j instanceof THREE.MarchingCubes&&m.__webglObjectsImmediate.push({object:j,opaque:{list:[],count:0},transparent:{list:[],count:0}});f.__objectsAdded.splice(0,1)}for(;f.__objectsRemoved.length;){j=f.__objectsRemoved[0];
+m=f;i=void 0;h=void 0;for(i=m.__webglObjects.length-1;i>=0;i--){h=m.__webglObjects[i].object;j==h&&m.__webglObjects.splice(i,1)}f.__objectsRemoved.splice(0,1)}j=0;for(m=f.__webglObjects.length;j<m;j++){h=f.__webglObjects[j].object;t=void 0;i=void 0;p=void 0;if(h instanceof THREE.Mesh){i=h.geometry;for(t in i.geometryGroups){p=i.geometryGroups[t];if(i.__dirtyVertices||i.__dirtyElements||i.__dirtyUvs||i.__dirtyNormals||i.__dirtyColors||i.__dirtyTangents){J=c.DYNAMIC_DRAW;P=void 0;A=void 0;var ia=void 0,
+u=void 0,fa=void 0,ca=void 0,ha=void 0;ia=void 0;var y=void 0,B=void 0,C=void 0,O=void 0;y=void 0;B=void 0;C=void 0;u=void 0;y=void 0;B=void 0;C=void 0;O=void 0;y=void 0;B=void 0;C=void 0;O=void 0;y=void 0;B=void 0;C=void 0;O=void 0;y=void 0;B=void 0;C=void 0;O=void 0;y=void 0;B=void 0;C=void 0;O=void 0;u=void 0;ca=void 0;fa=void 0;ha=void 0;var ja=G=K=I=N=v=s=r=0,W=0,q=0,Z=p.__vertexArray,Ia=p.__uvArray,Ja=p.__uv2Array,na=p.__normalArray,Q=p.__tangentArray,$=p.__colorArray,R=p.__skinVertexAArray,
+S=p.__skinVertexBArray,T=p.__skinIndexArray,U=p.__skinWeightArray,sa=p.__faceArray,ka=p.__lineArray,Va=p.__needsSmoothNormals,ga=h.geometry,La=ga.__dirtyVertices,Ma=ga.__dirtyElements,Da=ga.__dirtyUvs,Na=ga.__dirtyNormals,Oa=ga.__dirtyTangents,Pa=ga.__dirtyColors,la=ga.vertices,Wa=p.faces,Xa=ga.faces,Ya=ga.uvs,Za=ga.uvs2,ta=ga.colors,xa=ga.skinVerticesA,ya=ga.skinVerticesB,za=ga.skinIndices,va=ga.skinWeights;P=0;for(A=Wa.length;P<A;P++){ia=Wa[P];u=Xa[ia];ha=Ya[ia];ia=Za[ia];fa=u.vertexNormals;ca=
+u.normal;if(u instanceof THREE.Face3){if(La){y=la[u.a].position;B=la[u.b].position;C=la[u.c].position;Z[s]=y.x;Z[s+1]=y.y;Z[s+2]=y.z;Z[s+3]=B.x;Z[s+4]=B.y;Z[s+5]=B.z;Z[s+6]=C.x;Z[s+7]=C.y;Z[s+8]=C.z;s+=9}if(va.length){y=va[u.a];B=va[u.b];C=va[u.c];U[q]=y.x;U[q+1]=y.y;U[q+2]=y.z;U[q+3]=y.w;U[q+4]=B.x;U[q+5]=B.y;U[q+6]=B.z;U[q+7]=B.w;U[q+8]=C.x;U[q+9]=C.y;U[q+10]=C.z;U[q+11]=C.w;y=za[u.a];B=za[u.b];C=za[u.c];T[q]=y.x;T[q+1]=y.y;T[q+2]=y.z;T[q+3]=y.w;T[q+4]=B.x;T[q+5]=B.y;T[q+6]=B.z;T[q+7]=B.w;T[q+8]=
+C.x;T[q+9]=C.y;T[q+10]=C.z;T[q+11]=C.w;y=xa[u.a];B=xa[u.b];C=xa[u.c];R[q]=y.x;R[q+1]=y.y;R[q+2]=y.z;R[q+3]=1;R[q+4]=B.x;R[q+5]=B.y;R[q+6]=B.z;R[q+7]=1;R[q+8]=C.x;R[q+9]=C.y;R[q+10]=C.z;R[q+11]=1;y=ya[u.a];B=ya[u.b];C=ya[u.c];S[q]=y.x;S[q+1]=y.y;S[q+2]=y.z;S[q+3]=1;S[q+4]=B.x;S[q+5]=B.y;S[q+6]=B.z;S[q+7]=1;S[q+8]=C.x;S[q+9]=C.y;S[q+10]=C.z;S[q+11]=1;q+=12}if(Pa&&ta.length){y=ta[u.a];B=ta[u.b];C=ta[u.c];$[W]=y.r;$[W+1]=y.g;$[W+2]=y.b;$[W+3]=B.r;$[W+4]=B.g;$[W+5]=B.b;$[W+6]=C.r;$[W+7]=C.g;$[W+8]=C.b;
+W+=9}if(Oa&&ga.hasTangents){y=la[u.a].tangent;B=la[u.b].tangent;C=la[u.c].tangent;Q[G]=y.x;Q[G+1]=y.y;Q[G+2]=y.z;Q[G+3]=y.w;Q[G+4]=B.x;Q[G+5]=B.y;Q[G+6]=B.z;Q[G+7]=B.w;Q[G+8]=C.x;Q[G+9]=C.y;Q[G+10]=C.z;Q[G+11]=C.w;G+=12}if(Na)if(fa.length==3&&Va)for(u=0;u<3;u++){ca=fa[u];na[K]=ca.x;na[K+1]=ca.y;na[K+2]=ca.z;K+=3}else for(u=0;u<3;u++){na[K]=ca.x;na[K+1]=ca.y;na[K+2]=ca.z;K+=3}if(Da&&ha)for(u=0;u<3;u++){fa=ha[u];Ia[v]=fa.u;Ia[v+1]=fa.v;v+=2}if(Da&&ia)for(u=0;u<3;u++){ha=ia[u];Ja[N]=ha.u;Ja[N+1]=ha.v;
+N+=2}if(Ma){sa[I]=r;sa[I+1]=r+1;sa[I+2]=r+2;I+=3;ka[ja]=r;ka[ja+1]=r+1;ka[ja+2]=r;ka[ja+3]=r+2;ka[ja+4]=r+1;ka[ja+5]=r+2;ja+=6;r+=3}}else if(u instanceof THREE.Face4){if(La){y=la[u.a].position;B=la[u.b].position;C=la[u.c].position;O=la[u.d].position;Z[s]=y.x;Z[s+1]=y.y;Z[s+2]=y.z;Z[s+3]=B.x;Z[s+4]=B.y;Z[s+5]=B.z;Z[s+6]=C.x;Z[s+7]=C.y;Z[s+8]=C.z;Z[s+9]=O.x;Z[s+10]=O.y;Z[s+11]=O.z;s+=12}if(va.length){y=va[u.a];B=va[u.b];C=va[u.c];O=va[u.d];U[q]=y.x;U[q+1]=y.y;U[q+2]=y.z;U[q+3]=y.w;U[q+4]=B.x;U[q+5]=
+B.y;U[q+6]=B.z;U[q+7]=B.w;U[q+8]=C.x;U[q+9]=C.y;U[q+10]=C.z;U[q+11]=C.w;U[q+12]=O.x;U[q+13]=O.y;U[q+14]=O.z;U[q+15]=O.w;y=za[u.a];B=za[u.b];C=za[u.c];O=za[u.d];T[q]=y.x;T[q+1]=y.y;T[q+2]=y.z;T[q+3]=y.w;T[q+4]=B.x;T[q+5]=B.y;T[q+6]=B.z;T[q+7]=B.w;T[q+8]=C.x;T[q+9]=C.y;T[q+10]=C.z;T[q+11]=C.w;T[q+12]=O.x;T[q+13]=O.y;T[q+14]=O.z;T[q+15]=O.w;y=xa[u.a];B=xa[u.b];C=xa[u.c];O=xa[u.d];R[q]=y.x;R[q+1]=y.y;R[q+2]=y.z;R[q+3]=1;R[q+4]=B.x;R[q+5]=B.y;R[q+6]=B.z;R[q+7]=1;R[q+8]=C.x;R[q+9]=C.y;R[q+10]=C.z;R[q+11]=
+1;R[q+12]=O.x;R[q+13]=O.y;R[q+14]=O.z;R[q+15]=1;y=ya[u.a];B=ya[u.b];C=ya[u.c];O=ya[u.d];S[q]=y.x;S[q+1]=y.y;S[q+2]=y.z;S[q+3]=1;S[q+4]=B.x;S[q+5]=B.y;S[q+6]=B.z;S[q+7]=1;S[q+8]=C.x;S[q+9]=C.y;S[q+10]=C.z;S[q+11]=1;S[q+12]=O.x;S[q+13]=O.y;S[q+14]=O.z;S[q+15]=1;q+=16}if(Pa&&ta.length){y=ta[u.a];B=ta[u.b];C=ta[u.c];O=ta[u.d];$[W]=y.r;$[W+1]=y.g;$[W+2]=y.b;$[W+3]=B.r;$[W+4]=B.g;$[W+5]=B.b;$[W+6]=C.r;$[W+7]=C.g;$[W+8]=C.b;$[W+9]=O.r;$[W+10]=O.g;$[W+11]=O.b;W+=12}if(Oa&&ga.hasTangents){y=la[u.a].tangent;
+B=la[u.b].tangent;C=la[u.c].tangent;u=la[u.d].tangent;Q[G]=y.x;Q[G+1]=y.y;Q[G+2]=y.z;Q[G+3]=y.w;Q[G+4]=B.x;Q[G+5]=B.y;Q[G+6]=B.z;Q[G+7]=B.w;Q[G+8]=C.x;Q[G+9]=C.y;Q[G+10]=C.z;Q[G+11]=C.w;Q[G+12]=u.x;Q[G+13]=u.y;Q[G+14]=u.z;Q[G+15]=u.w;G+=16}if(Na)if(fa.length==4&&Va)for(u=0;u<4;u++){ca=fa[u];na[K]=ca.x;na[K+1]=ca.y;na[K+2]=ca.z;K+=3}else for(u=0;u<4;u++){na[K]=ca.x;na[K+1]=ca.y;na[K+2]=ca.z;K+=3}if(Da&&ha)for(u=0;u<4;u++){fa=ha[u];Ia[v]=fa.u;Ia[v+1]=fa.v;v+=2}if(Da&&ia)for(u=0;u<4;u++){ha=ia[u];Ja[N]=
+ha.u;Ja[N+1]=ha.v;N+=2}if(Ma){sa[I]=r;sa[I+1]=r+1;sa[I+2]=r+2;sa[I+3]=r;sa[I+4]=r+2;sa[I+5]=r+3;I+=6;ka[ja]=r;ka[ja+1]=r+1;ka[ja+2]=r;ka[ja+3]=r+3;ka[ja+4]=r+1;ka[ja+5]=r+2;ka[ja+6]=r+2;ka[ja+7]=r+3;ja+=8;r+=4}}}if(La){c.bindBuffer(c.ARRAY_BUFFER,p.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,Z,J)}if(Pa&&ta.length){c.bindBuffer(c.ARRAY_BUFFER,p.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,$,J)}if(Na){c.bindBuffer(c.ARRAY_BUFFER,p.__webGLNormalBuffer);c.bufferData(c.ARRAY_BUFFER,na,J)}if(Oa&&
+ga.hasTangents){c.bindBuffer(c.ARRAY_BUFFER,p.__webGLTangentBuffer);c.bufferData(c.ARRAY_BUFFER,Q,J)}if(Da&&v>0){c.bindBuffer(c.ARRAY_BUFFER,p.__webGLUVBuffer);c.bufferData(c.ARRAY_BUFFER,Ia,J)}if(Da&&N>0){c.bindBuffer(c.ARRAY_BUFFER,p.__webGLUV2Buffer);c.bufferData(c.ARRAY_BUFFER,Ja,J)}if(Ma){c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,p.__webGLFaceBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,sa,J);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,p.__webGLLineBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,ka,J)}if(q>0){c.bindBuffer(c.ARRAY_BUFFER,
+p.__webGLSkinVertexABuffer);c.bufferData(c.ARRAY_BUFFER,R,J);c.bindBuffer(c.ARRAY_BUFFER,p.__webGLSkinVertexBBuffer);c.bufferData(c.ARRAY_BUFFER,S,J);c.bindBuffer(c.ARRAY_BUFFER,p.__webGLSkinIndicesBuffer);c.bufferData(c.ARRAY_BUFFER,T,J);c.bindBuffer(c.ARRAY_BUFFER,p.__webGLSkinWeightsBuffer);c.bufferData(c.ARRAY_BUFFER,U,J)}}}i.__dirtyVertices=!1;i.__dirtyElements=!1;i.__dirtyUvs=!1;i.__dirtyNormals=!1;i.__dirtyTangents=!1;i.__dirtyColors=!1}else if(h instanceof THREE.Ribbon){i=h.geometry;if(i.__dirtyVertices||
+i.__dirtyColors){h=i;t=c.DYNAMIC_DRAW;r=void 0;r=void 0;s=void 0;p=void 0;v=h.vertices;J=h.colors;N=v.length;P=J.length;I=h.__vertexArray;A=h.__colorArray;K=h.__dirtyColors;if(h.__dirtyVertices){for(r=0;r<N;r++){s=v[r].position;p=r*3;I[p]=s.x;I[p+1]=s.y;I[p+2]=s.z}c.bindBuffer(c.ARRAY_BUFFER,h.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,I,t)}if(K){for(r=0;r<P;r++){color=J[r];p=r*3;A[p]=color.r;A[p+1]=color.g;A[p+2]=color.b}c.bindBuffer(c.ARRAY_BUFFER,h.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,
+A,t)}}i.__dirtyVertices=!1;i.__dirtyColors=!1}else if(h instanceof THREE.Line){i=h.geometry;if(i.__dirtyVertices||i.__dirtyColors){h=i;t=c.DYNAMIC_DRAW;r=void 0;r=void 0;s=void 0;p=void 0;v=h.vertices;J=h.colors;N=v.length;P=J.length;I=h.__vertexArray;A=h.__colorArray;K=h.__dirtyColors;if(h.__dirtyVertices){for(r=0;r<N;r++){s=v[r].position;p=r*3;I[p]=s.x;I[p+1]=s.y;I[p+2]=s.z}c.bindBuffer(c.ARRAY_BUFFER,h.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,I,t)}if(K){for(r=0;r<P;r++){color=J[r];p=r*
+3;A[p]=color.r;A[p+1]=color.g;A[p+2]=color.b}c.bindBuffer(c.ARRAY_BUFFER,h.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,A,t)}}i.__dirtyVertices=!1;i.__dirtyColors=!1}else if(h instanceof THREE.ParticleSystem){i=h.geometry;(i.__dirtyVertices||i.__dirtyColors||h.sortParticles)&&b(i,c.DYNAMIC_DRAW,h);i.__dirtyVertices=!1;i.__dirtyColors=!1}}};this.setFaceCulling=function(f,j){if(f){!j||j=="ccw"?c.frontFace(c.CCW):c.frontFace(c.CW);if(f=="back")c.cullFace(c.BACK);else f=="front"?c.cullFace(c.FRONT):
+c.cullFace(c.FRONT_AND_BACK);c.enable(c.CULL_FACE)}else c.disable(c.CULL_FACE)};this.supportsVertexTextures=function(){return c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0}};

+ 6 - 2
examples/canvas_geometry_hierarchy.html

@@ -33,10 +33,10 @@
 		<script type="text/javascript" src="../src/core/Face4.js"></script>
 		<script type="text/javascript" src="../src/core/UV.js"></script>
 		<script type="text/javascript" src="../src/core/Geometry.js"></script>
+		<script type="text/javascript" src="../src/core/Spline.js"></script>
 		<script type="text/javascript" src="../src/animation/AnimationHandler.js"></script>
 		<script type="text/javascript" src="../src/animation/Animation.js"></script>
 		<script type="text/javascript" src="../src/cameras/Camera.js"></script>
-		<script type="text/javascript" src="../src/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/lights/Light.js"></script>
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
@@ -65,6 +65,7 @@
 		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
 		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
 		<script type="text/javascript" src="../src/objects/Sound.js"></script>
+		<script type="text/javascript" src="../src/objects/LOD.js"></script>
 		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
 		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
 		<script type="text/javascript" src="../src/scenes/FogExp2.js"></script>
@@ -72,6 +73,7 @@
 		<script type="text/javascript" src="../src/renderers/DOMRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/CanvasRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/SVGRenderer.js"></script>
+		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/SoundRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableObject.js"></script>
@@ -90,8 +92,10 @@
 		<script type="text/javascript" src="../src/extras/primitives/Icosahedron.js"></script>
 		<script type="text/javascript" src="../src/extras/primitives/LathedObject.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/PathCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
-
+		
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
 

+ 6 - 2
examples/canvas_performance.html

@@ -32,10 +32,10 @@
 		<script type="text/javascript" src="../src/core/Face4.js"></script>
 		<script type="text/javascript" src="../src/core/UV.js"></script>
 		<script type="text/javascript" src="../src/core/Geometry.js"></script>
+		<script type="text/javascript" src="../src/core/Spline.js"></script>
 		<script type="text/javascript" src="../src/animation/AnimationHandler.js"></script>
 		<script type="text/javascript" src="../src/animation/Animation.js"></script>
 		<script type="text/javascript" src="../src/cameras/Camera.js"></script>
-		<script type="text/javascript" src="../src/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/lights/Light.js"></script>
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
@@ -64,6 +64,7 @@
 		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
 		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
 		<script type="text/javascript" src="../src/objects/Sound.js"></script>
+		<script type="text/javascript" src="../src/objects/LOD.js"></script>
 		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
 		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
 		<script type="text/javascript" src="../src/scenes/FogExp2.js"></script>
@@ -71,6 +72,7 @@
 		<script type="text/javascript" src="../src/renderers/DOMRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/CanvasRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/SVGRenderer.js"></script>
+		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/SoundRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableObject.js"></script>
@@ -89,8 +91,10 @@
 		<script type="text/javascript" src="../src/extras/primitives/Icosahedron.js"></script>
 		<script type="text/javascript" src="../src/extras/primitives/LathedObject.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/PathCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
-
+		
 		<script type="text/javascript" src="../src/extras/primitives/Sphere.js"></script>
 
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>

+ 6 - 2
examples/canvas_sandbox.html

@@ -32,10 +32,10 @@
 		<script type="text/javascript" src="../src/core/Face4.js"></script>
 		<script type="text/javascript" src="../src/core/UV.js"></script>
 		<script type="text/javascript" src="../src/core/Geometry.js"></script>
+		<script type="text/javascript" src="../src/core/Spline.js"></script>
 		<script type="text/javascript" src="../src/animation/AnimationHandler.js"></script>
 		<script type="text/javascript" src="../src/animation/Animation.js"></script>
 		<script type="text/javascript" src="../src/cameras/Camera.js"></script>
-		<script type="text/javascript" src="../src/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/lights/Light.js"></script>
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
@@ -64,6 +64,7 @@
 		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
 		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
 		<script type="text/javascript" src="../src/objects/Sound.js"></script>
+		<script type="text/javascript" src="../src/objects/LOD.js"></script>
 		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
 		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
 		<script type="text/javascript" src="../src/scenes/FogExp2.js"></script>
@@ -71,6 +72,7 @@
 		<script type="text/javascript" src="../src/renderers/DOMRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/CanvasRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/SVGRenderer.js"></script>
+		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/SoundRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableObject.js"></script>
@@ -89,8 +91,10 @@
 		<script type="text/javascript" src="../src/extras/primitives/Icosahedron.js"></script>
 		<script type="text/javascript" src="../src/extras/primitives/LathedObject.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/PathCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
-
+		
 		<script type="text/javascript" src="../src/extras/primitives/Sphere.js"></script>
 		<script type="text/javascript" src="../src/extras/ImageUtils.js"></script>
 

+ 2 - 1
examples/misc_ubiquity_test.html

@@ -37,7 +37,6 @@
 		<script type="text/javascript" src="../src/animation/AnimationHandler.js"></script>
 		<script type="text/javascript" src="../src/animation/Animation.js"></script>
 		<script type="text/javascript" src="../src/cameras/Camera.js"></script>
-		<script type="text/javascript" src="../src/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/lights/Light.js"></script>
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
@@ -93,6 +92,8 @@
 		<script type="text/javascript" src="../src/extras/primitives/Icosahedron.js"></script>
 		<script type="text/javascript" src="../src/extras/primitives/LathedObject.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/PathCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
 		
 		<script type="text/javascript" src="obj/Qrcode.js"></script>

+ 1 - 79
examples/webgl_geometry_hierarchy.html

@@ -15,85 +15,7 @@
 	</head>
 	<body>
 
-		<!-- <script type="text/javascript" src="../build/Three.js"></script> -->
-
-		<script type="text/javascript" src="../src/Three.js"></script>
-		<script type="text/javascript" src="../src/core/Color.js"></script>
-		<script type="text/javascript" src="../src/core/Vector2.js"></script>
-		<script type="text/javascript" src="../src/core/Vector3.js"></script>
-		<script type="text/javascript" src="../src/core/Vector4.js"></script>
-		<script type="text/javascript" src="../src/core/Ray.js"></script>
-		<script type="text/javascript" src="../src/core/Rectangle.js"></script>
-		<script type="text/javascript" src="../src/core/Matrix3.js"></script>
-		<script type="text/javascript" src="../src/core/Matrix4.js"></script>
-		<script type="text/javascript" src="../src/core/Object3D.js"></script>
-		<script type="text/javascript" src="../src/core/Quaternion.js"></script>
-		<script type="text/javascript" src="../src/core/Vertex.js"></script>
-		<script type="text/javascript" src="../src/core/Face3.js"></script>
-		<script type="text/javascript" src="../src/core/Face4.js"></script>
-		<script type="text/javascript" src="../src/core/UV.js"></script>
-		<script type="text/javascript" src="../src/core/Geometry.js"></script>
-		<script type="text/javascript" src="../src/core/Spline.js"></script>
-		<script type="text/javascript" src="../src/animation/AnimationHandler.js"></script>
-		<script type="text/javascript" src="../src/animation/Animation.js"></script>
-		<script type="text/javascript" src="../src/cameras/Camera.js"></script>
-		<script type="text/javascript" src="../src/cameras/QuakeCamera.js"></script>
-		<script type="text/javascript" src="../src/lights/Light.js"></script>
-		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
-		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
-		<script type="text/javascript" src="../src/lights/PointLight.js"></script>
-		<script type="text/javascript" src="../src/materials/Material.js"></script>
-		<script type="text/javascript" src="../src/materials/Mappings.js"></script>
-		<script type="text/javascript" src="../src/materials/LineBasicMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshBasicMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshLambertMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshPhongMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshDepthMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshNormalMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshFaceMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshShaderMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/ParticleBasicMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/ParticleCircleMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/ParticleDOMMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/Texture.js"></script>
-		<script type="text/javascript" src="../src/materials/RenderTarget.js"></script>
-		<script type="text/javascript" src="../src/materials/Uniforms.js"></script>
-		<script type="text/javascript" src="../src/objects/Particle.js"></script>
-		<script type="text/javascript" src="../src/objects/ParticleSystem.js"></script>
-		<script type="text/javascript" src="../src/objects/Line.js"></script>
-		<script type="text/javascript" src="../src/objects/Mesh.js"></script>
-		<script type="text/javascript" src="../src/objects/Bone.js"></script>
-		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
-		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
-		<script type="text/javascript" src="../src/objects/Sound.js"></script>
-		<script type="text/javascript" src="../src/objects/LOD.js"></script>
-		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
-		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
-		<script type="text/javascript" src="../src/scenes/FogExp2.js"></script>
-		<script type="text/javascript" src="../src/renderers/Projector.js"></script>
-		<script type="text/javascript" src="../src/renderers/DOMRenderer.js"></script>
-		<script type="text/javascript" src="../src/renderers/CanvasRenderer.js"></script>
-		<script type="text/javascript" src="../src/renderers/SVGRenderer.js"></script>
-		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
-		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
-		<script type="text/javascript" src="../src/renderers/SoundRenderer.js"></script>
-		<script type="text/javascript" src="../src/renderers/renderables/RenderableObject.js"></script>
-		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace3.js"></script>
-		<script type="text/javascript" src="../src/renderers/renderables/RenderableParticle.js"></script>
-		<script type="text/javascript" src="../src/renderers/renderables/RenderableLine.js"></script>
-		<script type="text/javascript" src="../src/extras/GeometryUtils.js"></script>
-		<script type="text/javascript" src="../src/extras/ImageUtils.js"></script>
-		<script type="text/javascript" src="../src/extras/SceneUtils.js"></script>
-		<script type="text/javascript" src="../src/extras/ShaderUtils.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Cube.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Cylinder.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Plane.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Sphere.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Torus.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Icosahedron.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/LathedObject.js"></script>
-		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
-		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
+		<script type="text/javascript" src="../build/Three.js"></script>
 		
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>

+ 1 - 79
examples/webgl_geometry_hierarchy2.html

@@ -15,85 +15,7 @@
 	</head>
 	<body>
 
-		<!-- <script type="text/javascript" src="../build/Three.js"></script> -->
-
-		<script type="text/javascript" src="../src/Three.js"></script>
-		<script type="text/javascript" src="../src/core/Color.js"></script>
-		<script type="text/javascript" src="../src/core/Vector2.js"></script>
-		<script type="text/javascript" src="../src/core/Vector3.js"></script>
-		<script type="text/javascript" src="../src/core/Vector4.js"></script>
-		<script type="text/javascript" src="../src/core/Ray.js"></script>
-		<script type="text/javascript" src="../src/core/Rectangle.js"></script>
-		<script type="text/javascript" src="../src/core/Matrix3.js"></script>
-		<script type="text/javascript" src="../src/core/Matrix4.js"></script>
-		<script type="text/javascript" src="../src/core/Object3D.js"></script>
-		<script type="text/javascript" src="../src/core/Quaternion.js"></script>
-		<script type="text/javascript" src="../src/core/Vertex.js"></script>
-		<script type="text/javascript" src="../src/core/Face3.js"></script>
-		<script type="text/javascript" src="../src/core/Face4.js"></script>
-		<script type="text/javascript" src="../src/core/UV.js"></script>
-		<script type="text/javascript" src="../src/core/Geometry.js"></script>
-		<script type="text/javascript" src="../src/core/Spline.js"></script>
-		<script type="text/javascript" src="../src/animation/AnimationHandler.js"></script>
-		<script type="text/javascript" src="../src/animation/Animation.js"></script>
-		<script type="text/javascript" src="../src/cameras/Camera.js"></script>
-		<script type="text/javascript" src="../src/cameras/QuakeCamera.js"></script>
-		<script type="text/javascript" src="../src/lights/Light.js"></script>
-		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
-		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
-		<script type="text/javascript" src="../src/lights/PointLight.js"></script>
-		<script type="text/javascript" src="../src/materials/Material.js"></script>
-		<script type="text/javascript" src="../src/materials/Mappings.js"></script>
-		<script type="text/javascript" src="../src/materials/LineBasicMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshBasicMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshLambertMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshPhongMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshDepthMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshNormalMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshFaceMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/MeshShaderMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/ParticleBasicMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/ParticleCircleMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/ParticleDOMMaterial.js"></script>
-		<script type="text/javascript" src="../src/materials/Texture.js"></script>
-		<script type="text/javascript" src="../src/materials/RenderTarget.js"></script>
-		<script type="text/javascript" src="../src/materials/Uniforms.js"></script>
-		<script type="text/javascript" src="../src/objects/Particle.js"></script>
-		<script type="text/javascript" src="../src/objects/ParticleSystem.js"></script>
-		<script type="text/javascript" src="../src/objects/Line.js"></script>
-		<script type="text/javascript" src="../src/objects/Mesh.js"></script>
-		<script type="text/javascript" src="../src/objects/Bone.js"></script>
-		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
-		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
-		<script type="text/javascript" src="../src/objects/Sound.js"></script>
-		<script type="text/javascript" src="../src/objects/LOD.js"></script>
-		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
-		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
-		<script type="text/javascript" src="../src/scenes/FogExp2.js"></script>
-		<script type="text/javascript" src="../src/renderers/Projector.js"></script>
-		<script type="text/javascript" src="../src/renderers/DOMRenderer.js"></script>
-		<script type="text/javascript" src="../src/renderers/CanvasRenderer.js"></script>
-		<script type="text/javascript" src="../src/renderers/SVGRenderer.js"></script>
-		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
-		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
-		<script type="text/javascript" src="../src/renderers/SoundRenderer.js"></script>
-		<script type="text/javascript" src="../src/renderers/renderables/RenderableObject.js"></script>
-		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace3.js"></script>
-		<script type="text/javascript" src="../src/renderers/renderables/RenderableParticle.js"></script>
-		<script type="text/javascript" src="../src/renderers/renderables/RenderableLine.js"></script>
-		<script type="text/javascript" src="../src/extras/GeometryUtils.js"></script>
-		<script type="text/javascript" src="../src/extras/ImageUtils.js"></script>
-		<script type="text/javascript" src="../src/extras/SceneUtils.js"></script>
-		<script type="text/javascript" src="../src/extras/ShaderUtils.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Cube.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Cylinder.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Plane.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Sphere.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Torus.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/Icosahedron.js"></script>
-		<script type="text/javascript" src="../src/extras/primitives/LathedObject.js"></script>
-		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
-		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
+		<script type="text/javascript" src="../build/Three.js"></script>
 		
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>

+ 3 - 2
examples/webgl_performance.html

@@ -16,7 +16,7 @@
 	<body>
 
 		<!-- <script type="text/javascript" src="../build/Three.js"></script> -->
-
+		
 		<script type="text/javascript" src="../src/Three.js"></script>
 		<script type="text/javascript" src="../src/core/Color.js"></script>
 		<script type="text/javascript" src="../src/core/Vector2.js"></script>
@@ -37,7 +37,6 @@
 		<script type="text/javascript" src="../src/animation/AnimationHandler.js"></script>
 		<script type="text/javascript" src="../src/animation/Animation.js"></script>
 		<script type="text/javascript" src="../src/cameras/Camera.js"></script>
-		<script type="text/javascript" src="../src/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/lights/Light.js"></script>
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
@@ -93,6 +92,8 @@
 		<script type="text/javascript" src="../src/extras/primitives/Icosahedron.js"></script>
 		<script type="text/javascript" src="../src/extras/primitives/LathedObject.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/PathCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
 		
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>

+ 6 - 3
examples/webgl_sandbox.html

@@ -51,10 +51,10 @@
 		<script type="text/javascript" src="../src/core/Face4.js"></script>
 		<script type="text/javascript" src="../src/core/UV.js"></script>
 		<script type="text/javascript" src="../src/core/Geometry.js"></script>
+		<script type="text/javascript" src="../src/core/Spline.js"></script>
 		<script type="text/javascript" src="../src/animation/AnimationHandler.js"></script>
 		<script type="text/javascript" src="../src/animation/Animation.js"></script>
 		<script type="text/javascript" src="../src/cameras/Camera.js"></script>
-		<script type="text/javascript" src="../src/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/lights/Light.js"></script>
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
@@ -83,6 +83,7 @@
 		<script type="text/javascript" src="../src/objects/SkinnedMesh.js"></script>
 		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
 		<script type="text/javascript" src="../src/objects/Sound.js"></script>
+		<script type="text/javascript" src="../src/objects/LOD.js"></script>
 		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
 		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
 		<script type="text/javascript" src="../src/scenes/FogExp2.js"></script>
@@ -90,8 +91,8 @@
 		<script type="text/javascript" src="../src/renderers/DOMRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/CanvasRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/SVGRenderer.js"></script>
-		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
+		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/SoundRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableObject.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace3.js"></script>
@@ -109,8 +110,10 @@
 		<script type="text/javascript" src="../src/extras/primitives/Icosahedron.js"></script>
 		<script type="text/javascript" src="../src/extras/primitives/LathedObject.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/PathCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
-
+		
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
 

+ 0 - 0
src/cameras/PathCamera.js → src/extras/cameras/PathCamera.js


+ 0 - 0
src/cameras/QuakeCamera.js → src/extras/cameras/QuakeCamera.js


+ 2 - 4
utils/build.py

@@ -32,8 +32,6 @@ COMMON_FILES = [
 'animation/AnimationHandler.js',
 'animation/Animation.js',
 'cameras/Camera.js',
-'cameras/QuakeCamera.js',
-'cameras/PathCamera.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/DirectionalLight.js',
@@ -92,6 +90,8 @@ EXTRAS_FILES = [
 'extras/primitives/Icosahedron.js',
 'extras/primitives/LathedObject.js',
 'extras/objects/MarchingCubes.js',
+'extras/cameras/QuakeCamera.js',
+'extras/cameras/PathCamera.js',
 'extras/io/Loader.js'
 ]
 
@@ -237,8 +237,6 @@ WEBGL_FILES = [
 'core/UV.js',
 'core/Geometry.js',
 'cameras/Camera.js',
-'cameras/QuakeCamera.js',
-'cameras/PathCamera.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/DirectionalLight.js',

Some files were not shown because too many files changed in this diff