UNPKG

playcanvas

Version:

PlayCanvas WebGL game engine

41 lines (38 loc) 926 B
import { BoundingBox } from '../core/shape/bounding-box.js'; class MorphTarget { constructor(options){ this.used = false; this.options = options; this._name = options.name; this._defaultWeight = options.defaultWeight || 0; this._aabb = options.aabb; this.deltaPositions = options.deltaPositions; this.morphPositions = !!options.deltaPositions; this.morphNormals = !!options.deltaNormals; } get name() { return this._name; } get defaultWeight() { return this._defaultWeight; } get aabb() { if (!this._aabb) { this._aabb = new BoundingBox(); if (this.deltaPositions) { this._aabb.compute(this.deltaPositions); } } return this._aabb; } clone() { return new MorphTarget(this.options); } _postInit() { if (!this.options.preserveData) { this.options = null; } this.used = true; } } export { MorphTarget };