Selaa lähdekoodia

set proper default for CubeTexture( images ) parameter. Makes it easier to use.

Ben Houston 9 vuotta sitten
vanhempi
commit
598d7d19d6

+ 1 - 1
examples/js/loaders/HDRCubeTextureLoader.js

@@ -12,7 +12,7 @@ THREE.HDRCubeTextureLoader = function (manager) {
 }
 
 THREE.HDRCubeTextureLoader.prototype.load = function(type, urls, onLoad, onProgress, onError) {
-  var texture = new THREE.CubeTexture( [] );
+  var texture = new THREE.CubeTexture();
 
   texture.type = type;
   texture.encoding = (type === THREE.UnsignedByteType) ? THREE.RGBEEncoding : THREE.LinearEncoding;

+ 1 - 1
src/loaders/CubeTextureLoader.js

@@ -14,7 +14,7 @@ THREE.CubeTextureLoader.prototype = {
 
 	load: function ( urls, onLoad, onProgress, onError ) {
 
-		var texture = new THREE.CubeTexture( [] );
+		var texture = new THREE.CubeTexture();
 
 		var loader = new THREE.ImageLoader( this.manager );
 		loader.setCrossOrigin( this.crossOrigin );

+ 1 - 0
src/textures/CubeTexture.js

@@ -4,6 +4,7 @@
 
 THREE.CubeTexture = function ( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
 
+	images = images !== undefined ? images : [];
 	mapping = mapping !== undefined ? mapping : THREE.CubeReflectionMapping;
 
 	THREE.Texture.call( this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );