Do things in a way more amenable to subclassing.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3684 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2005-08-22 18:30:07 +00:00
parent 1afa3712fb
commit ef65ee5644
@@ -61,10 +61,7 @@ public class LineSegmentPath extends Path
// segment time and move on to the next segment // segment time and move on to the next segment
if (_accum > _durations[_current]) { if (_accum > _durations[_current]) {
_accum -= _durations[_current]; _accum -= _durations[_current];
_current++; advance();
if (_current < _points.length-1) {
updateRotation();
}
} }
// if we have completed our path, move the sprite to the final // if we have completed our path, move the sprite to the final
@@ -81,6 +78,14 @@ public class LineSegmentPath extends Path
_sprite.setLocalTranslation(_temp); _sprite.setLocalTranslation(_temp);
} }
protected void advance ()
{
_current++;
if (_current < _points.length-1) {
updateRotation();
}
}
protected void updateRotation () protected void updateRotation ()
{ {
_points[_current+1].subtract(_points[_current], _temp); _points[_current+1].subtract(_points[_current], _temp);