Class AABBCounter

java.lang.Object
com.prineside.tdi2.utils.AABBCounter

public final class AABBCounter extends Object
Lightweight AABB which only counts entities per cell Does not store entities Up to 127 entities per cell
  • Constructor Details

    • AABBCounter

      public AABBCounter(float cellSize)
  • Method Details

    • main

      public static void main(String[] args)
    • 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)