|
@@ -346,7 +346,7 @@ clamp:function(b,c,d){return b<c?c:b>d?d:b}};THREE.ColorUtils.__hsv={h:0,s:0,v:0
|
|
var GeometryUtils={merge:function(b,c){var d=c instanceof THREE.Mesh,e=b.vertices.length,g=d?c.geometry:c,f=b.vertices,j=g.vertices,k=b.faces,m=g.faces,n=b.faceVertexUvs[0],g=g.faceVertexUvs[0];d&&c.matrixAutoUpdate&&c.updateMatrix();for(var o=0,p=j.length;o<p;o++){var t=new THREE.Vertex(j[o].position.clone());d&&c.matrix.multiplyVector3(t.position);f.push(t)}o=0;for(p=m.length;o<p;o++){var j=m[o],u,v,z=j.vertexNormals,t=j.vertexColors;j instanceof THREE.Face3?u=new THREE.Face3(j.a+e,j.b+e,j.c+e):
|
|
var GeometryUtils={merge:function(b,c){var d=c instanceof THREE.Mesh,e=b.vertices.length,g=d?c.geometry:c,f=b.vertices,j=g.vertices,k=b.faces,m=g.faces,n=b.faceVertexUvs[0],g=g.faceVertexUvs[0];d&&c.matrixAutoUpdate&&c.updateMatrix();for(var o=0,p=j.length;o<p;o++){var t=new THREE.Vertex(j[o].position.clone());d&&c.matrix.multiplyVector3(t.position);f.push(t)}o=0;for(p=m.length;o<p;o++){var j=m[o],u,v,z=j.vertexNormals,t=j.vertexColors;j instanceof THREE.Face3?u=new THREE.Face3(j.a+e,j.b+e,j.c+e):
|
|
j instanceof THREE.Face4&&(u=new THREE.Face4(j.a+e,j.b+e,j.c+e,j.d+e));u.normal.copy(j.normal);d=0;for(f=z.length;d<f;d++)v=z[d],u.vertexNormals.push(v.clone());u.color.copy(j.color);d=0;for(f=t.length;d<f;d++)v=t[d],u.vertexColors.push(v.clone());u.materials=j.materials.slice();u.centroid.copy(j.centroid);k.push(u)}o=0;for(p=g.length;o<p;o++){e=g[o];k=[];d=0;for(f=e.length;d<f;d++)k.push(new THREE.UV(e[d].u,e[d].v));n.push(k)}}};
|
|
j instanceof THREE.Face4&&(u=new THREE.Face4(j.a+e,j.b+e,j.c+e,j.d+e));u.normal.copy(j.normal);d=0;for(f=z.length;d<f;d++)v=z[d],u.vertexNormals.push(v.clone());u.color.copy(j.color);d=0;for(f=t.length;d<f;d++)v=t[d],u.vertexColors.push(v.clone());u.materials=j.materials.slice();u.centroid.copy(j.centroid);k.push(u)}o=0;for(p=g.length;o<p;o++){e=g[o];k=[];d=0;for(f=e.length;d<f;d++)k.push(new THREE.UV(e[d].u,e[d].v));n.push(k)}}};
|
|
THREE.ImageUtils={loadTexture:function(b,c,d){var e=new Image,g=new THREE.Texture(e,c);e.onload=function(){g.needsUpdate=!0;d&&d(this)};e.src=b;return g},loadTextureCube:function(b,c,d){var e,g=[],f=new THREE.Texture(g,c),c=g.loadCount=0;for(e=b.length;c<e;++c)g[c]=new Image,g[c].onload=function(){g.loadCount+=1;if(g.loadCount==6)f.needsUpdate=!0;d&&d(this)},g[c].src=b[c];return f}};
|
|
THREE.ImageUtils={loadTexture:function(b,c,d){var e=new Image,g=new THREE.Texture(e,c);e.onload=function(){g.needsUpdate=!0;d&&d(this)};e.src=b;return g},loadTextureCube:function(b,c,d){var e,g=[],f=new THREE.Texture(g,c),c=g.loadCount=0;for(e=b.length;c<e;++c)g[c]=new Image,g[c].onload=function(){g.loadCount+=1;if(g.loadCount==6)f.needsUpdate=!0;d&&d(this)},g[c].src=b[c];return f}};
|
|
-THREE.SceneUtils={addMesh:function(b,c,d,e,g,f,j,k,m,n){c=new THREE.Mesh(c,n);c.scale.x=c.scale.y=c.scale.z=d;c.position.x=e;c.position.y=g;c.position.z=f;c.rotation.x=j;c.rotation.y=k;c.rotation.z=m;b.addObject(c);return c},addPanoramaCubeWebGL:function(b,c,d){var e=THREE.ShaderUtils.lib.cube;e.uniforms.tCube.texture=d;d=new THREE.MeshShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms});c=new THREE.Mesh(new THREE.Cube(c,c,c,1,1,1,null,!0),d);b.addObject(c);
|
|
|
|
|
|
+THREE.SceneUtils={addMesh:function(b,c,d,e,g,f,j,k,m,n){c=new THREE.Mesh(c,n);c.scale.x=c.scale.y=c.scale.z=d;c.position.x=e;c.position.y=g;c.position.z=f;c.rotation.x=j;c.rotation.y=k;c.rotation.z=m;b.addObject(c);return c},addPanoramaCubeWebGL:function(b,c,d){var e=THREE.ShaderUtils.lib.cube;e.uniforms.tCube.texture=d;d=new THREE.MeshShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms});c=new THREE.Mesh(new THREE.CubeGeometry(c,c,c,1,1,1,null,!0),d);b.addObject(c);
|
|
return c},addPanoramaCube:function(b,c,d){var e=[];e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[0])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[1])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[2])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[3])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[4])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[5])}));c=new THREE.Mesh(new THREE.Cube(c,c,c,1,1,e,!0),
|
|
return c},addPanoramaCube:function(b,c,d){var e=[];e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[0])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[1])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[2])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[3])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[4])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[5])}));c=new THREE.Mesh(new THREE.Cube(c,c,c,1,1,e,!0),
|
|
new THREE.MeshFaceMaterial);b.addObject(c);return c},addPanoramaCubePlanes:function(b,c,d){var e=c/2,c=new THREE.Plane(c,c),g=Math.PI,f=Math.PI/2;THREE.SceneUtils.addMesh(b,c,1,0,0,-e,0,0,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[5])}));THREE.SceneUtils.addMesh(b,c,1,-e,0,0,0,f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[0])}));THREE.SceneUtils.addMesh(b,c,1,e,0,0,0,-f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[1])}));THREE.SceneUtils.addMesh(b,c,1,0,e,0,f,0,g,
|
|
new THREE.MeshFaceMaterial);b.addObject(c);return c},addPanoramaCubePlanes:function(b,c,d){var e=c/2,c=new THREE.Plane(c,c),g=Math.PI,f=Math.PI/2;THREE.SceneUtils.addMesh(b,c,1,0,0,-e,0,0,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[5])}));THREE.SceneUtils.addMesh(b,c,1,-e,0,0,0,f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[0])}));THREE.SceneUtils.addMesh(b,c,1,e,0,0,0,-f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[1])}));THREE.SceneUtils.addMesh(b,c,1,0,e,0,f,0,g,
|
|
new THREE.MeshBasicMaterial({map:new THREE.Texture(d[2])}));THREE.SceneUtils.addMesh(b,c,1,0,-e,0,-f,0,g,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[3])}))},showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var d,e,g=b.children.length;for(e=0;e<g;e++)d=b.children[e],c(d),THREE.SceneUtils.traverseHierarchy(d,c)}};
|
|
new THREE.MeshBasicMaterial({map:new THREE.Texture(d[2])}));THREE.SceneUtils.addMesh(b,c,1,0,-e,0,-f,0,g,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[3])}))},showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var d,e,g=b.children.length;for(e=0;e<g;e++)d=b.children[e],c(d),THREE.SceneUtils.traverseHierarchy(d,c)}};
|
|
@@ -388,15 +388,15 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
|
|
!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
|
|
!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
|
|
THREE.QuakeCamera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(b));this.target.position.addSelf(c.multiplyScalar(b))};
|
|
THREE.QuakeCamera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(b));this.target.position.addSelf(c.multiplyScalar(b))};
|
|
THREE.PathCamera=function(b){function c(b,c,d,e){var f={name:d,fps:0.6,length:e,hierarchy:[]},g,j=c.getControlPointsArray(),k=c.getLength(),m=j.length,D=0;g=m-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:j[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[g]={time:e,pos:j[g],rot:[0,0,0,1],scl:[1,1,1]};for(g=1;g<m-1;g++)D=e*k.chunks[g]/k.total,c.keys[g]={time:D,pos:j[g]};f.hierarchy[0]=c;THREE.AnimationHandler.add(f);return new THREE.Animation(b,d,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function d(b,c){var d,
|
|
THREE.PathCamera=function(b){function c(b,c,d,e){var f={name:d,fps:0.6,length:e,hierarchy:[]},g,j=c.getControlPointsArray(),k=c.getLength(),m=j.length,D=0;g=m-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:j[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[g]={time:e,pos:j[g],rot:[0,0,0,1],scl:[1,1,1]};for(g=1;g<m-1;g++)D=e*k.chunks[g]/k.total,c.keys[g]={time:D,pos:j[g]};f.hierarchy[0]=c;THREE.AnimationHandler.add(f);return new THREE.Animation(b,d,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function d(b,c){var d,
|
|
-e,f=new THREE.Geometry;for(d=0;d<b.points.length*c;d++)e=d/(b.points.length*c),e=b.getPoint(e),f.vertices[d]=new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z));return f}function e(b,c){var e=d(c,10),f=d(c,10),g=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,g);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.addChild(lineObj);particleObj.scale.set(1,1,1);b.addChild(particleObj);f=new THREE.Sphere(1,
|
|
|
|
|
|
+e,f=new THREE.Geometry;for(d=0;d<b.points.length*c;d++)e=d/(b.points.length*c),e=b.getPoint(e),f.vertices[d]=new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z));return f}function e(b,c){var e=d(c,10),f=d(c,10),g=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,g);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.addChild(lineObj);particleObj.scale.set(1,1,1);b.addChild(particleObj);f=new THREE.SphereGeometry(1,
|
|
16,8);g=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)e=new THREE.Mesh(f,g),e.position.copy(c.points[i]),e.updateMatrix(),b.addChild(e)}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=
|
|
16,8);g=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)e=new THREE.Mesh(f,g),e.position.copy(c.points[i]),e.updateMatrix(),b.addChild(e)}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=
|
|
this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(b){if(b.duration!==void 0)this.duration=b.duration*1E3;if(b.waypoints!==void 0)this.waypoints=b.waypoints;if(b.useConstantSpeed!==void 0)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==void 0)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==void 0)this.createDebugPath=b.createDebugPath;if(b.createDebugDummy!==
|
|
this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(b){if(b.duration!==void 0)this.duration=b.duration*1E3;if(b.waypoints!==void 0)this.waypoints=b.waypoints;if(b.useConstantSpeed!==void 0)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==void 0)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==void 0)this.createDebugPath=b.createDebugPath;if(b.createDebugDummy!==
|
|
void 0)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==void 0)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==void 0)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==void 0)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
|
|
void 0)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==void 0)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==void 0)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==void 0)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
|
|
window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var g=Math.PI*2,f=Math.PI/180;this.update=function(b,c,d){var e,j;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*f;this.theta=this.lon*f;e=this.phi%g;this.phi=e>=0?e:e+g;e=this.verticalAngleMap.srcRange;j=this.verticalAngleMap.dstRange;var k=j[1]-j[0];this.phi=
|
|
window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var g=Math.PI*2,f=Math.PI/180;this.update=function(b,c,d){var e,j;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*f;this.theta=this.lon*f;e=this.phi%g;this.phi=e>=0?e:e+g;e=this.verticalAngleMap.srcRange;j=this.verticalAngleMap.dstRange;var k=j[1]-j[0];this.phi=
|
|
TWEEN.Easing.Quadratic.EaseInOut(((this.phi-e[0])*(j[1]-j[0])/(e[1]-e[0])+j[0]-j[0])/k)*k+j[0];e=this.horizontalAngleMap.srcRange;j=this.horizontalAngleMap.dstRange;k=j[1]-j[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-e[0])*(j[1]-j[0])/(e[1]-e[0])+j[0]-j[0])/k)*k+j[0];e=this.target.position;e.x=100*Math.sin(this.phi)*Math.cos(this.theta);e.y=100*Math.cos(this.phi);e.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,b,c,d)};this.onMouseMove=function(b){this.mouseX=
|
|
TWEEN.Easing.Quadratic.EaseInOut(((this.phi-e[0])*(j[1]-j[0])/(e[1]-e[0])+j[0]-j[0])/k)*k+j[0];e=this.horizontalAngleMap.srcRange;j=this.horizontalAngleMap.dstRange;k=j[1]-j[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-e[0])*(j[1]-j[0])/(e[1]-e[0])+j[0]-j[0])/k)*k+j[0];e=this.target.position;e.x=100*Math.sin(this.phi)*Math.cos(this.theta);e.y=100*Math.cos(this.phi);e.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,b,c,d)};this.onMouseMove=function(b){this.mouseX=
|
|
-b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),j=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.Cube(10,10,20),m=new THREE.Cube(2,2,10);this.animationParent=new THREE.Mesh(k,b);b=new THREE.Mesh(m,j);b.position.set(0,10,0);this.animation=c(this.animationParent,
|
|
|
|
-this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(b)}else this.animation=c(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&e(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(b,c){return function(){c.apply(b,arguments)}}(this,this.onMouseMove),!1)};
|
|
|
|
-THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
|
|
|
|
|
|
+b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),j=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(k,b);b=new THREE.Mesh(m,j);b.position.set(0,10,0);this.animation=
|
|
|
|
+c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(b)}else this.animation=c(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&e(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(b,c){return function(){c.apply(b,arguments)}}(this,this.onMouseMove),
|
|
|
|
+!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
|
|
THREE.FlyCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.domElement=document;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=b.movementSpeed;if(b.rollSpeed!==void 0)this.rollSpeed=b.rollSpeed;if(b.dragToLook!==void 0)this.dragToLook=b.dragToLook;if(b.autoForward!==void 0)this.autoForward=
|
|
THREE.FlyCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.domElement=document;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=b.movementSpeed;if(b.rollSpeed!==void 0)this.rollSpeed=b.rollSpeed;if(b.dragToLook!==void 0)this.dragToLook=b.dragToLook;if(b.autoForward!==void 0)this.autoForward=
|
|
b.autoForward;if(b.domElement!==void 0)this.domElement=b.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.keydown=function(b){if(!b.altKey){switch(b.keyCode){case 16:this.movementSpeedMultiplier=
|
|
b.autoForward;if(b.domElement!==void 0)this.domElement=b.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.keydown=function(b){if(!b.altKey){switch(b.keyCode){case 16:this.movementSpeedMultiplier=
|
|
0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
|
|
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()}};
|
|
@@ -499,12 +499,12 @@ J.objects[u]=object,J.empties[u]=object,D.trigger&&D.trigger.toLowerCase()!="non
|
|
U=h=0;J={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};var $=!1;for(u in G.objects)if(D=G.objects[u],D.meshCollider){$=!0;break}if($)J.scene.collisions=new THREE.CollisionSystem;if(G.transform){$=G.transform.position;H=G.transform.rotation;var R=G.transform.scale;$&&J.scene.position.set($[0],$[1],$[2]);H&&J.scene.rotation.set(H[0],H[1],H[2]);R&&J.scene.scale.set(R[0],R[1],R[2]);($||H||R)&&J.scene.updateMatrix()}$=function(){U-=
|
|
U=h=0;J={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};var $=!1;for(u in G.objects)if(D=G.objects[u],D.meshCollider){$=!0;break}if($)J.scene.collisions=new THREE.CollisionSystem;if(G.transform){$=G.transform.position;H=G.transform.rotation;var R=G.transform.scale;$&&J.scene.position.set($[0],$[1],$[2]);H&&J.scene.rotation.set(H[0],H[1],H[2]);R&&J.scene.scale.set(R[0],R[1],R[2]);($||H||R)&&J.scene.updateMatrix()}$=function(){U-=
|
|
1;o();d.onLoadComplete()};for(z in G.cameras){H=G.cameras[z];if(H.type=="perspective")O=new THREE.Camera(H.fov,H.aspect,H.near,H.far);else if(H.type=="ortho")O=new THREE.Camera,O.projectionMatrix=THREE.Matrix4.makeOrtho(H.left,H.right,H.top,H.bottom,H.near,H.far);x=H.position;H=H.target;O.position.set(x[0],x[1],x[2]);O.target.position.set(H[0],H[1],H[2]);J.cameras[z]=O}for(v in G.lights){z=G.lights[v];O=z.color!==void 0?z.color:16777215;H=z.intensity!==void 0?z.intensity:1;if(z.type=="directional")x=
|
|
1;o();d.onLoadComplete()};for(z in G.cameras){H=G.cameras[z];if(H.type=="perspective")O=new THREE.Camera(H.fov,H.aspect,H.near,H.far);else if(H.type=="ortho")O=new THREE.Camera,O.projectionMatrix=THREE.Matrix4.makeOrtho(H.left,H.right,H.top,H.bottom,H.near,H.far);x=H.position;H=H.target;O.position.set(x[0],x[1],x[2]);O.target.position.set(H[0],H[1],H[2]);J.cameras[z]=O}for(v in G.lights){z=G.lights[v];O=z.color!==void 0?z.color:16777215;H=z.intensity!==void 0?z.intensity:1;if(z.type=="directional")x=
|
|
z.direction,light=new THREE.DirectionalLight(O,H),light.position.set(x[0],x[1],x[2]),light.position.normalize();else if(z.type=="point")x=z.position,light=new THREE.PointLight(O,H),light.position.set(x[0],x[1],x[2]);J.scene.addLight(light);J.lights[v]=light}for(B in G.fogs)v=G.fogs[B],v.type=="linear"?C=new THREE.Fog(0,v.near,v.far):v.type=="exp2"&&(C=new THREE.FogExp2(0,v.density)),H=v.color,C.color.setRGB(H[0],H[1],H[2]),J.fogs[B]=C;if(J.cameras&&G.defaults.camera)J.currentCamera=J.cameras[G.defaults.camera];
|
|
z.direction,light=new THREE.DirectionalLight(O,H),light.position.set(x[0],x[1],x[2]),light.position.normalize();else if(z.type=="point")x=z.position,light=new THREE.PointLight(O,H),light.position.set(x[0],x[1],x[2]);J.scene.addLight(light);J.lights[v]=light}for(B in G.fogs)v=G.fogs[B],v.type=="linear"?C=new THREE.Fog(0,v.near,v.far):v.type=="exp2"&&(C=new THREE.FogExp2(0,v.density)),H=v.color,C.color.setRGB(H[0],H[1],H[2]),J.fogs[B]=C;if(J.cameras&&G.defaults.camera)J.currentCamera=J.cameras[G.defaults.camera];
|
|
-if(J.fogs&&G.defaults.fog)J.scene.fog=J.fogs[G.defaults.fog];H=G.defaults.bgcolor;J.bgColor=new THREE.Color;J.bgColor.setRGB(H[0],H[1],H[2]);J.bgColorAlpha=G.defaults.bgalpha;for(p in G.geometries)if(B=G.geometries[p],B.type=="bin_mesh"||B.type=="ascii_mesh")h+=1,d.onLoadStart();Q=h;for(p in G.geometries)B=G.geometries[p],B.type=="cube"?(A=new THREE.Cube(B.width,B.height,B.depth,B.segmentsWidth,B.segmentsHeight,B.segmentsDepth,null,B.flipped,B.sides),J.geometries[p]=A):B.type=="plane"?(A=new THREE.Plane(B.width,
|
|
|
|
-B.height,B.segmentsWidth,B.segmentsHeight),J.geometries[p]=A):B.type=="sphere"?(A=new THREE.Sphere(B.radius,B.segmentsWidth,B.segmentsHeight),J.geometries[p]=A):B.type=="cylinder"?(A=new THREE.Cylinder(B.numSegs,B.topRad,B.botRad,B.height,B.topOffset,B.botOffset),J.geometries[p]=A):B.type=="torus"?(A=new THREE.Torus(B.radius,B.tube,B.segmentsR,B.segmentsT),J.geometries[p]=A):B.type=="icosahedron"?(A=new THREE.Icosahedron(B.subdivisions),J.geometries[p]=A):B.type=="bin_mesh"?b.load({model:e(B.url,
|
|
|
|
-G.urlBaseType),callback:m(p)}):B.type=="ascii_mesh"?S.load({model:e(B.url,G.urlBaseType),callback:m(p)}):B.type=="embedded_mesh"&&(B=G.embeds[B.id])&&S.createModel(B,n(p),"");for(y in G.textures)if(p=G.textures[y],p.url instanceof Array){U+=p.url.length;for(b=0;b<p.url.length;b++)d.onLoadStart()}else U+=1,d.onLoadStart();W=U;for(y in G.textures){p=G.textures[y];if(p.mapping!=void 0&&THREE[p.mapping]!=void 0)p.mapping=new THREE[p.mapping];if(p.url instanceof Array){for(var b=[],P=0;P<p.url.length;P++)b[P]=
|
|
|
|
-e(p.url[P],G.urlBaseType);b=THREE.ImageUtils.loadTextureCube(b,p.mapping,$)}else{b=THREE.ImageUtils.loadTexture(e(p.url,G.urlBaseType),p.mapping,$);if(THREE[p.minFilter]!=void 0)b.minFilter=THREE[p.minFilter];if(THREE[p.magFilter]!=void 0)b.magFilter=THREE[p.magFilter]}J.textures[y]=b}for(t in G.materials){y=G.materials[t];for(F in y.parameters)if(F=="envMap"||F=="map"||F=="lightMap")y.parameters[F]=J.textures[y.parameters[F]];else if(F=="shading")y.parameters[F]=y.parameters[F]=="flat"?THREE.FlatShading:
|
|
|
|
-THREE.SmoothShading;else if(F=="blending")y.parameters[F]=THREE[y.parameters[F]]?THREE[y.parameters[F]]:THREE.NormalBlending;else if(F=="combine")y.parameters[F]=y.parameters[F]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(F=="vertexColors")if(y.parameters[F]=="face")y.parameters[F]=THREE.FaceColors;else if(y.parameters[F])y.parameters[F]=THREE.VertexColors;if(y.parameters.opacity!==void 0&&y.parameters.opacity<1)y.parameters.transparent=!0;y=new THREE[y.type](y.parameters);
|
|
|
|
-J.materials[t]=y}k();d.callbackSync(J)}}};
|
|
|
|
|
|
+if(J.fogs&&G.defaults.fog)J.scene.fog=J.fogs[G.defaults.fog];H=G.defaults.bgcolor;J.bgColor=new THREE.Color;J.bgColor.setRGB(H[0],H[1],H[2]);J.bgColorAlpha=G.defaults.bgalpha;for(p in G.geometries)if(B=G.geometries[p],B.type=="bin_mesh"||B.type=="ascii_mesh")h+=1,d.onLoadStart();Q=h;for(p in G.geometries)B=G.geometries[p],B.type=="cube"?(A=new THREE.CubeGeometry(B.width,B.height,B.depth,B.segmentsWidth,B.segmentsHeight,B.segmentsDepth,null,B.flipped,B.sides),J.geometries[p]=A):B.type=="plane"?(A=
|
|
|
|
+new THREE.PlaneGeometry(B.width,B.height,B.segmentsWidth,B.segmentsHeight),J.geometries[p]=A):B.type=="sphere"?(A=new THREE.SphereGeometry(B.radius,B.segmentsWidth,B.segmentsHeight),J.geometries[p]=A):B.type=="cylinder"?(A=new THREE.CylinderGeometry(B.numSegs,B.topRad,B.botRad,B.height,B.topOffset,B.botOffset),J.geometries[p]=A):B.type=="torus"?(A=new THREE.TorusGeometry(B.radius,B.tube,B.segmentsR,B.segmentsT),J.geometries[p]=A):B.type=="icosahedron"?(A=new THREE.IcosahedronGeometry(B.subdivisions),
|
|
|
|
+J.geometries[p]=A):B.type=="bin_mesh"?b.load({model:e(B.url,G.urlBaseType),callback:m(p)}):B.type=="ascii_mesh"?S.load({model:e(B.url,G.urlBaseType),callback:m(p)}):B.type=="embedded_mesh"&&(B=G.embeds[B.id])&&S.createModel(B,n(p),"");for(y in G.textures)if(p=G.textures[y],p.url instanceof Array){U+=p.url.length;for(b=0;b<p.url.length;b++)d.onLoadStart()}else U+=1,d.onLoadStart();W=U;for(y in G.textures){p=G.textures[y];if(p.mapping!=void 0&&THREE[p.mapping]!=void 0)p.mapping=new THREE[p.mapping];
|
|
|
|
+if(p.url instanceof Array){for(var b=[],P=0;P<p.url.length;P++)b[P]=e(p.url[P],G.urlBaseType);b=THREE.ImageUtils.loadTextureCube(b,p.mapping,$)}else{b=THREE.ImageUtils.loadTexture(e(p.url,G.urlBaseType),p.mapping,$);if(THREE[p.minFilter]!=void 0)b.minFilter=THREE[p.minFilter];if(THREE[p.magFilter]!=void 0)b.magFilter=THREE[p.magFilter]}J.textures[y]=b}for(t in G.materials){y=G.materials[t];for(F in y.parameters)if(F=="envMap"||F=="map"||F=="lightMap")y.parameters[F]=J.textures[y.parameters[F]];else if(F==
|
|
|
|
+"shading")y.parameters[F]=y.parameters[F]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(F=="blending")y.parameters[F]=THREE[y.parameters[F]]?THREE[y.parameters[F]]:THREE.NormalBlending;else if(F=="combine")y.parameters[F]=y.parameters[F]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(F=="vertexColors")if(y.parameters[F]=="face")y.parameters[F]=THREE.FaceColors;else if(y.parameters[F])y.parameters[F]=THREE.VertexColors;if(y.parameters.opacity!==void 0&&y.parameters.opacity<
|
|
|
|
+1)y.parameters.transparent=!0;y=new THREE[y.type](y.parameters);J.materials[t]=y}k();d.callbackSync(J)}}};
|
|
THREE.MarchingCubes=function(b,c){THREE.Object3D.call(this);this.materials=c instanceof Array?c:[c];this.init=function(b){this.isolation=80;this.size=b;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(b,c){THREE.Object3D.call(this);this.materials=c instanceof Array?c:[c];this.init=function(b){this.isolation=80;this.size=b;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(b,c,g){return b+(c-b)*g};this.VIntX=function(b,c,g,f,j,k,m,n,o,p){j=(j-o)/(p-o);o=this.normal_cache;c[f]=k+j*this.delta;c[f+1]=m;c[f+2]=n;g[f]=this.lerp(o[b],o[b+3],j);g[f+1]=this.lerp(o[b+1],o[b+4],j);g[f+2]=this.lerp(o[b+2],o[b+5],j)};this.VIntY=function(b,c,g,f,j,k,m,n,o,p){j=(j-o)/(p-o);o=this.normal_cache;c[f]=k;c[f+1]=m+j*this.delta;c[f+
|
|
0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,c,g){return b+(c-b)*g};this.VIntX=function(b,c,g,f,j,k,m,n,o,p){j=(j-o)/(p-o);o=this.normal_cache;c[f]=k+j*this.delta;c[f+1]=m;c[f+2]=n;g[f]=this.lerp(o[b],o[b+3],j);g[f+1]=this.lerp(o[b+1],o[b+4],j);g[f+2]=this.lerp(o[b+2],o[b+5],j)};this.VIntY=function(b,c,g,f,j,k,m,n,o,p){j=(j-o)/(p-o);o=this.normal_cache;c[f]=k;c[f+1]=m+j*this.delta;c[f+
|
|
2]=n;c=b+this.yd*3;g[f]=this.lerp(o[b],o[c],j);g[f+1]=this.lerp(o[b+1],o[c+1],j);g[f+2]=this.lerp(o[b+2],o[c+2],j)};this.VIntZ=function(b,c,g,f,j,k,m,n,o,p){j=(j-o)/(p-o);o=this.normal_cache;c[f]=k;c[f+1]=m;c[f+2]=n+j*this.delta;c=b+this.zd*3;g[f]=this.lerp(o[b],o[c],j);g[f+1]=this.lerp(o[b+1],o[c+1],j);g[f+2]=this.lerp(o[b+2],o[c+2],j)};this.compNorm=function(b){var c=b*3;this.normal_cache[c]==0&&(this.normal_cache[c]=this.field[b-1]-this.field[b+1],this.normal_cache[c+1]=this.field[b-this.yd]-this.field[b+
|
|
2]=n;c=b+this.yd*3;g[f]=this.lerp(o[b],o[c],j);g[f+1]=this.lerp(o[b+1],o[c+1],j);g[f+2]=this.lerp(o[b+2],o[c+2],j)};this.VIntZ=function(b,c,g,f,j,k,m,n,o,p){j=(j-o)/(p-o);o=this.normal_cache;c[f]=k;c[f+1]=m;c[f+2]=n+j*this.delta;c=b+this.zd*3;g[f]=this.lerp(o[b],o[c],j);g[f+1]=this.lerp(o[b+1],o[c+1],j);g[f+2]=this.lerp(o[b+2],o[c+2],j)};this.compNorm=function(b){var c=b*3;this.normal_cache[c]==0&&(this.normal_cache[c]=this.field[b-1]-this.field[b+1],this.normal_cache[c+1]=this.field[b-this.yd]-this.field[b+
|
|
@@ -542,7 +542,7 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
|
|
4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
|
|
4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
|
|
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,
|
|
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,
|
|
2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);
|
|
2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);
|
|
-THREE.Trident=function(b){function c(c){return new THREE.Mesh(new THREE.Cylinder(30,0.1,b.length/20,b.length/5),new THREE.MeshBasicMaterial({color:c}))}function d(b,c){var d=new THREE.Geometry;d.vertices=[new THREE.Vertex,new THREE.Vertex(b)];return new THREE.Line(d,new THREE.LineBasicMaterial({color:c}))}THREE.Object3D.call(this);var e=Math.PI/2,g,b=b||THREE.Trident.defaultParams;if(b!==THREE.Trident.defaultParams)for(g in THREE.Trident.defaultParams)b.hasOwnProperty(g)||(b[g]=THREE.Trident.defaultParams[g]);
|
|
|
|
|
|
+THREE.Trident=function(b){function c(c){return new THREE.Mesh(new THREE.CylinderGeometry(30,0.1,b.length/20,b.length/5),new THREE.MeshBasicMaterial({color:c}))}function d(b,c){var d=new THREE.Geometry;d.vertices=[new THREE.Vertex,new THREE.Vertex(b)];return new THREE.Line(d,new THREE.LineBasicMaterial({color:c}))}THREE.Object3D.call(this);var e=Math.PI/2,g,b=b||THREE.Trident.defaultParams;if(b!==THREE.Trident.defaultParams)for(g in THREE.Trident.defaultParams)b.hasOwnProperty(g)||(b[g]=THREE.Trident.defaultParams[g]);
|
|
this.scale=new THREE.Vector3(b.scale,b.scale,b.scale);this.addChild(d(new THREE.Vector3(b.length,0,0),b.xAxisColor));this.addChild(d(new THREE.Vector3(0,b.length,0),b.yAxisColor));this.addChild(d(new THREE.Vector3(0,0,b.length),b.zAxisColor));if(b.showArrows)g=c(b.xAxisColor),g.rotation.y=-e,g.position.x=b.length,this.addChild(g),g=c(b.yAxisColor),g.rotation.x=e,g.position.y=b.length,this.addChild(g),g=c(b.zAxisColor),g.rotation.y=Math.PI,g.position.z=b.length,this.addChild(g)};
|
|
this.scale=new THREE.Vector3(b.scale,b.scale,b.scale);this.addChild(d(new THREE.Vector3(b.length,0,0),b.xAxisColor));this.addChild(d(new THREE.Vector3(0,b.length,0),b.yAxisColor));this.addChild(d(new THREE.Vector3(0,0,b.length),b.zAxisColor));if(b.showArrows)g=c(b.xAxisColor),g.rotation.y=-e,g.position.x=b.length,this.addChild(g),g=c(b.yAxisColor),g.rotation.x=e,g.position.y=b.length,this.addChild(g),g=c(b.zAxisColor),g.rotation.y=Math.PI,g.position.z=b.length,this.addChild(g)};
|
|
THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.Trident.defaultParams={xAxisColor:16711680,yAxisColor:65280,zAxisColor:255,showArrows:!0,length:100,scale:1};THREE.PlaneCollider=function(b,c){this.point=b;this.normal=c};THREE.SphereCollider=function(b,c){this.center=b;this.radius=c;this.radiusSq=c*c};THREE.BoxCollider=function(b,c){this.min=b;this.max=c;this.dynamic=!0;this.normal=new THREE.Vector3};
|
|
THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.Trident.defaultParams={xAxisColor:16711680,yAxisColor:65280,zAxisColor:255,showArrows:!0,length:100,scale:1};THREE.PlaneCollider=function(b,c){this.point=b;this.normal=c};THREE.SphereCollider=function(b,c){this.center=b;this.radius=c;this.radiusSq=c*c};THREE.BoxCollider=function(b,c){this.min=b;this.max=c;this.dynamic=!0;this.normal=new THREE.Vector3};
|
|
THREE.MeshCollider=function(b,c){this.mesh=b;this.box=c;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;THREE.CollisionSystem.prototype.merge=function(b){this.colliders=this.colliders.concat(b.colliders);this.hits=this.hits.concat(b.hits)};
|
|
THREE.MeshCollider=function(b,c){this.mesh=b;this.box=c;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;THREE.CollisionSystem.prototype.merge=function(b){this.colliders=this.colliders.concat(b.colliders);this.hits=this.hits.concat(b.hits)};
|
|
@@ -562,7 +562,7 @@ THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionU
|
|
THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))};
|
|
THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))};
|
|
if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,d=this.setSize,e=this.render,g=new THREE.Camera,f=new THREE.Camera,b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},j=new THREE.WebGLRenderTarget(512,512,b),k=new THREE.WebGLRenderTarget(512,512,b),m=new THREE.Camera(53,1,1,1E4);m.position.z=2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:j},mapRight:{type:"t",value:1,
|
|
if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,d=this.setSize,e=this.render,g=new THREE.Camera,f=new THREE.Camera,b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},j=new THREE.WebGLRenderTarget(512,512,b),k=new THREE.WebGLRenderTarget(512,512,b),m=new THREE.Camera(53,1,1,1E4);m.position.z=2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:j},mapRight:{type:"t",value:1,
|
|
texture:k}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});var n=
|
|
texture:k}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});var n=
|
|
-new THREE.Scene;n.addObject(new THREE.Mesh(new THREE.Plane(2,2),_material));this.setSize=function(b,e){d.call(c,b,e);j.width=b;j.height=e;k.width=b;k.height=e};this.render=function(b,d){g.projectionMatrix=d.projectionMatrix;g.position.copy(d.position);g.target.position.copy(d.target.position);g.translateX(-10);f.projectionMatrix=d.projectionMatrix;f.position.copy(d.position);f.target.position.copy(d.target.position);f.translateX(10);e.call(c,b,g,j,!0);e.call(c,b,f,k,!0);e.call(c,n,m)}},THREE.AnaglyphWebGLRenderer.prototype=
|
|
|
|
|
|
+new THREE.Scene;n.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,e){d.call(c,b,e);j.width=b;j.height=e;k.width=b;k.height=e};this.render=function(b,d){g.projectionMatrix=d.projectionMatrix;g.position.copy(d.position);g.target.position.copy(d.target.position);g.translateX(-10);f.projectionMatrix=d.projectionMatrix;f.position.copy(d.position);f.target.position.copy(d.target.position);f.translateX(10);e.call(c,b,g,j,!0);e.call(c,b,f,k,!0);e.call(c,n,m)}},THREE.AnaglyphWebGLRenderer.prototype=
|
|
new THREE.WebGLRenderer,THREE.AnaglyphWebGLRenderer.prototype.constructor=THREE.AnaglyphWebGLRenderer;
|
|
new THREE.WebGLRenderer,THREE.AnaglyphWebGLRenderer.prototype.constructor=THREE.AnaglyphWebGLRenderer;
|
|
if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,d=this.setSize,e=this.render,g,f,j=new THREE.Camera,k=new THREE.Camera;c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(b,e){d.call(c,b,e);g=b/2;f=e};this.render=function(b,d){this.clear();j.fov=d.fov;j.aspect=0.5*d.aspect;j.near=d.near;j.far=d.far;
|
|
if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,d=this.setSize,e=this.render,g,f,j=new THREE.Camera,k=new THREE.Camera;c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(b,e){d.call(c,b,e);g=b/2;f=e};this.render=function(b,d){this.clear();j.fov=d.fov;j.aspect=0.5*d.aspect;j.near=d.near;j.far=d.far;
|
|
j.updateProjectionMatrix();j.position.copy(d.position);j.target.position.copy(d.target.position);j.translateX(c.separation);k.projectionMatrix=j.projectionMatrix;k.position.copy(d.position);k.target.position.copy(d.target.position);k.translateX(-c.separation);this.setViewport(0,0,g,f);e.call(c,b,j);this.setViewport(g,0,g,f);e.call(c,b,k,!1)}},THREE.CrosseyedWebGLRenderer.prototype=new THREE.WebGLRenderer,THREE.CrosseyedWebGLRenderer.prototype.constructor=THREE.CrosseyedWebGLRenderer;
|
|
j.updateProjectionMatrix();j.position.copy(d.position);j.target.position.copy(d.target.position);j.translateX(c.separation);k.projectionMatrix=j.projectionMatrix;k.position.copy(d.position);k.target.position.copy(d.target.position);k.translateX(-c.separation);this.setViewport(0,0,g,f);e.call(c,b,j);this.setViewport(g,0,g,f);e.call(c,b,k,!1)}},THREE.CrosseyedWebGLRenderer.prototype=new THREE.WebGLRenderer,THREE.CrosseyedWebGLRenderer.prototype.constructor=THREE.CrosseyedWebGLRenderer;
|