diff --git a/lod.js b/lod.js index 2e4a511095..4c5744c24d 100644 --- a/lod.js +++ b/lod.js @@ -26,24 +26,30 @@ const uint16Array = new Uint16Array(1); return result; } */ const tp16 = 2 ** 16; -const tp5 = 2 ** 5; +const tp11 = 2 ** 11; const _getHashMinLod = (min, lod) => { let result; uint16Array[0] = min.x; result = uint16Array[0]; + result *= tp16; + uint16Array[0] = min.y; - result = (result * tp16) + uint16Array[0]; + result += uint16Array[0]; + result *= tp11; + uint16Array[0] = min.z; - result = (result * tp16) + uint16Array[0]; + result += uint16Array[0]; + result *= tp16; + uint16Array[0] = lod; - result = (result * tp5) + uint16Array[0]; + result += uint16Array[0]; return result; }; const _getHashChunk = chunk => _getHashMinLod(chunk.min, chunk.lod); -const _getHashMinLodArray = (min, lodArray) => min.x + ',' + min.y + ',' + min.z + ':' + lodArray.join(','); -const _getHashChunkLodArray = chunk => _getHashMinLodArray(chunk.min, chunk.lodArray); +// const _getHashMinLodArray = (min, lodArray) => min.x + ',' + min.y + ',' + min.z + ':' + lodArray.join(','); +// const _getHashChunkLodArray = chunk => _getHashMinLodArray(chunk.min, chunk.lodArray); class Dominator extends EventTarget { constructor(base, onload) {