org.selman.java3d.book.common
Class TornadoMouseScale

java.lang.Object
  |
  +--javax.media.j3d.SceneGraphObject
        |
        +--javax.media.j3d.Node
              |
              +--javax.media.j3d.Leaf
                    |
                    +--javax.media.j3d.Behavior
                          |
                          +--org.selman.java3d.book.common.TornadoMouseBehavior
                                |
                                +--org.selman.java3d.book.common.TornadoMouseScale

public class TornadoMouseScale
extends TornadoMouseBehavior

TornadoMouseScale Custon scaling behaviour

Version:
1.0
Author:
Daniel Selman

Field Summary
protected  float m_Delta
           
protected  javax.vecmath.Point3d m_MaxScale
           
protected  javax.vecmath.Point3d m_MinScale
           
protected  float m_Threshold
           
 
Fields inherited from class org.selman.java3d.book.common.TornadoMouseBehavior
m_bDragging, m_Listener, m_MouseCriterion, m_NewPos, m_nLastY, m_Object, m_OldPos, m_Transform3D, m_Translation, m_TranslationVector
 
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
TornadoMouseScale(float threshold, float delta)
           
 
Method Summary
protected  void applyVectorToObject(javax.vecmath.Vector3f vector)
          Apply a delta vector (in the object's local coordinates) to the object.
protected  boolean isRelativeToObjectCoordinates()
           
protected  boolean isStartBehaviorEvent(java.awt.event.MouseEvent evt)
           
 void setMaxScale(javax.vecmath.Point3d maxScale)
           
 void setMinScale(javax.vecmath.Point3d minScale)
           
 
Methods inherited from class org.selman.java3d.book.common.TornadoMouseBehavior
adjustTransform, applyTransform, getImagePlateToVworld, getObjectLocalToVworld, getTransformGroup, initialize, isRelativeToStartDrag, isStopBehaviorEvent, onEndDrag, onStartDrag, processMouseEvent, processStimulus, setChangeListener, setObject
 
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
 

Field Detail

m_Delta

protected float m_Delta

m_Threshold

protected float m_Threshold

m_MinScale

protected javax.vecmath.Point3d m_MinScale

m_MaxScale

protected javax.vecmath.Point3d m_MaxScale
Constructor Detail

TornadoMouseScale

public TornadoMouseScale(float threshold,
                         float delta)
Parameters:
threshold - the amount the mouse must be moved before an object is moved
delta - the step size to use for object scaling bigger = faster scaling. Default minimum scale: 0.1,0.1,0.1 Default maximum scale: 5,5,5
Method Detail

setMinScale

public void setMinScale(javax.vecmath.Point3d minScale)
Parameters:
minScale - the minimum x,y,z scale

setMaxScale

public void setMaxScale(javax.vecmath.Point3d maxScale)
Parameters:
maxScale - the maximum x,y,z scale

isRelativeToObjectCoordinates

protected boolean isRelativeToObjectCoordinates()
Overrides:
isRelativeToObjectCoordinates in class TornadoMouseBehavior
Returns:
true if the mouse coordinates should be converted to local object coordinates before being processed by applyVectorToObject

isStartBehaviorEvent

protected boolean isStartBehaviorEvent(java.awt.event.MouseEvent evt)
Specified by:
isStartBehaviorEvent in class TornadoMouseBehavior
Returns:
true is this the mouse event that starts the tracking behaviour

applyVectorToObject

protected void applyVectorToObject(javax.vecmath.Vector3f vector)
Description copied from class: TornadoMouseBehavior
Apply a delta vector (in the object's local coordinates) to the object.

Specified by:
applyVectorToObject in class TornadoMouseBehavior