UNPKG

mdx-m3-viewer

Version:

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

32 lines (26 loc) 688 B
import Scene from './scene'; import TextureMapper from './texturemapper'; import Model from './model'; import ModelInstance from './modelinstance'; /** * A render batch. */ export default abstract class RenderBatch { scene: Scene; model: Model; textureMapper: TextureMapper; instances: ModelInstance[] = []; count: number = 0; abstract render(): void; constructor(scene: Scene, model: Model, textureMapper: TextureMapper) { this.scene = scene; this.model = model; this.textureMapper = textureMapper; } clear() { this.count = 0; } add(instance: ModelInstance) { this.instances[this.count++] = instance; } }