mdx-m3-viewer
Version:
A browser WebGL model viewer. Mainly focused on models of the games Warcraft 3 and Starcraft 2.
30 lines (25 loc) • 784 B
text/typescript
import BoundingShape from '../../../parsers/m3/boundingshape';
/**
* An M3 bounding shape.
*/
export default class M3BoundingShape {
bone: number;
matrix: Float32Array;
constructor(boundingshape: BoundingShape) {
this.bone = boundingshape.bone;
this.matrix = boundingshape.matrix;
//this.name = bones[boundingshape.bone].name;
/*
var size = boundingshape.size;
var shape;
if (boundingshape.shape === 0) {
shape = gl.createCube(-size[0], -size[1], -size[2], size[0], size[1], size[2]);
} else if (boundingshape.shape === 1) {
shape = gl.createSphere(0, 0, 0, 9, 9, size[0]);
} else {
shape = gl.createCylinder(0, 0, 0, size[0], size[1], 9);
}
this.shape = shape;
*/
}
}