
Mirror Engine API / MorphInstance
Class: MorphInstance
An instance of Morph. Contains weights to assign to every MorphTarget, manages selection of active morph targets.
Constructors
new MorphInstance()
new MorphInstance(morph: Morph): MorphInstance
Create a new MorphInstance instance.
Parameters
morph
The Morph to instance.
Returns
Properties
morph
morph: Morph
The morph with its targets, which is being instanced.
Methods
clone()
clone(): MorphInstance
Clones a MorphInstance. The returned clone uses the same Morph and weights are set to defaults.
Returns
A clone of the specified MorphInstance.
destroy()
destroy(): void
Frees video memory allocated by this object.
Returns
void
getWeight()
getWeight(key: string | number): number
Gets current weight of the specified morph target.
Parameters
key
An identifier for the morph target. Either the weight index or the weight name.
string
| number
Returns
number
Weight.
setWeight()
setWeight(key: string | number, weight: number): void
Sets weight of the specified morph target.
Parameters
key
An identifier for the morph target. Either the weight index or the weight name.
string
| number
weight
number
Weight.
Returns
void
update()
update(): void
Selects active morph targets and prepares morph for rendering. Called automatically by renderer.
Returns
void