Browse Source

using static class properties again

DefinitelyMaybe 4 years ago
parent
commit
2d31d48e8d
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/textures/Texture.js

+ 4 - 3
src/textures/Texture.js

@@ -19,12 +19,14 @@ let textureId = 0;
 
 class Texture extends EventDispatcher {
 
+	static DEFAULT_IMAGE = undefined;
+	static DEFAULT_MAPPING = UVMapping;
+
 	constructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding ) {
 
 		super();
 
 		Object.defineProperty( this, 'id', { value: textureId ++ } );
-		Object.defineProperty( this, 'isTexture', { value: true } );
 
 		this.uuid = MathUtils.generateUUID();
 
@@ -368,7 +370,6 @@ class Texture extends EventDispatcher {
 
 }
 
-Texture.DEFAULT_IMAGE = undefined;
-Texture.DEFAULT_MAPPING = UVMapping;
+Texture.prototype.isTexture = true;
 
 export { Texture };