holy-quad-tree
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "holy-quad-tree", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Optimized QuadTree made by Sopur", | ||
@@ -5,0 +5,0 @@ "main": "src/node-js.js", |
@@ -20,3 +20,3 @@ # Sopur's QuadTree library | ||
```js | ||
const QuadTree = require("holy-quadtree"); | ||
const QuadTree = require("holy-quad-tree"); | ||
const qt = new QuadTree.QuadTree( | ||
@@ -23,0 +23,0 @@ new QuadTree.Bound(100, 100), // Width, height |
@@ -56,3 +56,2 @@ /** | ||
this.objects = []; | ||
this.objectReferences = []; | ||
this.nodes = []; | ||
@@ -207,9 +206,2 @@ } | ||
if (index !== -1) { | ||
if ( | ||
this.nodes[index].x > object.x + object.width || | ||
this.nodes[index].x < object.x - object.width || | ||
this.nodes[index].y > object.y + object.height || | ||
this.nodes[index].y < object.y - object.height | ||
) | ||
return []; | ||
returnObjects = returnObjects.concat(this.nodes[index].retrieve(object)); | ||
@@ -220,9 +212,2 @@ | ||
for (let i = 0; i < this.nodes.length; i++) { | ||
if ( | ||
this.nodes[i].x > object.x + object.width || | ||
this.nodes[i].x < object.x - object.width || | ||
this.nodes[i].y > object.y + object.height || | ||
this.nodes[i].y < object.y - object.height | ||
) | ||
return []; | ||
returnObjects = returnObjects.concat(this.nodes[i].retrieve(object)); | ||
@@ -239,3 +224,3 @@ } | ||
* @param {Node} object The object that was inserted | ||
* @return {Node} The subnode, or false if it wasn't found | ||
* @return {QuadTree} The subnode, or false if it wasn't found | ||
* @private | ||
@@ -242,0 +227,0 @@ */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
257
14014