|
@@ -280,9 +280,7 @@ THREE.Detector={canvas:!!document.createElement("canvas").getContext,webgl:windo
|
|
c;c=d.style;c.fontFamily="monospace";c.fontSize="13px";c.textAlign="center";c.background="#eee";c.color="#000";c.padding="1em";c.width="475px";c.margin="5em auto 0";a.appendChild(d);b.appendChild(a);return d}};
|
|
c;c=d.style;c.fontFamily="monospace";c.fontSize="13px";c.textAlign="center";c.background="#eee";c.color="#000";c.padding="1em";c.width="475px";c.margin="5em auto 0";a.appendChild(d);b.appendChild(a);return d}};
|
|
var GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,d=a.vertices.length,f=c?b.geometry:b,g=a.vertices,h=f.vertices,k=a.faces,j=f.faces,m=a.uvs;f=f.uvs;c&&b.autoUpdateMatrix&&b.updateMatrix();for(var o=0,w=h.length;o<w;o++){var u=new THREE.Vertex(h[o].position.clone());c&&b.localMatrix.multiplyVector3(u.position);g.push(u)}o=0;for(w=j.length;o<w;o++){h=j[o];var t,x=h.vertexNormals;if(h instanceof THREE.Face3)t=new THREE.Face3(h.a+d,h.b+d,h.c+d);else h instanceof THREE.Face4&&(t=new THREE.Face4(h.a+
|
|
var GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,d=a.vertices.length,f=c?b.geometry:b,g=a.vertices,h=f.vertices,k=a.faces,j=f.faces,m=a.uvs;f=f.uvs;c&&b.autoUpdateMatrix&&b.updateMatrix();for(var o=0,w=h.length;o<w;o++){var u=new THREE.Vertex(h[o].position.clone());c&&b.localMatrix.multiplyVector3(u.position);g.push(u)}o=0;for(w=j.length;o<w;o++){h=j[o];var t,x=h.vertexNormals;if(h instanceof THREE.Face3)t=new THREE.Face3(h.a+d,h.b+d,h.c+d);else h instanceof THREE.Face4&&(t=new THREE.Face4(h.a+
|
|
d,h.b+d,h.c+d,h.d+d));t.centroid.copy(h.centroid);t.normal.copy(h.normal);c=0;for(g=x.length;c<g;c++){u=x[c];t.vertexNormals.push(u.clone())}t.materials=h.materials.slice();k.push(t)}o=0;for(w=f.length;o<w;o++){d=f[o];k=[];c=0;for(g=d.length;c<g;c++)k.push(new THREE.UV(d[c].u,d[c].v));m.push(k)}}},ImageUtils={loadTexture:function(a,b,c){var d=new Image;d.onload=function(){this.loaded=!0;c&&c(this)};d.src=a;return new THREE.Texture(d,b)},loadArray:function(a,b){var c,d,f=[];c=f.loadCount=0;for(d=a.length;c<
|
|
d,h.b+d,h.c+d,h.d+d));t.centroid.copy(h.centroid);t.normal.copy(h.normal);c=0;for(g=x.length;c<g;c++){u=x[c];t.vertexNormals.push(u.clone())}t.materials=h.materials.slice();k.push(t)}o=0;for(w=f.length;o<w;o++){d=f[o];k=[];c=0;for(g=d.length;c<g;c++)k.push(new THREE.UV(d[c].u,d[c].v));m.push(k)}}},ImageUtils={loadTexture:function(a,b,c){var d=new Image;d.onload=function(){this.loaded=!0;c&&c(this)};d.src=a;return new THREE.Texture(d,b)},loadArray:function(a,b){var c,d,f=[];c=f.loadCount=0;for(d=a.length;c<
|
|
-d;++c){f[c]=new Image;f[c].loaded=0;f[c].onload=function(){f.loadCount+=1;this.loaded=!0;b&&b(this)};f[c].src=a[c]}return f}};
|
|
|
|
-THREE.requestAnimationFrame=function(a,b){if(!THREE.requestAnimationFrameImpl_)THREE.requestAnimationFrameImpl_=function(){for(var c=[a,window],d=["requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","operaRequestAnimationFrame","requestAnimationFrame"],f=[function(m){return function(o,w){o[m].call(o,w)}},function(m){return function(o,w){window[m].call(window,w)}}],g=0;g<c.length;++g)for(var h=c[g],k=0;k<d.length;++k){var j=d[k];if(h[j]){console.log("using ",j);return f[g](j)}}console.log("using window.setTimeout");
|
|
|
|
-return function(m,o){window.setTimeout(o,1E3/70)}}();THREE.requestAnimationFrameImpl_(a,b)};
|
|
|
|
|
|
+d;++c){f[c]=new Image;f[c].loaded=0;f[c].onload=function(){f.loadCount+=1;this.loaded=!0;b&&b(this)};f[c].src=a[c]}return f}};if(!window.requestAnimationFrame)window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();
|
|
var SceneUtils={loadScene:function(a,b,c,d){a=new Worker(a);a.postMessage(0);a.onmessage=function(f){function g(){for(o in L.objects)if(!G.objects[o]){A=L.objects[o];if(q=G.geometries[A.geometry]){ba=[];for(i=0;i<A.materials.length;i++)ba[i]=G.materials[A.materials[i]];F=A.position;r=A.rotation;s=A.scale;object=new THREE.Mesh(q,ba);object.position.set(F[0],F[1],F[2]);object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=A.visible;G.scene.addObject(object);G.objects[o]=
|
|
var SceneUtils={loadScene:function(a,b,c,d){a=new Worker(a);a.postMessage(0);a.onmessage=function(f){function g(){for(o in L.objects)if(!G.objects[o]){A=L.objects[o];if(q=G.geometries[A.geometry]){ba=[];for(i=0;i<A.materials.length;i++)ba[i]=G.materials[A.materials[i]];F=A.position;r=A.rotation;s=A.scale;object=new THREE.Mesh(q,ba);object.position.set(F[0],F[1],F[2]);object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=A.visible;G.scene.addObject(object);G.objects[o]=
|
|
object}}}function h(U){return function(na){G.geometries[U]=na;g();V-=1;k()}}function k(){d({total_models:Y,total_textures:Z,loaded_models:Y-V,loaded_textures:Z-S},G);V==0&&S==0&&c(G)}var j,m,o,w,u,t,x,A,F,v,I,q,J,e,ba,L,M,V,S,Y,Z,G;L=f.data;M=new THREE.Loader;S=V=0;G={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{}};f=function(){S-=1;k()};for(u in L.cameras){v=L.cameras[u];if(v.type=="perspective")J=new THREE.Camera(v.fov,v.aspect,v.near,v.far);
|
|
object}}}function h(U){return function(na){G.geometries[U]=na;g();V-=1;k()}}function k(){d({total_models:Y,total_textures:Z,loaded_models:Y-V,loaded_textures:Z-S},G);V==0&&S==0&&c(G)}var j,m,o,w,u,t,x,A,F,v,I,q,J,e,ba,L,M,V,S,Y,Z,G;L=f.data;M=new THREE.Loader;S=V=0;G={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{}};f=function(){S-=1;k()};for(u in L.cameras){v=L.cameras[u];if(v.type=="perspective")J=new THREE.Camera(v.fov,v.aspect,v.near,v.far);
|
|
else if(v.type=="ortho"){J=new THREE.Camera;J.projectionMatrix=THREE.Matrix4.makeOrtho(v.left,v.right,v.top,v.bottom,v.near,v.far)}F=v.position;v=v.target;J.position.set(F[0],F[1],F[2]);J.target.position.set(v[0],v[1],v[2]);G.cameras[u]=J}for(w in L.lights){u=L.lights[w];if(u.type=="directional"){F=u.direction;light=new THREE.DirectionalLight;light.position.set(F[0],F[1],F[2]);light.position.normalize()}else if(u.type=="point"){F=u.position;light=new THREE.PointLight;light.position.set(F[0],F[1],
|
|
else if(v.type=="ortho"){J=new THREE.Camera;J.projectionMatrix=THREE.Matrix4.makeOrtho(v.left,v.right,v.top,v.bottom,v.near,v.far)}F=v.position;v=v.target;J.position.set(F[0],F[1],F[2]);J.target.position.set(v[0],v[1],v[2]);G.cameras[u]=J}for(w in L.lights){u=L.lights[w];if(u.type=="directional"){F=u.direction;light=new THREE.DirectionalLight;light.position.set(F[0],F[1],F[2]);light.position.normalize()}else if(u.type=="point"){F=u.position;light=new THREE.PointLight;light.position.set(F[0],F[1],
|