|
@@ -31,7 +31,7 @@ this.getPrevKeyWith("pos",p,g.index-1).pos,this.points[1]=e,this.points[2]=h,thi
|
|
THREE.Animation.prototype.interpolateCatmullRom=function(a,c){var b=[],f=[],e,h,g,k,j,m;e=(a.length-1)*c;h=Math.floor(e);e-=h;b[0]=h==0?h:h-1;b[1]=h;b[2]=h>a.length-2?h:h+1;b[3]=h>a.length-3?h:h+2;h=a[b[0]];k=a[b[1]];j=a[b[2]];m=a[b[3]];b=e*e;g=e*b;f[0]=this.interpolate(h[0],k[0],j[0],m[0],e,b,g);f[1]=this.interpolate(h[1],k[1],j[1],m[1],e,b,g);f[2]=this.interpolate(h[2],k[2],j[2],m[2],e,b,g);return f};
|
|
THREE.Animation.prototype.interpolateCatmullRom=function(a,c){var b=[],f=[],e,h,g,k,j,m;e=(a.length-1)*c;h=Math.floor(e);e-=h;b[0]=h==0?h:h-1;b[1]=h;b[2]=h>a.length-2?h:h+1;b[3]=h>a.length-3?h:h+2;h=a[b[0]];k=a[b[1]];j=a[b[2]];m=a[b[3]];b=e*e;g=e*b;f[0]=this.interpolate(h[0],k[0],j[0],m[0],e,b,g);f[1]=this.interpolate(h[1],k[1],j[1],m[1],e,b,g);f[2]=this.interpolate(h[2],k[2],j[2],m[2],e,b,g);return f};
|
|
THREE.Animation.prototype.interpolate=function(a,c,b,f,e,h,g){a=(b-a)*0.5;f=(f-c)*0.5;return(2*(c-b)+a+f)*g+(-3*(c-b)-2*a-f)*h+a*e+c};THREE.Animation.prototype.getNextKeyWith=function(a,c,b){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?b=b<f.length-1?b:f.length-1:b%=f.length;b<f.length;b++)if(f[b][a]!==void 0)return f[b];return this.data.hierarchy[c].keys[0]};
|
|
THREE.Animation.prototype.interpolate=function(a,c,b,f,e,h,g){a=(b-a)*0.5;f=(f-c)*0.5;return(2*(c-b)+a+f)*g+(-3*(c-b)-2*a-f)*h+a*e+c};THREE.Animation.prototype.getNextKeyWith=function(a,c,b){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?b=b<f.length-1?b:f.length-1:b%=f.length;b<f.length;b++)if(f[b][a]!==void 0)return f[b];return this.data.hierarchy[c].keys[0]};
|
|
THREE.Animation.prototype.getPrevKeyWith=function(a,c,b){for(var f=this.data.hierarchy[c].keys,b=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?b>0?b:0:b>=0?b:b+f.length;b>=0;b--)if(f[b][a]!==void 0)return f[b];return this.data.hierarchy[c].keys[f.length-1]};
|
|
THREE.Animation.prototype.getPrevKeyWith=function(a,c,b){for(var f=this.data.hierarchy[c].keys,b=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?b>0?b:0:b>=0?b:b+f.length;b>=0;b--)if(f[b][a]!==void 0)return f[b];return this.data.hierarchy[c].keys[f.length-1]};
|
|
-THREE.FirstPersonCamera=function(a){function c(a,c){return function(){c.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=
|
|
|
|
|
|
+THREE.FirstPersonCamera=function(a){function c(a,c){return function(){c.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=
|
|
a.movementSpeed;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.noFly!==void 0)this.noFly=a.noFly;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.autoForward!==void 0)this.autoForward=a.autoForward;if(a.activeLook!==void 0)this.activeLook=a.activeLook;if(a.heightSpeed!==void 0)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==void 0)this.heightCoef=a.heightCoef;if(a.heightMin!==void 0)this.heightMin=a.heightMin;if(a.heightMax!==void 0)this.heightMax=a.heightMax;if(a.constrainVertical!==
|
|
a.movementSpeed;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.noFly!==void 0)this.noFly=a.noFly;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.autoForward!==void 0)this.autoForward=a.autoForward;if(a.activeLook!==void 0)this.activeLook=a.activeLook;if(a.heightSpeed!==void 0)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==void 0)this.heightCoef=a.heightCoef;if(a.heightMin!==void 0)this.heightMin=a.heightMin;if(a.heightMax!==void 0)this.heightMax=a.heightMax;if(a.constrainVertical!==
|
|
void 0)this.constrainVertical=a.constrainVertical;if(a.verticalMin!==void 0)this.verticalMin=a.verticalMin;if(a.verticalMax!==void 0)this.verticalMax=a.verticalMax;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(a){a.preventDefault();
|
|
void 0)this.constrainVertical=a.constrainVertical;if(a.verticalMin!==void 0)this.verticalMin=a.verticalMin;if(a.verticalMax!==void 0)this.verticalMax=a.verticalMax;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(a){a.preventDefault();
|
|
a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.mouseX=a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.onKeyDown=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=
|
|
a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.mouseX=a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.onKeyDown=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=
|
|
@@ -41,17 +41,17 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
|
|
(this.phi-0)*(this.verticalMax-this.verticalMin)/3.14+this.verticalMin;a=this.target.position;e=this.position;a.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=e.y+100*Math.cos(this.phi);a.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),
|
|
(this.phi-0)*(this.verticalMax-this.verticalMin)/3.14+this.verticalMin;a=this.target.position;e=this.position;a.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=e.y+100*Math.cos(this.phi);a.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),
|
|
!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};THREE.FirstPersonCamera.prototype=new THREE.Camera;THREE.FirstPersonCamera.prototype.constructor=THREE.FirstPersonCamera;THREE.FirstPersonCamera.prototype.supr=THREE.Camera.prototype;
|
|
!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};THREE.FirstPersonCamera.prototype=new THREE.Camera;THREE.FirstPersonCamera.prototype.constructor=THREE.FirstPersonCamera;THREE.FirstPersonCamera.prototype.supr=THREE.Camera.prototype;
|
|
THREE.FirstPersonCamera.prototype.translate=function(a,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(a));this.target.position.addSelf(c.multiplyScalar(a))};
|
|
THREE.FirstPersonCamera.prototype.translate=function(a,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(a));this.target.position.addSelf(c.multiplyScalar(a))};
|
|
-THREE.PathCamera=function(a){function c(a,b,c,f){var g={name:c,fps:0.6,length:f,hierarchy:[]},h,e=b.getControlPointsArray(),k=b.getLength(),j=e.length,w=0;h=j-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:e[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[h]={time:f,pos:e[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h<j-1;h++)w=f*k.chunks[h]/k.total,b.keys[h]={time:w,pos:e[h]};g.hierarchy[0]=b;THREE.AnimationHandler.add(g);return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function b(a,b){var c,
|
|
|
|
-f,g=new THREE.Geometry;for(c=0;c<a.points.length*b;c++)f=c/(a.points.length*b),f=a.getPoint(f),g.vertices[c]=new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z));return g}function f(a,c){var f=b(c,10),g=b(c,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(f,h);particleObj=new THREE.ParticleSystem(g,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.addChild(lineObj);particleObj.scale.set(1,1,1);a.addChild(particleObj);g=new THREE.SphereGeometry(1,
|
|
|
|
-16,8);h=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)f=new THREE.Mesh(g,h),f.position.copy(c.points[i]),f.updateMatrix(),a.addChild(f)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=
|
|
|
|
|
|
+THREE.PathCamera=function(a){function c(a,b,c,g){var f={name:c,fps:0.6,length:g,hierarchy:[]},h,e=b.getControlPointsArray(),k=b.getLength(),j=e.length,x=0;h=j-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:e[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[h]={time:g,pos:e[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h<j-1;h++)x=g*k.chunks[h]/k.total,b.keys[h]={time:x,pos:e[h]};f.hierarchy[0]=b;THREE.AnimationHandler.add(f);return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function b(a,b){var c,
|
|
|
|
+g,f=new THREE.Geometry;for(c=0;c<a.points.length*b;c++)g=c/(a.points.length*b),g=a.getPoint(g),f.vertices[c]=new THREE.Vertex(new THREE.Vector3(g.x,g.y,g.z));return f}function f(a,c){var g=b(c,10),f=b(c,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(g,h);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.addChild(lineObj);particleObj.scale.set(1,1,1);a.addChild(particleObj);f=new THREE.SphereGeometry(1,
|
|
|
|
+16,8);h=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)g=new THREE.Mesh(f,h),g.position.copy(c.points[i]),g.updateMatrix(),a.addChild(g)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookHorizontal=
|
|
this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(a){if(a.duration!==void 0)this.duration=a.duration*1E3;if(a.waypoints!==void 0)this.waypoints=a.waypoints;if(a.useConstantSpeed!==void 0)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==void 0)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==void 0)this.createDebugPath=a.createDebugPath;if(a.createDebugDummy!==
|
|
this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(a){if(a.duration!==void 0)this.duration=a.duration*1E3;if(a.waypoints!==void 0)this.waypoints=a.waypoints;if(a.useConstantSpeed!==void 0)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==void 0)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==void 0)this.createDebugPath=a.createDebugPath;if(a.createDebugDummy!==
|
|
void 0)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==void 0)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==void 0)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==void 0)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
|
|
void 0)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==void 0)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==void 0)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==void 0)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
|
|
-window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var e=Math.PI*2,h=Math.PI/180;this.update=function(a,b,c){var f,g;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*h;this.theta=this.lon*h;f=this.phi%e;this.phi=f>=0?f:f+e;f=this.verticalAngleMap.srcRange;g=this.verticalAngleMap.dstRange;var k=g[1]-g[0];this.phi=
|
|
|
|
-TWEEN.Easing.Quadratic.EaseInOut(((this.phi-f[0])*(g[1]-g[0])/(f[1]-f[0])+g[0]-g[0])/k)*k+g[0];f=this.horizontalAngleMap.srcRange;g=this.horizontalAngleMap.dstRange;k=g[1]-g[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-f[0])*(g[1]-g[0])/(f[1]-f[0])+g[0]-g[0])/k)*k+g[0];f=this.target.position;f.x=100*Math.sin(this.phi)*Math.cos(this.theta);f.y=100*Math.cos(this.phi);f.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,a,b,c)};this.onMouseMove=function(a){this.mouseX=
|
|
|
|
|
|
+window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var e=Math.PI*2,h=Math.PI/180;this.update=function(a,b,c){var g,f;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*h;this.theta=this.lon*h;g=this.phi%e;this.phi=g>=0?g:g+e;g=this.verticalAngleMap.srcRange;f=this.verticalAngleMap.dstRange;var k=f[1]-f[0];this.phi=
|
|
|
|
+TWEEN.Easing.Quadratic.EaseInOut(((this.phi-g[0])*(f[1]-f[0])/(g[1]-g[0])+f[0]-f[0])/k)*k+f[0];g=this.horizontalAngleMap.srcRange;f=this.horizontalAngleMap.dstRange;k=f[1]-f[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-g[0])*(f[1]-f[0])/(g[1]-g[0])+f[0]-f[0])/k)*k+f[0];g=this.target.position;g.x=100*Math.sin(this.phi)*Math.cos(this.theta);g.y=100*Math.cos(this.phi);g.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,a,b,c)};this.onMouseMove=function(a){this.mouseX=
|
|
a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),g=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.CubeGeometry(10,10,20),j=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(k,a);a=new THREE.Mesh(j,g);a.position.set(0,10,0);this.animation=
|
|
a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),g=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.CubeGeometry(10,10,20),j=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(k,a);a=new THREE.Mesh(j,g);a.position.set(0,10,0);this.animation=
|
|
c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else this.animation=c(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&f(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(a,b){return function(){b.apply(a,arguments)}}(this,this.onMouseMove),
|
|
c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else this.animation=c(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&f(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(a,b){return function(){b.apply(a,arguments)}}(this,this.onMouseMove),
|
|
!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
|
|
!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
|
|
-THREE.FlyCamera=function(a){function c(a,c){return function(){c.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.domElement=document;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=a.movementSpeed;if(a.rollSpeed!==void 0)this.rollSpeed=a.rollSpeed;if(a.dragToLook!==void 0)this.dragToLook=a.dragToLook;if(a.autoForward!==void 0)this.autoForward=
|
|
|
|
|
|
+THREE.FlyCamera=function(a){function c(a,c){return function(){c.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.domElement=document;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=a.movementSpeed;if(a.rollSpeed!==void 0)this.rollSpeed=a.rollSpeed;if(a.dragToLook!==void 0)this.dragToLook=a.dragToLook;if(a.autoForward!==void 0)this.autoForward=
|
|
a.autoForward;if(a.domElement!==void 0)this.domElement=a.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(a){if(typeof this[a.type]=="function")this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=
|
|
a.autoForward;if(a.domElement!==void 0)this.domElement=a.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(a){if(typeof this[a.type]=="function")this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=
|
|
0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
|
|
0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
|
|
this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;
|
|
this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;
|
|
@@ -61,12 +61,12 @@ this.rollSpeed;this.translateX(this.moveVector.x*a);this.translateY(this.moveVec
|
|
this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=
|
|
this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=
|
|
document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,this.mouseup),!1);window.addEventListener("keydown",c(this,this.keydown),!1);window.addEventListener("keyup",c(this,
|
|
document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,this.mouseup),!1);window.addEventListener("keydown",c(this,this.keydown),!1);window.addEventListener("keyup",c(this,
|
|
this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};THREE.FlyCamera.prototype=new THREE.Camera;THREE.FlyCamera.prototype.constructor=THREE.FlyCamera;THREE.FlyCamera.prototype.supr=THREE.Camera.prototype;
|
|
this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};THREE.FlyCamera.prototype=new THREE.Camera;THREE.FlyCamera.prototype.constructor=THREE.FlyCamera;THREE.FlyCamera.prototype.supr=THREE.Camera.prototype;
|
|
-THREE.RollCamera=function(a,c,b,f){THREE.Camera.call(this,a,c,b,f);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.matrixAutoUpdate=this.useTarget=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var e=new THREE.Vector3,h=new THREE.Vector3,g=new THREE.Vector3,k=new THREE.Matrix4,j=!1,m=1,l=0,n=0,o=0,p=0,u=0,v=window.innerWidth/2,x=window.innerHeight/2;this.update=
|
|
|
|
|
|
+THREE.RollCamera=function(a,c,b,f){THREE.Camera.call(this,a,c,b,f);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.matrixAutoUpdate=this.useTarget=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var e=new THREE.Vector3,h=new THREE.Vector3,g=new THREE.Vector3,k=new THREE.Matrix4,j=!1,m=1,l=0,n=0,o=0,p=0,u=0,v=window.innerWidth/2,y=window.innerHeight/2;this.update=
|
|
function(){var a=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.delta=(a-this.lastUpdate)/1E3;this.lastUpdate=a;this.mouseLook&&(a=this.delta*this.lookSpeed,this.rotateHorizontally(a*p),this.rotateVertically(a*u));a=this.delta*this.movementSpeed;this.translateZ(a*(l>0||this.autoForward&&!(l<0)?1:l));this.translateX(a*n);this.translateY(a*o);j&&(this.roll+=this.rollSpeed*this.delta*m);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();
|
|
function(){var a=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.delta=(a-this.lastUpdate)/1E3;this.lastUpdate=a;this.mouseLook&&(a=this.delta*this.lookSpeed,this.rotateHorizontally(a*p),this.rotateVertically(a*u));a=this.delta*this.movementSpeed;this.translateZ(a*(l>0||this.autoForward&&!(l<0)?1:l));this.translateX(a*n);this.translateY(a*o);j&&(this.roll+=this.rollSpeed*this.delta*m);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();
|
|
else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();g.copy(this.forward);h.set(0,1,0);e.cross(h,g).normalize();h.cross(g,e).normalize();this.matrix.n11=e.x;this.matrix.n12=h.x;this.matrix.n13=g.x;this.matrix.n21=e.y;this.matrix.n22=h.y;this.matrix.n23=g.y;this.matrix.n31=e.z;this.matrix.n32=h.z;this.matrix.n33=g.z;k.identity();k.n11=Math.cos(this.roll);k.n12=-Math.sin(this.roll);k.n21=Math.sin(this.roll);k.n22=Math.cos(this.roll);this.matrix.multiplySelf(k);
|
|
else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();g.copy(this.forward);h.set(0,1,0);e.cross(h,g).normalize();h.cross(g,e).normalize();this.matrix.n11=e.x;this.matrix.n12=h.x;this.matrix.n13=g.x;this.matrix.n21=e.y;this.matrix.n22=h.y;this.matrix.n23=g.y;this.matrix.n31=e.z;this.matrix.n32=h.z;this.matrix.n33=g.z;k.identity();k.n11=Math.cos(this.roll);k.n12=-Math.sin(this.roll);k.n21=Math.sin(this.roll);k.n22=Math.cos(this.roll);this.matrix.multiplySelf(k);
|
|
this.matrixWorldNeedsUpdate=!0;this.matrix.n14=this.position.x;this.matrix.n24=this.position.y;this.matrix.n34=this.position.z;this.supr.update.call(this)};this.translateX=function(a){this.position.x+=this.matrix.n11*a;this.position.y+=this.matrix.n21*a;this.position.z+=this.matrix.n31*a};this.translateY=function(a){this.position.x+=this.matrix.n12*a;this.position.y+=this.matrix.n22*a;this.position.z+=this.matrix.n32*a};this.translateZ=function(a){this.position.x-=this.matrix.n13*a;this.position.y-=
|
|
this.matrixWorldNeedsUpdate=!0;this.matrix.n14=this.position.x;this.matrix.n24=this.position.y;this.matrix.n34=this.position.z;this.supr.update.call(this)};this.translateX=function(a){this.position.x+=this.matrix.n11*a;this.position.y+=this.matrix.n21*a;this.position.z+=this.matrix.n31*a};this.translateY=function(a){this.position.x+=this.matrix.n12*a;this.position.y+=this.matrix.n22*a;this.position.z+=this.matrix.n32*a};this.translateZ=function(a){this.position.x-=this.matrix.n13*a;this.position.y-=
|
|
this.matrix.n23*a;this.position.z-=this.matrix.n33*a};this.rotateHorizontally=function(a){e.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);e.multiplyScalar(a);this.forward.subSelf(e);this.forward.normalize()};this.rotateVertically=function(a){h.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);h.multiplyScalar(a);this.forward.addSelf(h);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",
|
|
this.matrix.n23*a;this.position.z-=this.matrix.n33*a};this.rotateHorizontally=function(a){e.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);e.multiplyScalar(a);this.forward.subSelf(e);this.forward.normalize()};this.rotateVertically=function(a){h.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);h.multiplyScalar(a);this.forward.addSelf(h);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",
|
|
-function(a){p=(a.clientX-v)/window.innerWidth;u=(a.clientY-x)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:l=1;break;case 2:l=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:l=0;break;case 2:l=0}},!1);this.domElement.addEventListener("keydown",function(a){switch(a.keyCode){case 38:case 87:l=1;break;case 37:case 65:n=-1;break;
|
|
|
|
|
|
+function(a){p=(a.clientX-v)/window.innerWidth;u=(a.clientY-y)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:l=1;break;case 2:l=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:l=0;break;case 2:l=0}},!1);this.domElement.addEventListener("keydown",function(a){switch(a.keyCode){case 38:case 87:l=1;break;case 37:case 65:n=-1;break;
|
|
case 40:case 83:l=-1;break;case 39:case 68:n=1;break;case 81:j=!0;m=1;break;case 69:j=!0;m=-1;break;case 82:o=1;break;case 70:o=-1}},!1);this.domElement.addEventListener("keyup",function(a){switch(a.keyCode){case 38:case 87:l=0;break;case 37:case 65:n=0;break;case 40:case 83:l=0;break;case 39:case 68:n=0;break;case 81:j=!1;break;case 69:j=!1;break;case 82:o=0;break;case 70:o=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
|
|
case 40:case 83:l=-1;break;case 39:case 68:n=1;break;case 81:j=!0;m=1;break;case 69:j=!0;m=-1;break;case 82:o=1;break;case 70:o=-1}},!1);this.domElement.addEventListener("keyup",function(a){switch(a.keyCode){case 38:case 87:l=0;break;case 37:case 65:n=0;break;case 40:case 83:l=0;break;case 39:case 68:n=0;break;case 81:j=!1;break;case 69:j=!1;break;case 82:o=0;break;case 70:o=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
|
|
THREE.RollCamera.prototype.supr=THREE.Camera.prototype;
|
|
THREE.RollCamera.prototype.supr=THREE.Camera.prototype;
|
|
THREE.TrackballCamera=function(a){function c(a,b){return function(){b.apply(a,arguments)}}a=a||{};THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.domElement=a.domElement||document;this.screen=a.screen||{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=a.radius||(this.screen.width+this.screen.height)/4;this.rotateSpeed=a.rotateSpeed||1;this.zoomSpeed=a.zoomSpeed||1.2;this.panSpeed=a.panSpeed||0.3;this.noZoom=a.noZoom||!1;this.noPan=a.noPan||
|
|
THREE.TrackballCamera=function(a){function c(a,b){return function(){b.apply(a,arguments)}}a=a||{};THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.domElement=a.domElement||document;this.screen=a.screen||{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=a.radius||(this.screen.width+this.screen.height)/4;this.rotateSpeed=a.rotateSpeed||1;this.zoomSpeed=a.zoomSpeed||1.2;this.panSpeed=a.panSpeed||0.3;this.noZoom=a.noZoom||!1;this.noPan=a.noPan||
|
|
@@ -89,30 +89,30 @@ f));b instanceof THREE.Face4&&c.push(new THREE.UV(0.5+Math.atan2(n.position.x,n.
|
|
THREE.IcosahedronGeometry=function(a){function c(a,b,c){var g=Math.sqrt(a*a+b*b+c*c);return e.vertices.push(new THREE.Vertex(new THREE.Vector3(a/g,b/g,c/g)))-1}function b(a,b,c,g){g.faces.push(new THREE.Face3(a,b,c))}function f(a,b){var g=e.vertices[a].position,f=e.vertices[b].position;return c((g.x+f.x)/2,(g.y+f.y)/2,(g.z+f.z)/2)}var e=this,h=new THREE.Geometry,g;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;c(-1,a,0);c(1,a,0);c(-1,-a,0);c(1,-a,0);c(0,-1,a);c(0,1,a);c(0,-1,
|
|
THREE.IcosahedronGeometry=function(a){function c(a,b,c){var g=Math.sqrt(a*a+b*b+c*c);return e.vertices.push(new THREE.Vertex(new THREE.Vector3(a/g,b/g,c/g)))-1}function b(a,b,c,g){g.faces.push(new THREE.Face3(a,b,c))}function f(a,b){var g=e.vertices[a].position,f=e.vertices[b].position;return c((g.x+f.x)/2,(g.y+f.y)/2,(g.z+f.z)/2)}var e=this,h=new THREE.Geometry,g;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;c(-1,a,0);c(1,a,0);c(-1,-a,0);c(1,-a,0);c(0,-1,a);c(0,1,a);c(0,-1,
|
|
-a);c(0,1,-a);c(a,0,-1);c(a,0,1);c(-a,0,-1);c(-a,0,1);b(0,11,5,h);b(0,5,1,h);b(0,1,7,h);b(0,7,10,h);b(0,10,11,h);b(1,5,9,h);b(5,11,4,h);b(11,10,2,h);b(10,7,6,h);b(7,1,8,h);b(3,9,4,h);b(3,4,2,h);b(3,2,6,h);b(3,6,8,h);b(3,8,9,h);b(4,9,5,h);b(2,4,11,h);b(6,2,10,h);b(8,6,7,h);b(9,8,1,h);for(a=0;a<this.subdivisions;a++){g=new THREE.Geometry;for(var k in h.faces){var j=f(h.faces[k].a,h.faces[k].b),m=f(h.faces[k].b,h.faces[k].c),l=f(h.faces[k].c,h.faces[k].a);b(h.faces[k].a,j,l,g);b(h.faces[k].b,m,j,g);
|
|
-a);c(0,1,-a);c(a,0,-1);c(a,0,1);c(-a,0,-1);c(-a,0,1);b(0,11,5,h);b(0,5,1,h);b(0,1,7,h);b(0,7,10,h);b(0,10,11,h);b(1,5,9,h);b(5,11,4,h);b(11,10,2,h);b(10,7,6,h);b(7,1,8,h);b(3,9,4,h);b(3,4,2,h);b(3,2,6,h);b(3,6,8,h);b(3,8,9,h);b(4,9,5,h);b(2,4,11,h);b(6,2,10,h);b(8,6,7,h);b(9,8,1,h);for(a=0;a<this.subdivisions;a++){g=new THREE.Geometry;for(var k in h.faces){var j=f(h.faces[k].a,h.faces[k].b),m=f(h.faces[k].b,h.faces[k].c),l=f(h.faces[k].c,h.faces[k].a);b(h.faces[k].a,j,l,g);b(h.faces[k].b,m,j,g);
|
|
b(h.faces[k].c,l,m,g);b(j,m,l,g)}h.faces=g.faces}e.faces=h.faces;delete h;delete g;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
|
|
b(h.faces[k].c,l,m,g);b(j,m,l,g)}h.faces=g.faces}e.faces=h.faces;delete h;delete g;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
|
|
-THREE.LatheGeometry=function(a,c,b){THREE.Geometry.call(this);this.steps=c||12;this.angle=b||2*Math.PI;for(var c=this.angle/this.steps,b=[],f=[],e=[],h=[],g=(new THREE.Matrix4).setRotationZ(c),k=0;k<a.length;k++)this.vertices.push(new THREE.Vertex(a[k])),b[k]=a[k].clone(),f[k]=this.vertices.length-1;for(var j=0;j<=this.angle+0.001;j+=c){for(k=0;k<b.length;k++)j<this.angle?(b[k]=g.multiplyVector3(b[k].clone()),this.vertices.push(new THREE.Vertex(b[k])),e[k]=this.vertices.length-1):e=h;j==0&&(h=f);
|
|
|
|
|
|
+THREE.LatheGeometry=function(a,c,b){THREE.Geometry.call(this);this.steps=c||12;this.angle=b||2*Math.PI;for(var c=this.angle/this.steps,b=[],f=[],e=[],h=[],g=(new THREE.Matrix4).setRotationZ(c),k=0;k<a.length;k++)this.vertices.push(new THREE.Vertex(a[k])),b[k]=a[k].clone(),f[k]=this.vertices.length-1;for(var j=0;j<=this.angle+0.0010;j+=c){for(k=0;k<b.length;k++)j<this.angle?(b[k]=g.multiplyVector3(b[k].clone()),this.vertices.push(new THREE.Vertex(b[k])),e[k]=this.vertices.length-1):e=h;j==0&&(h=f);
|
|
for(k=0;k<f.length-1;k++)this.faces.push(new THREE.Face4(e[k],e[k+1],f[k+1],f[k])),this.faceVertexUvs[0].push([new THREE.UV(1-j/this.angle,k/a.length),new THREE.UV(1-j/this.angle,(k+1)/a.length),new THREE.UV(1-(j-c)/this.angle,(k+1)/a.length),new THREE.UV(1-(j-c)/this.angle,k/a.length)]);f=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
|
|
for(k=0;k<f.length-1;k++)this.faces.push(new THREE.Face4(e[k],e[k+1],f[k+1],f[k])),this.faceVertexUvs[0].push([new THREE.UV(1-j/this.angle,k/a.length),new THREE.UV(1-j/this.angle,(k+1)/a.length),new THREE.UV(1-(j-c)/this.angle,(k+1)/a.length),new THREE.UV(1-(j-c)/this.angle,k/a.length)]);f=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
|
|
THREE.PlaneGeometry=function(a,c,b,f){THREE.Geometry.call(this);var e,h=a/2,g=c/2,b=b||1,f=f||1,k=b+1,j=f+1;a/=b;var m=c/f;for(e=0;e<j;e++)for(c=0;c<k;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*a-h,-(e*m-g),0)));for(e=0;e<f;e++)for(c=0;c<b;c++)this.faces.push(new THREE.Face4(c+k*e,c+k*(e+1),c+1+k*(e+1),c+1+k*e)),this.faceVertexUvs[0].push([new THREE.UV(c/b,e/f),new THREE.UV(c/b,(e+1)/f),new THREE.UV((c+1)/b,(e+1)/f),new THREE.UV((c+1)/b,e/f)]);this.computeCentroids();this.computeFaceNormals()};
|
|
THREE.PlaneGeometry=function(a,c,b,f){THREE.Geometry.call(this);var e,h=a/2,g=c/2,b=b||1,f=f||1,k=b+1,j=f+1;a/=b;var m=c/f;for(e=0;e<j;e++)for(c=0;c<k;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*a-h,-(e*m-g),0)));for(e=0;e<f;e++)for(c=0;c<b;c++)this.faces.push(new THREE.Face4(c+k*e,c+k*(e+1),c+1+k*(e+1),c+1+k*e)),this.faceVertexUvs[0].push([new THREE.UV(c/b,e/f),new THREE.UV(c/b,(e+1)/f),new THREE.UV((c+1)/b,(e+1)/f),new THREE.UV((c+1)/b,e/f)]);this.computeCentroids();this.computeFaceNormals()};
|
|
THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
|
|
THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
|
|
THREE.SphereGeometry=function(a,c,b){THREE.Geometry.call(this);for(var a=a||50,f,e=Math.PI,h=Math.max(3,c||8),g=Math.max(2,b||6),c=[],b=0;b<g+1;b++){f=b/g;var k=a*Math.cos(f*e),j=a*Math.sin(f*e),m=[],l=0;for(f=0;f<h;f++){var n=2*f/h,o=j*Math.sin(n*e),n=j*Math.cos(n*e);(b==0||b==g)&&f>0||(l=this.vertices.push(new THREE.Vertex(new THREE.Vector3(n,k,o)))-1);m.push(l)}c.push(m)}for(var p,u,v,e=c.length,b=0;b<e;b++)if(h=c[b].length,b>0)for(f=0;f<h;f++){m=f==h-1;g=c[b][m?0:f+1];k=c[b][m?h-1:f];j=c[b-1][m?
|
|
THREE.SphereGeometry=function(a,c,b){THREE.Geometry.call(this);for(var a=a||50,f,e=Math.PI,h=Math.max(3,c||8),g=Math.max(2,b||6),c=[],b=0;b<g+1;b++){f=b/g;var k=a*Math.cos(f*e),j=a*Math.sin(f*e),m=[],l=0;for(f=0;f<h;f++){var n=2*f/h,o=j*Math.sin(n*e),n=j*Math.cos(n*e);(b==0||b==g)&&f>0||(l=this.vertices.push(new THREE.Vertex(new THREE.Vector3(n,k,o)))-1);m.push(l)}c.push(m)}for(var p,u,v,e=c.length,b=0;b<e;b++)if(h=c[b].length,b>0)for(f=0;f<h;f++){m=f==h-1;g=c[b][m?0:f+1];k=c[b][m?h-1:f];j=c[b-1][m?
|
|
-h-1:f];m=c[b-1][m?0:f+1];o=b/(e-1);p=(b-1)/(e-1);u=(f+1)/h;var n=f/h,l=new THREE.UV(1-u,o),o=new THREE.UV(1-n,o),n=new THREE.UV(1-n,p),x=new THREE.UV(1-u,p);b<c.length-1&&(p=this.vertices[g].position.clone(),u=this.vertices[k].position.clone(),v=this.vertices[j].position.clone(),p.normalize(),u.normalize(),v.normalize(),this.faces.push(new THREE.Face3(g,k,j,[new THREE.Vector3(p.x,p.y,p.z),new THREE.Vector3(u.x,u.y,u.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([l,o,n]));b>1&&(p=
|
|
|
|
-this.vertices[g].position.clone(),u=this.vertices[j].position.clone(),v=this.vertices[m].position.clone(),p.normalize(),u.normalize(),v.normalize(),this.faces.push(new THREE.Face3(g,j,m,[new THREE.Vector3(p.x,p.y,p.z),new THREE.Vector3(u.x,u.y,u.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([l,n,x]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;
|
|
|
|
|
|
+h-1:f];m=c[b-1][m?0:f+1];o=b/(e-1);p=(b-1)/(e-1);u=(f+1)/h;var n=f/h,l=new THREE.UV(1-u,o),o=new THREE.UV(1-n,o),n=new THREE.UV(1-n,p),y=new THREE.UV(1-u,p);b<c.length-1&&(p=this.vertices[g].position.clone(),u=this.vertices[k].position.clone(),v=this.vertices[j].position.clone(),p.normalize(),u.normalize(),v.normalize(),this.faces.push(new THREE.Face3(g,k,j,[new THREE.Vector3(p.x,p.y,p.z),new THREE.Vector3(u.x,u.y,u.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([l,o,n]));b>1&&(p=
|
|
|
|
+this.vertices[g].position.clone(),u=this.vertices[j].position.clone(),v=this.vertices[m].position.clone(),p.normalize(),u.normalize(),v.normalize(),this.faces.push(new THREE.Face3(g,j,m,[new THREE.Vector3(p.x,p.y,p.z),new THREE.Vector3(u.x,u.y,u.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([l,n,y]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;
|
|
THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(a,c){THREE.Geometry.call(this);this.parameters=c||{};this.set(a)};THREE.TextGeometry.prototype=new THREE.Geometry;THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
|
|
THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(a,c){THREE.Geometry.call(this);this.parameters=c||{};this.set(a)};THREE.TextGeometry.prototype=new THREE.Geometry;THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
|
|
THREE.TextGeometry.prototype.set=function(a,c){function b(a,b,c){u.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}function f(a,b,c,g){u.faces.push(new THREE.Face4(a,b,c,g))}this.text=a;var c=c||this.parameters,e=c.height!==void 0?c.height:50,h=c.curveSegments!==void 0?c.curveSegments:4,g=c.font!==void 0?c.font:"helvetiker",k=c.weight!==void 0?c.weight:"normal",j=c.style!==void 0?c.style:"normal",m=c.bezelThickness!==void 0?c.bezelThickness:10,l=c.bezelSize!==void 0?c.bezelSize:8,n=c.bezelEnabled!==
|
|
THREE.TextGeometry.prototype.set=function(a,c){function b(a,b,c){u.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}function f(a,b,c,g){u.faces.push(new THREE.Face4(a,b,c,g))}this.text=a;var c=c||this.parameters,e=c.height!==void 0?c.height:50,h=c.curveSegments!==void 0?c.curveSegments:4,g=c.font!==void 0?c.font:"helvetiker",k=c.weight!==void 0?c.weight:"normal",j=c.style!==void 0?c.style:"normal",m=c.bezelThickness!==void 0?c.bezelThickness:10,l=c.bezelSize!==void 0?c.bezelSize:8,n=c.bezelEnabled!==
|
|
-void 0?c.bezelEnabled:!1;THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=h;THREE.FontUtils.face=g;THREE.FontUtils.weight=k;THREE.FontUtils.style=j;THREE.FontUtils.bezelSize=l;var k=THREE.FontUtils.drawText(a),h=k.points,o=k.faces,g=k.contour,p=k.bezel,u=this;u.vertices=[];u.faces=[];for(var v,j=h.length,x=o.length,l=p.length,k=0;k<j;k++)v=h[k],b(v.x,v.y,0);for(k=0;k<j;k++)v=h[k],b(v.x,v.y,e);if(n){for(k=0;k<l;k++)v=p[k],b(v.x,v.y,m);for(k=0;k<l;k++)v=p[k],b(v.x,v.y,e-m)}for(k=
|
|
|
|
-0;k<x;k++)e=o[k],u.faces.push(new THREE.Face3(e[2],e[1],e[0]));for(k=0;k<x;k++)e=o[k],u.faces.push(new THREE.Face3(e[0]+j,e[1]+j,e[2]+j));var y;if(n)for(k=p.length;--k>0;){if(y){if(y.equals(g[k])){y=null;continue}}else y=g[k];m=j*2+k;o=m-1;f(m,o,o+l,m+l);for(n=0;n<j;n++)if(h[n].equals(g[k]))break;for(e=0;e<j;e++)if(h[e].equals(g[k-1]))break;f(n,e,o,m);f(m+l,o+l,e+j,n+j)}else for(k=g.length;--k>0;){if(y){if(y.equals(g[k])){y=null;continue}}else y=g[k];for(n=0;n<j;n++)if(h[n].equals(g[k]))break;for(e=
|
|
|
|
|
|
+void 0?c.bezelEnabled:!1;THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=h;THREE.FontUtils.face=g;THREE.FontUtils.weight=k;THREE.FontUtils.style=j;THREE.FontUtils.bezelSize=l;var k=THREE.FontUtils.drawText(a),h=k.points,o=k.faces,g=k.contour,p=k.bezel,u=this;u.vertices=[];u.faces=[];for(var v,j=h.length,y=o.length,l=p.length,k=0;k<j;k++)v=h[k],b(v.x,v.y,0);for(k=0;k<j;k++)v=h[k],b(v.x,v.y,e);if(n){for(k=0;k<l;k++)v=p[k],b(v.x,v.y,m);for(k=0;k<l;k++)v=p[k],b(v.x,v.y,e-m)}for(k=
|
|
|
|
+0;k<y;k++)e=o[k],u.faces.push(new THREE.Face3(e[2],e[1],e[0]));for(k=0;k<y;k++)e=o[k],u.faces.push(new THREE.Face3(e[0]+j,e[1]+j,e[2]+j));var w;if(n)for(k=p.length;--k>0;){if(w){if(w.equals(g[k])){w=null;continue}}else w=g[k];m=j*2+k;o=m-1;f(m,o,o+l,m+l);for(n=0;n<j;n++)if(h[n].equals(g[k]))break;for(e=0;e<j;e++)if(h[e].equals(g[k-1]))break;f(n,e,o,m);f(m+l,o+l,e+j,n+j)}else for(k=g.length;--k>0;){if(w){if(w.equals(g[k])){w=null;continue}}else w=g[k];for(n=0;n<j;n++)if(h[n].equals(g[k]))break;for(e=
|
|
0;e<j;e++)if(h[e].equals(g[k-1]))break;f(n,e,e+j,n+j)}this.computeCentroids();this.computeFaceNormals()};
|
|
0;e<j;e++)if(h[e].equals(g[k-1]))break;f(n,e,e+j,n+j)}this.computeCentroids();this.computeFaceNormals()};
|
|
THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(a){var c=a.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][a.cssFontWeight]=this.faces[c][a.cssFontWeight]||{};this.faces[c][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[c][a.cssFontWeight][a.cssFontStyle]=a},extractPoints:function(a,c){if(a.length<3)return console.log("not valid polygon"),
|
|
THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(a){var c=a.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][a.cssFontWeight]=this.faces[c][a.cssFontWeight]||{};this.faces[c][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[c][a.cssFontWeight][a.cssFontStyle]=a},extractPoints:function(a,c){if(a.length<3)return console.log("not valid polygon"),
|
|
{points:a,faces:[]};for(var b,f,e,h,g,k=[],j=0;j<c.length;j++){g=c[j];h=[];for(b=0;b<g.length;b++)f=g[b],h.push(f.x+","+f.y);var m;b=h.slice(1).indexOf(h[0]);var l=this.Triangulate.area(g.slice(0,b+1))<0;f=[];for(b=-1;b<h.length;){m=b+1;b=h[m];b=h.slice(m+1).indexOf(b)+m;if(b<=m)break;var n=g.slice(m,b+1);l?this.Triangulate.area(n)<0?(m>0&&k.push({shape:e,holes:f}),e=n,f=[]):f.push(n):this.Triangulate.area(n)<0?(k.push({shape:n,holes:f}),f=[]):f.push(n);b++}l&&k.push({shape:e,holes:f})}var o,p,u,
|
|
{points:a,faces:[]};for(var b,f,e,h,g,k=[],j=0;j<c.length;j++){g=c[j];h=[];for(b=0;b<g.length;b++)f=g[b],h.push(f.x+","+f.y);var m;b=h.slice(1).indexOf(h[0]);var l=this.Triangulate.area(g.slice(0,b+1))<0;f=[];for(b=-1;b<h.length;){m=b+1;b=h[m];b=h.slice(m+1).indexOf(b)+m;if(b<=m)break;var n=g.slice(m,b+1);l?this.Triangulate.area(n)<0?(m>0&&k.push({shape:e,holes:f}),e=n,f=[]):f.push(n):this.Triangulate.area(n)<0?(k.push({shape:n,holes:f}),f=[]):f.push(n);b++}l&&k.push({shape:e,holes:f})}var o,p,u,
|
|
-v,x,y;h=[];for(g=0;g<k.length;g++){j=k[g];e=j.shape;f=j.holes;for(m=0;m<f.length;m++){l=f[m];u=Number.POSITIVE_INFINITY;for(n=0;n<l.length;n++){x=l[n];for(b=0;b<e.length;b++)v=e[b],v=x.distanceTo(v),v<u&&(u=v,o=n,p=b)}b=p-1>=0?p-1:e.length-1;var n=o-1>=0?o-1:l.length-1,w=[];w.push(l[o]);w.push(e[p]);w.push(e[b]);u=this.Triangulate.area(w);var t=[];t.push(l[o]);t.push(l[n]);t.push(e[p]);x=this.Triangulate.area(t);v=p;y=o;p+=1;o+=-1;p<0&&(p+=e.length);p%=e.length;o<0&&(o+=l.length);o%=e.length;b=p-
|
|
|
|
-1>=0?p-1:e.length-1;n=o-1>=0?o-1:l.length-1;w=[];w.push(l[o]);w.push(e[p]);w.push(e[b]);w=this.Triangulate.area(w);t=[];t.push(l[o]);t.push(l[n]);t.push(e[p]);t=this.Triangulate.area(t);u+x>w+t&&(p=v,o=y,p<0&&(p+=e.length),p%=e.length,o<0&&(o+=l.length),o%=e.length,b=p-1>=0?p-1:e.length-1,n=o-1>=0?o-1:l.length-1);u=e.slice(0,p);x=e.slice(p);v=l.slice(o);y=l.slice(0,o);h.push(l[o]);h.push(e[p]);h.push(e[b]);h.push(l[o]);h.push(l[n]);h.push(e[p]);e=u.concat(v).concat(y).concat(x)}j.shape=e}o=[];p=[];
|
|
|
|
|
|
+v,y,w;h=[];for(g=0;g<k.length;g++){j=k[g];e=j.shape;f=j.holes;for(m=0;m<f.length;m++){l=f[m];u=Number.POSITIVE_INFINITY;for(n=0;n<l.length;n++){y=l[n];for(b=0;b<e.length;b++)v=e[b],v=y.distanceTo(v),v<u&&(u=v,o=n,p=b)}b=p-1>=0?p-1:e.length-1;var n=o-1>=0?o-1:l.length-1,x=[];x.push(l[o]);x.push(e[p]);x.push(e[b]);u=this.Triangulate.area(x);var t=[];t.push(l[o]);t.push(l[n]);t.push(e[p]);y=this.Triangulate.area(t);v=p;w=o;p+=1;o+=-1;p<0&&(p+=e.length);p%=e.length;o<0&&(o+=l.length);o%=e.length;b=p-
|
|
|
|
+1>=0?p-1:e.length-1;n=o-1>=0?o-1:l.length-1;x=[];x.push(l[o]);x.push(e[p]);x.push(e[b]);x=this.Triangulate.area(x);t=[];t.push(l[o]);t.push(l[n]);t.push(e[p]);t=this.Triangulate.area(t);u+y>x+t&&(p=v,o=w,p<0&&(p+=e.length),p%=e.length,o<0&&(o+=l.length),o%=e.length,b=p-1>=0?p-1:e.length-1,n=o-1>=0?o-1:l.length-1);u=e.slice(0,p);y=e.slice(p);v=l.slice(o);w=l.slice(0,o);h.push(l[o]);h.push(e[p]);h.push(e[b]);h.push(l[o]);h.push(l[n]);h.push(e[p]);e=u.concat(v).concat(w).concat(y)}j.shape=e}o=[];p=[];
|
|
for(g=m=0;g<k.length;g++){j=k[g];e=j.shape;o=o.concat(e);l=THREE.FontUtils.Triangulate(e,!0);for(f=0;f<l.length;f++)j=l[f],j[0]+=m,j[1]+=m,j[2]+=m;p=p.concat(l);m+=e.length}var z;for(f=0;f<h.length/3;f++){j=[];for(k=0;k<3;k++){g=!1;for(e=0;e<o.length&&!g;e++)z=f*3+k,o[e].equals(h[z])&&(j.push(e),g=!0);g||(o.push(h[z]),j.push(o.length-1),console.log("not found"))}p.push(j)}return{points:o,faces:p}},drawText:function(a){var c=[],b=[],f,e=this.getFace(),h=this.size/e.resolution,g=0;f=String(a).split("");
|
|
for(g=m=0;g<k.length;g++){j=k[g];e=j.shape;o=o.concat(e);l=THREE.FontUtils.Triangulate(e,!0);for(f=0;f<l.length;f++)j=l[f],j[0]+=m,j[1]+=m,j[2]+=m;p=p.concat(l);m+=e.length}var z;for(f=0;f<h.length/3;f++){j=[];for(k=0;k<3;k++){g=!1;for(e=0;e<o.length&&!g;e++)z=f*3+k,o[e].equals(h[z])&&(j.push(e),g=!0);g||(o.push(h[z]),j.push(o.length-1),console.log("not found"))}p.push(j)}return{points:o,faces:p}},drawText:function(a){var c=[],b=[],f,e=this.getFace(),h=this.size/e.resolution,g=0;f=String(a).split("");
|
|
for(var k=f.length,a=0;a<k;a++){var j=this.extractGlyphPoints(f[a],e,h,g);g+=j.offset;c.push(j.points);b=b.concat(j.points)}a=g/2;for(f=0;f<b.length;f++)b[f].x-=a;c=this.extractPoints(b,c);c.contour=b;e=[];h=[];f=[];for(var g=[],k=new THREE.Vector2,m,a=b.length;--a>=0;){if(m){if(m.equals(b[a])){m=null;j=this.Triangulate.area(f)>0;g.push(j);h.push(k.divideScalar(f.length));f=[];k=new THREE.Vector2;continue}}else m=b[a];k.addSelf(b[a]);f.push(b[a])}a=b.length;f=0;for(var l;--a>=0;)j=b[a],k=h[f],j=j.clone().subSelf(k),
|
|
for(var k=f.length,a=0;a<k;a++){var j=this.extractGlyphPoints(f[a],e,h,g);g+=j.offset;c.push(j.points);b=b.concat(j.points)}a=g/2;for(f=0;f<b.length;f++)b[f].x-=a;c=this.extractPoints(b,c);c.contour=b;e=[];h=[];f=[];for(var g=[],k=new THREE.Vector2,m,a=b.length;--a>=0;){if(m){if(m.equals(b[a])){m=null;j=this.Triangulate.area(f)>0;g.push(j);h.push(k.divideScalar(f.length));f=[];k=new THREE.Vector2;continue}}else m=b[a];k.addSelf(b[a]);f.push(b[a])}a=b.length;f=0;for(var l;--a>=0;)j=b[a],k=h[f],j=j.clone().subSelf(k),
|
|
l=this.bezelSize/j.length(),g[f]?l+=1:l=1-l,l=j.multiplyScalar(l).addSelf(k),e.unshift(l),m?m.equals(b[a])&&(m=null,f++):m=b[a];c.bezel=e;return c},b2p0:function(a,c){var b=1-a;return b*b*c},b2p1:function(a,c){return 2*(1-a)*a*c},b2p2:function(a,c){return a*a*c},b2:function(a,c,b,f){return this.b2p0(a,c)+this.b2p1(a,b)+this.b2p2(a,f)},b3p0:function(a,c){var b=1-a;return b*b*b*c},b3p1:function(a,c){var b=1-a;return 3*b*b*a*c},b3p2:function(a,c){return 3*(1-a)*a*a*c},b3p3:function(a,c){return a*a*a*
|
|
l=this.bezelSize/j.length(),g[f]?l+=1:l=1-l,l=j.multiplyScalar(l).addSelf(k),e.unshift(l),m?m.equals(b[a])&&(m=null,f++):m=b[a];c.bezel=e;return c},b2p0:function(a,c){var b=1-a;return b*b*c},b2p1:function(a,c){return 2*(1-a)*a*c},b2p2:function(a,c){return a*a*c},b2:function(a,c,b,f){return this.b2p0(a,c)+this.b2p1(a,b)+this.b2p2(a,f)},b3p0:function(a,c){var b=1-a;return b*b*b*c},b3p1:function(a,c){var b=1-a;return 3*b*b*a*c},b3p2:function(a,c){return 3*(1-a)*a*a*c},b3p3:function(a,c){return a*a*a*
|
|
c},b3:function(a,c,b,f,e){return this.b3p0(a,c)+this.b3p1(a,b)+this.b3p2(a,f)+this.b3p3(a,e)},extractGlyphPoints:function(a,c,b,f){var e=[],h,g,k,j,m,l,n,o,p,u,v=c.glyphs[a]||c.glyphs[ctxt.options.fallbackCharacter];if(v){if(v.o){c=v._cachedOutline||(v._cachedOutline=v.o.split(" "));k=c.length;for(a=0;a<k;)switch(g=c[a++],g){case "m":g=c[a++]*b+f;j=c[a++]*b;e.push(new THREE.Vector2(g,j));break;case "l":g=c[a++]*b+f;j=c[a++]*b;e.push(new THREE.Vector2(g,j));break;case "q":g=c[a++]*b+f;j=c[a++]*b;n=
|
|
c},b3:function(a,c,b,f,e){return this.b3p0(a,c)+this.b3p1(a,b)+this.b3p2(a,f)+this.b3p3(a,e)},extractGlyphPoints:function(a,c,b,f){var e=[],h,g,k,j,m,l,n,o,p,u,v=c.glyphs[a]||c.glyphs[ctxt.options.fallbackCharacter];if(v){if(v.o){c=v._cachedOutline||(v._cachedOutline=v.o.split(" "));k=c.length;for(a=0;a<k;)switch(g=c[a++],g){case "m":g=c[a++]*b+f;j=c[a++]*b;e.push(new THREE.Vector2(g,j));break;case "l":g=c[a++]*b+f;j=c[a++]*b;e.push(new THREE.Vector2(g,j));break;case "q":g=c[a++]*b+f;j=c[a++]*b;n=
|
|
-c[a++]*b+f;o=c[a++]*b;if(h=e[e.length-1]){m=h.x;l=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++){var x=h/divisions,y=THREE.FontUtils.b2(x,m,n,g),x=THREE.FontUtils.b2(x,l,o,j);e.push(new THREE.Vector2(y,x))}}break;case "b":if(g=c[a++]*b+f,j=c[a++]*b,n=c[a++]*b+f,o=c[a++]*-b,p=c[a++]*b+f,u=c[a++]*-b,h=e[e.length-1]){m=h.x;l=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++)x=h/divisions,y=THREE.FontUtils.b3(x,m,n,p,g),x=THREE.FontUtils.b3(x,l,o,u,j),e.push(new THREE.Vector2(y,x))}}}return{offset:v.ha*
|
|
|
|
|
|
+c[a++]*b+f;o=c[a++]*b;if(h=e[e.length-1]){m=h.x;l=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++){var y=h/divisions,w=THREE.FontUtils.b2(y,m,n,g),y=THREE.FontUtils.b2(y,l,o,j);e.push(new THREE.Vector2(w,y))}}break;case "b":if(g=c[a++]*b+f,j=c[a++]*b,n=c[a++]*b+f,o=c[a++]*-b,p=c[a++]*b+f,u=c[a++]*-b,h=e[e.length-1]){m=h.x;l=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++)y=h/divisions,w=THREE.FontUtils.b3(y,m,n,p,g),y=THREE.FontUtils.b3(y,l,o,u,j),e.push(new THREE.Vector2(w,y))}}}return{offset:v.ha*
|
|
b,points:e}}}};
|
|
b,points:e}}}};
|
|
-(function(a){var c=function(a){for(var c=a.length,e=0,h=c-1,g=0;g<c;h=g++)e+=a[h].x*a[g].y-a[g].x*a[h].y;return e*0.5};a.Triangulate=function(a,f){var e=a.length;if(e<3)return null;var h=[],g=[],k=[],j,m,l;if(c(a)>0)for(m=0;m<e;m++)g[m]=m;else for(m=0;m<e;m++)g[m]=e-1-m;var n=2*e;for(m=e-1;e>2;){if(n--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return k;return h}j=m;e<=j&&(j=0);m=j+1;e<=m&&(m=0);l=m+1;e<=l&&(l=0);var o;a:{o=a;var p=j,u=m,v=l,x=e,y=g,w=void 0,t=void 0,z=void 0,
|
|
|
|
-A=void 0,E=void 0,F=void 0,G=void 0,D=void 0,K=void 0,t=o[y[p]].x,z=o[y[p]].y,A=o[y[u]].x,E=o[y[u]].y,F=o[y[v]].x,G=o[y[v]].y;if(1.0E-10>(A-t)*(G-z)-(E-z)*(F-t))o=!1;else{for(w=0;w<x;w++)if(!(w==p||w==u||w==v)){var D=o[y[w]].x,K=o[y[w]].y,I=void 0,C=void 0,J=void 0,L=void 0,H=void 0,N=void 0,O=void 0,B=void 0,P=void 0,M=void 0,R=void 0,S=void 0,I=J=H=void 0,I=F-A,C=G-E,J=t-F,L=z-G,H=A-t,N=E-z,O=D-t,B=K-z,P=D-A,M=K-E,R=D-F,S=K-G,I=I*M-C*P,H=H*B-N*O,J=J*S-L*R;if(I>=0&&J>=0&&H>=0){o=!1;break a}}o=!0}}if(o){n=
|
|
|
|
|
|
+(function(a){var c=function(a){for(var c=a.length,e=0,h=c-1,g=0;g<c;h=g++)e+=a[h].x*a[g].y-a[g].x*a[h].y;return e*0.5};a.Triangulate=function(a,f){var e=a.length;if(e<3)return null;var h=[],g=[],k=[],j,m,l;if(c(a)>0)for(m=0;m<e;m++)g[m]=m;else for(m=0;m<e;m++)g[m]=e-1-m;var n=2*e;for(m=e-1;e>2;){if(n--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return k;return h}j=m;e<=j&&(j=0);m=j+1;e<=m&&(m=0);l=m+1;e<=l&&(l=0);var o;a:{o=a;var p=j,u=m,v=l,y=e,w=g,x=void 0,t=void 0,z=void 0,
|
|
|
|
+A=void 0,E=void 0,F=void 0,G=void 0,D=void 0,K=void 0,t=o[w[p]].x,z=o[w[p]].y,A=o[w[u]].x,E=o[w[u]].y,F=o[w[v]].x,G=o[w[v]].y;if(1.0E-10>(A-t)*(G-z)-(E-z)*(F-t))o=!1;else{for(x=0;x<y;x++)if(!(x==p||x==u||x==v)){var D=o[w[x]].x,K=o[w[x]].y,I=void 0,C=void 0,J=void 0,L=void 0,H=void 0,N=void 0,O=void 0,B=void 0,P=void 0,M=void 0,R=void 0,S=void 0,I=J=H=void 0,I=F-A,C=G-E,J=t-F,L=z-G,H=A-t,N=E-z,O=D-t,B=K-z,P=D-A,M=K-E,R=D-F,S=K-G,I=I*M-C*P,H=H*B-N*O,J=J*S-L*R;if(I>=0&&J>=0&&H>=0){o=!1;break a}}o=!0}}if(o){n=
|
|
g[j];o=g[m];p=g[l];h.push(a[n]);h.push(a[o]);h.push(a[p]);k.push([g[j],g[m],g[l]]);j=m;for(l=m+1;l<e;j++,l++)g[j]=g[l];e--;n=2*e}}if(f)return k;return h};a.Triangulate.area=c;return a})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
|
|
g[j];o=g[m];p=g[l];h.push(a[n]);h.push(a[o]);h.push(a[p]);k.push([g[j],g[m],g[l]]);j=m;for(l=m+1;l<e;j++,l++)g[j]=g[l];e--;n=2*e}}if(f)return k;return h};a.Triangulate.area=c;return a})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
|
|
THREE.TorusGeometry=function(a,c,b,f){THREE.Geometry.call(this);this.radius=a||100;this.tube=c||40;this.segmentsR=b||8;this.segmentsT=f||6;a=[];for(c=0;c<=this.segmentsR;++c)for(b=0;b<=this.segmentsT;++b){var f=b/this.segmentsT*2*Math.PI,e=c/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(e))*Math.cos(f),(this.radius+this.tube*Math.cos(e))*Math.sin(f),this.tube*Math.sin(e))));a.push([b/this.segmentsT,1-c/this.segmentsR])}for(c=1;c<=this.segmentsR;++c)for(b=
|
|
THREE.TorusGeometry=function(a,c,b,f){THREE.Geometry.call(this);this.radius=a||100;this.tube=c||40;this.segmentsR=b||8;this.segmentsT=f||6;a=[];for(c=0;c<=this.segmentsR;++c)for(b=0;b<=this.segmentsT;++b){var f=b/this.segmentsT*2*Math.PI,e=c/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(e))*Math.cos(f),(this.radius+this.tube*Math.cos(e))*Math.sin(f),this.tube*Math.sin(e))));a.push([b/this.segmentsT,1-c/this.segmentsR])}for(c=1;c<=this.segmentsR;++c)for(b=
|
|
1;b<=this.segmentsT;++b){var f=(this.segmentsT+1)*c+b,e=(this.segmentsT+1)*c+b-1,h=(this.segmentsT+1)*(c-1)+b-1,g=(this.segmentsT+1)*(c-1)+b;this.faces.push(new THREE.Face4(f,e,h,g));this.faceVertexUvs[0].push([new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[h][0],a[h][1]),new THREE.UV(a[g][0],a[g][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusGeometry.prototype=new THREE.Geometry;
|
|
1;b<=this.segmentsT;++b){var f=(this.segmentsT+1)*c+b,e=(this.segmentsT+1)*c+b-1,h=(this.segmentsT+1)*(c-1)+b-1,g=(this.segmentsT+1)*(c-1)+b;this.faces.push(new THREE.Face4(f,e,h,g));this.faceVertexUvs[0].push([new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[h][0],a[h][1]),new THREE.UV(a[g][0],a[g][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusGeometry.prototype=new THREE.Geometry;
|
|
@@ -127,55 +127,55 @@ new Image;g.onload=function(){if(!b(this.width)||!b(this.height)){var c=Math.pow
|
|
1)a[b].wrapT=THREE.RepeatWrapping}e&&a[b].offset.set(e[0],e[1]);if(k){h={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(h[k[0]]!==void 0)a[b].wrapS=h[k[0]];if(h[k[1]]!==void 0)a[b].wrapT=h[k[1]]}f(a[b],c+"/"+g)}function h(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}var g,k,j;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"));
|
|
1)a[b].wrapT=THREE.RepeatWrapping}e&&a[b].offset.set(e[0],e[1]);if(k){h={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(h[k[0]]!==void 0)a[b].wrapS=h[k[0]];if(h[k[1]]!==void 0)a[b].wrapT=h[k[1]]}f(a[b],c+"/"+g)}function h(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}var g,k,j;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);
|
|
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);
|
|
else if(a.DbgColor)g.color=a.DbgColor;if(a.colorSpecular)g.specular=h(a.colorSpecular);if(a.colorAmbient)g.ambient=h(a.colorAmbient);if(a.transparency)g.opacity=a.transparency;if(a.specularCoef)g.shininess=a.specularCoef;a.mapDiffuse&&c&&e(g,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap);a.mapLight&&c&&e(g,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap);a.mapNormal&&c&&e(g,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap);
|
|
else if(a.DbgColor)g.color=a.DbgColor;if(a.colorSpecular)g.specular=h(a.colorSpecular);if(a.colorAmbient)g.ambient=h(a.colorAmbient);if(a.transparency)g.opacity=a.transparency;if(a.specularCoef)g.shininess=a.specularCoef;a.mapDiffuse&&c&&e(g,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap);a.mapLight&&c&&e(g,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap);a.mapNormal&&c&&e(g,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap);
|
|
-if(a.mapNormal){var m=THREE.ShaderUtils.lib.normal,l=THREE.UniformsUtils.clone(m.uniforms),n=g.color;k=g.specular;j=g.ambient;var o=g.shininess;l.tNormal.texture=g.normalMap;if(a.mapNormalFactor)l.uNormalScale.value=a.mapNormalFactor;if(g.map)l.tDiffuse.texture=g.map,l.enableDiffuse.value=!0;l.enableAO.value=!1;l.enableSpecular.value=!1;l.uDiffuseColor.value.setHex(n);l.uSpecularColor.value.setHex(k);l.uAmbientColor.value.setHex(j);l.uShininess.value=o;if(g.opacity)l.uOpacity.value=g.opacity;g=new THREE.MeshShaderMaterial({fragmentShader:m.fragmentShader,
|
|
|
|
-vertexShader:m.vertexShader,uniforms:l,lights:!0})}else g=new THREE[k](g);return g}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;
|
|
|
|
-THREE.JSONLoader.prototype.load=function(a){var c=this,b=a.model,f=a.callback,e=a.texture_path?a.texture_path:this.extractUrlbase(b),a=new Worker(b);a.onmessage=function(a){c.createModel(a.data,f,e);c.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
|
|
|
|
-THREE.JSONLoader.prototype.createModel=function(a,c,b){var f=new THREE.Geometry,e=a.scale!==void 0?1/a.scale:1;this.init_materials(f,a.materials,b);(function(b){if(a.version===void 0||a.version!=2)console.error("Deprecated file format.");else{var c,e,j,m,l,n,o,p,u,v,x,y,w,t,z=a.faces;n=a.vertices;var A=a.normals,E=a.colors,F=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&F++;for(c=0;c<F;c++)f.faceUvs[c]=[],f.faceVertexUvs[c]=[];m=0;for(l=n.length;m<l;)o=new THREE.Vertex,o.position.x=n[m++]*b,o.position.y=
|
|
|
|
-n[m++]*b,o.position.z=n[m++]*b,f.vertices.push(o);m=0;for(l=z.length;m<l;){b=z[m++];n=b&1;j=b&2;c=b&4;e=b&8;p=b&16;o=b&32;v=b&64;b&=128;n?(x=new THREE.Face4,x.a=z[m++],x.b=z[m++],x.c=z[m++],x.d=z[m++],n=4):(x=new THREE.Face3,x.a=z[m++],x.b=z[m++],x.c=z[m++],n=3);if(j)j=z[m++],x.materials=f.materials[j];j=f.faces.length;if(c)for(c=0;c<F;c++)y=a.uvs[c],u=z[m++],t=y[u*2],u=y[u*2+1],f.faceUvs[c][j]=new THREE.UV(t,u);if(e)for(c=0;c<F;c++){y=a.uvs[c];w=[];for(e=0;e<n;e++)u=z[m++],t=y[u*2],u=y[u*2+1],w[e]=
|
|
|
|
-new THREE.UV(t,u);f.faceVertexUvs[c][j]=w}if(p)p=z[m++]*3,e=new THREE.Vector3,e.x=A[p++],e.y=A[p++],e.z=A[p],x.normal=e;if(o)for(c=0;c<n;c++)p=z[m++]*3,e=new THREE.Vector3,e.x=A[p++],e.y=A[p++],e.z=A[p],x.vertexNormals.push(e);if(v)o=z[m++],o=new THREE.Color(E[o]),x.color=o;if(b)for(c=0;c<n;c++)o=z[m++],o=new THREE.Color(E[o]),x.vertexColors.push(o);f.faces.push(x)}}})(e);(function(){var b,c,e,j;if(a.skinWeights){b=0;for(c=a.skinWeights.length;b<c;b+=2)e=a.skinWeights[b],j=a.skinWeights[b+1],f.skinWeights.push(new THREE.Vector4(e,
|
|
|
|
|
|
+a.mapSpecular&&c&&e(g,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap);if(a.mapNormal){var m=THREE.ShaderUtils.lib.normal,l=THREE.UniformsUtils.clone(m.uniforms),n=g.color;k=g.specular;j=g.ambient;var o=g.shininess;l.tNormal.texture=g.normalMap;if(a.mapNormalFactor)l.uNormalScale.value=a.mapNormalFactor;if(g.map)l.tDiffuse.texture=g.map,l.enableDiffuse.value=!0;if(g.specularMap)l.tSpecular.texture=g.specularMap,l.enableSpecular.value=!0;if(g.lightMap)l.tAO.texture=
|
|
|
|
+g.lightMap,l.enableAO.value=!0;l.uDiffuseColor.value.setHex(n);l.uSpecularColor.value.setHex(k);l.uAmbientColor.value.setHex(j);l.uShininess.value=o;if(g.opacity)l.uOpacity.value=g.opacity;g=new THREE.MeshShaderMaterial({fragmentShader:m.fragmentShader,vertexShader:m.vertexShader,uniforms:l,lights:!0})}else g=new THREE[k](g);return g}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;
|
|
|
|
+THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(a){var c=this,b=a.model,f=a.callback,e=a.texture_path?a.texture_path:this.extractUrlbase(b),a=new Worker(b);a.onmessage=function(a){c.createModel(a.data,f,e);c.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
|
|
|
|
+THREE.JSONLoader.prototype.createModel=function(a,c,b){var f=new THREE.Geometry,e=a.scale!==void 0?1/a.scale:1;this.init_materials(f,a.materials,b);(function(b){if(a.version===void 0||a.version!=2)console.error("Deprecated file format.");else{var c,e,j,m,l,n,o,p,u,v,y,w,x,t,z=a.faces;n=a.vertices;var A=a.normals,E=a.colors,F=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&F++;for(c=0;c<F;c++)f.faceUvs[c]=[],f.faceVertexUvs[c]=[];m=0;for(l=n.length;m<l;)o=new THREE.Vertex,o.position.x=n[m++]*b,o.position.y=
|
|
|
|
+n[m++]*b,o.position.z=n[m++]*b,f.vertices.push(o);m=0;for(l=z.length;m<l;){b=z[m++];n=b&1;j=b&2;c=b&4;e=b&8;p=b&16;o=b&32;v=b&64;b&=128;n?(y=new THREE.Face4,y.a=z[m++],y.b=z[m++],y.c=z[m++],y.d=z[m++],n=4):(y=new THREE.Face3,y.a=z[m++],y.b=z[m++],y.c=z[m++],n=3);if(j)j=z[m++],y.materials=f.materials[j];j=f.faces.length;if(c)for(c=0;c<F;c++)w=a.uvs[c],u=z[m++],t=w[u*2],u=w[u*2+1],f.faceUvs[c][j]=new THREE.UV(t,u);if(e)for(c=0;c<F;c++){w=a.uvs[c];x=[];for(e=0;e<n;e++)u=z[m++],t=w[u*2],u=w[u*2+1],x[e]=
|
|
|
|
+new THREE.UV(t,u);f.faceVertexUvs[c][j]=x}if(p)p=z[m++]*3,e=new THREE.Vector3,e.x=A[p++],e.y=A[p++],e.z=A[p],y.normal=e;if(o)for(c=0;c<n;c++)p=z[m++]*3,e=new THREE.Vector3,e.x=A[p++],e.y=A[p++],e.z=A[p],y.vertexNormals.push(e);if(v)o=z[m++],o=new THREE.Color(E[o]),y.color=o;if(b)for(c=0;c<n;c++)o=z[m++],o=new THREE.Color(E[o]),y.vertexColors.push(o);f.faces.push(y)}}})(e);(function(){var b,c,e,j;if(a.skinWeights){b=0;for(c=a.skinWeights.length;b<c;b+=2)e=a.skinWeights[b],j=a.skinWeights[b+1],f.skinWeights.push(new THREE.Vector4(e,
|
|
j,0,0))}if(a.skinIndices){b=0;for(c=a.skinIndices.length;b<c;b+=2)e=a.skinIndices[b],j=a.skinIndices[b+1],f.skinIndices.push(new THREE.Vector4(e,j,0,0))}f.bones=a.bones;f.animation=a.animation})();(function(b){if(a.morphTargets!==void 0){var c,e,j,m,l,n,o,p,u;c=0;for(e=a.morphTargets.length;c<e;c++){f.morphTargets[c]={};f.morphTargets[c].name=a.morphTargets[c].name;f.morphTargets[c].vertices=[];p=f.morphTargets[c].vertices;u=a.morphTargets[c].vertices;j=0;for(m=u.length;j<m;j+=3)l=u[j]*b,n=u[j+1]*
|
|
j,0,0))}if(a.skinIndices){b=0;for(c=a.skinIndices.length;b<c;b+=2)e=a.skinIndices[b],j=a.skinIndices[b+1],f.skinIndices.push(new THREE.Vector4(e,j,0,0))}f.bones=a.bones;f.animation=a.animation})();(function(b){if(a.morphTargets!==void 0){var c,e,j,m,l,n,o,p,u;c=0;for(e=a.morphTargets.length;c<e;c++){f.morphTargets[c]={};f.morphTargets[c].name=a.morphTargets[c].name;f.morphTargets[c].vertices=[];p=f.morphTargets[c].vertices;u=a.morphTargets[c].vertices;j=0;for(m=u.length;j<m;j+=3)l=u[j]*b,n=u[j+1]*
|
|
b,o=u[j+2]*b,p.push(new THREE.Vertex(new THREE.Vector3(l,n,o)))}}if(a.morphColors!==void 0){c=0;for(e=a.morphColors.length;c<e;c++){f.morphColors[c]={};f.morphColors[c].name=a.morphColors[c].name;f.morphColors[c].colors=[];m=f.morphColors[c].colors;l=a.morphColors[c].colors;b=0;for(j=l.length;b<j;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),m.push(n)}}})(e);(function(){if(a.edges!==void 0){var b,c,e;for(b=0;b<a.edges.length;b+=2)c=a.edges[b],e=a.edges[b+1],f.edges.push(new THREE.Edge(f.vertices[c],
|
|
b,o=u[j+2]*b,p.push(new THREE.Vertex(new THREE.Vector3(l,n,o)))}}if(a.morphColors!==void 0){c=0;for(e=a.morphColors.length;c<e;c++){f.morphColors[c]={};f.morphColors[c].name=a.morphColors[c].name;f.morphColors[c].colors=[];m=f.morphColors[c].colors;l=a.morphColors[c].colors;b=0;for(j=l.length;b<j;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),m.push(n)}}})(e);(function(){if(a.edges!==void 0){var b,c,e;for(b=0;b<a.edges.length;b+=2)c=a.edges[b],e=a.edges[b+1],f.edges.push(new THREE.Edge(f.vertices[c],
|
|
f.vertices[e],c,e))}})();f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};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;
|
|
f.vertices[e],c,e))}})();f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};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 c=a.model,b=a.callback,f=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(c),e=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(c),a=(new Date).getTime(),c=new Worker(c),h=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(a){THREE.BinaryLoader.prototype.loadAjaxBuffers(a.data.buffers,a.data.materials,b,e,f,h)};c.onerror=function(a){alert("worker.onerror: "+a.message+"\n"+a.data);a.preventDefault()};
|
|
THREE.BinaryLoader.prototype={load:function(a){var c=a.model,b=a.callback,f=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(c),e=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(c),a=(new Date).getTime(),c=new Worker(c),h=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(a){THREE.BinaryLoader.prototype.loadAjaxBuffers(a.data.buffers,a.data.materials,b,e,f,h)};c.onerror=function(a){alert("worker.onerror: "+a.message+"\n"+a.data);a.preventDefault()};
|
|
c.postMessage(a)},loadAjaxBuffers:function(a,c,b,f,e,h){var g=new XMLHttpRequest,k=f+"/"+a,j=0;g.onreadystatechange=function(){g.readyState==4?g.status==200||g.status==0?THREE.BinaryLoader.prototype.createBinModel(g.responseText,b,e,c):alert("Couldn't load ["+k+"] ["+g.status+"]"):g.readyState==3?h&&(j==0&&(j=g.getResponseHeader("Content-Length")),h({total:j,loaded:g.responseText.length})):g.readyState==2&&(j=g.getResponseHeader("Content-Length"))};g.open("GET",k,!0);g.overrideMimeType("text/plain; charset=x-user-defined");
|
|
c.postMessage(a)},loadAjaxBuffers:function(a,c,b,f,e,h){var g=new XMLHttpRequest,k=f+"/"+a,j=0;g.onreadystatechange=function(){g.readyState==4?g.status==200||g.status==0?THREE.BinaryLoader.prototype.createBinModel(g.responseText,b,e,c):alert("Couldn't load ["+k+"] ["+g.status+"]"):g.readyState==3?h&&(j==0&&(j=g.getResponseHeader("Content-Length")),h({total:j,loaded:g.responseText.length})):g.readyState==2&&(j=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)},createBinModel:function(a,c,b,f){var e=function(b){function c(a,b){var e=l(a,b),f=l(a,b+1),g=l(a,b+2),h=l(a,b+3),j=(h<<1&255|g>>7)-127;e|=(g&127)<<16|f<<8;if(e==0&&j==-127)return 0;return(1-2*(h>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,j)}function e(a,b){var c=l(a,b),f=l(a,b+1),g=l(a,b+2);return(l(a,b+3)<<24)+(g<<16)+(f<<8)+c}function j(a,b){var c=l(a,b);return(l(a,b+1)<<8)+c}function m(a,b){var c=l(a,b);return c>127?c-256:c}function l(a,
|
|
g.setRequestHeader("Content-Type","text/plain");g.send(null)},createBinModel:function(a,c,b,f){var e=function(b){function c(a,b){var e=l(a,b),f=l(a,b+1),g=l(a,b+2),h=l(a,b+3),j=(h<<1&255|g>>7)-127;e|=(g&127)<<16|f<<8;if(e==0&&j==-127)return 0;return(1-2*(h>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,j)}function e(a,b){var c=l(a,b),f=l(a,b+1),g=l(a,b+2);return(l(a,b+3)<<24)+(g<<16)+(f<<8)+c}function j(a,b){var c=l(a,b);return(l(a,b+1)<<8)+c}function m(a,b){var c=l(a,b);return c>127?c-256:c}function l(a,
|
|
-b){return a.charCodeAt(b)&255}function n(b){var c,f,g;c=e(a,b);f=e(a,b+E);g=e(a,b+F);b=j(a,b+G);THREE.BinaryLoader.prototype.f3(y,c,f,g,b)}function o(b){var c,f,g,h,m,l;c=e(a,b);f=e(a,b+E);g=e(a,b+F);h=j(a,b+G);m=e(a,b+D);l=e(a,b+K);b=e(a,b+I);THREE.BinaryLoader.prototype.f3n(y,z,c,f,g,h,m,l,b)}function p(b){var c,f,g,h;c=e(a,b);f=e(a,b+C);g=e(a,b+J);h=e(a,b+L);b=j(a,b+H);THREE.BinaryLoader.prototype.f4(y,c,f,g,h,b)}function u(b){var c,f,g,h,m,l,n,o;c=e(a,b);f=e(a,b+C);g=e(a,b+J);h=e(a,b+L);m=j(a,
|
|
|
|
-b+H);l=e(a,b+N);n=e(a,b+O);o=e(a,b+B);b=e(a,b+P);THREE.BinaryLoader.prototype.f4n(y,z,c,f,g,h,m,l,n,o,b)}function v(b){var c,f;c=e(a,b);f=e(a,b+M);b=e(a,b+R);THREE.BinaryLoader.prototype.uv3(y.faceVertexUvs[0],A[c*2],A[c*2+1],A[f*2],A[f*2+1],A[b*2],A[b*2+1])}function x(b){var c,f,g;c=e(a,b);f=e(a,b+S);g=e(a,b+Y);b=e(a,b+Z);THREE.BinaryLoader.prototype.uv4(y.faceVertexUvs[0],A[c*2],A[c*2+1],A[f*2],A[f*2+1],A[g*2],A[g*2+1],A[b*2],A[b*2+1])}var y=this,w=0,t,z=[],A=[],E,F,G,D,K,I,C,J,L,H,N,O,B,P,M,R,
|
|
|
|
-S,Y,Z,T,U,V,W,X,Q;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(y,f,b);t={signature:a.substr(w,8),header_bytes:l(a,w+8),vertex_coordinate_bytes:l(a,w+9),normal_coordinate_bytes:l(a,w+10),uv_coordinate_bytes:l(a,w+11),vertex_index_bytes:l(a,w+12),normal_index_bytes:l(a,w+13),uv_index_bytes:l(a,w+14),material_index_bytes:l(a,w+15),nvertices:e(a,w+16),nnormals:e(a,w+16+4),nuvs:e(a,w+16+8),ntri_flat:e(a,w+16+12),ntri_smooth:e(a,w+16+16),ntri_flat_uv:e(a,w+16+20),ntri_smooth_uv:e(a,w+
|
|
|
|
-16+24),nquad_flat:e(a,w+16+28),nquad_smooth:e(a,w+16+32),nquad_flat_uv:e(a,w+16+36),nquad_smooth_uv:e(a,w+16+40)};w+=t.header_bytes;E=t.vertex_index_bytes;F=t.vertex_index_bytes*2;G=t.vertex_index_bytes*3;D=t.vertex_index_bytes*3+t.material_index_bytes;K=t.vertex_index_bytes*3+t.material_index_bytes+t.normal_index_bytes;I=t.vertex_index_bytes*3+t.material_index_bytes+t.normal_index_bytes*2;C=t.vertex_index_bytes;J=t.vertex_index_bytes*2;L=t.vertex_index_bytes*3;H=t.vertex_index_bytes*4;N=t.vertex_index_bytes*
|
|
|
|
|
|
+b){return a.charCodeAt(b)&255}function n(b){var c,f,g;c=e(a,b);f=e(a,b+E);g=e(a,b+F);b=j(a,b+G);THREE.BinaryLoader.prototype.f3(w,c,f,g,b)}function o(b){var c,f,g,h,l,m;c=e(a,b);f=e(a,b+E);g=e(a,b+F);h=j(a,b+G);l=e(a,b+D);m=e(a,b+K);b=e(a,b+I);THREE.BinaryLoader.prototype.f3n(w,z,c,f,g,h,l,m,b)}function p(b){var c,f,g,h;c=e(a,b);f=e(a,b+C);g=e(a,b+J);h=e(a,b+L);b=j(a,b+H);THREE.BinaryLoader.prototype.f4(w,c,f,g,h,b)}function u(b){var c,f,g,h,l,m,n,o;c=e(a,b);f=e(a,b+C);g=e(a,b+J);h=e(a,b+L);l=j(a,
|
|
|
|
+b+H);m=e(a,b+N);n=e(a,b+O);o=e(a,b+B);b=e(a,b+P);THREE.BinaryLoader.prototype.f4n(w,z,c,f,g,h,l,m,n,o,b)}function v(b){var c,f;c=e(a,b);f=e(a,b+M);b=e(a,b+R);THREE.BinaryLoader.prototype.uv3(w.faceVertexUvs[0],A[c*2],A[c*2+1],A[f*2],A[f*2+1],A[b*2],A[b*2+1])}function y(b){var c,f,g;c=e(a,b);f=e(a,b+S);g=e(a,b+Y);b=e(a,b+Z);THREE.BinaryLoader.prototype.uv4(w.faceVertexUvs[0],A[c*2],A[c*2+1],A[f*2],A[f*2+1],A[g*2],A[g*2+1],A[b*2],A[b*2+1])}var w=this,x=0,t,z=[],A=[],E,F,G,D,K,I,C,J,L,H,N,O,B,P,M,R,
|
|
|
|
+S,Y,Z,T,U,V,W,X,Q;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(w,f,b);t={signature:a.substr(x,8),header_bytes:l(a,x+8),vertex_coordinate_bytes:l(a,x+9),normal_coordinate_bytes:l(a,x+10),uv_coordinate_bytes:l(a,x+11),vertex_index_bytes:l(a,x+12),normal_index_bytes:l(a,x+13),uv_index_bytes:l(a,x+14),material_index_bytes:l(a,x+15),nvertices:e(a,x+16),nnormals:e(a,x+16+4),nuvs:e(a,x+16+8),ntri_flat:e(a,x+16+12),ntri_smooth:e(a,x+16+16),ntri_flat_uv:e(a,x+16+20),ntri_smooth_uv:e(a,x+
|
|
|
|
+16+24),nquad_flat:e(a,x+16+28),nquad_smooth:e(a,x+16+32),nquad_flat_uv:e(a,x+16+36),nquad_smooth_uv:e(a,x+16+40)};x+=t.header_bytes;E=t.vertex_index_bytes;F=t.vertex_index_bytes*2;G=t.vertex_index_bytes*3;D=t.vertex_index_bytes*3+t.material_index_bytes;K=t.vertex_index_bytes*3+t.material_index_bytes+t.normal_index_bytes;I=t.vertex_index_bytes*3+t.material_index_bytes+t.normal_index_bytes*2;C=t.vertex_index_bytes;J=t.vertex_index_bytes*2;L=t.vertex_index_bytes*3;H=t.vertex_index_bytes*4;N=t.vertex_index_bytes*
|
|
4+t.material_index_bytes;O=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes;B=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*2;P=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*3;M=t.uv_index_bytes;R=t.uv_index_bytes*2;S=t.uv_index_bytes;Y=t.uv_index_bytes*2;Z=t.uv_index_bytes*3;b=t.vertex_index_bytes*3+t.material_index_bytes;Q=t.vertex_index_bytes*4+t.material_index_bytes;T=t.ntri_flat*b;U=t.ntri_smooth*(b+t.normal_index_bytes*3);V=t.ntri_flat_uv*
|
|
4+t.material_index_bytes;O=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes;B=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*2;P=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*3;M=t.uv_index_bytes;R=t.uv_index_bytes*2;S=t.uv_index_bytes;Y=t.uv_index_bytes*2;Z=t.uv_index_bytes*3;b=t.vertex_index_bytes*3+t.material_index_bytes;Q=t.vertex_index_bytes*4+t.material_index_bytes;T=t.ntri_flat*b;U=t.ntri_smooth*(b+t.normal_index_bytes*3);V=t.ntri_flat_uv*
|
|
-(b+t.uv_index_bytes*3);W=t.ntri_smooth_uv*(b+t.normal_index_bytes*3+t.uv_index_bytes*3);X=t.nquad_flat*Q;b=t.nquad_smooth*(Q+t.normal_index_bytes*4);Q=t.nquad_flat_uv*(Q+t.uv_index_bytes*4);w+=function(b){for(var f,e,h,j=t.vertex_coordinate_bytes*3,k=b+t.nvertices*j;b<k;b+=j)f=c(a,b),e=c(a,b+t.vertex_coordinate_bytes),h=c(a,b+t.vertex_coordinate_bytes*2),THREE.BinaryLoader.prototype.v(y,f,e,h);return t.nvertices*j}(w);w+=function(b){for(var c,f,e,g=t.normal_coordinate_bytes*3,h=b+t.nnormals*g;b<h;b+=
|
|
|
|
-g)c=m(a,b),f=m(a,b+t.normal_coordinate_bytes),e=m(a,b+t.normal_coordinate_bytes*2),z.push(c/127,f/127,e/127);return t.nnormals*g}(w);w+=function(b){for(var f,e,h=t.uv_coordinate_bytes*2,j=b+t.nuvs*h;b<j;b+=h)f=c(a,b),e=c(a,b+t.uv_coordinate_bytes),A.push(f,e);return t.nuvs*h}(w);T=w+T;U=T+U;V=U+V;W=V+W;X=W+X;b=X+b;Q=b+Q;(function(a){var b,c=t.vertex_index_bytes*3+t.material_index_bytes,f=c+t.uv_index_bytes*3,e=a+t.ntri_flat_uv*f;for(b=a;b<e;b+=f)n(b),v(b+c);return e-a})(U);(function(a){var b,c=t.vertex_index_bytes*
|
|
|
|
-3+t.material_index_bytes+t.normal_index_bytes*3,f=c+t.uv_index_bytes*3,e=a+t.ntri_smooth_uv*f;for(b=a;b<e;b+=f)o(b),v(b+c);return e-a})(V);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes,f=c+t.uv_index_bytes*4,e=a+t.nquad_flat_uv*f;for(b=a;b<e;b+=f)p(b),x(b+c);return e-a})(b);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*4,f=c+t.uv_index_bytes*4,e=a+t.nquad_smooth_uv*f;for(b=a;b<e;b+=f)u(b),x(b+c);return e-a})(Q);(function(a){var b,c=t.vertex_index_bytes*
|
|
|
|
-3+t.material_index_bytes,f=a+t.ntri_flat*c;for(b=a;b<f;b+=c)n(b);return f-a})(w);(function(a){var b,c=t.vertex_index_bytes*3+t.material_index_bytes+t.normal_index_bytes*3,f=a+t.ntri_smooth*c;for(b=a;b<f;b+=c)o(b);return f-a})(T);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes,f=a+t.nquad_flat*c;for(b=a;b<f;b+=c)p(b);return f-a})(W);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*4,f=a+t.nquad_smooth*c;for(b=a;b<f;b+=c)u(b);return f-a})(X);
|
|
|
|
|
|
+(b+t.uv_index_bytes*3);W=t.ntri_smooth_uv*(b+t.normal_index_bytes*3+t.uv_index_bytes*3);X=t.nquad_flat*Q;b=t.nquad_smooth*(Q+t.normal_index_bytes*4);Q=t.nquad_flat_uv*(Q+t.uv_index_bytes*4);x+=function(b){for(var f,e,h,j=t.vertex_coordinate_bytes*3,k=b+t.nvertices*j;b<k;b+=j)f=c(a,b),e=c(a,b+t.vertex_coordinate_bytes),h=c(a,b+t.vertex_coordinate_bytes*2),THREE.BinaryLoader.prototype.v(w,f,e,h);return t.nvertices*j}(x);x+=function(b){for(var c,f,e,g=t.normal_coordinate_bytes*3,h=b+t.nnormals*g;b<h;b+=
|
|
|
|
+g)c=m(a,b),f=m(a,b+t.normal_coordinate_bytes),e=m(a,b+t.normal_coordinate_bytes*2),z.push(c/127,f/127,e/127);return t.nnormals*g}(x);x+=function(b){for(var f,e,h=t.uv_coordinate_bytes*2,j=b+t.nuvs*h;b<j;b+=h)f=c(a,b),e=c(a,b+t.uv_coordinate_bytes),A.push(f,e);return t.nuvs*h}(x);T=x+T;U=T+U;V=U+V;W=V+W;X=W+X;b=X+b;Q=b+Q;(function(a){var b,c=t.vertex_index_bytes*3+t.material_index_bytes,f=c+t.uv_index_bytes*3,e=a+t.ntri_flat_uv*f;for(b=a;b<e;b+=f)n(b),v(b+c);return e-a})(U);(function(a){var b,c=t.vertex_index_bytes*
|
|
|
|
+3+t.material_index_bytes+t.normal_index_bytes*3,f=c+t.uv_index_bytes*3,e=a+t.ntri_smooth_uv*f;for(b=a;b<e;b+=f)o(b),v(b+c);return e-a})(V);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes,f=c+t.uv_index_bytes*4,e=a+t.nquad_flat_uv*f;for(b=a;b<e;b+=f)p(b),y(b+c);return e-a})(b);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*4,f=c+t.uv_index_bytes*4,e=a+t.nquad_smooth_uv*f;for(b=a;b<e;b+=f)u(b),y(b+c);return e-a})(Q);(function(a){var b,c=t.vertex_index_bytes*
|
|
|
|
+3+t.material_index_bytes,f=a+t.ntri_flat*c;for(b=a;b<f;b+=c)n(b);return f-a})(x);(function(a){var b,c=t.vertex_index_bytes*3+t.material_index_bytes+t.normal_index_bytes*3,f=a+t.ntri_smooth*c;for(b=a;b<f;b+=c)o(b);return f-a})(T);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes,f=a+t.nquad_flat*c;for(b=a;b<f;b+=c)p(b);return f-a})(W);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*4,f=a+t.nquad_smooth*c;for(b=a;b<f;b+=c)u(b);return f-a})(X);
|
|
this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;c(new e(b))},v:function(a,c,b,f){a.vertices.push(new THREE.Vertex(new THREE.Vector3(c,b,f)))},f3:function(a,c,b,f,e){a.faces.push(new THREE.Face3(c,b,f,null,null,a.materials[e]))},f4:function(a,c,b,f,e,h){a.faces.push(new THREE.Face4(c,b,f,e,null,null,a.materials[h]))},f3n:function(a,c,b,f,e,h,g,k,j){var h=a.materials[h],m=c[k*
|
|
this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;c(new e(b))},v:function(a,c,b,f){a.vertices.push(new THREE.Vertex(new THREE.Vector3(c,b,f)))},f3:function(a,c,b,f,e){a.faces.push(new THREE.Face3(c,b,f,null,null,a.materials[e]))},f4:function(a,c,b,f,e,h){a.faces.push(new THREE.Face4(c,b,f,e,null,null,a.materials[h]))},f3n:function(a,c,b,f,e,h,g,k,j){var h=a.materials[h],m=c[k*
|
|
-3],l=c[k*3+1],k=c[k*3+2],n=c[j*3],o=c[j*3+1],j=c[j*3+2];a.faces.push(new THREE.Face3(b,f,e,[new THREE.Vector3(c[g*3],c[g*3+1],c[g*3+2]),new THREE.Vector3(m,l,k),new THREE.Vector3(n,o,j)],null,h))},f4n:function(a,c,b,f,e,h,g,k,j,m,l){var g=a.materials[g],n=c[j*3],o=c[j*3+1],j=c[j*3+2],p=c[m*3],u=c[m*3+1],m=c[m*3+2],v=c[l*3],x=c[l*3+1],l=c[l*3+2];a.faces.push(new THREE.Face4(b,f,e,h,[new THREE.Vector3(c[k*3],c[k*3+1],c[k*3+2]),new THREE.Vector3(n,o,j),new THREE.Vector3(p,u,m),new THREE.Vector3(v,x,
|
|
|
|
|
|
+3],l=c[k*3+1],k=c[k*3+2],n=c[j*3],o=c[j*3+1],j=c[j*3+2];a.faces.push(new THREE.Face3(b,f,e,[new THREE.Vector3(c[g*3],c[g*3+1],c[g*3+2]),new THREE.Vector3(m,l,k),new THREE.Vector3(n,o,j)],null,h))},f4n:function(a,c,b,f,e,h,g,k,j,m,l){var g=a.materials[g],n=c[j*3],o=c[j*3+1],j=c[j*3+2],p=c[m*3],u=c[m*3+1],m=c[m*3+2],v=c[l*3],y=c[l*3+1],l=c[l*3+2];a.faces.push(new THREE.Face4(b,f,e,h,[new THREE.Vector3(c[k*3],c[k*3+1],c[k*3+2]),new THREE.Vector3(n,o,j),new THREE.Vector3(p,u,m),new THREE.Vector3(v,y,
|
|
l)],null,g))},uv3:function(a,c,b,f,e,h,g){var k=[];k.push(new THREE.UV(c,b));k.push(new THREE.UV(f,e));k.push(new THREE.UV(h,g));a.push(k)},uv4:function(a,c,b,f,e,h,g,k,j){var m=[];m.push(new THREE.UV(c,b));m.push(new THREE.UV(f,e));m.push(new THREE.UV(h,g));m.push(new THREE.UV(k,j));a.push(m)}};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
|
|
l)],null,g))},uv3:function(a,c,b,f,e,h,g){var k=[];k.push(new THREE.UV(c,b));k.push(new THREE.UV(f,e));k.push(new THREE.UV(h,g));a.push(k)},uv4:function(a,c,b,f,e,h,g,k,j){var m=[];m.push(new THREE.UV(c,b));m.push(new THREE.UV(f,e));m.push(new THREE.UV(h,g));m.push(new THREE.UV(k,j));a.push(m)}};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
|
|
-THREE.SceneLoader.prototype={load:function(a,c){var b=this,f=new Worker(a);f.postMessage(0);var e=THREE.Loader.prototype.extractUrlbase(a);f.onmessage=function(a){function f(a,b){return b=="relativeToHTML"?a:e+"/"+a}function k(){for(p in C.objects)if(!B.objects[p])if(w=C.objects[p],w.geometry!==void 0){if(E=B.geometries[w.geometry]){var a=!1;K=[];for(M=0;M<w.materials.length;M++)K[M]=B.materials[w.materials[M]],a=K[M]instanceof THREE.MeshShaderMaterial;a&&E.computeTangents();t=w.position;r=w.rotation;
|
|
|
|
-q=w.quaternion;s=w.scale;q=0;K.length==0&&(K[0]=new THREE.MeshFaceMaterial);K.length>1&&(K=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(E,K);object.name=p;object.position.set(t[0],t[1],t[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=w.visible;B.scene.addObject(object);B.objects[p]=object;w.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),B.scene.collisions.colliders.push(a));
|
|
|
|
-if(w.castsShadow)a=new THREE.ShadowVolume(E),B.scene.addChild(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;w.trigger&&w.trigger.toLowerCase()!="none"&&(a={type:w.trigger,object:w},B.triggers[object.name]=a)}}else t=w.position,r=w.rotation,q=w.quaternion,s=w.scale,q=0,object=new THREE.Object3D,object.name=p,object.position.set(t[0],t[1],t[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=w.visible!==void 0?w.visible:!1,B.scene.addObject(object),B.objects[p]=object,B.empties[p]=object,w.trigger&&w.trigger.toLowerCase()!="none"&&(a={type:w.trigger,object:w},B.triggers[object.name]=a)}function j(a){return function(c){B.geometries[a]=c;k();L-=1;b.onLoadComplete();l()}}function m(a){return function(b){B.geometries[a]=b}}function l(){b.callbackProgress({totalModels:N,totalTextures:O,loadedModels:N-L,loadedTextures:O-H},B);b.onLoadProgress();L==0&&H==0&&c(B)}var n,
|
|
|
|
-o,p,u,v,x,y,w,t,z,A,E,F,G,D,K,I,C,J,L,H,N,O,B;C=a.data;D=new THREE.BinaryLoader;J=new THREE.JSONLoader;H=L=0;B={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(p in C.objects)if(w=C.objects[p],w.meshCollider){a=!0;break}if(a)B.scene.collisions=new THREE.CollisionSystem;if(C.transform){a=C.transform.position;z=C.transform.rotation;var P=C.transform.scale;a&&B.scene.position.set(a[0],a[1],a[2]);z&&B.scene.rotation.set(z[0],
|
|
|
|
|
|
+THREE.SceneLoader.prototype={load:function(a,c){var b=this,f=new Worker(a);f.postMessage(0);var e=THREE.Loader.prototype.extractUrlbase(a);f.onmessage=function(a){function f(a,b){return b=="relativeToHTML"?a:e+"/"+a}function k(){for(p in C.objects)if(!B.objects[p])if(x=C.objects[p],x.geometry!==void 0){if(E=B.geometries[x.geometry]){var a=!1;K=[];for(M=0;M<x.materials.length;M++)K[M]=B.materials[x.materials[M]],a=K[M]instanceof THREE.MeshShaderMaterial;a&&E.computeTangents();t=x.position;r=x.rotation;
|
|
|
|
+q=x.quaternion;s=x.scale;q=0;K.length==0&&(K[0]=new THREE.MeshFaceMaterial);K.length>1&&(K=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(E,K);object.name=p;object.position.set(t[0],t[1],t[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=x.visible;B.scene.addObject(object);B.objects[p]=object;x.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),B.scene.collisions.colliders.push(a));
|
|
|
|
+if(x.castsShadow)a=new THREE.ShadowVolume(E),B.scene.addChild(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;x.trigger&&x.trigger.toLowerCase()!="none"&&(a={type:x.trigger,object:x},B.triggers[object.name]=a)}}else t=x.position,r=x.rotation,q=x.quaternion,s=x.scale,q=0,object=new THREE.Object3D,object.name=p,object.position.set(t[0],t[1],t[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=x.visible!==void 0?x.visible:!1,B.scene.addObject(object),B.objects[p]=object,B.empties[p]=object,x.trigger&&x.trigger.toLowerCase()!="none"&&(a={type:x.trigger,object:x},B.triggers[object.name]=a)}function j(a){return function(c){B.geometries[a]=c;k();L-=1;b.onLoadComplete();l()}}function m(a){return function(b){B.geometries[a]=b}}function l(){b.callbackProgress({totalModels:N,totalTextures:O,loadedModels:N-L,loadedTextures:O-H},B);b.onLoadProgress();L==0&&H==0&&c(B)}var n,
|
|
|
|
+o,p,u,v,y,w,x,t,z,A,E,F,G,D,K,I,C,J,L,H,N,O,B;C=a.data;D=new THREE.BinaryLoader;J=new THREE.JSONLoader;H=L=0;B={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(p in C.objects)if(x=C.objects[p],x.meshCollider){a=!0;break}if(a)B.scene.collisions=new THREE.CollisionSystem;if(C.transform){a=C.transform.position;z=C.transform.rotation;var P=C.transform.scale;a&&B.scene.position.set(a[0],a[1],a[2]);z&&B.scene.rotation.set(z[0],
|
|
z[1],z[2]);P&&B.scene.scale.set(P[0],P[1],P[2]);(a||z||P)&&B.scene.updateMatrix()}a=function(){H-=1;l();b.onLoadComplete()};for(v in C.cameras){z=C.cameras[v];if(z.type=="perspective")F=new THREE.Camera(z.fov,z.aspect,z.near,z.far);else if(z.type=="ortho")F=new THREE.Camera,F.projectionMatrix=THREE.Matrix4.makeOrtho(z.left,z.right,z.top,z.bottom,z.near,z.far);t=z.position;z=z.target;F.position.set(t[0],t[1],t[2]);F.target.position.set(z[0],z[1],z[2]);B.cameras[v]=F}for(u in C.lights)v=C.lights[u],
|
|
z[1],z[2]);P&&B.scene.scale.set(P[0],P[1],P[2]);(a||z||P)&&B.scene.updateMatrix()}a=function(){H-=1;l();b.onLoadComplete()};for(v in C.cameras){z=C.cameras[v];if(z.type=="perspective")F=new THREE.Camera(z.fov,z.aspect,z.near,z.far);else if(z.type=="ortho")F=new THREE.Camera,F.projectionMatrix=THREE.Matrix4.makeOrtho(z.left,z.right,z.top,z.bottom,z.near,z.far);t=z.position;z=z.target;F.position.set(t[0],t[1],t[2]);F.target.position.set(z[0],z[1],z[2]);B.cameras[v]=F}for(u in C.lights)v=C.lights[u],
|
|
-F=v.color!==void 0?v.color:16777215,z=v.intensity!==void 0?v.intensity:1,v.type=="directional"?(t=v.direction,I=new THREE.DirectionalLight(F,z),I.position.set(t[0],t[1],t[2]),I.position.normalize()):v.type=="point"?(t=v.position,d=v.distance,I=new THREE.PointLight(F,z,d),I.position.set(t[0],t[1],t[2])):v.type=="ambient"&&(I=new THREE.AmbientLight(F)),B.scene.addLight(I),B.lights[u]=I;for(x in C.fogs)u=C.fogs[x],u.type=="linear"?G=new THREE.Fog(0,u.near,u.far):u.type=="exp2"&&(G=new THREE.FogExp2(0,
|
|
|
|
-u.density)),z=u.color,G.color.setRGB(z[0],z[1],z[2]),B.fogs[x]=G;if(B.cameras&&C.defaults.camera)B.currentCamera=B.cameras[C.defaults.camera];if(B.fogs&&C.defaults.fog)B.scene.fog=B.fogs[C.defaults.fog];z=C.defaults.bgcolor;B.bgColor=new THREE.Color;B.bgColor.setRGB(z[0],z[1],z[2]);B.bgColorAlpha=C.defaults.bgalpha;for(n in C.geometries)if(x=C.geometries[n],x.type=="bin_mesh"||x.type=="ascii_mesh")L+=1,b.onLoadStart();N=L;for(n in C.geometries)x=C.geometries[n],x.type=="cube"?(E=new THREE.CubeGeometry(x.width,
|
|
|
|
-x.height,x.depth,x.segmentsWidth,x.segmentsHeight,x.segmentsDepth,null,x.flipped,x.sides),B.geometries[n]=E):x.type=="plane"?(E=new THREE.PlaneGeometry(x.width,x.height,x.segmentsWidth,x.segmentsHeight),B.geometries[n]=E):x.type=="sphere"?(E=new THREE.SphereGeometry(x.radius,x.segmentsWidth,x.segmentsHeight),B.geometries[n]=E):x.type=="cylinder"?(E=new THREE.CylinderGeometry(x.numSegs,x.topRad,x.botRad,x.height,x.topOffset,x.botOffset),B.geometries[n]=E):x.type=="torus"?(E=new THREE.TorusGeometry(x.radius,
|
|
|
|
-x.tube,x.segmentsR,x.segmentsT),B.geometries[n]=E):x.type=="icosahedron"?(E=new THREE.IcosahedronGeometry(x.subdivisions),B.geometries[n]=E):x.type=="bin_mesh"?D.load({model:f(x.url,C.urlBaseType),callback:j(n)}):x.type=="ascii_mesh"?J.load({model:f(x.url,C.urlBaseType),callback:j(n)}):x.type=="embedded_mesh"&&(x=C.embeds[x.id])&&J.createModel(x,m(n),"");for(y in C.textures)if(n=C.textures[y],n.url instanceof Array){H+=n.url.length;for(D=0;D<n.url.length;D++)b.onLoadStart()}else H+=1,b.onLoadStart();
|
|
|
|
-O=H;for(y in C.textures){n=C.textures[y];if(n.mapping!=void 0&&THREE[n.mapping]!=void 0)n.mapping=new THREE[n.mapping];if(n.url instanceof Array){D=[];for(var M=0;M<n.url.length;M++)D[M]=f(n.url[M],C.urlBaseType);D=THREE.ImageUtils.loadTextureCube(D,n.mapping,a)}else{D=THREE.ImageUtils.loadTexture(f(n.url,C.urlBaseType),n.mapping,a);if(THREE[n.minFilter]!=void 0)D.minFilter=THREE[n.minFilter];if(THREE[n.magFilter]!=void 0)D.magFilter=THREE[n.magFilter];if(n.repeat){D.repeat.set(n.repeat[0],n.repeat[1]);
|
|
|
|
-if(n.repeat[0]!=1)D.wrapS=THREE.RepeatWrapping;if(n.repeat[1]!=1)D.wrapT=THREE.RepeatWrapping}n.offset&&D.offset.set(n.offset[0],n.offset[1]);if(n.wrap){J={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(J[n.wrap[0]]!==void 0)D.wrapS=J[n.wrap[0]];if(J[n.wrap[1]]!==void 0)D.wrapT=J[n.wrap[1]]}}B.textures[y]=D}for(o in C.materials){y=C.materials[o];for(A in y.parameters)if(A=="envMap"||A=="map"||A=="lightMap")y.parameters[A]=B.textures[y.parameters[A]];else if(A=="shading")y.parameters[A]=
|
|
|
|
-y.parameters[A]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(A=="blending")y.parameters[A]=THREE[y.parameters[A]]?THREE[y.parameters[A]]:THREE.NormalBlending;else if(A=="combine")y.parameters[A]=y.parameters[A]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(A=="vertexColors")if(y.parameters[A]=="face")y.parameters[A]=THREE.FaceColors;else if(y.parameters[A])y.parameters[A]=THREE.VertexColors;if(y.parameters.opacity!==void 0&&y.parameters.opacity<1)y.parameters.transparent=
|
|
|
|
-!0;if(y.parameters.normalMap){n=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(n.uniforms);D=y.parameters.color;J=y.parameters.specular;x=y.parameters.ambient;G=y.parameters.shininess;a.tNormal.texture=B.textures[y.parameters.normalMap];if(y.parameters.normalMapFactor)a.uNormalScale.value=y.parameters.normalMapFactor;if(y.parameters.map)a.tDiffuse.texture=y.parameters.map,a.enableDiffuse.value=!0;a.enableAO.value=!1;a.enableSpecular.value=!1;a.uDiffuseColor.value.setHex(D);a.uSpecularColor.value.setHex(J);
|
|
|
|
-a.uAmbientColor.value.setHex(x);a.uShininess.value=G;if(y.parameters.opacity)a.uOpacity.value=y.parameters.opacity;y=new THREE.MeshShaderMaterial({fragmentShader:n.fragmentShader,vertexShader:n.vertexShader,uniforms:a,lights:!0})}else y=new THREE[y.type](y.parameters);B.materials[o]=y}k();b.callbackSync(B)}}};
|
|
|
|
|
|
+F=v.color!==void 0?v.color:16777215,z=v.intensity!==void 0?v.intensity:1,v.type=="directional"?(t=v.direction,I=new THREE.DirectionalLight(F,z),I.position.set(t[0],t[1],t[2]),I.position.normalize()):v.type=="point"?(t=v.position,d=v.distance,I=new THREE.PointLight(F,z,d),I.position.set(t[0],t[1],t[2])):v.type=="ambient"&&(I=new THREE.AmbientLight(F)),B.scene.addLight(I),B.lights[u]=I;for(y in C.fogs)u=C.fogs[y],u.type=="linear"?G=new THREE.Fog(0,u.near,u.far):u.type=="exp2"&&(G=new THREE.FogExp2(0,
|
|
|
|
+u.density)),z=u.color,G.color.setRGB(z[0],z[1],z[2]),B.fogs[y]=G;if(B.cameras&&C.defaults.camera)B.currentCamera=B.cameras[C.defaults.camera];if(B.fogs&&C.defaults.fog)B.scene.fog=B.fogs[C.defaults.fog];z=C.defaults.bgcolor;B.bgColor=new THREE.Color;B.bgColor.setRGB(z[0],z[1],z[2]);B.bgColorAlpha=C.defaults.bgalpha;for(n in C.geometries)if(y=C.geometries[n],y.type=="bin_mesh"||y.type=="ascii_mesh")L+=1,b.onLoadStart();N=L;for(n in C.geometries)y=C.geometries[n],y.type=="cube"?(E=new THREE.CubeGeometry(y.width,
|
|
|
|
+y.height,y.depth,y.segmentsWidth,y.segmentsHeight,y.segmentsDepth,null,y.flipped,y.sides),B.geometries[n]=E):y.type=="plane"?(E=new THREE.PlaneGeometry(y.width,y.height,y.segmentsWidth,y.segmentsHeight),B.geometries[n]=E):y.type=="sphere"?(E=new THREE.SphereGeometry(y.radius,y.segmentsWidth,y.segmentsHeight),B.geometries[n]=E):y.type=="cylinder"?(E=new THREE.CylinderGeometry(y.numSegs,y.topRad,y.botRad,y.height,y.topOffset,y.botOffset),B.geometries[n]=E):y.type=="torus"?(E=new THREE.TorusGeometry(y.radius,
|
|
|
|
+y.tube,y.segmentsR,y.segmentsT),B.geometries[n]=E):y.type=="icosahedron"?(E=new THREE.IcosahedronGeometry(y.subdivisions),B.geometries[n]=E):y.type=="bin_mesh"?D.load({model:f(y.url,C.urlBaseType),callback:j(n)}):y.type=="ascii_mesh"?J.load({model:f(y.url,C.urlBaseType),callback:j(n)}):y.type=="embedded_mesh"&&(y=C.embeds[y.id])&&J.createModel(y,m(n),"");for(w in C.textures)if(n=C.textures[w],n.url instanceof Array){H+=n.url.length;for(D=0;D<n.url.length;D++)b.onLoadStart()}else H+=1,b.onLoadStart();
|
|
|
|
+O=H;for(w in C.textures){n=C.textures[w];if(n.mapping!=void 0&&THREE[n.mapping]!=void 0)n.mapping=new THREE[n.mapping];if(n.url instanceof Array){D=[];for(var M=0;M<n.url.length;M++)D[M]=f(n.url[M],C.urlBaseType);D=THREE.ImageUtils.loadTextureCube(D,n.mapping,a)}else{D=THREE.ImageUtils.loadTexture(f(n.url,C.urlBaseType),n.mapping,a);if(THREE[n.minFilter]!=void 0)D.minFilter=THREE[n.minFilter];if(THREE[n.magFilter]!=void 0)D.magFilter=THREE[n.magFilter];if(n.repeat){D.repeat.set(n.repeat[0],n.repeat[1]);
|
|
|
|
+if(n.repeat[0]!=1)D.wrapS=THREE.RepeatWrapping;if(n.repeat[1]!=1)D.wrapT=THREE.RepeatWrapping}n.offset&&D.offset.set(n.offset[0],n.offset[1]);if(n.wrap){J={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(J[n.wrap[0]]!==void 0)D.wrapS=J[n.wrap[0]];if(J[n.wrap[1]]!==void 0)D.wrapT=J[n.wrap[1]]}}B.textures[w]=D}for(o in C.materials){w=C.materials[o];for(A in w.parameters)if(A=="envMap"||A=="map"||A=="lightMap")w.parameters[A]=B.textures[w.parameters[A]];else if(A=="shading")w.parameters[A]=
|
|
|
|
+w.parameters[A]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(A=="blending")w.parameters[A]=THREE[w.parameters[A]]?THREE[w.parameters[A]]:THREE.NormalBlending;else if(A=="combine")w.parameters[A]=w.parameters[A]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(A=="vertexColors")if(w.parameters[A]=="face")w.parameters[A]=THREE.FaceColors;else if(w.parameters[A])w.parameters[A]=THREE.VertexColors;if(w.parameters.opacity!==void 0&&w.parameters.opacity<1)w.parameters.transparent=
|
|
|
|
+!0;if(w.parameters.normalMap){n=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(n.uniforms);D=w.parameters.color;J=w.parameters.specular;y=w.parameters.ambient;G=w.parameters.shininess;a.tNormal.texture=B.textures[w.parameters.normalMap];if(w.parameters.normalMapFactor)a.uNormalScale.value=w.parameters.normalMapFactor;if(w.parameters.map)a.tDiffuse.texture=w.parameters.map,a.enableDiffuse.value=!0;if(w.parameters.lightMap)a.tAO.texture=w.parameters.lightMap,a.enableAO.value=!0;if(w.parameters.specularMap)a.tSpecular.texture=
|
|
|
|
+B.textures[w.parameters.specularMap],a.enableSpecular.value=!0;a.uDiffuseColor.value.setHex(D);a.uSpecularColor.value.setHex(J);a.uAmbientColor.value.setHex(y);a.uShininess.value=G;if(w.parameters.opacity)a.uOpacity.value=w.parameters.opacity;w=new THREE.MeshShaderMaterial({fragmentShader:n.fragmentShader,vertexShader:n.vertexShader,uniforms:a,lights:!0})}else w=new THREE[w.type](w.parameters);B.materials[o]=w}k();b.callbackSync(B)}}};
|
|
THREE.MarchingCubes=function(a,c){THREE.Object3D.call(this);this.materials=c instanceof Array?c:[c];this.init=function(a){this.isolation=80;this.size=a;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(this.size3*3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=
|
|
THREE.MarchingCubes=function(a,c){THREE.Object3D.call(this);this.materials=c instanceof Array?c:[c];this.init=function(a){this.isolation=80;this.size=a;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(this.size3*3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=
|
|
0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(a,c,e){return a+(c-a)*e};this.VIntX=function(a,c,e,h,g,k,j,m,l,n){g=(g-l)/(n-l);l=this.normal_cache;c[h]=k+g*this.delta;c[h+1]=j;c[h+2]=m;e[h]=this.lerp(l[a],l[a+3],g);e[h+1]=this.lerp(l[a+1],l[a+4],g);e[h+2]=this.lerp(l[a+2],l[a+5],g)};this.VIntY=function(a,c,e,h,g,k,j,m,l,n){g=(g-l)/(n-l);l=this.normal_cache;c[h]=k;c[h+1]=j+g*this.delta;c[h+
|
|
0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(a,c,e){return a+(c-a)*e};this.VIntX=function(a,c,e,h,g,k,j,m,l,n){g=(g-l)/(n-l);l=this.normal_cache;c[h]=k+g*this.delta;c[h+1]=j;c[h+2]=m;e[h]=this.lerp(l[a],l[a+3],g);e[h+1]=this.lerp(l[a+1],l[a+4],g);e[h+2]=this.lerp(l[a+2],l[a+5],g)};this.VIntY=function(a,c,e,h,g,k,j,m,l,n){g=(g-l)/(n-l);l=this.normal_cache;c[h]=k;c[h+1]=j+g*this.delta;c[h+
|
|
2]=m;c=a+this.yd*3;e[h]=this.lerp(l[a],l[c],g);e[h+1]=this.lerp(l[a+1],l[c+1],g);e[h+2]=this.lerp(l[a+2],l[c+2],g)};this.VIntZ=function(a,c,e,h,g,k,j,m,l,n){g=(g-l)/(n-l);l=this.normal_cache;c[h]=k;c[h+1]=j;c[h+2]=m+g*this.delta;c=a+this.zd*3;e[h]=this.lerp(l[a],l[c],g);e[h+1]=this.lerp(l[a+1],l[c+1],g);e[h+2]=this.lerp(l[a+2],l[c+2],g)};this.compNorm=function(a){var c=a*3;this.normal_cache[c]==0&&(this.normal_cache[c]=this.field[a-1]-this.field[a+1],this.normal_cache[c+1]=this.field[a-this.yd]-this.field[a+
|
|
2]=m;c=a+this.yd*3;e[h]=this.lerp(l[a],l[c],g);e[h+1]=this.lerp(l[a+1],l[c+1],g);e[h+2]=this.lerp(l[a+2],l[c+2],g)};this.VIntZ=function(a,c,e,h,g,k,j,m,l,n){g=(g-l)/(n-l);l=this.normal_cache;c[h]=k;c[h+1]=j;c[h+2]=m+g*this.delta;c=a+this.zd*3;e[h]=this.lerp(l[a],l[c],g);e[h+1]=this.lerp(l[a+1],l[c+1],g);e[h+2]=this.lerp(l[a+2],l[c+2],g)};this.compNorm=function(a){var c=a*3;this.normal_cache[c]==0&&(this.normal_cache[c]=this.field[a-1]-this.field[a+1],this.normal_cache[c+1]=this.field[a-this.yd]-this.field[a+
|
|
-this.yd],this.normal_cache[c+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,c,e,h,g,k){var j=h+1,m=h+this.yd,l=h+this.zd,n=j+this.yd,o=j+this.zd,p=h+this.yd+this.zd,u=j+this.yd+this.zd,v=0,x=this.field[h],y=this.field[j],w=this.field[m],t=this.field[n],z=this.field[l],A=this.field[o],E=this.field[p],F=this.field[u];x<g&&(v|=1);y<g&&(v|=2);w<g&&(v|=8);t<g&&(v|=4);z<g&&(v|=16);A<g&&(v|=32);E<g&&(v|=128);F<g&&(v|=64);var G=THREE.edgeTable[v];if(G==0)return 0;var D=this.delta,
|
|
|
|
-K=a+D,I=c+D,D=e+D;G&1&&(this.compNorm(h),this.compNorm(j),this.VIntX(h*3,this.vlist,this.nlist,0,g,a,c,e,x,y));G&2&&(this.compNorm(j),this.compNorm(n),this.VIntY(j*3,this.vlist,this.nlist,3,g,K,c,e,y,t));G&4&&(this.compNorm(m),this.compNorm(n),this.VIntX(m*3,this.vlist,this.nlist,6,g,a,I,e,w,t));G&8&&(this.compNorm(h),this.compNorm(m),this.VIntY(h*3,this.vlist,this.nlist,9,g,a,c,e,x,w));G&16&&(this.compNorm(l),this.compNorm(o),this.VIntX(l*3,this.vlist,this.nlist,12,g,a,c,D,z,A));G&32&&(this.compNorm(o),
|
|
|
|
-this.compNorm(u),this.VIntY(o*3,this.vlist,this.nlist,15,g,K,c,D,A,F));G&64&&(this.compNorm(p),this.compNorm(u),this.VIntX(p*3,this.vlist,this.nlist,18,g,a,I,D,E,F));G&128&&(this.compNorm(l),this.compNorm(p),this.VIntY(l*3,this.vlist,this.nlist,21,g,a,c,D,z,E));G&256&&(this.compNorm(h),this.compNorm(l),this.VIntZ(h*3,this.vlist,this.nlist,24,g,a,c,e,x,z));G&512&&(this.compNorm(j),this.compNorm(o),this.VIntZ(j*3,this.vlist,this.nlist,27,g,K,c,e,y,A));G&1024&&(this.compNorm(n),this.compNorm(u),this.VIntZ(n*
|
|
|
|
-3,this.vlist,this.nlist,30,g,K,I,e,t,F));G&2048&&(this.compNorm(m),this.compNorm(p),this.VIntZ(m*3,this.vlist,this.nlist,33,g,a,I,e,w,E));v<<=4;for(g=h=0;THREE.triTable[v+g]!=-1;)a=v+g,c=a+1,e=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[c],3*THREE.triTable[e],k),g+=3,h++;return h};this.posnormtriv=function(a,c,e,h,g,k){var j=this.count*3;this.positionArray[j]=a[e];this.positionArray[j+1]=a[e+1];this.positionArray[j+2]=a[e+2];this.positionArray[j+3]=a[h];this.positionArray[j+
|
|
|
|
|
|
+this.yd],this.normal_cache[c+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,c,e,h,g,k){var j=h+1,m=h+this.yd,l=h+this.zd,n=j+this.yd,o=j+this.zd,p=h+this.yd+this.zd,u=j+this.yd+this.zd,v=0,y=this.field[h],w=this.field[j],x=this.field[m],t=this.field[n],z=this.field[l],A=this.field[o],E=this.field[p],F=this.field[u];y<g&&(v|=1);w<g&&(v|=2);x<g&&(v|=8);t<g&&(v|=4);z<g&&(v|=16);A<g&&(v|=32);E<g&&(v|=128);F<g&&(v|=64);var G=THREE.edgeTable[v];if(G==0)return 0;var D=this.delta,
|
|
|
|
+K=a+D,I=c+D,D=e+D;G&1&&(this.compNorm(h),this.compNorm(j),this.VIntX(h*3,this.vlist,this.nlist,0,g,a,c,e,y,w));G&2&&(this.compNorm(j),this.compNorm(n),this.VIntY(j*3,this.vlist,this.nlist,3,g,K,c,e,w,t));G&4&&(this.compNorm(m),this.compNorm(n),this.VIntX(m*3,this.vlist,this.nlist,6,g,a,I,e,x,t));G&8&&(this.compNorm(h),this.compNorm(m),this.VIntY(h*3,this.vlist,this.nlist,9,g,a,c,e,y,x));G&16&&(this.compNorm(l),this.compNorm(o),this.VIntX(l*3,this.vlist,this.nlist,12,g,a,c,D,z,A));G&32&&(this.compNorm(o),
|
|
|
|
+this.compNorm(u),this.VIntY(o*3,this.vlist,this.nlist,15,g,K,c,D,A,F));G&64&&(this.compNorm(p),this.compNorm(u),this.VIntX(p*3,this.vlist,this.nlist,18,g,a,I,D,E,F));G&128&&(this.compNorm(l),this.compNorm(p),this.VIntY(l*3,this.vlist,this.nlist,21,g,a,c,D,z,E));G&256&&(this.compNorm(h),this.compNorm(l),this.VIntZ(h*3,this.vlist,this.nlist,24,g,a,c,e,y,z));G&512&&(this.compNorm(j),this.compNorm(o),this.VIntZ(j*3,this.vlist,this.nlist,27,g,K,c,e,w,A));G&1024&&(this.compNorm(n),this.compNorm(u),this.VIntZ(n*
|
|
|
|
+3,this.vlist,this.nlist,30,g,K,I,e,t,F));G&2048&&(this.compNorm(m),this.compNorm(p),this.VIntZ(m*3,this.vlist,this.nlist,33,g,a,I,e,x,E));v<<=4;for(g=h=0;THREE.triTable[v+g]!=-1;)a=v+g,c=a+1,e=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[c],3*THREE.triTable[e],k),g+=3,h++;return h};this.posnormtriv=function(a,c,e,h,g,k){var j=this.count*3;this.positionArray[j]=a[e];this.positionArray[j+1]=a[e+1];this.positionArray[j+2]=a[e+2];this.positionArray[j+3]=a[h];this.positionArray[j+
|
|
4]=a[h+1];this.positionArray[j+5]=a[h+2];this.positionArray[j+6]=a[g];this.positionArray[j+7]=a[g+1];this.positionArray[j+8]=a[g+2];this.normalArray[j]=c[e];this.normalArray[j+1]=c[e+1];this.normalArray[j+2]=c[e+2];this.normalArray[j+3]=c[h];this.normalArray[j+4]=c[h+1];this.normalArray[j+5]=c[h+2];this.normalArray[j+6]=c[g];this.normalArray[j+7]=c[g+1];this.normalArray[j+8]=c[g+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&k(this)};this.begin=function(){this.count=0;
|
|
4]=a[h+1];this.positionArray[j+5]=a[h+2];this.positionArray[j+6]=a[g];this.positionArray[j+7]=a[g+1];this.positionArray[j+8]=a[g+2];this.normalArray[j]=c[e];this.normalArray[j+1]=c[e+1];this.normalArray[j+2]=c[e+2];this.normalArray[j+3]=c[h];this.normalArray[j+4]=c[h+1];this.normalArray[j+5]=c[h+2];this.normalArray[j+6]=c[g];this.normalArray[j+7]=c[g+1];this.normalArray[j+8]=c[g+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&k(this)};this.begin=function(){this.count=0;
|
|
this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var c=this.count*3;c<this.positionArray.length;c++)this.positionArray[c]=0;a(this)}};this.addBall=function(a,c,e,h,g){var k=this.size*Math.sqrt(h/g),j=e*this.size,m=c*this.size,l=a*this.size,n=Math.floor(j-k);n<1&&(n=1);j=Math.floor(j+k);j>this.size-1&&(j=this.size-1);var o=Math.floor(m-k);o<1&&(o=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var p=Math.floor(l-k);p<1&&(p=1);k=Math.floor(l+k);k>this.size-1&&(k=this.size-
|
|
this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var c=this.count*3;c<this.positionArray.length;c++)this.positionArray[c]=0;a(this)}};this.addBall=function(a,c,e,h,g){var k=this.size*Math.sqrt(h/g),j=e*this.size,m=c*this.size,l=a*this.size,n=Math.floor(j-k);n<1&&(n=1);j=Math.floor(j+k);j>this.size-1&&(j=this.size-1);var o=Math.floor(m-k);o<1&&(o=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var p=Math.floor(l-k);p<1&&(p=1);k=Math.floor(l+k);k>this.size-1&&(k=this.size-
|
|
-1);for(var u,v,x,y,w,t;n<j;n++){l=this.size2*n;v=n/this.size-e;w=v*v;for(v=o;v<m;v++){x=l+this.size*v;u=v/this.size-c;t=u*u;for(u=p;u<k;u++)y=u/this.size-a,y=h/(1.0E-6+y*y+t+w)-g,y>0&&(this.field[x+u]+=y)}}};this.addPlaneX=function(a,c){var e,h,g,k,j,m=this.size,l=this.yd,n=this.zd,o=this.field,p=m*Math.sqrt(a/c);p>m&&(p=m);for(e=0;e<p;e++)if(h=e/m,h*=h,k=a/(1.0E-4+h)-c,k>0)for(h=0;h<m;h++){j=e+h*l;for(g=0;g<m;g++)o[n*g+j]+=k}};this.addPlaneY=function(a,c){var e,h,g,k,j,m,l=this.size,n=this.yd,o=
|
|
|
|
|
|
+1);for(var u,v,y,w,x,t;n<j;n++){l=this.size2*n;v=n/this.size-e;x=v*v;for(v=o;v<m;v++){y=l+this.size*v;u=v/this.size-c;t=u*u;for(u=p;u<k;u++)w=u/this.size-a,w=h/(1.0E-6+w*w+t+x)-g,w>0&&(this.field[y+u]+=w)}}};this.addPlaneX=function(a,c){var e,h,g,k,j,m=this.size,l=this.yd,n=this.zd,o=this.field,p=m*Math.sqrt(a/c);p>m&&(p=m);for(e=0;e<p;e++)if(h=e/m,h*=h,k=a/(1.0E-4+h)-c,k>0)for(h=0;h<m;h++){j=e+h*l;for(g=0;g<m;g++)o[n*g+j]+=k}};this.addPlaneY=function(a,c){var e,h,g,k,j,m,l=this.size,n=this.yd,o=
|
|
this.zd,p=this.field,u=l*Math.sqrt(a/c);u>l&&(u=l);for(h=0;h<u;h++)if(e=h/l,e*=e,k=a/(1.0E-4+e)-c,k>0){j=h*n;for(e=0;e<l;e++){m=j+e;for(g=0;g<l;g++)p[o*g+m]+=k}}};this.addPlaneZ=function(a,c){var e,h,g,k,j,m;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(a/c);dist>size&&(dist=size);for(g=0;g<dist;g++)if(e=g/size,e*=e,k=a/(1.0E-4+e)-c,k>0){j=zd*g;for(h=0;h<size;h++){m=j+h*yd;for(e=0;e<size;e++)field[m+e]+=k}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[a*
|
|
this.zd,p=this.field,u=l*Math.sqrt(a/c);u>l&&(u=l);for(h=0;h<u;h++)if(e=h/l,e*=e,k=a/(1.0E-4+e)-c,k>0){j=h*n;for(e=0;e<l;e++){m=j+e;for(g=0;g<l;g++)p[o*g+m]+=k}}};this.addPlaneZ=function(a,c){var e,h,g,k,j,m;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(a/c);dist>size&&(dist=size);for(g=0;g<dist;g++)if(e=g/size,e*=e,k=a/(1.0E-4+e)-c,k>0){j=zd*g;for(h=0;h<size;h++){m=j+h*yd;for(e=0;e<size;e++)field[m+e]+=k}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[a*
|
|
3]=0,this.field[a]=0};this.render=function(a){this.begin();var c,e,h,g,k,j,m,l,n,o=this.size-2;for(g=1;g<o;g++){n=this.size2*g;m=(g-this.halfsize)/this.halfsize;for(h=1;h<o;h++){l=n+this.size*h;j=(h-this.halfsize)/this.halfsize;for(e=1;e<o;e++)k=(e-this.halfsize)/this.halfsize,c=l+e,this.polygonize(k,j,m,c,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,c=new THREE.Geometry,e=[];this.render(function(h){var g,k,j,m,l,n,o,p;for(g=0;g<h.count;g++)o=g*3,l=o+1,p=o+2,k=h.positionArray[o],
|
|
3]=0,this.field[a]=0};this.render=function(a){this.begin();var c,e,h,g,k,j,m,l,n,o=this.size-2;for(g=1;g<o;g++){n=this.size2*g;m=(g-this.halfsize)/this.halfsize;for(h=1;h<o;h++){l=n+this.size*h;j=(h-this.halfsize)/this.halfsize;for(e=1;e<o;e++)k=(e-this.halfsize)/this.halfsize,c=l+e,this.polygonize(k,j,m,c,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,c=new THREE.Geometry,e=[];this.render(function(h){var g,k,j,m,l,n,o,p;for(g=0;g<h.count;g++)o=g*3,l=o+1,p=o+2,k=h.positionArray[o],
|
|
j=h.positionArray[l],m=h.positionArray[p],n=new THREE.Vector3(k,j,m),k=h.normalArray[o],j=h.normalArray[l],m=h.normalArray[p],o=new THREE.Vector3(k,j,m),o.normalize(),l=new THREE.Vertex(n),c.vertices.push(l),e.push(o);nfaces=h.count/3;for(g=0;g<nfaces;g++)o=(a+g)*3,l=o+1,p=o+2,n=e[o],k=e[l],j=e[p],o=new THREE.Face3(o,l,p,[n,k,j]),c.faces.push(o);a+=nfaces;h.count=0});return c};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
|
|
j=h.positionArray[l],m=h.positionArray[p],n=new THREE.Vector3(k,j,m),k=h.normalArray[o],j=h.normalArray[l],m=h.normalArray[p],o=new THREE.Vector3(k,j,m),o.normalize(),l=new THREE.Vertex(n),c.vertices.push(l),e.push(o);nfaces=h.count/3;for(g=0;g<nfaces;g++)o=(a+g)*3,l=o+1,p=o+2,n=e[o],k=e[l],j=e[p],o=new THREE.Face3(o,l,p,[n,k,j]),c.faces.push(o);a+=nfaces;h.count=0});return c};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
|
|
@@ -223,7 +223,7 @@ THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionU
|
|
THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))};
|
|
THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))};
|
|
if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var c=this,b=this.setSize,f=this.render,e=new THREE.Camera,h=new THREE.Camera,g=new THREE.Matrix4,k=new THREE.Matrix4,j,m,l;e.useTarget=h.useTarget=!1;e.matrixAutoUpdate=h.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},n=new THREE.WebGLRenderTarget(512,512,a),o=new THREE.WebGLRenderTarget(512,512,a),p=new THREE.Camera(53,1,1,1E4);p.position.z=
|
|
if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var c=this,b=this.setSize,f=this.render,e=new THREE.Camera,h=new THREE.Camera,g=new THREE.Matrix4,k=new THREE.Matrix4,j,m,l;e.useTarget=h.useTarget=!1;e.matrixAutoUpdate=h.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},n=new THREE.WebGLRenderTarget(512,512,a),o=new THREE.WebGLRenderTarget(512,512,a),p=new THREE.Camera(53,1,1,1E4);p.position.z=
|
|
2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:n},mapRight:{type:"t",value:1,texture:o}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});
|
|
2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:n},mapRight:{type:"t",value:1,texture:o}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});
|
|
-var u=new THREE.Scene;u.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){b.call(c,a,e);n.width=a;n.height=e;o.width=a;o.height=e};this.render=function(a,b){b.update(null,!0);if(j!==b.aspect||m!==b.near||l!==b.fov){j=b.aspect;m=b.near;l=b.fov;var y=b.projectionMatrix.clone(),w=125/30*0.5,t=w*m/125,z=m*Math.tan(l*Math.PI/360),A;g.n14=w;k.n14=-w;w=-z*j+t;A=z*j+t;y.n11=2*m/(A-w);y.n13=(A+w)/(A-w);e.projectionMatrix=y.clone();w=-z*j-t;A=z*j-t;y.n11=2*m/(A-w);
|
|
|
|
-y.n13=(A+w)/(A-w);h.projectionMatrix=y.clone()}e.matrix=b.matrixWorld.clone().multiplySelf(k);e.update(null,!0);e.position.copy(b.position);e.near=m;e.far=b.far;f.call(c,a,e,n,!0);h.matrix=b.matrixWorld.clone().multiplySelf(g);h.update(null,!0);h.position.copy(b.position);h.near=m;h.far=b.far;f.call(c,a,h,o,!0);f.call(c,u,p)}};
|
|
|
|
|
|
+var u=new THREE.Scene;u.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){b.call(c,a,e);n.width=a;n.height=e;o.width=a;o.height=e};this.render=function(a,b){b.update(null,!0);if(j!==b.aspect||m!==b.near||l!==b.fov){j=b.aspect;m=b.near;l=b.fov;var w=b.projectionMatrix.clone(),x=125/30*0.5,t=x*m/125,z=m*Math.tan(l*Math.PI/360),A;g.n14=x;k.n14=-x;x=-z*j+t;A=z*j+t;w.n11=2*m/(A-x);w.n13=(A+x)/(A-x);e.projectionMatrix=w.clone();x=-z*j-t;A=z*j-t;w.n11=2*m/(A-x);
|
|
|
|
+w.n13=(A+x)/(A-x);h.projectionMatrix=w.clone()}e.matrix=b.matrixWorld.clone().multiplySelf(k);e.update(null,!0);e.position.copy(b.position);e.near=m;e.far=b.far;f.call(c,a,e,n,!0);h.matrix=b.matrixWorld.clone().multiplySelf(g);h.update(null,!0);h.position.copy(b.position);h.near=m;h.far=b.far;f.call(c,a,h,o,!0);f.call(c,u,p)}};
|
|
if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var c=this,b=this.setSize,f=this.render,e,h,g=new THREE.Camera,k=new THREE.Camera;c.separation=10;if(a&&a.separation!==void 0)c.separation=a.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(a,f){b.call(c,a,f);e=a/2;h=f};this.render=function(a,b){this.clear();g.fov=b.fov;g.aspect=0.5*b.aspect;g.near=b.near;g.far=b.far;
|
|
if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var c=this,b=this.setSize,f=this.render,e,h,g=new THREE.Camera,k=new THREE.Camera;c.separation=10;if(a&&a.separation!==void 0)c.separation=a.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(a,f){b.call(c,a,f);e=a/2;h=f};this.render=function(a,b){this.clear();g.fov=b.fov;g.aspect=0.5*b.aspect;g.near=b.near;g.far=b.far;
|
|
g.updateProjectionMatrix();g.position.copy(b.position);g.target.position.copy(b.target.position);g.translateX(c.separation);k.projectionMatrix=g.projectionMatrix;k.position.copy(b.position);k.target.position.copy(b.target.position);k.translateX(-c.separation);this.setViewport(0,0,e,h);f.call(c,a,g);this.setViewport(e,0,e,h);f.call(c,a,k,!1)}};
|
|
g.updateProjectionMatrix();g.position.copy(b.position);g.target.position.copy(b.target.position);g.translateX(c.separation);k.projectionMatrix=g.projectionMatrix;k.position.copy(b.position);k.target.position.copy(b.target.position);k.translateX(-c.separation);this.setViewport(0,0,e,h);f.call(c,a,g);this.setViewport(e,0,e,h);f.call(c,a,k,!1)}};
|