org.xith3d.utility.math
Class LinearFloatInterpolator

java.lang.Object
  extended by org.xith3d.utility.math.LinearFloatInterpolator
All Implemented Interfaces:
Interpolator

public class LinearFloatInterpolator
extends java.lang.Object
implements Interpolator

LinearFloatInterpolator interpolates a float linearly between two values. Use it whenever you need non-instantaneous (="progressive") actions, e.g. opening a door, moving blocks.. With interpolators, your game can be much smoother.


Constructor Summary
LinearFloatInterpolator(float value1, float value2)
          Create a new LinearFloatInterpolator.
 
Method Summary
 float getValue()
           
 float getValue1()
           
 float getValue2()
           
 void setAlpha(float alpha)
          Set the alpha of this interpolator Changing alpha progressively from 0 to 1 changes the value from value1 to value2 If alpha = 0f, the value of this interpolator will be value1 If alpha = 1f, it will be value2 If it's between 0f and 1f (inclusive) it will be between value1 and value2
 void setValue1(float value1)
           
 void setValue2(float value2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearFloatInterpolator

public LinearFloatInterpolator(float value1,
                               float value2)
Create a new LinearFloatInterpolator. Note : alpha is set at 0f when this constructor is called, which means that if you don't call setAlpha()

Parameters:
value1 - The value which will be set when alpha is at 0
value2 - The value which will be set when alpha is at 1
Method Detail

setAlpha

public void setAlpha(float alpha)
Set the alpha of this interpolator Changing alpha progressively from 0 to 1 changes the value from value1 to value2 If alpha = 0f, the value of this interpolator will be value1 If alpha = 1f, it will be value2 If it's between 0f and 1f (inclusive) it will be between value1 and value2

Specified by:
setAlpha in interface Interpolator

getValue

public float getValue()
Returns:
the value

getValue1

public float getValue1()
Returns:
the value1

setValue1

public void setValue1(float value1)
Parameters:
value1 - the value1 to set

getValue2

public float getValue2()
Returns:
the value2

setValue2

public void setValue2(float value2)
Parameters:
value2 - the value2 to set