Allow a LinePath to be constructed with only one point, and the
source point will be the position of the pathable at initialization time. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2584 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: LinePath.java,v 1.11 2002/12/04 02:45:09 shaper Exp $
|
// $Id: LinePath.java,v 1.12 2003/05/16 02:22:19 ray Exp $
|
||||||
|
|
||||||
package com.threerings.media.util;
|
package com.threerings.media.util;
|
||||||
|
|
||||||
@@ -38,6 +38,27 @@ public class LinePath extends TimedPath
|
|||||||
_dest = dest;
|
_dest = dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
public LinePath (Point dest, long duration)
|
||||||
|
{
|
||||||
|
this(null, dest, duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
|
public void init (Pathable pable, long timestamp)
|
||||||
|
{
|
||||||
|
super.init(pable, timestamp);
|
||||||
|
|
||||||
|
// fill in the source if necessary.
|
||||||
|
if (_source == null) {
|
||||||
|
_source = new Point(pable.getX(), pable.getY());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 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