new QuadTree(x, y, width, height, maxObjects, maxLevels, level)
A QuadTree implementation. The original code was a conversion of the Java code posted to GameDevTuts.
However I've tweaked it massively to add node indexing, removed lots of temp. var creation and significantly increased performance as a result.
Original version at https://github.com/timohausmann/quadtree-js/
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
x | number | The top left coordinate of the quadtree. | ||
y | number | The top left coordinate of the quadtree. | ||
width | number | The width of the quadtree in pixels. | ||
height | number | The height of the quadtree in pixels. | ||
maxObjects | number | <optional> | 10 | The maximum number of objects per node. |
maxLevels | number | <optional> | 4 | The maximum number of levels to iterate to. |
level | number | <optional> | 0 | Which level is this? |
- Source code: math/QuadTree.js (Line 23)
Please login to continue.