org.xith3d.utility.math
Class TimedInterpolator

java.lang.Object
  extended by org.xith3d.loop.opscheduler.impl.ScheduledOperationImpl
      extended by org.xith3d.utility.math.TimedInterpolator
All Implemented Interfaces:
ScheduledOperation, Updatable

public class TimedInterpolator
extends ScheduledOperationImpl

A timed interpolator uses an Interpolator (e.g. LinearFloatInterpolator) but it adjust it automatically so that it interpolates precisely between two instants you define. Don't worry about memory or what : when a TimedInterpolator is finished (the "end time" is reached), it is destroyed automatically.


Constructor Summary
TimedInterpolator(Interpolator interpolator, org.jagatoo.util.timing.Time beginTime, double length, OperationScheduler opSched)
          Create a new TimedInterpolator
TimedInterpolator(Interpolator interpolator, org.jagatoo.util.timing.Time length, OperationScheduler opSched)
          Create a new TimedInterpolator
TimedInterpolator(Interpolator interpolator, org.jagatoo.util.timing.Time beginTime, org.jagatoo.util.timing.Time endTime, OperationScheduler opSched)
          Create a new TimedInterpolator
 
Method Summary
 org.jagatoo.util.timing.Time getBeginTime()
           
 org.jagatoo.util.timing.Time getEndTime()
           
 Interpolator getInterpolator()
           
 void setBeginTime(org.jagatoo.util.timing.Time beginTime)
           
 void setEndTime(org.jagatoo.util.timing.Time endTime)
           
 void setInterpolator(Interpolator interpolator)
           
 void update(long gameTime, long frameTime, UpdatingThread.TimingMode timingMode)
          Updates this Updatable object.
 
Methods inherited from class org.xith3d.loop.opscheduler.impl.ScheduledOperationImpl
isAlive, isPersistent, setAlive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimedInterpolator

public TimedInterpolator(Interpolator interpolator,
                         org.jagatoo.util.timing.Time beginTime,
                         org.jagatoo.util.timing.Time endTime,
                         OperationScheduler opSched)
Create a new TimedInterpolator

Parameters:
interpolator - The interpolator on which to act
beginTime - The time the interpolator should begin
endTime - The time the interpolator should end
opSched - The OperationScheduled we should schedule to

TimedInterpolator

public TimedInterpolator(Interpolator interpolator,
                         org.jagatoo.util.timing.Time beginTime,
                         double length,
                         OperationScheduler opSched)
Create a new TimedInterpolator

Parameters:
interpolator - The interpolator on which to act
beginTime - The time the interpolator should begin
length - The length the interpolator should last
opSched - The OperationScheduled we should schedule to

TimedInterpolator

public TimedInterpolator(Interpolator interpolator,
                         org.jagatoo.util.timing.Time length,
                         OperationScheduler opSched)
Create a new TimedInterpolator

Parameters:
interpolator - The interpolator on which to act
length - The length the interpolator should last
opSched - The OperationScheduled we should schedule to
Method Detail

update

public void update(long gameTime,
                   long frameTime,
                   UpdatingThread.TimingMode timingMode)
Description copied from interface: Updatable
Updates this Updatable object.

Parameters:
gameTime - the gameTime in Milliseconds
frameTime - the frameTime in Milliseconds (needed time for the last frame)
timingMode - the TimingMode to use for frameTime.

getBeginTime

public org.jagatoo.util.timing.Time getBeginTime()
Returns:
the beginTime

setBeginTime

public void setBeginTime(org.jagatoo.util.timing.Time beginTime)
Parameters:
beginTime - the beginTime to set

getEndTime

public org.jagatoo.util.timing.Time getEndTime()
Returns:
the endTime

setEndTime

public void setEndTime(org.jagatoo.util.timing.Time endTime)
Parameters:
endTime - the endTime to set

getInterpolator

public Interpolator getInterpolator()
Returns:
the interpolator

setInterpolator

public void setInterpolator(Interpolator interpolator)
Parameters:
interpolator - the interpolator to set