ModelData

Methods
3
Fields
5

Getting one

client:loadModelData(…)

Methods

MethodReturnsDescription
cloneColors()ModelDataThis model data, its colours its own (they already are: see the class doc).
recolor(number, number)ModelDataReplace face colour colorToReplace with colorToReplaceWith (HSL, a signed 16-bit value or its unsigned form), after the recolours befor…
light(number, number, number, number, number)Model?(ModelData, number, number, number, number, number) -> Model?: The model, lit with ambient, contrast and light direction x, y, `z…
light()Model?

Fields

FieldTypeDescription
DEFAULT_AMBIENTnumberThe ambient light light() uses.
DEFAULT_CONTRASTnumberThe contrast light() uses.
DEFAULT_XnumberThe light direction's x light() uses.
DEFAULT_YnumberThe light direction's y light() uses.
DEFAULT_ZnumberThe light direction's z light() uses.

Returned by

MethodReturnsDescription
Client.loadModelDataModelData?Cache model id's data, to recolour and light; nil when the cache has no such model. Each call makes a new one, so a recolour never reac…

Method details

recolor

recolor: (ModelData, number, number) -> ModelData

Replace face colour colorToReplace with colorToReplaceWith (HSL, a signed 16-bit value or its unsigned form), after the recolours before it; this model data.

light

light: ((ModelData, number, number, number, number, number) -> Model?) & ((ModelData) -> Model?)

(ModelData, number, number, number, number, number) -> Model?: The model, lit with ambient, contrast and light direction x, y, z, as the client lights it (the SD model in either mode).

(ModelData) -> Model?: The model lit with the defaults (DEFAULT_AMBIENT, ...).