@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
19 lines (17 loc) • 608 B
JavaScript
const feature = {
id: "_primitive",
async applyMesh(meshData, mesh) {
const mode = meshData._primitive?.mode;
const topo = mode === 0 ? 1 : mode === 1 ? 2 : mode === 3 ? 3 : mode === 5 ? 4 : void 0;
if (topo) {
mesh._topology = topo;
}
const wm = meshData._worldMatrix;
const det3 = wm[0] * (wm[5] * wm[10] - wm[6] * wm[9]) + wm[1] * (wm[6] * wm[8] - wm[4] * wm[10]) + wm[2] * (wm[4] * wm[9] - wm[5] * wm[8]);
if (det3 > 0) {
mesh._reverseWinding = true;
}
}
};
export { feature as default };
//# sourceMappingURL=gltf-feature-primitive-lq8p4Yd3.esm.js.map