Class KeyNavigator
java.lang.Object
com.sun.j3d.utils.behaviors.keyboard.KeyNavigator
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
ConstructorsConstructorDescriptionKeyNavigator
(TransformGroup targetTG) Constructs a new key navigator object that operates on the specified transform group. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Computes a new transform for the next frame based on the current transform, accumulated keyboard inputs, and elapsed time.void
processKeyEvent
(KeyEvent keyEvent) Processed a keyboard event.
-
Constructor Details
-
KeyNavigator
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
-
-
Method Details
-
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. -
processKeyEvent
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
-