Why are there 3 nested loop? If an explosion is spawned within a given sphere all there is to do would be generating a random radius within that sphere and a random euler-angle to know where to place the particle. The 3 nested loops look like you would spawn voxels within a cube/box