org.gicentre.utils.network.traer.animation
Class Animator

java.lang.Object
  extended by org.gicentre.utils.network.traer.animation.Animator
All Implemented Interfaces:
Tickable

public class Animator
extends java.lang.Object
implements Tickable

Class for controlling all the smoothers. It can be used to create smoothers and then call this class's tick() method inside a sketch's draw() to advance the time for all smoothers.

Version:
31st July 2012.
Author:
Jeffrey Traer Bernstein with Minor Modifications by Jo Wood.

Constructor Summary
Animator(float smoothness)
          Creates an animator with the given smoothness.
 
Method Summary
 Smoother2D make2DSmoother()
          Adds a 2D smoother that will be handled by this animator.
 Smoother3D make3DSmoother()
          Adds a 3D smoother that will be handled by this animator.
 Smoother makeSmoother()
          Adds a smoother that will be handled by this animator.
 void setSmoothness(float smoothness)
          Sets the smoothness of all smoothers that have been made by this animator.
 void tick()
          Advances time for all smoothers that have been made by this animator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Animator

public Animator(float smoothness)
Creates an animator with the given smoothness.

Parameters:
smoothness - The smoothness of the animator 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.
Method Detail

makeSmoother

public final Smoother makeSmoother()
Adds a smoother that will be handled by this animator. A smoother is a normalised one-pole filter that transitions towards a target at a rate determined by its smoothness.

Returns:
The smoother that has been added to those handled by this animator.

make2DSmoother

public final Smoother2D make2DSmoother()
Adds a 2D smoother that will be handled by this animator. A 2D smoother is made of two smoothers to smooth 2D movements.

Returns:
The smoother that has been added to those handled by this animator.

make3DSmoother

public final Smoother3D make3DSmoother()
Adds a 3D smoother that will be handled by this animator. A 3D smoother is made of three smoothers to smooth 3D movements.

Returns:
The smoother that has been added to those handled by this animator.

tick

public final void tick()
Advances time for all smoothers that have been made by this animator. This method is normally called from within the sketch wishing to smooth transitions.

Specified by:
tick in interface Tickable

setSmoothness

public final void setSmoothness(float smoothness)
Sets the smoothness of all smoothers that have been made by this animator.

Specified by:
setSmoothness in interface Tickable
Parameters:
smoothness - The smoothness of the animator 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.


giCentre Utilities V.3.3, API documentation generated 6th April, 2013