js: Fix computeMeshletBounds to always return an array

The existing interface is error-prone for meshes with a small number of
triangles.
This commit is contained in:
Arseny Kapoulkine
2024-08-21 21:19:30 -07:00
parent 9044bc6c38
commit 453fafee3f
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -194,7 +194,7 @@ var MeshoptClusterizer = (function () {
// reset memory
sbrk(verticesp - sbrk(0));
return results.length > 1 ? results : results[0];
return results;
}
function computeClusterBounds(indices, vertex_positions, vertex_positions_stride) {
+1 -1
View File
@@ -40,6 +40,6 @@ export const MeshoptClusterizer: {
cone_weight?: number
) => MeshletBuffers;
computeClusterBounds: (indices: Uint32Array, vertex_positions: Float32Array, vertex_positions_stride: number) => Bounds;
computeMeshletBounds: (buffers: MeshletBuffers, vertex_positions: Float32Array, vertex_positions_stride: number) => Bounds | Bounds[];
computeMeshletBounds: (buffers: MeshletBuffers, vertex_positions: Float32Array, vertex_positions_stride: number) => Bounds[];
extractMeshlet: (buffers: MeshletBuffers, index: number) => Meshlet;
};
+1 -1
View File
@@ -194,7 +194,7 @@ var MeshoptClusterizer = (function () {
// reset memory
sbrk(verticesp - sbrk(0));
return results.length > 1 ? results : results[0];
return results;
}
function computeClusterBounds(indices, vertex_positions, vertex_positions_stride) {