Class: XMaterials

XMaterials()

new XMaterials()

System for managing object's materials, affected by xlight. A system that managing object's material, plus environment effect, not material itself.

Source:

Methods

change(e, vparas) → {XMaterials}

Update mesh material uniforms

Parameters:
Name Type Description
e Entity

entity's material to be changed. e must has an Obj3.

vparas object

paras in the same structure of Visual.paras

Source:
Returns:

this

Type
XMaterials

changeLight(p) → {XMaterials}

Set scene light parameters.

Parameters:
Name Type Description
p object

light parameters

Properties
Name Type Description
ambient: array

ambient color - TODO better way handling css/number/array color

diffuse: array

diffuse color

position: array

change light position

intensity: array

light intensity

specular: array

specular color - will change all object's specular color

Source:
Returns:

this

Type
XMaterials

update(tick, entities)

Dispatch x.light parameters to lightened objects (Obj3.lightened == true).

Parameters:
Name Type Description
tick int
entities array.<Entity>
Source:

XMaterials()

new XMaterials()

Source:

Methods

change(e, vparas) → {XMaterials}

Update mesh material uniforms

Parameters:
Name Type Description
e Entity

entity's material to be changed. e must has an Obj3.

vparas object

paras in the same structure of Visual.paras

Source:
Returns:

this

Type
XMaterials

changeLight(p) → {XMaterials}

Set scene light parameters.

Parameters:
Name Type Description
p object

light parameters

Properties
Name Type Description
ambient: array

ambient color - TODO better way handling css/number/array color

diffuse: array

diffuse color

position: array

change light position

intensity: array

light intensity

specular: array

specular color - will change all object's specular color

Source:
Returns:

this

Type
XMaterials

update(tick, entities)

Dispatch x.light parameters to lightened objects (Obj3.lightened == true).

Parameters:
Name Type Description
tick int
entities array.<Entity>
Source: