Package com.prineside.tdi2.utils
Class AABB<T>
java.lang.Object
com.prineside.tdi2.utils.AABB<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic final class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanentriesExistInRect(float minX, float minY, float maxX, float maxY) floatfloatshortgetCols()intgetEntityCount(int cellIdx) floatgetMaxX()floatgetMaxY()floatgetMinX()floatgetMinY()shortgetRows()booleanisEmpty()booleanlineCanHitEntry(float x1, float y1, float x2, float y2) voidtraverseEntriesInLine(float x1, float y1, float x2, float y2, AABB.EntryFilter filter, AABB.EntryRetriever<T> cb) voidtraverseEntriesInRect(float minX, float minY, float maxX, float maxY, AABB.EntryFilter filter, AABB.EntryRetriever<T> cb) Check entriesExistInRect() before calling this Traverse through entities touching the rectangle Very broad but does the job
-
Field Details
-
debugBatch
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
getMinX
public float getMinX() -
getMaxX
public float getMaxX() -
getMinY
public float getMinY() -
getMaxY
public float getMaxY() -
getCols
public short getCols() -
getRows
public short getRows() -
getCellSizeXInv
public float getCellSizeXInv() -
getCellSizeYInv
public float getCellSizeYInv() -
getEntityCount
public int getEntityCount(int cellIdx) -
entriesExistInRect
public boolean entriesExistInRect(float minX, float minY, float maxX, float maxY) -
lineCanHitEntry
public boolean lineCanHitEntry(float x1, float y1, float x2, float y2) -
traverseEntriesInRect
public void traverseEntriesInRect(float minX, float minY, float maxX, float maxY, AABB.EntryFilter filter, AABB.EntryRetriever<T> cb) Check entriesExistInRect() before calling this Traverse through entities touching the rectangle Very broad but does the job -
traverseEntriesInLine
public void traverseEntriesInLine(float x1, float y1, float x2, float y2, AABB.EntryFilter filter, AABB.EntryRetriever<T> cb)
-