@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
18 lines (15 loc) • 584 B
JavaScript
import { tetrahedron_compute_signed_volume } from "./tetrahedron_compute_signed_volume.js";
/**
*
* @param {TetrahedralMesh} mesh
* @param {ArrayLike<number>|number[]} points
* @param {number} tet_index
* @return {number}
*/
export function compute_tetrahedron_volume(mesh, points, tet_index) {
const a = mesh.getVertexIndex(tet_index, 0);
const b = mesh.getVertexIndex(tet_index, 1);
const c = mesh.getVertexIndex(tet_index, 2);
const d = mesh.getVertexIndex(tet_index, 3);
return tetrahedron_compute_signed_volume(points, a, b, c, d);
}