edu.washington.NVisF.viewer
Class MouseRotateLocked

java.lang.Object
  |
  +--javax.media.j3d.SceneGraphObject
        |
        +--javax.media.j3d.Node
              |
              +--javax.media.j3d.Leaf
                    |
                    +--javax.media.j3d.Behavior
                          |
                          +--com.sun.j3d.utils.behaviors.mouse.MouseBehavior
                                |
                                +--com.sun.j3d.utils.behaviors.mouse.MouseRotate
                                      |
                                      +--edu.washington.NVisF.viewer.MouseRotateLocked

public class MouseRotateLocked
extends com.sun.j3d.utils.behaviors.mouse.MouseRotate

This class is a simple extension of the MouseRotate class in the sun utility packages. The essential change is that instead of simply performing a rotation in place, the target TransformGroup also aquires a translation equivalent to a rotation about the current vertical axis. The combination produces a rotation about the vertical axis presenting the same face to that axis. The effect is identical to rotating the rest of the universe the opposite way, which is the point. By giving this class the TransformGroup of a ViewPlatform and inverting the input, this duplicates the rotation behavior of MouseRotate on a universal TransformGroup, except that here the ViewPlatform is transformed instead of everything else which should be less computationally challenging.


Fields inherited from class com.sun.j3d.utils.behaviors.mouse.MouseBehavior
INVERT_INPUT, MANUAL_WAKEUP
 
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
MouseRotateLocked()
          Creates a rotate behavior given the transform group to act upon.
MouseRotateLocked(int flags)
          Usual constructor for this rotation behavior.
 
Method Summary
 void processStimulus(java.util.Enumeration criteria)
          Overrides MouseRotate.processStimulus(java.util.Enumeration).
 
Methods inherited from class com.sun.j3d.utils.behaviors.mouse.MouseRotate
getXFactor, getYFactor, initialize, setFactor, setFactor, setupCallback, transformChanged
 
Methods inherited from class com.sun.j3d.utils.behaviors.mouse.MouseBehavior
getTransformGroup, processMouseEvent, setTransformGroup, wakeup
 
Methods inherited from class javax.media.j3d.Behavior
getEnable, getSchedulingBoundingLeaf, getSchedulingBounds, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, updateNodeReferences
 
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, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseRotateLocked

public MouseRotateLocked(int flags)
Usual constructor for this rotation behavior. Simply calls {@code super(flags)}. Note that this behavior still needs a transform group to work on (use setTransformGroup(tg)). Common usage is {@code MouseRotateLocked(MouseRotate.INVERT_INPUT)} followed by {@code setTransformGroup(viewPlatformTransformGroup)}.
Parameters:
flags - interesting flags (wakeup conditions).

MouseRotateLocked

public MouseRotateLocked()
Creates a rotate behavior given the transform group to act upon. Simply calls {@code super(transformGroup)}.
Parameters:
transformGroup - The transformGroup to operate on. public MouseRotateLocked(TransformGroup transformGroup) { super(transformGroup); } /** Creates a default rotation behavior. Simply calls {@code super()}.
Method Detail

processStimulus

public void processStimulus(java.util.Enumeration criteria)
Overrides MouseRotate.processStimulus(java.util.Enumeration). Essentially a direct copy of the source code, except that an additional translation is added at the end to perform the rotation about the current vertical axis.
Overrides:
processStimulus in class com.sun.j3d.utils.behaviors.mouse.MouseRotate