Package arc.math.geom
Class IntQuadTree
java.lang.Object
arc.math.geom.IntQuadTree
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRepresents an object in a QuadTree. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanany(float x, float y, float width, float height) voidclear()Removes all objects.protected IntQuadTreegetFittingChild(Rect boundingBox) voidgetObjects(IntSeq out) Adds all quadtree objects to the specified Seq.protected voidhitbox(int t) voidinsert(int obj) Inserts an object into this node or its child nodes.voidProcesses objects that may intersect the given rectangle.voidFills the out parameter with any objects that may intersect the given rectangle.voidProcesses objects that may intersect the given rectangle.voidFills the out parameter with any objects that may intersect the given rectangle.protected IntQuadTreebooleanremove(int obj) Removes an object from this node or its child nodes.protected voidsplit()protected voidunsplit()
-
Field Details
-
tmp
-
maxObjectsPerNode
protected static final int maxObjectsPerNode- See Also:
-
prov
-
bounds
-
objects
-
botLeft
-
botRight
-
topLeft
-
topRight
-
leaf
public boolean leaf -
totalObjects
public int totalObjects
-
-
Constructor Details
-
IntQuadTree
-
-
Method Details
-
split
protected void split() -
unsplit
protected void unsplit() -
insert
public void insert(int obj) Inserts an object into this node or its child nodes. This will split a leaf node if it exceeds the object limit. -
remove
public boolean remove(int obj) Removes an object from this node or its child nodes. -
clear
public void clear()Removes all objects. -
getFittingChild
-
intersect
Processes objects that may intersect the given rectangle.This will never result in false positives.
-
any
public boolean any(float x, float y, float width, float height) - Returns:
- whether an object overlaps this rectangle. This will never result in false positives.
-
intersect
Processes objects that may intersect the given rectangle.This will never result in false positives.
-
intersect
Fills the out parameter with any objects that may intersect the given rectangle.This will result in false positives, but never a false negative.
-
intersect
Fills the out parameter with any objects that may intersect the given rectangle. -
getObjects
Adds all quadtree objects to the specified Seq. -
newChild
-
hitbox
protected void hitbox(int t)
-