UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

25 lines (16 loc) 520 B
import { sparse_typed_array_hash } from "../../../../core/collection/array/typed/sparse_typed_array_hash.js"; /** * * @param {THREE.BufferAttribute} attribute * @returns {number} */ export function computeBufferAttributeHash(attribute) { let result = 0; if (attribute !== null) { const data = attribute.array; const data_size = data.length; result += data_size; result ^= sparse_typed_array_hash(data, 0, data_size); } return result; }