public class CollisionCircle extends Circle implements CollisionArea, PositionChangeListener<CollisionCircle>, SizeChangeListener<CollisionCircle>
Circle that allows for interpolation. Game
objects can use this class to move around the game world and retrieve the
appropriate rendering coordinates during the render phase.positionChangeListeners, sizeChangeListeners| Constructor and Description |
|---|
CollisionCircle(float radius) |
CollisionCircle(float centerX,
float centerY,
float radius) |
CollisionCircle(int id,
float radius) |
CollisionCircle(int id,
float centerX,
float centerY,
float radius) |
| Modifier and Type | Method and Description |
|---|---|
<T extends Positionable> |
addPostionChangeListener(PositionChangeListener<T> listener)
Adds a
Positionable to be notified of coordinate
changes |
<T extends Sizeable> |
addSizeChangeListener(SizeChangeListener<T> listener)
Adds a
SizeChangeListener to be notified of size changes |
protected void |
clearPositionChangeListeners() |
protected void |
clearSizeChangeListeners() |
void |
dispose()
|
boolean |
equals(java.lang.Object o) |
void |
forceTo(float x,
float y)
Sets the current x and y coordinate to the specified x and y and force updates the
rendering position to match
|
void |
forceTo(float x,
float y,
float width,
float height)
Sets the current x, y, width and height and force updates the
rendering state to match
|
int |
getId()
Returns the unique id of this object
|
int |
getRenderHeight()
Returns the render height of this object
|
int |
getRenderRadius() |
int |
getRenderWidth()
Returns the render width of this object
|
int |
getRenderX()
Returns the render x coordinate of this object
|
int |
getRenderY()
Returns the render y coordinate of this object
|
int |
hashCode() |
void |
interpolate(float alpha)
Called during interpolate phase each interpolate()
|
protected void |
notifyPositionChangeListeners() |
protected void |
notifySizeChangeListeners() |
void |
positionChanged(CollisionCircle moved) |
void |
preUpdate()
Called at the start of each update() before any changes are made to this object
|
<T extends Positionable> |
removePositionChangeListener(PositionChangeListener<T> listener)
Removes a
PositionChangeListener to stop it being notified of
coordinate changes |
<T extends Sizeable> |
removeSizeChangeListener(SizeChangeListener<T> listener)
Removes a
SizeChangeListener to stop it being notified of size
changes |
void |
sizeChanged(CollisionCircle changed) |
java.lang.String |
toString() |
contains, contains, contains, contains, contains, contains, copy, draw, edgeIterator, fill, getBoundingBox, getCenterX, getCenterY, getDistanceFromCenter, getDistanceFromCenter, getDistanceTo, getHeight, getMaxX, getMaxY, getMinX, getMinY, getNumberOfSides, getPolygon, getRadius, getRotation, getWidth, getX, getY, intersects, intersects, intersects, intersectsLineSegment, intersectsLineSegment, isCircle, lerp, rotate, rotateAround, scale, set, setCenter, setCenterX, setCenterY, setRadius, setRotation, setRotationAround, setX, setXY, setY, translateadd, clearPositionListeners, clearPositionListeners, clearSizeListeners, clearSizeListeners, getDistanceTo, intersects, moveTowards, moveTowards, notifyPositionListeners, notifyPositionListeners, notifySizeListeners, notifySizeListeners, removePositionListener, removePositionListener, removeSizeListener, removeSizeListener, setRotationAround, subtractclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontains, contains, contains, getCenterX, getCenterY, getHeight, getMaxX, getMaxY, getMinX, getMinY, getNumberOfSides, getPolygon, getWidth, intersects, intersects, intersectsLineSegment, intersectsLineSegment, isCircle, scale, setCenter, setCenterX, setCenterY, setRadiusgetDistanceTo, getDistanceTo, getX, getY, moveTowards, moveTowards, setX, setXY, setYpublic CollisionCircle(float radius)
public CollisionCircle(int id,
float radius)
public CollisionCircle(float centerX,
float centerY,
float radius)
public CollisionCircle(int id,
float centerX,
float centerY,
float radius)
public void dispose()
Shapepublic void preUpdate()
CollisionObjectpreUpdate in interface CollisionObjectpreUpdate in interface Interpolatablepublic void interpolate(float alpha)
CollisionObjectinterpolate in interface CollisionObjectinterpolate in interface Interpolatablealpha - The alpha value between 0.0 and 1.0public void forceTo(float x,
float y,
float width,
float height)
CollisionAreaforceTo in interface CollisionAreax - The x coordinate to sety - The y coordinate to setpublic void forceTo(float x,
float y)
CollisionObjectforceTo in interface CollisionObjectx - The x coordinate to sety - The y coordinate to setpublic int getId()
CollisionObjectgetId in interface CollisionObjectpublic int getRenderX()
CollisionObjectgetRenderX in interface CollisionObjectpublic int getRenderY()
CollisionObjectgetRenderY in interface CollisionObjectpublic int getRenderWidth()
CollisionAreagetRenderWidth in interface CollisionAreapublic int getRenderHeight()
CollisionAreagetRenderHeight in interface CollisionAreapublic int getRenderRadius()
public void positionChanged(CollisionCircle moved)
positionChanged in interface PositionChangeListener<CollisionCircle>public void sizeChanged(CollisionCircle changed)
sizeChanged in interface SizeChangeListener<CollisionCircle>public <T extends Positionable> void addPostionChangeListener(PositionChangeListener<T> listener)
PositionablePositionable to be notified of coordinate
changesaddPostionChangeListener in interface PositionableaddPostionChangeListener in class Shapelistener - The PositionChangeListener to addPositionable.addPostionChangeListener(PositionChangeListener)public <T extends Positionable> void removePositionChangeListener(PositionChangeListener<T> listener)
PositionablePositionChangeListener to stop it being notified of
coordinate changesremovePositionChangeListener in interface PositionableremovePositionChangeListener in class Shapelistener - The PositionChangeListener to removePositionable.removePositionChangeListener(PositionChangeListener)public <T extends Sizeable> void addSizeChangeListener(SizeChangeListener<T> listener)
SizeableSizeChangeListener to be notified of size changesaddSizeChangeListener in interface SizeableaddSizeChangeListener in class Shapelistener - The SizeChangeListener to addpublic <T extends Sizeable> void removeSizeChangeListener(SizeChangeListener<T> listener)
SizeableSizeChangeListener to stop it being notified of size
changesremoveSizeChangeListener in interface SizeableremoveSizeChangeListener in class Shapelistener - The SizeChangeListener to removeprotected void notifyPositionChangeListeners()
notifyPositionChangeListeners in class Shapeprotected void clearPositionChangeListeners()
clearPositionChangeListeners in class Shapeprotected void notifySizeChangeListeners()
notifySizeChangeListeners in class Shapeprotected void clearSizeChangeListeners()
clearSizeChangeListeners in class Shapepublic java.lang.String toString()
toString in class java.lang.Object