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

Updated builds.

上级 74507823
......@@ -12748,8 +12748,10 @@ THREE.TextureLoader.prototype = {
*/
THREE.CompressedTextureLoader = function () {
// override in sub classes
this._parser = null;
};
......@@ -12766,8 +12768,8 @@ THREE.CompressedTextureLoader.prototype = {
var texture = new THREE.CompressedTexture();
texture.image = images;
var loader = new THREE.XHRLoader();
loader.setResponseType( 'arraybuffer' );
var loader = new THREE.XHRLoader();
loader.setResponseType( 'arraybuffer' );
if ( url instanceof Array ) {
......@@ -12784,12 +12786,15 @@ THREE.CompressedTextureLoader.prototype = {
height: texDatas.height,
format: texDatas.format,
mipmaps: texDatas.mipmaps
}
};
loaded += 1;
if ( loaded === 6 ) {
if (texDatas.mipmapCount == 1)
texture.minFilter = THREE.LinearFilter;
texture.format = texDatas.format;
texture.needsUpdate = true;
......@@ -12799,7 +12804,7 @@ THREE.CompressedTextureLoader.prototype = {
} );
}
};
for ( var i = 0, il = url.length; i < il; ++ i ) {
......@@ -12842,6 +12847,12 @@ THREE.CompressedTextureLoader.prototype = {
}
if ( texDatas.mipmapCount === 1 ) {
texture.minFilter = THREE.LinearFilter;
}
texture.format = texDatas.format;
texture.needsUpdate = true;
......
......@@ -280,8 +280,8 @@ b.aspect,b.near,b.far);break;case "OrthographicCamera":e=new THREE.OrthographicC
b.groundColor,b.intensity);break;case "Mesh":e=c[b.geometry];var g=d[b.material];void 0===e&&console.error("THREE.ObjectLoader: Undefined geometry "+b.geometry);void 0===g&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,g);break;case "Sprite":g=d[b.material];void 0===g&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Sprite(g);break;case "Group":e=new THREE.Group;break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&
(e.name=b.name);void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==b.visible&&(e.visible=b.visible);void 0!==b.userData&&(e.userData=b.userData);void 0!==b.script&&(e.script=new THREE.Script(b.script));if(void 0!==b.children)for(var f in b.children)e.add(this.parseObject(b.children[f],c,d));return e}}()};
THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=new THREE.ImageLoader(this.manager);e.setCrossOrigin(this.crossOrigin);e.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.CompressedTextureLoader=function(){this._parser=null};
THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c){var d=this,e=[],g=new THREE.CompressedTexture;g.image=e;var f=new THREE.XHRLoader;f.setResponseType("arraybuffer");if(a instanceof Array){var h=0;c=function(c){f.load(a[c],function(a){a=d._parser(a,!0);e[c]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};h+=1;6===h&&(g.format=a.format,g.needsUpdate=!0,b&&b(g))})};for(var k=0,m=a.length;k<m;++k)c(k)}else f.load(a,function(a){a=
d._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,f=0;f<c;f++){e[f]={mipmaps:[]};for(var h=0;h<a.mipmapCount;h++)e[f].mipmaps.push(a.mipmaps[f*a.mipmapCount+h]),e[f].format=a.format,e[f].width=a.width,e[f].height=a.height}else g.image.width=a.width,g.image.height=a.height,g.mipmaps=a.mipmaps;g.format=a.format;g.needsUpdate=!0;b&&b(g)});return g}};
THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c){var d=this,e=[],g=new THREE.CompressedTexture;g.image=e;var f=new THREE.XHRLoader;f.setResponseType("arraybuffer");if(a instanceof Array){var h=0;c=function(c){f.load(a[c],function(a){a=d._parser(a,!0);e[c]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};h+=1;6===h&&(1==a.mipmapCount&&(g.minFilter=THREE.LinearFilter),g.format=a.format,g.needsUpdate=!0,b&&b(g))})};for(var k=0,m=
a.length;k<m;++k)c(k)}else f.load(a,function(a){a=d._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,f=0;f<c;f++){e[f]={mipmaps:[]};for(var h=0;h<a.mipmapCount;h++)e[f].mipmaps.push(a.mipmaps[f*a.mipmapCount+h]),e[f].format=a.format,e[f].width=a.width,e[f].height=a.height}else g.image.width=a.width,g.image.height=a.height,g.mipmaps=a.mipmaps;1===a.mipmapCount&&(g.minFilter=THREE.LinearFilter);g.format=a.format;g.needsUpdate=!0;b&&b(g)});return g}};
THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.type="Material";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=
!0};
THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},toJSON:function(){var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(a.name=
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册