|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Leaf javax.media.j3d.Behavior com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior edu.d.umn.behaviors.FlyBehavior
public abstract class FlyBehavior
FlyBehavior.java Created on July 13, 2005, 11:37 AM Basically, this is the same type of behavior available with Sun's java3d demo. It is just condensed down into one file, rather than several inheritances. Movement is as follows. Left Click - move forward and backward, turn left and right Middle Click - look up and down, and roll Right Click - change elevation, and strafe left and right
Field Summary | |
---|---|
protected javax.media.j3d.WakeupOr |
awtCondition
Mainly the mouse and keyboard conditions to wakeup on. |
protected javax.media.j3d.WakeupOr |
bothCondition
Both awtCondition and frameElapsed conditions. |
protected java.awt.Rectangle |
canvasBounds
The bounds of the canvas. |
protected java.awt.geom.Point2D.Float |
canvasCenter
Center of the canvas. |
protected float |
deadXSize
Size of the dead zone in the center of the canvas. |
protected float |
deadYSize
Size of the dead zone in the center of the canvas. |
protected boolean |
ignoreMouseMotion
Field indicating whether to ignore mouse motion or not. |
protected float |
MAX_ANGLE
The maximum turning angle for movement. |
protected float |
maxVelocity
the maximum velocity for movement. |
protected boolean |
motion
Field indicating whether the behavior is in motion or not. |
protected float |
pitchAngle
Current pitch angle. |
protected javax.media.j3d.Transform3D |
pitchTransform
Transform3D that controls pitch. |
protected float |
rollAngle
Current roll angle. |
protected javax.media.j3d.Transform3D |
rollTransform
Transform3D that controls roll. |
protected javax.media.j3d.TransformGroup |
targetTG
The TransformGroup this behavior acts on. |
protected javax.media.j3d.Transform3D |
targetTransform
The Transform3D component of the targetTG. |
protected javax.vecmath.Vector3f |
velocity
The velocity of the behavior. |
protected javax.media.j3d.Transform3D |
velocityTransform
Transform3D that controls velocity. |
protected float |
yawAngle
Current angle of yaw. |
protected javax.media.j3d.Transform3D |
yawTransform
Transform3D that controls yaw. |
Fields inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior |
---|
homeTransform, vp |
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_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING |
Constructor Summary | |
---|---|
FlyBehavior()
Constructs a new FlyBehavior |
Method Summary | |
---|---|
abstract void |
aerialView()
Should change the view orientation and position to view a the target from the air. |
javax.media.j3d.TransformGroup |
getTarget()
Returns the TransformGroup this behavior works on. |
protected void |
init()
Setup the initial wakeup conditions for this behavior. |
void |
initialize()
Applies wake conditions via a wakeupOn() call. |
protected void |
integrateTransforms()
Changes yaw, pitch, roll and velocity and sets the Transform3D of targetTG to account for all of these. |
void |
levelOff()
Resets the roll and pitch angles to give you a flat view of the models. |
void |
processAWTEvents(java.awt.AWTEvent[] events)
If processStimulus gets an AWT event, it is passed here for processing. |
protected void |
processKeyEvent(java.awt.event.KeyEvent evt)
|
protected void |
processMouseEvent(java.awt.event.MouseEvent evt)
If processAWTEvents gets a mouseEvent, this method is called to deal with it. |
void |
processStimulus(java.util.Enumeration e)
Process a stimulus meant for this behavior. |
void |
setMaxSpeed(float n)
sets the maximum speed. |
void |
setTarget(javax.media.j3d.TransformGroup targetTG)
Sets the TransformGroup that this behavior acts on. |
Methods inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior |
---|
getHomeTransform, getViewingPlatform, goHome, setHomeTransform, setViewingPlatform |
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, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
Methods inherited from class javax.media.j3d.SceneGraphObject |
---|
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected javax.media.j3d.TransformGroup targetTG
protected javax.media.j3d.WakeupOr awtCondition
protected javax.media.j3d.WakeupOr bothCondition
protected java.awt.Rectangle canvasBounds
protected java.awt.geom.Point2D.Float canvasCenter
protected javax.media.j3d.Transform3D targetTransform
protected final float MAX_ANGLE
protected float maxVelocity
protected boolean motion
protected boolean ignoreMouseMotion
protected float deadXSize
protected float deadYSize
protected javax.media.j3d.Transform3D velocityTransform
protected javax.media.j3d.Transform3D yawTransform
protected javax.media.j3d.Transform3D rollTransform
protected javax.media.j3d.Transform3D pitchTransform
protected javax.vecmath.Vector3f velocity
protected float yawAngle
protected float pitchAngle
protected float rollAngle
Constructor Detail |
---|
public FlyBehavior()
Method Detail |
---|
public void setTarget(javax.media.j3d.TransformGroup targetTG)
targetTG
- New TransformGroup to use.public javax.media.j3d.TransformGroup getTarget()
protected void init()
public void initialize()
initialize
in class javax.media.j3d.Behavior
public void processStimulus(java.util.Enumeration e)
processStimulus
in class javax.media.j3d.Behavior
e
- an enumeration of triggered wakeup criteria for this behaviorpublic void processAWTEvents(java.awt.AWTEvent[] events)
events
- Array of events that processStimulus received.protected void processKeyEvent(java.awt.event.KeyEvent evt)
protected void processMouseEvent(java.awt.event.MouseEvent evt)
evt
- The MouseEvent to process.protected void integrateTransforms()
public void levelOff()
public void setMaxSpeed(float n)
n
- new maximum speed. Must be greater than zero.public abstract void aerialView()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |