File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -297,15 +297,15 @@ class QuadTree {
297297 }
298298
299299 if ( typeof maxDistance === "undefined" ) {
300- // A circle that contains the entire QuadTree
300+ // A circle as big as the QuadTree's boundary
301301 const outerReach = Math . sqrt (
302302 Math . pow ( this . boundary . w , 2 ) + Math . pow ( this . boundary . h , 2 )
303303 ) ;
304304 // Distance of query point from center
305305 const pointDistance = Math . sqrt (
306306 Math . pow ( point . x , 2 ) + Math . pow ( point . y , 2 )
307307 ) ;
308- // One QuadTree size away from the query point
308+ // Together, a circle that encompasses the whole QuadTree
309309 maxDistance = outerReach + pointDistance ;
310310 }
311311
@@ -321,8 +321,10 @@ class QuadTree {
321321 if ( points . length === count ) {
322322 return points ; // Return when we hit the right size
323323 } else if ( points . length < count ) {
324+ // Grow
324325 inner = radius ;
325326 } else {
327+ // Shrink
326328 outer = radius ;
327329 limit -- ;
328330 }
You can’t perform that action at this time.
0 commit comments