atavism.server.engine
Class MobilePerceiver<ElementType extends QuadTreeElement<ElementType>>
java.lang.Object
atavism.server.engine.Perceiver<ElementType>
atavism.server.engine.MobilePerceiver<ElementType>
- Type Parameters:
ElementType
-
- All Implemented Interfaces:
- java.io.Serializable
public class MobilePerceiver<ElementType extends QuadTreeElement<ElementType>>
- extends Perceiver<ElementType>
The MobilePerceiver is used for all elements in the Quad Tree that are able to move to keep track of what
an object should now be able to perceive.
- Author:
- Andrew Harrison
- See Also:
- Serialized Form
Fields inherited from class atavism.server.engine.Perceiver |
log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MobilePerceiver
public MobilePerceiver()
MobilePerceiver
public MobilePerceiver(ElementType elem)
MobilePerceiver
public MobilePerceiver(ElementType elem,
int radius)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
overlaps
public boolean overlaps(Geometry g)
- Checks whether the perceiver radius overlaps the specified geometry.
- Specified by:
overlaps
in class Perceiver<ElementType extends QuadTreeElement<ElementType>>
contains
public boolean contains(Geometry g)
- Specified by:
contains
in class Perceiver<ElementType extends QuadTreeElement<ElementType>>
shouldUpdateBasedOnLoc
public boolean shouldUpdateBasedOnLoc(Point loc)
- This virtual function returns true if the elements visible to a
perceiver should be updated if it moves to the loc supplied.
MobilePerceivers determine whether elements should be updated
based on whether the new location is further than
defaultPerceiverUpdateDistance from the last update position.
- Overrides:
shouldUpdateBasedOnLoc
in class Perceiver<ElementType extends QuadTreeElement<ElementType>>
getElement
public ElementType getElement()
setElement
public void setElement(ElementType elem)
getRadius
public int getRadius()
setRadius
public void setRadius(int radius)
getPerceiverUpdateDistance
public int getPerceiverUpdateDistance()
setPerceiverUpdateDistance
public void setPerceiverUpdateDistance(int perceiverUpdateDistance)