| Modifier and Type | Field and Description |
|---|---|
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.
|
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
fastForward, init, toString, wasRemovedpublic static final int NORMAL
public static final int FINE
public static final int NONE
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.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)
Pathpable - the pathable whose position should be updated.timestamp - the timestamp associated with this frame.public void paint(Graphics2D gfx)
Pathpublic static void computePosition(Point center, double xradius, double yradius, double angle, Point pos)
Copyright © 2015. All rights reserved.