|
@@ -448,7 +448,7 @@ h;y.position.y=p[o++]/h;y.position.z=p[o++]/h;f.vertices.push(y)}o=0;for(t=R.len
|
|
|
D=B[A*2];A=B[A*2+1];W[k]=new THREE.UV(D,A)}f.faceVertexUvs[j][m]=W}if(u){u=R[o++]*3;k=new THREE.Vector3;k.x=L[u++];k.y=L[u++];k.z=L[u];H.normal=k}if(y)for(j=0;j<p;j++){u=R[o++]*3;k=new THREE.Vector3;k.x=L[u++];k.y=L[u++];k.z=L[u];H.vertexNormals.push(k)}if(I){y=R[o++];y=new THREE.Color(Q[y]);H.color=y}if(h)for(j=0;j<p;j++){y=R[o++];y=new THREE.Color(Q[y]);H.vertexColors.push(y)}f.faces.push(H)}}})(g);(function(){var h,j,k,m;if(b.skinWeights){h=0;for(j=b.skinWeights.length;h<j;h+=2){k=b.skinWeights[h];
|
|
|
m=b.skinWeights[h+1];f.skinWeights.push(new THREE.Vector4(k,m,0,0))}}if(b.skinIndices){h=0;for(j=b.skinIndices.length;h<j;h+=2){k=b.skinIndices[h];m=b.skinIndices[h+1];f.skinIndices.push(new THREE.Vector4(k,m,0,0))}}f.bones=b.bones;f.animation=b.animation})();(function(h){if(b.morphTargets!==undefined){var j,k,m,o,t,p,y,u,A;j=0;for(k=b.morphTargets.length;j<k;j++){f.morphTargets[j]={};f.morphTargets[j].name=b.morphTargets[j].name;f.morphTargets[j].vertices=[];u=f.morphTargets[j].vertices;A=b.morphTargets[j].vertices;
|
|
|
m=0;for(o=A.length;m<o;m+=3){t=A[m]/h;p=A[m+1]/h;y=A[m+2]/h;u.push(new THREE.Vertex(new THREE.Vector3(t,p,y)))}}}if(b.morphColors!==undefined){j=0;for(k=b.morphColors.length;j<k;j++){f.morphColors[j]={};f.morphColors[j].name=b.morphColors[j].name;f.morphColors[j].colors=[];o=f.morphColors[j].colors;t=b.morphColors[j].colors;h=0;for(m=t.length;h<m;h+=3){p=new THREE.Color(16755200);p.setRGB(t[h],t[h+1],t[h+2]);o.push(p)}}}})(g);(function(){if(b.edges!==undefined){var h,j,k;for(h=0;h<b.edges.length;h+=
|
|
|
-2){j=b.edges[h];k=b.edges[h+1];f.edges.push(new THREE.Edge(f.vertices[j],f.vertices[k],j,k))}}})();f.computeCentroids();f.computeFaceNormals();f.computeEdgeFaces();d(f)};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
|
|
|
+2){j=b.edges[h];k=b.edges[h+1];f.edges.push(new THREE.Edge(f.vertices[j],f.vertices[k],j,k))}}})();f.computeFaceNormals();d(f)};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
|
|
|
THREE.BinaryLoader.prototype={load:function(b){var d=b.model,c=b.callback,f=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(d),g=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(d);b=(new Date).getTime();d=new Worker(d);var h=this.showProgress?THREE.Loader.prototype.updateProgress:null;d.onmessage=function(j){THREE.BinaryLoader.prototype.loadAjaxBuffers(j.data.buffers,j.data.materials,c,g,f,h)};d.onerror=function(j){alert("worker.onerror: "+j.message+"\n"+j.data);j.preventDefault()};
|
|
|
d.postMessage(b)},loadAjaxBuffers:function(b,d,c,f,g,h){var j=new XMLHttpRequest,k=f+"/"+b,m=0;j.onreadystatechange=function(){if(j.readyState==4)j.status==200||j.status==0?THREE.BinaryLoader.prototype.createBinModel(j.responseText,c,g,d):alert("Couldn't load ["+k+"] ["+j.status+"]");else if(j.readyState==3){if(h){m==0&&(m=j.getResponseHeader("Content-Length"));h({total:m,loaded:j.responseText.length})}}else j.readyState==2&&(m=j.getResponseHeader("Content-Length"))};j.open("GET",k,!0);j.overrideMimeType("text/plain; charset=x-user-defined");
|
|
|
j.setRequestHeader("Content-Type","text/plain");j.send(null)},createBinModel:function(b,d,c,f){var g=function(h){function j(S,T){var O=t(S,T),Ba=t(S,T+1),La=t(S,T+2),n=t(S,T+3),C=(n<<1&255|La>>7)-127;O|=(La&127)<<16|Ba<<8;if(O==0&&C==-127)return 0;return(1-2*(n>>7))*(1+O*Math.pow(2,-23))*Math.pow(2,C)}function k(S,T){var O=t(S,T),Ba=t(S,T+1),La=t(S,T+2);return(t(S,T+3)<<24)+(La<<16)+(Ba<<8)+O}function m(S,T){var O=t(S,T);return(t(S,T+1)<<8)+O}function o(S,T){var O=t(S,T);return O>127?O-256:O}function t(S,
|