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

Updated builds.

上级 c42abb2f
......@@ -9098,6 +9098,16 @@ THREE.BufferGeometry.prototype = {
addAttribute: function ( name, attribute ) {
if ( attribute instanceof THREE.BufferAttribute === false ) {
console.warn( 'DEPRECATED: BufferGeometry\'s addAttribute() now expects ( name, attribute ).' );
this.attributes[ name ] = { array: arguments[ 1 ], itemSize: arguments[ 2 ] };
return;
}
this.attributes[ name ] = attribute;
},
......
......@@ -188,20 +188,20 @@ this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e}};THREE.In
THREE.Uint8ClampedAttribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.Int16Attribute=function(a,b){this.array=new Int16Array(a*b);this.itemSize=b};THREE.Int16Attribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.Uint16Attribute=function(a,b){this.array=new Uint16Array(a*b);this.itemSize=b};THREE.Uint16Attribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.Int32Attribute=function(a,b){this.array=new Int32Array(a*b);this.itemSize=b};
THREE.Int32Attribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.Uint32Attribute=function(a,b){this.array=new Uint32Array(a*b);this.itemSize=b};THREE.Uint32Attribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.Float32Attribute=function(a,b){this.array=new Float32Array(a*b);this.itemSize=b};THREE.Float32Attribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.Float64Attribute=function(a,b){this.array=new Float64Array(a*b);this.itemSize=b};
THREE.Float64Attribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.BufferGeometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.attributes={};this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0)},computeBoundingBox:function(){null===
this.boundingBox&&(this.boundingBox=new THREE.Box3);var a=this.attributes.position.array;if(a){var b=this.boundingBox;3<=a.length&&(b.min.x=b.max.x=a[0],b.min.y=b.max.y=a[1],b.min.z=b.max.z=a[2]);for(var c=3,d=a.length;c<d;c+=3){var e=a[c],f=a[c+1],g=a[c+2];e<b.min.x?b.min.x=e:e>b.max.x&&(b.max.x=e);f<b.min.y?b.min.y=f:f>b.max.y&&(b.max.y=f);g<b.min.z?b.min.z=g:g>b.max.z&&(b.max.z=g)}}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)},computeBoundingSphere:function(){var a=
new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.addPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g)}}}(),computeVertexNormals:function(){if(this.attributes.position){var a,
b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else for(a=0,b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0;var e=this.attributes.position.array,f=this.attributes.normal.array,g,h,k,l,n,q,s=new THREE.Vector3,r=new THREE.Vector3,u=new THREE.Vector3,p=new THREE.Vector3,v=new THREE.Vector3;if(this.attributes.index){var w=this.attributes.index.array,t=this.offsets;c=0;for(d=
t.length;c<d;++c){b=t[c].start;g=t[c].count;var x=t[c].index;a=b;for(b+=g;a<b;a+=3)g=x+w[a],h=x+w[a+1],k=x+w[a+2],l=e[3*g],n=e[3*g+1],q=e[3*g+2],s.set(l,n,q),l=e[3*h],n=e[3*h+1],q=e[3*h+2],r.set(l,n,q),l=e[3*k],n=e[3*k+1],q=e[3*k+2],u.set(l,n,q),p.subVectors(u,r),v.subVectors(s,r),p.cross(v),f[3*g]+=p.x,f[3*g+1]+=p.y,f[3*g+2]+=p.z,f[3*h]+=p.x,f[3*h+1]+=p.y,f[3*h+2]+=p.z,f[3*k]+=p.x,f[3*k+1]+=p.y,f[3*k+2]+=p.z}}else for(a=0,b=e.length;a<b;a+=9)l=e[a],n=e[a+1],q=e[a+2],s.set(l,n,q),l=e[a+3],n=e[a+4],
q=e[a+5],r.set(l,n,q),l=e[a+6],n=e[a+7],q=e[a+8],u.set(l,n,q),p.subVectors(u,r),v.subVectors(s,r),p.cross(v),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z;this.normalizeNormals();this.normalsNeedUpdate=!0}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},computeTangents:function(){function a(a,b,c){q=d[3*a];s=d[3*a+1];
r=d[3*a+2];u=d[3*b];p=d[3*b+1];v=d[3*b+2];w=d[3*c];t=d[3*c+1];x=d[3*c+2];H=f[2*a];G=f[2*a+1];P=f[2*b];F=f[2*b+1];D=f[2*c];K=f[2*c+1];y=u-q;E=w-q;I=p-s;C=t-s;N=v-r;z=x-r;M=P-H;A=D-H;J=F-G;Y=K-G;R=1/(M*Y-A*J);ka.set((Y*y-J*E)*R,(Y*I-J*C)*R,(Y*N-J*z)*R);ca.set((M*E-A*y)*R,(M*C-A*I)*R,(M*z-A*N)*R);k[a].add(ka);k[b].add(ka);k[c].add(ka);l[a].add(ca);l[b].add(ca);l[c].add(ca)}function b(a){aa.x=e[3*a];aa.y=e[3*a+1];aa.z=e[3*a+2];Ga.copy(aa);Da=k[a];T.copy(Da);T.sub(aa.multiplyScalar(aa.dot(Da))).normalize();
ya.crossVectors(Ga,Da);Ha=ya.dot(l[a]);Ja=0>Ha?-1:1;h[4*a]=T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=Ja}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&
(this.attributes.tangent={itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var q,s,r,u,p,v,w,t,x,H,G,P,F,D,K,y,E,I,C,N,z,M,A,J,Y,R,ka=new THREE.Vector3,ca=new THREE.Vector3,X,O,S,ea,B,ha=this.offsets,n=0;for(O=ha.length;n<O;++n){X=ha[n].start;S=ha[n].count;var ua=ha[n].index,g=X;for(X+=S;g<X;g+=3)S=ua+c[g],ea=ua+c[g+1],B=ua+c[g+2],a(S,ea,B)}var T=new THREE.Vector3,ya=new THREE.Vector3,aa=new THREE.Vector3,
Ga=new THREE.Vector3,Ja,Da,Ha,n=0;for(O=ha.length;n<O;++n)for(X=ha[n].start,S=ha[n].count,ua=ha[n].index,g=X,X+=S;g<X;g+=3)S=ua+c[g],ea=ua+c[g+1],B=ua+c[g+2],b(S),b(ea),b(B)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,q=new Int32Array(6),s=new Int32Array(c.length),r=new Int32Array(c.length),u=0;u<c.length;u++)s[u]=
-1,r[u]=-1;for(c=0;c<d;c++){for(var p=n=0;3>p;p++)u=a[3*c+p],-1==s[u]?(q[2*p]=u,q[2*p+1]=-1,n++):s[u]<k.index?(q[2*p]=u,q[2*p+1]=-1,l++):(q[2*p]=u,q[2*p+1]=s[u]);if(g+n>k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)p=q[n+1],-1<p&&p<k.index&&(q[n+1]=-1);for(n=0;6>n;n+=2)u=q[n],p=q[n+1],-1===p&&(p=g++),s[u]=p,r[p]=u,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,r,g);return this.offsets=h},reorderBuffers:function(a,b,c){var d={},e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,
Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],f;for(f in this.attributes)if("index"!=f)for(var g=this.attributes[f].array,h=0,k=e.length;h<k;h++){var l=e[h];if(g instanceof l){d[f]=new l(this.attributes[f].itemSize*c);break}}for(e=0;e<c;e++)for(f in g=b[e],this.attributes)if("index"!=f)for(var h=this.attributes[f].array,k=this.attributes[f].itemSize,l=d[f],n=0;n<k;n++)l[e*k+n]=h[g*k+n];this.attributes.index.array=a;for(f in this.attributes)"index"!=f&&(this.attributes[f].array=d[f],
this.attributes[f].numItems=this.attributes[f].itemSize*c)},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,array:null},d=0,g=b.length;d<g;d++){var h=b[d];if(e instanceof h){f.array=new h(e);break}}a.attributes[c]=f}d=0;for(g=this.offsets.length;d<g;d++)b=this.offsets[d],a.offsets.push({start:b.start,
index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=
THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute?(console.warn("DEPRECATED: BufferGeometry's addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),
b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0)},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var a=this.attributes.position.array;if(a){var b=this.boundingBox;3<=a.length&&(b.min.x=b.max.x=a[0],b.min.y=b.max.y=a[1],b.min.z=b.max.z=a[2]);for(var c=3,d=a.length;c<d;c+=3){var e=a[c],f=a[c+1],g=a[c+2];e<b.min.x?b.min.x=e:e>b.max.x&&(b.max.x=e);f<b.min.y?b.min.y=f:
f>b.max.y&&(b.max.y=f);g<b.min.z?b.min.z=g:g>b.max.z&&(b.max.z=g)}}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)},computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.addPoint(b);a.center(d);for(var g=0,
e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g)}}}(),computeVertexNormals:function(){if(this.attributes.position){var a,b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else for(a=0,b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0;var e=this.attributes.position.array,f=this.attributes.normal.array,
g,h,k,l,n,q,s=new THREE.Vector3,r=new THREE.Vector3,u=new THREE.Vector3,p=new THREE.Vector3,v=new THREE.Vector3;if(this.attributes.index){var w=this.attributes.index.array,t=this.offsets;c=0;for(d=t.length;c<d;++c){b=t[c].start;g=t[c].count;var x=t[c].index;a=b;for(b+=g;a<b;a+=3)g=x+w[a],h=x+w[a+1],k=x+w[a+2],l=e[3*g],n=e[3*g+1],q=e[3*g+2],s.set(l,n,q),l=e[3*h],n=e[3*h+1],q=e[3*h+2],r.set(l,n,q),l=e[3*k],n=e[3*k+1],q=e[3*k+2],u.set(l,n,q),p.subVectors(u,r),v.subVectors(s,r),p.cross(v),f[3*g]+=p.x,
f[3*g+1]+=p.y,f[3*g+2]+=p.z,f[3*h]+=p.x,f[3*h+1]+=p.y,f[3*h+2]+=p.z,f[3*k]+=p.x,f[3*k+1]+=p.y,f[3*k+2]+=p.z}}else for(a=0,b=e.length;a<b;a+=9)l=e[a],n=e[a+1],q=e[a+2],s.set(l,n,q),l=e[a+3],n=e[a+4],q=e[a+5],r.set(l,n,q),l=e[a+6],n=e[a+7],q=e[a+8],u.set(l,n,q),p.subVectors(u,r),v.subVectors(s,r),p.cross(v),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z;this.normalizeNormals();this.normalsNeedUpdate=!0}},normalizeNormals:function(){for(var a=this.attributes.normal.array,
b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},computeTangents:function(){function a(a,b,c){q=d[3*a];s=d[3*a+1];r=d[3*a+2];u=d[3*b];p=d[3*b+1];v=d[3*b+2];w=d[3*c];t=d[3*c+1];x=d[3*c+2];H=f[2*a];G=f[2*a+1];P=f[2*b];F=f[2*b+1];D=f[2*c];K=f[2*c+1];y=u-q;E=w-q;I=p-s;C=t-s;N=v-r;z=x-r;M=P-H;A=D-H;J=F-G;Y=K-G;R=1/(M*Y-A*J);ka.set((Y*y-J*E)*R,(Y*I-J*C)*R,(Y*N-J*z)*R);ca.set((M*E-A*y)*R,(M*C-A*I)*R,(M*z-A*N)*R);k[a].add(ka);k[b].add(ka);k[c].add(ka);
l[a].add(ca);l[b].add(ca);l[c].add(ca)}function b(a){aa.x=e[3*a];aa.y=e[3*a+1];aa.z=e[3*a+2];Ga.copy(aa);Da=k[a];T.copy(Da);T.sub(aa.multiplyScalar(aa.dot(Da))).normalize();ya.crossVectors(Ga,Da);Ha=ya.dot(l[a]);Ja=0>Ha?-1:1;h[4*a]=T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=Ja}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent={itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var q,s,r,u,p,v,w,t,x,H,G,P,F,D,K,y,E,I,C,N,z,M,A,J,Y,R,ka=new THREE.Vector3,ca=new THREE.Vector3,X,O,S,ea,B,ha=this.offsets,n=0;for(O=ha.length;n<O;++n){X=
ha[n].start;S=ha[n].count;var ua=ha[n].index,g=X;for(X+=S;g<X;g+=3)S=ua+c[g],ea=ua+c[g+1],B=ua+c[g+2],a(S,ea,B)}var T=new THREE.Vector3,ya=new THREE.Vector3,aa=new THREE.Vector3,Ga=new THREE.Vector3,Ja,Da,Ha,n=0;for(O=ha.length;n<O;++n)for(X=ha[n].start,S=ha[n].count,ua=ha[n].index,g=X,X+=S;g<X;g+=3)S=ua+c[g],ea=ua+c[g+1],B=ua+c[g+2],b(S),b(ea),b(B)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/
3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,q=new Int32Array(6),s=new Int32Array(c.length),r=new Int32Array(c.length),u=0;u<c.length;u++)s[u]=-1,r[u]=-1;for(c=0;c<d;c++){for(var p=n=0;3>p;p++)u=a[3*c+p],-1==s[u]?(q[2*p]=u,q[2*p+1]=-1,n++):s[u]<k.index?(q[2*p]=u,q[2*p+1]=-1,l++):(q[2*p]=u,q[2*p+1]=s[u]);if(g+n>k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)p=q[n+1],-1<p&&p<k.index&&(q[n+1]=-1);for(n=0;6>n;n+=2)u=q[n],p=q[n+1],-1===p&&(p=g++),
s[u]=p,r[p]=u,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,r,g);return this.offsets=h},reorderBuffers:function(a,b,c){var d={},e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],f;for(f in this.attributes)if("index"!=f)for(var g=this.attributes[f].array,h=0,k=e.length;h<k;h++){var l=e[h];if(g instanceof l){d[f]=new l(this.attributes[f].itemSize*c);break}}for(e=0;e<c;e++)for(f in g=b[e],this.attributes)if("index"!=f)for(var h=this.attributes[f].array,
k=this.attributes[f].itemSize,l=d[f],n=0;n<k;n++)l[e*k+n]=h[g*k+n];this.attributes.index.array=a;for(f in this.attributes)"index"!=f&&(this.attributes[f].array=d[f],this.attributes[f].numItems=this.attributes[f].itemSize*c)},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,array:null},d=0,g=b.length;d<
g;d++){var h=b[d];if(e instanceof h){f.array=new h(e);break}}a.attributes[c]=f}d=0;for(g=this.offsets.length;d<g;d++)b=this.offsets[d],a.offsets.push({start:b.start,index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=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,f=a.vertexNormals.length;e<f;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}this.boundingBox instanceof THREE.Box3&&this.computeBoundingBox();this.boundingSphere instanceof THREE.Sphere&&this.computeBoundingSphere()},
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],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g);b.subVectors(f,g);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,f,g,h=new THREE.Vector3,k=new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册