浏览代码

make CubeTexture.images a true alias of Texture.image to avoid bugs.

Ben Houston 9 年之前
父节点
当前提交
5978d9156e
共有 1 个文件被更改,包括 9 次插入10 次删除
  1. 9 10
      src/textures/CubeTexture.js

+ 9 - 10
src/textures/CubeTexture.js

@@ -8,7 +8,6 @@ THREE.CubeTexture = function ( images, mapping, wrapS, wrapT, magFilter, minFilt
 
 	THREE.Texture.call( this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
 
-	this.images = images;
 	this.flipY = false;
 
 };
@@ -16,12 +15,12 @@ THREE.CubeTexture = function ( images, mapping, wrapS, wrapT, magFilter, minFilt
 THREE.CubeTexture.prototype = Object.create( THREE.Texture.prototype );
 THREE.CubeTexture.prototype.constructor = THREE.CubeTexture;
 
-THREE.CubeTexture.prototype.copy = function ( source ) {
-
-	THREE.Texture.prototype.copy.call( this, source );
-
-	this.images = source.images;
-
-	return this;
-
-};
+Object.defineProperty(THREE.CubeTexture.prototype, "images", {
+		  get: function() {
+				return this.image;
+		  },
+			set: function( value ) {
+				this.image = value;
+			}
+		}
+);