org.xith3d.utility.interpolate
Class DistanceInterpolater

java.lang.Object
  extended by org.xith3d.utility.interpolate.DistanceInterpolater

public class DistanceInterpolater
extends java.lang.Object

Handles changes in distance over time. Time values must always be in microseconds!


Constructor Summary
DistanceInterpolater()
           
DistanceInterpolater(float speed, float min, float max)
          Constructs the DistanceInterpolator.
DistanceInterpolater(float speed, float min, float max, boolean turnsBack)
          Constructs the DistanceInterpolator.
DistanceInterpolater(float value, float speed, float min, float max)
          Constructs the DistanceInterpolator.
DistanceInterpolater(float value, float speed, float min, float max, boolean turnsBack)
          Constructs the DistanceInterpolator.
 
Method Summary
 float getMaxValue()
           
 float getMinValue()
           
 float getSpeed()
           
 float getStartValue()
           
 long getTicks(long curTime)
           
 boolean getTurnsBack()
           
 float getValue(long gameMicros)
           
 float getValue(long gameTime, UpdatingThread.TimingMode timingMode)
           
 boolean isDecreasing()
           
 boolean isIncreasing()
           
 boolean isStarted()
           
 void resetDecreasing(long startTime)
           
 void resetIncreasing(long startTime)
           
 void setMaxValue(float max)
           
 void setMinValue(float min)
           
 void setSpeed(float speed)
           
 void setStartValue(float startVal)
           
 void setTurnsBack(boolean turnsBack)
           
 void setValue(float value)
           
 void startDecreasing(long startTime)
           
 void startIncreasing(long startTime)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistanceInterpolater

public DistanceInterpolater(float value,
                            float speed,
                            float min,
                            float max,
                            boolean turnsBack)
Constructs the DistanceInterpolator.

Parameters:
value - Current angle
speed - meters per second that we change
min - Minimum acceptable angle in radians
max - Maximum acceptable angle in radians
turnsBack - if true, the interpolation will invert when max or min is hit

DistanceInterpolater

public DistanceInterpolater(float speed,
                            float min,
                            float max,
                            boolean turnsBack)
Constructs the DistanceInterpolator.

Parameters:
speed - meters per second that we change
min - Minimum acceptable angle in radians
max - Maximum acceptable angle in radians
turnsBack - if true, the interpolation will invert when max or min is hit

DistanceInterpolater

public DistanceInterpolater(float value,
                            float speed,
                            float min,
                            float max)
Constructs the DistanceInterpolator.

Parameters:
speed - meters per second that we change
min - Minimum acceptable angle in radians
max - Maximum acceptable angle in radians

DistanceInterpolater

public DistanceInterpolater(float speed,
                            float min,
                            float max)
Constructs the DistanceInterpolator.

Parameters:
speed - meters per second that we change
min - Minimum acceptable angle in radians
max - Maximum acceptable angle in radians

DistanceInterpolater

public DistanceInterpolater()
Method Detail

stop

public void stop()

startIncreasing

public void startIncreasing(long startTime)

resetIncreasing

public void resetIncreasing(long startTime)

resetDecreasing

public void resetDecreasing(long startTime)

startDecreasing

public void startDecreasing(long startTime)

setValue

public void setValue(float value)

getValue

public final float getValue(long gameMicros)

getValue

public final float getValue(long gameTime,
                            UpdatingThread.TimingMode timingMode)

setStartValue

public void setStartValue(float startVal)

getStartValue

public float getStartValue()

setSpeed

public void setSpeed(float speed)

getSpeed

public float getSpeed()

setMinValue

public void setMinValue(float min)

getMinValue

public float getMinValue()

setMaxValue

public void setMaxValue(float max)

getMaxValue

public float getMaxValue()

setTurnsBack

public void setTurnsBack(boolean turnsBack)

getTurnsBack

public boolean getTurnsBack()

isStarted

public boolean isStarted()

isIncreasing

public boolean isIncreasing()

isDecreasing

public boolean isDecreasing()

getTicks

public long getTicks(long curTime)