|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Leaf
javax.media.j3d.Behavior
com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior
com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior
edu.d.umn.behaviors.FlyingPlatform
public class FlyingPlatform
This class is a specialization of ViewPlatformAWTBehavior. Its purpose is to provide control to the ViewPlatform using three mechanisms, keyboard, mouse, and popupmenu with control dialog.
Field Summary |
---|
Fields inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior |
---|
canvases, frameWakeup, KEY_LISTENER, motion, MOUSE_LISTENER, MOUSE_MOTION_LISTENER, MOUSE_WHEEL_LISTENER, POST_ID, postWakeup, targetTransform |
Fields inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior |
---|
homeTransform, targetTG, 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 | |
---|---|
FlyingPlatform(javax.media.j3d.Canvas3D aCanvas,
ElevationModelInterface aModel)
Create the flying platform |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
process popup menu input |
void |
aerialView()
Moves the viewplatform to give an aerial view of the terrain and turns off terrain following. |
float |
getRotateAmount()
returns the rotation amount |
float |
getStepSize()
returns the setsize |
void |
goHome()
Moves the viewplatform to the default home position and turns off terrain following. |
void |
increaseXRotate(float amt)
Increase the X axis rotation. |
void |
increaseY(float amt)
Increase the Y location. |
void |
increaseYRotate(float amt)
Increase the Y axis rotation. |
void |
increaseZRotate(float amt)
Increase the Z axis rotation. |
protected void |
integrateTransforms()
reset the viewplatform transformation based on the x,y,z rotation and location information. |
void |
itemStateChanged(java.awt.event.ItemEvent e)
processes the terrain following checkmenu item. |
void |
keyPressed(java.awt.event.KeyEvent e)
process keyboard input up arrow - move forward down arrow - move backward left arrow - turn left right arrow - turn right U, u - increase altitude D, d - decrease altitude |
void |
levelOff()
Cause the viewplatform to return to level flight, x, z angles all set to 0 |
void |
mouseClicked(java.awt.event.MouseEvent e)
process mouse clicked event, check if it is the right button, if so, bring up the popup menu. |
void |
mouseDragged(java.awt.event.MouseEvent e)
process mouseDragged event. |
void |
mouseMoved(java.awt.event.MouseEvent e)
process mouse moved event, just reset old mouse locations |
void |
moveForward(float amt)
move the viewplatform forward by desired number of meters forward implies in the direction that it is currently pointed. |
protected void |
processAWTEvents(java.awt.AWTEvent[] events)
If processStimulus gets an AWT event, it is passed here for processing. |
void |
setRotateAmt(float amt)
updates the amount of rotation (in degrees) that the platform is rotated with each mouse move/arrow key event |
void |
setStepSize(float amt)
updates the amount of space (in meters) that the platform is advanced with each mouse move/arrow key event |
Methods inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior |
---|
initialize, keyReleased, keyTyped, mouseEntered, mouseExited, mousePressed, mouseReleased, mouseWheelMoved, processStimulus, queueAWTEvent, setEnable, setListenerFlags, setViewingPlatform |
Methods inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior |
---|
getHomeTransform, getViewingPlatform, setHomeTransform |
Methods inherited from class javax.media.j3d.Behavior |
---|
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, 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 |
Constructor Detail |
---|
public FlyingPlatform(javax.media.j3d.Canvas3D aCanvas, ElevationModelInterface aModel)
aModel
- ElevationModel this platform flies over.aCanvas
- Canvas3D object that is used to display the worldMethod Detail |
---|
protected void integrateTransforms()
integrateTransforms
in class com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- ActionEvent objectpublic void levelOff()
public void goHome()
goHome
in class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior
public void aerialView()
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged
in interface java.awt.event.ItemListener
e
- The ItemEvent to process.public void setStepSize(float amt)
amt
- number of meters to move with each operationpublic float getStepSize()
public void setRotateAmt(float amt)
amt
- number of degrees to rotate with each operationpublic float getRotateAmount()
protected void processAWTEvents(java.awt.AWTEvent[] events)
processAWTEvents
in class com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior
events
- Array of events that processStimulus received.public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
keyPressed
in class com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior
e
- keyboard eventpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior
e
- mouse eventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior
e
- mouse eventpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior
e
- The event to process.public void moveForward(float amt)
amt
- number of meters to move forwardpublic void increaseYRotate(float amt)
amt
- number of degrees to change the headingpublic void increaseXRotate(float amt)
amt
- number of degrees to change the pitchpublic void increaseZRotate(float amt)
amt
- number of degrees to change the bankpublic void increaseY(float amt)
amt
- number of degrees to change the altitude
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |