We specify an Arcing path in terms of a start position and various parameters. It's useful to be able to ask the resulting path where that path ended, especially if we want to create another path starting from that new end point.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@185 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -96,7 +96,7 @@ public class ArcPath extends TimedPath
|
|||||||
int starty =
|
int starty =
|
||||||
(int)(_center.y + Math.round(Math.sin(_sangle) * _yradius));
|
(int)(_center.y + Math.round(Math.sin(_sangle) * _yradius));
|
||||||
|
|
||||||
return new ArcPath(new Point (startx + x, starty + y),
|
return new ArcPath(new Point(startx + x, starty + y),
|
||||||
_xradius, _yradius, _sangle, _delta, _duration, _orient);
|
_xradius, _yradius, _sangle, _delta, _duration, _orient);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +114,16 @@ public class ArcPath extends TimedPath
|
|||||||
_orientOffset = offset;
|
_orientOffset = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the position of the end of the path.
|
||||||
|
*/
|
||||||
|
public Point getEndPos ()
|
||||||
|
{
|
||||||
|
return new Point(
|
||||||
|
(int)(_center.x + Math.round(Math.cos(_sangle + _delta) * _xradius)),
|
||||||
|
(int)(_center.y + Math.round(Math.sin(_sangle + _delta) * _yradius)));
|
||||||
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
public boolean tick (Pathable pable, long timestamp)
|
public boolean tick (Pathable pable, long timestamp)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user