org.wilmascope.rotation
Class AutoRotation

java.lang.Object
  extended by javax.media.j3d.SceneGraphObject
      extended by javax.media.j3d.Node
          extended by javax.media.j3d.Leaf
              extended by javax.media.j3d.Behavior
                  extended by javax.media.j3d.Interpolator
                      extended by org.wilmascope.rotation.AutoRotation

public class AutoRotation
extends javax.media.j3d.Interpolator

AutoRotation is a java3D Interpolator object used to continously rotate the scene graph.

 rotator = new AutoRotation(transformGroup);
 rotator.setSchedulingBounds(bounds);
 bg.addChild(rotator);
 
The above code will add the AutoRotation object to the branchgroup group.


Field Summary
 
Fields inherited from class javax.media.j3d.Interpolator
defaultWakeupCriterion
 
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
AutoRotation(javax.media.j3d.TransformGroup target)
           
 
Method Summary
 void initialize()
          Initializes the wake up event:wake up every 25 miliseconds
 void processStimulus(java.util.Enumeration e)
          Rotates the scene graph with a small angle each time wakes up
 void setRotParams(long duration, double angleX, double angleY)
          Sets up the rotation parameters
 
Methods inherited from class javax.media.j3d.Interpolator
getAlpha, setAlpha
 
Methods inherited from class javax.media.j3d.Behavior
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOn
 
Methods inherited from class javax.media.j3d.Node
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoRotation

public AutoRotation(javax.media.j3d.TransformGroup target)
Parameters:
target - The TransformGroup AutoRotation will manipulate
Method Detail

initialize

public void initialize()
Initializes the wake up event:wake up every 25 miliseconds

Overrides:
initialize in class javax.media.j3d.Interpolator

processStimulus

public void processStimulus(java.util.Enumeration e)
Rotates the scene graph with a small angle each time wakes up

Specified by:
processStimulus in class javax.media.j3d.Behavior

setRotParams

public void setRotParams(long duration,
                         double angleX,
                         double angleY)
Sets up the rotation parameters

Parameters:
duration - The time between mouse pressed and mouse released
angleX - During the mouse drag, how much angle has been rotated around the x axis
angleY - During the mouse drag, how much angle has been rotated around the y axis