|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.util.TimeFunction
public abstract class TimeFunction
Used to vary a value over time where time is provided at discrete increments (on the frame tick) and the value is computed appropriately.
| Field Summary | |
|---|---|
protected int |
_duration
The number of milliseconds over which we vary our value. |
protected int |
_end
Our starting and ending values. |
protected int |
_start
Our starting and ending values. |
protected long |
_startStamp
The timestamp at which we began varying our value. |
| Constructor Summary | |
|---|---|
TimeFunction(int start,
int end,
int duration)
Every time function varies a value from some starting value to some ending value over some duration. |
|
| Method Summary | |
|---|---|
protected abstract int |
computeValue(int dt)
This must be implemented by our derived class to compute our value given the specified elapsed time (in millis). |
void |
fastForward(long timeDelta)
Called to fast forward our time stamps if we are ever paused and need to resume where we left off. |
int |
getValue(long tickStamp)
Returns the current value given the supplied time stamp. |
void |
init(long tickStamp)
Configures this function with a starting time. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int _start
protected int _end
protected int _duration
protected long _startStamp
| Constructor Detail |
|---|
public TimeFunction(int start,
int end,
int duration)
Note: it is assumed that we will operate with relatively short durations such that integer arithmetic may be used rather than long arithmetic.
| Method Detail |
|---|
public void init(long tickStamp)
getValue(long) will be
used to obtain a starting time stamp.
public void fastForward(long timeDelta)
public int getValue(long tickStamp)
_duration (and above)
respectively.
protected abstract int computeValue(int dt)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||