new CollisionIndex() [source]
Methods
collides(box) [source]
Test if given box is collided with any other
| Parameter | Type | Description |
|---|---|---|
box
|
Array.<Number> | [minx, miny, maxx, maxy] |
Returns:
Boolean:insertBox(box) [source]
Insert box in collision index
| Parameter | Type | Description |
|---|---|---|
box
|
Array.<Number> | [minx, miny, maxx, maxy] |
Returns:
CollisionIndex: thisbulkInsertBox(boxes) [source]
Bulk insert boxes in collision index
Powered by rbush, it will perform better in subsquent query
| Parameter | Type | Description |
|---|---|---|
boxes
|
Array.<Array.<Number>> | [[minx, miny, maxx, maxy], ...] |
Returns:
CollisionIndex: thisclear() [source]
Clear the collision index