提交 ec2c41e7 编写于 作者: M Mr.doob

Updated builds.

上级 511cf473
......@@ -7912,18 +7912,8 @@ THREE.Projector = function () {
};
this.pickingRay = function ( vector, camera ) {
// set two vectors with opposing z values
vector.z = - 1.0;
var end = new THREE.Vector3( vector.x, vector.y, 1.0 );
this.unprojectVector( vector, camera );
this.unprojectVector( end, camera );
// find direction from vector to end
end.sub( vector ).normalize();
return new THREE.Raycaster( vector, end );
console.error( 'THREE.Projector: .pickingRay() has been removed.' );
};
......@@ -9311,6 +9301,8 @@ THREE.Geometry.prototype = {
}
}
this.computeFaceNormals();
if ( geometry.boundingBox !== null ) {
......
......@@ -167,8 +167,7 @@ c.name&&(f.name=c.name);"{}"!==JSON.stringify(c.userData)&&(f.userData=c.userDat
c.color.getHex(),f.intensity=c.intensity;else if(c instanceof THREE.PointLight)f.color=c.color.getHex(),f.intensity=c.intensity,f.distance=c.distance;else if(c instanceof THREE.SpotLight)f.color=c.color.getHex(),f.intensity=c.intensity,f.distance=c.distance,f.angle=c.angle,f.exponent=c.exponent;else if(c instanceof THREE.HemisphereLight)f.color=c.color.getHex(),f.groundColor=c.groundColor.getHex();else if(c instanceof THREE.Mesh){var h=c.geometry;void 0===a.geometries&&(a.geometries=[]);if(void 0===
b[h.uuid]){var k=h.toJSON();delete k.metadata;b[h.uuid]=k;a.geometries.push(k)}f.geometry=h.uuid;f.material=d(c.material)}else c instanceof THREE.Sprite&&(f.material=d(c.material));f.matrix=c.matrix.toArray();if(0<c.children.length)for(f.children=[],h=0;h<c.children.length;h++)f.children.push(e(c.children[h]));return f};a.object=e(this);return a},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);
a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));void 0!==this.script&&(a.script=this.script.clone());if(!0===b)for(var c=
0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;
THREE.Projector=function(){this.projectVector=function(a,b){console.warn("THREE.Projector: .projectVector() is now vector.project().");a.project(b)};this.unprojectVector=function(a,b){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject().");a.unproject(b)};this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)}};
0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){this.projectVector=function(a,b){console.warn("THREE.Projector: .projectVector() is now vector.project().");a.project(b)};this.unprojectVector=function(a,b){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject().");a.unproject(b)};this.pickingRay=function(a,b){console.error("THREE.Projector: .pickingRay() has been removed.")}};
THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==g?g:0};
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.materialIndex=this.materialIndex;for(var b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}};
THREE.Face4=function(a,b,c,d,e,g,f){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,g,f)};THREE.BufferAttribute=function(a,b){this.array=a;this.itemSize=b;this.needsUpdate=!1};
......@@ -201,18 +200,18 @@ THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryI
this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1};
THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,g=a.vertexNormals.length;e<g;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}this.boundingBox instanceof THREE.Box3&&this.computeBoundingBox();this.boundingSphere instanceof THREE.Sphere&&this.computeBoundingSphere()},
fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,g=void 0!==c.normal?c.normal.array:void 0,f=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=[],n=[],p=c=0;c<d.length;c+=3,p+=2)b.vertices.push(new THREE.Vector3(d[c],d[c+1],d[c+2])),void 0!==g&&k.push(new THREE.Vector3(g[c],g[c+1],g[c+2])),void 0!==f&&b.colors.push(new THREE.Color(f[c],f[c+1],f[c+2])),void 0!==h&&n.push(new THREE.Vector2(h[p],h[p+1]));h=
function(a,c,d){var e=void 0!==g?[k[a].clone(),k[c].clone(),k[d].clone()]:[],h=void 0!==f?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,h));b.faceVertexUvs[0].push([n[a],n[c],n[d]])};if(void 0!==e)for(c=0;c<e.length;c+=3)h(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)h(c,c+1,c+2);null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();
var a=new THREE.Vector3;a.addVectors(this.boundingBox.min,this.boundingBox.max);a.multiplyScalar(-.5);this.applyMatrix((new THREE.Matrix4).makeTranslation(a.x,a.y,a.z));this.computeBoundingBox();return a},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],g=this.vertices[e.a],f=this.vertices[e.b];a.subVectors(this.vertices[e.c],f);b.subVectors(g,f);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){var b,
c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,g,f,h=new THREE.Vector3,k=new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],g=this.vertices[c.b],f=this.vertices[c.c],h.subVectors(f,g),k.subVectors(e,g),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),
d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<
b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var g=new THREE.Geometry;g.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var f=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,
b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),f.push(k)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();g.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,
b,c,d,e,g,f,h,k,n,p,m,q,t,s,r,v,w=[],u=[];c=new THREE.Vector3;var z=new THREE.Vector3,x=new THREE.Vector3,G=new THREE.Vector3,F=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,f=this.vertices[d],h=this.vertices[v],k=this.vertices[e],n=g[0],p=g[1],m=g[2],g=h.x-f.x,q=k.x-f.x,t=h.y-f.y,s=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=p.x-n.x,r=m.x-n.x,p=p.y-n.y,n=m.y-
n.y,m=1/(k*n-r*p),c.set((n*g-p*q)*m,(n*t-p*s)*m,(n*h-p*f)*m),z.set((k*q-r*g)*m,(k*s-r*t)*m,(k*f-r*h)*m),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(z),u[v].add(z),u[e].add(z);z=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)F.copy(e.vertexNormals[c]),d=e[z[c]],v=w[d],x.copy(v),x.sub(F.multiplyScalar(F.dot(v))).normalize(),G.crossVectors(e.vertexNormals[c],v),d=G.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,
x.y,x.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof
THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,g=this.vertices,f=a.vertices,h=this.faces,k=a.faces,n=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var p=0,m=f.length;p<m;p++){var q=f[p].clone();void 0!==b&&q.applyMatrix4(b);g.push(q)}p=0;for(m=k.length;p<m;p++){var f=k[p],t,s=f.vertexNormals,r=f.vertexColors,q=new THREE.Face3(f.a+e,f.b+
e,f.c+e);q.normal.copy(f.normal);void 0!==d&&q.normal.applyMatrix3(d).normalize();b=0;for(g=s.length;b<g;b++)t=s[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),q.vertexNormals.push(t);q.color.copy(f.color);b=0;for(g=r.length;b<g;b++)t=r[b],q.vertexColors.push(t.clone());q.materialIndex=f.materialIndex+c;h.push(q)}p=0;for(m=a.length;p<m;p++)if(c=a[p],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));n.push(d)}}},mergeVertices:function(){var a={},b=[],c=[],d,
e=Math.pow(10,4),g,f;g=0;for(f=this.vertices.length;g<f;g++)d=this.vertices[g],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[d]];a=[];g=0;for(f=this.faces.length;g<f;g++)for(e=this.faces[g],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(g);break}for(g=a.length-1;0<=g;g--)for(e=a[g],this.faces.splice(e,1),c=0,f=this.faceVertexUvs.length;c<f;c++)this.faceVertexUvs[c].splice(e,
function(a,c,d){var e=void 0!==g?[k[a].clone(),k[c].clone(),k[d].clone()]:[],h=void 0!==f?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,h));b.faceVertexUvs[0].push([n[a],n[c],n[d]])};if(void 0!==e)for(c=0;c<e.length;c+=3)h(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)h(c,c+1,c+2);this.computeFaceNormals();null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());
return this},center:function(){this.computeBoundingBox();var a=new THREE.Vector3;a.addVectors(this.boundingBox.min,this.boundingBox.max);a.multiplyScalar(-.5);this.applyMatrix((new THREE.Matrix4).makeTranslation(a.x,a.y,a.z));this.computeBoundingBox();return a},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],g=this.vertices[e.a],f=this.vertices[e.b];a.subVectors(this.vertices[e.c],f);b.subVectors(g,f);a.cross(b);a.normalize();
e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,g,f,h=new THREE.Vector3,k=new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],g=this.vertices[c.b],f=this.vertices[c.c],h.subVectors(f,g),k.subVectors(e,g),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<
b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||
(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var g=new THREE.Geometry;g.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var f=this.morphNormals[a].vertexNormals,h,k;c=
0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),f.push(k)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();g.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=
e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,g,f,h,k,n,p,m,q,t,s,r,v,w=[],u=[];c=new THREE.Vector3;var z=new THREE.Vector3,x=new THREE.Vector3,G=new THREE.Vector3,F=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,f=this.vertices[d],h=this.vertices[v],k=this.vertices[e],n=g[0],p=g[1],m=g[2],
g=h.x-f.x,q=k.x-f.x,t=h.y-f.y,s=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=p.x-n.x,r=m.x-n.x,p=p.y-n.y,n=m.y-n.y,m=1/(k*n-r*p),c.set((n*g-p*q)*m,(n*t-p*s)*m,(n*h-p*f)*m),z.set((k*q-r*g)*m,(k*s-r*t)*m,(k*f-r*h)*m),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(z),u[v].add(z),u[e].add(z);z=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)F.copy(e.vertexNormals[c]),d=e[z[c]],v=w[d],x.copy(v),x.sub(F.multiplyScalar(F.dot(v))).normalize(),G.crossVectors(e.vertexNormals[c],
v),d=G.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,x.y,x.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},
merge:function(a,b,c){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,g=this.vertices,f=a.vertices,h=this.faces,k=a.faces,n=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var p=0,m=f.length;p<m;p++){var q=f[p].clone();void 0!==b&&q.applyMatrix4(b);g.push(q)}p=0;for(m=k.length;p<m;p++){var f=k[p],t,s=f.vertexNormals,r=
f.vertexColors,q=new THREE.Face3(f.a+e,f.b+e,f.c+e);q.normal.copy(f.normal);void 0!==d&&q.normal.applyMatrix3(d).normalize();b=0;for(g=s.length;b<g;b++)t=s[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),q.vertexNormals.push(t);q.color.copy(f.color);b=0;for(g=r.length;b<g;b++)t=r[b],q.vertexColors.push(t.clone());q.materialIndex=f.materialIndex+c;h.push(q)}p=0;for(m=a.length;p<m;p++)if(c=a[p],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));n.push(d)}}},mergeVertices:function(){var a=
{},b=[],c=[],d,e=Math.pow(10,4),g,f;g=0;for(f=this.vertices.length;g<f;g++)d=this.vertices[g],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[d]];a=[];g=0;for(f=this.faces.length;g<f;g++)for(e=this.faces[g],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(g);break}for(g=a.length-1;0<=g;g--)for(e=a[g],this.faces.splice(e,1),c=0,f=this.faceVertexUvs.length;c<f;c++)this.faceVertexUvs[c].splice(e,
1);g=this.vertices.length-b.length;this.vertices=b;return g},makeGroups:function(){var a=0;return function(b,c){var d,e,g,f,h={},k,n=this.morphTargets.length,p=this.morphNormals.length;this.geometryGroups={};this.geometryGroupsList=[];d=0;for(e=this.faces.length;d<e;d++)g=this.faces[d],g=b?g.materialIndex:0,g in h||(h[g]={hash:g,counter:0}),f=h[g].hash+"_"+h[g].counter,f in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:g,vertices:0,numMorphTargets:n,numMorphNormals:p},this.geometryGroups[f]=
k,this.geometryGroupsList.push(k)),this.geometryGroups[f].vertices+3>c&&(h[g].counter+=1,f=h[g].hash+"_"+h[g].counter,f in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:g,vertices:0,numMorphTargets:n,numMorphNormals:p},this.geometryGroups[f]=k,this.geometryGroupsList.push(k))),this.geometryGroups[f].faces3.push(d),this.geometryGroups[f].vertices+=3}}(),toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==
n[b])return n[b];n[b]=k.length/3;k.push(a.x,a.y,a.z);return n[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==m[b])return m[b];m[b]=p.length;p.push(a.getHex());return m[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==t[b])return t[b];t[b]=q.length/2;q.push(a.x,a.y);return t[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册