Mirror Engine
V5
How To
Mirror Engine Logo

Mirror Engine API


Mirror Engine API / MorphTarget

Class: MorphTarget

A Morph Target (also known as Blend Shape) contains deformation data to apply to existing mesh. Multiple morph targets can be blended together on a mesh. This is useful for effects that are hard to achieve with conventional animation and skinning.

Constructors

new MorphTarget()

new MorphTarget(options: {
  aabb: BoundingBox;
  defaultWeight: number;
  deltaNormals: ArrayBuffer;
  deltaPositions: ArrayBuffer;
  name: string;
  preserveData: boolean;
 }, ...args: any): MorphTarget

Create a new MorphTarget instance.

Parameters

options

Object for passing optional arguments.

aabb?

BoundingBox

Bounding box. Will be automatically generated, if undefined.

defaultWeight?

number

Default blend weight to use for this morph target.

deltaNormals?

ArrayBuffer

An array of 3-dimensional vertex normal offsets.

deltaPositions

ArrayBuffer

An array of 3-dimensional vertex position offsets.

name?

string

Name.

preserveData?

boolean

When true, the morph target keeps its data passed using the options, allowing the clone operation.

args

...any

Returns

MorphTarget

Properties

used

used: boolean = false

A used flag. A morph target can be used / owned by the Morph class only one time.

defaultWeight

Get Signature

get defaultWeight(): number

Gets the default weight of the morph target.

Returns

number


name

Get Signature

get name(): string

Gets the name of the morph target.

Returns

string

Methods

clone()

clone(): MorphTarget

Returns an identical copy of the specified morph target. This can only be used if the morph target was created with options.preserveData set to true.

Returns

MorphTarget

A morph target instance containing the result of the cloning.

Mirror Engine Logo