public class CollisionPoint extends Point implements CollisionObject, PositionChangeListener<CollisionPoint>
Point that allows for interpolation. Game
objects can use this class to move around the game world and retrieve the
appropriate rendering coordinates during render phase.| Modifier and Type | Field and Description |
|---|---|
protected Collisions |
collisions |
disposed, positionChangeListeners| Constructor and Description |
|---|
CollisionPoint() |
CollisionPoint(float x,
float y) |
CollisionPoint(int id) |
CollisionPoint(int id,
Collisions collisions) |
CollisionPoint(int id,
float x,
float y) |
| Modifier and Type | Method and Description |
|---|---|
<T extends Positionable> |
addPostionChangeListener(PositionChangeListener<T> listener)
Adds a
Positionable to be notified of coordinate
changes |
void |
clearPositionChangeListeners()
Removes all listeners
|
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
|
int |
getId()
Returns the unique id of this object
|
float |
getRawRenderX()
Returns the raw float value used for the render x coordinate
|
float |
getRawRenderY()
Returns the raw float value used for the render y coordinate
|
RenderCoordMode |
getRenderCoordMode()
Returns the mode used for calculating render coordinates
|
int |
getRenderX()
Returns the render x coordinate of this object using the set
RenderCoordMode |
int |
getRenderY()
Returns the render y coordinate of this object using the set
RenderCoordMode |
int |
hashCode() |
protected void |
init(int id,
float x,
float y) |
void |
interpolate(float alpha)
Called during interpolate phase each interpolate()
|
void |
notifyPositionChangeListeners()
Notifies all listeners of the current position.
|
void |
positionChanged(CollisionPoint moved) |
void |
preUpdate()
Called at the start of each update() before any changes are made to this object
|
protected void |
release() |
<T extends Positionable> |
removePositionChangeListener(PositionChangeListener<T> listener)
Removes a
PositionChangeListener to stop it being notified of
coordinate changes |
void |
setRenderCoordMode(RenderCoordMode mode)
Sets the mode used for calculating render coordinates
|
java.lang.String |
toString() |
add, add, copy, equals, equals, equals, getDistanceTo, getDistanceTo, getX, getY, isOnLineBetween, moveTowards, moveTowards, mul, mulAdd, mulAdd, rotateAround, rotateAround, scl, scl, scl, set, set, setDisposed, setX, setXY, setY, sub, subangle, angle, angleDeg, angleDeg, angleRad, angleRad, clamp, cpy, crs, crs, dot, dot, dot, dst, dst, dst, dst2, dst2, dst2, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, fromString, hasOppositeDirection, hasSameDirection, interpolate, isCollinear, isCollinear, isCollinearOpposite, isCollinearOpposite, isOnLine, isOnLine, isPerpendicular, isPerpendicular, isUnit, isUnit, isZero, isZero, len, len, len2, len2, lerp, limit, limit2, nor, rotate, rotate90, rotateAround, rotateAroundDeg, rotateAroundRad, rotateDeg, rotateRad, setAngle, setAngleDeg, setAngleRad, setLength, setLength2, setToRandomDirection, setZeroclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDistanceTo, getDistanceTo, getX, getY, moveTowards, moveTowards, setX, setXY, setYprotected Collisions collisions
public CollisionPoint()
public CollisionPoint(int id)
public CollisionPoint(float x,
float y)
public CollisionPoint(int id,
float x,
float y)
public CollisionPoint(int id,
Collisions collisions)
protected void init(int id,
float x,
float y)
protected void release()
public void dispose()
Pointdispose in interface CollisionObjectdispose in interface org.mini2Dx.gdx.utils.Disposabledispose in class Pointpublic 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)
CollisionObjectforceTo in interface CollisionObjectx - The x coordinate to sety - The y coordinate to setpublic int getRenderX()
CollisionObjectRenderCoordModegetRenderX in interface CollisionObjectpublic int getRenderY()
CollisionObjectRenderCoordModegetRenderY in interface CollisionObjectpublic float getRawRenderX()
CollisionObjectgetRawRenderX in interface CollisionObjectpublic float getRawRenderY()
CollisionObjectgetRawRenderY in interface CollisionObjectpublic RenderCoordMode getRenderCoordMode()
CollisionObjectgetRenderCoordMode in interface CollisionObjectRenderCoordMode.GLOBAL_DEFAULTpublic void setRenderCoordMode(RenderCoordMode mode)
CollisionObjectsetRenderCoordMode in interface CollisionObjectmode - The RenderCoordMode valuepublic int getId()
CollisionObjectgetId in interface CollisionObjectpublic void positionChanged(CollisionPoint moved)
positionChanged in interface PositionChangeListener<CollisionPoint>public <T extends Positionable> void addPostionChangeListener(PositionChangeListener<T> listener)
PositionablePositionable to be notified of coordinate
changesaddPostionChangeListener in interface PositionableaddPostionChangeListener in class Pointlistener - 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 Pointlistener - The PositionChangeListener to removePositionable.removePositionChangeListener(PositionChangeListener)public void notifyPositionChangeListeners()
PositionablenotifyPositionChangeListeners in interface PositionablenotifyPositionChangeListeners in class Pointpublic void clearPositionChangeListeners()
PositionableclearPositionChangeListeners in interface PositionableclearPositionChangeListeners in class Pointpublic boolean equals(java.lang.Object o)
equals in class org.mini2Dx.gdx.math.Vector2public int hashCode()
hashCode in class org.mini2Dx.gdx.math.Vector2public java.lang.String toString()
toString in class org.mini2Dx.gdx.math.Vector2