File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ var DIR_OPPOSITES = [
2727 [ LL , LR ] // + y
2828 ] ;
2929
30- var MAX_LEVELS = 6 ;
30+ var MAX_LEVELS = 8 ;
3131
3232
3333var Cell = function ( bounds ) {
@@ -339,10 +339,11 @@ QuadTree.createFromCSGFields = function(fields, maxLevel) {
339339 upperLeftMaterial != lowerRightMaterial ||
340340 lowerLeftMaterial != upperRightMaterial ) {
341341
342- console . log ( 'adding cell at (' + x + ', ' + y + ')' ) ;
342+ // add cell at max level
343+ var xx = ( cellBounds . left / bounds . width ( ) ) * tree . maxVal ;
344+ var yy = ( cellBounds . bottom / bounds . height ( ) ) * tree . maxVal ;
343345
344- // add cell at max level
345- tree . addCellAtDepth ( cellBounds . left , cellBounds . bottom , maxLevel ) ;
346+ tree . addCellAtDepth ( xx , yy , maxLevel ) ;
346347 }
347348 }
348349 }
You can’t perform that action at this time.
0 commit comments