浏览代码

Refactored BinaryLoader to follow new JSONLoader style simpler API.

Also updated corresponding examples.
alteredq 14 年之前
父节点
当前提交
0284cb950a

+ 113 - 113
build/Three.js

@@ -424,7 +424,7 @@ THREE.TextPath.prototype.toShapes=function(){for(var b=THREE.FontUtils.drawText(
 THREE.AnimationHandler=function(){var b=[],c={},e={update:function(c){for(var e=0;e<b.length;e++)b[e].update(c)},addToUpdate:function(c){b.indexOf(c)===-1&&b.push(c)},removeFromUpdate:function(c){c=b.indexOf(c);c!==-1&&b.splice(c,1)},add:function(b){c[b.name]!==void 0&&console.log("THREE.AnimationHandler.add: Warning! "+b.name+" already exists in library. Overwriting.");c[b.name]=b;if(b.initialized!==!0){for(var e=0;e<b.hierarchy.length;e++){for(var f=0;f<b.hierarchy[e].keys.length;f++){if(b.hierarchy[e].keys[f].time<
 0)b.hierarchy[e].keys[f].time=0;if(b.hierarchy[e].keys[f].rot!==void 0&&!(b.hierarchy[e].keys[f].rot instanceof THREE.Quaternion)){var n=b.hierarchy[e].keys[f].rot;b.hierarchy[e].keys[f].rot=new THREE.Quaternion(n[0],n[1],n[2],n[3])}}if(b.hierarchy[e].keys[0].morphTargets!==void 0){n={};for(f=0;f<b.hierarchy[e].keys.length;f++)for(var p=0;p<b.hierarchy[e].keys[f].morphTargets.length;p++){var t=b.hierarchy[e].keys[f].morphTargets[p];n[t]=-1}b.hierarchy[e].usedMorphTargets=n;for(f=0;f<b.hierarchy[e].keys.length;f++){var w=
 {};for(t in n){for(p=0;p<b.hierarchy[e].keys[f].morphTargets.length;p++)if(b.hierarchy[e].keys[f].morphTargets[p]===t){w[t]=b.hierarchy[e].keys[f].morphTargetsInfluences[p];break}p===b.hierarchy[e].keys[f].morphTargets.length&&(w[t]=0)}b.hierarchy[e].keys[f].morphTargetsInfluences=w}}for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].time===b.hierarchy[e].keys[f-1].time&&(b.hierarchy[e].keys.splice(f,1),f--);for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].index=f}f=parseInt(b.length*
-b.fps,10);b.JIT={};b.JIT.hierarchy=[];for(e=0;e<b.hierarchy.length;e++)b.JIT.hierarchy.push(Array(f));b.initialized=!0}},get:function(b){if(typeof b==="string")return c[b]?c[b]:(console.log("THREE.AnimationHandler.get: Couldn't find animation "+b),null)},parse:function(b){var c=[];if(b instanceof THREE.SkinnedMesh)for(var e=0;e<b.bones.length;e++)c.push(b.bones[e]);else f(b,c);return c}},f=function(b,c){c.push(b);for(var e=0;e<b.children.length;e++)f(b.children[e],c)};e.LINEAR=0;e.CATMULLROM=1;e.CATMULLROM_FORWARD=
+b.fps,10);b.JIT={};b.JIT.hierarchy=[];for(e=0;e<b.hierarchy.length;e++)b.JIT.hierarchy.push(Array(f));b.initialized=!0}},get:function(b){if(typeof b==="string")return c[b]?c[b]:(console.log("THREE.AnimationHandler.get: Couldn't find animation "+b),null)},parse:function(b){var e=[];if(b instanceof THREE.SkinnedMesh)for(var c=0;c<b.bones.length;c++)e.push(b.bones[c]);else f(b,e);return e}},f=function(b,e){e.push(b);for(var c=0;c<b.children.length;c++)f(b.children[c],e)};e.LINEAR=0;e.CATMULLROM=1;e.CATMULLROM_FORWARD=
 2;return e}();THREE.Animation=function(b,c,e,f){this.root=b;this.data=THREE.AnimationHandler.get(c);this.hierarchy=THREE.AnimationHandler.parse(b);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=e!==void 0?e:THREE.AnimationHandler.LINEAR;this.JITCompile=f!==void 0?f:!0;this.points=[];this.target=new THREE.Vector3};
 THREE.Animation.prototype.play=function(b,c){if(!this.isPlaying){this.isPlaying=!0;this.loop=b!==void 0?b:!0;this.currentTime=c!==void 0?c:0;var e,f=this.hierarchy.length,h;for(e=0;e<f;e++){h=this.hierarchy[e];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)h.useQuaternion=!0;h.matrixAutoUpdate=!0;if(h.animationCache===void 0)h.animationCache={},h.animationCache.prevKey={pos:0,rot:0,scl:0},h.animationCache.nextKey={pos:0,rot:0,scl:0},h.animationCache.originalMatrix=h instanceof
 THREE.Bone?h.skinMatrix:h.matrix;var k=h.animationCache.prevKey;h=h.animationCache.nextKey;k.pos=this.data.hierarchy[e].keys[0];k.rot=this.data.hierarchy[e].keys[0];k.scl=this.data.hierarchy[e].keys[0];h.pos=this.getNextKeyWith("pos",e,1);h.rot=this.getNextKeyWith("rot",e,1);h.scl=this.getNextKeyWith("scl",e,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
@@ -441,34 +441,34 @@ THREE.Animation.prototype.getPrevKeyWith=function(b,c,e){for(var f=this.data.hie
 THREE.CubeCamera=function(b,c,e,f){this.heightOffset=e;this.position=new THREE.Vector3(0,e,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position=
 this.position;this.cameraNY.position=this.position;this.cameraPZ.position=this.position;this.cameraNZ.position=this.position;this.cameraPX.up.set(0,-1,0);this.cameraNX.up.set(0,-1,0);this.cameraPY.up.set(0,0,1);this.cameraNY.up.set(0,0,-1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.targetPX=new THREE.Vector3(0,0,0);this.targetNX=new THREE.Vector3(0,0,0);this.targetPY=new THREE.Vector3(0,0,0);this.targetNY=new THREE.Vector3(0,0,0);this.targetPZ=new THREE.Vector3(0,0,0);this.targetNZ=
 new THREE.Vector3(0,0,0);this.renderTarget=new THREE.WebGLRenderTargetCube(f,f,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updatePosition=function(b){this.position.copy(b);this.position.y+=this.heightOffset;this.targetPX.copy(this.position);this.targetNX.copy(this.position);this.targetPY.copy(this.position);this.targetNY.copy(this.position);this.targetPZ.copy(this.position);this.targetNZ.copy(this.position);this.targetPX.x+=1;this.targetNX.x-=1;this.targetPY.y+=
-1;this.targetNY.y-=1;this.targetPZ.z+=1;this.targetNZ.z-=1;this.cameraPX.lookAt(this.targetPX);this.cameraNX.lookAt(this.targetNX);this.cameraPY.lookAt(this.targetPY);this.cameraNY.lookAt(this.targetNY);this.cameraPZ.lookAt(this.targetPZ);this.cameraNZ.lookAt(this.targetNZ)};this.updateCubeMap=function(b,c){var e=this.renderTarget;e.activeCubeFace=0;b.render(c,this.cameraPX,e);e.activeCubeFace=1;b.render(c,this.cameraNX,e);e.activeCubeFace=2;b.render(c,this.cameraPY,e);e.activeCubeFace=3;b.render(c,
-this.cameraNY,e);e.activeCubeFace=4;b.render(c,this.cameraPZ,e);e.activeCubeFace=5;b.render(c,this.cameraNZ,e)}};THREE.FirstPersonCamera=function(){console.warn("DEPRECATED: FirstPersonCamera() is FirstPersonControls().")};THREE.PathCamera=function(){console.warn("DEPRECATED: PathCamera() is PathControls().")};THREE.FlyCamera=function(){console.warn("DEPRECATED: FlyCamera() is FlyControls().")};THREE.RollCamera=function(){console.warn("DEPRECATED: RollCamera() is RollControls().")};
+1;this.targetNY.y-=1;this.targetPZ.z+=1;this.targetNZ.z-=1;this.cameraPX.lookAt(this.targetPX);this.cameraNX.lookAt(this.targetNX);this.cameraPY.lookAt(this.targetPY);this.cameraNY.lookAt(this.targetNY);this.cameraPZ.lookAt(this.targetPZ);this.cameraNZ.lookAt(this.targetNZ)};this.updateCubeMap=function(b,e){var c=this.renderTarget;c.activeCubeFace=0;b.render(e,this.cameraPX,c);c.activeCubeFace=1;b.render(e,this.cameraNX,c);c.activeCubeFace=2;b.render(e,this.cameraPY,c);c.activeCubeFace=3;b.render(e,
+this.cameraNY,c);c.activeCubeFace=4;b.render(e,this.cameraPZ,c);c.activeCubeFace=5;b.render(e,this.cameraNZ,c)}};THREE.FirstPersonCamera=function(){console.warn("DEPRECATED: FirstPersonCamera() is FirstPersonControls().")};THREE.PathCamera=function(){console.warn("DEPRECATED: PathCamera() is PathControls().")};THREE.FlyCamera=function(){console.warn("DEPRECATED: FlyCamera() is FlyControls().")};THREE.RollCamera=function(){console.warn("DEPRECATED: RollCamera() is RollControls().")};
 THREE.TrackballCamera=function(){console.warn("DEPRECATED: TrackballCamera() is TrackballControls().")};THREE.CombinedCamera=function(b,c,e,f,h,k,m){THREE.Camera.call(this);this.cameraO=new THREE.OrthographicCamera(b/-2,b/2,c/2,c/-2,k,m);this.cameraP=new THREE.PerspectiveCamera(e,b/c,f,h);this.toPerspective()};THREE.CombinedCamera.prototype=new THREE.Camera;THREE.CombinedCamera.prototype.constructor=THREE.CoolCamera;
 THREE.CombinedCamera.prototype.toPerspective=function(){this.near=this.cameraP.near;this.far=this.cameraP.far;this.projectionMatrix=this.cameraP.projectionMatrix};THREE.CombinedCamera.prototype.toOrthographic=function(){this.near=this.cameraO.near;this.far=this.cameraO.far;this.projectionMatrix=this.cameraO.projectionMatrix};THREE.CombinedCamera.prototype.setFov=function(b){this.cameraP.fov=b;this.cameraP.updateProjectionMatrix();this.toPerspective()};
 THREE.CombinedCamera.prototype.setLens=function(b,c){c||(c=43.25);var e=2*Math.atan(c/(b*2));e*=180/Math.PI;this.setFov(e);return e};
-THREE.FirstPersonControls=function(b,c){function e(b,e){return function(){e.apply(b,arguments)}}this.object=b;this.target=new THREE.Vector3(0,0,0);this.domElement=c!==void 0?c:document;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=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=
+THREE.FirstPersonControls=function(b,c){function e(b,c){return function(){c.apply(b,arguments)}}this.object=b;this.target=new THREE.Vector3(0,0,0);this.domElement=c!==void 0?c:document;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=Math.PI;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.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(b){this.domElement!==document&&this.domElement.focus();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.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown=
 function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=
-!1;break;case 70:this.moveDown=!1}};this.update=function(b){if(!this.freeze){if(this.heightSpeed){var e=THREE.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=b*e*this.heightCoef}else this.autoSpeedFactor=0;e=b*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(e+this.autoSpeedFactor));this.moveBackward&&this.object.translateZ(e);this.moveLeft&&this.object.translateX(-e);this.moveRight&&this.object.translateX(e);
-this.moveUp&&this.object.translateY(e);this.moveDown&&this.object.translateY(-e);e=b*this.lookSpeed;this.activeLook||(e=0);this.lon+=this.mouseX*e;this.lookVertical&&(this.lat-=this.mouseY*e);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target,c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta)}b=1;this.constrainVertical&&
-(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*e;this.lookVertical&&(this.lat-=this.mouseY*e*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);b=this.target;c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta);
+!1;break;case 70:this.moveDown=!1}};this.update=function(b){if(!this.freeze){if(this.heightSpeed){var c=THREE.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=b*c*this.heightCoef}else this.autoSpeedFactor=0;c=b*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(c+this.autoSpeedFactor));this.moveBackward&&this.object.translateZ(c);this.moveLeft&&this.object.translateX(-c);this.moveRight&&this.object.translateX(c);
+this.moveUp&&this.object.translateY(c);this.moveDown&&this.object.translateY(-c);c=b*this.lookSpeed;this.activeLook||(c=0);this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target,e=this.object.position;b.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=e.y+100*Math.cos(this.phi);b.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta)}b=1;this.constrainVertical&&
+(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);b=this.target;e=this.object.position;b.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=e.y+100*Math.cos(this.phi);b.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta);
 this.object.lookAt(b)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",e(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",e(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",e(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",e(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",e(this,this.onKeyUp),!1)};
-THREE.PathControls=function(b,c){function e(b){if((b*=2)<1)return 0.5*b*b;return-0.5*(--b*(b-2)-1)}function f(b,e){return function(){e.apply(b,arguments)}}function h(b,e,c,f){var h={name:c,fps:0.6,length:f,hierarchy:[]},k,m=e.getControlPointsArray(),n=e.getLength(),y=m.length,D=0;k=y-1;e={parent:-1,keys:[]};e.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};e.keys[k]={time:f,pos:m[k],rot:[0,0,0,1],scl:[1,1,1]};for(k=1;k<y-1;k++)D=f*n.chunks[k]/n.total,e.keys[k]={time:D,pos:m[k]};h.hierarchy[0]=
-e;THREE.AnimationHandler.add(h);return new THREE.Animation(b,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function k(b,e){var c,f,h=new THREE.Geometry;for(c=0;c<b.points.length*e;c++)f=c/(b.points.length*e),f=b.getPoint(f),h.vertices[c]=new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z));return h}this.object=b;this.domElement=c!==void 0?c:document;this.id="PathControls"+THREE.PathControlsIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=
+THREE.PathControls=function(b,c){function e(b){if((b*=2)<1)return 0.5*b*b;return-0.5*(--b*(b-2)-1)}function f(b,c){return function(){c.apply(b,arguments)}}function h(b,c,e,f){var h={name:e,fps:0.6,length:f,hierarchy:[]},k,m=c.getControlPointsArray(),n=c.getLength(),y=m.length,D=0;k=y-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[k]={time:f,pos:m[k],rot:[0,0,0,1],scl:[1,1,1]};for(k=1;k<y-1;k++)D=f*n.chunks[k]/n.total,c.keys[k]={time:D,pos:m[k]};h.hierarchy[0]=
+c;THREE.AnimationHandler.add(h);return new THREE.Animation(b,e,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function k(b,c){var e,f,h=new THREE.Geometry;for(e=0;e<b.points.length*c;e++)f=e/(b.points.length*c),f=b.getPoint(f),h.vertices[e]=new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z));return h}this.object=b;this.domElement=c!==void 0?c:document;this.id="PathControls"+THREE.PathControlsIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=
 new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookHorizontal=this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=
 this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var m=Math.PI*2,n=Math.PI/180;this.update=function(b){var c;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed*b);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed*b);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*n;this.theta=this.lon*n;b=this.phi%m;this.phi=b>=0?b:b+m;c=this.verticalAngleMap.srcRange;
 b=this.verticalAngleMap.dstRange;c=THREE.Math.mapLinear(this.phi,c[0],c[1],b[0],b[1]);var f=b[1]-b[0];this.phi=e((c-b[0])/f)*f+b[0];c=this.horizontalAngleMap.srcRange;b=this.horizontalAngleMap.dstRange;c=THREE.Math.mapLinear(this.theta,c[0],c[1],b[0],b[1]);f=b[1]-b[0];this.theta=e((c-b[0])/f)*f+b[0];b=this.target.position;b.x=100*Math.sin(this.phi)*Math.cos(this.theta);b.y=100*Math.cos(this.phi);b.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=
-function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){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}),e=new THREE.MeshLambertMaterial({color:65280}),
-c=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,b);b=new THREE.Mesh(m,e);b.position.set(0,10,0);this.animation=h(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(b)}else this.animation=h(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var b=
-this.debugPath,e=this.spline,c=k(e,10),m=k(e,10),n=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(c,n);particleObj=new THREE.ParticleSystem(m,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.add(lineObj);particleObj.scale.set(1,1,1);b.add(particleObj);m=new THREE.SphereGeometry(1,16,8);n=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<e.points.length;i++)c=new THREE.Mesh(m,n),c.position.copy(e.points[i]),b.add(c)}this.domElement.addEventListener("mousemove",
+function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){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}),c=new THREE.MeshLambertMaterial({color:65280}),
+e=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(e,b);b=new THREE.Mesh(m,c);b.position.set(0,10,0);this.animation=h(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(b)}else this.animation=h(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var b=
+this.debugPath,c=this.spline,e=k(c,10),m=k(c,10),n=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,n);particleObj=new THREE.ParticleSystem(m,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.add(lineObj);particleObj.scale.set(1,1,1);b.add(particleObj);m=new THREE.SphereGeometry(1,16,8);n=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)e=new THREE.Mesh(m,n),e.position.copy(c.points[i]),b.add(e)}this.domElement.addEventListener("mousemove",
 f(this,this.onMouseMove),!1)}};THREE.PathControlsIdCounter=0;
-THREE.FlyControls=function(b,c){function e(b,e){return function(){e.apply(b,arguments)}}this.object=b;this.domElement=c!==void 0?c:document;c&&this.domElement.setAttribute("tabindex",-1);this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.object.useQuaternion=!0;this.tmpQuaternion=new THREE.Quaternion;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,
+THREE.FlyControls=function(b,c){function e(b,c){return function(){c.apply(b,arguments)}}this.object=b;this.domElement=c!==void 0?c:document;c&&this.domElement.setAttribute("tabindex",-1);this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.object.useQuaternion=!0;this.tmpQuaternion=new THREE.Quaternion;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.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;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(b){this.domElement!==document&&this.domElement.focus();b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(b.button){case 0:this.object.moveForward=
-!0;break;case 2:this.object.moveBackward=!0}};this.mousemove=function(b){if(!this.dragToLook||this.mouseStatus>0){var e=this.getContainerDimensions(),c=e.size[0]/2,m=e.size[1]/2;this.moveState.yawLeft=-(b.pageX-e.offset[0]-c)/c;this.moveState.pitchDown=(b.pageY-e.offset[1]-m)/m;this.updateRotationVector()}};this.mouseup=function(b){b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(b.button){case 0:this.moveForward=
-!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(b){var e=b*this.movementSpeed;b*=this.rollSpeed;this.object.translateX(this.moveVector.x*e);this.object.translateY(this.moveVector.y*e);this.object.translateZ(this.moveVector.z*e);this.tmpQuaternion.set(this.rotationVector.x*b,this.rotationVector.y*b,this.rotationVector.z*b,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion);
+!0;break;case 2:this.object.moveBackward=!0}};this.mousemove=function(b){if(!this.dragToLook||this.mouseStatus>0){var c=this.getContainerDimensions(),e=c.size[0]/2,m=c.size[1]/2;this.moveState.yawLeft=-(b.pageX-c.offset[0]-e)/e;this.moveState.pitchDown=(b.pageY-c.offset[1]-m)/m;this.updateRotationVector()}};this.mouseup=function(b){b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(b.button){case 0:this.moveForward=
+!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(b){var c=b*this.movementSpeed;b*=this.rollSpeed;this.object.translateX(this.moveVector.x*c);this.object.translateY(this.moveVector.y*c);this.object.translateZ(this.moveVector.z*c);this.tmpQuaternion.set(this.rotationVector.x*b,this.rotationVector.y*b,this.rotationVector.z*b,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion);
 this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var b=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=
 -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",e(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",e(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",e(this,
 this.mouseup),!1);this.domElement.addEventListener("keydown",e(this,this.keydown),!1);this.domElement.addEventListener("keyup",e(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};
@@ -479,16 +479,16 @@ this.object.matrix.n24=this.object.position.y;this.object.matrix.n34=this.object
 b;this.object.position.y-=this.object.matrix.n23*b;this.object.position.z-=this.object.matrix.n33*b};this.rotateHorizontally=function(b){e.set(this.object.matrix.n11,this.object.matrix.n21,this.object.matrix.n31);e.multiplyScalar(b);this.forward.subSelf(e);this.forward.normalize()};this.rotateVertically=function(b){f.set(this.object.matrix.n12,this.object.matrix.n22,this.object.matrix.n32);f.multiplyScalar(b);this.forward.addSelf(f);this.forward.normalize()};this.domElement.addEventListener("contextmenu",
 function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",function(b){u=(b.clientX-v)/window.innerWidth;x=(b.clientY-A)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:p=1;break;case 2:p=-1}},!1);this.domElement.addEventListener("mouseup",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:p=0;break;case 2:p=0}},!1);this.domElement.addEventListener("keydown",
 function(b){switch(b.keyCode){case 38:case 87:p=1;break;case 37:case 65:t=-1;break;case 40:case 83:p=-1;break;case 39:case 68:t=1;break;case 81:m=!0;n=1;break;case 69:m=!0;n=-1;break;case 82:w=1;break;case 70:w=-1}},!1);this.domElement.addEventListener("keyup",function(b){switch(b.keyCode){case 38:case 87:p=0;break;case 37:case 65:t=0;break;case 40:case 83:p=0;break;case 39:case 68:t=0;break;case 81:m=!1;break;case 69:m=!1;break;case 82:w=0;break;case 70:w=0}},!1)};
-THREE.TrackballControls=function(b,c){function e(b,e){return function(){e.apply(b,arguments)}}this.object=b;this.domElement=c!==void 0?c:document;this.screen={width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=(this.screen.width+this.screen.height)/4;this.rotateSpeed=1;this.zoomSpeed=1.2;this.panSpeed=0.3;this.staticMoving=this.noPan=this.noZoom=!1;this.dynamicDampingFactor=0.2;this.minDistance=0;this.maxDistance=Infinity;this.keys=[65,83,68];this.target=new THREE.Vector3(0,
-0,0);var f=!1,h=this.STATE.NONE,k=new THREE.Vector3,m=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector2,t=new THREE.Vector2,w=new THREE.Vector2,u=new THREE.Vector2;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.getMouseOnScreen=function(b,e){return new THREE.Vector2((b-this.screen.offsetLeft)/this.radius*0.5,(e-this.screen.offsetTop)/this.radius*0.5)};this.getMouseProjectionOnBall=function(b,e){var c=new THREE.Vector3((b-this.screen.width*0.5-this.screen.offsetLeft)/
-this.radius,(this.screen.height*0.5+this.screen.offsetTop-e)/this.radius,0),f=c.length();f>1?c.normalize():c.z=Math.sqrt(1-f*f);k.copy(this.object.position).subSelf(this.target);f=this.object.up.clone().setLength(c.y);f.addSelf(this.object.up.clone().crossSelf(k).setLength(c.x));f.addSelf(k.setLength(c.z));return f};this.rotateCamera=function(){var b=Math.acos(m.dot(n)/m.length()/n.length());if(b){var e=(new THREE.Vector3).cross(m,n).normalize(),c=new THREE.Quaternion;b*=this.rotateSpeed;c.setFromAxisAngle(e,
--b);c.multiplyVector3(k);c.multiplyVector3(this.object.up);c.multiplyVector3(n);this.staticMoving?m=n:(c.setFromAxisAngle(e,b*(this.dynamicDampingFactor-1)),c.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(t.y-p.y)*this.zoomSpeed;b!==1&&b>0&&(k.multiplyScalar(b),this.staticMoving?p=t:p.y+=(t.y-p.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=u.clone().subSelf(w);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var e=k.clone().crossSelf(this.object.up).setLength(b.x);
-e.addSelf(this.object.up.clone().setLength(b.y));this.object.position.addSelf(e);this.target.addSelf(e);this.staticMoving?w=u:w.addSelf(b.sub(u,w).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()<this.minDistance*this.minDistance&&this.object.position.add(this.target,k.setLength(this.minDistance))};this.update=function(){k.copy(this.object.position).subSelf(this.target);
+THREE.TrackballControls=function(b,c){function e(b,c){return function(){c.apply(b,arguments)}}this.object=b;this.domElement=c!==void 0?c:document;this.screen={width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=(this.screen.width+this.screen.height)/4;this.rotateSpeed=1;this.zoomSpeed=1.2;this.panSpeed=0.3;this.staticMoving=this.noPan=this.noZoom=!1;this.dynamicDampingFactor=0.2;this.minDistance=0;this.maxDistance=Infinity;this.keys=[65,83,68];this.target=new THREE.Vector3(0,
+0,0);var f=!1,h=this.STATE.NONE,k=new THREE.Vector3,m=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector2,t=new THREE.Vector2,w=new THREE.Vector2,u=new THREE.Vector2;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.getMouseOnScreen=function(b,c){return new THREE.Vector2((b-this.screen.offsetLeft)/this.radius*0.5,(c-this.screen.offsetTop)/this.radius*0.5)};this.getMouseProjectionOnBall=function(b,c){var e=new THREE.Vector3((b-this.screen.width*0.5-this.screen.offsetLeft)/
+this.radius,(this.screen.height*0.5+this.screen.offsetTop-c)/this.radius,0),f=e.length();f>1?e.normalize():e.z=Math.sqrt(1-f*f);k.copy(this.object.position).subSelf(this.target);f=this.object.up.clone().setLength(e.y);f.addSelf(this.object.up.clone().crossSelf(k).setLength(e.x));f.addSelf(k.setLength(e.z));return f};this.rotateCamera=function(){var b=Math.acos(m.dot(n)/m.length()/n.length());if(b){var c=(new THREE.Vector3).cross(m,n).normalize(),e=new THREE.Quaternion;b*=this.rotateSpeed;e.setFromAxisAngle(c,
+-b);e.multiplyVector3(k);e.multiplyVector3(this.object.up);e.multiplyVector3(n);this.staticMoving?m=n:(e.setFromAxisAngle(c,b*(this.dynamicDampingFactor-1)),e.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(t.y-p.y)*this.zoomSpeed;b!==1&&b>0&&(k.multiplyScalar(b),this.staticMoving?p=t:p.y+=(t.y-p.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=u.clone().subSelf(w);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var c=k.clone().crossSelf(this.object.up).setLength(b.x);
+c.addSelf(this.object.up.clone().setLength(b.y));this.object.position.addSelf(c);this.target.addSelf(c);this.staticMoving?w=u:w.addSelf(b.sub(u,w).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()<this.minDistance*this.minDistance&&this.object.position.add(this.target,k.setLength(this.minDistance))};this.update=function(){k.copy(this.object.position).subSelf(this.target);
 this.rotateCamera();this.noZoom||this.zoomCamera();this.noPan||this.panCamera();this.object.position.add(this.target,k);this.checkDistances();this.object.lookAt(this.target)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",e(this,function(b){f&&(m=n=this.getMouseProjectionOnBall(b.clientX,b.clientY),p=t=this.getMouseOnScreen(b.clientX,b.clientY),w=u=this.getMouseOnScreen(b.clientX,b.clientY),f=!1);h!==this.STATE.NONE&&
 (h===this.STATE.ROTATE?n=this.getMouseProjectionOnBall(b.clientX,b.clientY):h===this.STATE.ZOOM&&!this.noZoom?t=this.getMouseOnScreen(b.clientX,b.clientY):h===this.STATE.PAN&&!this.noPan&&(u=this.getMouseOnScreen(b.clientX,b.clientY)))}),!1);this.domElement.addEventListener("mousedown",e(this,function(b){b.preventDefault();b.stopPropagation();if(h===this.STATE.NONE)h=b.button,h===this.STATE.ROTATE?m=n=this.getMouseProjectionOnBall(b.clientX,b.clientY):h===this.STATE.ZOOM&&!this.noZoom?p=t=this.getMouseOnScreen(b.clientX,
 b.clientY):this.noPan||(w=u=this.getMouseOnScreen(b.clientX,b.clientY))}),!1);this.domElement.addEventListener("mouseup",e(this,function(b){b.preventDefault();b.stopPropagation();h=this.STATE.NONE}),!1);window.addEventListener("keydown",e(this,function(b){if(h===this.STATE.NONE){if(b.keyCode===this.keys[this.STATE.ROTATE])h=this.STATE.ROTATE;else if(b.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)h=this.STATE.ZOOM;else if(b.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)h=this.STATE.PAN;h!==
 this.STATE.NONE&&(f=!0)}}),!1);window.addEventListener("keyup",e(this,function(){if(h!==this.STATE.NONE)h=this.STATE.NONE}),!1)};THREE.TrackballControls.prototype.STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2};
-THREE.CubeGeometry=function(b,c,e,f,h,k,m,n){function p(b,e,c,m,n,p,u,v){var w,x,A=f||1,Y=h||1,N=n/2,V=p/2,J=t.vertices.length;if(b=="x"&&e=="y"||b=="y"&&e=="x")w="z";else if(b=="x"&&e=="z"||b=="z"&&e=="x")w="y",Y=k||1;else if(b=="z"&&e=="y"||b=="y"&&e=="z")w="x",A=k||1;var $=A+1,Z=Y+1;n/=A;var Q=p/Y;for(x=0;x<Z;x++)for(p=0;p<$;p++){var o=new THREE.Vector3;o[b]=(p*n-N)*c;o[e]=(x*Q-V)*m;o[w]=u;t.vertices.push(new THREE.Vertex(o))}for(x=0;x<Y;x++)for(p=0;p<A;p++)t.faces.push(new THREE.Face4(p+$*x+J,
+THREE.CubeGeometry=function(b,c,e,f,h,k,m,n){function p(b,c,e,m,n,p,u,v){var w,x,A=f||1,Y=h||1,N=n/2,V=p/2,J=t.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")w="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")w="y",Y=k||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")w="x",A=k||1;var $=A+1,Z=Y+1;n/=A;var Q=p/Y;for(x=0;x<Z;x++)for(p=0;p<$;p++){var o=new THREE.Vector3;o[b]=(p*n-N)*e;o[c]=(x*Q-V)*m;o[w]=u;t.vertices.push(new THREE.Vertex(o))}for(x=0;x<Y;x++)for(p=0;p<A;p++)t.faces.push(new THREE.Face4(p+$*x+J,
 p+$*(x+1)+J,p+1+$*(x+1)+J,p+1+$*x+J,null,null,v)),t.faceVertexUvs[0].push([new THREE.UV(p/A,x/Y),new THREE.UV(p/A,(x+1)/Y),new THREE.UV((p+1)/A,(x+1)/Y),new THREE.UV((p+1)/A,x/Y)])}THREE.Geometry.call(this);var t=this,w=b/2,u=c/2,x=e/2;if(m!==void 0)if(m instanceof Array)this.materials=m;else{this.materials=[];for(var v=0;v<6;v++)this.materials.push([m])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(n!=void 0)for(var A in n)this.sides[A]!=void 0&&(this.sides[A]=n[A]);
 this.sides.px&&p("z","y",-1,-1,e,c,w,this.materials[0]);this.sides.nx&&p("z","y",1,-1,e,c,-w,this.materials[1]);this.sides.py&&p("x","z",1,1,b,e,u,this.materials[2]);this.sides.ny&&p("x","z",1,-1,b,e,-u,this.materials[3]);this.sides.pz&&p("x","y",1,-1,b,c,x,this.materials[4]);this.sides.nz&&p("x","y",-1,-1,b,c,-x,this.materials[5]);this.mergeVertices();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
 THREE.CylinderGeometry=function(b,c,e,f,h,k){THREE.Geometry.call(this);var b=b!=null?b:20,c=c!=null?c:20,e=e||100,m=e/2,f=f||8,h=h||1,n,p,t=[],w=[];for(p=0;p<=h;p++){var u=[],x=[],v=p/h,A=v*(c-b)+b;for(n=0;n<=f;n++){var z=n/f;this.vertices.push(new THREE.Vertex(new THREE.Vector3(A*Math.sin(z*Math.PI*2),-v*e+m,A*Math.cos(z*Math.PI*2))));u.push(this.vertices.length-1);x.push(new THREE.UV(z,v))}t.push(u);w.push(x)}for(p=0;p<h;p++)for(n=0;n<f;n++){var e=t[p][n],u=t[p+1][n],x=t[p+1][n+1],v=t[p][n+1],A=
@@ -496,23 +496,23 @@ this.vertices[e].position.clone().setY(0).normalize(),z=this.vertices[u].positio
 1],x=this.vertices.length-1,A=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),E=w[0][n].clone(),C=w[0][n+1].clone(),G=new THREE.UV(C.u,0),this.faces.push(new THREE.Face3(e,u,x,[A,z,y])),this.faceVertexUvs[0].push([E,C,G])}if(!k&&c>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;n<f;n++)e=t[p][n+1],u=t[p][n],x=this.vertices.length-1,A=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),E=w[p][n+1].clone(),C=w[p][n].clone(),
 G=new THREE.UV(C.u,1),this.faces.push(new THREE.Face3(e,u,x,[A,z,y])),this.faceVertexUvs[0].push([E,C,G])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
 THREE.ExtrudeGeometry=function(b,c){if(typeof b!="undefined"){THREE.Geometry.call(this);var b=b instanceof Array?b:[b],e,f=b.length,h;this.shapebb=b[f-1].getBoundingBox();for(e=0;e<f;e++)h=b[e],this.addShape(h,c);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
-THREE.ExtrudeGeometry.prototype.addShape=function(b,c){function e(b,e,c){e||console.log("die");return e.clone().multiplyScalar(c).addSelf(b)}function f(b,e,c){var f=THREE.ExtrudeGeometry.__v1,k=THREE.ExtrudeGeometry.__v2,h=THREE.ExtrudeGeometry.__v3,m=THREE.ExtrudeGeometry.__v4,n=THREE.ExtrudeGeometry.__v5,o=THREE.ExtrudeGeometry.__v6;f.set(b.x-e.x,b.y-e.y);k.set(b.x-c.x,b.y-c.y);f=f.normalize();k=k.normalize();h.set(-f.y,f.x);m.set(k.y,-k.x);n.copy(b).addSelf(h);o.copy(b).addSelf(m);if(n.equals(o))return m.clone();
-n.copy(e).addSelf(h);o.copy(c).addSelf(m);h=f.dot(m);m=o.subSelf(n).dot(m);h==0&&(console.log("Either infinite or no solutions!"),m==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));m/=h;if(m<0)return e=Math.atan2(e.y-b.y,e.x-b.x),b=Math.atan2(c.y-b.y,c.x-b.x),e>b&&(b+=Math.PI*2),anglec=(e+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function h(b){for(N=b.length;--N>=0;){la=N;oa=N-1;oa<0&&(oa=b.length-
-1);for(var e=0,c=v+w*2,e=0;e<c;e++){var f=o*e,k=o*(e+1),h=aa+la+f,m=aa+la+k,t=h,f=aa+oa+f,k=aa+oa+k,u=m;t+=Y;f+=Y;k+=Y;u+=Y;O.faces.push(new THREE.Face4(t,f,k,u,null,null,G));G&&(t=e/c,f=(e+1)/c,k=n+p*2,h=(O.vertices[h].position.z+p)/k,m=(O.vertices[m].position.z+p)/k,O.faceVertexUvs[0].push([new THREE.UV(h,t),new THREE.UV(m,t),new THREE.UV(m,f),new THREE.UV(h,f)]))}}}function k(b,e,c){O.vertices.push(new THREE.Vertex(new THREE.Vector3(b,e,c)))}function m(b,e,c){b+=Y;e+=Y;c+=Y;O.faces.push(new THREE.Face3(b,
-e,c,null,null,C));if(C){var f=I.maxY,k=I.maxX,h=O.vertices[e].position.x,e=O.vertices[e].position.y,m=O.vertices[c].position.x,c=O.vertices[c].position.y;O.faceVertexUvs[0].push([new THREE.UV(O.vertices[b].position.x/k,O.vertices[b].position.y/f),new THREE.UV(h/k,e/f),new THREE.UV(m/k,c/f)])}}var n=c.amount!==void 0?c.amount:100,p=c.bevelThickness!==void 0?c.bevelThickness:6,t=c.bevelSize!==void 0?c.bevelSize:p-2,w=c.bevelSegments!==void 0?c.bevelSegments:3,u=c.bevelEnabled!==void 0?c.bevelEnabled:
+THREE.ExtrudeGeometry.prototype.addShape=function(b,c){function e(b,c,e){c||console.log("die");return c.clone().multiplyScalar(e).addSelf(b)}function f(b,c,e){var f=THREE.ExtrudeGeometry.__v1,k=THREE.ExtrudeGeometry.__v2,h=THREE.ExtrudeGeometry.__v3,m=THREE.ExtrudeGeometry.__v4,n=THREE.ExtrudeGeometry.__v5,o=THREE.ExtrudeGeometry.__v6;f.set(b.x-c.x,b.y-c.y);k.set(b.x-e.x,b.y-e.y);f=f.normalize();k=k.normalize();h.set(-f.y,f.x);m.set(k.y,-k.x);n.copy(b).addSelf(h);o.copy(b).addSelf(m);if(n.equals(o))return m.clone();
+n.copy(c).addSelf(h);o.copy(e).addSelf(m);h=f.dot(m);m=o.subSelf(n).dot(m);h==0&&(console.log("Either infinite or no solutions!"),m==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));m/=h;if(m<0)return c=Math.atan2(c.y-b.y,c.x-b.x),b=Math.atan2(e.y-b.y,e.x-b.x),c>b&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function h(b){for(N=b.length;--N>=0;){la=N;oa=N-1;oa<0&&(oa=b.length-
+1);for(var c=0,e=v+w*2,c=0;c<e;c++){var f=o*c,k=o*(c+1),h=aa+la+f,m=aa+la+k,t=h,f=aa+oa+f,k=aa+oa+k,u=m;t+=Y;f+=Y;k+=Y;u+=Y;O.faces.push(new THREE.Face4(t,f,k,u,null,null,G));G&&(t=c/e,f=(c+1)/e,k=n+p*2,h=(O.vertices[h].position.z+p)/k,m=(O.vertices[m].position.z+p)/k,O.faceVertexUvs[0].push([new THREE.UV(h,t),new THREE.UV(m,t),new THREE.UV(m,f),new THREE.UV(h,f)]))}}}function k(b,c,e){O.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}function m(b,c,e){b+=Y;c+=Y;e+=Y;O.faces.push(new THREE.Face3(b,
+c,e,null,null,C));if(C){var f=I.maxY,k=I.maxX,h=O.vertices[c].position.x,c=O.vertices[c].position.y,m=O.vertices[e].position.x,e=O.vertices[e].position.y;O.faceVertexUvs[0].push([new THREE.UV(O.vertices[b].position.x/k,O.vertices[b].position.y/f),new THREE.UV(h/k,c/f),new THREE.UV(m/k,e/f)])}}var n=c.amount!==void 0?c.amount:100,p=c.bevelThickness!==void 0?c.bevelThickness:6,t=c.bevelSize!==void 0?c.bevelSize:p-2,w=c.bevelSegments!==void 0?c.bevelSegments:3,u=c.bevelEnabled!==void 0?c.bevelEnabled:
 !0,x=c.curveSegments!==void 0?c.curveSegments:12,v=c.steps!==void 0?c.steps:1,A=c.bendPath,z=c.extrudePath,y,D=!1,E=c.useSpacedPoints!==void 0?c.useSpacedPoints:!1,C=c.material,G=c.extrudeMaterial,I=this.shapebb;if(z)y=z.getPoints(x),v=y.length,D=!0,u=!1;u||(t=p=w=0);var P,K,B,O=this,Y=this.vertices.length;A&&b.addWrapPath(A);x=E?b.extractAllSpacedPoints(x):b.extractAllPoints(x);A=x.shape;x=x.holes;if(z=!THREE.Shape.Utils.isClockWise(A)){A=A.reverse();K=0;for(B=x.length;K<B;K++)P=x[K],THREE.Shape.Utils.isClockWise(P)&&
 (x[K]=P.reverse());z=!1}z=THREE.Shape.Utils.triangulateShape(A,x);E=A;K=0;for(B=x.length;K<B;K++)P=x[K],A=A.concat(P);var N,V,J,$,Z,Q,o=A.length,R=z.length,fa=[];N=0;V=E.length;la=V-1;for(oa=N+1;N<V;N++,la++,oa++)la==V&&(la=0),oa==V&&(oa=0),fa[N]=f(E[N],E[la],E[oa]);var ea=[],ha,ga=fa.concat();K=0;for(B=x.length;K<B;K++){P=x[K];ha=[];N=0;V=P.length;la=V-1;for(oa=N+1;N<V;N++,la++,oa++)la==V&&(la=0),oa==V&&(oa=0),ha[N]=f(P[N],P[la],P[oa]);ea.push(ha);ga=ga.concat(ha)}for(J=0;J<w;J++){$=J/w;Z=p*(1-$);
 $=t*Math.sin($*Math.PI/2);N=0;for(V=E.length;N<V;N++)Q=e(E[N],fa[N],$),k(Q.x,Q.y,-Z);K=0;for(B=x.length;K<B;K++){P=x[K];ha=ea[K];N=0;for(V=P.length;N<V;N++)Q=e(P[N],ha[N],$),k(Q.x,Q.y,-Z)}}$=t;for(N=0;N<o;N++)Q=u?e(A[N],ga[N],$):A[N],D?k(Q.x,Q.y+y[0].y,y[0].x):k(Q.x,Q.y,0);for(J=1;J<=v;J++)for(N=0;N<o;N++)Q=u?e(A[N],ga[N],$):A[N],D?k(Q.x,Q.y+y[J-1].y,y[J-1].x):k(Q.x,Q.y,n/v*J);for(J=w-1;J>=0;J--){$=J/w;Z=p*(1-$);$=t*Math.sin($*Math.PI/2);N=0;for(V=E.length;N<V;N++)Q=e(E[N],fa[N],$),k(Q.x,Q.y,n+Z);
 K=0;for(B=x.length;K<B;K++){P=x[K];ha=ea[K];N=0;for(V=P.length;N<V;N++)Q=e(P[N],ha[N],$),D?k(Q.x,Q.y+y[v-1].y,y[v-1].x+Z):k(Q.x,Q.y,n+Z)}}if(u){u=o*0;for(N=0;N<R;N++)t=z[N],m(t[2]+u,t[1]+u,t[0]+u);u=o*(v+w*2);for(N=0;N<R;N++)t=z[N],m(t[0]+u,t[1]+u,t[2]+u)}else{for(N=0;N<R;N++)t=z[N],m(t[2],t[1],t[0]);for(N=0;N<R;N++)t=z[N],m(t[0]+o*v,t[1]+o*v,t[2]+o*v)}var la,oa,aa=0;h(E);aa+=E.length;K=0;for(B=x.length;K<B;K++)P=x[K],h(P),aa+=P.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
-THREE.IcosahedronGeometry=function(b){function c(b,e,c){var f=Math.sqrt(b*b+e*e+c*c);return h.vertices.push(new THREE.Vertex(new THREE.Vector3(b/f,e/f,c/f)))-1}function e(b,e,c,f){f.faces.push(new THREE.Face3(b,e,c))}function f(b,e){var f=h.vertices[b].position,k=h.vertices[e].position;return c((f.x+k.x)/2,(f.y+k.y)/2,(f.z+k.z)/2)}var h=this,k=new THREE.Geometry;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;c(-1,b,0);c(1,b,0);c(-1,-b,0);c(1,-b,0);c(0,-1,b);c(0,1,b);c(0,-1,
+THREE.IcosahedronGeometry=function(b){function c(b,c,e){var f=Math.sqrt(b*b+c*c+e*e);return h.vertices.push(new THREE.Vertex(new THREE.Vector3(b/f,c/f,e/f)))-1}function e(b,c,e,f){f.faces.push(new THREE.Face3(b,c,e))}function f(b,e){var f=h.vertices[b].position,k=h.vertices[e].position;return c((f.x+k.x)/2,(f.y+k.y)/2,(f.z+k.z)/2)}var h=this,k=new THREE.Geometry;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;c(-1,b,0);c(1,b,0);c(-1,-b,0);c(1,-b,0);c(0,-1,b);c(0,1,b);c(0,-1,
 -b);c(0,1,-b);c(b,0,-1);c(b,0,1);c(-b,0,-1);c(-b,0,1);e(0,11,5,k);e(0,5,1,k);e(0,1,7,k);e(0,7,10,k);e(0,10,11,k);e(1,5,9,k);e(5,11,4,k);e(11,10,2,k);e(10,7,6,k);e(7,1,8,k);e(3,9,4,k);e(3,4,2,k);e(3,2,6,k);e(3,6,8,k);e(3,8,9,k);e(4,9,5,k);e(2,4,11,k);e(6,2,10,k);e(8,6,7,k);e(9,8,1,k);for(var m=0;m<this.subdivisions;m++){var b=new THREE.Geometry,n;for(n in k.faces){var p=f(k.faces[n].a,k.faces[n].b),t=f(k.faces[n].b,k.faces[n].c),w=f(k.faces[n].c,k.faces[n].a);e(k.faces[n].a,p,w,b);e(k.faces[n].b,t,
 p,b);e(k.faces[n].c,w,t,b);e(p,t,w,b)}k.faces=b.faces}h.faces=k.faces;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
 THREE.LatheGeometry=function(b,c,e){THREE.Geometry.call(this);this.steps=c||12;this.angle=e||2*Math.PI;for(var c=this.angle/this.steps,e=[],f=[],h=[],k=[],m=(new THREE.Matrix4).setRotationZ(c),n=0;n<b.length;n++)this.vertices.push(new THREE.Vertex(b[n])),e[n]=b[n].clone(),f[n]=this.vertices.length-1;for(var p=0;p<=this.angle+0.0010;p+=c){for(n=0;n<e.length;n++)p<this.angle?(e[n]=m.multiplyVector3(e[n].clone()),this.vertices.push(new THREE.Vertex(e[n])),h[n]=this.vertices.length-1):h=k;p==0&&(k=f);
 for(n=0;n<f.length-1;n++)this.faces.push(new THREE.Face4(h[n],h[n+1],f[n+1],f[n])),this.faceVertexUvs[0].push([new THREE.UV(1-p/this.angle,n/b.length),new THREE.UV(1-p/this.angle,(n+1)/b.length),new THREE.UV(1-(p-c)/this.angle,(n+1)/b.length),new THREE.UV(1-(p-c)/this.angle,n/b.length)]);f=h;h=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
-THREE.OctahedronGeometry=function(b,c){function e(e){var c=e.clone().normalize(),c=new THREE.Vertex(c.clone().multiplyScalar(b));c.index=m.vertices.push(c)-1;c.uv=new THREE.UV(Math.atan2(e.z,-e.x)/2/Math.PI+0.5,Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+0.5);return c}function f(b,e,c,n){n<1?(n=new THREE.Face3(b.index,e.index,c.index,[b.position,e.position,c.position]),n.centroid.addSelf(b.position).addSelf(e.position).addSelf(c.position).divideScalar(3),n.normal=n.centroid.clone().normalize(),
-m.faces.push(n),n=Math.atan2(n.centroid.z,-n.centroid.x),m.faceVertexUvs[0].push([k(b.uv,b.position,n),k(e.uv,e.position,n),k(c.uv,c.position,n)])):(n-=1,f(b,h(b,e),h(b,c),n),f(h(b,e),e,h(e,c),n),f(h(b,c),h(e,c),c,n),f(h(b,e),h(e,c),h(b,c),n))}function h(b,c){n[b.index]||(n[b.index]=[]);n[c.index]||(n[c.index]=[]);var f=n[b.index][c.index];f===void 0&&(n[b.index][c.index]=n[c.index][b.index]=f=e((new THREE.Vector3).add(b.position,c.position).divideScalar(2)));return f}function k(b,e,c){c<0&&b.u===
-1&&(b=new THREE.UV(b.u-1,b.v));e.x===0&&e.z===0&&(b=new THREE.UV(c/2/Math.PI+0.5,b.v));return b}THREE.Geometry.call(this);var c=isFinite(c)?c:3,m=this;e(new THREE.Vector3(1,0,0));e(new THREE.Vector3(-1,0,0));e(new THREE.Vector3(0,1,0));e(new THREE.Vector3(0,-1,0));e(new THREE.Vector3(0,0,1));e(new THREE.Vector3(0,0,-1));var n=[],p=this.vertices;f(p[0],p[2],p[4],c);f(p[0],p[4],p[3],c);f(p[0],p[3],p[5],c);f(p[0],p[5],p[2],c);f(p[1],p[2],p[5],c);f(p[1],p[5],p[3],c);f(p[1],p[3],p[4],c);f(p[1],p[4],p[2],
+THREE.OctahedronGeometry=function(b,c){function e(c){var e=c.clone().normalize(),e=new THREE.Vertex(e.clone().multiplyScalar(b));e.index=m.vertices.push(e)-1;e.uv=new THREE.UV(Math.atan2(c.z,-c.x)/2/Math.PI+0.5,Math.atan2(-c.y,Math.sqrt(c.x*c.x+c.z*c.z))/Math.PI+0.5);return e}function f(b,c,e,n){n<1?(n=new THREE.Face3(b.index,c.index,e.index,[b.position,c.position,e.position]),n.centroid.addSelf(b.position).addSelf(c.position).addSelf(e.position).divideScalar(3),n.normal=n.centroid.clone().normalize(),
+m.faces.push(n),n=Math.atan2(n.centroid.z,-n.centroid.x),m.faceVertexUvs[0].push([k(b.uv,b.position,n),k(c.uv,c.position,n),k(e.uv,e.position,n)])):(n-=1,f(b,h(b,c),h(b,e),n),f(h(b,c),c,h(c,e),n),f(h(b,e),h(c,e),e,n),f(h(b,c),h(c,e),h(b,e),n))}function h(b,c){n[b.index]||(n[b.index]=[]);n[c.index]||(n[c.index]=[]);var f=n[b.index][c.index];f===void 0&&(n[b.index][c.index]=n[c.index][b.index]=f=e((new THREE.Vector3).add(b.position,c.position).divideScalar(2)));return f}function k(b,c,e){e<0&&b.u===
+1&&(b=new THREE.UV(b.u-1,b.v));c.x===0&&c.z===0&&(b=new THREE.UV(e/2/Math.PI+0.5,b.v));return b}THREE.Geometry.call(this);var c=isFinite(c)?c:3,m=this;e(new THREE.Vector3(1,0,0));e(new THREE.Vector3(-1,0,0));e(new THREE.Vector3(0,1,0));e(new THREE.Vector3(0,-1,0));e(new THREE.Vector3(0,0,1));e(new THREE.Vector3(0,0,-1));var n=[],p=this.vertices;f(p[0],p[2],p[4],c);f(p[0],p[4],p[3],c);f(p[0],p[3],p[5],c);f(p[0],p[5],p[2],c);f(p[1],p[2],p[5],c);f(p[1],p[5],p[3],c);f(p[1],p[3],p[4],c);f(p[1],p[4],p[2],
 c);this.boundingSphere={radius:b}};THREE.OctahedronGeometry.prototype=new THREE.Geometry;THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
 THREE.PlaneGeometry=function(b,c,e,f){THREE.Geometry.call(this);var h,k=b/2,m=c/2,e=e||1,f=f||1,n=e+1,p=f+1;b/=e;var t=c/f;for(h=0;h<p;h++)for(c=0;c<n;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-k,-(h*t-m),0)));for(h=0;h<f;h++)for(c=0;c<e;c++)this.faces.push(new THREE.Face4(c+n*h,c+n*(h+1),c+1+n*(h+1),c+1+n*h)),this.faceVertexUvs[0].push([new THREE.UV(c/e,h/f),new THREE.UV(c/e,(h+1)/f),new THREE.UV((c+1)/e,(h+1)/f),new THREE.UV((c+1)/e,h/f)]);this.computeCentroids();this.computeFaceNormals()};
 THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
@@ -536,15 +536,15 @@ THREE.TorusKnotGeometry=function(b,c,e,f,h,k,m){function n(b,c,e,f,k,h){c=e/f*b;
 this.segmentsT;++c){var p=b/this.segmentsR*2*this.p*Math.PI,m=c/this.segmentsT*2*Math.PI,h=n(p,m,this.q,this.p,this.radius,this.heightScale),p=n(p+0.01,m,this.q,this.p,this.radius,this.heightScale);e.x=p.x-h.x;e.y=p.y-h.y;e.z=p.z-h.z;f.x=p.x+h.x;f.y=p.y+h.y;f.z=p.z+h.z;k.cross(e,f);f.cross(k,e);k.normalize();f.normalize();p=-this.tube*Math.cos(m);m=this.tube*Math.sin(m);h.x+=p*f.x+m*k.x;h.y+=p*f.y+m*k.y;h.z+=p*f.z+m*k.z;this.grid[b][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(h.x,h.y,
 h.z)))-1}}for(b=0;b<this.segmentsR;++b)for(c=0;c<this.segmentsT;++c){var f=(b+1)%this.segmentsR,k=(c+1)%this.segmentsT,h=this.grid[b][c],e=this.grid[f][c],f=this.grid[f][k],k=this.grid[b][k],m=new THREE.UV(b/this.segmentsR,c/this.segmentsT),p=new THREE.UV((b+1)/this.segmentsR,c/this.segmentsT),t=new THREE.UV((b+1)/this.segmentsR,(c+1)/this.segmentsT),w=new THREE.UV(b/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(h,e,f,k));this.faceVertexUvs[0].push([m,p,t,w])}this.computeCentroids();
 this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;THREE.SubdivisionModifier=function(b){this.subdivisions=b===void 0?1:b;this.useOldVertexColors=!1;this.supportUVs=!0};THREE.SubdivisionModifier.prototype.constructor=THREE.SubdivisionModifier;THREE.SubdivisionModifier.prototype.modify=function(b){for(var c=this.subdivisions;c-- >0;)this.smooth(b)};
-THREE.SubdivisionModifier.prototype.smooth=function(b){function c(b,e,c,f,n,p){var t=new THREE.Face4(b,e,c,f,null,n.color,n.material);if(m.useOldVertexColors){t.vertexColors=[];for(var v,o,w,x=0;x<4;x++){w=p[x];v=new THREE.Color;v.setRGB(0,0,0);for(var y=0;y<w.length;y++)o=n.vertexColors[w[y]-1],v.r+=o.r,v.g+=o.g,v.b+=o.b;v.r/=w.length;v.g/=w.length;v.b/=w.length;t.vertexColors[x]=v}}h.push(t);(!m.supportUVs||u.length!=0)&&k.push([u[b],u[e],u[c],u[f]])}function e(b,e){return Math.min(b,e)+"_"+Math.max(b,
-e)}var f=[],h=[],k=[],m=this,n=b.vertices,f=b.faces,p=n.concat(),t=[],w={},u=[],x,v,A,z,y,D=b.faceVertexUvs[0];x=0;for(v=D.length;x<v;x++){A=0;for(z=D[x].length;A<z;A++)y=f[x]["abcd".charAt(A)],u[y]||(u[y]=D[x][A])}var E;x=0;for(v=f.length;x<v;x++)if(y=f[x],t.push(y.centroid),p.push(new THREE.Vertex(y.centroid)),m.supportUVs&&u.length!=0){E=new THREE.UV;if(y instanceof THREE.Face3)E.u=u[y.a].u+u[y.b].u+u[y.c].u,E.v=u[y.a].v+u[y.b].v+u[y.c].v,E.u/=3,E.v/=3;else if(y instanceof THREE.Face4)E.u=u[y.a].u+
+THREE.SubdivisionModifier.prototype.smooth=function(b){function c(b,c,e,f,n,p){var t=new THREE.Face4(b,c,e,f,null,n.color,n.material);if(m.useOldVertexColors){t.vertexColors=[];for(var v,o,w,x=0;x<4;x++){w=p[x];v=new THREE.Color;v.setRGB(0,0,0);for(var y=0;y<w.length;y++)o=n.vertexColors[w[y]-1],v.r+=o.r,v.g+=o.g,v.b+=o.b;v.r/=w.length;v.g/=w.length;v.b/=w.length;t.vertexColors[x]=v}}h.push(t);(!m.supportUVs||u.length!=0)&&k.push([u[b],u[c],u[e],u[f]])}function e(b,c){return Math.min(b,c)+"_"+Math.max(b,
+c)}var f=[],h=[],k=[],m=this,n=b.vertices,f=b.faces,p=n.concat(),t=[],w={},u=[],x,v,A,z,y,D=b.faceVertexUvs[0];x=0;for(v=D.length;x<v;x++){A=0;for(z=D[x].length;A<z;A++)y=f[x]["abcd".charAt(A)],u[y]||(u[y]=D[x][A])}var E;x=0;for(v=f.length;x<v;x++)if(y=f[x],t.push(y.centroid),p.push(new THREE.Vertex(y.centroid)),m.supportUVs&&u.length!=0){E=new THREE.UV;if(y instanceof THREE.Face3)E.u=u[y.a].u+u[y.b].u+u[y.c].u,E.v=u[y.a].v+u[y.b].v+u[y.c].v,E.u/=3,E.v/=3;else if(y instanceof THREE.Face4)E.u=u[y.a].u+
 u[y.b].u+u[y.c].u+u[y.d].u,E.v=u[y.a].v+u[y.b].v+u[y.c].v+u[y.d].v,E.u/=4,E.v/=4;u.push(E)}z=function(b){function c(b,e,f){b[e]===void 0&&(b[e]=[]);b[e].push(f)}var f,k,h,m,n={};f=0;for(k=b.faces.length;f<k;f++)h=b.faces[f],h instanceof THREE.Face3?(m=e(h.a,h.b),c(n,m,f),m=e(h.b,h.c),c(n,m,f),m=e(h.c,h.a),c(n,m,f)):h instanceof THREE.Face4&&(m=e(h.a,h.b),c(n,m,f),m=e(h.b,h.c),c(n,m,f),m=e(h.c,h.d),c(n,m,f),m=e(h.d,h.a),c(n,m,f));return n}(b);var C,G,I=0,D=n.length,P;for(x in z)if(y=z[x],E=y[0],C=
 y[1],P=x.split("_"),v=P[0],P=P[1],G=new THREE.Vector3,y.length!=2?(G.addSelf(n[v].position),G.addSelf(n[P].position),G.multiplyScalar(0.5)):(G.addSelf(t[E]),G.addSelf(t[C]),G.addSelf(n[v].position),G.addSelf(n[P].position),G.multiplyScalar(0.25)),w[x]=D+f.length+I,p.push(new THREE.Vertex(G)),I++,m.supportUVs&&u.length!=0)E=new THREE.UV,E.u=u[v].u+u[P].u,E.v=u[v].v+u[P].v,E.u/=2,E.v/=2,u.push(E);x=0;for(v=t.length;x<v;x++)y=f[x],E=D+x,y instanceof THREE.Face3?(C=e(y.a,y.b),P=e(y.b,y.c),I=e(y.c,y.a),
 c(E,w[C],y.b,w[P],y,["123","12","2","23"]),c(E,w[P],y.c,w[I],y,["123","23","3","31"]),c(E,w[I],y.a,w[C],y,["123","31","1","12"])):y instanceof THREE.Face4?(C=e(y.a,y.b),P=e(y.b,y.c),I=e(y.c,y.d),G=e(y.d,y.a),c(E,w[C],y.b,w[P],y,["1234","12","2","23"]),c(E,w[P],y.c,w[I],y,["1234","23","3","34"]),c(E,w[I],y.d,w[G],y,["1234","34","4","41"]),c(E,w[G],y.a,w[C],y,["1234","41","1","12"])):console.log("face should be a face!",y);var f=p,K={},B={},p=function(b,c){K[b]===void 0&&(K[b]=[]);K[b].push(c)},w=function(b,
 c){B[b]===void 0&&(B[b]={});B[b][c]=null};for(x in z)y=z[x],P=x.split("_"),v=P[0],P=P[1],p(v,[v,P]),p(P,[v,P]),E=y[0],C=y[1],w(v,E),C?w(v,C):w(v,E),w(P,E),C?w(P,C):w(P,E);p=new THREE.Vector3;w=new THREE.Vector3;x=0;for(v=n.length;x<v;x++)if(K[x]!==void 0){p.set(0,0,0);w.set(0,0,0);z=new THREE.Vector3(0,0,0);D=0;for(A in B[x])p.addSelf(t[A]),D++;p.divideScalar(D);D=K[x].length;for(A=0;A<D;A++)y=K[x][A],y=n[y[0]].position.clone().addSelf(n[y[1]].position).divideScalar(2),w.addSelf(y);w.divideScalar(D);
 z.addSelf(n[x].position);z.multiplyScalar(D-3);z.addSelf(p);z.addSelf(w.multiplyScalar(2));z.divideScalar(D);f[x].position=z}b.vertices=f;b.faces=h;b.faceVertexUvs[0]=k;delete b.__tmpVertices;b.computeCentroids();b.computeFaceNormals();b.computeVertexNormals()};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={constructor:THREE.Loader,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.length<1?"":b.join("/")+"/"},init_materials:function(b,c,e){b.materials=[];for(var f=0;f<c.length;++f)b.materials[f]=[THREE.Loader.prototype.createMaterial(c[f],e)]},hasNormals:function(b){var c,e,f=b.materials.length;for(e=0;e<f;e++)if(c=b.materials[e][0],c instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(b,c){function e(b){b=Math.log(b)/Math.LN2;return Math.floor(b)==
+1E3).toFixed(2)+" KB";this.statusDomElement.innerHTML=c},extractUrlbase:function(b){b=b.split("/");b.pop();return b.length<1?"":b.join("/")+"/"},initMaterials:function(b,c,e){b.materials=[];for(var f=0;f<c.length;++f)b.materials[f]=[THREE.Loader.prototype.createMaterial(c[f],e)]},hasNormals:function(b){var c,e,f=b.materials.length;for(e=0;e<f;e++)if(c=b.materials[e][0],c instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(b,c){function e(b){b=Math.log(b)/Math.LN2;return Math.floor(b)==
 b}function f(b,c){var f=new Image;f.onload=function(){if(!e(this.width)||!e(this.height)){var c=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),f=Math.pow(2,Math.round(Math.log(this.height)/Math.LN2));b.image.width=c;b.image.height=f;b.image.getContext("2d").drawImage(this,0,0,c,f)}else b.image=this;b.needsUpdate=!0};f.src=c}function h(b,e,h,k,m,n){var p=document.createElement("canvas");b[e]=new THREE.Texture(p);b[e].sourceFile=h;if(k){b[e].repeat.set(k[0],k[1]);if(k[0]!=1)b[e].wrapS=THREE.RepeatWrapping;
 if(k[1]!=1)b[e].wrapT=THREE.RepeatWrapping}m&&b[e].offset.set(m[0],m[1]);if(n){k={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(k[n[0]]!==void 0)b[e].wrapS=k[n[0]];if(k[n[1]]!==void 0)b[e].wrapT=k[n[1]]}f(b[e],c+"/"+h)}function k(b){return(b[0]*255<<16)+(b[1]*255<<8)+b[2]*255}var m,n,p;n="MeshLambertMaterial";m={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:b.wireframe};b.shading&&(b.shading=="Phong"?n="MeshPhongMaterial":b.shading=="Basic"&&(n="MeshBasicMaterial"));
 if(b.blending)if(b.blending=="Additive")m.blending=THREE.AdditiveBlending;else if(b.blending=="Subtractive")m.blending=THREE.SubtractiveBlending;else if(b.blending=="Multiply")m.blending=THREE.MultiplyBlending;if(b.transparent!==void 0||b.opacity<1)m.transparent=b.transparent;if(b.depthTest!==void 0)m.depthTest=b.depthTest;if(b.vertexColors!==void 0)if(b.vertexColors=="face")m.vertexColors=THREE.FaceColors;else if(b.vertexColors)m.vertexColors=THREE.VertexColors;if(b.colorDiffuse)m.color=k(b.colorDiffuse);
@@ -552,104 +552,104 @@ else if(b.DbgColor)m.color=b.DbgColor;if(b.colorSpecular)m.specular=k(b.colorSpe
 b.mapSpecular&&c&&h(m,"specularMap",b.mapSpecular,b.mapSpecularRepeat,b.mapSpecularOffset,b.mapSpecularWrap);if(b.mapNormal){var t=THREE.ShaderUtils.lib.normal,w=THREE.UniformsUtils.clone(t.uniforms),u=m.color;n=m.specular;p=m.ambient;var x=m.shininess;w.tNormal.texture=m.normalMap;if(b.mapNormalFactor)w.uNormalScale.value=b.mapNormalFactor;if(m.map)w.tDiffuse.texture=m.map,w.enableDiffuse.value=!0;if(m.specularMap)w.tSpecular.texture=m.specularMap,w.enableSpecular.value=!0;if(m.lightMap)w.tAO.texture=
 m.lightMap,w.enableAO.value=!0;w.uDiffuseColor.value.setHex(u);w.uSpecularColor.value.setHex(n);w.uAmbientColor.value.setHex(p);w.uShininess.value=x;if(m.opacity)w.uOpacity.value=m.opacity;m=new THREE.ShaderMaterial({fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:w,lights:!0,fog:!0})}else m=new THREE[n](m);return m}};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;
 THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
-THREE.BinaryLoader.prototype.load=function(b){var c=b.model,e=b.callback,f=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(c),h=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(c),b=(new Date).getTime(),c=new Worker(c),k=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,e,h,f,k)};c.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};
-c.postMessage(b)};
+THREE.BinaryLoader.prototype.load=function(b,c,e,f){if(b instanceof Object){console.warn("DEPRECATED: BinaryLoader( parameters ) is now BinaryLoader( url, callback, texturePath, binaryPath ).");var h=b,b=h.model,c=h.callback,e=h.texture_path,f=h.bin_path}var e=e?e:this.extractUrlbase(b),f=f?f:this.extractUrlbase(b),h=Date.now(),b=new Worker(b),k=this.showProgress?THREE.Loader.prototype.updateProgress:null;b.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,
+c,f,e,k)};b.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};b.postMessage(h)};
 THREE.BinaryLoader.prototype.loadAjaxBuffers=function(b,c,e,f,h,k){var m=new XMLHttpRequest,n=f+"/"+b,p=0;m.onreadystatechange=function(){m.readyState==4?m.status==200||m.status==0?THREE.BinaryLoader.prototype.createBinModel(m.responseText,e,h,c):alert("Couldn't load ["+n+"] ["+m.status+"]"):m.readyState==3?k&&(p==0&&(p=m.getResponseHeader("Content-Length")),k({total:p,loaded:m.responseText.length})):m.readyState==2&&(p=m.getResponseHeader("Content-Length"))};m.open("GET",n,!0);m.overrideMimeType("text/plain; charset=x-user-defined");
 m.setRequestHeader("Content-Type","text/plain");m.send(null)};
-THREE.BinaryLoader.prototype.createBinModel=function(b,c,e,f){var h=function(e){function c(b,e){var f=w(b,e),h=w(b,e+1),k=w(b,e+2),m=w(b,e+3),n=(m<<1&255|k>>7)-127;f|=(k&127)<<16|h<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,e){var c=w(b,e),f=w(b,e+1),k=w(b,e+2);return(w(b,e+3)<<24)+(k<<16)+(f<<8)+c}function p(b,e){var c=w(b,e);return(w(b,e+1)<<8)+c}function t(b,e){var c=w(b,e);return c>127?c-256:c}function w(b,e){return b.charCodeAt(e)&255}function u(e){var c,
-f,k;c=h(b,e);f=h(b,e+P);k=h(b,e+K);e=p(b,e+B);D.faces.push(new THREE.Face3(c,f,k,null,null,D.materials[e]))}function x(e){var c,f,k,m,o,t;c=h(b,e);f=h(b,e+P);k=h(b,e+K);m=p(b,e+B);o=h(b,e+O);t=h(b,e+Y);e=h(b,e+N);m=D.materials[m];var u=G[t*3],v=G[t*3+1];t=G[t*3+2];var w=G[e*3],x=G[e*3+1],e=G[e*3+2];D.faces.push(new THREE.Face3(c,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(u,v,t),new THREE.Vector3(w,x,e)],null,m))}function v(e){var c,f,k,m;c=h(b,e);f=h(b,e+V);k=h(b,e+J);m=h(b,
-e+$);e=p(b,e+Z);D.faces.push(new THREE.Face4(c,f,k,m,null,null,D.materials[e]))}function A(e){var c,f,k,m,t,u,v,w;c=h(b,e);f=h(b,e+V);k=h(b,e+J);m=h(b,e+$);t=p(b,e+Z);u=h(b,e+Q);v=h(b,e+o);w=h(b,e+R);e=h(b,e+fa);t=D.materials[t];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var U=G[w*3],L=G[w*3+1];w=G[w*3+2];var z=G[e*3],A=G[e*3+1],e=G[e*3+2];D.faces.push(new THREE.Face4(c,f,k,m,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(U,L,w),new THREE.Vector3(z,A,e)],null,t))}
-function z(e){var c,f,k,m;c=h(b,e);f=h(b,e+ea);k=h(b,e+ha);e=I[c*2];m=I[c*2+1];c=I[f*2];var o=D.faceVertexUvs[0];f=I[f*2+1];var p=I[k*2];k=I[k*2+1];var t=[];t.push(new THREE.UV(e,m));t.push(new THREE.UV(c,f));t.push(new THREE.UV(p,k));o.push(t)}function y(e){var c,f,k,m,o,p;c=h(b,e);f=h(b,e+ga);k=h(b,e+la);m=h(b,e+oa);e=I[c*2];o=I[c*2+1];c=I[f*2];p=I[f*2+1];f=I[k*2];var t=D.faceVertexUvs[0];k=I[k*2+1];var u=I[m*2];m=I[m*2+1];var v=[];v.push(new THREE.UV(e,o));v.push(new THREE.UV(c,p));v.push(new THREE.UV(f,
-k));v.push(new THREE.UV(u,m));t.push(v)}var D=this,E=0,C,G=[],I=[],P,K,B,O,Y,N,V,J,$,Z,Q,o,R,fa,ea,ha,ga,la,oa,aa,T,X,ia,ja,sa;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(D,f,e);C={signature:b.substr(E,8),header_bytes:w(b,E+8),vertex_coordinate_bytes:w(b,E+9),normal_coordinate_bytes:w(b,E+10),uv_coordinate_bytes:w(b,E+11),vertex_index_bytes:w(b,E+12),normal_index_bytes:w(b,E+13),uv_index_bytes:w(b,E+14),material_index_bytes:w(b,E+15),nvertices:h(b,E+16),nnormals:h(b,E+16+4),nuvs:h(b,
+THREE.BinaryLoader.prototype.createBinModel=function(b,c,e,f){var h=function(c){function e(b,c){var f=w(b,c),h=w(b,c+1),k=w(b,c+2),m=w(b,c+3),n=(m<<1&255|k>>7)-127;f|=(k&127)<<16|h<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,c){var e=w(b,c),f=w(b,c+1),k=w(b,c+2);return(w(b,c+3)<<24)+(k<<16)+(f<<8)+e}function p(b,c){var e=w(b,c);return(w(b,c+1)<<8)+e}function t(b,c){var e=w(b,c);return e>127?e-256:e}function w(b,c){return b.charCodeAt(c)&255}function u(c){var e,
+f,k;e=h(b,c);f=h(b,c+P);k=h(b,c+K);c=p(b,c+B);D.faces.push(new THREE.Face3(e,f,k,null,null,D.materials[c]))}function x(c){var e,f,k,m,o,t;e=h(b,c);f=h(b,c+P);k=h(b,c+K);m=p(b,c+B);o=h(b,c+O);t=h(b,c+Y);c=h(b,c+N);m=D.materials[m];var u=G[t*3],v=G[t*3+1];t=G[t*3+2];var w=G[c*3],x=G[c*3+1],c=G[c*3+2];D.faces.push(new THREE.Face3(e,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(u,v,t),new THREE.Vector3(w,x,c)],null,m))}function v(c){var e,f,k,m;e=h(b,c);f=h(b,c+V);k=h(b,c+J);m=h(b,
+c+$);c=p(b,c+Z);D.faces.push(new THREE.Face4(e,f,k,m,null,null,D.materials[c]))}function A(c){var e,f,k,m,t,u,v,w;e=h(b,c);f=h(b,c+V);k=h(b,c+J);m=h(b,c+$);t=p(b,c+Z);u=h(b,c+Q);v=h(b,c+o);w=h(b,c+R);c=h(b,c+fa);t=D.materials[t];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var U=G[w*3],L=G[w*3+1];w=G[w*3+2];var z=G[c*3],A=G[c*3+1],c=G[c*3+2];D.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(U,L,w),new THREE.Vector3(z,A,c)],null,t))}
+function z(c){var e,f,k,m;e=h(b,c);f=h(b,c+ea);k=h(b,c+ha);c=I[e*2];m=I[e*2+1];e=I[f*2];var o=D.faceVertexUvs[0];f=I[f*2+1];var p=I[k*2];k=I[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,k));o.push(t)}function y(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+ga);k=h(b,c+la);m=h(b,c+oa);c=I[e*2];o=I[e*2+1];e=I[f*2];p=I[f*2+1];f=I[k*2];var t=D.faceVertexUvs[0];k=I[k*2+1];var u=I[m*2];m=I[m*2+1];var v=[];v.push(new THREE.UV(c,o));v.push(new THREE.UV(e,p));v.push(new THREE.UV(f,
+k));v.push(new THREE.UV(u,m));t.push(v)}var D=this,E=0,C,G=[],I=[],P,K,B,O,Y,N,V,J,$,Z,Q,o,R,fa,ea,ha,ga,la,oa,aa,T,X,ia,ja,sa;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(D,f,c);C={signature:b.substr(E,8),header_bytes:w(b,E+8),vertex_coordinate_bytes:w(b,E+9),normal_coordinate_bytes:w(b,E+10),uv_coordinate_bytes:w(b,E+11),vertex_index_bytes:w(b,E+12),normal_index_bytes:w(b,E+13),uv_index_bytes:w(b,E+14),material_index_bytes:w(b,E+15),nvertices:h(b,E+16),nnormals:h(b,E+16+4),nuvs:h(b,
 E+16+8),ntri_flat:h(b,E+16+12),ntri_smooth:h(b,E+16+16),ntri_flat_uv:h(b,E+16+20),ntri_smooth_uv:h(b,E+16+24),nquad_flat:h(b,E+16+28),nquad_smooth:h(b,E+16+32),nquad_flat_uv:h(b,E+16+36),nquad_smooth_uv:h(b,E+16+40)};E+=C.header_bytes;P=C.vertex_index_bytes;K=C.vertex_index_bytes*2;B=C.vertex_index_bytes*3;O=C.vertex_index_bytes*3+C.material_index_bytes;Y=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;N=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;V=C.vertex_index_bytes;
-J=C.vertex_index_bytes*2;$=C.vertex_index_bytes*3;Z=C.vertex_index_bytes*4;Q=C.vertex_index_bytes*4+C.material_index_bytes;o=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;R=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;fa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;ea=C.uv_index_bytes;ha=C.uv_index_bytes*2;ga=C.uv_index_bytes;la=C.uv_index_bytes*2;oa=C.uv_index_bytes*3;e=C.vertex_index_bytes*3+C.material_index_bytes;sa=C.vertex_index_bytes*
-4+C.material_index_bytes;aa=C.ntri_flat*e;T=C.ntri_smooth*(e+C.normal_index_bytes*3);X=C.ntri_flat_uv*(e+C.uv_index_bytes*3);ia=C.ntri_smooth_uv*(e+C.normal_index_bytes*3+C.uv_index_bytes*3);ja=C.nquad_flat*sa;e=C.nquad_smooth*(sa+C.normal_index_bytes*4);sa=C.nquad_flat_uv*(sa+C.uv_index_bytes*4);E+=function(e){for(var f,h,k,n=C.vertex_coordinate_bytes*3,o=e+C.nvertices*n;e<o;e+=n)f=c(b,e),h=c(b,e+C.vertex_coordinate_bytes),k=c(b,e+C.vertex_coordinate_bytes*2),D.vertices.push(new THREE.Vertex(new THREE.Vector3(f,
-h,k)));return C.nvertices*n}(E);E+=function(e){for(var c,f,h,k=C.normal_coordinate_bytes*3,m=e+C.nnormals*k;e<m;e+=k)c=t(b,e),f=t(b,e+C.normal_coordinate_bytes),h=t(b,e+C.normal_coordinate_bytes*2),G.push(c/127,f/127,h/127);return C.nnormals*k}(E);E+=function(e){for(var f,h,k=C.uv_coordinate_bytes*2,n=e+C.nuvs*k;e<n;e+=k)f=c(b,e),h=c(b,e+C.uv_coordinate_bytes),I.push(f,h);return C.nuvs*k}(E);aa=E+aa;T=aa+T;X=T+X;ia=X+ia;ja=ia+ja;e=ja+e;sa=e+sa;(function(b){var e,c=C.vertex_index_bytes*3+C.material_index_bytes,
-f=c+C.uv_index_bytes*3,h=b+C.ntri_flat_uv*f;for(e=b;e<h;e+=f)u(e),z(e+c);return h-b})(T);(function(b){var e,c=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*3,f=c+C.uv_index_bytes*3,h=b+C.ntri_smooth_uv*f;for(e=b;e<h;e+=f)x(e),z(e+c);return h-b})(X);(function(b){var e,c=C.vertex_index_bytes*4+C.material_index_bytes,f=c+C.uv_index_bytes*4,h=b+C.nquad_flat_uv*f;for(e=b;e<h;e+=f)v(e),y(e+c);return h-b})(e);(function(b){var e,c=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*
-4,f=c+C.uv_index_bytes*4,h=b+C.nquad_smooth_uv*f;for(e=b;e<h;e+=f)A(e),y(e+c);return h-b})(sa);(function(b){var e,c=C.vertex_index_bytes*3+C.material_index_bytes,f=b+C.ntri_flat*c;for(e=b;e<f;e+=c)u(e);return f-b})(E);(function(b){var e,c=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*3,f=b+C.ntri_smooth*c;for(e=b;e<f;e+=c)x(e);return f-b})(aa);(function(b){var e,c=C.vertex_index_bytes*4+C.material_index_bytes,f=b+C.nquad_flat*c;for(e=b;e<f;e+=c)v(e);return f-b})(ia);(function(b){var e,
-c=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*4,f=b+C.nquad_smooth*c;for(e=b;e<f;e+=c)A(e);return f-b})(ja);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};h.prototype=new THREE.Geometry;h.prototype.constructor=h;c(new h(e))};
+J=C.vertex_index_bytes*2;$=C.vertex_index_bytes*3;Z=C.vertex_index_bytes*4;Q=C.vertex_index_bytes*4+C.material_index_bytes;o=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;R=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;fa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;ea=C.uv_index_bytes;ha=C.uv_index_bytes*2;ga=C.uv_index_bytes;la=C.uv_index_bytes*2;oa=C.uv_index_bytes*3;c=C.vertex_index_bytes*3+C.material_index_bytes;sa=C.vertex_index_bytes*
+4+C.material_index_bytes;aa=C.ntri_flat*c;T=C.ntri_smooth*(c+C.normal_index_bytes*3);X=C.ntri_flat_uv*(c+C.uv_index_bytes*3);ia=C.ntri_smooth_uv*(c+C.normal_index_bytes*3+C.uv_index_bytes*3);ja=C.nquad_flat*sa;c=C.nquad_smooth*(sa+C.normal_index_bytes*4);sa=C.nquad_flat_uv*(sa+C.uv_index_bytes*4);E+=function(c){for(var f,h,k,n=C.vertex_coordinate_bytes*3,o=c+C.nvertices*n;c<o;c+=n)f=e(b,c),h=e(b,c+C.vertex_coordinate_bytes),k=e(b,c+C.vertex_coordinate_bytes*2),D.vertices.push(new THREE.Vertex(new THREE.Vector3(f,
+h,k)));return C.nvertices*n}(E);E+=function(c){for(var e,f,h,k=C.normal_coordinate_bytes*3,m=c+C.nnormals*k;c<m;c+=k)e=t(b,c),f=t(b,c+C.normal_coordinate_bytes),h=t(b,c+C.normal_coordinate_bytes*2),G.push(e/127,f/127,h/127);return C.nnormals*k}(E);E+=function(c){for(var f,h,k=C.uv_coordinate_bytes*2,n=c+C.nuvs*k;c<n;c+=k)f=e(b,c),h=e(b,c+C.uv_coordinate_bytes),I.push(f,h);return C.nuvs*k}(E);aa=E+aa;T=aa+T;X=T+X;ia=X+ia;ja=ia+ja;c=ja+c;sa=c+sa;(function(b){var c,e=C.vertex_index_bytes*3+C.material_index_bytes,
+f=e+C.uv_index_bytes*3,h=b+C.ntri_flat_uv*f;for(c=b;c<h;c+=f)u(c),z(c+e);return h-b})(T);(function(b){var c,e=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*3,f=e+C.uv_index_bytes*3,h=b+C.ntri_smooth_uv*f;for(c=b;c<h;c+=f)x(c),z(c+e);return h-b})(X);(function(b){var c,e=C.vertex_index_bytes*4+C.material_index_bytes,f=e+C.uv_index_bytes*4,h=b+C.nquad_flat_uv*f;for(c=b;c<h;c+=f)v(c),y(c+e);return h-b})(c);(function(b){var c,e=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*
+4,f=e+C.uv_index_bytes*4,h=b+C.nquad_smooth_uv*f;for(c=b;c<h;c+=f)A(c),y(c+e);return h-b})(sa);(function(b){var c,e=C.vertex_index_bytes*3+C.material_index_bytes,f=b+C.ntri_flat*e;for(c=b;c<f;c+=e)u(c);return f-b})(E);(function(b){var c,e=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*3,f=b+C.ntri_smooth*e;for(c=b;c<f;c+=e)x(c);return f-b})(aa);(function(b){var c,e=C.vertex_index_bytes*4+C.material_index_bytes,f=b+C.nquad_flat*e;for(c=b;c<f;c+=e)v(c);return f-b})(ia);(function(b){var c,
+e=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*4,f=b+C.nquad_smooth*e;for(c=b;c<f;c+=e)A(c);return f-b})(ja);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};h.prototype=new THREE.Geometry;h.prototype.constructor=h;c(new h(e))};
 THREE.ColladaLoader=function(){function b(b,f,h){T=b;f=f||ja;h!==void 0&&(b=h.split("/"),b.pop(),Ga=b.length<1?"":b.join("/")+"/");ma=c("//dae:library_images/dae:image",m,"image");ra=c("//dae:library_materials/dae:material",B,"material");xa=c("//dae:library_effects/dae:effect",J,"effect");qa=c("//dae:library_geometries/dae:geometry",y,"geometry");ua=c("//dae:library_controllers/dae:controller",n,"controller");ca=c("//dae:library_animations/dae:animation",Z,"animation");Ca=c(".//dae:library_visual_scenes/dae:visual_scene",
-w,"visual_scene");Fa=[];Da=[];(b=T.evaluate(".//dae:scene/dae:instance_visual_scene",T,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(b=b.getAttribute("url").replace(/^#/,""),ia=Ca[b]):ia=null;X=new THREE.Object3D;for(b=0;b<ia.nodes.length;b++)X.add(k(ia.nodes[b]));e();for(var o in ca);o={scene:X,morphs:Fa,skins:Da,dae:{images:ma,materials:ra,effects:xa,geometries:qa,controllers:ua,animations:ca,visualScenes:Ca,scene:ia}};f&&f(o);return o}function c(b,e,c){for(var b=T.evaluate(b,
-T,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),f={},h=b.iterateNext(),k=0;h;){h=(new e).parse(h);if(h.id.length==0)h.id=c+k++;f[h.id]=h;h=b.iterateNext()}return f}function e(){var b=1E6,e=-b,c=0,f;for(f in ca)for(var h=ca[f],k=0;k<h.sampler.length;k++){var m=h.sampler[k];m.create();b=Math.min(b,m.startTime);e=Math.max(e,m.endTime);c=Math.max(c,m.input.length)}return{start:b,end:e,frames:c}}function f(b,e,c,h){b.world=b.world||new THREE.Matrix4;b.world.copy(b.matrix);if(b.channels&&b.channels.length){var k=
-b.channels[0].sampler.output[c];k instanceof THREE.Matrix4&&b.world.copy(k)}h&&b.world.multiply(h,b.world);e.push(b);for(h=0;h<b.nodes.length;h++)f(b.nodes[h],e,c,b.world)}function h(b,c,h){var k=ua[c.url];if(!k||!k.skin)console.log("ColladaLoader: Could not find skin controller.");else if(!c.skeleton||!c.skeleton.length)console.log("ColladaLoader: Could not find the skeleton for the skin. ");else{var m=e(),c=ia.getChildById(c.skeleton[0],!0)||ia.getChildBySid(c.skeleton[0],!0),n,o,p,t,u=new THREE.Vector3,
+w,"visual_scene");Fa=[];Da=[];(b=T.evaluate(".//dae:scene/dae:instance_visual_scene",T,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(b=b.getAttribute("url").replace(/^#/,""),ia=Ca[b]):ia=null;X=new THREE.Object3D;for(b=0;b<ia.nodes.length;b++)X.add(k(ia.nodes[b]));e();for(var o in ca);o={scene:X,morphs:Fa,skins:Da,dae:{images:ma,materials:ra,effects:xa,geometries:qa,controllers:ua,animations:ca,visualScenes:Ca,scene:ia}};f&&f(o);return o}function c(b,c,e){for(var b=T.evaluate(b,
+T,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),f={},h=b.iterateNext(),k=0;h;){h=(new c).parse(h);if(h.id.length==0)h.id=e+k++;f[h.id]=h;h=b.iterateNext()}return f}function e(){var b=1E6,c=-b,e=0,f;for(f in ca)for(var h=ca[f],k=0;k<h.sampler.length;k++){var m=h.sampler[k];m.create();b=Math.min(b,m.startTime);c=Math.max(c,m.endTime);e=Math.max(e,m.input.length)}return{start:b,end:c,frames:e}}function f(b,c,e,h){b.world=b.world||new THREE.Matrix4;b.world.copy(b.matrix);if(b.channels&&b.channels.length){var k=
+b.channels[0].sampler.output[e];k instanceof THREE.Matrix4&&b.world.copy(k)}h&&b.world.multiply(h,b.world);c.push(b);for(h=0;h<b.nodes.length;h++)f(b.nodes[h],c,e,b.world)}function h(b,c,h){var k=ua[c.url];if(!k||!k.skin)console.log("ColladaLoader: Could not find skin controller.");else if(!c.skeleton||!c.skeleton.length)console.log("ColladaLoader: Could not find the skeleton for the skin. ");else{var m=e(),c=ia.getChildById(c.skeleton[0],!0)||ia.getChildBySid(c.skeleton[0],!0),n,o,p,t,u=new THREE.Vector3,
 v;for(n=0;n<b.vertices.length;n++)k.skin.bindShapeMatrix.multiplyVector3(b.vertices[n].position);for(h=0;h<m.frames;h++){var w=[],x=[];for(n=0;n<b.vertices.length;n++)x.push(new THREE.Vertex(new THREE.Vector3));f(c,w,h);n=w;o=k.skin;for(t=0;t<n.length;t++)if(p=n[t],v=-1,p.type=="JOINT"){for(var y=0;y<o.joints.length;y++)if(p.sid==o.joints[y]){v=y;break}if(v>=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];for(y=0;y<o.weights.length;y++)for(var z=
-0;z<o.weights[y].length;z++){var A=o.weights[y][z];A.joint==v&&p.weights.push(A)}}else throw"ColladaLoader: Could not find joint '"+p.sid+"'.";}for(n=0;n<w.length;n++)if(w[n].type=="JOINT")for(o=0;o<w[n].weights.length;o++)p=w[n].weights[o],t=p.index,p=p.weight,v=b.vertices[t],t=x[t],u.x=v.position.x,u.y=v.position.y,u.z=v.position.z,w[n].skinningMatrix.multiplyVector3(u),t.position.x+=u.x*p,t.position.y+=u.y*p,t.position.z+=u.z*p;b.morphTargets.push({name:"target_"+h,vertices:x})}}}function k(b){var e=
-new THREE.Object3D,c,f,m;e.name=b.id||"";e.matrixAutoUpdate=!1;e.matrix=b.matrix;for(m=0;m<b.controllers.length;m++){var n=ua[b.controllers[m].url];switch(n.type){case "skin":if(qa[n.skin.source]){var o=new z;o.url=n.skin.source;o.instance_material=b.controllers[m].instance_material;b.geometries.push(o);c=b.controllers[m]}else if(ua[n.skin.source]&&(f=n=ua[n.skin.source],n.morph&&qa[n.morph.source]))o=new z,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o);
-break;case "morph":if(qa[n.morph.source])o=new z,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o),f=b.controllers[m];console.log("ColladaLoader: Morph-controller partially supported.")}}for(m=0;m<b.geometries.length;m++){var n=b.geometries[m],o=n.instance_material,n=qa[n.url],p={},t=0,u;if(n&&n.mesh&&n.mesh.primitives){if(e.name.length==0)e.name=n.id;if(o)for(j=0;j<o.length;j++){u=o[j];var w=xa[ra[u.target].instance_effect.url].shader;w.material.opacity=
-!w.material.opacity?1:w.material.opacity;u=p[u.symbol]=w.material;t++}o=u||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});n=n.mesh.geometry3js;if(t>1){o=new THREE.MeshFaceMaterial;for(j=0;j<n.faces.length;j++)t=n.faces[j],t.materials=[p[t.daeMaterial]]}if(c!==void 0)h(n,c),o.morphTargets=!0,o=new THREE.SkinnedMesh(n,o),o.skeleton=c.skeleton,o.skinController=ua[c.url],o.skinInstanceController=c,o.name="skin_"+Da.length,Da.push(o);else if(f!==void 0){p=n;t=f instanceof v?
-ua[f.url]:f;if(!t||!t.morph)console.log("could not find morph controller!");else{t=t.morph;for(w=0;w<t.targets.length;w++){var x=qa[t.targets[w]];if(x.mesh&&x.mesh.primitives&&x.mesh.primitives.length)x=x.mesh.primitives[0].geometry,x.vertices.length===p.vertices.length&&p.morphTargets.push({name:"target_1",vertices:x.vertices})}p.morphTargets.push({name:"target_Z",vertices:p.vertices})}o.morphTargets=!0;o=new THREE.Mesh(n,o);o.name="morph_"+Fa.length;Fa.push(o)}else o=new THREE.Mesh(n,o);e.add(o)}}for(m=
-0;m<b.nodes.length;m++)e.add(k(b.nodes[m],b));return e}function m(){this.init_from=this.id=""}function n(){this.type=this.name=this.id="";this.morph=this.skin=null}function p(){this.weights=this.targets=this.source=this.method=null}function t(){this.source="";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function w(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function u(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=
+0;z<o.weights[y].length;z++){var A=o.weights[y][z];A.joint==v&&p.weights.push(A)}}else throw"ColladaLoader: Could not find joint '"+p.sid+"'.";}for(n=0;n<w.length;n++)if(w[n].type=="JOINT")for(o=0;o<w[n].weights.length;o++)p=w[n].weights[o],t=p.index,p=p.weight,v=b.vertices[t],t=x[t],u.x=v.position.x,u.y=v.position.y,u.z=v.position.z,w[n].skinningMatrix.multiplyVector3(u),t.position.x+=u.x*p,t.position.y+=u.y*p,t.position.z+=u.z*p;b.morphTargets.push({name:"target_"+h,vertices:x})}}}function k(b){var c=
+new THREE.Object3D,e,f,m;c.name=b.id||"";c.matrixAutoUpdate=!1;c.matrix=b.matrix;for(m=0;m<b.controllers.length;m++){var n=ua[b.controllers[m].url];switch(n.type){case "skin":if(qa[n.skin.source]){var o=new z;o.url=n.skin.source;o.instance_material=b.controllers[m].instance_material;b.geometries.push(o);e=b.controllers[m]}else if(ua[n.skin.source]&&(f=n=ua[n.skin.source],n.morph&&qa[n.morph.source]))o=new z,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o);
+break;case "morph":if(qa[n.morph.source])o=new z,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o),f=b.controllers[m];console.log("ColladaLoader: Morph-controller partially supported.")}}for(m=0;m<b.geometries.length;m++){var n=b.geometries[m],o=n.instance_material,n=qa[n.url],p={},t=0,u;if(n&&n.mesh&&n.mesh.primitives){if(c.name.length==0)c.name=n.id;if(o)for(j=0;j<o.length;j++){u=o[j];var w=xa[ra[u.target].instance_effect.url].shader;w.material.opacity=
+!w.material.opacity?1:w.material.opacity;u=p[u.symbol]=w.material;t++}o=u||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});n=n.mesh.geometry3js;if(t>1){o=new THREE.MeshFaceMaterial;for(j=0;j<n.faces.length;j++)t=n.faces[j],t.materials=[p[t.daeMaterial]]}if(e!==void 0)h(n,e),o.morphTargets=!0,o=new THREE.SkinnedMesh(n,o),o.skeleton=e.skeleton,o.skinController=ua[e.url],o.skinInstanceController=e,o.name="skin_"+Da.length,Da.push(o);else if(f!==void 0){p=n;t=f instanceof v?
+ua[f.url]:f;if(!t||!t.morph)console.log("could not find morph controller!");else{t=t.morph;for(w=0;w<t.targets.length;w++){var x=qa[t.targets[w]];if(x.mesh&&x.mesh.primitives&&x.mesh.primitives.length)x=x.mesh.primitives[0].geometry,x.vertices.length===p.vertices.length&&p.morphTargets.push({name:"target_1",vertices:x.vertices})}p.morphTargets.push({name:"target_Z",vertices:p.vertices})}o.morphTargets=!0;o=new THREE.Mesh(n,o);o.name="morph_"+Fa.length;Fa.push(o)}else o=new THREE.Mesh(n,o);c.add(o)}}for(m=
+0;m<b.nodes.length;m++)c.add(k(b.nodes[m],b));return c}function m(){this.init_from=this.id=""}function n(){this.type=this.name=this.id="";this.morph=this.skin=null}function p(){this.weights=this.targets=this.source=this.method=null}function t(){this.source="";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function w(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function u(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=
 [];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function x(){this.type=this.sid="";this.data=[];this.matrix=new THREE.Matrix4}function v(){this.url="";this.skeleton=[];this.instance_material=[]}function A(){this.target=this.symbol=""}function z(){this.url="";this.instance_material=[]}function y(){this.id="";this.mesh=null}function D(b){this.geometry=b.id;this.primitives=[];this.geometry3js=this.vertices=null}function E(){}function C(){this.material="";this.count=0;this.inputs=
-[];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function G(){this.source="";this.stride=this.count=0;this.params=[]}function I(){this.input={}}function P(){this.semantic="";this.offset=0;this.source="";this.set=0}function K(b){this.id=b;this.type=null}function B(){this.name=this.id="";this.instance_effect=null}function O(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texcoord=this.texture=null}function Y(b,e){this.type=
-b;this.effect=e;this.material=null}function N(b){this.effect=b;this.format=this.init_from=null}function V(b){this.effect=b;this.mipfilter=this.magfilter=this.minfilter=this.wrap_t=this.wrap_s=this.source=null}function J(){this.name=this.id="";this.sampler=this.surface=this.shader=null}function $(){this.url=""}function Z(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function Q(b){this.animation=b;this.target=this.source="";this.member=this.arrIndices=this.arrSyntax=this.dotSyntax=
-this.sid=null}function o(b){this.id="";this.animation=b;this.inputs=[];this.endTime=this.startTime=this.interpolation=this.output=this.input=null;this.duration=0}function R(b){var e=b.getAttribute("id");if(sa[e]!=void 0)return sa[e];sa[e]=(new K(e)).parse(b);return sa[e]}function fa(b){if(b=="dae")return"http://www.collada.org/2005/11/COLLADASchema";return null}function ea(b){for(var b=ga(b),e=[],c=0;c<b.length;c++)e.push(parseFloat(b[c]));return e}function ha(b){for(var b=ga(b),e=[],c=0;c<b.length;c++)e.push(parseInt(b[c],
-10));return e}function ga(b){return b.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s+/)}function la(b,e,c){return b.hasAttribute(e)?parseInt(b.getAttribute(e),10):c}function oa(b,e){if(b===void 0){for(var c="0.";c.length<e+2;)c+="0";return c}e=e||2;c=b.toString().split(".");for(c[1]=c.length>1?c[1].substr(0,e):"0";c[1].length<e;)c[1]+="0";return c.join(".")}function aa(b,e){var c="";c+=oa(b.x,e)+",";c+=oa(b.y,e)+",";c+=oa(b.z,e);return c}var T=null,X=null,ia,ja=null,sa={},ma={},ca={},ua={},qa={},
-ra={},xa={},Ca,Ga,Fa,Da,za=THREE.SmoothShading;m.prototype.parse=function(b){this.id=b.getAttribute("id");for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeName=="init_from")this.init_from=c.textContent}return this};n.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.type="none";for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];switch(c.nodeName){case "skin":this.skin=(new t).parse(c);this.type=c.nodeName;break;case "morph":this.morph=
-(new p).parse(c),this.type=c.nodeName}}return this};p.prototype.parse=function(b){var e={},c=[],f;this.method=b.getAttribute("method");this.source=b.getAttribute("source").replace(/^#/,"");for(f=0;f<b.childNodes.length;f++){var h=b.childNodes[f];if(h.nodeType==1)switch(h.nodeName){case "source":h=(new K).parse(h);e[h.id]=h;break;case "targets":c=this.parseInputs(h);break;default:console.log(h.nodeName)}}for(f=0;f<c.length;f++)switch(b=c[f],h=e[b.source],b.semantic){case "MORPH_TARGET":this.targets=
-h.read();break;case "MORPH_WEIGHT":this.weights=h.read()}return this};p.prototype.parseInputs=function(b){for(var e=[],c=0;c<b.childNodes.length;c++){var f=b.childNodes[c];if(f.nodeType==1)switch(f.nodeName){case "input":e.push((new P).parse(f))}}return e};t.prototype.parse=function(b){var e={},c,f;this.source=b.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var h=0;h<b.childNodes.length;h++){var k=b.childNodes[h];if(k.nodeType==1)switch(k.nodeName){case "bind_shape_matrix":k=
-ea(k.textContent);this.bindShapeMatrix=new THREE.Matrix4;this.bindShapeMatrix.set(k[0],k[1],k[2],k[3],k[4],k[5],k[6],k[7],k[8],k[9],k[10],k[11],k[12],k[13],k[14],k[15]);break;case "source":k=(new K).parse(k);e[k.id]=k;break;case "joints":c=k;break;case "vertex_weights":f=k;break;default:console.log(k.nodeName)}}this.parseJoints(c,e);this.parseWeights(f,e);return this};t.prototype.parseJoints=function(b,e){for(var c=0;c<b.childNodes.length;c++){var f=b.childNodes[c];if(f.nodeType==1)switch(f.nodeName){case "input":var f=
-(new P).parse(f),h=e[f.source];if(f.semantic=="JOINT")this.joints=h.read();else if(f.semantic=="INV_BIND_MATRIX")this.invBindMatrices=h.read()}}};t.prototype.parseWeights=function(b,e){for(var c,f,h=[],k=0;k<b.childNodes.length;k++){var m=b.childNodes[k];if(m.nodeType==1)switch(m.nodeName){case "input":h.push((new P).parse(m));break;case "v":c=ha(m.textContent);break;case "vcount":f=ha(m.textContent)}}for(k=m=0;k<f.length;k++){for(var n=f[k],o=[],p=0;p<n;p++){for(var t={},u=0;u<h.length;u++){var v=
-h[u],w=c[m+v.offset];switch(v.semantic){case "JOINT":t.joint=w;break;case "WEIGHT":t.weight=e[v.source].data[w]}}o.push(t);m+=h.length}for(p=0;p<o.length;p++)o[p].index=k;this.weights.push(o)}};w.prototype.getChildById=function(b,e){for(var c=0;c<this.nodes.length;c++){var f=this.nodes[c].getChildById(b,e);if(f)return f}return null};w.prototype.getChildBySid=function(b,e){for(var c=0;c<this.nodes.length;c++){var f=this.nodes[c].getChildBySid(b,e);if(f)return f}return null};w.prototype.parse=function(b){this.id=
-b.getAttribute("id");this.name=b.getAttribute("name");this.nodes=[];for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeType==1)switch(c.nodeName){case "node":this.nodes.push((new u).parse(c))}}return this};u.prototype.getChannelForTransform=function(b){for(var e=0;e<this.channels.length;e++){var c=this.channels[e],f=c.target.split("/");f.shift();var h=f.shift(),k=h.indexOf(".")>=0,m=h.indexOf("(")>=0,n;if(k)f=h.split("."),h=f.shift(),f.shift();else if(m){n=h.split("(");h=n.shift();
-for(f=0;f<n.length;f++)n[f]=parseInt(n[f].replace(/\)/,""))}if(h==b)return c.info={sid:h,dotSyntax:k,arrSyntax:m,arrIndices:n},c}return null};u.prototype.getChildById=function(b,e){if(this.id==b)return this;if(e)for(var c=0;c<this.nodes.length;c++){var f=this.nodes[c].getChildById(b,e);if(f)return f}return null};u.prototype.getChildBySid=function(b,e){if(this.sid==b)return this;if(e)for(var c=0;c<this.nodes.length;c++){var f=this.nodes[c].getChildBySid(b,e);if(f)return f}return null};u.prototype.getTransformBySid=
-function(b){for(var e=0;e<this.transforms.length;e++)if(this.transforms[e].sid==b)return this.transforms[e];return null};u.prototype.parse=function(b){var e;this.id=b.getAttribute("id");this.sid=b.getAttribute("sid");this.name=b.getAttribute("name");this.type=b.getAttribute("type");this.type=this.type=="JOINT"?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var c=0;c<b.childNodes.length;c++)if(e=b.childNodes[c],e.nodeType==
-1)switch(e.nodeName){case "node":this.nodes.push((new u).parse(e));break;case "instance_camera":break;case "instance_controller":this.controllers.push((new v).parse(e));break;case "instance_geometry":this.geometries.push((new z).parse(e));break;case "instance_light":break;case "instance_node":e=e.getAttribute("url").replace(/^#/,"");(e=T.evaluate(".//dae:library_nodes//dae:node[@id='"+e+"']",T,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new u).parse(e));break;
-case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new x).parse(e));break;case "extra":break;default:console.log(e.nodeName)}b=[];c=1E6;e=-1E6;for(var f in ca)for(var h=ca[f],k=0;k<h.channel.length;k++){var m=h.channel[k],n=h.sampler[k];f=m.target.split("/")[0];if(f==this.id)n.create(),m.sampler=n,c=Math.min(c,n.startTime),e=Math.max(e,n.endTime),b.push(m)}if(b.length)this.startTime=c,this.endTime=e;if((this.channels=b)&&this.channels.length){f=
-1E7;for(i=0;i<this.channels.length;i++){b=this.channels[i].sampler;for(c=0;c<b.input.length-1;c++)f=Math.min(f,b.input[c+1]-b.input[c])}c=[];for(b=this.startTime;b<this.endTime;b+=f){e=b;for(var h={},o=k=void 0,k=0;k<this.channels.length;k++)o=this.channels[k],h[o.sid]=o;m=new THREE.Matrix4;for(k=0;k<this.transforms.length;k++)if(n=this.transforms[k],o=h[n.sid],o!==void 0){for(var p=o.sampler,t,o=0;o<p.input.length-1;o++)if(p.input[o+1]>e){t=p.output[o];break}m=t!==void 0?t instanceof THREE.Matrix4?
-m.multiply(m,t):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);e=m;c.push({time:b,pos:[e.n14,e.n24,e.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=c}this.updateMatrix();return this};u.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b<this.transforms.length;b++)this.matrix.multiply(this.matrix,this.transforms[b].matrix)};x.prototype.parse=function(b){this.sid=b.getAttribute("sid");this.type=b.nodeName;this.data=ea(b.textContent);this.updateMatrix();return this};
+[];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function G(){this.source="";this.stride=this.count=0;this.params=[]}function I(){this.input={}}function P(){this.semantic="";this.offset=0;this.source="";this.set=0}function K(b){this.id=b;this.type=null}function B(){this.name=this.id="";this.instance_effect=null}function O(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texcoord=this.texture=null}function Y(b,c){this.type=
+b;this.effect=c;this.material=null}function N(b){this.effect=b;this.format=this.init_from=null}function V(b){this.effect=b;this.mipfilter=this.magfilter=this.minfilter=this.wrap_t=this.wrap_s=this.source=null}function J(){this.name=this.id="";this.sampler=this.surface=this.shader=null}function $(){this.url=""}function Z(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function Q(b){this.animation=b;this.target=this.source="";this.member=this.arrIndices=this.arrSyntax=this.dotSyntax=
+this.sid=null}function o(b){this.id="";this.animation=b;this.inputs=[];this.endTime=this.startTime=this.interpolation=this.output=this.input=null;this.duration=0}function R(b){var c=b.getAttribute("id");if(sa[c]!=void 0)return sa[c];sa[c]=(new K(c)).parse(b);return sa[c]}function fa(b){if(b=="dae")return"http://www.collada.org/2005/11/COLLADASchema";return null}function ea(b){for(var b=ga(b),c=[],e=0;e<b.length;e++)c.push(parseFloat(b[e]));return c}function ha(b){for(var b=ga(b),c=[],e=0;e<b.length;e++)c.push(parseInt(b[e],
+10));return c}function ga(b){return b.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s+/)}function la(b,c,e){return b.hasAttribute(c)?parseInt(b.getAttribute(c),10):e}function oa(b,c){if(b===void 0){for(var e="0.";e.length<c+2;)e+="0";return e}c=c||2;e=b.toString().split(".");for(e[1]=e.length>1?e[1].substr(0,c):"0";e[1].length<c;)e[1]+="0";return e.join(".")}function aa(b,c){var e="";e+=oa(b.x,c)+",";e+=oa(b.y,c)+",";e+=oa(b.z,c);return e}var T=null,X=null,ia,ja=null,sa={},ma={},ca={},ua={},qa={},
+ra={},xa={},Ca,Ga,Fa,Da,za=THREE.SmoothShading;m.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="init_from")this.init_from=e.textContent}return this};n.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.type="none";for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "skin":this.skin=(new t).parse(e);this.type=e.nodeName;break;case "morph":this.morph=
+(new p).parse(e),this.type=e.nodeName}}return this};p.prototype.parse=function(b){var c={},e=[],f;this.method=b.getAttribute("method");this.source=b.getAttribute("source").replace(/^#/,"");for(f=0;f<b.childNodes.length;f++){var h=b.childNodes[f];if(h.nodeType==1)switch(h.nodeName){case "source":h=(new K).parse(h);c[h.id]=h;break;case "targets":e=this.parseInputs(h);break;default:console.log(h.nodeName)}}for(f=0;f<e.length;f++)switch(b=e[f],h=c[b.source],b.semantic){case "MORPH_TARGET":this.targets=
+h.read();break;case "MORPH_WEIGHT":this.weights=h.read()}return this};p.prototype.parseInputs=function(b){for(var c=[],e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":c.push((new P).parse(f))}}return c};t.prototype.parse=function(b){var c={},e,f;this.source=b.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var h=0;h<b.childNodes.length;h++){var k=b.childNodes[h];if(k.nodeType==1)switch(k.nodeName){case "bind_shape_matrix":k=
+ea(k.textContent);this.bindShapeMatrix=new THREE.Matrix4;this.bindShapeMatrix.set(k[0],k[1],k[2],k[3],k[4],k[5],k[6],k[7],k[8],k[9],k[10],k[11],k[12],k[13],k[14],k[15]);break;case "source":k=(new K).parse(k);c[k.id]=k;break;case "joints":e=k;break;case "vertex_weights":f=k;break;default:console.log(k.nodeName)}}this.parseJoints(e,c);this.parseWeights(f,c);return this};t.prototype.parseJoints=function(b,c){for(var e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":var f=
+(new P).parse(f),h=c[f.source];if(f.semantic=="JOINT")this.joints=h.read();else if(f.semantic=="INV_BIND_MATRIX")this.invBindMatrices=h.read()}}};t.prototype.parseWeights=function(b,c){for(var e,f,h=[],k=0;k<b.childNodes.length;k++){var m=b.childNodes[k];if(m.nodeType==1)switch(m.nodeName){case "input":h.push((new P).parse(m));break;case "v":e=ha(m.textContent);break;case "vcount":f=ha(m.textContent)}}for(k=m=0;k<f.length;k++){for(var n=f[k],o=[],p=0;p<n;p++){for(var t={},u=0;u<h.length;u++){var v=
+h[u],w=e[m+v.offset];switch(v.semantic){case "JOINT":t.joint=w;break;case "WEIGHT":t.weight=c[v.source].data[w]}}o.push(t);m+=h.length}for(p=0;p<o.length;p++)o[p].index=k;this.weights.push(o)}};w.prototype.getChildById=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};w.prototype.getChildBySid=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};w.prototype.parse=function(b){this.id=
+b.getAttribute("id");this.name=b.getAttribute("name");this.nodes=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "node":this.nodes.push((new u).parse(e))}}return this};u.prototype.getChannelForTransform=function(b){for(var c=0;c<this.channels.length;c++){var e=this.channels[c],f=e.target.split("/");f.shift();var h=f.shift(),k=h.indexOf(".")>=0,m=h.indexOf("(")>=0,n;if(k)f=h.split("."),h=f.shift(),f.shift();else if(m){n=h.split("(");h=n.shift();
+for(f=0;f<n.length;f++)n[f]=parseInt(n[f].replace(/\)/,""))}if(h==b)return e.info={sid:h,dotSyntax:k,arrSyntax:m,arrIndices:n},e}return null};u.prototype.getChildById=function(b,c){if(this.id==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};u.prototype.getChildBySid=function(b,c){if(this.sid==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};u.prototype.getTransformBySid=
+function(b){for(var c=0;c<this.transforms.length;c++)if(this.transforms[c].sid==b)return this.transforms[c];return null};u.prototype.parse=function(b){var c;this.id=b.getAttribute("id");this.sid=b.getAttribute("sid");this.name=b.getAttribute("name");this.type=b.getAttribute("type");this.type=this.type=="JOINT"?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var e=0;e<b.childNodes.length;e++)if(c=b.childNodes[e],c.nodeType==
+1)switch(c.nodeName){case "node":this.nodes.push((new u).parse(c));break;case "instance_camera":break;case "instance_controller":this.controllers.push((new v).parse(c));break;case "instance_geometry":this.geometries.push((new z).parse(c));break;case "instance_light":break;case "instance_node":c=c.getAttribute("url").replace(/^#/,"");(c=T.evaluate(".//dae:library_nodes//dae:node[@id='"+c+"']",T,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new u).parse(c));break;
+case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new x).parse(c));break;case "extra":break;default:console.log(c.nodeName)}b=[];e=1E6;c=-1E6;for(var f in ca)for(var h=ca[f],k=0;k<h.channel.length;k++){var m=h.channel[k],n=h.sampler[k];f=m.target.split("/")[0];if(f==this.id)n.create(),m.sampler=n,e=Math.min(e,n.startTime),c=Math.max(c,n.endTime),b.push(m)}if(b.length)this.startTime=e,this.endTime=c;if((this.channels=b)&&this.channels.length){f=
+1E7;for(i=0;i<this.channels.length;i++){b=this.channels[i].sampler;for(e=0;e<b.input.length-1;e++)f=Math.min(f,b.input[e+1]-b.input[e])}e=[];for(b=this.startTime;b<this.endTime;b+=f){c=b;for(var h={},o=k=void 0,k=0;k<this.channels.length;k++)o=this.channels[k],h[o.sid]=o;m=new THREE.Matrix4;for(k=0;k<this.transforms.length;k++)if(n=this.transforms[k],o=h[n.sid],o!==void 0){for(var p=o.sampler,t,o=0;o<p.input.length-1;o++)if(p.input[o+1]>c){t=p.output[o];break}m=t!==void 0?t instanceof THREE.Matrix4?
+m.multiply(m,t):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};u.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b<this.transforms.length;b++)this.matrix.multiply(this.matrix,this.transforms[b].matrix)};x.prototype.parse=function(b){this.sid=b.getAttribute("sid");this.type=b.nodeName;this.data=ea(b.textContent);this.updateMatrix();return this};
 x.prototype.updateMatrix=function(){var b=0;this.matrix.identity();switch(this.type){case "matrix":this.matrix.set(this.data[0],this.data[1],this.data[2],this.data[3],this.data[4],this.data[5],this.data[6],this.data[7],this.data[8],this.data[9],this.data[10],this.data[11],this.data[12],this.data[13],this.data[14],this.data[15]);break;case "translate":this.matrix.setTranslation(this.data[0],this.data[1],this.data[2]);break;case "rotate":b=this.data[3]*(Math.PI/180);this.matrix.setRotationAxis(new THREE.Vector3(this.data[0],
-this.data[1],this.data[2]),b);break;case "scale":this.matrix.setScale(this.data[0],this.data[1],this.data[2])}return this.matrix};v.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeType==1)switch(c.nodeName){case "skeleton":this.skeleton.push(c.textContent.replace(/^#/,""));break;case "bind_material":if(c=T.evaluate(".//dae:instance_material",c,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,
-null))for(var f=c.iterateNext();f;)this.instance_material.push((new A).parse(f)),f=c.iterateNext()}}return this};A.prototype.parse=function(b){this.symbol=b.getAttribute("symbol");this.target=b.getAttribute("target").replace(/^#/,"");return this};z.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeType==1&&c.nodeName=="bind_material"){if(b=T.evaluate(".//dae:instance_material",
-c,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(e=b.iterateNext();e;)this.instance_material.push((new A).parse(e)),e=b.iterateNext();break}}return this};y.prototype.parse=function(b){this.id=b.getAttribute("id");for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];switch(c.nodeName){case "mesh":this.mesh=(new D(this)).parse(c)}}return this};D.prototype.parse=function(b){function e(b,c){var f=aa(b.position);h[f]===void 0&&(h[f]={v:b,index:c});return h[f]}this.primitives=[];var c;for(c=
-0;c<b.childNodes.length;c++){var f=b.childNodes[c];switch(f.nodeName){case "source":R(f);break;case "vertices":this.vertices=(new I).parse(f);break;case "triangles":this.primitives.push((new C).parse(f));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new E).parse(f))}}var h={};this.geometry3js=new THREE.Geometry;f=sa[this.vertices.input.POSITION.source].data;for(b=c=0;c<f.length;c+=3,b++){var k=new THREE.Vertex(new THREE.Vector3(f[c],f[c+
-1],f[c+2]));e(k,b);this.geometry3js.vertices.push(k)}for(c=0;c<this.primitives.length;c++)primitive=this.primitives[c],primitive.setVertices(this.vertices),this.handlePrimitive(primitive,this.geometry3js,h);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.computeVertexNormals();this.geometry3js.computeBoundingBox();return this};D.prototype.handlePrimitive=function(b,e,c){var f=0,h,k,m=b.p,n=b.inputs,o,p,t,u=0,v=3,w=[];for(h=0;h<n.length;h++)switch(o=n[h],
-o.semantic){case "TEXCOORD":w.push(o.set)}for(;f<m.length;){var x=[],y=[],z={},A=[];b.vcount&&(v=b.vcount[u++]);for(h=0;h<v;h++)for(k=0;k<n.length;k++)switch(o=n[k],source=sa[o.source],p=m[f+h*n.length+o.offset],numParams=source.accessor.params.length,t=p*numParams,o.semantic){case "VERTEX":o=aa(e.vertices[p].position);x.push(c[o].index);break;case "NORMAL":y.push(new THREE.Vector3(source.data[t],source.data[t+1],source.data[t+2]));break;case "TEXCOORD":z[o.set]===void 0&&(z[o.set]=[]);z[o.set].push(new THREE.UV(source.data[t],
-source.data[t+1]));break;case "COLOR":A.push((new THREE.Color).setRGB(source.data[t],source.data[t+1],source.data[t+2]))}var B;v==3?B=new THREE.Face3(x[0],x[1],x[2],[y[0],y[1],y[2]],A.length?A:new THREE.Color):v==4&&(B=new THREE.Face4(x[0],x[1],x[2],x[3],[y[0],y[1],y[2],y[3]],A.length?A:new THREE.Color));B.daeMaterial=b.material;e.faces.push(B);for(k=0;k<w.length;k++)h=z[w[k]],e.faceVertexUvs[k].push([h[0],h[1],h[2]]);f+=n.length*v}};E.prototype=new C;E.prototype.constructor=E;C.prototype.setVertices=
-function(b){for(var e=0;e<this.inputs.length;e++)if(this.inputs[e].source==b.id)this.inputs[e].source=b.input.POSITION.source};C.prototype.parse=function(b){this.inputs=[];this.material=b.getAttribute("material");this.count=la(b,"count",0);for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];switch(c.nodeName){case "input":this.inputs.push((new P).parse(b.childNodes[e]));break;case "vcount":this.vcount=ha(c.textContent);break;case "p":this.p=ha(c.textContent)}}return this};G.prototype.parse=
-function(b){this.params=[];this.source=b.getAttribute("source");this.count=la(b,"count",0);this.stride=la(b,"stride",0);for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeName=="param"){var f={};f.name=c.getAttribute("name");f.type=c.getAttribute("type");this.params.push(f)}}return this};I.prototype.parse=function(b){this.id=b.getAttribute("id");for(var e=0;e<b.childNodes.length;e++)b.childNodes[e].nodeName=="input"&&(input=(new P).parse(b.childNodes[e]),this.input[input.semantic]=
-input);return this};P.prototype.parse=function(b){this.semantic=b.getAttribute("semantic");this.source=b.getAttribute("source").replace(/^#/,"");this.set=la(b,"set",-1);this.offset=la(b,"offset",0);if(this.semantic=="TEXCOORD"&&this.set<0)this.set=0;return this};K.prototype.parse=function(b){this.id=b.getAttribute("id");for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];switch(c.nodeName){case "bool_array":for(var f=ga(c.textContent),h=[],k=0;k<f.length;k++)h.push(f[k]=="true"||f[k]=="1"?
-!0:!1);this.data=h;this.type=c.nodeName;break;case "float_array":this.data=ea(c.textContent);this.type=c.nodeName;break;case "int_array":this.data=ha(c.textContent);this.type=c.nodeName;break;case "IDREF_array":case "Name_array":this.data=ga(c.textContent);this.type=c.nodeName;break;case "technique_common":for(f=0;f<c.childNodes.length;f++)if(c.childNodes[f].nodeName=="accessor"){this.accessor=(new G).parse(c.childNodes[f]);break}}}return this};K.prototype.read=function(){var b=[],e=this.accessor.params[0];
-switch(e.type){case "IDREF":case "Name":case "name":case "float":return this.data;case "float4x4":for(e=0;e<this.data.length;e+=16){var c=this.data.slice(e,e+16),f=new THREE.Matrix4;f.set(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]);b.push(f)}break;default:console.log("ColladaLoader: Source: Read dont know how to read "+e.type+".")}return b};B.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");for(var e=0;e<b.childNodes.length;e++)if(b.childNodes[e].nodeName==
-"instance_effect"){this.instance_effect=(new $).parse(b.childNodes[e]);break}return this};O.prototype.isColor=function(){return this.texture==null};O.prototype.isTexture=function(){return this.texture!=null};O.prototype.parse=function(b){for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeType==1)switch(c.nodeName){case "color":c=ea(c.textContent);this.color=new THREE.Color(0);this.color.setRGB(c[0],c[1],c[2]);this.color.a=c[3];break;case "texture":this.texture=c.getAttribute("texture"),
-this.texcoord=c.getAttribute("texcoord")}}return this};Y.prototype.parse=function(b){for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeType==1)switch(c.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[c.nodeName]=(new O).parse(c);break;case "shininess":case "reflectivity":case "transparency":var f;f=T.evaluate(".//dae:float",c,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var h=f.iterateNext(),k=[];h;)k.push(h),h=f.iterateNext();
-f=k;f.length>0&&(this[c.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};Y.prototype.create=function(){var b={},e=this.transparency!==void 0&&this.transparency<1,c;for(c in this)switch(c){case "ambient":case "emission":case "diffuse":case "specular":var f=this[c];if(f instanceof O)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=ma[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ga+f.init_from),
-b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else c=="diffuse"?b.color=f.color.getHex():e||(b[c]=f.color.getHex());break;case "shininess":case "reflectivity":b[c]=this[c];break;case "transparency":if(e)b.transparent=!0,b.opacity=this[c],e=!0}b.shading=za;return this.material=new THREE.MeshLambertMaterial(b)};N.prototype.parse=function(b){for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeType==1)switch(c.nodeName){case "init_from":this.init_from=
-c.textContent;break;case "format":this.format=c.textContent;break;default:console.log("unhandled Surface prop: "+c.nodeName)}}return this};V.prototype.parse=function(b){for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeType==1)switch(c.nodeName){case "source":this.source=c.textContent;break;case "minfilter":this.minfilter=c.textContent;break;case "magfilter":this.magfilter=c.textContent;break;case "mipfilter":this.mipfilter=c.textContent;break;case "wrap_s":this.wrap_s=c.textContent;
-break;case "wrap_t":this.wrap_t=c.textContent;break;default:console.log("unhandled Sampler2D prop: "+c.nodeName)}}return this};J.prototype.create=function(){if(this.shader==null)return null};J.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.shader=null;for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeType==1)switch(c.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(c))}}return this};J.prototype.parseNewparam=
-function(b){for(var e=b.getAttribute("sid"),c=0;c<b.childNodes.length;c++){var f=b.childNodes[c];if(f.nodeType==1)switch(f.nodeName){case "surface":this.surface=(new N(this)).parse(f);this.surface.sid=e;break;case "sampler2D":this.sampler=(new V(this)).parse(f);this.sampler.sid=e;break;case "extra":break;default:console.log(f.nodeName)}}};J.prototype.parseProfileCOMMON=function(b){for(var e,c=0;c<b.childNodes.length;c++){var f=b.childNodes[c];if(f.nodeType==1)switch(f.nodeName){case "profile_COMMON":this.parseProfileCOMMON(f);
-break;case "technique":e=f;break;case "newparam":this.parseNewparam(f);break;case "extra":break;default:console.log(f.nodeName)}}return e};J.prototype.parseTechnique=function(b){for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeType==1)switch(c.nodeName){case "lambert":case "blinn":case "phong":this.shader=(new Y(c.nodeName,this)).parse(c)}}};$.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");return this};Z.prototype.parse=function(b){this.id=b.getAttribute("id");
-this.name=b.getAttribute("name");this.source={};for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeType==1)switch(c.nodeName){case "source":c=(new K).parse(c);this.source[c.id]=c;break;case "sampler":this.sampler.push((new o(this)).parse(c));break;case "channel":this.channel.push((new Q(this)).parse(c))}}return this};Q.prototype.parse=function(b){this.source=b.getAttribute("source").replace(/^#/,"");this.target=b.getAttribute("target");var e=this.target.split("/");e.shift();var b=
-e.shift(),c=b.indexOf(".")>=0,f=b.indexOf("(")>=0,h,k;if(c)e=b.split("."),b=e.shift(),k=e.shift();else if(f){h=b.split("(");b=h.shift();for(e=0;e<h.length;e++)h[e]=parseInt(h[e].replace(/\)/,""))}this.sid=b;this.dotSyntax=c;this.arrSyntax=f;this.arrIndices=h;this.member=k;return this};o.prototype.parse=function(b){this.id=b.getAttribute("id");this.inputs=[];for(var e=0;e<b.childNodes.length;e++){var c=b.childNodes[e];if(c.nodeType==1)switch(c.nodeName){case "input":this.inputs.push((new P).parse(c))}}return this};
-o.prototype.create=function(){for(var b=0;b<this.inputs.length;b++){var e=this.inputs[b],c=this.animation.source[e.source];switch(e.semantic){case "INPUT":this.input=c.read();break;case "OUTPUT":this.output=c.read();break;case "INTERPOLATION":this.interpolation=c.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(e.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(b=0;b<this.input.length;b++)this.startTime=
-Math.min(this.startTime,this.input[b]),this.endTime=Math.max(this.endTime,this.input[b]);this.duration=this.endTime-this.startTime}};return{load:function(e,c){if(document.implementation&&document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);e+="?rnd="+Math.random();var f=new XMLHttpRequest;f.overrideMimeType&&f.overrideMimeType("text/xml");f.onreadystatechange=function(){if(f.readyState==4&&(f.status==0||f.status==
-200))ja=c,b(f.responseXML,void 0,e)};f.open("GET",e,!0);f.send(null)}else alert("Don't know how to parse XML!")},parse:b,setPreferredShading:function(b){za=b},applySkin:h,geometries:qa}};THREE.JSONLoader=function(b){THREE.Loader.call(this,b)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;
-THREE.JSONLoader.prototype.load=function(b,c,e){var f=this,h;if(b instanceof Object)console.warn("DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath )."),h=b,b=h.model,c=h.callback,e=h.texture_path;h=new Worker(b);e=e?e:this.extractUrlbase(b);h.onmessage=function(b){f.createModel(b.data,c,e);f.onLoadComplete()};this.onLoadStart();h.postMessage((new Date).getTime())};
-THREE.JSONLoader.prototype.createModel=function(b,c,e){var f=new THREE.Geometry,h=b.scale!==void 0?1/b.scale:1;this.init_materials(f,b.materials,e);(function(e){if(b.version===void 0||b.version!=2)console.error("Deprecated file format.");else{var c,h,p,t,w,u,x,v,A,z,y,D,E,C,G=b.faces;u=b.vertices;var I=b.normals,P=b.colors,K=0;for(c=0;c<b.uvs.length;c++)b.uvs[c].length&&K++;for(c=0;c<K;c++)f.faceUvs[c]=[],f.faceVertexUvs[c]=[];t=0;for(w=u.length;t<w;)x=new THREE.Vertex,x.position.x=u[t++]*e,x.position.y=
-u[t++]*e,x.position.z=u[t++]*e,f.vertices.push(x);t=0;for(w=G.length;t<w;){e=G[t++];u=e&1;p=e&2;c=e&4;h=e&8;v=e&16;x=e&32;z=e&64;e&=128;u?(y=new THREE.Face4,y.a=G[t++],y.b=G[t++],y.c=G[t++],y.d=G[t++],u=4):(y=new THREE.Face3,y.a=G[t++],y.b=G[t++],y.c=G[t++],u=3);if(p)p=G[t++],y.materials=f.materials[p];p=f.faces.length;if(c)for(c=0;c<K;c++)D=b.uvs[c],A=G[t++],C=D[A*2],A=D[A*2+1],f.faceUvs[c][p]=new THREE.UV(C,A);if(h)for(c=0;c<K;c++){D=b.uvs[c];E=[];for(h=0;h<u;h++)A=G[t++],C=D[A*2],A=D[A*2+1],E[h]=
-new THREE.UV(C,A);f.faceVertexUvs[c][p]=E}if(v)v=G[t++]*3,h=new THREE.Vector3,h.x=I[v++],h.y=I[v++],h.z=I[v],y.normal=h;if(x)for(c=0;c<u;c++)v=G[t++]*3,h=new THREE.Vector3,h.x=I[v++],h.y=I[v++],h.z=I[v],y.vertexNormals.push(h);if(z)x=G[t++],x=new THREE.Color(P[x]),y.color=x;if(e)for(c=0;c<u;c++)x=G[t++],x=new THREE.Color(P[x]),y.vertexColors.push(x);f.faces.push(y)}}})(h);(function(){var e,c,h,p;if(b.skinWeights){e=0;for(c=b.skinWeights.length;e<c;e+=2)h=b.skinWeights[e],p=b.skinWeights[e+1],f.skinWeights.push(new THREE.Vector4(h,
-p,0,0))}if(b.skinIndices){e=0;for(c=b.skinIndices.length;e<c;e+=2)h=b.skinIndices[e],p=b.skinIndices[e+1],f.skinIndices.push(new THREE.Vector4(h,p,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(e){if(b.morphTargets!==void 0){var c,h,p,t,w,u,x,v,A;c=0;for(h=b.morphTargets.length;c<h;c++){f.morphTargets[c]={};f.morphTargets[c].name=b.morphTargets[c].name;f.morphTargets[c].vertices=[];v=f.morphTargets[c].vertices;A=b.morphTargets[c].vertices;p=0;for(t=A.length;p<t;p+=3)w=A[p]*e,u=A[p+1]*
-e,x=A[p+2]*e,v.push(new THREE.Vertex(new THREE.Vector3(w,u,x)))}}if(b.morphColors!==void 0){c=0;for(h=b.morphColors.length;c<h;c++){f.morphColors[c]={};f.morphColors[c].name=b.morphColors[c].name;f.morphColors[c].colors=[];t=f.morphColors[c].colors;w=b.morphColors[c].colors;e=0;for(p=w.length;e<p;e+=3)u=new THREE.Color(16755200),u.setRGB(w[e],w[e+1],w[e+2]),t.push(u)}}})(h);f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};
+this.data[1],this.data[2]),b);break;case "scale":this.matrix.setScale(this.data[0],this.data[1],this.data[2])}return this.matrix};v.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "skeleton":this.skeleton.push(e.textContent.replace(/^#/,""));break;case "bind_material":if(e=T.evaluate(".//dae:instance_material",e,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,
+null))for(var f=e.iterateNext();f;)this.instance_material.push((new A).parse(f)),f=e.iterateNext()}}return this};A.prototype.parse=function(b){this.symbol=b.getAttribute("symbol");this.target=b.getAttribute("target").replace(/^#/,"");return this};z.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1&&e.nodeName=="bind_material"){if(b=T.evaluate(".//dae:instance_material",
+e,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(c=b.iterateNext();c;)this.instance_material.push((new A).parse(c)),c=b.iterateNext();break}}return this};y.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "mesh":this.mesh=(new D(this)).parse(e)}}return this};D.prototype.parse=function(b){function c(b,e){var f=aa(b.position);h[f]===void 0&&(h[f]={v:b,index:e});return h[f]}this.primitives=[];var e;for(e=
+0;e<b.childNodes.length;e++){var f=b.childNodes[e];switch(f.nodeName){case "source":R(f);break;case "vertices":this.vertices=(new I).parse(f);break;case "triangles":this.primitives.push((new C).parse(f));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new E).parse(f))}}var h={};this.geometry3js=new THREE.Geometry;f=sa[this.vertices.input.POSITION.source].data;for(b=e=0;e<f.length;e+=3,b++){var k=new THREE.Vertex(new THREE.Vector3(f[e],f[e+
+1],f[e+2]));c(k,b);this.geometry3js.vertices.push(k)}for(e=0;e<this.primitives.length;e++)primitive=this.primitives[e],primitive.setVertices(this.vertices),this.handlePrimitive(primitive,this.geometry3js,h);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.computeVertexNormals();this.geometry3js.computeBoundingBox();return this};D.prototype.handlePrimitive=function(b,c,e){var f=0,h,k,m=b.p,n=b.inputs,o,p,t,u=0,v=3,w=[];for(h=0;h<n.length;h++)switch(o=n[h],
+o.semantic){case "TEXCOORD":w.push(o.set)}for(;f<m.length;){var x=[],y=[],z={},A=[];b.vcount&&(v=b.vcount[u++]);for(h=0;h<v;h++)for(k=0;k<n.length;k++)switch(o=n[k],source=sa[o.source],p=m[f+h*n.length+o.offset],numParams=source.accessor.params.length,t=p*numParams,o.semantic){case "VERTEX":o=aa(c.vertices[p].position);x.push(e[o].index);break;case "NORMAL":y.push(new THREE.Vector3(source.data[t],source.data[t+1],source.data[t+2]));break;case "TEXCOORD":z[o.set]===void 0&&(z[o.set]=[]);z[o.set].push(new THREE.UV(source.data[t],
+source.data[t+1]));break;case "COLOR":A.push((new THREE.Color).setRGB(source.data[t],source.data[t+1],source.data[t+2]))}var B;v==3?B=new THREE.Face3(x[0],x[1],x[2],[y[0],y[1],y[2]],A.length?A:new THREE.Color):v==4&&(B=new THREE.Face4(x[0],x[1],x[2],x[3],[y[0],y[1],y[2],y[3]],A.length?A:new THREE.Color));B.daeMaterial=b.material;c.faces.push(B);for(k=0;k<w.length;k++)h=z[w[k]],c.faceVertexUvs[k].push([h[0],h[1],h[2]]);f+=n.length*v}};E.prototype=new C;E.prototype.constructor=E;C.prototype.setVertices=
+function(b){for(var c=0;c<this.inputs.length;c++)if(this.inputs[c].source==b.id)this.inputs[c].source=b.input.POSITION.source};C.prototype.parse=function(b){this.inputs=[];this.material=b.getAttribute("material");this.count=la(b,"count",0);for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "input":this.inputs.push((new P).parse(b.childNodes[c]));break;case "vcount":this.vcount=ha(e.textContent);break;case "p":this.p=ha(e.textContent)}}return this};G.prototype.parse=
+function(b){this.params=[];this.source=b.getAttribute("source");this.count=la(b,"count",0);this.stride=la(b,"stride",0);for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="param"){var f={};f.name=e.getAttribute("name");f.type=e.getAttribute("type");this.params.push(f)}}return this};I.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++)b.childNodes[c].nodeName=="input"&&(input=(new P).parse(b.childNodes[c]),this.input[input.semantic]=
+input);return this};P.prototype.parse=function(b){this.semantic=b.getAttribute("semantic");this.source=b.getAttribute("source").replace(/^#/,"");this.set=la(b,"set",-1);this.offset=la(b,"offset",0);if(this.semantic=="TEXCOORD"&&this.set<0)this.set=0;return this};K.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "bool_array":for(var f=ga(e.textContent),h=[],k=0;k<f.length;k++)h.push(f[k]=="true"||f[k]=="1"?
+!0:!1);this.data=h;this.type=e.nodeName;break;case "float_array":this.data=ea(e.textContent);this.type=e.nodeName;break;case "int_array":this.data=ha(e.textContent);this.type=e.nodeName;break;case "IDREF_array":case "Name_array":this.data=ga(e.textContent);this.type=e.nodeName;break;case "technique_common":for(f=0;f<e.childNodes.length;f++)if(e.childNodes[f].nodeName=="accessor"){this.accessor=(new G).parse(e.childNodes[f]);break}}}return this};K.prototype.read=function(){var b=[],c=this.accessor.params[0];
+switch(c.type){case "IDREF":case "Name":case "name":case "float":return this.data;case "float4x4":for(c=0;c<this.data.length;c+=16){var e=this.data.slice(c,c+16),f=new THREE.Matrix4;f.set(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]);b.push(f)}break;default:console.log("ColladaLoader: Source: Read dont know how to read "+c.type+".")}return b};B.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");for(var c=0;c<b.childNodes.length;c++)if(b.childNodes[c].nodeName==
+"instance_effect"){this.instance_effect=(new $).parse(b.childNodes[c]);break}return this};O.prototype.isColor=function(){return this.texture==null};O.prototype.isTexture=function(){return this.texture!=null};O.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "color":e=ea(e.textContent);this.color=new THREE.Color(0);this.color.setRGB(e[0],e[1],e[2]);this.color.a=e[3];break;case "texture":this.texture=e.getAttribute("texture"),
+this.texcoord=e.getAttribute("texcoord")}}return this};Y.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[e.nodeName]=(new O).parse(e);break;case "shininess":case "reflectivity":case "transparency":var f;f=T.evaluate(".//dae:float",e,fa,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var h=f.iterateNext(),k=[];h;)k.push(h),h=f.iterateNext();
+f=k;f.length>0&&(this[e.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};Y.prototype.create=function(){var b={},c=this.transparency!==void 0&&this.transparency<1,e;for(e in this)switch(e){case "ambient":case "emission":case "diffuse":case "specular":var f=this[e];if(f instanceof O)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=ma[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ga+f.init_from),
+b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else e=="diffuse"?b.color=f.color.getHex():c||(b[e]=f.color.getHex());break;case "shininess":case "reflectivity":b[e]=this[e];break;case "transparency":if(c)b.transparent=!0,b.opacity=this[e],c=!0}b.shading=za;return this.material=new THREE.MeshLambertMaterial(b)};N.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "init_from":this.init_from=
+e.textContent;break;case "format":this.format=e.textContent;break;default:console.log("unhandled Surface prop: "+e.nodeName)}}return this};V.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "source":this.source=e.textContent;break;case "minfilter":this.minfilter=e.textContent;break;case "magfilter":this.magfilter=e.textContent;break;case "mipfilter":this.mipfilter=e.textContent;break;case "wrap_s":this.wrap_s=e.textContent;
+break;case "wrap_t":this.wrap_t=e.textContent;break;default:console.log("unhandled Sampler2D prop: "+e.nodeName)}}return this};J.prototype.create=function(){if(this.shader==null)return null};J.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.shader=null;for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(e))}}return this};J.prototype.parseNewparam=
+function(b){for(var c=b.getAttribute("sid"),e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "surface":this.surface=(new N(this)).parse(f);this.surface.sid=c;break;case "sampler2D":this.sampler=(new V(this)).parse(f);this.sampler.sid=c;break;case "extra":break;default:console.log(f.nodeName)}}};J.prototype.parseProfileCOMMON=function(b){for(var c,e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "profile_COMMON":this.parseProfileCOMMON(f);
+break;case "technique":c=f;break;case "newparam":this.parseNewparam(f);break;case "extra":break;default:console.log(f.nodeName)}}return c};J.prototype.parseTechnique=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "lambert":case "blinn":case "phong":this.shader=(new Y(e.nodeName,this)).parse(e)}}};$.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");return this};Z.prototype.parse=function(b){this.id=b.getAttribute("id");
+this.name=b.getAttribute("name");this.source={};for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "source":e=(new K).parse(e);this.source[e.id]=e;break;case "sampler":this.sampler.push((new o(this)).parse(e));break;case "channel":this.channel.push((new Q(this)).parse(e))}}return this};Q.prototype.parse=function(b){this.source=b.getAttribute("source").replace(/^#/,"");this.target=b.getAttribute("target");var c=this.target.split("/");c.shift();var b=
+c.shift(),e=b.indexOf(".")>=0,f=b.indexOf("(")>=0,h,k;if(e)c=b.split("."),b=c.shift(),k=c.shift();else if(f){h=b.split("(");b=h.shift();for(c=0;c<h.length;c++)h[c]=parseInt(h[c].replace(/\)/,""))}this.sid=b;this.dotSyntax=e;this.arrSyntax=f;this.arrIndices=h;this.member=k;return this};o.prototype.parse=function(b){this.id=b.getAttribute("id");this.inputs=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "input":this.inputs.push((new P).parse(e))}}return this};
+o.prototype.create=function(){for(var b=0;b<this.inputs.length;b++){var c=this.inputs[b],e=this.animation.source[c.source];switch(c.semantic){case "INPUT":this.input=e.read();break;case "OUTPUT":this.output=e.read();break;case "INTERPOLATION":this.interpolation=e.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(c.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(b=0;b<this.input.length;b++)this.startTime=
+Math.min(this.startTime,this.input[b]),this.endTime=Math.max(this.endTime,this.input[b]);this.duration=this.endTime-this.startTime}};return{load:function(c,e){if(document.implementation&&document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);c+="?rnd="+Math.random();var f=new XMLHttpRequest;f.overrideMimeType&&f.overrideMimeType("text/xml");f.onreadystatechange=function(){if(f.readyState==4&&(f.status==0||f.status==
+200))ja=e,b(f.responseXML,void 0,c)};f.open("GET",c,!0);f.send(null)}else alert("Don't know how to parse XML!")},parse:b,setPreferredShading:function(b){za=b},applySkin:h,geometries:qa}};THREE.JSONLoader=function(b){THREE.Loader.call(this,b)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;
+THREE.JSONLoader.prototype.load=function(b,c,e){var f,h=this;if(b instanceof Object)console.warn("DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath )."),f=b,b=f.model,c=f.callback,e=f.texture_path;f=new Worker(b);e=e?e:this.extractUrlbase(b);f.onmessage=function(b){h.createModel(b.data,c,e);h.onLoadComplete()};this.onLoadStart();f.postMessage(Date.now())};
+THREE.JSONLoader.prototype.createModel=function(b,c,e){var f=new THREE.Geometry,h=b.scale!==void 0?1/b.scale:1;this.initMaterials(f,b.materials,e);(function(c){if(b.version===void 0||b.version!=2)console.error("Deprecated file format.");else{var e,h,p,t,w,u,x,v,A,z,y,D,E,C,G=b.faces;u=b.vertices;var I=b.normals,P=b.colors,K=0;for(e=0;e<b.uvs.length;e++)b.uvs[e].length&&K++;for(e=0;e<K;e++)f.faceUvs[e]=[],f.faceVertexUvs[e]=[];t=0;for(w=u.length;t<w;)x=new THREE.Vertex,x.position.x=u[t++]*c,x.position.y=
+u[t++]*c,x.position.z=u[t++]*c,f.vertices.push(x);t=0;for(w=G.length;t<w;){c=G[t++];u=c&1;p=c&2;e=c&4;h=c&8;v=c&16;x=c&32;z=c&64;c&=128;u?(y=new THREE.Face4,y.a=G[t++],y.b=G[t++],y.c=G[t++],y.d=G[t++],u=4):(y=new THREE.Face3,y.a=G[t++],y.b=G[t++],y.c=G[t++],u=3);if(p)p=G[t++],y.materials=f.materials[p];p=f.faces.length;if(e)for(e=0;e<K;e++)D=b.uvs[e],A=G[t++],C=D[A*2],A=D[A*2+1],f.faceUvs[e][p]=new THREE.UV(C,A);if(h)for(e=0;e<K;e++){D=b.uvs[e];E=[];for(h=0;h<u;h++)A=G[t++],C=D[A*2],A=D[A*2+1],E[h]=
+new THREE.UV(C,A);f.faceVertexUvs[e][p]=E}if(v)v=G[t++]*3,h=new THREE.Vector3,h.x=I[v++],h.y=I[v++],h.z=I[v],y.normal=h;if(x)for(e=0;e<u;e++)v=G[t++]*3,h=new THREE.Vector3,h.x=I[v++],h.y=I[v++],h.z=I[v],y.vertexNormals.push(h);if(z)x=G[t++],x=new THREE.Color(P[x]),y.color=x;if(c)for(e=0;e<u;e++)x=G[t++],x=new THREE.Color(P[x]),y.vertexColors.push(x);f.faces.push(y)}}})(h);(function(){var c,e,h,p;if(b.skinWeights){c=0;for(e=b.skinWeights.length;c<e;c+=2)h=b.skinWeights[c],p=b.skinWeights[c+1],f.skinWeights.push(new THREE.Vector4(h,
+p,0,0))}if(b.skinIndices){c=0;for(e=b.skinIndices.length;c<e;c+=2)h=b.skinIndices[c],p=b.skinIndices[c+1],f.skinIndices.push(new THREE.Vector4(h,p,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var e,h,p,t,w,u,x,v,A;e=0;for(h=b.morphTargets.length;e<h;e++){f.morphTargets[e]={};f.morphTargets[e].name=b.morphTargets[e].name;f.morphTargets[e].vertices=[];v=f.morphTargets[e].vertices;A=b.morphTargets[e].vertices;p=0;for(t=A.length;p<t;p+=3)w=A[p]*c,u=A[p+1]*
+c,x=A[p+2]*c,v.push(new THREE.Vertex(new THREE.Vector3(w,u,x)))}}if(b.morphColors!==void 0){e=0;for(h=b.morphColors.length;e<h;e++){f.morphColors[e]={};f.morphColors[e].name=b.morphColors[e].name;f.morphColors[e].colors=[];t=f.morphColors[e].colors;w=b.morphColors[e].colors;c=0;for(p=w.length;c<p;c+=3)u=new THREE.Color(16755200),u.setRGB(w[c],w[c+1],w[c+2]),t.push(u)}}})(h);f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};
 THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
-THREE.SceneLoader.prototype={load:function(b,c){var e=this,f=new Worker(b);f.postMessage(0);var h=THREE.Loader.prototype.extractUrlbase(b);f.onmessage=function(b){function f(b,e){return e=="relativeToHTML"?b:h+"/"+b}function n(){for(v in V.objects)if(!R.objects[v])if(E=V.objects[v],E.geometry!==void 0){if(P=R.geometries[E.geometry]){var b=!1;Y=[];for(ea=0;ea<E.materials.length;ea++)Y[ea]=R.materials[E.materials[ea]],b=Y[ea]instanceof THREE.ShaderMaterial;b&&P.computeTangents();C=E.position;r=E.rotation;
+THREE.SceneLoader.prototype={load:function(b,c){var e=this,f=new Worker(b);f.postMessage(0);var h=THREE.Loader.prototype.extractUrlbase(b);f.onmessage=function(b){function f(b,c){return c=="relativeToHTML"?b:h+"/"+b}function n(){for(v in V.objects)if(!R.objects[v])if(E=V.objects[v],E.geometry!==void 0){if(P=R.geometries[E.geometry]){var b=!1;Y=[];for(ea=0;ea<E.materials.length;ea++)Y[ea]=R.materials[E.materials[ea]],b=Y[ea]instanceof THREE.ShaderMaterial;b&&P.computeTangents();C=E.position;r=E.rotation;
 q=E.quaternion;s=E.scale;q=0;Y.length==0&&(Y[0]=new THREE.MeshFaceMaterial);Y.length>1&&(Y=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(P,Y);object.name=v;object.position.set(C[0],C[1],C[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=E.visible;R.scene.add(object);R.objects[v]=object;E.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),R.scene.collisions.colliders.push(b));
 if(E.castsShadow)b=new THREE.ShadowVolume(P),R.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},R.triggers[object.name]=b)}}else C=E.position,r=E.rotation,q=E.quaternion,s=E.scale,q=0,object=new THREE.Object3D,object.name=v,object.position.set(C[0],C[1],C[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],
-s[1],s[2]),object.visible=E.visible!==void 0?E.visible:!1,R.scene.add(object),R.objects[v]=object,R.empties[v]=object,E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},R.triggers[object.name]=b)}function p(b){return function(c){R.geometries[b]=c;n();$-=1;e.onLoadComplete();w()}}function t(b){return function(e){R.geometries[b]=e}}function w(){e.callbackProgress({totalModels:Q,totalTextures:o,loadedModels:Q-$,loadedTextures:o-Z},R);e.onLoadProgress();$==0&&Z==0&&c(R)}var u,x,
+s[1],s[2]),object.visible=E.visible!==void 0?E.visible:!1,R.scene.add(object),R.objects[v]=object,R.empties[v]=object,E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},R.triggers[object.name]=b)}function p(b){return function(c){R.geometries[b]=c;n();$-=1;e.onLoadComplete();w()}}function t(b){return function(c){R.geometries[b]=c}}function w(){e.callbackProgress({totalModels:Q,totalTextures:o,loadedModels:Q-$,loadedTextures:o-Z},R);e.onLoadProgress();$==0&&Z==0&&c(R)}var u,x,
 v,A,z,y,D,E,C,G,I,P,K,B,O,Y,N,V,J,$,Z,Q,o,R;V=b.data;O=new THREE.BinaryLoader;J=new THREE.JSONLoader;Z=$=0;R={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in V.objects)if(E=V.objects[v],E.meshCollider){b=!0;break}if(b)R.scene.collisions=new THREE.CollisionSystem;if(V.transform){b=V.transform.position;G=V.transform.rotation;var fa=V.transform.scale;b&&R.scene.position.set(b[0],b[1],b[2]);G&&R.scene.rotation.set(G[0],
 G[1],G[2]);fa&&R.scene.scale.set(fa[0],fa[1],fa[2]);(b||G||fa)&&R.scene.updateMatrix()}b=function(){Z-=1;w();e.onLoadComplete()};for(z in V.cameras)G=V.cameras[z],G.type=="perspective"?K=new THREE.PerspectiveCamera(G.fov,G.aspect,G.near,G.far):G.type=="ortho"&&(K=new THREE.OrthographicCamera(G.left,G.right,G.top,G.bottom,G.near,G.far)),C=G.position,G=G.target,K.position.set(C[0],C[1],C[2]),K.target=new THREE.Vector3(G[0],G[1],G[2]),R.cameras[z]=K;for(A in V.lights)z=V.lights[A],K=z.color!==void 0?
 z.color:16777215,G=z.intensity!==void 0?z.intensity:1,z.type=="directional"?(C=z.direction,N=new THREE.DirectionalLight(K,G),N.position.set(C[0],C[1],C[2]),N.position.normalize()):z.type=="point"?(C=z.position,d=z.distance,N=new THREE.PointLight(K,G,d),N.position.set(C[0],C[1],C[2])):z.type=="ambient"&&(N=new THREE.AmbientLight(K)),R.scene.add(N),R.lights[A]=N;for(y in V.fogs)A=V.fogs[y],A.type=="linear"?B=new THREE.Fog(0,A.near,A.far):A.type=="exp2"&&(B=new THREE.FogExp2(0,A.density)),G=A.color,
 B.color.setRGB(G[0],G[1],G[2]),R.fogs[y]=B;if(R.cameras&&V.defaults.camera)R.currentCamera=R.cameras[V.defaults.camera];if(R.fogs&&V.defaults.fog)R.scene.fog=R.fogs[V.defaults.fog];G=V.defaults.bgcolor;R.bgColor=new THREE.Color;R.bgColor.setRGB(G[0],G[1],G[2]);R.bgColorAlpha=V.defaults.bgalpha;for(u in V.geometries)if(y=V.geometries[u],y.type=="bin_mesh"||y.type=="ascii_mesh")$+=1,e.onLoadStart();Q=$;for(u in V.geometries)y=V.geometries[u],y.type=="cube"?(P=new THREE.CubeGeometry(y.width,y.height,
 y.depth,y.segmentsWidth,y.segmentsHeight,y.segmentsDepth,null,y.flipped,y.sides),R.geometries[u]=P):y.type=="plane"?(P=new THREE.PlaneGeometry(y.width,y.height,y.segmentsWidth,y.segmentsHeight),R.geometries[u]=P):y.type=="sphere"?(P=new THREE.SphereGeometry(y.radius,y.segmentsWidth,y.segmentsHeight),R.geometries[u]=P):y.type=="cylinder"?(P=new THREE.CylinderGeometry(y.topRad,y.botRad,y.height,y.radSegs,y.heightSegs),R.geometries[u]=P):y.type=="torus"?(P=new THREE.TorusGeometry(y.radius,y.tube,y.segmentsR,
-y.segmentsT),R.geometries[u]=P):y.type=="icosahedron"?(P=new THREE.IcosahedronGeometry(y.subdivisions),R.geometries[u]=P):y.type=="bin_mesh"?O.load({model:f(y.url,V.urlBaseType),callback:p(u)}):y.type=="ascii_mesh"?J.load({model:f(y.url,V.urlBaseType),callback:p(u)}):y.type=="embedded_mesh"&&(y=V.embeds[y.id])&&J.createModel(y,t(u),"");for(D in V.textures)if(u=V.textures[D],u.url instanceof Array){Z+=u.url.length;for(O=0;O<u.url.length;O++)e.onLoadStart()}else Z+=1,e.onLoadStart();o=Z;for(D in V.textures){u=
-V.textures[D];if(u.mapping!=void 0&&THREE[u.mapping]!=void 0)u.mapping=new THREE[u.mapping];if(u.url instanceof Array){O=[];for(var ea=0;ea<u.url.length;ea++)O[ea]=f(u.url[ea],V.urlBaseType);O=THREE.ImageUtils.loadTextureCube(O,u.mapping,b)}else{O=THREE.ImageUtils.loadTexture(f(u.url,V.urlBaseType),u.mapping,b);if(THREE[u.minFilter]!=void 0)O.minFilter=THREE[u.minFilter];if(THREE[u.magFilter]!=void 0)O.magFilter=THREE[u.magFilter];if(u.repeat){O.repeat.set(u.repeat[0],u.repeat[1]);if(u.repeat[0]!=
-1)O.wrapS=THREE.RepeatWrapping;if(u.repeat[1]!=1)O.wrapT=THREE.RepeatWrapping}u.offset&&O.offset.set(u.offset[0],u.offset[1]);if(u.wrap){J={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(J[u.wrap[0]]!==void 0)O.wrapS=J[u.wrap[0]];if(J[u.wrap[1]]!==void 0)O.wrapT=J[u.wrap[1]]}}R.textures[D]=O}for(x in V.materials){D=V.materials[x];for(I in D.parameters)if(I=="envMap"||I=="map"||I=="lightMap")D.parameters[I]=R.textures[D.parameters[I]];else if(I=="shading")D.parameters[I]=D.parameters[I]==
-"flat"?THREE.FlatShading:THREE.SmoothShading;else if(I=="blending")D.parameters[I]=THREE[D.parameters[I]]?THREE[D.parameters[I]]:THREE.NormalBlending;else if(I=="combine")D.parameters[I]=D.parameters[I]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(I=="vertexColors")if(D.parameters[I]=="face")D.parameters[I]=THREE.FaceColors;else if(D.parameters[I])D.parameters[I]=THREE.VertexColors;if(D.parameters.opacity!==void 0&&D.parameters.opacity<1)D.parameters.transparent=!0;if(D.parameters.normalMap){u=
-THREE.ShaderUtils.lib.normal;b=THREE.UniformsUtils.clone(u.uniforms);O=D.parameters.color;J=D.parameters.specular;y=D.parameters.ambient;B=D.parameters.shininess;b.tNormal.texture=R.textures[D.parameters.normalMap];if(D.parameters.normalMapFactor)b.uNormalScale.value=D.parameters.normalMapFactor;if(D.parameters.map)b.tDiffuse.texture=D.parameters.map,b.enableDiffuse.value=!0;if(D.parameters.lightMap)b.tAO.texture=D.parameters.lightMap,b.enableAO.value=!0;if(D.parameters.specularMap)b.tSpecular.texture=
-R.textures[D.parameters.specularMap],b.enableSpecular.value=!0;b.uDiffuseColor.value.setHex(O);b.uSpecularColor.value.setHex(J);b.uAmbientColor.value.setHex(y);b.uShininess.value=B;if(D.parameters.opacity)b.uOpacity.value=D.parameters.opacity;D=new THREE.ShaderMaterial({fragmentShader:u.fragmentShader,vertexShader:u.vertexShader,uniforms:b,lights:!0,fog:!0})}else D=new THREE[D.type](D.parameters);R.materials[x]=D}n();e.callbackSync(R)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};
-THREE.UTF8Loader.prototype=new THREE.UTF8Loader;THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
+y.segmentsT),R.geometries[u]=P):y.type=="icosahedron"?(P=new THREE.IcosahedronGeometry(y.subdivisions),R.geometries[u]=P):y.type=="bin_mesh"?O.load(f(y.url,V.urlBaseType),p(u)):y.type=="ascii_mesh"?J.load(f(y.url,V.urlBaseType),p(u)):y.type=="embedded_mesh"&&(y=V.embeds[y.id])&&J.createModel(y,t(u),"");for(D in V.textures)if(u=V.textures[D],u.url instanceof Array){Z+=u.url.length;for(O=0;O<u.url.length;O++)e.onLoadStart()}else Z+=1,e.onLoadStart();o=Z;for(D in V.textures){u=V.textures[D];if(u.mapping!=
+void 0&&THREE[u.mapping]!=void 0)u.mapping=new THREE[u.mapping];if(u.url instanceof Array){O=[];for(var ea=0;ea<u.url.length;ea++)O[ea]=f(u.url[ea],V.urlBaseType);O=THREE.ImageUtils.loadTextureCube(O,u.mapping,b)}else{O=THREE.ImageUtils.loadTexture(f(u.url,V.urlBaseType),u.mapping,b);if(THREE[u.minFilter]!=void 0)O.minFilter=THREE[u.minFilter];if(THREE[u.magFilter]!=void 0)O.magFilter=THREE[u.magFilter];if(u.repeat){O.repeat.set(u.repeat[0],u.repeat[1]);if(u.repeat[0]!=1)O.wrapS=THREE.RepeatWrapping;
+if(u.repeat[1]!=1)O.wrapT=THREE.RepeatWrapping}u.offset&&O.offset.set(u.offset[0],u.offset[1]);if(u.wrap){J={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(J[u.wrap[0]]!==void 0)O.wrapS=J[u.wrap[0]];if(J[u.wrap[1]]!==void 0)O.wrapT=J[u.wrap[1]]}}R.textures[D]=O}for(x in V.materials){D=V.materials[x];for(I in D.parameters)if(I=="envMap"||I=="map"||I=="lightMap")D.parameters[I]=R.textures[D.parameters[I]];else if(I=="shading")D.parameters[I]=D.parameters[I]=="flat"?THREE.FlatShading:
+THREE.SmoothShading;else if(I=="blending")D.parameters[I]=THREE[D.parameters[I]]?THREE[D.parameters[I]]:THREE.NormalBlending;else if(I=="combine")D.parameters[I]=D.parameters[I]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(I=="vertexColors")if(D.parameters[I]=="face")D.parameters[I]=THREE.FaceColors;else if(D.parameters[I])D.parameters[I]=THREE.VertexColors;if(D.parameters.opacity!==void 0&&D.parameters.opacity<1)D.parameters.transparent=!0;if(D.parameters.normalMap){u=THREE.ShaderUtils.lib.normal;
+b=THREE.UniformsUtils.clone(u.uniforms);O=D.parameters.color;J=D.parameters.specular;y=D.parameters.ambient;B=D.parameters.shininess;b.tNormal.texture=R.textures[D.parameters.normalMap];if(D.parameters.normalMapFactor)b.uNormalScale.value=D.parameters.normalMapFactor;if(D.parameters.map)b.tDiffuse.texture=D.parameters.map,b.enableDiffuse.value=!0;if(D.parameters.lightMap)b.tAO.texture=D.parameters.lightMap,b.enableAO.value=!0;if(D.parameters.specularMap)b.tSpecular.texture=R.textures[D.parameters.specularMap],
+b.enableSpecular.value=!0;b.uDiffuseColor.value.setHex(O);b.uSpecularColor.value.setHex(J);b.uAmbientColor.value.setHex(y);b.uShininess.value=B;if(D.parameters.opacity)b.uOpacity.value=D.parameters.opacity;D=new THREE.ShaderMaterial({fragmentShader:u.fragmentShader,vertexShader:u.vertexShader,uniforms:b,lights:!0,fog:!0})}else D=new THREE[D.type](D.parameters);R.materials[x]=D}n();e.callbackSync(R)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};THREE.UTF8Loader.prototype=new THREE.UTF8Loader;
+THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
 THREE.UTF8Loader.prototype.load=function(b){var c=new XMLHttpRequest,e=b.model,f=b.callback,h=b.scale!==void 0?b.scale:1,k=b.offsetX!==void 0?b.offsetX:0,m=b.offsetY!==void 0?b.offsetY:0,n=b.offsetZ!==void 0?b.offsetZ:0;c.onreadystatechange=function(){c.readyState==4?c.status==200||c.status==0?THREE.UTF8Loader.prototype.createModel(c.responseText,f,h,k,m,n):alert("Couldn't load ["+e+"] ["+c.status+"]"):c.readyState!=3&&c.readyState==2&&c.getResponseHeader("Content-Length")};c.open("GET",e,!0);c.send(null)};
 THREE.UTF8Loader.prototype.decompressMesh=function(b){var c=b.charCodeAt(0);c>=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,h=0;h<8;h++){for(var k=0,m=0;m<c;++m){var n=b.charCodeAt(m+f);k+=n>>1^-(n&1);e[8*m+h]=k}f+=c}c=b.length-f;k=new Uint16Array(c);for(h=m=0;h<c;h++)n=b.charCodeAt(h+f),k[h]=m-n,n==0&&m++;return[e,k]};
-THREE.UTF8Loader.prototype.createModel=function(b,c,e,f,h,k){var m=function(){var c=this;c.materials=[];THREE.Geometry.call(this);var m=THREE.UTF8Loader.prototype.decompressMesh(b),t=[],w=[];(function(b,m,p){for(var t,w,y,D=b.length;p<D;p+=m)t=b[p],w=b[p+1],y=b[p+2],t=t/16383*e,w=w/16383*e,y=y/16383*e,t+=f,w+=h,y+=k,c.vertices.push(new THREE.Vertex(new THREE.Vector3(t,w,y)))})(m[0],8,0);(function(b,e,c){for(var f,h,k=b.length;c<k;c+=e)f=b[c],h=b[c+1],f/=1023,h/=1023,w.push(f,1-h)})(m[0],8,3);(function(b,
-e,c){for(var f,h,k,m=b.length;c<m;c+=e)f=b[c],h=b[c+1],k=b[c+2],f=(f-512)/511,h=(h-512)/511,k=(k-512)/511,t.push(f,h,k)})(m[0],8,5);(function(b){var e,f,h,k,m,p,E,C,G,I=b.length;for(e=0;e<I;e+=3){f=b[e];h=b[e+1];k=b[e+2];m=c;C=f;G=h;p=k;E=f;var P=h,K=k,B=m.materials[0],O=t[P*3],Y=t[P*3+1],P=t[P*3+2],N=t[K*3],V=t[K*3+1],K=t[K*3+2];E=new THREE.Vector3(t[E*3],t[E*3+1],t[E*3+2]);P=new THREE.Vector3(O,Y,P);K=new THREE.Vector3(N,V,K);m.faces.push(new THREE.Face3(C,G,p,[E,P,K],null,B));m=w[f*2];f=w[f*2+
+THREE.UTF8Loader.prototype.createModel=function(b,c,e,f,h,k){var m=function(){var c=this;c.materials=[];THREE.Geometry.call(this);var m=THREE.UTF8Loader.prototype.decompressMesh(b),t=[],w=[];(function(b,m,p){for(var t,w,y,D=b.length;p<D;p+=m)t=b[p],w=b[p+1],y=b[p+2],t=t/16383*e,w=w/16383*e,y=y/16383*e,t+=f,w+=h,y+=k,c.vertices.push(new THREE.Vertex(new THREE.Vector3(t,w,y)))})(m[0],8,0);(function(b,c,e){for(var f,h,k=b.length;e<k;e+=c)f=b[e],h=b[e+1],f/=1023,h/=1023,w.push(f,1-h)})(m[0],8,3);(function(b,
+c,e){for(var f,h,k,m=b.length;e<m;e+=c)f=b[e],h=b[e+1],k=b[e+2],f=(f-512)/511,h=(h-512)/511,k=(k-512)/511,t.push(f,h,k)})(m[0],8,5);(function(b){var e,f,h,k,m,p,E,C,G,I=b.length;for(e=0;e<I;e+=3){f=b[e];h=b[e+1];k=b[e+2];m=c;C=f;G=h;p=k;E=f;var P=h,K=k,B=m.materials[0],O=t[P*3],Y=t[P*3+1],P=t[P*3+2],N=t[K*3],V=t[K*3+1],K=t[K*3+2];E=new THREE.Vector3(t[E*3],t[E*3+1],t[E*3+2]);P=new THREE.Vector3(O,Y,P);K=new THREE.Vector3(N,V,K);m.faces.push(new THREE.Face3(C,G,p,[E,P,K],null,B));m=w[f*2];f=w[f*2+
 1];p=w[h*2];E=w[h*2+1];C=w[k*2];G=w[k*2+1];k=c.faceVertexUvs[0];h=p;p=E;E=[];E.push(new THREE.UV(m,f));E.push(new THREE.UV(h,p));E.push(new THREE.UV(C,G));k.push(E)}})(m[1]);this.computeCentroids();this.computeFaceNormals()};m.prototype=new THREE.Geometry;m.prototype.constructor=m;c(new m)};
 THREE.Axes=function(){THREE.Object3D.call(this);var b=new THREE.Geometry;b.vertices.push(new THREE.Vertex);b.vertices.push(new THREE.Vertex(new THREE.Vector3(0,100,0)));var c=new THREE.CylinderGeometry(0,5,25,5,1),e=new THREE.Line(b,new THREE.LineBasicMaterial({color:16711680}));e.rotation.z=-Math.PI/2;this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:16711680}));e.position.x=100;e.rotation.z=-Math.PI/2;this.add(e);e=new THREE.Line(b,new THREE.LineBasicMaterial({color:65280}));this.add(e);
 e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:65280}));e.position.y=100;this.add(e);e=new THREE.Line(b,new THREE.LineBasicMaterial({color:255}));e.rotation.x=Math.PI/2;this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:255}));e.position.z=100;e.rotation.x=Math.PI/2;this.add(e)};THREE.Axes.prototype=new THREE.Object3D;THREE.Axes.prototype.constructor=THREE.Axes;

+ 14 - 14
build/custom/ThreeExtras.js

@@ -88,8 +88,8 @@ THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var e=this.data.hie
 THREE.CubeCamera=function(a,b,c,e){this.heightOffset=c;this.position=new THREE.Vector3(0,c,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position=
 this.position;this.cameraNY.position=this.position;this.cameraPZ.position=this.position;this.cameraNZ.position=this.position;this.cameraPX.up.set(0,-1,0);this.cameraNX.up.set(0,-1,0);this.cameraPY.up.set(0,0,1);this.cameraNY.up.set(0,0,-1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.targetPX=new THREE.Vector3(0,0,0);this.targetNX=new THREE.Vector3(0,0,0);this.targetPY=new THREE.Vector3(0,0,0);this.targetNY=new THREE.Vector3(0,0,0);this.targetPZ=new THREE.Vector3(0,0,0);this.targetNZ=
 new THREE.Vector3(0,0,0);this.renderTarget=new THREE.WebGLRenderTargetCube(e,e,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updatePosition=function(a){this.position.copy(a);this.position.y+=this.heightOffset;this.targetPX.copy(this.position);this.targetNX.copy(this.position);this.targetPY.copy(this.position);this.targetNY.copy(this.position);this.targetPZ.copy(this.position);this.targetNZ.copy(this.position);this.targetPX.x+=1;this.targetNX.x-=1;this.targetPY.y+=
-1;this.targetNY.y-=1;this.targetPZ.z+=1;this.targetNZ.z-=1;this.cameraPX.lookAt(this.targetPX);this.cameraNX.lookAt(this.targetNX);this.cameraPY.lookAt(this.targetPY);this.cameraNY.lookAt(this.targetNY);this.cameraPZ.lookAt(this.targetPZ);this.cameraNZ.lookAt(this.targetNZ)};this.updateCubeMap=function(a,c){var b=this.renderTarget;b.activeCubeFace=0;a.render(c,this.cameraPX,b);b.activeCubeFace=1;a.render(c,this.cameraNX,b);b.activeCubeFace=2;a.render(c,this.cameraPY,b);b.activeCubeFace=3;a.render(c,
-this.cameraNY,b);b.activeCubeFace=4;a.render(c,this.cameraPZ,b);b.activeCubeFace=5;a.render(c,this.cameraNZ,b)}};THREE.FirstPersonCamera=function(){console.warn("DEPRECATED: FirstPersonCamera() is FirstPersonControls().")};THREE.PathCamera=function(){console.warn("DEPRECATED: PathCamera() is PathControls().")};THREE.FlyCamera=function(){console.warn("DEPRECATED: FlyCamera() is FlyControls().")};THREE.RollCamera=function(){console.warn("DEPRECATED: RollCamera() is RollControls().")};
+1;this.targetNY.y-=1;this.targetPZ.z+=1;this.targetNZ.z-=1;this.cameraPX.lookAt(this.targetPX);this.cameraNX.lookAt(this.targetNX);this.cameraPY.lookAt(this.targetPY);this.cameraNY.lookAt(this.targetNY);this.cameraPZ.lookAt(this.targetPZ);this.cameraNZ.lookAt(this.targetNZ)};this.updateCubeMap=function(a,c){var e=this.renderTarget;e.activeCubeFace=0;a.render(c,this.cameraPX,e);e.activeCubeFace=1;a.render(c,this.cameraNX,e);e.activeCubeFace=2;a.render(c,this.cameraPY,e);e.activeCubeFace=3;a.render(c,
+this.cameraNY,e);e.activeCubeFace=4;a.render(c,this.cameraPZ,e);e.activeCubeFace=5;a.render(c,this.cameraNZ,e)}};THREE.FirstPersonCamera=function(){console.warn("DEPRECATED: FirstPersonCamera() is FirstPersonControls().")};THREE.PathCamera=function(){console.warn("DEPRECATED: PathCamera() is PathControls().")};THREE.FlyCamera=function(){console.warn("DEPRECATED: FlyCamera() is FlyControls().")};THREE.RollCamera=function(){console.warn("DEPRECATED: RollCamera() is RollControls().")};
 THREE.TrackballCamera=function(){console.warn("DEPRECATED: TrackballCamera() is TrackballControls().")};THREE.CombinedCamera=function(a,b,c,e,f,h,g){THREE.Camera.call(this);this.cameraO=new THREE.OrthographicCamera(a/-2,a/2,b/2,b/-2,h,g);this.cameraP=new THREE.PerspectiveCamera(c,a/b,e,f);this.toPerspective()};THREE.CombinedCamera.prototype=new THREE.Camera;THREE.CombinedCamera.prototype.constructor=THREE.CoolCamera;
 THREE.CombinedCamera.prototype.toPerspective=function(){this.near=this.cameraP.near;this.far=this.cameraP.far;this.projectionMatrix=this.cameraP.projectionMatrix};THREE.CombinedCamera.prototype.toOrthographic=function(){this.near=this.cameraO.near;this.far=this.cameraO.far;this.projectionMatrix=this.cameraO.projectionMatrix};THREE.CombinedCamera.prototype.setFov=function(a){this.cameraP.fov=a;this.cameraP.updateProjectionMatrix();this.toPerspective()};
 THREE.CombinedCamera.prototype.setLens=function(a,b){b||(b=43.25);var c=2*Math.atan(b/(a*2));c*=180/Math.PI;this.setFov(c);return c};
@@ -191,7 +191,7 @@ b(x,n[w],p.b,n[B],p,["123","12","2","23"]),b(x,n[B],p.c,n[D],p,["123","23","3","
 c){I[a]===void 0&&(I[a]={});I[a][c]=null};for(t in y)p=y[t],B=t.split("_"),u=B[0],B=B[1],l(u,[u,B]),l(B,[u,B]),x=p[0],w=p[1],n(u,x),w?n(u,w):n(u,x),n(B,x),w?n(B,w):n(B,x);l=new THREE.Vector3;n=new THREE.Vector3;t=0;for(u=k.length;t<u;t++)if(E[t]!==void 0){l.set(0,0,0);n.set(0,0,0);y=new THREE.Vector3(0,0,0);z=0;for(v in I[t])l.addSelf(m[v]),z++;l.divideScalar(z);z=E[t].length;for(v=0;v<z;v++)p=E[t][v],p=k[p[0]].position.clone().addSelf(k[p[1]].position).divideScalar(2),n.addSelf(p);n.divideScalar(z);
 y.addSelf(k[t].position);y.multiplyScalar(z-3);y.addSelf(l);y.addSelf(n.multiplyScalar(2));y.divideScalar(z);e[t].position=y}a.vertices=e;a.faces=f;a.faceVertexUvs[0]=h;delete a.__tmpVertices;a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals()};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={constructor:THREE.Loader,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.length<1?"":a.join("/")+"/"},init_materials:function(a,b,c){a.materials=[];for(var e=0;e<b.length;++e)a.materials[e]=[THREE.Loader.prototype.createMaterial(b[e],c)]},hasNormals:function(a){var b,c,e=a.materials.length;for(c=0;c<e;c++)if(b=a.materials[c][0],b instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.floor(a)==
+1E3).toFixed(2)+" KB";this.statusDomElement.innerHTML=b},extractUrlbase:function(a){a=a.split("/");a.pop();return a.length<1?"":a.join("/")+"/"},initMaterials:function(a,b,c){a.materials=[];for(var e=0;e<b.length;++e)a.materials[e]=[THREE.Loader.prototype.createMaterial(b[e],c)]},hasNormals:function(a){var b,c,e=a.materials.length;for(c=0;c<e;c++)if(b=a.materials[c][0],b instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.floor(a)==
 a}function e(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!c(this.height)){var b=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),e=Math.pow(2,Math.round(Math.log(this.height)/Math.LN2));a.image.width=b;a.image.height=e;a.image.getContext("2d").drawImage(this,0,0,b,e)}else a.image=this;a.needsUpdate=!0};e.src=b}function f(a,c,g,h,f,k){var l=document.createElement("canvas");a[c]=new THREE.Texture(l);a[c].sourceFile=g;if(h){a[c].repeat.set(h[0],h[1]);if(h[0]!=1)a[c].wrapS=THREE.RepeatWrapping;
 if(h[1]!=1)a[c].wrapT=THREE.RepeatWrapping}f&&a[c].offset.set(f[0],f[1]);if(k){h={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(h[k[0]]!==void 0)a[c].wrapS=h[k[0]];if(h[k[1]]!==void 0)a[c].wrapT=h[k[1]]}e(a[c],b+"/"+g)}function h(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}var g,k,l;k="MeshLambertMaterial";g={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:a.wireframe};a.shading&&(a.shading=="Phong"?k="MeshPhongMaterial":a.shading=="Basic"&&(k="MeshBasicMaterial"));
 if(a.blending)if(a.blending=="Additive")g.blending=THREE.AdditiveBlending;else if(a.blending=="Subtractive")g.blending=THREE.SubtractiveBlending;else if(a.blending=="Multiply")g.blending=THREE.MultiplyBlending;if(a.transparent!==void 0||a.opacity<1)g.transparent=a.transparent;if(a.depthTest!==void 0)g.depthTest=a.depthTest;if(a.vertexColors!==void 0)if(a.vertexColors=="face")g.vertexColors=THREE.FaceColors;else if(a.vertexColors)g.vertexColors=THREE.VertexColors;if(a.colorDiffuse)g.color=h(a.colorDiffuse);
@@ -199,15 +199,15 @@ else if(a.DbgColor)g.color=a.DbgColor;if(a.colorSpecular)g.specular=h(a.colorSpe
 a.mapSpecular&&b&&f(g,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap);if(a.mapNormal){var m=THREE.ShaderUtils.lib.normal,n=THREE.UniformsUtils.clone(m.uniforms),o=g.color;k=g.specular;l=g.ambient;var t=g.shininess;n.tNormal.texture=g.normalMap;if(a.mapNormalFactor)n.uNormalScale.value=a.mapNormalFactor;if(g.map)n.tDiffuse.texture=g.map,n.enableDiffuse.value=!0;if(g.specularMap)n.tSpecular.texture=g.specularMap,n.enableSpecular.value=!0;if(g.lightMap)n.tAO.texture=
 g.lightMap,n.enableAO.value=!0;n.uDiffuseColor.value.setHex(o);n.uSpecularColor.value.setHex(k);n.uAmbientColor.value.setHex(l);n.uShininess.value=t;if(g.opacity)n.uOpacity.value=g.opacity;g=new THREE.ShaderMaterial({fragmentShader:m.fragmentShader,vertexShader:m.vertexShader,uniforms:n,lights:!0,fog:!0})}else g=new THREE[k](g);return g}};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;
 THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
-THREE.BinaryLoader.prototype.load=function(a){var b=a.model,c=a.callback,e=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(b),f=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(b),a=(new Date).getTime(),b=new Worker(b),h=this.showProgress?THREE.Loader.prototype.updateProgress:null;b.onmessage=function(a){THREE.BinaryLoader.prototype.loadAjaxBuffers(a.data.buffers,a.data.materials,c,f,e,h)};b.onerror=function(a){alert("worker.onerror: "+a.message+"\n"+a.data);a.preventDefault()};
-b.postMessage(a)};
+THREE.BinaryLoader.prototype.load=function(a,b,c,e){if(a instanceof Object){console.warn("DEPRECATED: BinaryLoader( parameters ) is now BinaryLoader( url, callback, texturePath, binaryPath ).");var f=a,a=f.model,b=f.callback,c=f.texture_path,e=f.bin_path}var c=c?c:this.extractUrlbase(a),e=e?e:this.extractUrlbase(a),f=Date.now(),a=new Worker(a),h=this.showProgress?THREE.Loader.prototype.updateProgress:null;a.onmessage=function(a){THREE.BinaryLoader.prototype.loadAjaxBuffers(a.data.buffers,a.data.materials,
+b,e,c,h)};a.onerror=function(a){alert("worker.onerror: "+a.message+"\n"+a.data);a.preventDefault()};a.postMessage(f)};
 THREE.BinaryLoader.prototype.loadAjaxBuffers=function(a,b,c,e,f,h){var g=new XMLHttpRequest,k=e+"/"+a,l=0;g.onreadystatechange=function(){g.readyState==4?g.status==200||g.status==0?THREE.BinaryLoader.prototype.createBinModel(g.responseText,c,f,b):alert("Couldn't load ["+k+"] ["+g.status+"]"):g.readyState==3?h&&(l==0&&(l=g.getResponseHeader("Content-Length")),h({total:l,loaded:g.responseText.length})):g.readyState==2&&(l=g.getResponseHeader("Content-Length"))};g.open("GET",k,!0);g.overrideMimeType("text/plain; charset=x-user-defined");
 g.setRequestHeader("Content-Type","text/plain");g.send(null)};
 THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,e){var f=function(c){function b(a,c){var e=n(a,c),g=n(a,c+1),f=n(a,c+2),h=n(a,c+3),k=(h<<1&255|f>>7)-127;e|=(f&127)<<16|g<<8;if(e==0&&k==-127)return 0;return(1-2*(h>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,k)}function f(a,c){var b=n(a,c),e=n(a,c+1),g=n(a,c+2);return(n(a,c+3)<<24)+(g<<16)+(e<<8)+b}function l(a,c){var b=n(a,c);return(n(a,c+1)<<8)+b}function m(a,c){var b=n(a,c);return b>127?b-256:b}function n(a,c){return a.charCodeAt(c)&255}function o(c){var b,
 e,g;b=f(a,c);e=f(a,c+B);g=f(a,c+E);c=l(a,c+I);z.faces.push(new THREE.Face3(b,e,g,null,null,z.materials[c]))}function t(c){var b,e,g,h,m,o;b=f(a,c);e=f(a,c+B);g=f(a,c+E);h=l(a,c+I);m=f(a,c+G);o=f(a,c+K);c=f(a,c+C);h=z.materials[h];var n=A[o*3],p=A[o*3+1];o=A[o*3+2];var t=A[c*3],u=A[c*3+1],c=A[c*3+2];z.faces.push(new THREE.Face3(b,e,g,[new THREE.Vector3(A[m*3],A[m*3+1],A[m*3+2]),new THREE.Vector3(n,p,o),new THREE.Vector3(t,u,c)],null,h))}function u(c){var b,e,g,h;b=f(a,c);e=f(a,c+F);g=f(a,c+J);h=f(a,
 c+M);c=l(a,c+N);z.faces.push(new THREE.Face4(b,e,g,h,null,null,z.materials[c]))}function v(c){var b,e,g,h,m,o,n,p;b=f(a,c);e=f(a,c+F);g=f(a,c+J);h=f(a,c+M);m=l(a,c+N);o=f(a,c+L);n=f(a,c+O);p=f(a,c+H);c=f(a,c+Q);m=z.materials[m];var t=A[n*3],u=A[n*3+1];n=A[n*3+2];var la=A[p*3],ma=A[p*3+1];p=A[p*3+2];var na=A[c*3],v=A[c*3+1],c=A[c*3+2];z.faces.push(new THREE.Face4(b,e,g,h,[new THREE.Vector3(A[o*3],A[o*3+1],A[o*3+2]),new THREE.Vector3(t,u,n),new THREE.Vector3(la,ma,p),new THREE.Vector3(na,v,c)],null,
 m))}function y(c){var b,e,g,h;b=f(a,c);e=f(a,c+P);g=f(a,c+T);c=D[b*2];h=D[b*2+1];b=D[e*2];var l=z.faceVertexUvs[0];e=D[e*2+1];var m=D[g*2];g=D[g*2+1];var o=[];o.push(new THREE.UV(c,h));o.push(new THREE.UV(b,e));o.push(new THREE.UV(m,g));l.push(o)}function p(c){var b,e,g,h,l,m;b=f(a,c);e=f(a,c+X);g=f(a,c+R);h=f(a,c+S);c=D[b*2];l=D[b*2+1];b=D[e*2];m=D[e*2+1];e=D[g*2];var o=z.faceVertexUvs[0];g=D[g*2+1];var n=D[h*2];h=D[h*2+1];var p=[];p.push(new THREE.UV(c,l));p.push(new THREE.UV(b,m));p.push(new THREE.UV(e,
-g));p.push(new THREE.UV(n,h));o.push(p)}var z=this,x=0,w,A=[],D=[],B,E,I,G,K,C,F,J,M,N,L,O,H,Q,P,T,X,R,S,W,U,Z,Y,$,V;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(z,e,c);w={signature:a.substr(x,8),header_bytes:n(a,x+8),vertex_coordinate_bytes:n(a,x+9),normal_coordinate_bytes:n(a,x+10),uv_coordinate_bytes:n(a,x+11),vertex_index_bytes:n(a,x+12),normal_index_bytes:n(a,x+13),uv_index_bytes:n(a,x+14),material_index_bytes:n(a,x+15),nvertices:f(a,x+16),nnormals:f(a,x+16+4),nuvs:f(a,x+16+
+g));p.push(new THREE.UV(n,h));o.push(p)}var z=this,x=0,w,A=[],D=[],B,E,I,G,K,C,F,J,M,N,L,O,H,Q,P,T,X,R,S,W,U,Z,Y,$,V;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(z,e,c);w={signature:a.substr(x,8),header_bytes:n(a,x+8),vertex_coordinate_bytes:n(a,x+9),normal_coordinate_bytes:n(a,x+10),uv_coordinate_bytes:n(a,x+11),vertex_index_bytes:n(a,x+12),normal_index_bytes:n(a,x+13),uv_index_bytes:n(a,x+14),material_index_bytes:n(a,x+15),nvertices:f(a,x+16),nnormals:f(a,x+16+4),nuvs:f(a,x+16+
 8),ntri_flat:f(a,x+16+12),ntri_smooth:f(a,x+16+16),ntri_flat_uv:f(a,x+16+20),ntri_smooth_uv:f(a,x+16+24),nquad_flat:f(a,x+16+28),nquad_smooth:f(a,x+16+32),nquad_flat_uv:f(a,x+16+36),nquad_smooth_uv:f(a,x+16+40)};x+=w.header_bytes;B=w.vertex_index_bytes;E=w.vertex_index_bytes*2;I=w.vertex_index_bytes*3;G=w.vertex_index_bytes*3+w.material_index_bytes;K=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes;C=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes*2;F=w.vertex_index_bytes;
 J=w.vertex_index_bytes*2;M=w.vertex_index_bytes*3;N=w.vertex_index_bytes*4;L=w.vertex_index_bytes*4+w.material_index_bytes;O=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes;H=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*2;Q=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*3;P=w.uv_index_bytes;T=w.uv_index_bytes*2;X=w.uv_index_bytes;R=w.uv_index_bytes*2;S=w.uv_index_bytes*3;c=w.vertex_index_bytes*3+w.material_index_bytes;V=w.vertex_index_bytes*
 4+w.material_index_bytes;W=w.ntri_flat*c;U=w.ntri_smooth*(c+w.normal_index_bytes*3);Z=w.ntri_flat_uv*(c+w.uv_index_bytes*3);Y=w.ntri_smooth_uv*(c+w.normal_index_bytes*3+w.uv_index_bytes*3);$=w.nquad_flat*V;c=w.nquad_smooth*(V+w.normal_index_bytes*4);V=w.nquad_flat_uv*(V+w.uv_index_bytes*4);x+=function(c){for(var e,h,f,k=w.vertex_coordinate_bytes*3,l=c+w.nvertices*k;c<l;c+=k)e=b(a,c),h=b(a,c+w.vertex_coordinate_bytes),f=b(a,c+w.vertex_coordinate_bytes*2),z.vertices.push(new THREE.Vertex(new THREE.Vector3(e,
@@ -270,8 +270,8 @@ parseInt(g[c].replace(/\)/,""))}this.sid=a;this.dotSyntax=b;this.arrSyntax=e;thi
 b.read();break;case "OUTPUT":this.output=b.read();break;case "INTERPOLATION":this.interpolation=b.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(c.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(a=0;a<this.input.length;a++)this.startTime=Math.min(this.startTime,this.input[a]),this.endTime=Math.max(this.endTime,this.input[a]);this.duration=this.endTime-this.startTime}};return{load:function(c,b){if(document.implementation&&
 document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);c+="?rnd="+Math.random();var e=new XMLHttpRequest;e.overrideMimeType&&e.overrideMimeType("text/xml");e.onreadystatechange=function(){if(e.readyState==4&&(e.status==0||e.status==200))$=b,a(e.responseXML,void 0,c)};e.open("GET",c,!0);e.send(null)}else alert("Don't know how to parse XML!")},parse:a,setPreferredShading:function(a){ka=a},applySkin:f,geometries:ba}};
 THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;
-THREE.JSONLoader.prototype.load=function(a,b,c){var e=this,f;if(a instanceof Object)console.warn("DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath )."),f=a,a=f.model,b=f.callback,c=f.texture_path;f=new Worker(a);c=c?c:this.extractUrlbase(a);f.onmessage=function(a){e.createModel(a.data,b,c);e.onLoadComplete()};this.onLoadStart();f.postMessage((new Date).getTime())};
-THREE.JSONLoader.prototype.createModel=function(a,b,c){var e=new THREE.Geometry,f=a.scale!==void 0?1/a.scale:1;this.init_materials(e,a.materials,c);(function(c){if(a.version===void 0||a.version!=2)console.error("Deprecated file format.");else{var b,f,l,m,n,o,t,u,v,y,p,z,x,w,A=a.faces;o=a.vertices;var D=a.normals,B=a.colors,E=0;for(b=0;b<a.uvs.length;b++)a.uvs[b].length&&E++;for(b=0;b<E;b++)e.faceUvs[b]=[],e.faceVertexUvs[b]=[];m=0;for(n=o.length;m<n;)t=new THREE.Vertex,t.position.x=o[m++]*c,t.position.y=
+THREE.JSONLoader.prototype.load=function(a,b,c){var e,f=this;if(a instanceof Object)console.warn("DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath )."),e=a,a=e.model,b=e.callback,c=e.texture_path;e=new Worker(a);c=c?c:this.extractUrlbase(a);e.onmessage=function(a){f.createModel(a.data,b,c);f.onLoadComplete()};this.onLoadStart();e.postMessage(Date.now())};
+THREE.JSONLoader.prototype.createModel=function(a,b,c){var e=new THREE.Geometry,f=a.scale!==void 0?1/a.scale:1;this.initMaterials(e,a.materials,c);(function(c){if(a.version===void 0||a.version!=2)console.error("Deprecated file format.");else{var b,f,l,m,n,o,t,u,v,y,p,z,x,w,A=a.faces;o=a.vertices;var D=a.normals,B=a.colors,E=0;for(b=0;b<a.uvs.length;b++)a.uvs[b].length&&E++;for(b=0;b<E;b++)e.faceUvs[b]=[],e.faceVertexUvs[b]=[];m=0;for(n=o.length;m<n;)t=new THREE.Vertex,t.position.x=o[m++]*c,t.position.y=
 o[m++]*c,t.position.z=o[m++]*c,e.vertices.push(t);m=0;for(n=A.length;m<n;){c=A[m++];o=c&1;l=c&2;b=c&4;f=c&8;u=c&16;t=c&32;y=c&64;c&=128;o?(p=new THREE.Face4,p.a=A[m++],p.b=A[m++],p.c=A[m++],p.d=A[m++],o=4):(p=new THREE.Face3,p.a=A[m++],p.b=A[m++],p.c=A[m++],o=3);if(l)l=A[m++],p.materials=e.materials[l];l=e.faces.length;if(b)for(b=0;b<E;b++)z=a.uvs[b],v=A[m++],w=z[v*2],v=z[v*2+1],e.faceUvs[b][l]=new THREE.UV(w,v);if(f)for(b=0;b<E;b++){z=a.uvs[b];x=[];for(f=0;f<o;f++)v=A[m++],w=z[v*2],v=z[v*2+1],x[f]=
 new THREE.UV(w,v);e.faceVertexUvs[b][l]=x}if(u)u=A[m++]*3,f=new THREE.Vector3,f.x=D[u++],f.y=D[u++],f.z=D[u],p.normal=f;if(t)for(b=0;b<o;b++)u=A[m++]*3,f=new THREE.Vector3,f.x=D[u++],f.y=D[u++],f.z=D[u],p.vertexNormals.push(f);if(y)t=A[m++],t=new THREE.Color(B[t]),p.color=t;if(c)for(b=0;b<o;b++)t=A[m++],t=new THREE.Color(B[t]),p.vertexColors.push(t);e.faces.push(p)}}})(f);(function(){var c,b,f,l;if(a.skinWeights){c=0;for(b=a.skinWeights.length;c<b;c+=2)f=a.skinWeights[c],l=a.skinWeights[c+1],e.skinWeights.push(new THREE.Vector4(f,
 l,0,0))}if(a.skinIndices){c=0;for(b=a.skinIndices.length;c<b;c+=2)f=a.skinIndices[c],l=a.skinIndices[c+1],e.skinIndices.push(new THREE.Vector4(f,l,0,0))}e.bones=a.bones;e.animation=a.animation})();(function(c){if(a.morphTargets!==void 0){var b,f,l,m,n,o,t,u,v;b=0;for(f=a.morphTargets.length;b<f;b++){e.morphTargets[b]={};e.morphTargets[b].name=a.morphTargets[b].name;e.morphTargets[b].vertices=[];u=e.morphTargets[b].vertices;v=a.morphTargets[b].vertices;l=0;for(m=v.length;l<m;l+=3)n=v[l]*c,o=v[l+1]*
@@ -286,12 +286,12 @@ A[1],A[2]);Q&&H.scene.scale.set(Q[0],Q[1],Q[2]);(a||A||Q)&&H.scene.updateMatrix(
 16777215,A=y.intensity!==void 0?y.intensity:1,y.type=="directional"?(w=y.direction,C=new THREE.DirectionalLight(E,A),C.position.set(w[0],w[1],w[2]),C.position.normalize()):y.type=="point"?(w=y.position,d=y.distance,C=new THREE.PointLight(E,A,d),C.position.set(w[0],w[1],w[2])):y.type=="ambient"&&(C=new THREE.AmbientLight(E)),H.scene.add(C),H.lights[v]=C;for(p in F.fogs)v=F.fogs[p],v.type=="linear"?I=new THREE.Fog(0,v.near,v.far):v.type=="exp2"&&(I=new THREE.FogExp2(0,v.density)),A=v.color,I.color.setRGB(A[0],
 A[1],A[2]),H.fogs[p]=I;if(H.cameras&&F.defaults.camera)H.currentCamera=H.cameras[F.defaults.camera];if(H.fogs&&F.defaults.fog)H.scene.fog=H.fogs[F.defaults.fog];A=F.defaults.bgcolor;H.bgColor=new THREE.Color;H.bgColor.setRGB(A[0],A[1],A[2]);H.bgColorAlpha=F.defaults.bgalpha;for(o in F.geometries)if(p=F.geometries[o],p.type=="bin_mesh"||p.type=="ascii_mesh")M+=1,c.onLoadStart();L=M;for(o in F.geometries)p=F.geometries[o],p.type=="cube"?(B=new THREE.CubeGeometry(p.width,p.height,p.depth,p.segmentsWidth,
 p.segmentsHeight,p.segmentsDepth,null,p.flipped,p.sides),H.geometries[o]=B):p.type=="plane"?(B=new THREE.PlaneGeometry(p.width,p.height,p.segmentsWidth,p.segmentsHeight),H.geometries[o]=B):p.type=="sphere"?(B=new THREE.SphereGeometry(p.radius,p.segmentsWidth,p.segmentsHeight),H.geometries[o]=B):p.type=="cylinder"?(B=new THREE.CylinderGeometry(p.topRad,p.botRad,p.height,p.radSegs,p.heightSegs),H.geometries[o]=B):p.type=="torus"?(B=new THREE.TorusGeometry(p.radius,p.tube,p.segmentsR,p.segmentsT),H.geometries[o]=
-B):p.type=="icosahedron"?(B=new THREE.IcosahedronGeometry(p.subdivisions),H.geometries[o]=B):p.type=="bin_mesh"?G.load({model:e(p.url,F.urlBaseType),callback:l(o)}):p.type=="ascii_mesh"?J.load({model:e(p.url,F.urlBaseType),callback:l(o)}):p.type=="embedded_mesh"&&(p=F.embeds[p.id])&&J.createModel(p,m(o),"");for(z in F.textures)if(o=F.textures[z],o.url instanceof Array){N+=o.url.length;for(G=0;G<o.url.length;G++)c.onLoadStart()}else N+=1,c.onLoadStart();O=N;for(z in F.textures){o=F.textures[z];if(o.mapping!=
-void 0&&THREE[o.mapping]!=void 0)o.mapping=new THREE[o.mapping];if(o.url instanceof Array){G=[];for(var P=0;P<o.url.length;P++)G[P]=e(o.url[P],F.urlBaseType);G=THREE.ImageUtils.loadTextureCube(G,o.mapping,a)}else{G=THREE.ImageUtils.loadTexture(e(o.url,F.urlBaseType),o.mapping,a);if(THREE[o.minFilter]!=void 0)G.minFilter=THREE[o.minFilter];if(THREE[o.magFilter]!=void 0)G.magFilter=THREE[o.magFilter];if(o.repeat){G.repeat.set(o.repeat[0],o.repeat[1]);if(o.repeat[0]!=1)G.wrapS=THREE.RepeatWrapping;if(o.repeat[1]!=
-1)G.wrapT=THREE.RepeatWrapping}o.offset&&G.offset.set(o.offset[0],o.offset[1]);if(o.wrap){J={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(J[o.wrap[0]]!==void 0)G.wrapS=J[o.wrap[0]];if(J[o.wrap[1]]!==void 0)G.wrapT=J[o.wrap[1]]}}H.textures[z]=G}for(t in F.materials){z=F.materials[t];for(D in z.parameters)if(D=="envMap"||D=="map"||D=="lightMap")z.parameters[D]=H.textures[z.parameters[D]];else if(D=="shading")z.parameters[D]=z.parameters[D]=="flat"?THREE.FlatShading:THREE.SmoothShading;
-else if(D=="blending")z.parameters[D]=THREE[z.parameters[D]]?THREE[z.parameters[D]]:THREE.NormalBlending;else if(D=="combine")z.parameters[D]=z.parameters[D]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(D=="vertexColors")if(z.parameters[D]=="face")z.parameters[D]=THREE.FaceColors;else if(z.parameters[D])z.parameters[D]=THREE.VertexColors;if(z.parameters.opacity!==void 0&&z.parameters.opacity<1)z.parameters.transparent=!0;if(z.parameters.normalMap){o=THREE.ShaderUtils.lib.normal;
-a=THREE.UniformsUtils.clone(o.uniforms);G=z.parameters.color;J=z.parameters.specular;p=z.parameters.ambient;I=z.parameters.shininess;a.tNormal.texture=H.textures[z.parameters.normalMap];if(z.parameters.normalMapFactor)a.uNormalScale.value=z.parameters.normalMapFactor;if(z.parameters.map)a.tDiffuse.texture=z.parameters.map,a.enableDiffuse.value=!0;if(z.parameters.lightMap)a.tAO.texture=z.parameters.lightMap,a.enableAO.value=!0;if(z.parameters.specularMap)a.tSpecular.texture=H.textures[z.parameters.specularMap],
-a.enableSpecular.value=!0;a.uDiffuseColor.value.setHex(G);a.uSpecularColor.value.setHex(J);a.uAmbientColor.value.setHex(p);a.uShininess.value=I;if(z.parameters.opacity)a.uOpacity.value=z.parameters.opacity;z=new THREE.ShaderMaterial({fragmentShader:o.fragmentShader,vertexShader:o.vertexShader,uniforms:a,lights:!0,fog:!0})}else z=new THREE[z.type](z.parameters);H.materials[t]=z}k();c.callbackSync(H)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};THREE.UTF8Loader.prototype=new THREE.UTF8Loader;
+B):p.type=="icosahedron"?(B=new THREE.IcosahedronGeometry(p.subdivisions),H.geometries[o]=B):p.type=="bin_mesh"?G.load(e(p.url,F.urlBaseType),l(o)):p.type=="ascii_mesh"?J.load(e(p.url,F.urlBaseType),l(o)):p.type=="embedded_mesh"&&(p=F.embeds[p.id])&&J.createModel(p,m(o),"");for(z in F.textures)if(o=F.textures[z],o.url instanceof Array){N+=o.url.length;for(G=0;G<o.url.length;G++)c.onLoadStart()}else N+=1,c.onLoadStart();O=N;for(z in F.textures){o=F.textures[z];if(o.mapping!=void 0&&THREE[o.mapping]!=
+void 0)o.mapping=new THREE[o.mapping];if(o.url instanceof Array){G=[];for(var P=0;P<o.url.length;P++)G[P]=e(o.url[P],F.urlBaseType);G=THREE.ImageUtils.loadTextureCube(G,o.mapping,a)}else{G=THREE.ImageUtils.loadTexture(e(o.url,F.urlBaseType),o.mapping,a);if(THREE[o.minFilter]!=void 0)G.minFilter=THREE[o.minFilter];if(THREE[o.magFilter]!=void 0)G.magFilter=THREE[o.magFilter];if(o.repeat){G.repeat.set(o.repeat[0],o.repeat[1]);if(o.repeat[0]!=1)G.wrapS=THREE.RepeatWrapping;if(o.repeat[1]!=1)G.wrapT=THREE.RepeatWrapping}o.offset&&
+G.offset.set(o.offset[0],o.offset[1]);if(o.wrap){J={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(J[o.wrap[0]]!==void 0)G.wrapS=J[o.wrap[0]];if(J[o.wrap[1]]!==void 0)G.wrapT=J[o.wrap[1]]}}H.textures[z]=G}for(t in F.materials){z=F.materials[t];for(D in z.parameters)if(D=="envMap"||D=="map"||D=="lightMap")z.parameters[D]=H.textures[z.parameters[D]];else if(D=="shading")z.parameters[D]=z.parameters[D]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(D=="blending")z.parameters[D]=
+THREE[z.parameters[D]]?THREE[z.parameters[D]]:THREE.NormalBlending;else if(D=="combine")z.parameters[D]=z.parameters[D]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(D=="vertexColors")if(z.parameters[D]=="face")z.parameters[D]=THREE.FaceColors;else if(z.parameters[D])z.parameters[D]=THREE.VertexColors;if(z.parameters.opacity!==void 0&&z.parameters.opacity<1)z.parameters.transparent=!0;if(z.parameters.normalMap){o=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(o.uniforms);
+G=z.parameters.color;J=z.parameters.specular;p=z.parameters.ambient;I=z.parameters.shininess;a.tNormal.texture=H.textures[z.parameters.normalMap];if(z.parameters.normalMapFactor)a.uNormalScale.value=z.parameters.normalMapFactor;if(z.parameters.map)a.tDiffuse.texture=z.parameters.map,a.enableDiffuse.value=!0;if(z.parameters.lightMap)a.tAO.texture=z.parameters.lightMap,a.enableAO.value=!0;if(z.parameters.specularMap)a.tSpecular.texture=H.textures[z.parameters.specularMap],a.enableSpecular.value=!0;
+a.uDiffuseColor.value.setHex(G);a.uSpecularColor.value.setHex(J);a.uAmbientColor.value.setHex(p);a.uShininess.value=I;if(z.parameters.opacity)a.uOpacity.value=z.parameters.opacity;z=new THREE.ShaderMaterial({fragmentShader:o.fragmentShader,vertexShader:o.vertexShader,uniforms:a,lights:!0,fog:!0})}else z=new THREE[z.type](z.parameters);H.materials[t]=z}k();c.callbackSync(H)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};THREE.UTF8Loader.prototype=new THREE.UTF8Loader;
 THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
 THREE.UTF8Loader.prototype.load=function(a){var b=new XMLHttpRequest,c=a.model,e=a.callback,f=a.scale!==void 0?a.scale:1,h=a.offsetX!==void 0?a.offsetX:0,g=a.offsetY!==void 0?a.offsetY:0,k=a.offsetZ!==void 0?a.offsetZ:0;b.onreadystatechange=function(){b.readyState==4?b.status==200||b.status==0?THREE.UTF8Loader.prototype.createModel(b.responseText,e,f,h,g,k):alert("Couldn't load ["+c+"] ["+b.status+"]"):b.readyState!=3&&b.readyState==2&&b.getResponseHeader("Content-Length")};b.open("GET",c,!0);b.send(null)};
 THREE.UTF8Loader.prototype.decompressMesh=function(a){var b=a.charCodeAt(0);b>=57344&&(b-=2048);b++;for(var c=new Float32Array(8*b),e=1,f=0;f<8;f++){for(var h=0,g=0;g<b;++g){var k=a.charCodeAt(g+e);h+=k>>1^-(k&1);c[8*g+f]=h}e+=b}b=a.length-e;h=new Uint16Array(b);for(f=g=0;f<b;f++)k=a.charCodeAt(f+e),h[f]=g-k,k==0&&g++;return[c,h]};

+ 1 - 3
examples/webgl_collisions_trigger.html

@@ -48,7 +48,7 @@
 
 		<script>
 
-			var camera, cameraTarget, scene, renderer, info, mouse2d, sun, loader, sphere;
+			var camera, cameraTarget, scene, renderer, info, mouse2d, sun, sphere;
 
 			var range = 400, speed = 1, sphereSize = 4;
 
@@ -66,8 +66,6 @@
 
 				mouse2d = new THREE.Vector3( 0, 0, 1 );
 
-				loader = new THREE.Loader( true );
-
 				scene = new THREE.Scene();
 
 				sphere = new THREE.Mesh( new THREE.SphereGeometry( sphereSize, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0xff0000 } ) );

+ 2 - 2
examples/webgl_geometry_large_mesh.html

@@ -169,8 +169,8 @@
 				var s = Date.now(),
 					callback = function( geometry ) { createScene( geometry, s ) };
 
-				//loader.load( { model: 'obj/lucy/Lucy100k_slim.js', callback: callback } );
-				loader.load( { model: 'obj/lucy/Lucy100k_bin.js', callback: callback } );
+				//loader.load( 'obj/lucy/Lucy100k_slim.js', callback );
+				loader.load( 'obj/lucy/Lucy100k_bin.js', callback );
 
 			}
 

+ 1 - 1
examples/webgl_lights_pointlights.html

@@ -78,7 +78,7 @@
 
 				};
 
-				loader.load( { model: "obj/walt/WaltHead_bin.js", callback: callback } );
+				loader.load( "obj/walt/WaltHead_bin.js", callback );
 
 				scene.add( new THREE.AmbientLight( 0x000000 ) );
 

+ 6 - 6
examples/webgl_materials_cars.html

@@ -458,7 +458,7 @@
 
 				}
 
-				loader.load( { model: CARS[ "veyron" ].url, callback: function( geometry ) { createScene( geometry, "veyron" ) } } );
+				loader.load( CARS[ "veyron" ].url, function( geometry ) { createScene( geometry, "veyron" ) } );
 
 				for( var c in CARS ) initCarButton( c );
 
@@ -471,7 +471,7 @@
 					if ( ! CARS[ car ].object ) {
 
 						loader.statusDomElement.style.display = "block";
-						loader.load( { model: CARS[ car ].url, callback: function( geometry ) { createScene( geometry, car ) } } );
+						loader.load( CARS[ car ].url, function( geometry ) { createScene( geometry, car ) } );
 
 					} else {
 
@@ -479,7 +479,7 @@
 
 					}
 
-				}, false);
+				}, false );
 
 			}
 
@@ -510,13 +510,13 @@
 
 				var buttons, i, src = "";
 
-				for( i = 0; i < materials.length; i++ ) {
+				for( i = 0; i < materials.length; i ++ ) {
 
 					src += '<button id="' + button_name( car, i ) + '">' + materials[ i ][ 0 ] + '</button> ';
 
 				}
 
-				buttons = document.createElement("div");
+				buttons = document.createElement( "div" );
 				buttons.innerHTML = src;
 
 				$( "buttons_materials" ).appendChild( buttons );
@@ -527,7 +527,7 @@
 
 			function attachButtonMaterials( materials, geometry, material_indices, car ) {
 
-				for( var i = 0; i < materials.length; i++ ) {
+				for( var i = 0; i < materials.length; i ++ ) {
 
 					$( button_name( car, i ) ).counter = i;
 					$( button_name( car, i ) ).addEventListener( 'click', function() {

+ 2 - 2
examples/webgl_materials_cars_anaglyph.html

@@ -451,7 +451,7 @@
 
 				}
 
-				loader.load( { model: CARS[ "veyron" ].url, callback: function( geometry ) { createScene( geometry, "veyron" ) } } );
+				loader.load( CARS[ "veyron" ].url, function( geometry ) { createScene( geometry, "veyron" ) } );
 
 				for( var c in CARS ) initCarButton( c );
 
@@ -464,7 +464,7 @@
 					if ( ! CARS[ car ].object ) {
 
 						loader.statusDomElement.style.display = "block";
-						loader.load( { model: CARS[ car ].url, callback: function( geometry ) { createScene( geometry, car ) } } );
+						loader.load( CARS[ car ].url, function( geometry ) { createScene( geometry, car ) } );
 
 					} else {
 

+ 2 - 2
examples/webgl_materials_cars_camaro.html

@@ -136,7 +136,7 @@
 				camaroMaterials.body.push( [ "Chrome", new THREE.MeshPhongMaterial( { color: 0xffffff, specular:0xffffff, envMap: textureCube, combine: THREE.MultiplyOperation } ) ] );
 
 				var loader = new THREE.BinaryLoader();
-				loader.load( { model: "obj/camaro/CamaroNoUv_bin.js", callback: function( geometry ) { createScene( geometry, camaroMaterials ) } } );
+				loader.load( "obj/camaro/CamaroNoUv_bin.js", function( geometry ) { createScene( geometry, camaroMaterials ) } );
 
 			}
 
@@ -155,7 +155,7 @@
 
 				parent.innerHTML = src;
 
-				for( i = 0; i < materials.length; i++ ) {
+				for( i = 0; i < materials.length; i ++ ) {
 
 					$( "m" + i ).counter = i;
 					$( "m" + i ).addEventListener( 'click', function() { geometry.materials[ 0 ][ 0 ] = materials[ this.counter ][ 1 ] }, false );

+ 1 - 1
examples/webgl_materials_cars_camaro_crosseyed.html

@@ -143,7 +143,7 @@
 				camaroMaterials.body.push( [ "Chrome", new THREE.MeshPhongMaterial( { color: 0xffffff, specular:0xffffff, envMap: textureCube, combine: THREE.MultiplyOperation } ) ] );
 
 				var loader = new THREE.BinaryLoader();
-				loader.load( { model: "obj/camaro/CamaroNoUv_bin.js", callback: function( geometry ) { createScene( geometry, camaroMaterials ) } } );
+				loader.load( "obj/camaro/CamaroNoUv_bin.js", function( geometry ) { createScene( geometry, camaroMaterials ) } );
 
 			}
 

+ 2 - 2
examples/webgl_materials_cars_parallaxbarrier.html

@@ -452,7 +452,7 @@
 
 				}
 
-				loader.load( { model: CARS[ "veyron" ].url, callback: function( geometry ) { createScene( geometry, "veyron" ) } } );
+				loader.load( CARS[ "veyron" ].url, function( geometry ) { createScene( geometry, "veyron" ) } );
 
 				for( var c in CARS ) initCarButton( c );
 
@@ -465,7 +465,7 @@
 					if ( ! CARS[ car ].object ) {
 
 						loader.statusDomElement.style.display = "block";
-						loader.load( { model: CARS[ car ].url, callback: function( geometry ) { createScene( geometry, car ) } } );
+						loader.load( CARS[ car ].url, function( geometry ) { createScene( geometry, car ) } );
 
 					} else {
 

+ 1 - 1
examples/webgl_materials_cubemap.html

@@ -152,7 +152,7 @@
 				loader = new THREE.BinaryLoader( true );
 				document.body.appendChild( loader.statusDomElement );
 
-				loader.load( { model: "obj/walt/WaltHead_bin.js", callback: function( geometry ) { createScene( geometry, cubeMaterial1, cubeMaterial2, cubeMaterial3 ) } } );
+				loader.load( "obj/walt/WaltHead_bin.js", function( geometry ) { createScene( geometry, cubeMaterial1, cubeMaterial2, cubeMaterial3 ) } );
 
 			}
 

+ 1 - 1
examples/webgl_materials_cubemap_refraction.html

@@ -143,7 +143,7 @@
 				loader = new THREE.BinaryLoader( true );
 				document.body.appendChild( loader.statusDomElement );
 
-				loader.load( { model: 'obj/lucy/Lucy100k_bin.js', callback: function( geometry ) { createScene( geometry, cubeMaterial1, cubeMaterial2, cubeMaterial3 ) } } );
+				loader.load( 'obj/lucy/Lucy100k_bin.js', function( geometry ) { createScene( geometry, cubeMaterial1, cubeMaterial2, cubeMaterial3 ) } );
 
 				document.addEventListener('mousemove', onDocumentMouseMove, false);
 

+ 1 - 1
examples/webgl_materials_normalmap.html

@@ -183,7 +183,7 @@
 				loader = new THREE.BinaryLoader( true );
 				document.body.appendChild( loader.statusDomElement );
 
-				loader.load( { model: "obj/ninja/NinjaLo_bin.js", callback: function( geometry ) { createScene( geometry, scale, material1, material2 ) } } );
+				loader.load( "obj/ninja/NinjaLo_bin.js", function( geometry ) { createScene( geometry, scale, material1, material2 ) } );
 
 				//
 

+ 2 - 2
examples/webgl_morphtargets_horse.html

@@ -62,13 +62,13 @@
 				scene.add( light );
 
 				var loader = new THREE.JSONLoader( true );
-				loader.load( { model: "models/animated/horse.js", callback: function( geometry ) {
+				loader.load( "models/animated/horse.js", function( geometry ) {
 
 					mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0x606060, morphTargets: true } ) );
 					mesh.scale.set( 1.5, 1.5, 1.5 );
 					scene.add( mesh );
 
-				} } );
+				} );
 
 				//
 

+ 4 - 4
examples/webgl_objconvert_test.html

@@ -190,11 +190,11 @@
 					callbackMale   = function( geometry ) { createScene( geometry,  90, FLOOR, 50, 105 ) },
 					callbackFemale = function( geometry ) { createScene( geometry, -80, FLOOR, 50, 0 ) };
 
-				loader.load( { model: "obj/male02/Male02_slim.js", callback: callbackMale } );
-				loader.load( { model: "obj/female02/Female02_slim.js", callback: callbackFemale } );
+				loader.load( "obj/male02/Male02_slim.js", callbackMale );
+				loader.load( "obj/female02/Female02_slim.js", callbackFemale );
 
-				//loader.load( { model: "obj/male02/Male02_bin.js", callback: callbackMale } );
-				//loader.load( { model: "obj/female02/Female02_bin.js", callback: callbackFemale } );
+				//loader.load( "obj/male02/Male02_bin.js", callbackMale );
+				//loader.load( "obj/female02/Female02_bin.js", callbackFemale );
 
 			}
 

+ 5 - 5
examples/webgl_particles_dynamic.html

@@ -113,9 +113,9 @@
 
 				} );
 
-				bloader.load( { model: "obj/veyron/VeyronNoUv_bin.js", callback: function( geometry ) { createMesh( geometry, scene, 6.8, 2200, -200, -100, 0x0055ff, false ) } } );
+				bloader.load( "obj/veyron/VeyronNoUv_bin.js", function( geometry ) { createMesh( geometry, scene, 6.8, 2200, -200, -100, 0x0055ff, false ) } );
 
-				bloader.load( { model: "obj/female02/Female02_bin.js", callback: function( geometry ) {
+				bloader.load( "obj/female02/Female02_bin.js", function( geometry ) {
 
 					createMesh( geometry, scene, 4.05, -1000, -350,    0, 0xffdd44, true );
 					createMesh( geometry, scene, 4.05,     0, -350,    0, 0xffffff, true );
@@ -123,16 +123,16 @@
 					createMesh( geometry, scene, 4.05,   250, -350, 1500, 0xff9955, true );
 					createMesh( geometry, scene, 4.05,   250, -350, 2500, 0xff77dd, true );
 
-				} } );
+				} );
 
-				bloader.load( { model: "obj/male02/Male02_bin.js", callback: function( geometry ) {
+				bloader.load( "obj/male02/Male02_bin.js", function( geometry ) {
 
 					createMesh( geometry, scene, 4.05,  -500, -350,   600, 0xff7744, true );
 					createMesh( geometry, scene, 4.05,   500, -350,     0, 0xff5522, true );
 					createMesh( geometry, scene, 4.05,  -250, -350,  1500, 0xff9922, true );
 					createMesh( geometry, scene, 4.05,  -250, -350, -1500, 0xff99ff, true );
 
-				} } );
+				} );
 
 				//
 

+ 32 - 21
src/extras/loaders/BinaryLoader.js

@@ -16,26 +16,37 @@ THREE.BinaryLoader.prototype.supr = THREE.Loader.prototype;
 // Load models generated by slim OBJ converter with BINARY option (converter_obj_three_slim.py -t binary)
 //  - binary models consist of two files: JS and BIN
 //  - parameters
-//		- model (required)
+//		- url (required)
 //		- callback (required)
-//		- bin_path (optional: if not specified, binary file will be assumed to be in the same folder as JS model file)
-//		- texture_path (optional: if not specified, textures will be assumed to be in the same folder as JS model file)
+//		- texturePath (optional: if not specified, textures will be assumed to be in the same folder as JS model file)
+//		- binaryPath (optional: if not specified, binary file will be assumed to be in the same folder as JS model file)
 
-THREE.BinaryLoader.prototype.load = function( parameters ) {
+THREE.BinaryLoader.prototype.load = function( url, callback, texturePath, binaryPath ) {
+
+	if ( url instanceof Object ) {
+
+		console.warn( 'DEPRECATED: BinaryLoader( parameters ) is now BinaryLoader( url, callback, texturePath, binaryPath ).' );
+
+		var parameters = url;
+
+		url = parameters.model;
+		callback = parameters.callback;
+		texturePath = parameters.texture_path;
+		binaryPath = parameters.bin_path;
+
+	}
 
 	// #1 load JS part via web worker
 
 	//  This isn't really necessary, JS part is tiny,
 	//  could be done by more ordinary means.
 
-	var url = parameters.model,
-		callback = parameters.callback,
-		texture_path = parameters.texture_path ? parameters.texture_path : THREE.Loader.prototype.extractUrlbase( url ),
-		bin_path = parameters.bin_path ? parameters.bin_path : THREE.Loader.prototype.extractUrlbase( url ),
+	texturePath = texturePath ? texturePath : this.extractUrlbase( url );
+	binaryPath = binaryPath ? binaryPath : this.extractUrlbase( url );
 
-		s = (new Date).getTime(),
+	var s = Date.now(),
 		worker = new Worker( url ),
-		callback_progress = this.showProgress ? THREE.Loader.prototype.updateProgress : null;
+		callbackProgress = this.showProgress ? THREE.Loader.prototype.updateProgress : null;
 
 	worker.onmessage = function( event ) {
 
@@ -49,11 +60,11 @@ THREE.BinaryLoader.prototype.load = function( parameters ) {
 		//  Also, worker loading huge data by Ajax still freezes browser. Go figure,
 		//  worker with baked ascii JSON data keeps browser more responsive.
 
-		THREE.BinaryLoader.prototype.loadAjaxBuffers( buffers, materials, callback, bin_path, texture_path, callback_progress );
+		THREE.BinaryLoader.prototype.loadAjaxBuffers( buffers, materials, callback, binaryPath, texturePath, callbackProgress );
 
 	};
 
-	worker.onerror = function (event) {
+	worker.onerror = function ( event ) {
 
 		alert( "worker.onerror: " + event.message + "\n" + event.data );
 		event.preventDefault();
@@ -71,10 +82,10 @@ THREE.BinaryLoader.prototype.load = function( parameters ) {
 // See also other suggestions by Gregg Tavares
 // https://groups.google.com/group/o3d-discuss/browse_thread/thread/a8967bc9ce1e0978
 
-THREE.BinaryLoader.prototype.loadAjaxBuffers = function( buffers, materials, callback, bin_path, texture_path, callback_progress ) {
+THREE.BinaryLoader.prototype.loadAjaxBuffers = function( buffers, materials, callback, binaryPath, texturePath, callbackProgress ) {
 
 	var xhr = new XMLHttpRequest(),
-		url = bin_path + "/" + buffers;
+		url = binaryPath + "/" + buffers;
 
 	var length = 0;
 
@@ -84,7 +95,7 @@ THREE.BinaryLoader.prototype.loadAjaxBuffers = function( buffers, materials, cal
 
 			if ( xhr.status == 200 || xhr.status == 0 ) {
 
-				THREE.BinaryLoader.prototype.createBinModel( xhr.responseText, callback, texture_path, materials );
+				THREE.BinaryLoader.prototype.createBinModel( xhr.responseText, callback, texturePath, materials );
 
 			} else {
 
@@ -94,7 +105,7 @@ THREE.BinaryLoader.prototype.loadAjaxBuffers = function( buffers, materials, cal
 
 		} else if ( xhr.readyState == 3 ) {
 
-			if ( callback_progress ) {
+			if ( callbackProgress ) {
 
 				if ( length == 0 ) {
 
@@ -102,7 +113,7 @@ THREE.BinaryLoader.prototype.loadAjaxBuffers = function( buffers, materials, cal
 
 				}
 
-				callback_progress( { total: length, loaded: xhr.responseText.length } );
+				callbackProgress( { total: length, loaded: xhr.responseText.length } );
 
 			}
 
@@ -121,9 +132,9 @@ THREE.BinaryLoader.prototype.loadAjaxBuffers = function( buffers, materials, cal
 
 };
 
-THREE.BinaryLoader.prototype.createBinModel = function ( data, callback, texture_path, materials ) {
+THREE.BinaryLoader.prototype.createBinModel = function ( data, callback, texturePath, materials ) {
 
-	var Model = function ( texture_path ) {
+	var Model = function ( texturePath ) {
 
 		//var s = (new Date).getTime();
 
@@ -144,7 +155,7 @@ THREE.BinaryLoader.prototype.createBinModel = function ( data, callback, texture
 
 		THREE.Geometry.call( this );
 
-		THREE.Loader.prototype.init_materials( scope, materials, texture_path );
+		THREE.Loader.prototype.initMaterials( scope, materials, texturePath );
 
 		md = parseMetaData( data, currentOffset );
 		currentOffset += md.header_bytes;
@@ -765,6 +776,6 @@ THREE.BinaryLoader.prototype.createBinModel = function ( data, callback, texture
 	Model.prototype = new THREE.Geometry();
 	Model.prototype.constructor = Model;
 
-	callback( new Model( texture_path ) );
+	callback( new Model( texturePath ) );
 
 };

+ 8 - 8
src/extras/loaders/JSONLoader.js

@@ -13,19 +13,19 @@ THREE.JSONLoader.prototype = new THREE.Loader();
 THREE.JSONLoader.prototype.constructor = THREE.JSONLoader;
 THREE.JSONLoader.prototype.supr = THREE.Loader.prototype;
 
-
 THREE.JSONLoader.prototype.load = function ( url, callback, texturePath ) {
 
-	var scope = this, worker;
+	var worker, scope = this;
 
 	if ( url instanceof Object ) {
 
 		console.warn( 'DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath ).' );
 
-		var object = url;
-		url = object.model;
-		callback = object.callback;
-		texturePath = object.texture_path;
+		var parameters = url;
+
+		url = parameters.model;
+		callback = parameters.callback;
+		texturePath = parameters.texture_path;
 
 	}
 
@@ -40,7 +40,7 @@ THREE.JSONLoader.prototype.load = function ( url, callback, texturePath ) {
 	};
 
 	this.onLoadStart();
-	worker.postMessage( new Date().getTime() );
+	worker.postMessage( Date.now() );
 
 };
 
@@ -50,7 +50,7 @@ THREE.JSONLoader.prototype.createModel = function ( json, callback, texture_path
 	geometry = new THREE.Geometry(),
 	scale = ( json.scale !== undefined ) ? 1.0 / json.scale : 1.0;
 
-	this.init_materials( geometry, json.materials, texture_path );
+	this.initMaterials( geometry, json.materials, texture_path );
 
 	parseModel( scale );
 

+ 1 - 1
src/extras/loaders/Loader.js

@@ -65,7 +65,7 @@ THREE.Loader.prototype = {
 
 	},
 
-	init_materials: function ( scope, materials, texture_path ) {
+	initMaterials: function ( scope, materials, texture_path ) {
 
 		scope.materials = [];
 

+ 2 - 6
src/extras/loaders/SceneLoader.js

@@ -516,15 +516,11 @@ THREE.SceneLoader.prototype = {
 
 				} else if ( g.type == "bin_mesh" ) {
 
-					binLoader.load( { model: get_url( g.url, data.urlBaseType ),
-									  callback: create_callback( dg )
-									} );
+					binLoader.load( get_url( g.url, data.urlBaseType ), create_callback( dg ) );
 
 				} else if ( g.type == "ascii_mesh" ) {
 
-					jsonLoader.load( { model: get_url( g.url, data.urlBaseType ),
-									   callback: create_callback( dg )
-									} );
+					jsonLoader.load( get_url( g.url, data.urlBaseType ), create_callback( dg ) );
 
 				} else if ( g.type == "embedded_mesh" ) {