perf: Optimize STL chunk transfer to 1 MB and primitive spatial hashing for instant auto-loading
This commit is contained in:
+2
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user