|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.util.TimedPath
com.threerings.media.util.LinePath
public class LinePath
The line path is used to cause a pathable to go from point A to point B in a certain number of milliseconds.
| Field Summary | |
|---|---|
protected Point |
_dest
Our source and destination points. |
protected Point |
_source
Our source and destination points. |
protected Point |
_tpos
A temporary point used when computing our position along the path. |
| Fields inherited from class com.threerings.media.util.TimedPath |
|---|
_duration, _startStamp |
| Constructor Summary | |
|---|---|
LinePath(int x1,
int y1,
int x2,
int y2,
long duration)
Constructs a line path between the two specified points that will be followed in the specified number of milliseconds. |
|
LinePath(Point dest,
long duration)
Constructs a line path that moves a pathable from whatever its location is at init time to the dest point over the specified number of milliseconds. |
|
LinePath(Point source,
Point dest,
long duration)
Constructs a line path between the two specified points that will be followed in the specified number of milliseconds. |
|
| Method Summary | |
|---|---|
static void |
computePosition(Point start,
Point end,
long elapsed,
long duration,
Point pos)
Computes the position of an entity along the path defined by the supplied start and end points assuming that it must finish the path in the specified duration (in millis) and has been traveling the path for the specified number of elapsed milliseconds. |
Path |
getTranslatedInstance(int x,
int y)
Return a copy of the path, translated by the specified amounts. |
void |
init(Pathable pable,
long timestamp)
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). |
boolean |
tick(Pathable pable,
long timestamp)
Called to request that this path update the position of the specified pathable based on the supplied timestamp information. |
protected void |
toString(StringBuilder buf)
An extensible method for generating a string representation of this instance. |
| Methods inherited from class com.threerings.media.util.TimedPath |
|---|
fastForward, toString, wasRemoved |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Point _source
protected Point _dest
protected Point _tpos
| Constructor Detail |
|---|
public LinePath(int x1,
int y1,
int x2,
int y2,
long duration)
public LinePath(Point source,
Point dest,
long duration)
public LinePath(Point dest,
long duration)
| Method Detail |
|---|
public Path getTranslatedInstance(int x,
int y)
public void init(Pathable pable,
long timestamp)
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 Pathinit in class TimedPath
public boolean tick(Pathable pable,
long timestamp)
Path
pable - the pathable whose position should be updated.timestamp - the timestamp associated with this frame.
public void paint(Graphics2D gfx)
Path
protected void toString(StringBuilder buf)
TimedPath
toString in class TimedPath
public static void computePosition(Point start,
Point end,
long elapsed,
long duration,
Point pos)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||