|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.util.BobblePath
public class BobblePath
Bobble a Pathable.
| Field Summary | |
|---|---|
protected long |
_duration
How long we'll bobble. |
protected int |
_dx
The variance we will bobble around that initial position. |
protected int |
_dy
The variance we will bobble around that initial position. |
protected long |
_nextMove
The time at which we'll next update the position of the pathable. |
protected long |
_stopTime
The time at which we'll stop pathin'. |
protected int |
_sx
The initial position of the pathable. |
protected int |
_sy
The initial position of the pathable. |
protected long |
_updateFreq
How often we update the locations. |
| Constructor Summary | |
|---|---|
BobblePath(int dx,
int dy,
long duration)
Construct a bobble path that updates as often as possible. |
|
BobblePath(int dx,
int dy,
long duration,
long updateFreq)
Construct a bobble path. |
|
| Method Summary | |
|---|---|
void |
fastForward(long timeDelta)
This is called if the pathable is paused for some length of time and then unpaused. |
void |
init(Pathable pable,
long tickstamp)
Called once to let the path prepare itself for the process of animating the supplied pathable. |
void |
paint(Graphics2D gfx)
Paint this path on the screen (used for debugging purposes only). |
void |
setUpdateFrequency(long freq)
Set a new update frequency. |
void |
setVariance(int dx,
int dy)
Set the variance of bobblin' in each direction. |
void |
stop()
Have the Pathable stop bobbling asap. |
boolean |
tick(Pathable pable,
long tickStamp)
Called to request that this path update the position of the specified pathable based on the supplied timestamp information. |
protected boolean |
updatePositionTo(Pathable pable,
int x,
int y)
Update the position of the pathable or return false if it's already there. |
void |
wasRemoved(Pathable pable)
When a path is removed from a pathable, whether that is because the path was completed or because it was replaced by another path, this method will be called to let the path know that it is no longer associated with this pathable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int _sx
protected int _sy
protected int _dx
protected int _dy
protected long _duration
protected long _updateFreq
protected long _stopTime
protected long _nextMove
| Constructor Detail |
|---|
public BobblePath(int dx,
int dy,
long duration)
dx - the variance in the x direction.dy - the variance in the y direction.duration - the duration to bobble, or -1 to bobble until stop() is called.
public BobblePath(int dx,
int dy,
long duration,
long updateFreq)
dx - the variance in the x direction.dy - the variance in the y direction.duration - the duration to bobble, or -1 to bobble until stop() is called.updateFreq - how often to update the Pathable's location.| Method Detail |
|---|
public void setVariance(int dx,
int dy)
public void setUpdateFrequency(long freq)
public void stop()
public void init(Pathable pable,
long tickstamp)
PathPath.tick(com.threerings.media.util.Pathable, long) after Path.init(com.threerings.media.util.Pathable, long) with the same
initialization timestamp.
init in interface Path
public boolean tick(Pathable pable,
long tickStamp)
Path
tick in interface Pathpable - the pathable whose position should be updated.tickStamp - the timestamp associated with this frame.
public void fastForward(long timeDelta)
Path
fastForward in interface Pathpublic void paint(Graphics2D gfx)
Path
paint in interface Pathpublic void wasRemoved(Pathable pable)
Path
wasRemoved in interface Path
protected boolean updatePositionTo(Pathable pable,
int x,
int y)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||