glapp
Class GLCam

java.lang.Object
  extended by glapp.GLCam

public class GLCam
extends java.lang.Object

Change the position and orientation of a GLCamera based on input keys. This class moves the camera according to how much time has elapsed, so will produce consistent response to input, regardless of processor speed. To use:

See Also:
GLCamera.java

Field Summary
 GLCamera camera
           
 float camSpeedR
           
 float camSpeedXZ
           
 float camSpeedY
           
 
Constructor Summary
GLCam()
          Create a GLCameraMover.
GLCam(GLCamera cam)
          Create a GLCameraMover with the camera that it will be moving.
 
Method Summary
 void handleArrowKeysOnly(float seconds)
          Adjust the Camera position based on keyboard arrow key input.
 void handleNavKeys(float seconds)
          Adjust the Camera position based on keyboard arrow key input.
 void handleNavKeysViewOnly(float seconds)
          Adjust the Camera view direction based on key press events.
 void render()
          Tell camera to adjust modelview matrix to new view position and orientation.
 void setCamera(GLCamera cam)
          Create a GLCameraMover with the camera that it will be moving.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

camSpeedR

public float camSpeedR

camSpeedXZ

public float camSpeedXZ

camSpeedY

public float camSpeedY

camera

public GLCamera camera
Constructor Detail

GLCam

public GLCam(GLCamera cam)
Create a GLCameraMover with the camera that it will be moving.

Parameters:
cam -

GLCam

public GLCam()
Create a GLCameraMover. Will create a default camera.

Parameters:
cam -
Method Detail

setCamera

public void setCamera(GLCamera cam)
Create a GLCameraMover with the camera that it will be moving.

Parameters:
cam -

render

public void render()
Tell camera to adjust modelview matrix to new view position and orientation.


handleNavKeys

public void handleNavKeys(float seconds)
Adjust the Camera position based on keyboard arrow key input. These are repeating events (camera will move as long as key is held down). Moves the camera according to time elapsed, so camera motion is consistent across varied cpu speeds.

Parameters:
seconds - seconds elapsed since last frame was drawn

handleArrowKeysOnly

public void handleArrowKeysOnly(float seconds)
Adjust the Camera position based on keyboard arrow key input. These are repeating events (camera will move as long as key is held down). Moves the camera according to time elapsed, so camera motion is consistent across varied cpu speeds.

Parameters:
seconds - seconds elapsed since last frame was drawn

handleNavKeysViewOnly

public void handleNavKeysViewOnly(float seconds)
Adjust the Camera view direction based on key press events. Do not change camera position.

Parameters:
seconds - seconds elapsed since last frame was drawn