public class Quad<T extends Positionable> extends Rectangle implements PositionChangeListener<T>
Modifier and Type | Field and Description |
---|---|
protected Quad<T> |
bottomLeft |
protected Quad<T> |
bottomRight |
static com.badlogic.gdx.graphics.Color |
ELEMENT_COLOR |
protected int |
elementLimitPerQuad |
protected List<T> |
elements |
protected Quad<T> |
parent |
static com.badlogic.gdx.graphics.Color |
QUAD_COLOR |
protected Quad<T> |
topLeft |
protected Quad<T> |
topRight |
Constructor and Description |
---|
Quad(int elementLimitPerQuad,
float x,
float y,
float width,
float height) |
Quad(Quad<T> parent,
float x,
float y,
float width,
float height) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T element) |
protected boolean |
addElement(T element) |
protected boolean |
addElementToChild(T element) |
int |
getElementLimitPerQuad() |
List<T> |
getElements() |
void |
getElementsIntersectingLineSegment(Collection<T> result,
LineSegment lineSegment) |
List<T> |
getElementsIntersectingLineSegment(LineSegment lineSegment) |
void |
getElementsWithinRegion(Collection<T> result,
Parallelogram parallelogram) |
List<T> |
getElementsWithinRegion(Parallelogram parallelogram) |
Quad<T> |
getParent() |
int |
getTotalQuads() |
void |
positionChanged(T moved) |
boolean |
remove(T element) |
protected boolean |
removeElement(T element) |
protected boolean |
removeElementFromChild(T element) |
void |
render(Graphics g) |
protected void |
subdivide() |
addPostionChangeListener, contains, contains, contains, draw, getCenterX, getCenterY, getDistanceTo, getMaxX, getMaxY, getMinX, getMinY, getNumberOfSides, getRotation, intersection, intersects, intersects, intersects, intersects, removePositionChangeListener, rotate, rotateAround, set, set, set, setHeight, setRotation, setRotationAround, setWidth, setX, setY
contains, contains, getHeight, getWidth, getX, getY, merge, overlaps, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getHeight, getWidth
getX, getY
public static com.badlogic.gdx.graphics.Color QUAD_COLOR
public static com.badlogic.gdx.graphics.Color ELEMENT_COLOR
protected Quad<T extends Positionable> parent
protected Quad<T extends Positionable> topLeft
protected Quad<T extends Positionable> topRight
protected Quad<T extends Positionable> bottomLeft
protected Quad<T extends Positionable> bottomRight
protected List<T extends Positionable> elements
protected int elementLimitPerQuad
public Quad(int elementLimitPerQuad, float x, float y, float width, float height)
public void render(Graphics g)
public boolean add(T element)
protected boolean addElement(T element)
protected boolean addElementToChild(T element)
protected void subdivide()
public boolean remove(T element)
protected boolean removeElementFromChild(T element)
protected boolean removeElement(T element)
public List<T> getElementsWithinRegion(Parallelogram parallelogram)
public void getElementsWithinRegion(Collection<T> result, Parallelogram parallelogram)
public List<T> getElementsIntersectingLineSegment(LineSegment lineSegment)
public void getElementsIntersectingLineSegment(Collection<T> result, LineSegment lineSegment)
public int getTotalQuads()
public void positionChanged(T moved)
positionChanged
in interface PositionChangeListener<T extends Positionable>
public int getElementLimitPerQuad()
Copyright © 2014. All rights reserved.