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:
@@ -61,10 +61,7 @@ public class LineSegmentPath extends Path
|
||||
// segment time and move on to the next segment
|
||||
if (_accum > _durations[_current]) {
|
||||
_accum -= _durations[_current];
|
||||
_current++;
|
||||
if (_current < _points.length-1) {
|
||||
updateRotation();
|
||||
}
|
||||
advance();
|
||||
}
|
||||
|
||||
// if we have completed our path, move the sprite to the final
|
||||
@@ -81,6 +78,14 @@ public class LineSegmentPath extends Path
|
||||
_sprite.setLocalTranslation(_temp);
|
||||
}
|
||||
|
||||
protected void advance ()
|
||||
{
|
||||
_current++;
|
||||
if (_current < _points.length-1) {
|
||||
updateRotation();
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateRotation ()
|
||||
{
|
||||
_points[_current+1].subtract(_points[_current], _temp);
|
||||
|
||||
Reference in New Issue
Block a user