@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
19 lines (15 loc) • 450 B
JavaScript
import { assert } from "../../../../core/assert.js";
/**
*
* @param {number} iFace
* @param {number} iVert
* @returns {number}
*/
export function MakeIndex(iFace, iVert) {
assert.greaterThanOrEqual(iVert, 0);
assert.lessThan(iVert, 4);
assert.greaterThanOrEqual(iFace, 0);
assert.isNonNegativeInteger(iFace,'iFace');
assert.isNonNegativeInteger(iVert,'iVert');
return (iFace << 2) | (iVert & 0x3);
}