Преглед на файлове

Checking if WebGLRenderer exists before creating AnaglyphWebGLRenderer and CrosseyedWebGLRenderer.

Mr.doob преди 14 години
родител
ревизия
d46a1ee368

+ 40 - 37
build/Three.js

@@ -51,7 +51,7 @@ THREE.Quaternion.prototype={set:function(b,c,d,e){this.x=b;this.y=c;this.z=d;thi
 e;this.z=b.z*e;this.w=Math.cos(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 b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},
 multiplySelf:function(b){var c=this.x,d=this.y,e=this.z,g=this.w,f=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+g*f+d*k-e*j;this.y=d*b+g*j+e*f-c*k;this.z=e*b+g*k+c*j-d*f;this.w=g*b-c*f-d*j-e*k;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var d=b.x,e=b.y,g=b.z,f=this.x,j=this.y,k=this.z,m=this.w,n=m*d+j*g-k*e,o=
 m*e+k*d-f*g,p=m*g+f*e-j*d,d=-f*d-j*e-k*g;c.x=n*m+d*-f+o*-k-p*-j;c.y=o*m+d*-j+p*-f-n*-k;c.z=p*m+d*-k+n*-j-o*-f;return c}};
-THREE.Quaternion.slerp=function(b,c,d,e){var g=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(g)>=1)return d.w=b.w,d.x=b.x,d.y=b.y,d.z=b.z,d;var f=Math.acos(g),j=Math.sqrt(1-g*g);if(Math.abs(j)<0.0010)return d.w=0.5*(b.w+c.w),d.x=0.5*(b.x+c.x),d.y=0.5*(b.y+c.y),d.z=0.5*(b.z+c.z),d;g=Math.sin((1-e)*f)/j;e=Math.sin(e*f)/j;d.w=b.w*g+c.w*e;d.x=b.x*g+c.x*e;d.y=b.y*g+c.y*e;d.z=b.z*g+c.z*e;return d};THREE.Vertex=function(b){this.position=b||new THREE.Vector3};
+THREE.Quaternion.slerp=function(b,c,d,e){var g=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(g)>=1)return d.w=b.w,d.x=b.x,d.y=b.y,d.z=b.z,d;var f=Math.acos(g),j=Math.sqrt(1-g*g);if(Math.abs(j)<0.001)return d.w=0.5*(b.w+c.w),d.x=0.5*(b.x+c.x),d.y=0.5*(b.y+c.y),d.z=0.5*(b.z+c.z),d;g=Math.sin((1-e)*f)/j;e=Math.sin(e*f)/j;d.w=b.w*g+c.w*e;d.x=b.x*g+c.x*e;d.y=b.y*g+c.y*e;d.z=b.z*g+c.z*e;return d};THREE.Vertex=function(b){this.position=b||new THREE.Vector3};
 THREE.Face3=function(b,c,d,e,g,f){this.a=b;this.b=c;this.c=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};
 THREE.Face4=function(b,c,d,e,g,f,j){this.a=b;this.b=c;this.c=d;this.d=e;this.normal=g instanceof THREE.Vector3?g:new THREE.Vector3;this.vertexNormals=g instanceof Array?g:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.set(b||0,c||0)};
 THREE.UV.prototype={set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.set(b.u,b.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
@@ -256,7 +256,7 @@ h.uniform1f(g.rotation,f.rotation),h.uniform2fv(g.scale,m),f.mergeWith3D&&!o?(h.
 xa||(h.enableVertexAttribArray(M.attributes.vertex),h.enableVertexAttribArray(M.attributes.uv),xa=!0);h.uniform1i(x.occlusionMap,0);h.uniform1i(x.map,1);h.bindBuffer(h.ARRAY_BUFFER,M.vertexBuffer);h.vertexAttribPointer(c.vertex,2,h.FLOAT,!1,16,0);h.vertexAttribPointer(c.uv,2,h.FLOAT,!1,16,8);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,M.elementBuffer);h.disable(h.CULL_FACE);h.depthMask(!1);h.activeTexture(h.TEXTURE0);h.bindTexture(h.TEXTURE_2D,M.occlusionTexture);h.activeTexture(h.TEXTURE1);for(e=0;e<f;e++)if(c=
 b.__webglLensFlares[e].object,m.set(c.matrixWorld.n14,c.matrixWorld.n24,c.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(m),d.projectionMatrix.multiplyVector3(m),v[0]=m.x,v[1]=m.y,v[2]=m.z,y[0]=v[0]*p+p,y[1]=v[1]*o+o,M.hasVertexTexture||y[0]>0&&y[0]<ha&&y[1]>0&&y[1]<ea){h.bindTexture(h.TEXTURE_2D,M.tempTexture);h.copyTexImage2D(h.TEXTURE_2D,0,h.RGB,y[0]-8,y[1]-8,16,16,0);h.uniform1i(x.renderType,0);h.uniform2fv(x.scale,u);h.uniform3fv(x.screenPosition,v);h.disable(h.BLEND);h.enable(h.DEPTH_TEST);
 h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0);h.bindTexture(h.TEXTURE_2D,M.occlusionTexture);h.copyTexImage2D(h.TEXTURE_2D,0,h.RGBA,y[0]-8,y[1]-8,16,16,0);h.uniform1i(x.renderType,1);h.disable(h.DEPTH_TEST);h.bindTexture(h.TEXTURE_2D,M.tempTexture);h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0);c.positionScreen.x=v[0];c.positionScreen.y=v[1];c.positionScreen.z=v[2];c.customUpdateCallback?c.customUpdateCallback(c):c.updateLensFlares();h.uniform1i(x.renderType,2);h.enable(h.BLEND);g=0;for(j=c.lensFlares.length;g<
-j;g++)if(k=c.lensFlares[g],k.opacity>0.0010&&k.scale>0.0010)v[0]=k.x,v[1]=k.y,v[2]=k.z,t=k.size*k.scale/ea,u[0]=t*n,u[1]=t,h.uniform3fv(x.screenPosition,v),h.uniform2fv(x.scale,u),h.uniform1f(x.rotation,k.rotation),h.uniform1f(x.opacity,k.opacity),H(k.blending),A(k.texture,1),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0)}h.enable(h.CULL_FACE);h.enable(h.DEPTH_TEST);h.depthMask(J)}function B(b,d){b._modelViewMatrix.multiplyToArray(d.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}
+j;g++)if(k=c.lensFlares[g],k.opacity>0.001&&k.scale>0.001)v[0]=k.x,v[1]=k.y,v[2]=k.z,t=k.size*k.scale/ea,u[0]=t*n,u[1]=t,h.uniform3fv(x.screenPosition,v),h.uniform2fv(x.scale,u),h.uniform1f(x.rotation,k.rotation),h.uniform1f(x.opacity,k.opacity),H(k.blending),A(k.texture,1),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0)}h.enable(h.CULL_FACE);h.enable(h.DEPTH_TEST);h.depthMask(J)}function B(b,d){b._modelViewMatrix.multiplyToArray(d.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}
 function y(b){var d,e,f,g,j;if(b instanceof THREE.Mesh){e=b.geometry;for(d in e.geometryGroups){f=e.geometryGroups[d];j=!1;for(g in f.__webglCustomAttributes)if(f.__webglCustomAttributes[g].needsUpdate){j=!0;break}if(e.__dirtyVertices||e.__dirtyMorphTargets||e.__dirtyElements||e.__dirtyUvs||e.__dirtyNormals||e.__dirtyColors||e.__dirtyTangents||j){j=b;var k=h.DYNAMIC_DRAW;if(f.__inittedArrays){var m=void 0,n=void 0,p=void 0,o=void 0,t=p=void 0,u=void 0,v=void 0,y=void 0,x=void 0,z=void 0,B=void 0,
 G=void 0,Z=void 0,A=void 0,D=void 0,F=void 0,H=void 0,E=o=y=o=v=u=void 0,C=void 0,w=C=E=u=void 0,ja=void 0,L=w=C=E=p=p=t=y=o=w=C=E=ja=w=C=E=ja=w=C=E=void 0,fa=0,J=0,M=0,ma=0,O=0,S=0,K=0,Q=0,N=0,I=0,P=0,C=E=0,V=f.__vertexArray,aa=f.__uvArray,$=f.__uv2Array,ga=f.__normalArray,R=f.__tangentArray,W=f.__colorArray,U=f.__skinVertexAArray,ia=f.__skinVertexBArray,X=f.__skinIndexArray,Y=f.__skinWeightArray,ha=f.__morphTargetsArrays,ea=f.__webglCustomAttributes,w=void 0,ca=f.__faceArray,da=f.__lineArray,ka=
 f.__needsSmoothNormals,z=f.__vertexColorType,x=f.__uvType,B=f.__normalType,oa=j.geometry,za=oa.__dirtyVertices,wa=oa.__dirtyElements,qa=oa.__dirtyUvs,xa=oa.__dirtyNormals,Va=oa.__dirtyTangents,Wa=oa.__dirtyColors,Xa=oa.__dirtyMorphTargets,Ea=oa.vertices,Za=f.faces,bb=oa.faces,$a=oa.faceVertexUvs[0],ab=oa.faceVertexUvs[1],Fa=oa.skinVerticesA,Ga=oa.skinVerticesB,Ha=oa.skinIndices,ya=oa.skinWeights,Ca=j instanceof THREE.ShadowVolume?oa.edgeFaces:void 0,va=oa.morphTargets;if(ea)for(L in ea)ea[L].offset=
@@ -377,7 +377,7 @@ this.getPrevKeyWith("pos",u,j.index-1).pos,this.points[1]=g,this.points[2]=f,thi
 THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var d=[],e=[],g,f,j,k,m,n;g=(b.length-1)*c;f=Math.floor(g);g-=f;d[0]=f==0?f:f-1;d[1]=f;d[2]=f>b.length-2?f:f+1;d[3]=f>b.length-3?f:f+2;f=b[d[0]];k=b[d[1]];m=b[d[2]];n=b[d[3]];d=g*g;j=g*d;e[0]=this.interpolate(f[0],k[0],m[0],n[0],g,d,j);e[1]=this.interpolate(f[1],k[1],m[1],n[1],g,d,j);e[2]=this.interpolate(f[2],k[2],m[2],n[2],g,d,j);return e};
 THREE.Animation.prototype.interpolate=function(b,c,d,e,g,f,j){b=(d-b)*0.5;e=(e-c)*0.5;return(2*(c-d)+b+e)*j+(-3*(c-d)-2*b-e)*f+b*g+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,d){var e=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?d=d<e.length-1?d:e.length-1:d%=e.length;d<e.length;d++)if(e[d][b]!==void 0)return e[d];return this.data.hierarchy[c].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(b,c,d){for(var e=this.data.hierarchy[c].keys,d=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?d>0?d:0:d>=0?d:d+e.length;d>=0;d--)if(e[d][b]!==void 0)return e[d];return this.data.hierarchy[c].keys[e.length-1]};
-THREE.QuakeCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=
+THREE.QuakeCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=
 b.movementSpeed;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.noFly!==void 0)this.noFly=b.noFly;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.autoForward!==void 0)this.autoForward=b.autoForward;if(b.activeLook!==void 0)this.activeLook=b.activeLook;if(b.heightSpeed!==void 0)this.heightSpeed=b.heightSpeed;if(b.heightCoef!==void 0)this.heightCoef=b.heightCoef;if(b.heightMin!==void 0)this.heightMin=b.heightMin;if(b.heightMax!==void 0)this.heightMax=b.heightMax;if(b.constrainVertical!==
 void 0)this.constrainVertical=b.constrainVertical;if(b.verticalMin!==void 0)this.verticalMin=b.verticalMin;if(b.verticalMax!==void 0)this.verticalMax=b.verticalMax;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(b){b.preventDefault();
 b.stopPropagation();if(this.activeLook)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.activeLook)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=
@@ -389,7 +389,7 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
 THREE.QuakeCamera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(b));this.target.position.addSelf(c.multiplyScalar(b))};
 THREE.PathCamera=function(b){function c(b,c,d,e){var f={name:d,fps:0.6,length:e,hierarchy:[]},g,j=c.getControlPointsArray(),k=c.getLength(),m=j.length,D=0;g=m-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:j[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[g]={time:e,pos:j[g],rot:[0,0,0,1],scl:[1,1,1]};for(g=1;g<m-1;g++)D=e*k.chunks[g]/k.total,c.keys[g]={time:D,pos:j[g]};f.hierarchy[0]=c;THREE.AnimationHandler.add(f);return new THREE.Animation(b,d,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function d(b,c){var d,
 e,f=new THREE.Geometry;for(d=0;d<b.points.length*c;d++)e=d/(b.points.length*c),e=b.getPoint(e),f.vertices[d]=new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z));return f}function e(b,c){var e=d(c,10),f=d(c,10),g=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,g);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.addChild(lineObj);particleObj.scale.set(1,1,1);b.addChild(particleObj);f=new THREE.Sphere(1,
-16,8);g=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)e=new THREE.Mesh(f,g),e.position.copy(c.points[i]),e.updateMatrix(),b.addChild(e)}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookHorizontal=
+16,8);g=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)e=new THREE.Mesh(f,g),e.position.copy(c.points[i]),e.updateMatrix(),b.addChild(e)}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=
 this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(b){if(b.duration!==void 0)this.duration=b.duration*1E3;if(b.waypoints!==void 0)this.waypoints=b.waypoints;if(b.useConstantSpeed!==void 0)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==void 0)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==void 0)this.createDebugPath=b.createDebugPath;if(b.createDebugDummy!==
 void 0)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==void 0)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==void 0)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==void 0)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
 window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var g=Math.PI*2,f=Math.PI/180;this.update=function(b,c,d){var e,j;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)*f;this.theta=this.lon*f;e=this.phi%g;this.phi=e>=0?e:e+g;e=this.verticalAngleMap.srcRange;j=this.verticalAngleMap.dstRange;var k=j[1]-j[0];this.phi=
@@ -397,7 +397,7 @@ TWEEN.Easing.Quadratic.EaseInOut(((this.phi-e[0])*(j[1]-j[0])/(e[1]-e[0])+j[0]-j
 b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),j=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.Cube(10,10,20),m=new THREE.Cube(2,2,10);this.animationParent=new THREE.Mesh(k,b);b=new THREE.Mesh(m,j);b.position.set(0,10,0);this.animation=c(this.animationParent,
 this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(b)}else this.animation=c(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&e(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(b,c){return function(){c.apply(b,arguments)}}(this,this.onMouseMove),!1)};
 THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
-THREE.FlyCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.domElement=document;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=b.movementSpeed;if(b.rollSpeed!==void 0)this.rollSpeed=b.rollSpeed;if(b.dragToLook!==void 0)this.dragToLook=b.dragToLook;if(b.autoForward!==void 0)this.autoForward=
+THREE.FlyCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.domElement=document;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=b.movementSpeed;if(b.rollSpeed!==void 0)this.rollSpeed=b.rollSpeed;if(b.dragToLook!==void 0)this.dragToLook=b.dragToLook;if(b.autoForward!==void 0)this.autoForward=
 b.autoForward;if(b.domElement!==void 0)this.domElement=b.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.keydown=function(b){if(!b.altKey){switch(b.keyCode){case 16:this.movementSpeedMultiplier=
 0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
 this.keyup=function(b){switch(b.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;
@@ -425,32 +425,27 @@ c(this,function(b){d&&(f=j=this.getMouseProjectionOnBall(b.clientX,b.clientY),k=
 b.stopPropagation();if(e===this.STATE.NONE)e=b.button,e===this.STATE.ROTATE?f=j=this.getMouseProjectionOnBall(b.clientX,b.clientY):e===this.STATE.ZOOM&&!this.noZoom?k=m=this.getMouseOnScreen(b.clientX,b.clientY):this.noPan||(n=o=this.getMouseOnScreen(b.clientX,b.clientY))}),!1);this.domElement.addEventListener("mouseup",c(this,function(b){b.preventDefault();b.stopPropagation();e=this.STATE.NONE}),!1);window.addEventListener("keydown",c(this,function(b){if(e===this.STATE.NONE){if(b.keyCode===this.keys[this.STATE.ROTATE])e=
 this.STATE.ROTATE;else if(b.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)e=this.STATE.ZOOM;else if(b.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)e=this.STATE.PAN;e!==this.STATE.NONE&&(d=!0)}}),!1);window.addEventListener("keyup",c(this,function(){if(e!==this.STATE.NONE)e=this.STATE.NONE}),!1)};THREE.TrackballCamera.prototype=new THREE.Camera;THREE.TrackballCamera.prototype.constructor=THREE.TrackballCamera;THREE.TrackballCamera.prototype.supr=THREE.Camera.prototype;
 THREE.TrackballCamera.prototype.STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2};
-THREE.Cube=function(b,c,d,e,g,f,j,k,m){function n(b,c,d,j,k,m,n,p){var t,u,v=e||1,z=g||1,h=k/2,U=m/2,Q=o.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")t="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")t="y",z=f||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")t="x",v=f||1;var W=v+1,J=z+1;k/=v;var $=m/z;for(u=0;u<J;u++)for(m=0;m<W;m++){var R=new THREE.Vector3;R[b]=(m*k-h)*d;R[c]=(u*$-U)*j;R[t]=n;o.vertices.push(new THREE.Vertex(R))}for(u=0;u<z;u++)for(m=0;m<v;m++)o.faces.push(new THREE.Face4(m+W*u+Q,m+W*(u+
-1)+Q,m+1+W*(u+1)+Q,m+1+W*u+Q,null,null,p)),o.faceVertexUvs[0].push([new THREE.UV(m/v,u/z),new THREE.UV(m/v,(u+1)/z),new THREE.UV((m+1)/v,(u+1)/z),new THREE.UV((m+1)/v,u/z)])}THREE.Geometry.call(this);var o=this,p=b/2,t=c/2,u=d/2,k=k?-1:1;if(j!==void 0)if(j instanceof Array)this.materials=j;else{this.materials=[];for(var v=0;v<6;v++)this.materials.push([j])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(m!=void 0)for(var z in m)this.sides[z]!=void 0&&(this.sides[z]=m[z]);
-this.sides.px&&n("z","y",1*k,-1,d,c,-p,this.materials[0]);this.sides.nx&&n("z","y",-1*k,-1,d,c,p,this.materials[1]);this.sides.py&&n("x","z",1*k,1,b,d,t,this.materials[2]);this.sides.ny&&n("x","z",1*k,-1,b,d,-t,this.materials[3]);this.sides.pz&&n("x","y",1*k,-1,b,c,u,this.materials[4]);this.sides.nz&&n("x","y",-1*k,-1,b,c,-u,this.materials[5]);(function(){for(var b=[],c=[],d=0,e=o.vertices.length;d<e;d++){for(var f=o.vertices[d],g=!1,j=0,k=b.length;j<k;j++){var m=b[j];if(f.position.x==m.position.x&&
-f.position.y==m.position.y&&f.position.z==m.position.z){c[d]=j;g=!0;break}}if(!g)c[d]=b.length,b.push(new THREE.Vertex(f.position.clone()))}d=0;for(e=o.faces.length;d<e;d++)f=o.faces[d],f.a=c[f.a],f.b=c[f.b],f.c=c[f.c],f.d=c[f.d];o.vertices=b})();this.computeCentroids();this.computeFaceNormals()};THREE.Cube.prototype=new THREE.Geometry;THREE.Cube.prototype.constructor=THREE.Cube;
-THREE.Cylinder=function(b,c,d,e,g,f){function j(b,c,d){k.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,d)))}THREE.Geometry.call(this);var k=this,m,n=Math.PI*2,o=e/2;for(m=0;m<b;m++)j(Math.sin(n*m/b)*c,Math.cos(n*m/b)*c,-o);for(m=0;m<b;m++)j(Math.sin(n*m/b)*d,Math.cos(n*m/b)*d,o);for(m=0;m<b;m++)k.faces.push(new THREE.Face4(m,m+b,b+(m+1)%b,(m+1)%b));if(d>0){j(0,0,-o-(f||0));for(m=b;m<b+b/2;m++)k.faces.push(new THREE.Face4(2*b,(2*m-2*b)%b,(2*m-2*b+1)%b,(2*m-2*b+2)%b))}if(c>0){j(0,0,o+(g||0));
-for(m=b+b/2;m<2*b;m++)k.faces.push(new THREE.Face4(2*b+1,(2*m-2*b+2)%b+b,(2*m-2*b+1)%b+b,(2*m-2*b)%b+b))}m=0;for(b=this.faces.length;m<b;m++){var c=[],d=this.faces[m],g=this.vertices[d.a],f=this.vertices[d.b],o=this.vertices[d.c],p=this.vertices[d.d];c.push(new THREE.UV(0.5+Math.atan2(g.position.x,g.position.y)/n,0.5+g.position.z/e));c.push(new THREE.UV(0.5+Math.atan2(f.position.x,f.position.y)/n,0.5+f.position.z/e));c.push(new THREE.UV(0.5+Math.atan2(o.position.x,o.position.y)/n,0.5+o.position.z/
-e));d instanceof THREE.Face4&&c.push(new THREE.UV(0.5+Math.atan2(p.position.x,p.position.y)/n,0.5+p.position.z/e));this.faceVertexUvs[0].push(c)}this.computeCentroids();this.computeFaceNormals()};THREE.Cylinder.prototype=new THREE.Geometry;THREE.Cylinder.prototype.constructor=THREE.Cylinder;
-THREE.Icosahedron=function(b){function c(b,c,d){var e=Math.sqrt(b*b+c*c+d*d);return g.vertices.push(new THREE.Vertex(new THREE.Vector3(b/e,c/e,d/e)))-1}function d(b,c,d,e){e.faces.push(new THREE.Face3(b,c,d))}function e(b,d){var e=g.vertices[b].position,f=g.vertices[d].position;return c((e.x+f.x)/2,(e.y+f.y)/2,(e.z+f.z)/2)}var g=this,f=new THREE.Geometry,j;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;c(-1,b,0);c(1,b,0);c(-1,-b,0);c(1,-b,0);c(0,-1,b);c(0,1,b);c(0,-1,-b);c(0,
-1,-b);c(b,0,-1);c(b,0,1);c(-b,0,-1);c(-b,0,1);d(0,11,5,f);d(0,5,1,f);d(0,1,7,f);d(0,7,10,f);d(0,10,11,f);d(1,5,9,f);d(5,11,4,f);d(11,10,2,f);d(10,7,6,f);d(7,1,8,f);d(3,9,4,f);d(3,4,2,f);d(3,2,6,f);d(3,6,8,f);d(3,8,9,f);d(4,9,5,f);d(2,4,11,f);d(6,2,10,f);d(8,6,7,f);d(9,8,1,f);for(b=0;b<this.subdivisions;b++){j=new THREE.Geometry;for(var k in f.faces){var m=e(f.faces[k].a,f.faces[k].b),n=e(f.faces[k].b,f.faces[k].c),o=e(f.faces[k].c,f.faces[k].a);d(f.faces[k].a,m,o,j);d(f.faces[k].b,n,m,j);d(f.faces[k].c,
-o,n,j);d(m,n,o,j)}f.faces=j.faces}g.faces=f.faces;delete f;delete j;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Icosahedron.prototype=new THREE.Geometry;THREE.Icosahedron.prototype.constructor=THREE.Icosahedron;
-THREE.Lathe=function(b,c,d){THREE.Geometry.call(this);this.steps=c||12;this.angle=d||2*Math.PI;for(var c=this.angle/this.steps,d=[],e=[],g=[],f=[],j=(new THREE.Matrix4).setRotationZ(c),k=0;k<b.length;k++)this.vertices.push(new THREE.Vertex(b[k])),d[k]=b[k].clone(),e[k]=this.vertices.length-1;for(var m=0;m<=this.angle+0.0010;m+=c){for(k=0;k<d.length;k++)m<this.angle?(d[k]=j.multiplyVector3(d[k].clone()),this.vertices.push(new THREE.Vertex(d[k])),g[k]=this.vertices.length-1):g=f;m==0&&(f=e);for(k=0;k<
-e.length-1;k++)this.faces.push(new THREE.Face4(g[k],g[k+1],e[k+1],e[k])),this.faceVertexUvs[0].push([new THREE.UV(1-m/this.angle,k/b.length),new THREE.UV(1-m/this.angle,(k+1)/b.length),new THREE.UV(1-(m-c)/this.angle,(k+1)/b.length),new THREE.UV(1-(m-c)/this.angle,k/b.length)]);e=g;g=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Lathe.prototype=new THREE.Geometry;THREE.Lathe.prototype.constructor=THREE.Lathe;
-THREE.Plane=function(b,c,d,e){THREE.Geometry.call(this);var g,f=b/2,j=c/2,d=d||1,e=e||1,k=d+1,m=e+1;b/=d;var n=c/e;for(g=0;g<m;g++)for(c=0;c<k;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-f,-(g*n-j),0)));for(g=0;g<e;g++)for(c=0;c<d;c++)this.faces.push(new THREE.Face4(c+k*g,c+k*(g+1),c+1+k*(g+1),c+1+k*g)),this.faceVertexUvs[0].push([new THREE.UV(c/d,g/e),new THREE.UV(c/d,(g+1)/e),new THREE.UV((c+1)/d,(g+1)/e),new THREE.UV((c+1)/d,g/e)]);this.computeCentroids();this.computeFaceNormals()};
-THREE.Plane.prototype=new THREE.Geometry;THREE.Plane.prototype.constructor=THREE.Plane;
-THREE.Sphere=function(b,c,d){THREE.Geometry.call(this);for(var e,g=Math.PI,f=Math.max(3,c||8),j=Math.max(2,d||6),c=[],d=0;d<j+1;d++){e=d/j;var k=b*Math.cos(e*g),m=b*Math.sin(e*g),n=[],o=0;for(e=0;e<f;e++){var p=2*e/f,t=m*Math.sin(p*g),p=m*Math.cos(p*g);(d==0||d==j)&&e>0||(o=this.vertices.push(new THREE.Vertex(new THREE.Vector3(p,k,t)))-1);n.push(o)}c.push(n)}for(var u,v,z,g=c.length,d=0;d<g;d++)if(f=c[d].length,d>0)for(e=0;e<f;e++){n=e==f-1;j=c[d][n?0:e+1];k=c[d][n?f-1:e];m=c[d-1][n?f-1:e];n=c[d-
-1][n?0:e+1];t=d/(g-1);u=(d-1)/(g-1);v=(e+1)/f;var p=e/f,o=new THREE.UV(1-v,t),t=new THREE.UV(1-p,t),p=new THREE.UV(1-p,u),B=new THREE.UV(1-v,u);d<c.length-1&&(u=this.vertices[j].position.clone(),v=this.vertices[k].position.clone(),z=this.vertices[m].position.clone(),u.normalize(),v.normalize(),z.normalize(),this.faces.push(new THREE.Face3(j,k,m,[new THREE.Vector3(u.x,u.y,u.z),new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([o,t,p]));d>1&&(u=this.vertices[j].position.clone(),
-v=this.vertices[m].position.clone(),z=this.vertices[n].position.clone(),u.normalize(),v.normalize(),z.normalize(),this.faces.push(new THREE.Face3(j,m,n,[new THREE.Vector3(u.x,u.y,u.z),new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([o,p,B]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.Sphere.prototype=new THREE.Geometry;THREE.Sphere.prototype.constructor=THREE.Sphere;
-THREE.Torus=function(b,c,d,e){THREE.Geometry.call(this);this.radius=b||100;this.tube=c||40;this.segmentsR=d||8;this.segmentsT=e||6;b=[];for(c=0;c<=this.segmentsR;++c)for(d=0;d<=this.segmentsT;++d){var e=d/this.segmentsT*2*Math.PI,g=c/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(g))*Math.cos(e),(this.radius+this.tube*Math.cos(g))*Math.sin(e),this.tube*Math.sin(g))));b.push([d/this.segmentsT,1-c/this.segmentsR])}for(c=1;c<=this.segmentsR;++c)for(d=
-1;d<=this.segmentsT;++d){var e=(this.segmentsT+1)*c+d,g=(this.segmentsT+1)*c+d-1,f=(this.segmentsT+1)*(c-1)+d-1,j=(this.segmentsT+1)*(c-1)+d;this.faces.push(new THREE.Face4(e,g,f,j));this.faceVertexUvs[0].push([new THREE.UV(b[e][0],b[e][1]),new THREE.UV(b[g][0],b[g][1]),new THREE.UV(b[f][0],b[f][1]),new THREE.UV(b[j][0],b[j][1])])}delete b;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Torus.prototype=new THREE.Geometry;THREE.Torus.prototype.constructor=THREE.Torus;
-THREE.TorusKnot=function(b,c,d,e,g,f,j){function k(b,c,d,e,f,g){c=d/e*b;d=Math.cos(c);return new THREE.Vector3(f*(2+d)*0.5*Math.cos(b),f*(2+d)*Math.sin(b)*0.5,g*f*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=b||200;this.tube=c||40;this.segmentsR=d||64;this.segmentsT=e||8;this.p=g||2;this.q=f||3;this.heightScale=j||1;this.grid=Array(this.segmentsR);d=new THREE.Vector3;e=new THREE.Vector3;f=new THREE.Vector3;for(b=0;b<this.segmentsR;++b){this.grid[b]=Array(this.segmentsT);for(c=0;c<this.segmentsT;++c){var m=
-b/this.segmentsR*2*this.p*Math.PI,j=c/this.segmentsT*2*Math.PI,g=k(m,j,this.q,this.p,this.radius,this.heightScale),m=k(m+0.01,j,this.q,this.p,this.radius,this.heightScale);d.x=m.x-g.x;d.y=m.y-g.y;d.z=m.z-g.z;e.x=m.x+g.x;e.y=m.y+g.y;e.z=m.z+g.z;f.cross(d,e);e.cross(f,d);f.normalize();e.normalize();m=-this.tube*Math.cos(j);j=this.tube*Math.sin(j);g.x+=m*e.x+j*f.x;g.y+=m*e.y+j*f.y;g.z+=m*e.z+j*f.z;this.grid[b][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(g.x,g.y,g.z)))-1}}for(b=0;b<this.segmentsR;++b)for(c=
-0;c<this.segmentsT;++c){var e=(b+1)%this.segmentsR,f=(c+1)%this.segmentsT,g=this.grid[b][c],d=this.grid[e][c],e=this.grid[e][f],f=this.grid[b][f],j=new THREE.UV(b/this.segmentsR,c/this.segmentsT),m=new THREE.UV((b+1)/this.segmentsR,c/this.segmentsT),n=new THREE.UV((b+1)/this.segmentsR,(c+1)/this.segmentsT),o=new THREE.UV(b/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(g,d,e,f));this.faceVertexUvs[0].push([j,m,n,o])}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};
-THREE.TorusKnot.prototype=new THREE.Geometry;THREE.TorusKnot.prototype.constructor=THREE.TorusKnot;THREE.Text=function(b,c){THREE.Geometry.call(this);this.parameters=c||{};this.set(b)};THREE.Text.prototype=new THREE.Geometry;THREE.Text.prototype.constructor=THREE.Text;
-THREE.Text.prototype.set=function(b,c){this.text=b;var c=c||this.parameters,d=c.height!==void 0?c.height:50,e=c.curveSegments!==void 0?c.curveSegments:4,g=c.font!==void 0?c.font:"helvetiker",f=c.weight!==void 0?c.weight:"normal",j=c.style!==void 0?c.style:"normal";THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=e;THREE.FontUtils.face=g;THREE.FontUtils.weight=f;THREE.FontUtils.style=j;var g=THREE.FontUtils.drawText(b),e=g.points,k=g.faces,g=g.contour;this.vertices=[];this.faces=
-[];for(var m,j=e.length,n=k.length,f=0;f<j;f++)m=e[f],this.vertices.push(new THREE.Vertex(new THREE.Vector3(m.x,m.y,0)));for(f=0;f<j;f++)m=e[f],this.vertices.push(new THREE.Vertex(new THREE.Vector3(m.x,m.y,d)));for(f=0;f<n;f++)d=k[f],this.faces.push(new THREE.Face3(d[2],d[1],d[0]));for(f=0;f<n;f++)d=k[f],this.faces.push(new THREE.Face3(d[0]+j,d[1]+j,d[2]+j));for(var f=g.length,o;--f>0;){if(o){if(o.equals(g[f])){o=null;continue}}else o=g[f];for(d=0;d<j;d++)if(e[d].equals(g[f]))break;for(k=0;k<j;k++)if(e[k].equals(g[f-
-1]))break;this.faces.push(new THREE.Face4(d,k,k+j,d+j))}this.computeCentroids();this.computeFaceNormals()};
+THREE.CubeGeometry=function(b,c,d,e,g,f,j,k,m){function n(b,c,d,j,k,m,n,p){var t,u,v=e||1,z=g||1,h=k/2,U=m/2,Q=o.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")t="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")t="y",z=f||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")t="x",v=f||1;var W=v+1,J=z+1;k/=v;var $=m/z;for(u=0;u<J;u++)for(m=0;m<W;m++){var R=new THREE.Vector3;R[b]=(m*k-h)*d;R[c]=(u*$-U)*j;R[t]=n;o.vertices.push(new THREE.Vertex(R))}for(u=0;u<z;u++)for(m=0;m<v;m++)o.faces.push(new THREE.Face4(m+W*u+
+Q,m+W*(u+1)+Q,m+1+W*(u+1)+Q,m+1+W*u+Q,null,null,p)),o.faceVertexUvs[0].push([new THREE.UV(m/v,u/z),new THREE.UV(m/v,(u+1)/z),new THREE.UV((m+1)/v,(u+1)/z),new THREE.UV((m+1)/v,u/z)])}THREE.Geometry.call(this);var o=this,p=b/2,t=c/2,u=d/2,k=k?-1:1;if(j!==void 0)if(j instanceof Array)this.materials=j;else{this.materials=[];for(var v=0;v<6;v++)this.materials.push([j])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(m!=void 0)for(var z in m)this.sides[z]!=void 0&&(this.sides[z]=
+m[z]);this.sides.px&&n("z","y",1*k,-1,d,c,-p,this.materials[0]);this.sides.nx&&n("z","y",-1*k,-1,d,c,p,this.materials[1]);this.sides.py&&n("x","z",1*k,1,b,d,t,this.materials[2]);this.sides.ny&&n("x","z",1*k,-1,b,d,-t,this.materials[3]);this.sides.pz&&n("x","y",1*k,-1,b,c,u,this.materials[4]);this.sides.nz&&n("x","y",-1*k,-1,b,c,-u,this.materials[5]);(function(){for(var b=[],c=[],d=0,e=o.vertices.length;d<e;d++){for(var f=o.vertices[d],g=!1,j=0,k=b.length;j<k;j++){var m=b[j];if(f.position.x==m.position.x&&
+f.position.y==m.position.y&&f.position.z==m.position.z){c[d]=j;g=!0;break}}if(!g)c[d]=b.length,b.push(new THREE.Vertex(f.position.clone()))}d=0;for(e=o.faces.length;d<e;d++)f=o.faces[d],f.a=c[f.a],f.b=c[f.b],f.c=c[f.c],f.d=c[f.d];o.vertices=b})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
+THREE.CylinderGeometry=function(b,c,d,e,g,f){function j(b,c,d){k.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,d)))}THREE.Geometry.call(this);var k=this,m,n=Math.PI*2,o=e/2;for(m=0;m<b;m++)j(Math.sin(n*m/b)*c,Math.cos(n*m/b)*c,-o);for(m=0;m<b;m++)j(Math.sin(n*m/b)*d,Math.cos(n*m/b)*d,o);for(m=0;m<b;m++)k.faces.push(new THREE.Face4(m,m+b,b+(m+1)%b,(m+1)%b));if(d>0){j(0,0,-o-(f||0));for(m=b;m<b+b/2;m++)k.faces.push(new THREE.Face4(2*b,(2*m-2*b)%b,(2*m-2*b+1)%b,(2*m-2*b+2)%b))}if(c>0){j(0,0,o+
+(g||0));for(m=b+b/2;m<2*b;m++)k.faces.push(new THREE.Face4(2*b+1,(2*m-2*b+2)%b+b,(2*m-2*b+1)%b+b,(2*m-2*b)%b+b))}m=0;for(b=this.faces.length;m<b;m++){var c=[],d=this.faces[m],g=this.vertices[d.a],f=this.vertices[d.b],o=this.vertices[d.c],p=this.vertices[d.d];c.push(new THREE.UV(0.5+Math.atan2(g.position.x,g.position.y)/n,0.5+g.position.z/e));c.push(new THREE.UV(0.5+Math.atan2(f.position.x,f.position.y)/n,0.5+f.position.z/e));c.push(new THREE.UV(0.5+Math.atan2(o.position.x,o.position.y)/n,0.5+o.position.z/
+e));d instanceof THREE.Face4&&c.push(new THREE.UV(0.5+Math.atan2(p.position.x,p.position.y)/n,0.5+p.position.z/e));this.faceVertexUvs[0].push(c)}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
+THREE.IcosahedronGeometry=function(b){function c(b,c,d){var e=Math.sqrt(b*b+c*c+d*d);return g.vertices.push(new THREE.Vertex(new THREE.Vector3(b/e,c/e,d/e)))-1}function d(b,c,d,e){e.faces.push(new THREE.Face3(b,c,d))}function e(b,d){var e=g.vertices[b].position,f=g.vertices[d].position;return c((e.x+f.x)/2,(e.y+f.y)/2,(e.z+f.z)/2)}var g=this,f=new THREE.Geometry,j;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;c(-1,b,0);c(1,b,0);c(-1,-b,0);c(1,-b,0);c(0,-1,b);c(0,1,b);c(0,-1,
+-b);c(0,1,-b);c(b,0,-1);c(b,0,1);c(-b,0,-1);c(-b,0,1);d(0,11,5,f);d(0,5,1,f);d(0,1,7,f);d(0,7,10,f);d(0,10,11,f);d(1,5,9,f);d(5,11,4,f);d(11,10,2,f);d(10,7,6,f);d(7,1,8,f);d(3,9,4,f);d(3,4,2,f);d(3,2,6,f);d(3,6,8,f);d(3,8,9,f);d(4,9,5,f);d(2,4,11,f);d(6,2,10,f);d(8,6,7,f);d(9,8,1,f);for(b=0;b<this.subdivisions;b++){j=new THREE.Geometry;for(var k in f.faces){var m=e(f.faces[k].a,f.faces[k].b),n=e(f.faces[k].b,f.faces[k].c),o=e(f.faces[k].c,f.faces[k].a);d(f.faces[k].a,m,o,j);d(f.faces[k].b,n,m,j);
+d(f.faces[k].c,o,n,j);d(m,n,o,j)}f.faces=j.faces}g.faces=f.faces;delete f;delete j;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
+THREE.LatheGeometry=function(b,c,d){THREE.Geometry.call(this);this.steps=c||12;this.angle=d||2*Math.PI;for(var c=this.angle/this.steps,d=[],e=[],g=[],f=[],j=(new THREE.Matrix4).setRotationZ(c),k=0;k<b.length;k++)this.vertices.push(new THREE.Vertex(b[k])),d[k]=b[k].clone(),e[k]=this.vertices.length-1;for(var m=0;m<=this.angle+0.001;m+=c){for(k=0;k<d.length;k++)m<this.angle?(d[k]=j.multiplyVector3(d[k].clone()),this.vertices.push(new THREE.Vertex(d[k])),g[k]=this.vertices.length-1):g=f;m==0&&(f=e);
+for(k=0;k<e.length-1;k++)this.faces.push(new THREE.Face4(g[k],g[k+1],e[k+1],e[k])),this.faceVertexUvs[0].push([new THREE.UV(1-m/this.angle,k/b.length),new THREE.UV(1-m/this.angle,(k+1)/b.length),new THREE.UV(1-(m-c)/this.angle,(k+1)/b.length),new THREE.UV(1-(m-c)/this.angle,k/b.length)]);e=g;g=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.PlaneGeometry=function(b,c,d,e){THREE.Geometry.call(this);var g,f=b/2,j=c/2,d=d||1,e=e||1,k=d+1,m=e+1;b/=d;var n=c/e;for(g=0;g<m;g++)for(c=0;c<k;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-f,-(g*n-j),0)));for(g=0;g<e;g++)for(c=0;c<d;c++)this.faces.push(new THREE.Face4(c+k*g,c+k*(g+1),c+1+k*(g+1),c+1+k*g)),this.faceVertexUvs[0].push([new THREE.UV(c/d,g/e),new THREE.UV(c/d,(g+1)/e),new THREE.UV((c+1)/d,(g+1)/e),new THREE.UV((c+1)/d,g/e)]);this.computeCentroids();this.computeFaceNormals()};
+THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
+THREE.SphereGeometry=function(b,c,d){THREE.Geometry.call(this);for(var b=b||50,e,g=Math.PI,f=Math.max(3,c||8),j=Math.max(2,d||6),c=[],d=0;d<j+1;d++){e=d/j;var k=b*Math.cos(e*g),m=b*Math.sin(e*g),n=[],o=0;for(e=0;e<f;e++){var p=2*e/f,t=m*Math.sin(p*g),p=m*Math.cos(p*g);(d==0||d==j)&&e>0||(o=this.vertices.push(new THREE.Vertex(new THREE.Vector3(p,k,t)))-1);n.push(o)}c.push(n)}for(var u,v,z,g=c.length,d=0;d<g;d++)if(f=c[d].length,d>0)for(e=0;e<f;e++){n=e==f-1;j=c[d][n?0:e+1];k=c[d][n?f-1:e];m=c[d-1][n?
+f-1:e];n=c[d-1][n?0:e+1];t=d/(g-1);u=(d-1)/(g-1);v=(e+1)/f;var p=e/f,o=new THREE.UV(1-v,t),t=new THREE.UV(1-p,t),p=new THREE.UV(1-p,u),B=new THREE.UV(1-v,u);d<c.length-1&&(u=this.vertices[j].position.clone(),v=this.vertices[k].position.clone(),z=this.vertices[m].position.clone(),u.normalize(),v.normalize(),z.normalize(),this.faces.push(new THREE.Face3(j,k,m,[new THREE.Vector3(u.x,u.y,u.z),new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([o,t,p]));d>1&&(u=
+this.vertices[j].position.clone(),v=this.vertices[m].position.clone(),z=this.vertices[n].position.clone(),u.normalize(),v.normalize(),z.normalize(),this.faces.push(new THREE.Face3(j,m,n,[new THREE.Vector3(u.x,u.y,u.z),new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([o,p,B]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;
+THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(b,c){THREE.Geometry.call(this);this.parameters=c||{};this.set(b)};THREE.TextGeometry.prototype=new THREE.Geometry;THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
+THREE.TextGeometry.prototype.set=function(b,c){this.text=b;var c=c||this.parameters,d=c.height!==void 0?c.height:50,e=c.curveSegments!==void 0?c.curveSegments:4,g=c.font!==void 0?c.font:"helvetiker",f=c.weight!==void 0?c.weight:"normal",j=c.style!==void 0?c.style:"normal";THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=e;THREE.FontUtils.face=g;THREE.FontUtils.weight=f;THREE.FontUtils.style=j;var g=THREE.FontUtils.drawText(b),e=g.points,k=g.faces,g=g.contour;this.vertices=
+[];this.faces=[];for(var m,j=e.length,n=k.length,f=0;f<j;f++)m=e[f],this.vertices.push(new THREE.Vertex(new THREE.Vector3(m.x,m.y,0)));for(f=0;f<j;f++)m=e[f],this.vertices.push(new THREE.Vertex(new THREE.Vector3(m.x,m.y,d)));for(f=0;f<n;f++)d=k[f],this.faces.push(new THREE.Face3(d[2],d[1],d[0]));for(f=0;f<n;f++)d=k[f],this.faces.push(new THREE.Face3(d[0]+j,d[1]+j,d[2]+j));for(var f=g.length,o;--f>0;){if(o){if(o.equals(g[f])){o=null;continue}}else o=g[f];for(d=0;d<j;d++)if(e[d].equals(g[f]))break;
+for(k=0;k<j;k++)if(e[k].equals(g[f-1]))break;this.faces.push(new THREE.Face4(d,k,k+j,d+j))}this.computeCentroids();this.computeFaceNormals()};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},extractPoints:function(b,c){if(b.length<3)return console.log("not valid polygon"),
 {points:b,faces:[]};var d,e,g,f,j=[],k;for(k in c){b=c[k];f=[];for(d in b)e=b[d],f.push(e.x+","+e.y);var m,n;n=f.slice(1).indexOf(f[0]);var o=this.Triangulate.area(b.slice(0,n+1))<0;e=[];for(n=-1;n<f.length;){m=n+1;n=f[m];n=f.slice(m+1).indexOf(n)+m;if(n<=m)break;var p=b.slice(m,n+1);o?this.Triangulate.area(p)<0?(m>0&&j.push({shape:g,holes:e}),g=p,e=[]):e.push(p):this.Triangulate.area(p)<0?(j.push({shape:p,holes:e}),e=[]):e.push(p);n++}o&&j.push({shape:g,holes:e})}var t,u,v,z,B,y;f=[];for(k=0;k<j.length;k++){m=
 j[k];g=m.shape;e=m.holes;for(o=0;o<e.length;o++){n=e[o];v=Number.POSITIVE_INFINITY;for(p=0;p<n.length;p++){B=n[p];for(d=0;d<g.length;d++)z=g[d],z=B.distanceTo(z),z<v&&(v=z,t=p,u=d)}d=u-1>=0?u-1:g.length-1;var p=t-1>=0?t-1:n.length-1,D=[];D.push(n[t]);D.push(g[u]);D.push(g[d]);v=this.Triangulate.area(D);var x=[];x.push(n[t]);x.push(n[p]);x.push(g[u]);B=this.Triangulate.area(x);z=u;y=t;u+=1;t+=-1;u<0&&(u+=g.length);u%=g.length;t<0&&(t+=n.length);t%=g.length;d=u-1>=0?u-1:g.length-1;p=t-1>=0?t-1:n.length-
@@ -462,7 +457,14 @@ d+e;m=c[b++]*d;p=c[b++]*d+e;t=c[b++]*d;if(f=g[g.length-1]){n=f.x;o=f.y;f=1;for(d
 B))}}}return{offset:z.ha*d,points:g}}}};
 (function(b){var c=function(b){for(var c=b.length,g=0,f=c-1,j=0;j<c;f=j++)g+=b[f].x*b[j].y-b[j].x*b[f].y;return g*0.5};b.Triangulate=function(b,e){var g=b.length;if(g<3)return null;var f=[],j=[],k=[],m,n,o;if(c(b)>0)for(n=0;n<g;n++)j[n]=n;else for(n=0;n<g;n++)j[n]=g-1-n;var p=2*g;for(n=g-1;g>2;){if(p--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return k;return f}m=n;g<=m&&(m=0);n=m+1;g<=n&&(n=0);o=n+1;g<=o&&(o=0);var t;a:{t=b;var u=m,v=n,z=o,B=g,y=j,D=void 0,x=void 0,H=void 0,
 F=void 0,A=void 0,O=void 0,C=void 0,L=void 0,G=void 0,x=t[y[u]].x,H=t[y[u]].y,F=t[y[v]].x,A=t[y[v]].y,O=t[y[z]].x,C=t[y[z]].y;if(1.0E-10>(F-x)*(C-H)-(A-H)*(O-x))t=!1;else{for(D=0;D<B;D++)if(!(D==u||D==v||D==z)){var L=t[y[D]].x,G=t[y[D]].y,S=void 0,h=void 0,U=void 0,Q=void 0,W=void 0,J=void 0,$=void 0,R=void 0,P=void 0,ga=void 0,V=void 0,da=void 0,S=U=W=void 0,S=O-F,h=C-A,U=x-O,Q=H-C,W=F-x,J=A-H,$=L-x,R=G-H,P=L-F,ga=G-A,V=L-O,da=G-C,S=S*ga-h*P,W=W*R-J*$,U=U*da-Q*V;if(S>=0&&U>=0&&W>=0){t=!1;break a}}t=
-!0}}if(t){p=j[m];t=j[n];u=j[o];f.push(b[p]);f.push(b[t]);f.push(b[u]);k.push([j[m],j[n],j[o]]);m=n;for(o=n+1;o<g;m++,o++)j[m]=j[o];g--;p=2*g}}if(e)return k;return f};b.Triangulate.area=c;return b})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.Loader=function(b){this.statusDomElement=(this.showStatus=b)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
+!0}}if(t){p=j[m];t=j[n];u=j[o];f.push(b[p]);f.push(b[t]);f.push(b[u]);k.push([j[m],j[n],j[o]]);m=n;for(o=n+1;o<g;m++,o++)j[m]=j[o];g--;p=2*g}}if(e)return k;return f};b.Triangulate.area=c;return b})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
+THREE.TorusGeometry=function(b,c,d,e){THREE.Geometry.call(this);this.radius=b||100;this.tube=c||40;this.segmentsR=d||8;this.segmentsT=e||6;b=[];for(c=0;c<=this.segmentsR;++c)for(d=0;d<=this.segmentsT;++d){var e=d/this.segmentsT*2*Math.PI,g=c/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(g))*Math.cos(e),(this.radius+this.tube*Math.cos(g))*Math.sin(e),this.tube*Math.sin(g))));b.push([d/this.segmentsT,1-c/this.segmentsR])}for(c=1;c<=this.segmentsR;++c)for(d=
+1;d<=this.segmentsT;++d){var e=(this.segmentsT+1)*c+d,g=(this.segmentsT+1)*c+d-1,f=(this.segmentsT+1)*(c-1)+d-1,j=(this.segmentsT+1)*(c-1)+d;this.faces.push(new THREE.Face4(e,g,f,j));this.faceVertexUvs[0].push([new THREE.UV(b[e][0],b[e][1]),new THREE.UV(b[g][0],b[g][1]),new THREE.UV(b[f][0],b[f][1]),new THREE.UV(b[j][0],b[j][1])])}delete b;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusGeometry.prototype=new THREE.Geometry;
+THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
+THREE.TorusKnotGeometry=function(b,c,d,e,g,f,j){function k(b,c,d,e,f,g){c=d/e*b;d=Math.cos(c);return new THREE.Vector3(f*(2+d)*0.5*Math.cos(b),f*(2+d)*Math.sin(b)*0.5,g*f*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=b||200;this.tube=c||40;this.segmentsR=d||64;this.segmentsT=e||8;this.p=g||2;this.q=f||3;this.heightScale=j||1;this.grid=Array(this.segmentsR);d=new THREE.Vector3;e=new THREE.Vector3;f=new THREE.Vector3;for(b=0;b<this.segmentsR;++b){this.grid[b]=Array(this.segmentsT);for(c=0;c<
+this.segmentsT;++c){var m=b/this.segmentsR*2*this.p*Math.PI,j=c/this.segmentsT*2*Math.PI,g=k(m,j,this.q,this.p,this.radius,this.heightScale),m=k(m+0.01,j,this.q,this.p,this.radius,this.heightScale);d.x=m.x-g.x;d.y=m.y-g.y;d.z=m.z-g.z;e.x=m.x+g.x;e.y=m.y+g.y;e.z=m.z+g.z;f.cross(d,e);e.cross(f,d);f.normalize();e.normalize();m=-this.tube*Math.cos(j);j=this.tube*Math.sin(j);g.x+=m*e.x+j*f.x;g.y+=m*e.y+j*f.y;g.z+=m*e.z+j*f.z;this.grid[b][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(g.x,g.y,
+g.z)))-1}}for(b=0;b<this.segmentsR;++b)for(c=0;c<this.segmentsT;++c){var e=(b+1)%this.segmentsR,f=(c+1)%this.segmentsT,g=this.grid[b][c],d=this.grid[e][c],e=this.grid[e][f],f=this.grid[b][f],j=new THREE.UV(b/this.segmentsR,c/this.segmentsT),m=new THREE.UV((b+1)/this.segmentsR,c/this.segmentsT),n=new THREE.UV((b+1)/this.segmentsR,(c+1)/this.segmentsT),o=new THREE.UV(b/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(g,d,e,f));this.faceVertexUvs[0].push([j,m,n,o])}this.computeCentroids();
+this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;THREE.Loader=function(b){this.statusDomElement=(this.showStatus=b)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={addStatusElement:function(){var b=document.createElement("div");b.style.position="absolute";b.style.right="0px";b.style.top="0px";b.style.fontSize="0.8em";b.style.textAlign="left";b.style.background="rgba(0,0,0,0.25)";b.style.color="#fff";b.style.width="120px";b.style.padding="0.5em 0.5em 0.5em 0.5em";b.style.zIndex=1E3;b.innerHTML="Loading ...";return b},updateProgress:function(b){var c="Loaded ";c+=b.total?(100*b.loaded/b.total).toFixed(0)+"%":(b.loaded/1E3).toFixed(2)+" KB";
 this.statusDomElement.innerHTML=c},extractUrlbase:function(b){b=b.split("/");b.pop();return b.join("/")},init_materials:function(b,c,d){b.materials=[];for(var e=0;e<c.length;++e)b.materials[e]=[THREE.Loader.prototype.createMaterial(c[e],d)]},createMaterial:function(b,c){function d(b){b=Math.log(b)/Math.LN2;return Math.floor(b)==b}function e(b,c){var e=new Image;e.onload=function(){if(!d(this.width)||!d(this.height)){var c=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),e=Math.pow(2,Math.round(Math.log(this.height)/
 Math.LN2));b.image.width=c;b.image.height=e;b.image.getContext("2d").drawImage(this,0,0,c,e)}else b.image=this;b.needsUpdate=!0};e.src=c}var g,f,j;g="MeshLambertMaterial";f={color:15658734,opacity:1,map:null,lightMap:null,wireframe:b.wireframe};b.shading&&(b.shading=="Phong"?g="MeshPhongMaterial":b.shading=="Basic"&&(g="MeshBasicMaterial"));if(b.blending)if(b.blending=="Additive")f.blending=THREE.AdditiveBlending;else if(b.blending=="Subtractive")f.blending=THREE.SubtractiveBlending;else if(b.blending==
@@ -558,8 +560,9 @@ e;if(d<c.min.z||d>c.max.z)return Number.MAX_VALUE;c.normal.set(0,k,0);break;case
 THREE.CollisionSystem.prototype.raySphere=function(b,c){var d=c.center.clone().subSelf(b.origin);if(d.lengthSq<c.radiusSq)return-1;var e=d.dot(b.direction.clone());if(e<=0)return Number.MAX_VALUE;d=c.radiusSq-(d.lengthSq()-e*e);if(d>=0)return Math.abs(e)-Math.sqrt(d);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4;
 THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(b){b.geometry.computeBoundingBox();var c=b.geometry.boundingBox,d=new THREE.Vector3(c.x[0],c.y[0],c.z[0]),c=new THREE.Vector3(c.x[1],c.y[1],c.z[1]),d=new THREE.BoxCollider(d,c);d.mesh=b;return d};THREE.CollisionUtils.MeshAABB=function(b){var c=THREE.CollisionUtils.MeshOBB(b);c.min.addSelf(b.position);c.max.addSelf(b.position);c.dynamic=!1;return c};
 THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))};
-THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,d=this.setSize,e=this.render,g=new THREE.Camera,f=new THREE.Camera,b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},j=new THREE.WebGLRenderTarget(512,512,b),k=new THREE.WebGLRenderTarget(512,512,b),m=new THREE.Camera(53,1,1,1E4);m.position.z=2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:j},mapRight:{type:"t",value:1,texture:k}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
-fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});var n=new THREE.Scene;n.addObject(new THREE.Mesh(new THREE.Plane(2,2),_material));this.setSize=function(b,e){d.call(c,b,e);j.width=b;j.height=e;k.width=b;k.height=e};this.render=
-function(b,d){g.projectionMatrix=d.projectionMatrix;g.position.copy(d.position);g.target.position.copy(d.target.position);g.translateX(-10);f.projectionMatrix=d.projectionMatrix;f.position.copy(d.position);f.target.position.copy(d.target.position);f.translateX(10);e.call(c,b,g,j,!0);e.call(c,b,f,k,!0);e.call(c,n,m)}};THREE.AnaglyphWebGLRenderer.prototype=new THREE.WebGLRenderer;THREE.AnaglyphWebGLRenderer.prototype.constructor=THREE.AnaglyphWebGLRenderer;
-THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,d=this.setSize,e=this.render,g,f,j=new THREE.Camera,k=new THREE.Camera;c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(b,e){d.call(c,b,e);g=b/2;f=e};this.render=function(b,d){this.clear();j.fov=d.fov;j.aspect=0.5*d.aspect;j.near=d.near;j.far=d.far;j.updateProjectionMatrix();
-j.position.copy(d.position);j.target.position.copy(d.target.position);j.translateX(c.separation);k.projectionMatrix=j.projectionMatrix;k.position.copy(d.position);k.target.position.copy(d.target.position);k.translateX(-c.separation);this.setViewport(0,0,g,f);e.call(c,b,j);this.setViewport(g,0,g,f);e.call(c,b,k,!1)}};THREE.CrosseyedWebGLRenderer.prototype=new THREE.WebGLRenderer;THREE.CrosseyedWebGLRenderer.prototype.constructor=THREE.CrosseyedWebGLRenderer;
+if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,d=this.setSize,e=this.render,g=new THREE.Camera,f=new THREE.Camera,b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},j=new THREE.WebGLRenderTarget(512,512,b),k=new THREE.WebGLRenderTarget(512,512,b),m=new THREE.Camera(53,1,1,1E4);m.position.z=2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:j},mapRight:{type:"t",value:1,
+texture:k}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});var n=
+new THREE.Scene;n.addObject(new THREE.Mesh(new THREE.Plane(2,2),_material));this.setSize=function(b,e){d.call(c,b,e);j.width=b;j.height=e;k.width=b;k.height=e};this.render=function(b,d){g.projectionMatrix=d.projectionMatrix;g.position.copy(d.position);g.target.position.copy(d.target.position);g.translateX(-10);f.projectionMatrix=d.projectionMatrix;f.position.copy(d.position);f.target.position.copy(d.target.position);f.translateX(10);e.call(c,b,g,j,!0);e.call(c,b,f,k,!0);e.call(c,n,m)}},THREE.AnaglyphWebGLRenderer.prototype=
+new THREE.WebGLRenderer,THREE.AnaglyphWebGLRenderer.prototype.constructor=THREE.AnaglyphWebGLRenderer;
+if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,d=this.setSize,e=this.render,g,f,j=new THREE.Camera,k=new THREE.Camera;c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(b,e){d.call(c,b,e);g=b/2;f=e};this.render=function(b,d){this.clear();j.fov=d.fov;j.aspect=0.5*d.aspect;j.near=d.near;j.far=d.far;
+j.updateProjectionMatrix();j.position.copy(d.position);j.target.position.copy(d.target.position);j.translateX(c.separation);k.projectionMatrix=j.projectionMatrix;k.position.copy(d.position);k.target.position.copy(d.target.position);k.translateX(-c.separation);this.setViewport(0,0,g,f);e.call(c,b,j);this.setViewport(g,0,g,f);e.call(c,b,k,!1)}},THREE.CrosseyedWebGLRenderer.prototype=new THREE.WebGLRenderer,THREE.CrosseyedWebGLRenderer.prototype.constructor=THREE.CrosseyedWebGLRenderer;

+ 1 - 1
build/custom/ThreeCanvas.js

@@ -51,7 +51,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
 d;this.z=a.z*d;this.w=Math.cos(c);return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
 multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,j=this.w,k=j*c+f*e-h*d,m=
 j*d+h*c-g*e,p=j*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=k*j+c*-g+m*-h-p*-f;b.y=m*j+c*-f+p*-g-k*-h;b.z=p*j+c*-h+k*-f-m*-g;return b}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.001)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};

+ 1 - 1
build/custom/ThreeDOM.js

@@ -51,7 +51,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
 d;this.z=a.z*d;this.w=Math.cos(c);return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
 multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,i=this.w,k=i*c+f*e-h*d,l=
 i*d+h*c-g*e,n=i*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=k*i+c*-g+l*-h-n*-f;b.y=l*i+c*-f+n*-g-k*-h;b.z=n*i+c*-h+k*-f-l*-g;return b}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.001)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=d||2E3;this.target=e||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;

+ 38 - 35
build/custom/ThreeExtras.js

@@ -35,7 +35,7 @@ this.getPrevKeyWith("pos",o,g.index-1).pos,this.points[1]=e,this.points[2]=f,thi
 THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],e,f,g,j,h,k;e=(a.length-1)*b;f=Math.floor(e);e-=f;c[0]=f==0?f:f-1;c[1]=f;c[2]=f>a.length-2?f:f+1;c[3]=f>a.length-3?f:f+2;f=a[c[0]];j=a[c[1]];h=a[c[2]];k=a[c[3]];c=e*e;g=e*c;d[0]=this.interpolate(f[0],j[0],h[0],k[0],e,c,g);d[1]=this.interpolate(f[1],j[1],h[1],k[1],e,c,g);d[2]=this.interpolate(f[2],j[2],h[2],k[2],e,c,g);return d};
 THREE.Animation.prototype.interpolate=function(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c<d.length-1?c:d.length-1:c%=d.length;c<d.length;c++)if(d[c][a]!==void 0)return d[c];return this.data.hierarchy[b].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+d.length;c>=0;c--)if(d[c][a]!==void 0)return d[c];return this.data.hierarchy[b].keys[d.length-1]};
-THREE.QuakeCamera=function(a){function b(a,b){return function(){b.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=
+THREE.QuakeCamera=function(a){function b(a,b){return function(){b.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=
 a.movementSpeed;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.noFly!==void 0)this.noFly=a.noFly;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.autoForward!==void 0)this.autoForward=a.autoForward;if(a.activeLook!==void 0)this.activeLook=a.activeLook;if(a.heightSpeed!==void 0)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==void 0)this.heightCoef=a.heightCoef;if(a.heightMin!==void 0)this.heightMin=a.heightMin;if(a.heightMax!==void 0)this.heightMax=a.heightMax;if(a.constrainVertical!==
 void 0)this.constrainVertical=a.constrainVertical;if(a.verticalMin!==void 0)this.verticalMin=a.verticalMin;if(a.verticalMax!==void 0)this.verticalMax=a.verticalMax;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(a){a.preventDefault();
 a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.mouseX=a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.onKeyDown=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=
@@ -47,7 +47,7 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
 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(a,c,b,d){var f={name:b,fps:0.6,length:d,hierarchy:[]},e,g=c.getControlPointsArray(),j=c.getLength(),h=g.length,w=0;e=h-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[e]={time:d,pos:g[e],rot:[0,0,0,1],scl:[1,1,1]};for(e=1;e<h-1;e++)w=d*j.chunks[e]/j.total,c.keys[e]={time:w,pos:g[e]};f.hierarchy[0]=c;THREE.AnimationHandler.add(f);return new THREE.Animation(a,b,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function c(a,c){var b,
 d,f=new THREE.Geometry;for(b=0;b<a.points.length*c;b++)d=b/(a.points.length*c),d=a.getPoint(d),f.vertices[b]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return f}function d(a,b){var d=c(b,10),f=c(b,10),e=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(d,e);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.addChild(lineObj);particleObj.scale.set(1,1,1);a.addChild(particleObj);f=new THREE.Sphere(1,
-16,8);e=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<b.points.length;i++)d=new THREE.Mesh(f,e),d.position.copy(b.points[i]),d.updateMatrix(),a.addChild(d)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookHorizontal=
+16,8);e=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<b.points.length;i++)d=new THREE.Mesh(f,e),d.position.copy(b.points[i]),d.updateMatrix(),a.addChild(d)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=
 this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(a){if(a.duration!==void 0)this.duration=a.duration*1E3;if(a.waypoints!==void 0)this.waypoints=a.waypoints;if(a.useConstantSpeed!==void 0)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==void 0)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==void 0)this.createDebugPath=a.createDebugPath;if(a.createDebugDummy!==
 void 0)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==void 0)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==void 0)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==void 0)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
 window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var e=Math.PI*2,f=Math.PI/180;this.update=function(a,c,b){var d,g;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)*f;this.theta=this.lon*f;d=this.phi%e;this.phi=d>=0?d:d+e;d=this.verticalAngleMap.srcRange;g=this.verticalAngleMap.dstRange;var j=g[1]-g[0];this.phi=
@@ -55,7 +55,7 @@ TWEEN.Easing.Quadratic.EaseInOut(((this.phi-d[0])*(g[1]-g[0])/(d[1]-d[0])+g[0]-g
 a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),g=new THREE.MeshLambertMaterial({color:65280}),j=new THREE.Cube(10,10,20),h=new THREE.Cube(2,2,10);this.animationParent=new THREE.Mesh(j,a);a=new THREE.Mesh(h,g);a.position.set(0,10,0);this.animation=b(this.animationParent,
 this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else this.animation=b(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&d(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(a,c){return function(){c.apply(a,arguments)}}(this,this.onMouseMove),!1)};
 THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
-THREE.FlyCamera=function(a){function b(a,b){return function(){b.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.domElement=document;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=a.movementSpeed;if(a.rollSpeed!==void 0)this.rollSpeed=a.rollSpeed;if(a.dragToLook!==void 0)this.dragToLook=a.dragToLook;if(a.autoForward!==void 0)this.autoForward=
+THREE.FlyCamera=function(a){function b(a,b){return function(){b.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.domElement=document;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=a.movementSpeed;if(a.rollSpeed!==void 0)this.rollSpeed=a.rollSpeed;if(a.dragToLook!==void 0)this.dragToLook=a.dragToLook;if(a.autoForward!==void 0)this.autoForward=
 a.autoForward;if(a.domElement!==void 0)this.domElement=a.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(a){if(typeof this[a.type]=="function")this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=
 0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
 this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;
@@ -83,32 +83,27 @@ b(this,function(a){c&&(f=g=this.getMouseProjectionOnBall(a.clientX,a.clientY),j=
 a.stopPropagation();if(d===this.STATE.NONE)d=a.button,d===this.STATE.ROTATE?f=g=this.getMouseProjectionOnBall(a.clientX,a.clientY):d===this.STATE.ZOOM&&!this.noZoom?j=h=this.getMouseOnScreen(a.clientX,a.clientY):this.noPan||(k=l=this.getMouseOnScreen(a.clientX,a.clientY))}),!1);this.domElement.addEventListener("mouseup",b(this,function(a){a.preventDefault();a.stopPropagation();d=this.STATE.NONE}),!1);window.addEventListener("keydown",b(this,function(a){if(d===this.STATE.NONE){if(a.keyCode===this.keys[this.STATE.ROTATE])d=
 this.STATE.ROTATE;else if(a.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)d=this.STATE.ZOOM;else if(a.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)d=this.STATE.PAN;d!==this.STATE.NONE&&(c=!0)}}),!1);window.addEventListener("keyup",b(this,function(){if(d!==this.STATE.NONE)d=this.STATE.NONE}),!1)};THREE.TrackballCamera.prototype=new THREE.Camera;THREE.TrackballCamera.prototype.constructor=THREE.TrackballCamera;THREE.TrackballCamera.prototype.supr=THREE.Camera.prototype;
 THREE.TrackballCamera.prototype.STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2};
-THREE.Cube=function(a,b,c,d,e,f,g,j,h){function k(a,c,b,g,j,h,k,m){var o,n,t=d||1,v=e||1,L=j/2,G=h/2,M=l.vertices.length;if(a=="x"&&c=="y"||a=="y"&&c=="x")o="z";else if(a=="x"&&c=="z"||a=="z"&&c=="x")o="y",v=f||1;else if(a=="z"&&c=="y"||a=="y"&&c=="z")o="x",t=f||1;var H=t+1,A=v+1;j/=t;var I=h/v;for(n=0;n<A;n++)for(h=0;h<H;h++){var K=new THREE.Vector3;K[a]=(h*j-L)*b;K[c]=(n*I-G)*g;K[o]=k;l.vertices.push(new THREE.Vertex(K))}for(n=0;n<v;n++)for(h=0;h<t;h++)l.faces.push(new THREE.Face4(h+H*n+M,h+H*(n+
-1)+M,h+1+H*(n+1)+M,h+1+H*n+M,null,null,m)),l.faceVertexUvs[0].push([new THREE.UV(h/t,n/v),new THREE.UV(h/t,(n+1)/v),new THREE.UV((h+1)/t,(n+1)/v),new THREE.UV((h+1)/t,n/v)])}THREE.Geometry.call(this);var l=this,m=a/2,n=b/2,o=c/2,j=j?-1:1;if(g!==void 0)if(g instanceof Array)this.materials=g;else{this.materials=[];for(var t=0;t<6;t++)this.materials.push([g])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(h!=void 0)for(var v in h)this.sides[v]!=void 0&&(this.sides[v]=h[v]);
-this.sides.px&&k("z","y",1*j,-1,c,b,-m,this.materials[0]);this.sides.nx&&k("z","y",-1*j,-1,c,b,m,this.materials[1]);this.sides.py&&k("x","z",1*j,1,a,c,n,this.materials[2]);this.sides.ny&&k("x","z",1*j,-1,a,c,-n,this.materials[3]);this.sides.pz&&k("x","y",1*j,-1,a,b,o,this.materials[4]);this.sides.nz&&k("x","y",-1*j,-1,a,b,-o,this.materials[5]);(function(){for(var a=[],c=[],b=0,d=l.vertices.length;b<d;b++){for(var f=l.vertices[b],e=!1,g=0,j=a.length;g<j;g++){var h=a[g];if(f.position.x==h.position.x&&
-f.position.y==h.position.y&&f.position.z==h.position.z){c[b]=g;e=!0;break}}if(!e)c[b]=a.length,a.push(new THREE.Vertex(f.position.clone()))}b=0;for(d=l.faces.length;b<d;b++)f=l.faces[b],f.a=c[f.a],f.b=c[f.b],f.c=c[f.c],f.d=c[f.d];l.vertices=a})();this.computeCentroids();this.computeFaceNormals()};THREE.Cube.prototype=new THREE.Geometry;THREE.Cube.prototype.constructor=THREE.Cube;
-THREE.Cylinder=function(a,b,c,d,e,f){function g(a,c,b){j.vertices.push(new THREE.Vertex(new THREE.Vector3(a,c,b)))}THREE.Geometry.call(this);var j=this,h,k=Math.PI*2,l=d/2;for(h=0;h<a;h++)g(Math.sin(k*h/a)*b,Math.cos(k*h/a)*b,-l);for(h=0;h<a;h++)g(Math.sin(k*h/a)*c,Math.cos(k*h/a)*c,l);for(h=0;h<a;h++)j.faces.push(new THREE.Face4(h,h+a,a+(h+1)%a,(h+1)%a));if(c>0){g(0,0,-l-(f||0));for(h=a;h<a+a/2;h++)j.faces.push(new THREE.Face4(2*a,(2*h-2*a)%a,(2*h-2*a+1)%a,(2*h-2*a+2)%a))}if(b>0){g(0,0,l+(e||0));
-for(h=a+a/2;h<2*a;h++)j.faces.push(new THREE.Face4(2*a+1,(2*h-2*a+2)%a+a,(2*h-2*a+1)%a+a,(2*h-2*a)%a+a))}h=0;for(a=this.faces.length;h<a;h++){var b=[],c=this.faces[h],e=this.vertices[c.a],f=this.vertices[c.b],l=this.vertices[c.c],m=this.vertices[c.d];b.push(new THREE.UV(0.5+Math.atan2(e.position.x,e.position.y)/k,0.5+e.position.z/d));b.push(new THREE.UV(0.5+Math.atan2(f.position.x,f.position.y)/k,0.5+f.position.z/d));b.push(new THREE.UV(0.5+Math.atan2(l.position.x,l.position.y)/k,0.5+l.position.z/
-d));c instanceof THREE.Face4&&b.push(new THREE.UV(0.5+Math.atan2(m.position.x,m.position.y)/k,0.5+m.position.z/d));this.faceVertexUvs[0].push(b)}this.computeCentroids();this.computeFaceNormals()};THREE.Cylinder.prototype=new THREE.Geometry;THREE.Cylinder.prototype.constructor=THREE.Cylinder;
-THREE.Icosahedron=function(a){function b(a,c,b){var d=Math.sqrt(a*a+c*c+b*b);return e.vertices.push(new THREE.Vertex(new THREE.Vector3(a/d,c/d,b/d)))-1}function c(a,c,b,d){d.faces.push(new THREE.Face3(a,c,b))}function d(a,c){var d=e.vertices[a].position,f=e.vertices[c].position;return b((d.x+f.x)/2,(d.y+f.y)/2,(d.z+f.z)/2)}var e=this,f=new THREE.Geometry,g;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;b(-1,a,0);b(1,a,0);b(-1,-a,0);b(1,-a,0);b(0,-1,a);b(0,1,a);b(0,-1,-a);b(0,
-1,-a);b(a,0,-1);b(a,0,1);b(-a,0,-1);b(-a,0,1);c(0,11,5,f);c(0,5,1,f);c(0,1,7,f);c(0,7,10,f);c(0,10,11,f);c(1,5,9,f);c(5,11,4,f);c(11,10,2,f);c(10,7,6,f);c(7,1,8,f);c(3,9,4,f);c(3,4,2,f);c(3,2,6,f);c(3,6,8,f);c(3,8,9,f);c(4,9,5,f);c(2,4,11,f);c(6,2,10,f);c(8,6,7,f);c(9,8,1,f);for(a=0;a<this.subdivisions;a++){g=new THREE.Geometry;for(var j in f.faces){var h=d(f.faces[j].a,f.faces[j].b),k=d(f.faces[j].b,f.faces[j].c),l=d(f.faces[j].c,f.faces[j].a);c(f.faces[j].a,h,l,g);c(f.faces[j].b,k,h,g);c(f.faces[j].c,
-l,k,g);c(h,k,l,g)}f.faces=g.faces}e.faces=f.faces;delete f;delete g;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Icosahedron.prototype=new THREE.Geometry;THREE.Icosahedron.prototype.constructor=THREE.Icosahedron;
-THREE.Lathe=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],e=[],f=[],g=(new THREE.Matrix4).setRotationZ(b),j=0;j<a.length;j++)this.vertices.push(new THREE.Vertex(a[j])),c[j]=a[j].clone(),d[j]=this.vertices.length-1;for(var h=0;h<=this.angle+0.0010;h+=b){for(j=0;j<c.length;j++)h<this.angle?(c[j]=g.multiplyVector3(c[j].clone()),this.vertices.push(new THREE.Vertex(c[j])),e[j]=this.vertices.length-1):e=f;h==0&&(f=d);for(j=0;j<
-d.length-1;j++)this.faces.push(new THREE.Face4(e[j],e[j+1],d[j+1],d[j])),this.faceVertexUvs[0].push([new THREE.UV(1-h/this.angle,j/a.length),new THREE.UV(1-h/this.angle,(j+1)/a.length),new THREE.UV(1-(h-b)/this.angle,(j+1)/a.length),new THREE.UV(1-(h-b)/this.angle,j/a.length)]);d=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Lathe.prototype=new THREE.Geometry;THREE.Lathe.prototype.constructor=THREE.Lathe;
-THREE.Plane=function(a,b,c,d){THREE.Geometry.call(this);var e,f=a/2,g=b/2,c=c||1,d=d||1,j=c+1,h=d+1;a/=c;var k=b/d;for(e=0;e<h;e++)for(b=0;b<j;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*a-f,-(e*k-g),0)));for(e=0;e<d;e++)for(b=0;b<c;b++)this.faces.push(new THREE.Face4(b+j*e,b+j*(e+1),b+1+j*(e+1),b+1+j*e)),this.faceVertexUvs[0].push([new THREE.UV(b/c,e/d),new THREE.UV(b/c,(e+1)/d),new THREE.UV((b+1)/c,(e+1)/d),new THREE.UV((b+1)/c,e/d)]);this.computeCentroids();this.computeFaceNormals()};
-THREE.Plane.prototype=new THREE.Geometry;THREE.Plane.prototype.constructor=THREE.Plane;
-THREE.Sphere=function(a,b,c){THREE.Geometry.call(this);for(var d,e=Math.PI,f=Math.max(3,b||8),g=Math.max(2,c||6),b=[],c=0;c<g+1;c++){d=c/g;var j=a*Math.cos(d*e),h=a*Math.sin(d*e),k=[],l=0;for(d=0;d<f;d++){var m=2*d/f,n=h*Math.sin(m*e),m=h*Math.cos(m*e);(c==0||c==g)&&d>0||(l=this.vertices.push(new THREE.Vertex(new THREE.Vector3(m,j,n)))-1);k.push(l)}b.push(k)}for(var o,t,v,e=b.length,c=0;c<e;c++)if(f=b[c].length,c>0)for(d=0;d<f;d++){k=d==f-1;g=b[c][k?0:d+1];j=b[c][k?f-1:d];h=b[c-1][k?f-1:d];k=b[c-
-1][k?0:d+1];n=c/(e-1);o=(c-1)/(e-1);t=(d+1)/f;var m=d/f,l=new THREE.UV(1-t,n),n=new THREE.UV(1-m,n),m=new THREE.UV(1-m,o),u=new THREE.UV(1-t,o);c<b.length-1&&(o=this.vertices[g].position.clone(),t=this.vertices[j].position.clone(),v=this.vertices[h].position.clone(),o.normalize(),t.normalize(),v.normalize(),this.faces.push(new THREE.Face3(g,j,h,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([l,n,m]));c>1&&(o=this.vertices[g].position.clone(),
-t=this.vertices[h].position.clone(),v=this.vertices[k].position.clone(),o.normalize(),t.normalize(),v.normalize(),this.faces.push(new THREE.Face3(g,h,k,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([l,m,u]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.Sphere.prototype=new THREE.Geometry;THREE.Sphere.prototype.constructor=THREE.Sphere;
-THREE.Torus=function(a,b,c,d){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=d||6;a=[];for(b=0;b<=this.segmentsR;++b)for(c=0;c<=this.segmentsT;++c){var d=c/this.segmentsT*2*Math.PI,e=b/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(e))*Math.cos(d),(this.radius+this.tube*Math.cos(e))*Math.sin(d),this.tube*Math.sin(e))));a.push([c/this.segmentsT,1-b/this.segmentsR])}for(b=1;b<=this.segmentsR;++b)for(c=
-1;c<=this.segmentsT;++c){var d=(this.segmentsT+1)*b+c,e=(this.segmentsT+1)*b+c-1,f=(this.segmentsT+1)*(b-1)+c-1,g=(this.segmentsT+1)*(b-1)+c;this.faces.push(new THREE.Face4(d,e,f,g));this.faceVertexUvs[0].push([new THREE.UV(a[d][0],a[d][1]),new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[g][0],a[g][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Torus.prototype=new THREE.Geometry;THREE.Torus.prototype.constructor=THREE.Torus;
-THREE.TorusKnot=function(a,b,c,d,e,f,g){function j(a,c,b,d,f,e){c=b/d*a;b=Math.cos(c);return new THREE.Vector3(f*(2+b)*0.5*Math.cos(a),f*(2+b)*Math.sin(a)*0.5,e*f*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=a||200;this.tube=b||40;this.segmentsR=c||64;this.segmentsT=d||8;this.p=e||2;this.q=f||3;this.heightScale=g||1;this.grid=Array(this.segmentsR);c=new THREE.Vector3;d=new THREE.Vector3;f=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=Array(this.segmentsT);for(b=0;b<this.segmentsT;++b){var h=
-a/this.segmentsR*2*this.p*Math.PI,g=b/this.segmentsT*2*Math.PI,e=j(h,g,this.q,this.p,this.radius,this.heightScale),h=j(h+0.01,g,this.q,this.p,this.radius,this.heightScale);c.x=h.x-e.x;c.y=h.y-e.y;c.z=h.z-e.z;d.x=h.x+e.x;d.y=h.y+e.y;d.z=h.z+e.z;f.cross(c,d);d.cross(f,c);f.normalize();d.normalize();h=-this.tube*Math.cos(g);g=this.tube*Math.sin(g);e.x+=h*d.x+g*f.x;e.y+=h*d.y+g*f.y;e.z+=h*d.z+g*f.z;this.grid[a][b]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z)))-1}}for(a=0;a<this.segmentsR;++a)for(b=
-0;b<this.segmentsT;++b){var d=(a+1)%this.segmentsR,f=(b+1)%this.segmentsT,e=this.grid[a][b],c=this.grid[d][b],d=this.grid[d][f],f=this.grid[a][f],g=new THREE.UV(a/this.segmentsR,b/this.segmentsT),h=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT),k=new THREE.UV((a+1)/this.segmentsR,(b+1)/this.segmentsT),l=new THREE.UV(a/this.segmentsR,(b+1)/this.segmentsT);this.faces.push(new THREE.Face4(e,c,d,f));this.faceVertexUvs[0].push([g,h,k,l])}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};
-THREE.TorusKnot.prototype=new THREE.Geometry;THREE.TorusKnot.prototype.constructor=THREE.TorusKnot;THREE.Text=function(a,b){THREE.Geometry.call(this);this.parameters=b||{};this.set(a)};THREE.Text.prototype=new THREE.Geometry;THREE.Text.prototype.constructor=THREE.Text;
-THREE.Text.prototype.set=function(a,b){this.text=a;var b=b||this.parameters,c=b.height!==void 0?b.height:50,d=b.curveSegments!==void 0?b.curveSegments:4,e=b.font!==void 0?b.font:"helvetiker",f=b.weight!==void 0?b.weight:"normal",g=b.style!==void 0?b.style:"normal";THREE.FontUtils.size=b.size!==void 0?b.size:100;THREE.FontUtils.divisions=d;THREE.FontUtils.face=e;THREE.FontUtils.weight=f;THREE.FontUtils.style=g;var e=THREE.FontUtils.drawText(a),d=e.points,j=e.faces,e=e.contour;this.vertices=[];this.faces=
-[];for(var h,g=d.length,k=j.length,f=0;f<g;f++)h=d[f],this.vertices.push(new THREE.Vertex(new THREE.Vector3(h.x,h.y,0)));for(f=0;f<g;f++)h=d[f],this.vertices.push(new THREE.Vertex(new THREE.Vector3(h.x,h.y,c)));for(f=0;f<k;f++)c=j[f],this.faces.push(new THREE.Face3(c[2],c[1],c[0]));for(f=0;f<k;f++)c=j[f],this.faces.push(new THREE.Face3(c[0]+g,c[1]+g,c[2]+g));for(var f=e.length,l;--f>0;){if(l){if(l.equals(e[f])){l=null;continue}}else l=e[f];for(c=0;c<g;c++)if(d[c].equals(e[f]))break;for(j=0;j<g;j++)if(d[j].equals(e[f-
-1]))break;this.faces.push(new THREE.Face4(c,j,j+g,c+g))}this.computeCentroids();this.computeFaceNormals()};
+THREE.CubeGeometry=function(a,b,c,d,e,f,g,j,h){function k(a,c,b,g,j,h,k,m){var o,n,t=d||1,v=e||1,L=j/2,G=h/2,M=l.vertices.length;if(a=="x"&&c=="y"||a=="y"&&c=="x")o="z";else if(a=="x"&&c=="z"||a=="z"&&c=="x")o="y",v=f||1;else if(a=="z"&&c=="y"||a=="y"&&c=="z")o="x",t=f||1;var H=t+1,A=v+1;j/=t;var I=h/v;for(n=0;n<A;n++)for(h=0;h<H;h++){var K=new THREE.Vector3;K[a]=(h*j-L)*b;K[c]=(n*I-G)*g;K[o]=k;l.vertices.push(new THREE.Vertex(K))}for(n=0;n<v;n++)for(h=0;h<t;h++)l.faces.push(new THREE.Face4(h+H*n+
+M,h+H*(n+1)+M,h+1+H*(n+1)+M,h+1+H*n+M,null,null,m)),l.faceVertexUvs[0].push([new THREE.UV(h/t,n/v),new THREE.UV(h/t,(n+1)/v),new THREE.UV((h+1)/t,(n+1)/v),new THREE.UV((h+1)/t,n/v)])}THREE.Geometry.call(this);var l=this,m=a/2,n=b/2,o=c/2,j=j?-1:1;if(g!==void 0)if(g instanceof Array)this.materials=g;else{this.materials=[];for(var t=0;t<6;t++)this.materials.push([g])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(h!=void 0)for(var v in h)this.sides[v]!=void 0&&(this.sides[v]=
+h[v]);this.sides.px&&k("z","y",1*j,-1,c,b,-m,this.materials[0]);this.sides.nx&&k("z","y",-1*j,-1,c,b,m,this.materials[1]);this.sides.py&&k("x","z",1*j,1,a,c,n,this.materials[2]);this.sides.ny&&k("x","z",1*j,-1,a,c,-n,this.materials[3]);this.sides.pz&&k("x","y",1*j,-1,a,b,o,this.materials[4]);this.sides.nz&&k("x","y",-1*j,-1,a,b,-o,this.materials[5]);(function(){for(var a=[],c=[],b=0,d=l.vertices.length;b<d;b++){for(var f=l.vertices[b],e=!1,g=0,j=a.length;g<j;g++){var h=a[g];if(f.position.x==h.position.x&&
+f.position.y==h.position.y&&f.position.z==h.position.z){c[b]=g;e=!0;break}}if(!e)c[b]=a.length,a.push(new THREE.Vertex(f.position.clone()))}b=0;for(d=l.faces.length;b<d;b++)f=l.faces[b],f.a=c[f.a],f.b=c[f.b],f.c=c[f.c],f.d=c[f.d];l.vertices=a})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
+THREE.CylinderGeometry=function(a,b,c,d,e,f){function g(a,c,b){j.vertices.push(new THREE.Vertex(new THREE.Vector3(a,c,b)))}THREE.Geometry.call(this);var j=this,h,k=Math.PI*2,l=d/2;for(h=0;h<a;h++)g(Math.sin(k*h/a)*b,Math.cos(k*h/a)*b,-l);for(h=0;h<a;h++)g(Math.sin(k*h/a)*c,Math.cos(k*h/a)*c,l);for(h=0;h<a;h++)j.faces.push(new THREE.Face4(h,h+a,a+(h+1)%a,(h+1)%a));if(c>0){g(0,0,-l-(f||0));for(h=a;h<a+a/2;h++)j.faces.push(new THREE.Face4(2*a,(2*h-2*a)%a,(2*h-2*a+1)%a,(2*h-2*a+2)%a))}if(b>0){g(0,0,l+
+(e||0));for(h=a+a/2;h<2*a;h++)j.faces.push(new THREE.Face4(2*a+1,(2*h-2*a+2)%a+a,(2*h-2*a+1)%a+a,(2*h-2*a)%a+a))}h=0;for(a=this.faces.length;h<a;h++){var b=[],c=this.faces[h],e=this.vertices[c.a],f=this.vertices[c.b],l=this.vertices[c.c],m=this.vertices[c.d];b.push(new THREE.UV(0.5+Math.atan2(e.position.x,e.position.y)/k,0.5+e.position.z/d));b.push(new THREE.UV(0.5+Math.atan2(f.position.x,f.position.y)/k,0.5+f.position.z/d));b.push(new THREE.UV(0.5+Math.atan2(l.position.x,l.position.y)/k,0.5+l.position.z/
+d));c instanceof THREE.Face4&&b.push(new THREE.UV(0.5+Math.atan2(m.position.x,m.position.y)/k,0.5+m.position.z/d));this.faceVertexUvs[0].push(b)}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
+THREE.IcosahedronGeometry=function(a){function b(a,c,b){var d=Math.sqrt(a*a+c*c+b*b);return e.vertices.push(new THREE.Vertex(new THREE.Vector3(a/d,c/d,b/d)))-1}function c(a,c,b,d){d.faces.push(new THREE.Face3(a,c,b))}function d(a,c){var d=e.vertices[a].position,f=e.vertices[c].position;return b((d.x+f.x)/2,(d.y+f.y)/2,(d.z+f.z)/2)}var e=this,f=new THREE.Geometry,g;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;b(-1,a,0);b(1,a,0);b(-1,-a,0);b(1,-a,0);b(0,-1,a);b(0,1,a);b(0,-1,
+-a);b(0,1,-a);b(a,0,-1);b(a,0,1);b(-a,0,-1);b(-a,0,1);c(0,11,5,f);c(0,5,1,f);c(0,1,7,f);c(0,7,10,f);c(0,10,11,f);c(1,5,9,f);c(5,11,4,f);c(11,10,2,f);c(10,7,6,f);c(7,1,8,f);c(3,9,4,f);c(3,4,2,f);c(3,2,6,f);c(3,6,8,f);c(3,8,9,f);c(4,9,5,f);c(2,4,11,f);c(6,2,10,f);c(8,6,7,f);c(9,8,1,f);for(a=0;a<this.subdivisions;a++){g=new THREE.Geometry;for(var j in f.faces){var h=d(f.faces[j].a,f.faces[j].b),k=d(f.faces[j].b,f.faces[j].c),l=d(f.faces[j].c,f.faces[j].a);c(f.faces[j].a,h,l,g);c(f.faces[j].b,k,h,g);
+c(f.faces[j].c,l,k,g);c(h,k,l,g)}f.faces=g.faces}e.faces=f.faces;delete f;delete g;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
+THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],e=[],f=[],g=(new THREE.Matrix4).setRotationZ(b),j=0;j<a.length;j++)this.vertices.push(new THREE.Vertex(a[j])),c[j]=a[j].clone(),d[j]=this.vertices.length-1;for(var h=0;h<=this.angle+0.001;h+=b){for(j=0;j<c.length;j++)h<this.angle?(c[j]=g.multiplyVector3(c[j].clone()),this.vertices.push(new THREE.Vertex(c[j])),e[j]=this.vertices.length-1):e=f;h==0&&(f=d);
+for(j=0;j<d.length-1;j++)this.faces.push(new THREE.Face4(e[j],e[j+1],d[j+1],d[j])),this.faceVertexUvs[0].push([new THREE.UV(1-h/this.angle,j/a.length),new THREE.UV(1-h/this.angle,(j+1)/a.length),new THREE.UV(1-(h-b)/this.angle,(j+1)/a.length),new THREE.UV(1-(h-b)/this.angle,j/a.length)]);d=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);var e,f=a/2,g=b/2,c=c||1,d=d||1,j=c+1,h=d+1;a/=c;var k=b/d;for(e=0;e<h;e++)for(b=0;b<j;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*a-f,-(e*k-g),0)));for(e=0;e<d;e++)for(b=0;b<c;b++)this.faces.push(new THREE.Face4(b+j*e,b+j*(e+1),b+1+j*(e+1),b+1+j*e)),this.faceVertexUvs[0].push([new THREE.UV(b/c,e/d),new THREE.UV(b/c,(e+1)/d),new THREE.UV((b+1)/c,(e+1)/d),new THREE.UV((b+1)/c,e/d)]);this.computeCentroids();this.computeFaceNormals()};
+THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
+THREE.SphereGeometry=function(a,b,c){THREE.Geometry.call(this);for(var a=a||50,d,e=Math.PI,f=Math.max(3,b||8),g=Math.max(2,c||6),b=[],c=0;c<g+1;c++){d=c/g;var j=a*Math.cos(d*e),h=a*Math.sin(d*e),k=[],l=0;for(d=0;d<f;d++){var m=2*d/f,n=h*Math.sin(m*e),m=h*Math.cos(m*e);(c==0||c==g)&&d>0||(l=this.vertices.push(new THREE.Vertex(new THREE.Vector3(m,j,n)))-1);k.push(l)}b.push(k)}for(var o,t,v,e=b.length,c=0;c<e;c++)if(f=b[c].length,c>0)for(d=0;d<f;d++){k=d==f-1;g=b[c][k?0:d+1];j=b[c][k?f-1:d];h=b[c-1][k?
+f-1:d];k=b[c-1][k?0:d+1];n=c/(e-1);o=(c-1)/(e-1);t=(d+1)/f;var m=d/f,l=new THREE.UV(1-t,n),n=new THREE.UV(1-m,n),m=new THREE.UV(1-m,o),u=new THREE.UV(1-t,o);c<b.length-1&&(o=this.vertices[g].position.clone(),t=this.vertices[j].position.clone(),v=this.vertices[h].position.clone(),o.normalize(),t.normalize(),v.normalize(),this.faces.push(new THREE.Face3(g,j,h,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([l,n,m]));c>1&&(o=
+this.vertices[g].position.clone(),t=this.vertices[h].position.clone(),v=this.vertices[k].position.clone(),o.normalize(),t.normalize(),v.normalize(),this.faces.push(new THREE.Face3(g,h,k,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([l,m,u]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;
+THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(a,b){THREE.Geometry.call(this);this.parameters=b||{};this.set(a)};THREE.TextGeometry.prototype=new THREE.Geometry;THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
+THREE.TextGeometry.prototype.set=function(a,b){this.text=a;var b=b||this.parameters,c=b.height!==void 0?b.height:50,d=b.curveSegments!==void 0?b.curveSegments:4,e=b.font!==void 0?b.font:"helvetiker",f=b.weight!==void 0?b.weight:"normal",g=b.style!==void 0?b.style:"normal";THREE.FontUtils.size=b.size!==void 0?b.size:100;THREE.FontUtils.divisions=d;THREE.FontUtils.face=e;THREE.FontUtils.weight=f;THREE.FontUtils.style=g;var e=THREE.FontUtils.drawText(a),d=e.points,j=e.faces,e=e.contour;this.vertices=
+[];this.faces=[];for(var h,g=d.length,k=j.length,f=0;f<g;f++)h=d[f],this.vertices.push(new THREE.Vertex(new THREE.Vector3(h.x,h.y,0)));for(f=0;f<g;f++)h=d[f],this.vertices.push(new THREE.Vertex(new THREE.Vector3(h.x,h.y,c)));for(f=0;f<k;f++)c=j[f],this.faces.push(new THREE.Face3(c[2],c[1],c[0]));for(f=0;f<k;f++)c=j[f],this.faces.push(new THREE.Face3(c[0]+g,c[1]+g,c[2]+g));for(var f=e.length,l;--f>0;){if(l){if(l.equals(e[f])){l=null;continue}}else l=e[f];for(c=0;c<g;c++)if(d[c].equals(e[f]))break;
+for(j=0;j<g;j++)if(d[j].equals(e[f-1]))break;this.faces.push(new THREE.Face4(c,j,j+g,c+g))}this.computeCentroids();this.computeFaceNormals()};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},extractPoints:function(a,b){if(a.length<3)return console.log("not valid polygon"),
 {points:a,faces:[]};var c,d,e,f,g=[],j;for(j in b){a=b[j];f=[];for(c in a)d=a[c],f.push(d.x+","+d.y);var h,k;k=f.slice(1).indexOf(f[0]);var l=this.Triangulate.area(a.slice(0,k+1))<0;d=[];for(k=-1;k<f.length;){h=k+1;k=f[h];k=f.slice(h+1).indexOf(k)+h;if(k<=h)break;var m=a.slice(h,k+1);l?this.Triangulate.area(m)<0?(h>0&&g.push({shape:e,holes:d}),e=m,d=[]):d.push(m):this.Triangulate.area(m)<0?(g.push({shape:m,holes:d}),d=[]):d.push(m);k++}l&&g.push({shape:e,holes:d})}var n,o,t,v,u,x;f=[];for(j=0;j<g.length;j++){h=
 g[j];e=h.shape;d=h.holes;for(l=0;l<d.length;l++){k=d[l];t=Number.POSITIVE_INFINITY;for(m=0;m<k.length;m++){u=k[m];for(c=0;c<e.length;c++)v=e[c],v=u.distanceTo(v),v<t&&(t=v,n=m,o=c)}c=o-1>=0?o-1:e.length-1;var m=n-1>=0?n-1:k.length-1,w=[];w.push(k[n]);w.push(e[o]);w.push(e[c]);t=this.Triangulate.area(w);var p=[];p.push(k[n]);p.push(k[m]);p.push(e[o]);u=this.Triangulate.area(p);v=o;x=n;o+=1;n+=-1;o<0&&(o+=e.length);o%=e.length;n<0&&(n+=k.length);n%=e.length;c=o-1>=0?o-1:e.length-1;m=n-1>=0?n-1:k.length-
@@ -120,7 +115,14 @@ c+d;h=b[a++]*c;m=b[a++]*c+d;n=b[a++]*c;if(f=e[e.length-1]){k=f.x;l=f.y;f=1;for(d
 u))}}}return{offset:v.ha*c,points:e}}}};
 (function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return e*0.5};a.Triangulate=function(a,d){var e=a.length;if(e<3)return null;var f=[],g=[],j=[],h,k,l;if(b(a)>0)for(k=0;k<e;k++)g[k]=k;else for(k=0;k<e;k++)g[k]=e-1-k;var m=2*e;for(k=e-1;e>2;){if(m--<=0){console.log("Warning, unable to triangulate polygon!");if(d)return j;return f}h=k;e<=h&&(h=0);k=h+1;e<=k&&(k=0);l=k+1;e<=l&&(l=0);var n;a:{n=a;var o=h,t=k,v=l,u=e,x=g,w=void 0,p=void 0,y=void 0,
 z=void 0,C=void 0,D=void 0,E=void 0,F=void 0,B=void 0,p=n[x[o]].x,y=n[x[o]].y,z=n[x[t]].x,C=n[x[t]].y,D=n[x[v]].x,E=n[x[v]].y;if(1.0E-10>(z-p)*(E-y)-(C-y)*(D-p))n=!1;else{for(w=0;w<u;w++)if(!(w==o||w==t||w==v)){var F=n[x[w]].x,B=n[x[w]].y,J=void 0,L=void 0,G=void 0,M=void 0,H=void 0,A=void 0,I=void 0,K=void 0,N=void 0,P=void 0,Q=void 0,R=void 0,J=G=H=void 0,J=D-z,L=E-C,G=p-D,M=y-E,H=z-p,A=C-y,I=F-p,K=B-y,N=F-z,P=B-C,Q=F-D,R=B-E,J=J*P-L*N,H=H*K-A*I,G=G*R-M*Q;if(J>=0&&G>=0&&H>=0){n=!1;break a}}n=!0}}if(n){m=
-g[h];n=g[k];o=g[l];f.push(a[m]);f.push(a[n]);f.push(a[o]);j.push([g[h],g[k],g[l]]);h=k;for(l=k+1;l<e;h++,l++)g[h]=g[l];e--;m=2*e}}if(d)return j;return f};a.Triangulate.area=b;return a})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
+g[h];n=g[k];o=g[l];f.push(a[m]);f.push(a[n]);f.push(a[o]);j.push([g[h],g[k],g[l]]);h=k;for(l=k+1;l<e;h++,l++)g[h]=g[l];e--;m=2*e}}if(d)return j;return f};a.Triangulate.area=b;return a})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
+THREE.TorusGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=d||6;a=[];for(b=0;b<=this.segmentsR;++b)for(c=0;c<=this.segmentsT;++c){var d=c/this.segmentsT*2*Math.PI,e=b/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(e))*Math.cos(d),(this.radius+this.tube*Math.cos(e))*Math.sin(d),this.tube*Math.sin(e))));a.push([c/this.segmentsT,1-b/this.segmentsR])}for(b=1;b<=this.segmentsR;++b)for(c=
+1;c<=this.segmentsT;++c){var d=(this.segmentsT+1)*b+c,e=(this.segmentsT+1)*b+c-1,f=(this.segmentsT+1)*(b-1)+c-1,g=(this.segmentsT+1)*(b-1)+c;this.faces.push(new THREE.Face4(d,e,f,g));this.faceVertexUvs[0].push([new THREE.UV(a[d][0],a[d][1]),new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[g][0],a[g][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusGeometry.prototype=new THREE.Geometry;
+THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
+THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function j(a,c,b,d,f,e){c=b/d*a;b=Math.cos(c);return new THREE.Vector3(f*(2+b)*0.5*Math.cos(a),f*(2+b)*Math.sin(a)*0.5,e*f*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=a||200;this.tube=b||40;this.segmentsR=c||64;this.segmentsT=d||8;this.p=e||2;this.q=f||3;this.heightScale=g||1;this.grid=Array(this.segmentsR);c=new THREE.Vector3;d=new THREE.Vector3;f=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=Array(this.segmentsT);for(b=0;b<
+this.segmentsT;++b){var h=a/this.segmentsR*2*this.p*Math.PI,g=b/this.segmentsT*2*Math.PI,e=j(h,g,this.q,this.p,this.radius,this.heightScale),h=j(h+0.01,g,this.q,this.p,this.radius,this.heightScale);c.x=h.x-e.x;c.y=h.y-e.y;c.z=h.z-e.z;d.x=h.x+e.x;d.y=h.y+e.y;d.z=h.z+e.z;f.cross(c,d);d.cross(f,c);f.normalize();d.normalize();h=-this.tube*Math.cos(g);g=this.tube*Math.sin(g);e.x+=h*d.x+g*f.x;e.y+=h*d.y+g*f.y;e.z+=h*d.z+g*f.z;this.grid[a][b]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(e.x,e.y,
+e.z)))-1}}for(a=0;a<this.segmentsR;++a)for(b=0;b<this.segmentsT;++b){var d=(a+1)%this.segmentsR,f=(b+1)%this.segmentsT,e=this.grid[a][b],c=this.grid[d][b],d=this.grid[d][f],f=this.grid[a][f],g=new THREE.UV(a/this.segmentsR,b/this.segmentsT),h=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT),k=new THREE.UV((a+1)/this.segmentsR,(b+1)/this.segmentsT),l=new THREE.UV(a/this.segmentsR,(b+1)/this.segmentsT);this.faces.push(new THREE.Face4(e,c,d,f));this.faceVertexUvs[0].push([g,h,k,l])}this.computeCentroids();
+this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ";b+=a.total?(100*a.loaded/a.total).toFixed(0)+"%":(a.loaded/1E3).toFixed(2)+" KB";
 this.statusDomElement.innerHTML=b},extractUrlbase:function(a){a=a.split("/");a.pop();return a.join("/")},init_materials:function(a,b,c){a.materials=[];for(var d=0;d<b.length;++d)a.materials[d]=[THREE.Loader.prototype.createMaterial(b[d],c)]},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.floor(a)==a}function d(a,b){var d=new Image;d.onload=function(){if(!c(this.width)||!c(this.height)){var b=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),d=Math.pow(2,Math.round(Math.log(this.height)/
 Math.LN2));a.image.width=b;a.image.height=d;a.image.getContext("2d").drawImage(this,0,0,b,d)}else a.image=this;a.needsUpdate=!0};d.src=b}var e,f,g;e="MeshLambertMaterial";f={color:15658734,opacity:1,map:null,lightMap:null,wireframe:a.wireframe};a.shading&&(a.shading=="Phong"?e="MeshPhongMaterial":a.shading=="Basic"&&(e="MeshBasicMaterial"));if(a.blending)if(a.blending=="Additive")f.blending=THREE.AdditiveBlending;else if(a.blending=="Subtractive")f.blending=THREE.SubtractiveBlending;else if(a.blending==
@@ -216,8 +218,9 @@ d;if(c<b.min.z||c>b.max.z)return Number.MAX_VALUE;b.normal.set(0,j,0);break;case
 THREE.CollisionSystem.prototype.raySphere=function(a,b){var c=b.center.clone().subSelf(a.origin);if(c.lengthSq<b.radiusSq)return-1;var d=c.dot(a.direction.clone());if(d<=0)return Number.MAX_VALUE;c=b.radiusSq-(c.lengthSq()-d*d);if(c>=0)return Math.abs(d)-Math.sqrt(c);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4;
 THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(a){a.geometry.computeBoundingBox();var b=a.geometry.boundingBox,c=new THREE.Vector3(b.x[0],b.y[0],b.z[0]),b=new THREE.Vector3(b.x[1],b.y[1],b.z[1]),c=new THREE.BoxCollider(c,b);c.mesh=a;return c};THREE.CollisionUtils.MeshAABB=function(a){var b=THREE.CollisionUtils.MeshOBB(a);b.min.addSelf(a.position);b.max.addSelf(a.position);b.dynamic=!1;return b};
 THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))};
-THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,d=this.render,e=new THREE.Camera,f=new THREE.Camera,a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},g=new THREE.WebGLRenderTarget(512,512,a),j=new THREE.WebGLRenderTarget(512,512,a),h=new THREE.Camera(53,1,1,1E4);h.position.z=2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:g},mapRight:{type:"t",value:1,texture:j}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
-fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});var k=new THREE.Scene;k.addObject(new THREE.Mesh(new THREE.Plane(2,2),_material));this.setSize=function(a,d){c.call(b,a,d);g.width=a;g.height=d;j.width=a;j.height=d};this.render=
-function(a,c){e.projectionMatrix=c.projectionMatrix;e.position.copy(c.position);e.target.position.copy(c.target.position);e.translateX(-10);f.projectionMatrix=c.projectionMatrix;f.position.copy(c.position);f.target.position.copy(c.target.position);f.translateX(10);d.call(b,a,e,g,!0);d.call(b,a,f,j,!0);d.call(b,k,h)}};THREE.AnaglyphWebGLRenderer.prototype=new THREE.WebGLRenderer;THREE.AnaglyphWebGLRenderer.prototype.constructor=THREE.AnaglyphWebGLRenderer;
-THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,d=this.render,e,f,g=new THREE.Camera,j=new THREE.Camera;b.separation=10;if(a&&a.separation!==void 0)b.separation=a.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(a,d){c.call(b,a,d);e=a/2;f=d};this.render=function(a,c){this.clear();g.fov=c.fov;g.aspect=0.5*c.aspect;g.near=c.near;g.far=c.far;g.updateProjectionMatrix();
-g.position.copy(c.position);g.target.position.copy(c.target.position);g.translateX(b.separation);j.projectionMatrix=g.projectionMatrix;j.position.copy(c.position);j.target.position.copy(c.target.position);j.translateX(-b.separation);this.setViewport(0,0,e,f);d.call(b,a,g);this.setViewport(e,0,e,f);d.call(b,a,j,!1)}};THREE.CrosseyedWebGLRenderer.prototype=new THREE.WebGLRenderer;THREE.CrosseyedWebGLRenderer.prototype.constructor=THREE.CrosseyedWebGLRenderer;
+if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,d=this.render,e=new THREE.Camera,f=new THREE.Camera,a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},g=new THREE.WebGLRenderTarget(512,512,a),j=new THREE.WebGLRenderTarget(512,512,a),h=new THREE.Camera(53,1,1,1E4);h.position.z=2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:g},mapRight:{type:"t",value:1,
+texture:j}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});var k=
+new THREE.Scene;k.addObject(new THREE.Mesh(new THREE.Plane(2,2),_material));this.setSize=function(a,d){c.call(b,a,d);g.width=a;g.height=d;j.width=a;j.height=d};this.render=function(a,c){e.projectionMatrix=c.projectionMatrix;e.position.copy(c.position);e.target.position.copy(c.target.position);e.translateX(-10);f.projectionMatrix=c.projectionMatrix;f.position.copy(c.position);f.target.position.copy(c.target.position);f.translateX(10);d.call(b,a,e,g,!0);d.call(b,a,f,j,!0);d.call(b,k,h)}},THREE.AnaglyphWebGLRenderer.prototype=
+new THREE.WebGLRenderer,THREE.AnaglyphWebGLRenderer.prototype.constructor=THREE.AnaglyphWebGLRenderer;
+if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,d=this.render,e,f,g=new THREE.Camera,j=new THREE.Camera;b.separation=10;if(a&&a.separation!==void 0)b.separation=a.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(a,d){c.call(b,a,d);e=a/2;f=d};this.render=function(a,c){this.clear();g.fov=c.fov;g.aspect=0.5*c.aspect;g.near=c.near;g.far=c.far;
+g.updateProjectionMatrix();g.position.copy(c.position);g.target.position.copy(c.target.position);g.translateX(b.separation);j.projectionMatrix=g.projectionMatrix;j.position.copy(c.position);j.target.position.copy(c.target.position);j.translateX(-b.separation);this.setViewport(0,0,e,f);d.call(b,a,g);this.setViewport(e,0,e,f);d.call(b,a,j,!1)}},THREE.CrosseyedWebGLRenderer.prototype=new THREE.WebGLRenderer,THREE.CrosseyedWebGLRenderer.prototype.constructor=THREE.CrosseyedWebGLRenderer;

+ 1 - 1
build/custom/ThreeSVG.js

@@ -51,7 +51,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
 d;this.z=a.z*d;this.w=Math.cos(c);return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
 multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,i=this.w,l=i*c+f*e-h*d,k=
 i*d+h*c-g*e,n=i*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=l*i+c*-g+k*-h-n*-f;b.y=k*i+c*-f+n*-g-l*-h;b.z=n*i+c*-h+l*-f-k*-g;return b}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.001)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};

+ 2 - 2
build/custom/ThreeWebGL.js

@@ -51,7 +51,7 @@ THREE.Quaternion.prototype={set:function(b,d,e,f){this.x=b;this.y=d;this.z=e;thi
 f;this.z=b.z*f;this.w=Math.cos(e);return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},
 multiplySelf:function(b){var d=this.x,e=this.y,f=this.z,h=this.w,i=b.x,g=b.y,j=b.z,b=b.w;this.x=d*b+h*i+e*j-f*g;this.y=e*b+h*g+f*i-d*j;this.z=f*b+h*j+d*g-e*i;this.w=h*b-d*i-e*g-f*j;return this},multiply:function(b,d){this.x=b.x*d.w+b.y*d.z-b.z*d.y+b.w*d.x;this.y=-b.x*d.z+b.y*d.w+b.z*d.x+b.w*d.y;this.z=b.x*d.y-b.y*d.x+b.z*d.w+b.w*d.z;this.w=-b.x*d.x-b.y*d.y-b.z*d.z+b.w*d.w;return this},multiplyVector3:function(b,d){d||(d=b);var e=b.x,f=b.y,h=b.z,i=this.x,g=this.y,j=this.z,p=this.w,k=p*e+g*h-j*f,n=
 p*f+j*e-i*h,v=p*h+i*f-g*e,e=-i*e-g*f-j*h;d.x=k*p+e*-i+n*-j-v*-g;d.y=n*p+e*-g+v*-i-k*-j;d.z=v*p+e*-j+k*-g-n*-i;return d}};
-THREE.Quaternion.slerp=function(b,d,e,f){var h=b.w*d.w+b.x*d.x+b.y*d.y+b.z*d.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var i=Math.acos(h),g=Math.sqrt(1-h*h);if(Math.abs(g)<0.0010)return e.w=0.5*(b.w+d.w),e.x=0.5*(b.x+d.x),e.y=0.5*(b.y+d.y),e.z=0.5*(b.z+d.z),e;h=Math.sin((1-f)*i)/g;f=Math.sin(f*i)/g;e.w=b.w*h+d.w*f;e.x=b.x*h+d.x*f;e.y=b.y*h+d.y*f;e.z=b.z*h+d.z*f;return e};THREE.Vertex=function(b){this.position=b||new THREE.Vector3};
+THREE.Quaternion.slerp=function(b,d,e,f){var h=b.w*d.w+b.x*d.x+b.y*d.y+b.z*d.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var i=Math.acos(h),g=Math.sqrt(1-h*h);if(Math.abs(g)<0.001)return e.w=0.5*(b.w+d.w),e.x=0.5*(b.x+d.x),e.y=0.5*(b.y+d.y),e.z=0.5*(b.z+d.z),e;h=Math.sin((1-f)*i)/g;f=Math.sin(f*i)/g;e.w=b.w*h+d.w*f;e.x=b.x*h+d.x*f;e.y=b.y*h+d.y*f;e.z=b.z*h+d.z*f;return e};THREE.Vertex=function(b){this.position=b||new THREE.Vector3};
 THREE.Face3=function(b,d,e,f,h,i){this.a=b;this.b=d;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=i instanceof Array?i:[i];this.centroid=new THREE.Vector3};
 THREE.Face4=function(b,d,e,f,h,i,g){this.a=b;this.b=d;this.c=e;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=i instanceof THREE.Color?i:new THREE.Color;this.vertexColors=i instanceof Array?i:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};THREE.UV=function(b,d){this.set(b||0,d||0)};
 THREE.UV.prototype={set:function(b,d){this.u=b;this.v=d;return this},copy:function(b){this.set(b.u,b.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
@@ -217,7 +217,7 @@ c.uniform1f(h.rotation,g.rotation),c.uniform2fv(h.scale,k),g.mergeWith3D&&!n?(c.
 (c.enableVertexAttribArray(t.attributes.vertex),c.enableVertexAttribArray(t.attributes.uv),Fa=!0);c.uniform1i(y.occlusionMap,0);c.uniform1i(y.map,1);c.bindBuffer(c.ARRAY_BUFFER,t.vertexBuffer);c.vertexAttribPointer(e.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(e.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,t.elementBuffer);c.disable(c.CULL_FACE);c.depthMask(!1);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,t.occlusionTexture);c.activeTexture(c.TEXTURE1);for(f=0;f<g;f++)if(e=
 b.__webglLensFlares[f].object,k.set(e.matrixWorld.n14,e.matrixWorld.n24,e.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(k),d.projectionMatrix.multiplyVector3(k),q[0]=k.x,q[1]=k.y,q[2]=k.z,z[0]=q[0]*o+o,z[1]=q[1]*n+n,t.hasVertexTexture||z[0]>0&&z[0]<O&&z[1]>0&&z[1]<H){c.bindTexture(c.TEXTURE_2D,t.tempTexture);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGB,z[0]-8,z[1]-8,16,16,0);c.uniform1i(y.renderType,0);c.uniform2fv(y.scale,v);c.uniform3fv(y.screenPosition,q);c.disable(c.BLEND);c.enable(c.DEPTH_TEST);
 c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);c.bindTexture(c.TEXTURE_2D,t.occlusionTexture);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGBA,z[0]-8,z[1]-8,16,16,0);c.uniform1i(y.renderType,1);c.disable(c.DEPTH_TEST);c.bindTexture(c.TEXTURE_2D,t.tempTexture);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);e.positionScreen.x=q[0];e.positionScreen.y=q[1];e.positionScreen.z=q[2];e.customUpdateCallback?e.customUpdateCallback(e):e.updateLensFlares();c.uniform1i(y.renderType,2);c.enable(c.BLEND);h=0;for(i=e.lensFlares.length;h<
-i;h++)if(j=e.lensFlares[h],j.opacity>0.0010&&j.scale>0.0010)q[0]=j.x,q[1]=j.y,q[2]=j.z,r=j.size*j.scale/H,v[0]=r*p,v[1]=r,c.uniform3fv(y.screenPosition,q),c.uniform2fv(y.scale,v),c.uniform1f(y.rotation,j.rotation),c.uniform1f(y.opacity,j.opacity),L(j.blending),x(j.texture,1),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0)}c.enable(c.CULL_FACE);c.enable(c.DEPTH_TEST);c.depthMask(ra)}function D(b,c){b._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}
+i;h++)if(j=e.lensFlares[h],j.opacity>0.001&&j.scale>0.001)q[0]=j.x,q[1]=j.y,q[2]=j.z,r=j.size*j.scale/H,v[0]=r*p,v[1]=r,c.uniform3fv(y.screenPosition,q),c.uniform2fv(y.scale,v),c.uniform1f(y.rotation,j.rotation),c.uniform1f(y.opacity,j.opacity),L(j.blending),x(j.texture,1),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0)}c.enable(c.CULL_FACE);c.enable(c.DEPTH_TEST);c.depthMask(ra)}function D(b,c){b._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}
 function y(b){var e,f,g,h,i;if(b instanceof THREE.Mesh){f=b.geometry;for(e in f.geometryGroups){g=f.geometryGroups[e];i=!1;for(h in g.__webglCustomAttributes)if(g.__webglCustomAttributes[h].needsUpdate){i=!0;break}if(f.__dirtyVertices||f.__dirtyMorphTargets||f.__dirtyElements||f.__dirtyUvs||f.__dirtyNormals||f.__dirtyColors||f.__dirtyTangents||i){i=b;var j=c.DYNAMIC_DRAW;if(g.__inittedArrays){var k=void 0,p=void 0,n=void 0,o=void 0,G=n=void 0,r=void 0,v=void 0,q=void 0,t=void 0,z=void 0,y=void 0,
 x=void 0,C=void 0,u=void 0,I=void 0,K=void 0,D=void 0,s=o=q=o=v=r=void 0,A=void 0,m=A=s=r=void 0,F=void 0,J=m=A=s=n=n=G=q=o=m=A=s=F=m=A=s=F=m=A=s=void 0,B=0,E=0,O=0,P=0,H=0,M=0,T=0,N=0,ca=0,w=0,da=0,A=s=0,L=g.__vertexArray,Z=g.__uvArray,$=g.__uv2Array,Q=g.__normalArray,U=g.__tangentArray,ea=g.__colorArray,V=g.__skinVertexAArray,W=g.__skinVertexBArray,X=g.__skinIndexArray,Y=g.__skinWeightArray,aa=g.__morphTargetsArrays,R=g.__webglCustomAttributes,m=void 0,ma=g.__faceArray,S=g.__lineArray,ja=g.__needsSmoothNormals,
 z=g.__vertexColorType,t=g.__uvType,y=g.__normalType,ga=i.geometry,ha=ga.__dirtyVertices,ia=ga.__dirtyElements,fa=ga.__dirtyUvs,ka=ga.__dirtyNormals,na=ga.__dirtyTangents,oa=ga.__dirtyColors,pa=ga.__dirtyMorphTargets,la=ga.vertices,qa=g.faces,ra=ga.faces,sa=ga.faceVertexUvs[0],ta=ga.faceVertexUvs[1],ya=ga.skinVerticesA,za=ga.skinVerticesB,Aa=ga.skinIndices,wa=ga.skinWeights,xa=i instanceof THREE.ShadowVolume?ga.edgeFaces:void 0,ua=ga.morphTargets;if(R)for(J in R)R[J].offset=0,R[J].offsetSrc=0;k=0;

+ 63 - 59
src/extras/renderers/AnaglyphWebGLRenderer.js

@@ -2,98 +2,102 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
-THREE.AnaglyphWebGLRenderer = function ( parameters ) {
+if ( THREE.WebGLRenderer ) {
 
-	THREE.WebGLRenderer.call( this, parameters );
+	THREE.AnaglyphWebGLRenderer = function ( parameters ) {
 
-	var _this = this, _setSize = this.setSize, _render = this.render;
-	var _cameraL = new THREE.Camera(), _cameraR = new THREE.Camera();
+		THREE.WebGLRenderer.call( this, parameters );
 
-	var _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };
-	var _renderTargetL = new THREE.WebGLRenderTarget( 512, 512, _params ), _renderTargetR = new THREE.WebGLRenderTarget( 512, 512, _params );
+		var _this = this, _setSize = this.setSize, _render = this.render;
+		var _cameraL = new THREE.Camera(), _cameraR = new THREE.Camera();
 
-	var _camera = new THREE.Camera( 53, 1, 1, 10000 );
-	_camera.position.z = 2;
+		var _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };
+		var _renderTargetL = new THREE.WebGLRenderTarget( 512, 512, _params ), _renderTargetR = new THREE.WebGLRenderTarget( 512, 512, _params );
 
-	_material = new THREE.MeshShaderMaterial( {
+		var _camera = new THREE.Camera( 53, 1, 1, 10000 );
+		_camera.position.z = 2;
 
-		uniforms: {
+		_material = new THREE.MeshShaderMaterial( {
 
-			"mapLeft": { type: "t", value: 0, texture: _renderTargetL },
-			"mapRight": { type: "t", value: 1, texture: _renderTargetR }
+			uniforms: {
 
-		},
-		vertexShader: [
+				"mapLeft": { type: "t", value: 0, texture: _renderTargetL },
+				"mapRight": { type: "t", value: 1, texture: _renderTargetR }
 
-			"varying vec2 vUv;",
+			},
+			vertexShader: [
 
-			"void main() {",
+				"varying vec2 vUv;",
 
-				"vUv = vec2( uv.x, 1.0 - uv.y );",
-				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+				"void main() {",
 
-			"}"
+					"vUv = vec2( uv.x, 1.0 - uv.y );",
+					"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
-		].join("\n"),
-		fragmentShader: [
+				"}"
 
-			"uniform sampler2D mapLeft;",
-			"uniform sampler2D mapRight;",
-			"varying vec2 vUv;",
+			].join("\n"),
+			fragmentShader: [
 
-			"void main() {",
+				"uniform sampler2D mapLeft;",
+				"uniform sampler2D mapRight;",
+				"varying vec2 vUv;",
 
-				"vec4 colorL, colorR;",
-				"vec2 uv = vUv;",
+				"void main() {",
 
-				"colorL = texture2D( mapLeft, uv );",
-				"colorR = texture2D( mapRight, uv );",
+					"vec4 colorL, colorR;",
+					"vec2 uv = vUv;",
 
-				// http://3dtv.at/Knowhow/AnaglyphComparison_en.aspx
+					"colorL = texture2D( mapLeft, uv );",
+					"colorR = texture2D( mapRight, uv );",
 
-				"gl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;",
+					// http://3dtv.at/Knowhow/AnaglyphComparison_en.aspx
 
-			"}"
+					"gl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;",
 
-			].join("\n")
+				"}"
 
-	} );
+				].join("\n")
 
-	var _scene = new THREE.Scene();
-	_scene.addObject( new THREE.Mesh( new THREE.Plane( 2, 2 ), _material ) );
+		} );
 
-	this.setSize = function ( width, height ) {
+		var _scene = new THREE.Scene();
+		_scene.addObject( new THREE.Mesh( new THREE.Plane( 2, 2 ), _material ) );
 
-		_setSize.call( _this, width, height );
+		this.setSize = function ( width, height ) {
 
-		_renderTargetL.width = width;
-		_renderTargetL.height = height;
+			_setSize.call( _this, width, height );
 
-		_renderTargetR.width = width;
-		_renderTargetR.height = height;
+			_renderTargetL.width = width;
+			_renderTargetL.height = height;
 
-	};
+			_renderTargetR.width = width;
+			_renderTargetR.height = height;
 
-	this.render = function ( scene, camera, renderTarget, forceClear ) {
+		};
 
-		_cameraL.projectionMatrix = camera.projectionMatrix;
-		_cameraL.position.copy( camera.position );
-		_cameraL.target.position.copy( camera.target.position );
-		_cameraL.translateX( - 10 );
+		this.render = function ( scene, camera, renderTarget, forceClear ) {
 
-		_cameraR.projectionMatrix = camera.projectionMatrix;
-		_cameraR.position.copy( camera.position );
-		_cameraR.target.position.copy( camera.target.position );
-		_cameraR.translateX( 10 );
+			_cameraL.projectionMatrix = camera.projectionMatrix;
+			_cameraL.position.copy( camera.position );
+			_cameraL.target.position.copy( camera.target.position );
+			_cameraL.translateX( - 10 );
 
-		_render.call( _this, scene, _cameraL, _renderTargetL, true );
-		_render.call( _this, scene, _cameraR, _renderTargetR, true );
+			_cameraR.projectionMatrix = camera.projectionMatrix;
+			_cameraR.position.copy( camera.position );
+			_cameraR.target.position.copy( camera.target.position );
+			_cameraR.translateX( 10 );
 
-		_render.call( _this, _scene, _camera );
+			_render.call( _this, scene, _cameraL, _renderTargetL, true );
+			_render.call( _this, scene, _cameraR, _renderTargetR, true );
 
-	};
+			_render.call( _this, _scene, _camera );
 
-};
+		};
+
+	};
 
-THREE.AnaglyphWebGLRenderer.prototype = new THREE.WebGLRenderer();
-THREE.AnaglyphWebGLRenderer.prototype.constructor = THREE.AnaglyphWebGLRenderer;
+	THREE.AnaglyphWebGLRenderer.prototype = new THREE.WebGLRenderer();
+	THREE.AnaglyphWebGLRenderer.prototype.constructor = THREE.AnaglyphWebGLRenderer;
+	
+}

+ 45 - 41
src/extras/renderers/CrosseyedWebGLRenderer.js

@@ -2,68 +2,72 @@
  * @author alteredq / http://alteredqualia.com/
  */
 
-THREE.CrosseyedWebGLRenderer = function ( parameters ) {
+if ( THREE.WebGLRenderer ) {
 
-	THREE.WebGLRenderer.call( this, parameters );
+	THREE.CrosseyedWebGLRenderer = function ( parameters ) {
 
-	this.autoClear = false;
+		THREE.WebGLRenderer.call( this, parameters );
 
-	var _this = this, _setSize = this.setSize, _render = this.render;
+		this.autoClear = false;
 
-	var _width, _height;
+		var _this = this, _setSize = this.setSize, _render = this.render;
+
+		var _width, _height;
 	
-	var _cameraL = new THREE.Camera(), 
-		_cameraR = new THREE.Camera();
+		var _cameraL = new THREE.Camera(), 
+			_cameraR = new THREE.Camera();
 
-	_this.separation = 10;
-	if ( parameters && parameters.separation !== undefined ) _this.separation = parameters.separation;
+		_this.separation = 10;
+		if ( parameters && parameters.separation !== undefined ) _this.separation = parameters.separation;
 
-	var SCREEN_WIDTH  = window.innerWidth;
-	var SCREEN_HEIGHT = window.innerHeight;
-	var HALF_WIDTH = SCREEN_WIDTH / 2;
+		var SCREEN_WIDTH  = window.innerWidth;
+		var SCREEN_HEIGHT = window.innerHeight;
+		var HALF_WIDTH = SCREEN_WIDTH / 2;
 	
-	var _camera = new THREE.Camera( 53, HALF_WIDTH / SCREEN_HEIGHT, 1, 10000 );
-	_camera.position.z = -10;
+		var _camera = new THREE.Camera( 53, HALF_WIDTH / SCREEN_HEIGHT, 1, 10000 );
+		_camera.position.z = -10;
 	
 
-	this.setSize = function ( width, height ) {
+		this.setSize = function ( width, height ) {
 
-		_setSize.call( _this, width, height );
+			_setSize.call( _this, width, height );
 
-		_width = width/2;
-		_height = height;
+			_width = width/2;
+			_height = height;
 
-	};
+		};
 
-	this.render = function ( scene, camera, renderTarget, forceClear ) {
+		this.render = function ( scene, camera, renderTarget, forceClear ) {
 		
-		this.clear();
+			this.clear();
 
-		_cameraL.fov = camera.fov;
-		_cameraL.aspect = 0.5 * camera.aspect;
-		_cameraL.near = camera.near;
-		_cameraL.far = camera.far;
-		_cameraL.updateProjectionMatrix();
+			_cameraL.fov = camera.fov;
+			_cameraL.aspect = 0.5 * camera.aspect;
+			_cameraL.near = camera.near;
+			_cameraL.far = camera.far;
+			_cameraL.updateProjectionMatrix();
 		
-		_cameraL.position.copy( camera.position );
-		_cameraL.target.position.copy( camera.target.position );
-		_cameraL.translateX( _this.separation );
+			_cameraL.position.copy( camera.position );
+			_cameraL.target.position.copy( camera.target.position );
+			_cameraL.translateX( _this.separation );
 
-		_cameraR.projectionMatrix = _cameraL.projectionMatrix;
+			_cameraR.projectionMatrix = _cameraL.projectionMatrix;
 
-		_cameraR.position.copy( camera.position );
-		_cameraR.target.position.copy( camera.target.position );
-		_cameraR.translateX( - _this.separation );
+			_cameraR.position.copy( camera.position );
+			_cameraR.target.position.copy( camera.target.position );
+			_cameraR.translateX( - _this.separation );
 
-		this.setViewport( 0, 0, _width, _height );
-		_render.call( _this, scene, _cameraL );
+			this.setViewport( 0, 0, _width, _height );
+			_render.call( _this, scene, _cameraL );
 		
-		this.setViewport( _width, 0, _width, _height );
-		_render.call( _this, scene, _cameraR, false );
+			this.setViewport( _width, 0, _width, _height );
+			_render.call( _this, scene, _cameraR, false );
 
-	};
+		};
 
-};
+	};
 
-THREE.CrosseyedWebGLRenderer.prototype = new THREE.WebGLRenderer();
-THREE.CrosseyedWebGLRenderer.prototype.constructor = THREE.CrosseyedWebGLRenderer;
+	THREE.CrosseyedWebGLRenderer.prototype = new THREE.WebGLRenderer();
+	THREE.CrosseyedWebGLRenderer.prototype.constructor = THREE.CrosseyedWebGLRenderer;
+	
+}