meta-next
Version:
23 lines (18 loc) • 350 B
JavaScript
const result = []
const execute = (x, y, buffer, depth) =>
{
let currDepth = 0
result.length = 0
for(let n = 0; n < buffer.length; n++) {
const node = buffer[n]
if(node.volume.vsPoint(x, y)) {
result.push(node)
currDepth++
if(depth === currDepth) {
break
}
}
}
return result
}
export { execute }