UNPKG

mdx-m3-viewer

Version:

A browser WebGL model viewer. Mainly focused on models of the games Warcraft 3 and Starcraft 2.

32 lines (27 loc) 670 B
import GenericObject from './genericobject'; /** * An MDX bone. */ export default class Bone extends GenericObject { /** * @param {ModelViewer.viewer.Model} model * @param {ModelViewer.parsers.mdx.Bone} bone * @param {number} index */ constructor(model, bone, index) { super(model, bone, index); this.geosetAnimation = model.geosetAnimations[bone.geosetAnimationId]; } /** * @param {Float32Array} out * @param {ModelInstance} instance * @return {number} */ getVisibility(out, instance) { if (this.geosetAnimation) { return this.geosetAnimation.getAlpha(out, instance); } out[0] = 1; return -1; } }