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

Updated builds.

上级 cdc37a67
......@@ -8637,6 +8637,19 @@ THREE.BufferAttribute.prototype = {
},
copyAt: function ( index1, attribute, index2 ) {
index1 *= this.itemSize;
index2 *= attribute.itemSize;
for ( var i = 0, l = this.itemSize; i < l; i ++ ) {
this.array[ index1 + i ] = attribute.array[ index2 + i ];
}
},
set: function ( value ) {
this.array.set( value );
......@@ -14745,8 +14758,7 @@ THREE.Mesh.prototype.raycast = ( function () {
distance: distance,
point: intersectionPoint,
indices: [ a, b, c ],
face: null,
face: new THREE.Face3( a, b, c, THREE.Triangle.normal( vA, vB, vC ) ),
faceIndex: null,
object: this
......@@ -14805,8 +14817,7 @@ THREE.Mesh.prototype.raycast = ( function () {
distance: distance,
point: intersectionPoint,
indices: [ a, b, c ],
face: null,
face: new THREE.Face3( a, b, c, THREE.Triangle.normal( vA, vB, vC ) ),
faceIndex: null,
object: this
......
......@@ -182,8 +182,8 @@ y.material.vertexColors===THREE.VertexColors&&(u.vertexColors[0].copy(y.geometry
Math.abs(C.y-(L.y+q.projectionMatrix.elements[5])/(L.w+q.projectionMatrix.elements[13])),C.material=y.material,D.elements.push(C)))}!0===x&&D.elements.sort(e);return D}};THREE.Face3=function(a,b,c,d,e,f){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!==f?f: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,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,g)};THREE.BufferAttribute=function(a,b){this.array=a;this.itemSize=b};
THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},set:function(a){this.array.set(a);return this},setX:function(a,b){this.array[a*this.itemSize]=b;return this},setY:function(a,b){this.array[a*this.itemSize+1]=b;return this},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a]=b;this.array[a+1]=
c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e;return this}};THREE.Int8Attribute=function(a,b){console.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};
THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},copyAt:function(a,b,c){a*=this.itemSize;c*=b.itemSize;for(var d=0,e=this.itemSize;d<e;d++)this.array[a+d]=b.array[c+d]},set:function(a){this.array.set(a);return this},setX:function(a,b){this.array[a*this.itemSize]=b;return this},setY:function(a,b){this.array[a*this.itemSize+1]=b;return this},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},setXY:function(a,b,c){a*=this.itemSize;
this.array[a]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e;return this}};THREE.Int8Attribute=function(a,b){console.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};
THREE.Uint8Attribute=function(a,b){console.warn("THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.Uint8ClampedAttribute=function(a,b){console.warn("THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};
THREE.Int16Attribute=function(a,b){console.warn("THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.Uint16Attribute=function(a,b){console.warn("THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};
THREE.Int32Attribute=function(a,b){console.warn("THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.Uint32Attribute=function(a,b){console.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};
......@@ -330,10 +330,10 @@ THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.mor
THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var m=
this.material;if(void 0!==m){var n=k.attributes,p,r,q=g.precision;if(void 0!==n.index){var t=n.index.array,s=n.position.array,v=k.offsets;0===v.length&&(v=[{start:0,count:t.length,index:0}]);for(var x=0,u=v.length;x<u;++x)for(var n=v[x].start,G=v[x].index,k=n,y=n+v[x].count;k<y;k+=3){n=G+t[k];p=G+t[k+1];r=G+t[k+2];d.set(s[3*n],s[3*n+1],s[3*n+2]);e.set(s[3*p],s[3*p+1],s[3*p+2]);f.set(s[3*r],s[3*r+1],s[3*r+2]);var B=m.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,m.side!==
THREE.DoubleSide);if(null!==B){B.applyMatrix4(this.matrixWorld);var C=g.ray.origin.distanceTo(B);C<q||C<g.near||C>g.far||h.push({distance:C,point:B,indices:[n,p,r],face:null,faceIndex:null,object:this})}}}else for(s=n.position.array,t=k=0,y=s.length;k<y;k+=3,t+=9)n=k,p=k+1,r=k+2,d.set(s[t],s[t+1],s[t+2]),e.set(s[t+3],s[t+4],s[t+5]),f.set(s[t+6],s[t+7],s[t+8]),B=m.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,m.side!==THREE.DoubleSide),null!==B&&(B.applyMatrix4(this.matrixWorld),
C=g.ray.origin.distanceTo(B),C<q||C<g.near||C>g.far||h.push({distance:C,point:B,indices:[n,p,r],face:null,faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,s=!0===t?this.material.materials:null,q=g.precision,v=k.vertices,x=0,u=k.faces.length;x<u;x++)if(G=k.faces[x],m=!0===t?s[G.materialIndex]:this.material,void 0!==m){n=v[G.a];p=v[G.b];r=v[G.c];if(!0===m.morphTargets){B=k.morphTargets;C=this.morphTargetInfluences;d.set(0,0,0);
e.set(0,0,0);f.set(0,0,0);for(var y=0,A=B.length;y<A;y++){var w=C[y];if(0!==w){var z=B[y].vertices;d.x+=(z[G.a].x-n.x)*w;d.y+=(z[G.a].y-n.y)*w;d.z+=(z[G.a].z-n.z)*w;e.x+=(z[G.b].x-p.x)*w;e.y+=(z[G.b].y-p.y)*w;e.z+=(z[G.b].z-p.z)*w;f.x+=(z[G.c].x-r.x)*w;f.y+=(z[G.c].y-r.y)*w;f.z+=(z[G.c].z-r.z)*w}}d.add(n);e.add(p);f.add(r);n=d;p=e;r=f}B=m.side===THREE.BackSide?b.intersectTriangle(r,p,n,!0):b.intersectTriangle(n,p,r,m.side!==THREE.DoubleSide);null!==B&&(B.applyMatrix4(this.matrixWorld),C=g.ray.origin.distanceTo(B),
C<q||C<g.near||C>g.far||h.push({distance:C,point:B,face:G,faceIndex:x,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
THREE.DoubleSide);if(null!==B){B.applyMatrix4(this.matrixWorld);var C=g.ray.origin.distanceTo(B);C<q||C<g.near||C>g.far||h.push({distance:C,point:B,face:new THREE.Face3(n,p,r,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(s=n.position.array,t=k=0,y=s.length;k<y;k+=3,t+=9)n=k,p=k+1,r=k+2,d.set(s[t],s[t+1],s[t+2]),e.set(s[t+3],s[t+4],s[t+5]),f.set(s[t+6],s[t+7],s[t+8]),B=m.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,m.side!==THREE.DoubleSide),
null!==B&&(B.applyMatrix4(this.matrixWorld),C=g.ray.origin.distanceTo(B),C<q||C<g.near||C>g.far||h.push({distance:C,point:B,face:new THREE.Face3(n,p,r,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,s=!0===t?this.material.materials:null,q=g.precision,v=k.vertices,x=0,u=k.faces.length;x<u;x++)if(G=k.faces[x],m=!0===t?s[G.materialIndex]:this.material,void 0!==m){n=v[G.a];p=v[G.b];r=v[G.c];if(!0===
m.morphTargets){B=k.morphTargets;C=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,0,0);for(var y=0,A=B.length;y<A;y++){var w=C[y];if(0!==w){var z=B[y].vertices;d.x+=(z[G.a].x-n.x)*w;d.y+=(z[G.a].y-n.y)*w;d.z+=(z[G.a].z-n.z)*w;e.x+=(z[G.b].x-p.x)*w;e.y+=(z[G.b].y-p.y)*w;e.z+=(z[G.b].z-p.z)*w;f.x+=(z[G.c].x-r.x)*w;f.y+=(z[G.c].y-r.y)*w;f.z+=(z[G.c].z-r.z)*w}}d.add(n);e.add(p);f.add(r);n=d;p=e;r=f}B=m.side===THREE.BackSide?b.intersectTriangle(r,p,n,!0):b.intersectTriangle(n,p,r,m.side!==
THREE.DoubleSide);null!==B&&(B.applyMatrix4(this.matrixWorld),C=g.ray.origin.distanceTo(B),C<q||C<g.near||C>g.far||h.push({distance:C,point:B,face:G,faceIndex:x,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),
this.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};
THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册