>>315
cy = camera.y % 5
ey = y % 5
if(cy-1 < ey && ey < cy+1){
 if((x*x+z*z) < 距離){
  処理
 }
}

自分ならとりあえずこんな風に書くな
これで無理ならxz軸に絞って分木クラスを作る