UNPKG

mdx-m3-viewer

Version:

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

27 lines (23 loc) 491 B
/** * M3 animation data validator. */ export default class M3Sts { /** * @param {M3ParserSts} sts */ constructor(sts) { const animIds = sts.animIds.getAll(); this.animIds = {}; // Allows direct checks instead of loops for (let i = 0, l = animIds.length; i < l; i++) { this.animIds[animIds[i]] = i; } } /** * @param {AnimationReference} animRef * @return {boolean} */ hasData(animRef) { return !!this.animIds[animRef.animId]; } }