Loader

Base class for implementing loaders.

Constructor

Loader()

Creates a new Loader. This should be called as base class.

Properties

.onLoadStart : Function

Will be called when load starts.

The default is a function with empty body.

.onLoadProgress : Function

Will be called while load progresses.

The default is a function with empty body.

.onLoadComplete : Function

Will be called when load completes.

The default is a function with empty body.

.crossOrigin : string

The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS. Default is "anonymous".

Methods

.createMaterial (m : object, texturePath : string) : Material

m — The parameters to create the material.
texturePath — The base path of the textures.

Creates the Material based on the parameters m.

.initMaterials (materials : Array, texturePath : string) : Array

materials — an array of parameters to create materials.
texturePath — The base path of the textures.

Creates an array of Material based on the array of parameters m. The index of the parameters decide the correct index of the materials.

Source

For more info on how to obtain the source code of this module see this page.