UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

17 lines (15 loc) 399 B
/** * * @param {function} random * @param {number[]} result * @param {number} result_offset */ export function randomPointInBox(random, result, result_offset) { const x = random() - 0.5; const y = random() - 0.5; const z = random() - 0.5; //write the result result[result_offset] = x; result[result_offset + 1] = y; result[result_offset + 2] = z; }