Browse Source

move to static variables

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

+ 3 - 2
src/textures/Texture.js

@@ -19,14 +19,15 @@ 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 } );
-		Object.defineProperty( this, 'DEFAULT_IMAGE', { value: undefined } );
-		Object.defineProperty( this, 'DEFAULT_MAPPING', { value: UVMapping } );
 
 		this.uuid = MathUtils.generateUUID();