vox-reader
Version:
Takes a Byte Array of .vox file data and returns a JavaScript Object with all the containing informations
20 lines (13 loc) • 326 B
text/typescript
const { floor } = Math
const groupArray = (array : Array<any>, groupSize : number) =>
{
return array.reduce((result, item, index) =>
{
const i1 = floor(index / groupSize)
const i2 = index % groupSize
if(i2 == 0) result.push([])
result[i1].push(item)
return result
}, []);
}
export = groupArray