Class MTLFileLoader
Index
Constructors
constructor
-
Returns MTLFileLoader
Properties
materials
All material loaded from the mtl will be set here
StaticINVERT_ TEXTURE_ Y
Invert Y-Axis of referenced textures on load
Methods
parse MTL
-
parseMTL(
scene: Scene,
data: string | ArrayBuffer,
rootUrl: string,
assetContainer: Nullable<AssetContainer>,
invertTextureY?: boolean,
materialNames?: ReadonlySet<string>,
trackTextureLoading?: boolean,
): Promise<void>[]This function will read the mtl file and create each material described inside This function could be improve by adding : -some component missing (Ni, Tf...) -including the specific options available
Parameters
- scene: Scene
defines the scene the material will be created in
- data: string | ArrayBuffer
defines the mtl data to parse
- rootUrl: string
defines the rooturl to use in order to load relative dependencies
- assetContainer: Nullable<AssetContainer>
defines the asset container to store the material in (can be null)
- invertTextureY: boolean = MTLFileLoader.INVERT_TEXTURE_Y
defines whether referenced textures are inverted on the Y axis
OptionalmaterialNames: ReadonlySet<string>defines which materials to load, or all materials if omitted
- trackTextureLoading: boolean = false
collects texture loading promises and starts delayed textures when true; defaults to false
Returns Promise<void>[]
the texture loading promises, or an empty array when trackTextureLoading is false
- scene: Scene
Class reading and parsing the MTL file bundled with the obj file.