SHARE
TWEET

Untitled

a guest Jun 19th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. insert(ball) {
  2.         if (!this.boundaryAABB.containsball(ball)) {
  3.             return false;
  4.         }
  5.         if (this.balls.length < QuadTree.size && this.nw == null) {
  6.             this.balls.push(ball);
  7.             return true;
  8.         }
  9.         if (this.nw == null) {
  10.             this.subdivide();
  11.         }
  12.         if (this.nw.insert(ball)) { return true; };
  13.         if (this.ne.insert(ball)) { return true; };
  14.         if (this.sw.insert(ball)) { return true; };
  15.         if (this.se.insert(ball)) { return true; };
  16.         return false;
  17.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top