Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- queryRange(rangeAABB) {
- var foundballs = [];
- if (!this.boundaryAABB.intersectsAABB(rangeAABB)) {
- return foundballs;
- }
- for (let c of this.balls) {
- if (rangeAABB.containsball(c)) {
- foundballs.push(c);
- }
- }
- if (this.nw == null) {
- return foundballs;
- }
- Array.prototype.push.apply(foundballs, this.nw.queryRange(rangeAABB));
- Array.prototype.push.apply(foundballs, this.ne.queryRange(rangeAABB));
- Array.prototype.push.apply(foundballs, this.sw.queryRange(rangeAABB));
- Array.prototype.push.apply(foundballs, this.se.queryRange(rangeAABB));
- return foundballs;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement