We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 009be3b commit 2b4cc79Copy full SHA for 2b4cc79
src/com/jwetherell/algorithms/data_structures/QuadTree.java
@@ -362,10 +362,10 @@ private void subdivide() {
362
363
private boolean insertIntoChildren(AABB b) {
364
//Try to insert into all children
365
- if (northWest.insert(b)) return true;
366
- if (northEast.insert(b)) return true;
367
- if (southWest.insert(b)) return true;
368
- if (southEast.insert(b)) return true;
+ if (northWest.aabb.insideThis(b) && northWest.insert(b)) return true;
+ if (northEast.aabb.insideThis(b) && northEast.insert(b)) return true;
+ if (southWest.aabb.insideThis(b) && southWest.insert(b)) return true;
+ if (southEast.aabb.insideThis(b) && southEast.insert(b)) return true;
369
return false;
370
}
371
0 commit comments