| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.environment.NavigationControl
public class NavigationControl
A simple form of keyboard based NavigationScene module. Keys: A and D move left and right, W and S move back and forth, Left and right "arrow" keys rotate, Up and down "arrow" keys move back and forth. PageUp and PageDown move up and down. One can pass required keymodifiers KeyEvent.VK_CONTROL/VK_ALT/VK_SHIFT at construction time
| Field Summary | |
|---|---|
(package private)  float | 
angVel
 | 
private static float | 
conv
 | 
(package private)  double | 
currentDoubleTime
 | 
static double | 
degToRad
 | 
private  float | 
inversionFactor
 | 
(package private)  KeyState | 
keyState
 | 
(package private)  double | 
lastTime
 | 
(package private)  float | 
linVel
 | 
(package private)  float[] | 
orientation
 | 
(package private)  float[] | 
position
 | 
private  float[] | 
rotation
 | 
private  float[] | 
rotationMatrix
 | 
(package private)  float | 
strafeVel
 | 
private  List<Integer> | 
theKeyModifiers
 | 
private  float[] | 
transformMatrix
 | 
private  float[] | 
translation
 | 
private  float[] | 
translationMatrix
 | 
(package private)  float | 
vertVel
 | 
| Constructor Summary | |
|---|---|
NavigationControl(Component c,
                  VJoint viewpoint,
                  boolean invert,
                  int[] keyModifiers)
Creates a new NavigationScene, listening to Component c for key and mouse events  | 
|
| Method Summary | |
|---|---|
private  boolean | 
correctModifiers(KeyState keyState)
Returns true if the keystate contains exactly those modifiers with which this control was initialized  | 
 float[] | 
getOrientation()
 | 
 float[] | 
getPosition()
 | 
 void | 
glInit(GLRenderContext gl)
OpenGL initialization.  | 
 void | 
glRender(GLRenderContext gl)
OpenGL rendering.  | 
 void | 
initTime(double currentTime)
initTime() is called before the Clock starts running, and sends some initial time value.  | 
 void | 
setAngularVelocity(float vel)
 | 
 void | 
setLinearVelocity(float vel)
 | 
 void | 
setOrientation(float xrot,
               float yrot,
               float zrot)
set the three Euler angles  | 
 void | 
setPosition(float[] pos)
set the position vector  | 
 void | 
setPosition(float x,
            float y,
            float z)
set the position vector  | 
 void | 
setRollPitchYaw(float roll,
                float pitch,
                float yaw)
 | 
 void | 
setStrafeVelocity(float vel)
 | 
 void | 
setTranslation(float tx,
               float ty,
               float tz)
 | 
 void | 
setVelocities(float vel)
 | 
 void | 
setVerticalVelocity(float vel)
 | 
 void | 
time(double currentTime)
Every clock tick, - check the new movements from the keystate, depending on the pressed keys - update the position and orientation of the controlled object  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
KeyState keyState
float[] position
float[] orientation
double currentDoubleTime
double lastTime
float linVel
float vertVel
float strafeVel
float angVel
public static final double degToRad
private static final float conv
private float[] rotation
private float[] translation
private float[] transformMatrix
private float[] rotationMatrix
private float[] translationMatrix
private List<Integer> theKeyModifiers
private float inversionFactor
| Constructor Detail | 
|---|
public NavigationControl(Component c,
                         VJoint viewpoint,
                         boolean invert,
                         int[] keyModifiers)
| Method Detail | 
|---|
public void setVelocities(float vel)
public void setLinearVelocity(float vel)
public void setVerticalVelocity(float vel)
public void setStrafeVelocity(float vel)
public void setAngularVelocity(float vel)
public void glInit(GLRenderContext gl)
glInit in interface GLRenderObjectpublic void glRender(GLRenderContext gl)
glRender in interface GLRenderObjectpublic void setPosition(float[] pos)
public void setPosition(float x,
                        float y,
                        float z)
public float[] getPosition()
public void setOrientation(float xrot,
                           float yrot,
                           float zrot)
public float[] getOrientation()
private boolean correctModifiers(KeyState keyState)
public void initTime(double currentTime)
ClockListener
initTime in interface ClockListenerpublic void time(double currentTime)
time in interface ClockListener
public void setRollPitchYaw(float roll,
                            float pitch,
                            float yaw)
public void setTranslation(float tx,
                           float ty,
                           float tz)
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||