|
|||||||||
| 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.ArcPath
public class ArcPath
The line path is used to cause a pathable to go from point A to point B along the arc of an ellipse in a certain number of milliseconds.
| Field Summary | |
|---|---|
protected Point |
_center
The center of our ellipse. |
protected double |
_delta
Our starting and delta angles. |
protected int |
_orient
The method to be used to orient the pathable. |
protected int |
_orientOffset
An orientation offset used when orienting our pathable. |
protected double |
_sangle
Our starting and delta angles. |
protected Point |
_tpos
A temporary point used when computing our position along the path. |
protected double |
_xradius
Our ellipse radii. |
protected double |
_yradius
Our ellipse radii. |
static int |
FINE
An orientation constant indicating that the fine (sixteen) directions should be used to orient the pathable being made to follow this path. |
static int |
NONE
An orientation indicating that the pathable should not be oriented as it moves along the path. |
static int |
NORMAL
An orientation constant indicating that the normal (eight) directions should be used to orient the pathable being made to follow this path. |
| Fields inherited from class com.threerings.media.util.TimedPath |
|---|
_duration, _startStamp |
| Constructor Summary | |
|---|---|
ArcPath(Point start,
double xradius,
double yradius,
double sangle,
double delta,
long duration,
int orient)
Creates an arc path that will animate a pathable from the specified starting position along an ellipse defined by the supplied parameters. |
|
| Method Summary | |
|---|---|
static void |
computePosition(Point center,
double xradius,
double yradius,
double angle,
Point pos)
Computes the position of an entity along the path defined by the supplied parameters 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. |
Point |
getEndPos()
Returns the position of the end of the path. |
Path |
getTranslatedInstance(int x,
int y)
Return a copy of the path, translated by the specified amounts. |
void |
paint(Graphics2D gfx)
Paint this path on the screen (used for debugging purposes only). |
void |
setOrientOffset(int offset)
Sets the offset that is applied to the pathable whenever it is oriented. |
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, init, toString, wasRemoved |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NORMAL
public static final int FINE
public static final int NONE
protected Point _center
protected double _xradius
protected double _yradius
protected double _sangle
protected double _delta
protected int _orient
protected int _orientOffset
protected Point _tpos
| Constructor Detail |
|---|
public ArcPath(Point start,
double xradius,
double yradius,
double sangle,
double delta,
long duration,
int orient)
start - the starting point for the pathable.xradius - the length of the x radius.yradius - the length of the y radius.sangle - the starting angle.delta - the angle through which the pathable should be moved.duration - the number of milliseconds during which to effect
the animation.orient - an orientation code indicating how the pathable
should be oriented when following the path, either NORMAL,
or FINE.| Method Detail |
|---|
public Path getTranslatedInstance(int x,
int y)
public void setOrientOffset(int offset)
NORMAL or FINE
setting supplied to the path at construct time. The intent here is to allow arc paths to be
applied that don't orient the pathable in the direction they are traveling but instead in
some fixed offset from that direction.
public Point getEndPos()
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 center,
double xradius,
double yradius,
double angle,
Point pos)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||