perf: Optimize STL chunk transfer to 1 MB and primitive spatial hashing for instant auto-loading

This commit is contained in:
2026-08-26 00:50:40 +02:00
parent c8f287cb3c
commit 1abd4f74ac
3 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -283,7 +283,8 @@
const numTriangles = Math.floor(rawTriangles.length / 9);
const posMap = new Map();
const getVertexIndex = (x, y, z) => {
const key = `${Math.round(x * 10000)},${Math.round(y * 10000)},${Math.round(z * 10000)}`;
const ix = (x * 2000) | 0, iy = (y * 2000) | 0, iz = (z * 2000) | 0;
const key = (ix * 73856093 ^ iy * 19349663 ^ iz * 83492791) >>> 0;
let idx = posMap.get(key);
if (idx === undefined) {
idx = posMap.size;