edu.cmu.sun.animation
Class RotationAnimation

java.lang.Object
  extended by edu.cmu.sun.animation.ScheduledAnimation
      extended by edu.cmu.sun.animation.RotationAnimation
All Implemented Interfaces:
java.lang.Comparable<ScheduledAnimation>

public class RotationAnimation
extends ScheduledAnimation

Adjusts the rotation of a target Component3D. Rotation is accomplished first by setting the rotation axis, then by rotating a specified number of degrees.

Author:
Braden Kowitz

Field Summary
(package private)  float angle
           
(package private)  javax.vecmath.Vector3f axis
           
(package private)  boolean change
           
 
Fields inherited from class edu.cmu.sun.animation.ScheduledAnimation
duration, startTime, target
 
Constructor Summary
RotationAnimation(Component3D target, int startTime, int duration, javax.vecmath.Vector3f axis, float angle)
          Creates a new action to call changeRotation();
RotationAnimation(Component3D target, int startTime, javax.vecmath.Vector3f axis, float angle)
          Creates a new action to call setRotation();
 
Method Summary
 void doAnimation()
          Performs the animation required for this ScheduledAnimation.
 
Methods inherited from class edu.cmu.sun.animation.ScheduledAnimation
compareTo, getEndTime, getStartTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

axis

javax.vecmath.Vector3f axis

angle

float angle

change

boolean change
Constructor Detail

RotationAnimation

public RotationAnimation(Component3D target,
                         int startTime,
                         int duration,
                         javax.vecmath.Vector3f axis,
                         float angle)
Creates a new action to call changeRotation();

Parameters:
target - Component to be called as a targt
startTime - Time this animation should start, in msec
duration - The duration of this animation, in msec
axis - The axis of rotation (yaw, pitch, roll) in radians from X-axis.
angle - The angle of rotation, in radians

RotationAnimation

public RotationAnimation(Component3D target,
                         int startTime,
                         javax.vecmath.Vector3f axis,
                         float angle)
Creates a new action to call setRotation();

Parameters:
target - Component to be called as a targt
startTime - Time this animation should start, in msec
axis - The axis of rotation (yaw, pitch, roll) in radians from X-axis.
angle - The angle of rotation, in radians
Method Detail

doAnimation

public void doAnimation()
Description copied from class: ScheduledAnimation
Performs the animation required for this ScheduledAnimation. Returns as soon as possible (nonblocking)

Specified by:
doAnimation in class ScheduledAnimation