Package toxi.geom
Class PointQuadtree
java.lang.Object
toxi.geom.Rect
toxi.geom.PointQuadtree
- All Implemented Interfaces:
Shape2D,SpatialIndex<Vec2D>
Implements a spatial subdivision tree to work efficiently with large numbers
of 2D particles. This quadtree can only be used for particle type objects and
does NOT support 2D mesh geometry as other forms of quadtree might do.
For further reference also see the QuadtreeDemo in the /examples folder.
-
Nested Class Summary
Nested Classes -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionPointQuadtree(float x, float y, float w, float h) PointQuadtree(PointQuadtree parent, float x, float y, float w, float h) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleanbooleanitemsWithinRadius(Vec2D p, float radius, List<Vec2D> results) itemsWithinRect(Rect bounds, List<Vec2D> results) voidprewalk(QuadtreeVisitor visitor) booleanintsize()booleanMethods inherited from class toxi.geom.Rect
containsPoint, copy, equals, fromCenterExtent, getArea, getAspect, getBottom, getBottomLeft, getBottomRight, getBoundingCircle, getBoundingRect, getBounds, getCentroid, getCircumference, getDimensions, getEdge, getEdges, getLeft, getMappedPointInRect, getRandomPoint, getRight, getTop, getTopLeft, getTopRight, getUnmappedPointInRect, growToContainPoint, hashCode, intersectionRectWith, intersectsCircle, intersectsRay, intersectsRect, scale, set, set, setDimension, setPosition, toPolygon2D, toPolygon2D, toString, translate, translate, union, unionRectWith
-
Constructor Details
-
PointQuadtree
public PointQuadtree(float x, float y, float w, float h) -
PointQuadtree
-
PointQuadtree
-
-
Method Details
-
clear
public void clear()- Specified by:
clearin interfaceSpatialIndex<Vec2D>
-
findNode
-
index
- Specified by:
indexin interfaceSpatialIndex<Vec2D>
-
isIndexed
- Specified by:
isIndexedin interfaceSpatialIndex<Vec2D>
-
itemsWithinRadius
- Specified by:
itemsWithinRadiusin interfaceSpatialIndex<Vec2D>
-
itemsWithinRect
-
prewalk
-
reindex
- Specified by:
reindexin interfaceSpatialIndex<Vec2D>
-
size
public int size()- Specified by:
sizein interfaceSpatialIndex<Vec2D>
-
unindex
- Specified by:
unindexin interfaceSpatialIndex<Vec2D>
-