org.xith3d.utility.interpolate
Class AngleInterpolater

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

public class AngleInterpolater
extends java.lang.Object

Creates a time based interpolator for angles. The result is an angle in radians appropriate to use as a euler angle. The speed is specfied in radians/second. The interpolator can be increasing or decreasing. Time values must always be in microseconds!


Constructor Summary
AngleInterpolater()
           
AngleInterpolater(float speed)
          Constructs the AngleInterpolator.
AngleInterpolater(float speed, boolean wraps)
          Constructs the AngleInterpolator.
AngleInterpolater(float speed, float min, float max, boolean wraps)
          Constructs the AngleInterpolator.
AngleInterpolater(float value, float speed, float min, float max, boolean wraps)
          Constructs the AngleInterpolator.
 
Method Summary
 float getMaxValue()
           
 float getMinValue()
           
 float getSpeed()
           
 float getStartValue()
           
 float getValue(long gameMicros)
           
 float getValue(long gameTime, UpdatingThread.TimingMode timingMode)
           
 boolean getWraps()
           
 boolean isStopped()
           
 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 setValue(float angle)
           
 void setWraps(boolean wraps)
           
 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

AngleInterpolater

public AngleInterpolater(float value,
                         float speed,
                         float min,
                         float max,
                         boolean wraps)
Constructs the AngleInterpolator.

Parameters:
value - Current angle
speed - Radians per second that we change
min - Minimum acceptable angle in radians
max - Maximum acceptable angle in radians
wraps - Determines if the angle wraps to MIN when it reaches MAX and visa versa

AngleInterpolater

public AngleInterpolater(float speed,
                         float min,
                         float max,
                         boolean wraps)
Constructs the AngleInterpolator.

Parameters:
speed - Radians per second that we change
min - Minimum acceptable angle in radians
max - Maximum acceptable angle in radians
wraps - Determines if the angle wraps to MIN when it reaches MAX and visa versa

AngleInterpolater

public AngleInterpolater(float speed,
                         boolean wraps)
Constructs the AngleInterpolator.

Parameters:
speed - Radians per second that we change
wraps - Determines if the angle wraps to MIN when it reaches MAX and visa versa

AngleInterpolater

public AngleInterpolater(float speed)
Constructs the AngleInterpolator.

Parameters:
speed - Radians per second that we change

AngleInterpolater

public AngleInterpolater()
Method Detail

stop

public void stop()

isStopped

public boolean isStopped()

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 angle)

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()

setWraps

public void setWraps(boolean wraps)

getWraps

public boolean getWraps()