Class KeyNavigatorEx
java.lang.Object
|
+--KeyNavigatorEx
- Direct Known Subclasses:
- PlayerKeyNavigator
- public class KeyNavigatorEx
- extends java.lang.Object
This is the KeyNavigator class. It accumulates AWT key events (key
press and key release) and computes a new transform based on the
accumulated events and elapsed time.
|
Constructor Summary |
KeyNavigatorEx(javax.media.j3d.TransformGroup targetTG)
Constructs a new key navigator object that operates on the specified
transform group. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
navVec
protected javax.vecmath.Vector3d navVec
time
protected long time
fwdAcc
protected javax.vecmath.Vector3d fwdAcc
bwdAcc
protected javax.vecmath.Vector3d bwdAcc
leftAcc
protected javax.vecmath.Vector3d leftAcc
rightAcc
protected javax.vecmath.Vector3d rightAcc
upAcc
protected javax.vecmath.Vector3d upAcc
downAcc
protected javax.vecmath.Vector3d downAcc
fwdDrag
protected javax.vecmath.Vector3d fwdDrag
bwdDrag
protected javax.vecmath.Vector3d bwdDrag
leftDrag
protected javax.vecmath.Vector3d leftDrag
rightDrag
protected javax.vecmath.Vector3d rightDrag
upDrag
protected javax.vecmath.Vector3d upDrag
downDrag
protected javax.vecmath.Vector3d downDrag
fwdVMax
protected double fwdVMax
bwdVMax
protected double bwdVMax
leftVMax
protected double leftVMax
rightVMax
protected double rightVMax
upVMax
protected double upVMax
downVMax
protected double downVMax
leftRotAngle
protected float leftRotAngle
rightRotAngle
protected float rightRotAngle
upRotAngle
protected float upRotAngle
downRotAngle
protected float downRotAngle
mmx
protected double mmx
a
protected javax.vecmath.Vector3d a
dv
protected javax.vecmath.Vector3d dv
dp
protected javax.vecmath.Point3d dp
udQuat
protected javax.vecmath.Quat4d udQuat
lrQuat
protected javax.vecmath.Quat4d lrQuat
vpPos
protected javax.vecmath.Vector3d vpPos
vpScale
protected double vpScale
vpQuat
protected javax.vecmath.Quat4d vpQuat
vpMatrix
protected javax.vecmath.Matrix4d vpMatrix
vpTrans
protected javax.media.j3d.Transform3D vpTrans
mat
protected javax.vecmath.Matrix4d mat
nda
protected javax.vecmath.Vector3d nda
temp
protected javax.vecmath.Vector3d temp
nominal
protected javax.media.j3d.Transform3D nominal
targetTG
protected javax.media.j3d.TransformGroup targetTG
UP_ARROW
public static final int UP_ARROW
DOWN_ARROW
public static final int DOWN_ARROW
LEFT_ARROW
public static final int LEFT_ARROW
RIGHT_ARROW
public static final int RIGHT_ARROW
PLUS_SIGN
public static final int PLUS_SIGN
MINUS_SIGN
public static final int MINUS_SIGN
PAGE_UP
public static final int PAGE_UP
PAGE_DOWN
public static final int PAGE_DOWN
HOME_DIR
public static final int HOME_DIR
HOME_NOMINAL
public static final int HOME_NOMINAL
SHIFT
public static final int SHIFT
ALT
public static final int ALT
META
public static final int META
KEY_UP
public static final int KEY_UP
KEY_DOWN
public static final int KEY_DOWN
key_state
protected int key_state
modifier_key_state
protected int modifier_key_state
m_Forward
protected int m_Forward
m_Backward
protected int m_Backward
m_Left
protected int m_Left
m_Right
protected int m_Right
m_ViewUp
protected int m_ViewUp
m_ViewDown
protected int m_ViewDown
m_Equals
protected int m_Equals
m_Plus
protected int m_Plus
m_Minus
protected int m_Minus
KeyNavigatorEx
public KeyNavigatorEx(javax.media.j3d.TransformGroup targetTG)
- Constructs a new key navigator object that operates on the specified
transform group. All parameters are set to their default, idle state.
- Parameters:
targetTG - the target transform group
getDeltaTime
protected long getDeltaTime()
genRotQuat
protected void genRotQuat(double av,
int axis,
javax.vecmath.Quat4d q)
accKeyAdd
protected void accKeyAdd(javax.vecmath.Vector3d a,
javax.vecmath.Vector3d da,
javax.vecmath.Vector3d drag,
double scaleVel)
integrateTransformChanges
public void integrateTransformChanges()
- Computes a new transform for the next frame based on
the current transform, accumulated keyboard inputs, and
elapsed time. This new transform is written into the target
transform group.
This method should be called once per frame.
resetVelocity
protected void resetVelocity()
- Resets the keyboard navigation velocity to 0.
processKeyEvent
public void processKeyEvent(java.awt.event.KeyEvent keyEvent)
- Processed a keyboard event. This routine should be called
every time a KEY_PRESSED or KEY_RELEASED event is received.
- Parameters:
keyEvent - the AWT key event
setForwardKey
public void setForwardKey(int iKey)
setBackwardKey
public void setBackwardKey(int iKey)
setLeftKey
public void setLeftKey(int iKey)
setRightKey
public void setRightKey(int iKey)
setViewUpKey
public void setViewUpKey(int iKey)
setViewDownKey
public void setViewDownKey(int iKey)
setEqualKey
public void setEqualKey(int iKey)
setPlusKey
public void setPlusKey(int iKey)
setMinusKey
public void setMinusKey(int iKey)