public class Smoother3D extends java.lang.Object implements Tickable
Constructor and Description |
---|
Smoother3D(float smoothness)
Creates a 3D smoother with the given smoothness.
|
Smoother3D(float startX,
float startY,
float startZ,
float smoothness)
Creates a 3D smoother with the given smoothness and start values.
|
Modifier and Type | Method and Description |
---|---|
float |
getX()
Reports the current x value of the smoother.
|
float |
getXTarget()
Reports the target x value aimed at by this smoother at a rate determined by the smoothness.
|
float |
getY()
Reports the current y value of the smoother.
|
float |
getYTarget()
Reports the target y value aimed at by this smoother at a rate determined by the smoothness.
|
float |
getZ()
Reports the current z value of the smoother.
|
float |
getZTarget()
Reports the target z value aimed at by this smoother at a rate determined by the smoothness.
|
void |
setSmoothness(float smoothness)
Sets the smoothness value that determines the rate of transition towards a target.
|
void |
setTarget(float targetX,
float targetY,
float targetZ)
Sets the target values aimed at by the smoother.
|
void |
setValue(float valueX,
float valueY,
float valueZ)
Move the smoother to the given values immediately regardless of the smoothness value.
|
void |
setX(float valueX)
Move the smoother to the given x value immediately regardless of the smoothness value.
|
void |
setXTarget(float targetX)
Sets the target x value aimed at by the smoother.
|
void |
setY(float valueY)
Move the smoother to the given y value immediately regardless of the smoothness value.
|
void |
setYTarget(float targetY)
Sets the target y value aimed at by the smoother.
|
void |
setZ(float valueZ)
Move the smoother to the given z value immediately regardless of the smoothness value.
|
void |
setZTarget(float targetZ)
Sets the target z value aimed at by the smoother.
|
void |
tick()
Advances the time used by the smoother to move towards its targets.
|
float |
x()
Deprecated.
Consider using
getX() instead for standard accessor naming. |
float |
y()
Deprecated.
Consider using
getY() instead for standard accessor naming. |
float |
z()
Deprecated.
Consider using
getZ() instead for standard accessor naming. |
public Smoother3D(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 Smoother3D(float startX, float startY, float startZ, float smoothness)
startX
- Initial x value that will move towards a target.startY
- Initial y value that will move towards a target.startZ
- Initial z value that will move towards a target.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 final void setSmoothness(float smoothness)
setSmoothness
in interface Tickable
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 final void tick()
public final void setXTarget(float targetX)
targetX
- X target value aimed at by the smoother.public final void setYTarget(float targetY)
targetY
- Y target value aimed at by the smoother.public final void setZTarget(float targetZ)
targetZ
- Z target value aimed at by the smoother.public final float getXTarget()
public final float getYTarget()
public final float getZTarget()
public final void setTarget(float targetX, float targetY, float targetZ)
targetX
- X target value aimed at by the smoother.targetY
- Y target value aimed at by the smoother.targetZ
- Z target value aimed at by the smoother.public final void setValue(float valueX, float valueY, float valueZ)
valueX
- New x target value to jump to.valueY
- New y target value to jump to.valueZ
- New z target value to jump to.public final void setX(float valueX)
valueX
- New x target value to jump to.public final void setY(float valueY)
valueY
- New y target value to jump to.public final void setZ(float valueZ)
valueZ
- New z target value to jump to.@Deprecated public final float x()
getX()
instead for standard accessor naming.tick()
has been called.public final float getX()
tick()
has been called.@Deprecated public final float y()
getY()
instead for standard accessor naming.tick()
has been called.public final float getY()
tick()
has been called.@Deprecated public final float z()
getZ()
instead for standard accessor naming.tick()
has been called.public final float getZ()
tick()
has been called.