Skip to main content

Class: MTLLoader2

Asset-Management.MTLLoader2

Loads a Wavefront .mtl file specifying materials

Hierarchy

  • Loader

    MTLLoader2

Constructors

constructor

new MTLLoader2(manager)

Parameters

NameType
managerany

Overrides

Loader.constructor

Defined in

webgi/src/extras/asset_manager/importer/threejs/loaders/MTLLoader2.ts:24

Methods

load

load(url, onLoad, onProgress, onError): void

Loads and parses a MTL asset from a URL.

see setPath setResourcePath

note In order for relative texture references to resolve correctly you must call setResourcePath() explicitly prior to load.

Parameters

NameTypeDescription
urlanyURL to the MTL file.
onLoadany-
onProgressany-
onErrorany-

Returns

void

Defined in

webgi/src/extras/asset_manager/importer/threejs/loaders/MTLLoader2.ts:43


setMaterialOptions

setMaterialOptions(value): MTLLoader2

Parameters

NameType
valueany

Returns

MTLLoader2

Defined in

webgi/src/extras/asset_manager/importer/threejs/loaders/MTLLoader2.ts:79


parse

parse(text, path): MaterialCreator

Parses a MTL file.

see setPath setResourcePath

note In order for relative texture references to resolve correctly you must call setResourcePath() explicitly prior to parse.

Parameters

NameTypeDescription
textanyContent of MTL file
pathany-

Returns

MaterialCreator

Defined in

webgi/src/extras/asset_manager/importer/threejs/loaders/MTLLoader2.ts:97