Skip to main content

Class: AMaterialManager<T>

Core-API.AMaterialManager

Type parameters

NameType
Textends string

Hierarchy

Implements

Constructors

constructor

new AMaterialManager<T>()

Type parameters

NameType
Textends string

Overrides

SimpleEventDispatcher.constructor

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:75

Methods

findOrCreate

findOrCreate(info, params?): undefined | IMaterial<any>

Parameters

NameType
infostring
params?AnyOptions

Returns

undefined | IMaterial<any>

Implementation of

IMaterialManager.findOrCreate

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:84


generateFromTemplate

generateFromTemplate(name, params?): undefined | IMaterial<any>

Parameters

NameType
namestring
params?AnyOptions

Returns

undefined | IMaterial<any>

Implementation of

IMaterialManager.generateFromTemplate

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:89


generateFromTemplateType

generateFromTemplateType(type, params?): undefined | IMaterial<any>

Parameters

NameType
typestring
params?AnyOptions

Returns

undefined | IMaterial<any>

Implementation of

IMaterialManager.generateFromTemplateType

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:94


findTemplate

findTemplate(name): undefined | IMaterialTemplate

Parameters

NameType
namestring

Returns

undefined | IMaterialTemplate

Implementation of

IMaterialManager.findTemplate

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:100


registerMaterial

registerMaterial(material): void

Parameters

NameType
materialIMaterial<any>

Returns

void

Implementation of

IMaterialManager.registerMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:150


registerMaterialObject

registerMaterialObject(material): IMaterial<any>

Parameters

NameType
materialany

Returns

IMaterial<any>

Implementation of

IMaterialManager.registerMaterialObject

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:164


unregisterMaterial

unregisterMaterial(material): void

This is done automatically on material dispose.

Parameters

NameType
materialIMaterial<any>

Returns

void

Implementation of

IMaterialManager.unregisterMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:178


registerMaterialTemplate

registerMaterialTemplate(template): void

Parameters

NameType
templateIMaterialTemplate

Returns

void

Implementation of

IMaterialManager.registerMaterialTemplate

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:183


unregisterMaterialTemplate

unregisterMaterialTemplate(template): void

Parameters

NameType
templateIMaterialTemplate

Returns

void

Implementation of

IMaterialManager.unregisterMaterialTemplate

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:192


dispose

dispose(): void

Returns

void

Implementation of

IMaterialManager.dispose

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:196


findMaterial

findMaterial(uuid): undefined | IMaterial<any>

Parameters

NameType
uuidstring

Returns

undefined | IMaterial<any>

Implementation of

IMaterialManager.findMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:201


findMaterialsByName

findMaterialsByName(name): IMaterial<any>[]

Parameters

NameType
namestring

Returns

IMaterial<any>[]

Implementation of

IMaterialManager.findMaterialsByName

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:205


getMaterialsOfType

getMaterialsOfType<TM>(typeSlug): TM[]

Type parameters

NameType
TMextends IMaterial<any, TM> = IMaterial<any>

Parameters

NameType
typeSlugundefined | string

Returns

TM[]

Implementation of

IMaterialManager.getMaterialsOfType

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:209


getAllMaterials

getAllMaterials(): IMaterial<any>[]

Returns

IMaterial<any>[]

Implementation of

IMaterialManager.getAllMaterials

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:213


processModel

processModel(object, options): IModel<any>

Parameters

NameType
objectIModel<any>
optionsAnyOptions

Returns

IModel<any>

Implementation of

IMaterialManager.processModel

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:217


processMaterial

processMaterial(material, options): IMaterial<any>

Parameters

NameType
materialIMaterial<any>
optionsAnyOptions

Returns

IMaterial<any>

Implementation of

IMaterialManager.processMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:243


registerMaterialExtension

registerMaterialExtension(extension): void

Parameters

NameType
extensionMaterialExtension

Returns

void

Implementation of

IMaterialManager.registerMaterialExtension

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:252


unregisterMaterialExtension

unregisterMaterialExtension(extension): void

Parameters

NameType
extensionMaterialExtension

Returns

void

Implementation of

IMaterialManager.unregisterMaterialExtension

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:255


exportMaterial

exportMaterial(material, filename?, minify?, download?): File

Parameters

NameTypeDefault value
materialIMaterial<any>undefined
filename?stringundefined
minifybooleantrue
downloadbooleanfalse

Returns

File

Implementation of

IMaterialManager.exportMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:260


addEventListener

addEventListener(type, listener): void

Adds a listener to an event type.

Parameters

NameType
typeT
listener(event: IEvent<T>) => void

Returns

void

Implementation of

IMaterialManager.addEventListener

Inherited from

SimpleEventDispatcher.addEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:48


hasEventListener

hasEventListener(type, listener): boolean

Checks if listener is added to an event type.

Parameters

NameType
typeT
listener(event: IEvent<T>) => void

Returns

boolean

Implementation of

IMaterialManager.hasEventListener

Inherited from

SimpleEventDispatcher.hasEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:56


removeEventListener

removeEventListener(type, listener): void

Removes a listener from an event type.

Parameters

NameType
typeT
listener(event: IEvent<T>) => void

Returns

void

Implementation of

IMaterialManager.removeEventListener

Inherited from

SimpleEventDispatcher.removeEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:63


dispatchEvent

dispatchEvent(event): void

Fire an event type.

Parameters

NameType
eventIEvent<T>

Returns

void

Implementation of

IMaterialManager.dispatchEvent

Inherited from

SimpleEventDispatcher.dispatchEvent

Defined in

webgi/src/helpers/EventDispatcher.ts:74


_generateFromTemplate

Protected Abstract _generateFromTemplate(template, oldMaterial?): undefined | IMaterial<any>

Parameters

NameType
templateIMaterialTemplate
oldMaterial?AnyOptions

Returns

undefined | IMaterial<any>

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:104


_refreshTextureRefs

Protected _refreshTextureRefs(): void

Returns

void

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:107


_getMapsForMaterial

Protected _getMapsForMaterial(material): Set<ITexture<any>>

Parameters

NameType
materialIMaterial<any>

Returns

Set<ITexture<any>>

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:118


_disposeMaterial

Protected _disposeMaterial(e): void

Parameters

NameType
eObject
e.target?IMaterial<any>

Returns

void

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:132


_processModel

Protected Abstract _processModel(object, options): any

Parameters

NameType
objectany
optionsAnyOptions

Returns

any

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:222


_processMaterial

Protected _processMaterial(material, options): undefined | IMaterial<any>

Parameters

NameType
materialany
optionsAnyOptions

Returns

undefined | IMaterial<any>

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:223

Properties

_materialExtensions

Protected _materialExtensions: MaterialExtension[] = []

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:250