|
@@ -527,7 +527,7 @@ THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THRE
|
|
|
THREE.IcosahedronGeometry=function(a){function b(a,b,c){var d=Math.sqrt(a*a+b*b+c*c);return e.vertices.push(new THREE.Vertex(new THREE.Vector3(a/d,b/d,c/d)))-1}function c(a,b,c,d){var f=e.vertices[a].position,g=e.vertices[b].position,h=e.vertices[c].position,a=new THREE.Face3(a,b,c);a.vertexNormals.push(f.clone().normalize(),g.clone().normalize(),h.clone().normalize());d.faces.push(a);d.faceVertexUvs[0].push([new THREE.UV(1-0.5*((Math.atan2(f.z,f.x)+Math.PI)%Math.PI/Math.PI),0.5-f.y/2),new THREE.UV(1-
|
|
|
0.5*((Math.atan2(g.z,g.x)+Math.PI)%Math.PI/Math.PI),0.5-g.y/2),new THREE.UV(1-0.5*((Math.atan2(h.z,h.x)+Math.PI)%Math.PI/Math.PI),0.5-h.y/2)])}function d(a,c){var d=e.vertices[a].position,f=e.vertices[c].position;return b((d.x+f.x)/2,(d.y+f.y)/2,(d.z+f.z)/2)}var e=this,f=new THREE.Geometry;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;b(-1,a,0);b(1,a,0);b(-1,-a,0);b(1,-a,0);b(0,-1,a);b(0,1,a);b(0,-1,-a);b(0,1,-a);b(a,0,-1);b(a,0,1);b(-a,0,-1);b(-a,0,1);c(0,11,5,f);c(0,5,1,
|
|
|
f);c(0,1,7,f);c(0,7,10,f);c(0,10,11,f);c(1,5,9,f);c(5,11,4,f);c(11,10,2,f);c(10,7,6,f);c(7,1,8,f);c(3,9,4,f);c(3,4,2,f);c(3,2,6,f);c(3,6,8,f);c(3,8,9,f);c(4,9,5,f);c(2,4,11,f);c(6,2,10,f);c(8,6,7,f);c(9,8,1,f);for(var g=0;g<this.subdivisions;g++){var a=new THREE.Geometry,h;for(h in f.faces){var i=d(f.faces[h].a,f.faces[h].b),j=d(f.faces[h].b,f.faces[h].c),l=d(f.faces[h].c,f.faces[h].a);c(f.faces[h].a,i,l,a);c(f.faces[h].b,j,i,a);c(f.faces[h].c,l,j,a);c(i,j,l,a)}f.faces=a.faces;f.faceVertexUvs[0]=
|
|
|
-a.faceVertexUvs[0]}e.faces=f.faces;e.faceVertexUvs[0]=f.faceVertexUvs[0];this.computeCentroids();this.computeFaceNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
|
|
|
+a.faceVertexUvs[0]}e.faces=f.faces;e.faceVertexUvs[0]=f.faceVertexUvs[0];this.mergeVertices();this.computeCentroids();this.computeFaceNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
|
|
|
THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],e=[],f=[],g=(new THREE.Matrix4).setRotationZ(b),h=0;h<a.length;h++)this.vertices.push(new THREE.Vertex(a[h])),c[h]=a[h].clone(),d[h]=this.vertices.length-1;for(var i=0;i<=this.angle+0.0010;i+=b){for(h=0;h<c.length;h++)i<this.angle?(c[h]=g.multiplyVector3(c[h].clone()),this.vertices.push(new THREE.Vertex(c[h])),e[h]=this.vertices.length-1):e=f;0==i&&(f=d);
|
|
|
for(h=0;h<d.length-1;h++)this.faces.push(new THREE.Face4(e[h],e[h+1],d[h+1],d[h])),this.faceVertexUvs[0].push([new THREE.UV(1-i/this.angle,h/a.length),new THREE.UV(1-i/this.angle,(h+1)/a.length),new THREE.UV(1-(i-b)/this.angle,(h+1)/a.length),new THREE.UV(1-(i-b)/this.angle,h/a.length)]);d=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
|
|
|
THREE.OctahedronGeometry=function(a,b){function c(b){var c=b.clone().normalize(),c=new THREE.Vertex(c.clone().multiplyScalar(a));c.index=g.vertices.push(c)-1;var d=Math.atan2(b.z,-b.x)/2/Math.PI+0.5,b=Math.atan2(-b.y,Math.sqrt(b.x*b.x+b.z*b.z))/Math.PI+0.5;c.uv=new THREE.UV(d,b);return c}function d(a,b,c,h){1>h?(h=new THREE.Face3(a.index,b.index,c.index,[a.position,b.position,c.position]),h.centroid.addSelf(a.position).addSelf(b.position).addSelf(c.position).divideScalar(3),h.normal=h.centroid.clone().normalize(),
|
|
@@ -574,7 +574,7 @@ j.lightMap,l.enableAO.value=!0;l.uDiffuseColor.value.setHex(j.color);l.uSpecular
|
|
|
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,b,c,d){if(a instanceof Object)console.warn("DEPRECATED: BinaryLoader( parameters ) is now BinaryLoader( url, callback, texturePath, binaryPath )."),d=a,a=d.model,b=d.callback,c=d.texture_path,d=d.bin_path;var c=c?c:this.extractUrlbase(a),d=d?d:this.extractUrlbase(a),e=this.showProgress?THREE.Loader.prototype.updateProgress:null;this.onLoadStart();this.loadAjaxJSON(this,a,b,c,d,e)};
|
|
|
THREE.BinaryLoader.prototype.loadAjaxJSON=function(a,b,c,d,e,f){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(4==g.readyState)if(200==g.status||0==g.status)try{var h=JSON.parse(g.responseText);void 0===h.metadata||void 0===h.metadata.formatVersion||3!==h.metadata.formatVersion?console.error("Deprecated file format."):a.loadAjaxBuffers(h,c,e,d,f)}catch(i){console.error(i),console.warn("DEPRECATED: ["+b+"] seems to be using old model format")}else console.error("Couldn't load ["+b+"] ["+
|
|
|
-g.status+"]")};g.open("GET",b,!0);g.overrideMimeType("text/plain; charset=x-user-defined");g.setRequestHeader("Content-Type","text/plain");g.send(null)};
|
|
|
+g.status+"]")};g.open("GET",b,!0);g.overrideMimeType&&g.overrideMimeType("text/plain; charset=x-user-defined");g.setRequestHeader("Content-Type","text/plain");g.send(null)};
|
|
|
THREE.BinaryLoader.prototype.loadAjaxBuffers=function(a,b,c,d,e){var f=new XMLHttpRequest,g=c+"/"+a.buffers,h=0;f.onreadystatechange=function(){4==f.readyState?200==f.status||0==f.status?THREE.BinaryLoader.prototype.createBinModel(f.response,b,d,a.materials):console.error("Couldn't load ["+g+"] ["+f.status+"]"):3==f.readyState?e&&(0==h&&(h=f.getResponseHeader("Content-Length")),e({total:h,loaded:f.responseText.length})):2==f.readyState&&(h=f.getResponseHeader("Content-Length"))};f.open("GET",g,!0);
|
|
|
f.responseType="arraybuffer";f.send(null)};
|
|
|
THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,d){var e=function(b){var c,e,i,j,l,o,p,n,q,m,r,s,t,u,x,v;function A(a){return a%4?4-a%4:0}function D(a,b){return(new Uint8Array(a,b,1))[0]}function E(a,b){return(new Uint32Array(a,b,1))[0]}function C(b,c){var d,e,f,g,h,i,k,j,l=new Uint32Array(a,c,3*b);for(d=0;d<b;d++){e=l[3*d];f=l[3*d+1];g=l[3*d+2];h=H[2*e];e=H[2*e+1];i=H[2*f];k=H[2*f+1];f=H[2*g];j=H[2*g+1];g=P.faceVertexUvs[0];var m=[];m.push(new THREE.UV(h,e));m.push(new THREE.UV(i,k));
|
|
@@ -653,7 +653,7 @@ function(){if(4==f.readyState){if(0==f.status||200==f.status)f.responseXML?(ca=c
|
|
|
THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;
|
|
|
THREE.JSONLoader.prototype.load=function(a,b,c){if(a instanceof Object)console.warn("DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath )."),c=a,a=c.model,b=c.callback,c=c.texture_path;c=c?c:this.extractUrlbase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
|
|
|
THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(4==f.readyState)if(200==f.status||0==f.status){try{var h=JSON.parse(f.responseText)}catch(i){console.warn("DEPRECATED: ["+b+"] seems to be using old model format")}a.createModel(h,c,d);a.onLoadComplete()}else console.error("Couldn't load ["+b+"] ["+f.status+"]");else 3==f.readyState?e&&(0==g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):
|
|
|
-2==f.readyState&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.overrideMimeType("text/plain; charset=x-user-defined");f.setRequestHeader("Content-Type","text/plain");f.send(null)};
|
|
|
+2==f.readyState&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined");f.setRequestHeader("Content-Type","text/plain");f.send(null)};
|
|
|
THREE.JSONLoader.prototype.createModel=function(a,b,c){var d=new THREE.Geometry,e=void 0!==a.scale?1/a.scale:1;this.initMaterials(d,a.materials,c);(function(b){if(void 0===a.metadata||void 0===a.metadata.formatVersion||3!==a.metadata.formatVersion)console.error("Deprecated file format.");else{var c,e,i,j,l,o,p,n,q,m,r,s,t,u,x=a.faces;o=a.vertices;var v=a.normals,A=a.colors,D=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&D++;for(c=0;c<D;c++)d.faceUvs[c]=[],d.faceVertexUvs[c]=[];j=0;for(l=o.length;j<
|
|
|
l;)p=new THREE.Vertex,p.position.x=o[j++]*b,p.position.y=o[j++]*b,p.position.z=o[j++]*b,d.vertices.push(p);j=0;for(l=x.length;j<l;){b=x[j++];o=b&1;i=b&2;c=b&4;e=b&8;n=b&16;p=b&32;m=b&64;b&=128;o?(r=new THREE.Face4,r.a=x[j++],r.b=x[j++],r.c=x[j++],r.d=x[j++],o=4):(r=new THREE.Face3,r.a=x[j++],r.b=x[j++],r.c=x[j++],o=3);if(i)i=x[j++],r.materialIndex=i;i=d.faces.length;if(c)for(c=0;c<D;c++)s=a.uvs[c],q=x[j++],u=s[2*q],q=s[2*q+1],d.faceUvs[c][i]=new THREE.UV(u,q);if(e)for(c=0;c<D;c++){s=a.uvs[c];t=[];
|
|
|
for(e=0;e<o;e++)q=x[j++],u=s[2*q],q=s[2*q+1],t[e]=new THREE.UV(u,q);d.faceVertexUvs[c][i]=t}if(n)n=3*x[j++],e=new THREE.Vector3,e.x=v[n++],e.y=v[n++],e.z=v[n],r.normal=e;if(p)for(c=0;c<o;c++)n=3*x[j++],e=new THREE.Vector3,e.x=v[n++],e.y=v[n++],e.z=v[n],r.vertexNormals.push(e);if(m)p=x[j++],p=new THREE.Color(A[p]),r.color=p;if(b)for(c=0;c<o;c++)p=x[j++],p=new THREE.Color(A[p]),r.vertexColors.push(p);d.faces.push(r)}}})(e);(function(){var b,c,e,i;if(a.skinWeights)for(b=0,c=a.skinWeights.length;b<c;b+=
|
|
@@ -661,7 +661,7 @@ for(e=0;e<o;e++)q=x[j++],u=s[2*q],q=s[2*q+1],t[e]=new THREE.UV(u,q);d.faceVertex
|
|
|
q=a.morphTargets[c].vertices;for(i=0,j=q.length;i<j;i+=3)l=q[i]*b,o=q[i+1]*b,p=q[i+2]*b,n.push(new THREE.Vertex(new THREE.Vector3(l,o,p)))}}if(void 0!==a.morphColors)for(c=0,e=a.morphColors.length;c<e;c++){d.morphColors[c]={};d.morphColors[c].name=a.morphColors[c].name;d.morphColors[c].colors=[];j=d.morphColors[c].colors;l=a.morphColors[c].colors;for(b=0,i=l.length;b<i;b+=3)o=new THREE.Color(16755200),o.setRGB(l[b],l[b+1],l[b+2]),j.push(o)}})(e);d.computeCentroids();d.computeFaceNormals();this.hasNormals(d)&&
|
|
|
d.computeTangents();b(d)};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};THREE.SceneLoader.prototype.constructor=THREE.SceneLoader;
|
|
|
THREE.SceneLoader.prototype.load=function(a,b){var c=this,d=new XMLHttpRequest;d.onreadystatechange=function(){if(4==d.readyState)if(200==d.status||0==d.status)try{var e=JSON.parse(d.responseText);void 0===e.metadata||void 0===e.metadata.formatVersion||3!==e.metadata.formatVersion?console.error("Deprecated file format."):c.createScene(e,b,a)}catch(f){console.error(f),console.warn("DEPRECATED: ["+a+"] seems to be using old model format")}else console.error("Couldn't load ["+a+"] ["+d.status+"]")};
|
|
|
-d.open("GET",a,!0);d.overrideMimeType("text/plain; charset=x-user-defined");d.setRequestHeader("Content-Type","text/plain");d.send(null)};
|
|
|
+d.open("GET",a,!0);d.overrideMimeType&&d.overrideMimeType("text/plain; charset=x-user-defined");d.setRequestHeader("Content-Type","text/plain");d.send(null)};
|
|
|
THREE.SceneLoader.prototype.createScene=function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:j+"/"+a}function e(){var a;for(p in N.objects)if(!y.objects[p])if(s=N.objects[p],void 0!==s.geometry){if(F=y.geometries[s.geometry]){a=!1;for(I=0;I<s.materials.length;I++)R=y.materials[s.materials[I]],a=R instanceof THREE.ShaderMaterial;a&&F.computeTangents();x=s.position;v=s.rotation;A=s.quaternion;D=s.scale;A=0;0==R.length&&(R=new THREE.MeshFaceMaterial);1<R.length&&(R=new THREE.MeshFaceMaterial);
|
|
|
a=new THREE.Mesh(F,R);a.name=p;a.position.set(x[0],x[1],x[2]);A?(a.quaternion.set(A[0],A[1],A[2],A[3]),a.useQuaternion=!0):a.rotation.set(v[0],v[1],v[2]);a.scale.set(D[0],D[1],D[2]);a.visible=s.visible;y.scene.add(a);y.objects[p]=a;if(s.meshCollider){var b=THREE.CollisionUtils.MeshColliderWBox(a);y.scene.collisions.colliders.push(b)}if(s.castsShadow)b=new THREE.ShadowVolume(F),y.scene.add(b),b.position=a.position,b.rotation=a.rotation,b.scale=a.scale;s.trigger&&"none"!=s.trigger.toLowerCase()&&(b=
|
|
|
{type:s.trigger,object:s},y.triggers[a.name]=b)}}else x=s.position,v=s.rotation,A=s.quaternion,D=s.scale,A=0,a=new THREE.Object3D,a.name=p,a.position.set(x[0],x[1],x[2]),A?(a.quaternion.set(A[0],A[1],A[2],A[3]),a.useQuaternion=!0):a.rotation.set(v[0],v[1],v[2]),a.scale.set(D[0],D[1],D[2]),a.visible=void 0!==s.visible?s.visible:!1,y.scene.add(a),y.objects[p]=a,y.empties[p]=a,s.trigger&&"none"!=s.trigger.toLowerCase()&&(b={type:s.trigger,object:s},y.triggers[a.name]=b)}function f(a){return function(b){y.geometries[a]=
|