tipgame.tracker
Class CompositeTracker

java.lang.Object
  extended by tipgame.tracker.CompositeTracker
All Implemented Interfaces:
Tracker

public abstract class CompositeTracker
extends java.lang.Object
implements Tracker


Field Summary
private  java.awt.geom.Point2D.Double location
           
private  CompositeTracker next
           
private  CompositeTracker previous
           
private  double rotationAddition
           
private  double scaleFactor
           
 
Constructor Summary
CompositeTracker()
           
 
Method Summary
 void addCompositeTracker(CompositeTracker tracker)
           
 void advanceCompositeTime(double time)
           
 void advanceTime(double time)
          called every time time is advanced.
 double getCompositeRotationAddition()
           
 double getCompositeScaleFactor()
           
 java.awt.geom.Point2D.Double getLocation()
          determines the absolute location (i.e.
 double getRotationAddition()
          determines the relative rotation.
 double getScaleFactor()
          determines the relative scaling factor.
 java.awt.geom.Point2D.Double getTranslation()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

next

private CompositeTracker next

previous

private CompositeTracker previous

location

private java.awt.geom.Point2D.Double location

scaleFactor

private double scaleFactor

rotationAddition

private double rotationAddition
Constructor Detail

CompositeTracker

public CompositeTracker()
Method Detail

getTranslation

public java.awt.geom.Point2D.Double getTranslation()

getCompositeScaleFactor

public double getCompositeScaleFactor()

getCompositeRotationAddition

public double getCompositeRotationAddition()

advanceCompositeTime

public void advanceCompositeTime(double time)

addCompositeTracker

public final void addCompositeTracker(CompositeTracker tracker)
                               throws java.lang.Exception
Throws:
java.lang.Exception

getLocation

public final java.awt.geom.Point2D.Double getLocation()
Description copied from interface: Tracker
determines the absolute location (i.e. not necessarily relative to the Sprite's last location)

Specified by:
getLocation in interface Tracker
Returns:
the absolute location of the Sprite

getScaleFactor

public final double getScaleFactor()
Description copied from interface: Tracker
determines the relative scaling factor. This method will take the current size of the Sprite and scale it by the factor returned

Specified by:
getScaleFactor in interface Tracker
Returns:
the multiplicative scaling factor

getRotationAddition

public final double getRotationAddition()
Description copied from interface: Tracker
determines the relative rotation. This method will take the current orientation and rotate it by the value returned.

Specified by:
getRotationAddition in interface Tracker
Returns:
the amount to rotate in radians

advanceTime

public final void advanceTime(double time)
Description copied from interface: Tracker
called every time time is advanced. The amount of time which has passed since the last call. This method must also accept negative time intervals for reversing time. The magnitude of the negative time interval will not exceed the magnitude of the last positive time interval. Also, the keyboard and mouse inputs will remain constant when the interval is negative.

Specified by:
advanceTime in interface Tracker
Parameters:
time - the time in seconds since the last frame