mdx-m3-viewer
Version:
A browser WebGL model viewer. Mainly focused on models of the games Warcraft 3 and Starcraft 2.
22 lines (18 loc) • 511 B
JavaScript
import ModelInstance from './modelinstance';
/**
* A textured model instance.
* Gives a consistent API for texture overloading for handlers that use it.
*/
export default class TexturedModelInstance extends ModelInstance {
/**
* Overrides a texture with another one.
*
* @param {Texture} which
* @param {Texture} texture
*/
setTexture(which, texture) {
let view = this.modelView.getShallowCopy();
view.textures.set(which, texture);
this.model.viewChanged(this, view);
}
}