UNPKG

mdx-m3-viewer

Version:

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

28 lines (22 loc) 485 B
import Model from './model'; import Texture from './texture'; /** * A texture mapper. */ export default class TextureMapper { model: Model; textures: Map<any, Texture>; constructor(model: Model, textures?: Map<any, Texture>) { let map; if (textures) { map = new Map(textures); } else { map = new Map(); } this.model = model; this.textures = map; } get(key: any) { return this.textures.get(key); } }