|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectfang.TrackerAdapter
fang.AbsoluteTransformer
public abstract class AbsoluteTransformer
This class provides an alternative interface to the Tracker interface. Instead of providing relative location, scaling, and rotation information, this one allow setting the absolute location, scaling, and rotation information. The class takes care of taking the differences and returning the relative values that the Tracker interface expects. To use this class, simply provide an advanceTime method which calls setScale, setLocation, or setRotation methods.
| Constructor Summary | |
|---|---|
AbsoluteTransformer()
|
|
AbsoluteTransformer(double rotation,
double scale,
Location2D location)
sets up the current state of the tracker |
|
| Method Summary | |
|---|---|
abstract void |
advanceFrame(double time)
this method is called automatically every time the frame is advanced. |
void |
advanceTime(double time)
this method is called between each frame. |
double |
getRotationAddition()
gets the amount to scale from the current rotation in radians |
double |
getScaleFactor()
gets the amount to scale from the current scale |
Location2D |
getTranslation()
gets the amount to move from the current location |
void |
setLocation(Location2D l)
sets the next location. |
void |
setRotationDegrees(double d)
sets the next rotation. |
void |
setRotationRadians(double r)
sets the next rotation. |
void |
setRotationRevolutions(double rev)
sets the next rotation. |
void |
setScale(double s)
sets the next scale. |
| Methods inherited from class fang.TrackerAdapter |
|---|
getRotationAdditionDegrees, getRotationAdditionRadians, getRotationAdditionRevolutions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbsoluteTransformer()
public AbsoluteTransformer(double rotation,
double scale,
Location2D location)
rotation - the rotation in radiansscale - the current scalelocation - the current position| Method Detail |
|---|
public final double getRotationAddition()
getRotationAddition in interface TrackergetRotationAddition in class TrackerAdapterfang.core.Tracker#getRotationAddition()public final double getScaleFactor()
getScaleFactor in interface TrackergetScaleFactor in class TrackerAdapterfang.core.Tracker#getScaleFactor()public final Location2D getTranslation()
getTranslation in interface TrackergetTranslation in class TrackerAdapterfang.core.Tracker#getTranslation()public final void setRotationRadians(double r)
r - the next orientation in radianspublic final void setRotationDegrees(double d)
d - the next orientation in degreespublic final void setRotationRevolutions(double rev)
rev - the next orientation in degreespublic final void setScale(double s)
s - the next scalepublic final void setLocation(Location2D l)
l - the next locationpublic abstract void advanceFrame(double time)
time - the amount of time which has
passed since the last framepublic final void advanceTime(double time)
TrackerAdapter
advanceTime in interface TrackeradvanceTime in class TrackerAdaptertime - the amount of time passed since
the last call to this method
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||