|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jeospace.navigation.Alpha
Generator of alpha values (ranging 0.0 to 1.0) for interpolators. This object is designed for synchronous operation; the fraction value is update in response to an external object calling it's tick() method. The alpha may run forward or backward depending on the direction constant value. The alpha's primary (fraction) value is incremented or decremented by the increment value for each tick(). The fraction value may be modified by a behavior function specified by the behavior constant.
| Field Summary | |
static int |
ACCELERATE
Behavior constant indicating that the alpha value accelerates or ramps up from it's beginning to end. |
static int |
ACCELERATE_DECELERATE
Behavior constant indicating that the alpha value accelerates for the first half of it's operation then decelerates for the second half. |
protected int |
behaviour
Modifier of the fraction. |
static int |
CONTINUOUS
Loop count value indicating that the Alpha should run continuously |
static int |
DECELERATE
Behavior constant indicating that the alpha value decelerates or ramps down from it's beginning to end. |
static boolean |
DECREMENT
Direction constant indicating that the alpha will decrement |
protected double |
fraction
The base value of the alpha which determines it's begin and end points. |
protected double |
increment
The value to increment (or decrement) the fraction by. |
static boolean |
INCREMENT
Direction constant indicating that the alpha will increment |
static int |
LINEAR
Behavior constant indicating that the alpha value is a linear function of the fraction value. |
protected int |
loopCount
The number of iterations to perform |
static int |
STOP
Loop count value indicating that the Alpha should stop |
| Constructor Summary | |
Alpha()
Default Constructor. |
|
Alpha(double fraction,
double increment,
int behaviour,
int loopCount)
Constructor |
|
| Method Summary | |
int |
getBehaviour()
Return the behavior constant |
double |
getFraction()
Return the fraction value |
int |
getLoopCount()
Return the loop count |
double |
getValue()
Return the alpha value. |
void |
set(double fraction,
double increment,
int behaviour,
int loopCount)
Set the alpha parameters |
void |
setBehaviour(int behaviour)
Set the alpha behavior |
void |
setFraction(double fraction)
Set the fraction value |
void |
setIncrement(double increment)
Set the increment value |
void |
setLoopCount(int loopCount)
Set the loop count to the argument value |
boolean |
tick(boolean up_or_down)
Update the fraction value by the increment, in the direction of the argument |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final boolean INCREMENT
public static final boolean DECREMENT
public static final int LINEAR
public static final int ACCELERATE
public static final int DECELERATE
public static final int ACCELERATE_DECELERATE
public static final int CONTINUOUS
public static final int STOP
protected double fraction
protected double increment
protected int behaviour
protected int loopCount
| Constructor Detail |
public Alpha()
public Alpha(double fraction,
double increment,
int behaviour,
int loopCount)
fraction - The fraction valueincrement - The increment valuebehaviour - A behavior constantloopCount - The number of cycles to perform| Method Detail |
public void set(double fraction,
double increment,
int behaviour,
int loopCount)
fraction - The fraction valueincrement - The increment valuebehaviour - A behavior constantloopCount - The number of cycles to performpublic void setFraction(double fraction)
fraction - The fraction valuepublic void setIncrement(double increment)
increment - The increment valuepublic void setBehaviour(int behaviour)
behaviour - A behavior constantpublic void setLoopCount(int loopCount)
loopCount - The number of cycles to performpublic boolean tick(boolean up_or_down)
up_or_down - Flag indicating whether the fraction should be incremented
or decremented by the increment value. true for increment,
false for decrement.
true if the alpha has reached it's final value,
false if not.public double getFraction()
public int getBehaviour()
public int getLoopCount()
public double getValue()
|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||