public class QuadTree<T>
extends java.lang.Object
Constructor and Description |
---|
QuadTree(float minX,
float minY,
float maxX,
float maxY)
Creates an empty QuadTree with the bounds
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
int |
execute(Box bounds,
engine.resources.scene.quadtree.QuadTree.Executor<T> executor) |
int |
execute(float minX,
float minY,
float maxX,
float maxY,
engine.resources.scene.quadtree.QuadTree.Executor<T> executor) |
java.util.ArrayList<T> |
get(Box bounds,
java.util.ArrayList<T> values)
Gets all objects inside the specified boundary.
|
T |
get(float x,
float y)
Gets the object closest to (x,y)
|
java.util.ArrayList<T> |
get(float x,
float y,
float distance)
Gets all objects within a certain distance
|
java.util.ArrayList<T> |
get(float minX,
float minY,
float maxX,
float maxY,
java.util.ArrayList<T> values)
Gets all objects inside the specified area.
|
float |
getMaxX() |
float |
getMaxY() |
float |
getMinX() |
float |
getMinY() |
boolean |
put(float x,
float y,
T value)
Associates the specified value with the specified coords in this
QuadTree.
|
boolean |
remove(float x,
float y,
T value) |
int |
size() |
java.util.AbstractCollection<T> |
values() |
public QuadTree(float minX, float minY, float maxX, float maxY)
public boolean put(float x, float y, T value)
public boolean remove(float x, float y, T value)
public void clear()
public T get(float x, float y)
public java.util.ArrayList<T> get(float x, float y, float distance)
public java.util.ArrayList<T> get(Box bounds, java.util.ArrayList<T> values)
public java.util.ArrayList<T> get(float minX, float minY, float maxX, float maxY, java.util.ArrayList<T> values)
public int execute(Box bounds, engine.resources.scene.quadtree.QuadTree.Executor<T> executor)
public int execute(float minX, float minY, float maxX, float maxY, engine.resources.scene.quadtree.QuadTree.Executor<T> executor)
public int size()
public float getMinX()
public float getMaxX()
public float getMinY()
public float getMaxY()
public java.util.AbstractCollection<T> values()