/** * 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. * * @category Graphics */ export class MorphTarget { /** * Create a new MorphTarget instance. * * @param {object} options - Object for passing optional arguments. * @param {ArrayBuffer} options.deltaPositions - An array of 3-dimensional vertex position * offsets. * @param {number} options.deltaPositionsType - A format to store position offsets inside * {@link VertexBuffer}. Defaults to {@link TYPE_FLOAT32} if not provided. * @param {ArrayBuffer} [options.deltaNormals] - An array of 3-dimensional vertex normal * offsets. * @param {number} options.deltaNormalsType - A format to store normal offsets inside * {@link VertexBuffer}. Defaults to {@link TYPE_FLOAT32} if not provided. * @param {string} [options.name] - Name. * @param {BoundingBox} [options.aabb] - Bounding box. Will be automatically generated, if * undefined. * @param {number} [options.defaultWeight] - Default blend weight to use for this morph target. * @param {boolean} [options.preserveData] - When true, the morph target keeps its data passed using the options, * allowing the clone operation. */ constructor(options: { deltaPositions: ArrayBuffer; deltaPositionsType: number; deltaNormals?: ArrayBuffer; deltaNormalsType: number; name?: string; aabb?: BoundingBox; defaultWeight?: number; preserveData?: boolean; }, ...args: any[]); /** * A used flag. A morph target can be used / owned by the Morph class only one time. * * @type {boolean} */ used: boolean; options: { deltaPositions: ArrayBuffer; deltaPositionsType: number; deltaNormals?: ArrayBuffer; deltaNormalsType: number; name?: string; aabb?: BoundingBox; defaultWeight?: number; preserveData?: boolean; }; _name: string; _defaultWeight: number; _aabb: BoundingBox; deltaPositions: ArrayBuffer; destroy(): void; _vertexBufferPositions: VertexBuffer; _vertexBufferNormals: VertexBuffer; texturePositions: any; textureNormals: any; /** * Gets the name of the morph target. * * @type {string} */ get name(): string; /** * Gets the default weight of the morph target. * * @type {number} */ get defaultWeight(): number; get aabb(): BoundingBox; get morphPositions(): boolean; get morphNormals(): boolean; /** * 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. */ clone(): MorphTarget; _postInit(): void; _initVertexBuffers(graphicsDevice: any): void; _createVertexBuffer(device: any, data: any, dataType?: number): VertexBuffer; _setTexture(name: any, texture: any): void; } import { BoundingBox } from '../core/shape/bounding-box.js'; import { VertexBuffer } from '../platform/graphics/vertex-buffer.js';