|
||||||||||
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 | +--com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior | +--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.
Nested Class Summary | |
(package private) class |
FlyingPlatform.SettingsDialog
Inner class, popup dialog used to allow settings to be controlled and navigation to be done with buttons |
Field Summary | |
private java.awt.MenuItem |
aerialViewMenu
|
private javax.media.j3d.Canvas3D |
canvas
|
private boolean |
followTerrain
|
private float |
HOME_X
home X location |
private static int |
HOME_XANGLE
base XAxis attitude determines whether you are climbing or diving |
private float |
HOME_Y
home Y location |
private static int |
HOME_YANGLE
base YAxis attitude determines whether you are flying east/west/north/south |
private float |
HOME_Z
home Z location |
private static int |
HOME_ZANGLE
base ZAxis attitude determines whether you are banking left or right |
private java.awt.MenuItem |
homeBaseMenu
|
private static float |
INITIAL_TERRAIN_FOLLOW_ALTITUDE
|
private java.awt.MenuItem |
levelOffMenu
|
private static float |
MINIMUM_ALTITUDE
|
private ElevationModelInterface |
model
|
private float |
moveAmt
amount to move (in meters) on each operation |
private int |
oldx
|
private int |
oldy
|
private javax.vecmath.Vector3f |
platformVect
holds view platform location |
private java.awt.PopupMenu |
popupMenu
|
private static int |
sensitivity
|
private FlyingPlatform.SettingsDialog |
settingsDialog
|
private java.awt.MenuItem |
settingsMenu
|
private float |
terrainFollowAltitude
|
private java.awt.CheckboxMenuItem |
terrainFollowMenu
|
private float |
turnAmt
amount to turn(in degrees) on each operation |
private float |
xAngle
holds current X axis attitude |
private float |
yAngle
holds current Y axis attitude |
private float |
zAngle
holds current Z axis attitude |
Fields inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior |
frameWakeup, KEY_LISTENER, motion, MOUSE_LISTENER, MOUSE_MOTION_LISTENER, POST_ID, postWakeup, targetTransform |
Fields inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior |
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_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING |
Fields inherited from class javax.media.j3d.SceneGraphObject |
|
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)
|
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, processStimulus, queueAWTEvent, setEnable, setViewingPlatform |
Methods inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior |
getViewingPlatform |
Methods inherited from class javax.media.j3d.Behavior |
getEnable, getSchedulingBoundingLeaf, getSchedulingBounds, getView, postId, setSchedulingBoundingLeaf, setSchedulingBounds, 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, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int HOME_XANGLE
private static final int HOME_YANGLE
private static final int HOME_ZANGLE
private float HOME_X
private float HOME_Y
private float HOME_Z
private javax.vecmath.Vector3f platformVect
private float xAngle
private float yAngle
private float zAngle
private int oldx
private int oldy
private static int sensitivity
private float moveAmt
private float turnAmt
private static float INITIAL_TERRAIN_FOLLOW_ALTITUDE
private static float MINIMUM_ALTITUDE
private boolean followTerrain
private float terrainFollowAltitude
private java.awt.PopupMenu popupMenu
private java.awt.CheckboxMenuItem terrainFollowMenu
private java.awt.MenuItem settingsMenu
private java.awt.MenuItem homeBaseMenu
private java.awt.MenuItem levelOffMenu
private java.awt.MenuItem aerialViewMenu
private ElevationModelInterface model
private javax.media.j3d.Canvas3D canvas
private FlyingPlatform.SettingsDialog settingsDialog
Constructor Detail |
public FlyingPlatform(javax.media.j3d.Canvas3D aCanvas, ElevationModelInterface aModel)
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()
public void aerialView()
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged
in interface java.awt.event.ItemListener
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
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
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 |