From 4ba1fe57c386c59cdb8f361b6fd73e09410eaba4 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Tue, 14 Jan 2003 22:37:38 +0000 Subject: [PATCH] Modified so that it will work if re-inited with a new Pathable. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2144 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/media/util/BobblePath.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/java/com/threerings/media/util/BobblePath.java b/src/java/com/threerings/media/util/BobblePath.java index 2b5354890..d95e704c0 100644 --- a/src/java/com/threerings/media/util/BobblePath.java +++ b/src/java/com/threerings/media/util/BobblePath.java @@ -1,5 +1,5 @@ // -// $Id: BobblePath.java,v 1.1 2003/01/14 04:40:45 ray Exp $ +// $Id: BobblePath.java,v 1.2 2003/01/14 22:37:38 ray Exp $ package com.threerings.media.util; @@ -40,8 +40,7 @@ public class BobblePath implements Path public BobblePath (int dx, int dy, long duration, long updateFreq) { _updateFreq = updateFreq; - // we store the duration in stoptime for now - _stopTime = duration; + _duration = duration; setVariance(dx, dy); } @@ -83,10 +82,10 @@ public class BobblePath implements Path _sx = pable.getX(); _sy = pable.getY(); // change the duration to a real stop time - if (_stopTime == -1L) { + if (_duration == -1L) { _stopTime = Long.MAX_VALUE; } else { - _stopTime += tickstamp; + _stopTime = tickstamp + _duration; } _nextMove = tickstamp; } @@ -152,6 +151,9 @@ public class BobblePath implements Path /** The variance we will bobble around that initial position. */ protected int _dx, _dy; + /** How long we'll bobble. */ + protected long _duration; + /** How often we update the locations. */ protected long _updateFreq;