37 for($subRadius = 0; $subRadius < $radius; $subRadius++){
38 $subRadiusSquared = $subRadius ** 2;
39 $nextSubRadiusSquared = ($subRadius + 1) ** 2;
40 $minX = (int) ($subRadius / M_SQRT2);
44 for($x = $subRadius; $x >= $minX; --$x){
45 for($z = $lastZ; $z <= $x; ++$z){
46 $distanceSquared = ($x ** 2 + $z ** 2);
47 if($distanceSquared < $subRadiusSquared){
49 }elseif($distanceSquared >= $nextSubRadiusSquared){
57 yield $subRadius => World::chunkHash($centerX + $x, $centerZ + $z);
59 yield $subRadius => World::chunkHash($centerX - $x - 1, $centerZ + $z);
61 yield $subRadius => World::chunkHash($centerX + $x, $centerZ - $z - 1);
63 yield $subRadius => World::chunkHash($centerX - $x - 1, $centerZ - $z - 1);
67 yield $subRadius => World::chunkHash($centerX + $z, $centerZ + $x);
69 yield $subRadius => World::chunkHash($centerX - $z - 1, $centerZ + $x);
71 yield $subRadius => World::chunkHash($centerX + $z, $centerZ - $x - 1);
73 yield $subRadius => World::chunkHash($centerX - $z - 1, $centerZ - $x - 1);