UNPKG

mdx-m3-viewer

Version:

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

25 lines (19 loc) 593 B
import M3ParserSts from '../../../parsers/m3/sts'; import { M3ParserAnimationReference } from '../../../parsers/m3/animationreference'; /** * M3 animation data validator. */ export default class M3Sts { animIds: object; constructor(sts: M3ParserSts) { this.animIds = {}; let animIds = sts.animIds.getAll(); // Allows direct checks instead of loops for (let i = 0, l = animIds.length; i < l; i++) { this.animIds[animIds[i]] = i; } } hasData(animRef: M3ParserAnimationReference) { return !!this.animIds[animRef.animId]; } }