|
@@ -436,32 +436,6 @@ Object.assign( ObjectLoader.prototype, {
|
|
|
|
|
|
parseTextures: function ( json, images ) {
|
|
|
|
|
|
- var TextureMapping = {
|
|
|
- UVMapping: UVMapping,
|
|
|
- CubeReflectionMapping: CubeReflectionMapping,
|
|
|
- CubeRefractionMapping: CubeRefractionMapping,
|
|
|
- EquirectangularReflectionMapping: EquirectangularReflectionMapping,
|
|
|
- EquirectangularRefractionMapping: EquirectangularRefractionMapping,
|
|
|
- SphericalReflectionMapping: SphericalReflectionMapping,
|
|
|
- CubeUVReflectionMapping: CubeUVReflectionMapping,
|
|
|
- CubeUVRefractionMapping: CubeUVRefractionMapping
|
|
|
- };
|
|
|
-
|
|
|
- var TextureWrapping = {
|
|
|
- RepeatWrapping: RepeatWrapping,
|
|
|
- ClampToEdgeWrapping: ClampToEdgeWrapping,
|
|
|
- MirroredRepeatWrapping: MirroredRepeatWrapping
|
|
|
- };
|
|
|
-
|
|
|
- var TextureFilter = {
|
|
|
- NearestFilter: NearestFilter,
|
|
|
- NearestMipMapNearestFilter: NearestMipMapNearestFilter,
|
|
|
- NearestMipMapLinearFilter: NearestMipMapLinearFilter,
|
|
|
- LinearFilter: LinearFilter,
|
|
|
- LinearMipMapNearestFilter: LinearMipMapNearestFilter,
|
|
|
- LinearMipMapLinearFilter: LinearMipMapLinearFilter
|
|
|
- };
|
|
|
-
|
|
|
function parseConstant( value, type ) {
|
|
|
|
|
|
if ( typeof( value ) === 'number' ) return value;
|
|
@@ -499,19 +473,19 @@ Object.assign( ObjectLoader.prototype, {
|
|
|
|
|
|
if ( data.name !== undefined ) texture.name = data.name;
|
|
|
|
|
|
- if ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TextureMapping );
|
|
|
+ if ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TEXTURE_MAPPING );
|
|
|
|
|
|
if ( data.offset !== undefined ) texture.offset.fromArray( data.offset );
|
|
|
if ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat );
|
|
|
if ( data.wrap !== undefined ) {
|
|
|
|
|
|
- texture.wrapS = parseConstant( data.wrap[ 0 ], TextureWrapping );
|
|
|
- texture.wrapT = parseConstant( data.wrap[ 1 ], TextureWrapping );
|
|
|
+ texture.wrapS = parseConstant( data.wrap[ 0 ], TEXTURE_WRAPPING );
|
|
|
+ texture.wrapT = parseConstant( data.wrap[ 1 ], TEXTURE_WRAPPING );
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TextureFilter );
|
|
|
- if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TextureFilter );
|
|
|
+ if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER );
|
|
|
+ if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER );
|
|
|
if ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy;
|
|
|
|
|
|
if ( data.flipY !== undefined ) texture.flipY = data.flipY;
|
|
@@ -807,5 +781,31 @@ Object.assign( ObjectLoader.prototype, {
|
|
|
|
|
|
} );
|
|
|
|
|
|
+var TEXTURE_MAPPING = {
|
|
|
+ UVMapping: UVMapping,
|
|
|
+ CubeReflectionMapping: CubeReflectionMapping,
|
|
|
+ CubeRefractionMapping: CubeRefractionMapping,
|
|
|
+ EquirectangularReflectionMapping: EquirectangularReflectionMapping,
|
|
|
+ EquirectangularRefractionMapping: EquirectangularRefractionMapping,
|
|
|
+ SphericalReflectionMapping: SphericalReflectionMapping,
|
|
|
+ CubeUVReflectionMapping: CubeUVReflectionMapping,
|
|
|
+ CubeUVRefractionMapping: CubeUVRefractionMapping
|
|
|
+};
|
|
|
+
|
|
|
+var TEXTURE_WRAPPING = {
|
|
|
+ RepeatWrapping: RepeatWrapping,
|
|
|
+ ClampToEdgeWrapping: ClampToEdgeWrapping,
|
|
|
+ MirroredRepeatWrapping: MirroredRepeatWrapping
|
|
|
+};
|
|
|
+
|
|
|
+var TEXTURE_FILTER = {
|
|
|
+ NearestFilter: NearestFilter,
|
|
|
+ NearestMipMapNearestFilter: NearestMipMapNearestFilter,
|
|
|
+ NearestMipMapLinearFilter: NearestMipMapLinearFilter,
|
|
|
+ LinearFilter: LinearFilter,
|
|
|
+ LinearMipMapNearestFilter: LinearMipMapNearestFilter,
|
|
|
+ LinearMipMapLinearFilter: LinearMipMapLinearFilter
|
|
|
+};
|
|
|
+
|
|
|
|
|
|
export { ObjectLoader };
|