Package com.prineside.tdi2.utils
Class AABBCounter
java.lang.Object
com.prineside.tdi2.utils.AABBCounter
Lightweight AABB which only counts entities per cell
Does not store entities
Up to 127 entities per cell
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(float x, float y, float size) void
bake()
boolean
entriesExistInRect
(float minX, float minY, float maxX, float maxY) float
short
getCols()
int
getEntityCount
(float x, float y) In a squareint
getEntityCount
(int cellIdx) float
getMaxX()
float
getMaxY()
float
getMinX()
float
getMinY()
short
getRows()
boolean
lineCanHitEntry
(float x1, float y1, float x2, float y2) static void
void
reset()
-
Constructor Details
-
AABBCounter
public AABBCounter(float cellSize)
-
-
Method Details
-
main
-
getMinX
public float getMinX() -
getMaxX
public float getMaxX() -
getMinY
public float getMinY() -
getMaxY
public float getMaxY() -
getCellSize
public float getCellSize() -
getCols
public short getCols() -
getRows
public short getRows() -
reset
public void reset() -
add
public void add(float x, float y, float size) -
bake
public void bake() -
getEntityCount
public int getEntityCount(int cellIdx) -
getEntityCount
public int getEntityCount(float x, float y) In a square -
entriesExistInRect
public boolean entriesExistInRect(float minX, float minY, float maxX, float maxY) -
lineCanHitEntry
public boolean lineCanHitEntry(float x1, float y1, float x2, float y2)
-