|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gicentre.utils.network.traer.animation.Smoother
public class Smoother
A single smoother for transitions towards a target over time. It is a normalised one-pole filter that transitions towards a target at a rate determined by its smoothness
| Constructor Summary | |
|---|---|
Smoother(float smoothness)
Creates a smoother with the given smoothness. |
|
Smoother(float smoothness,
float start)
Creates a smoother with the given smoothness and start value. |
|
| Method Summary | |
|---|---|
float |
getTarget()
Reports the target value aimed at by this smoother at a rate determined by the smoothness. |
float |
getValue()
Reports the current value of the smoother. |
void |
setSmoothness(float smoothness)
Sets the smoothness value that determines the rate of transition towards a target. |
void |
setTarget(float target)
Sets the target value aimed at by the smoother. |
void |
setValue(float x)
Move the smoother to the given target value immediately regardless of the smoothness value. |
void |
tick()
Advances the time used by the smoother to move towards its target. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Smoother(float smoothness)
smoothness - The smoothness of the transition towards a target. It is scaled between
0 and 1. A value of 0 has abrupt changes, 1 is very smooth. A value of
0.9 gives nice workable smoothness for typical animations.
public Smoother(float smoothness,
float start)
smoothness - The smoothness of the transition towards a target. It is scaled between
0 and 1. A value of 0 has abrupt changes, 1 is very smooth. A value of
0.9 gives nice workable smoothness for typical animations.start - Start value that will move towards a target.| Method Detail |
|---|
public final void setSmoothness(float smoothness)
setSmoothness in interface Tickablesmoothness - The smoothness of the transition towards a target. It is scaled between
0 and 1. A value of 0 has abrupt changes, 1 is very smooth. A value of
0.9 gives nice workable smoothness for typical animations.public final void tick()
tick in interface Tickablepublic final void setTarget(float target)
target - Target value aimed at by the smoother.public final float getTarget()
public void setValue(float x)
x - New target value to jump to.public final float getValue()
tick() has been called.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||