Class: MorphAnimation

MorphAnimation

MorphAnimation is a Component that can be added to ModelInstances to control morph target animations. The Mesh objects used by the ModelInstance's Model must contain morph data generated with Mesh#generateMorphData. Up to 8 morph targets can be active at a time. If more morph targets have a weight assigned to them, only those with the highest weight are used.


new MorphAnimation( [targets])

Parameters:
Name Type Argument Description
targets Array <optional>

An Array of MorphTarget objects. If omitted, it will use the morph pose already assigned to the entity (if any).

Properties:
Name Type Description
numMorphTargets number

The amount of morph targets in total (active and non-active).

Author:
  • derschmale <http://www.derschmale.com>
See:

Extends

Members


entity

The target entity.

Inherited From:

Methods


getMorphTarget(index)

Retrieves the morph target at the given index, as sorted by weight.

Parameters:
Name Type Description
index Number

The index of the morph target.

Returns:
Type
MorphTarget

setWeight(name, value)

Sets the weight of the morph target with the given name.

Parameters:
Name Type Description
name string

The name of the morph target to influence.

value number

The new weight of the morph target.