data
Class Camera

java.lang.Object
  extended by data.Camera

public class Camera
extends java.lang.Object

Camera in OpenGL-context

Author:
Felix Fleiß (MatrNr: 0527038)

Constructor Summary
Camera(double[] pos, double pan, double tilt, double zoom, double speed, javax.media.opengl.GL gl)
          initializes Camera parameters
 
Method Summary
 void addPan(double pan)
          Pans the camera when update(long deltaTime) is called
 void addTilt(double tilt)
          Tilts the camera when update(long deltaTime) is called
 void addZoom(double zoom)
          Tilts the camera when update(long deltaTime) is called
 double[] getPos()
          returns the camera position in world coordinates
 double getZoom()
          returns the zoom factor of the camera
 void move(float x, float y, float z)
          simply moves the camera instantly plus the given vector
 void moveBackward(boolean b)
          Moves the camera backward when update(long deltaTime) is called
 void moveDown(boolean b)
          Moves the camera down when update(long deltaTime) is called
 void moveForward(boolean b)
          Moves the camera forward when update(long deltaTime) is called
 void moveLeft(boolean b)
          Moves the camera left when update(long deltaTime) is called
 void moveRight(boolean b)
          Moves the camera right when update(long deltaTime) is called
 void moveUp(boolean b)
          Moves the camera up when update(long deltaTime) is called
 void transformIntoCameraSpace()
          transforms the OpenGL objects into camera space.
 void update(long deltaTime)
          updates the camera position and orientation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Camera

public Camera(double[] pos,
              double pan,
              double tilt,
              double zoom,
              double speed,
              javax.media.opengl.GL gl)
initializes Camera parameters

Parameters:
pos - absolute position
pan - pan of the camera
tilt - tilt of the camera
speed - movement speed of the camera
gl - GL-context
Method Detail

moveUp

public void moveUp(boolean b)
Moves the camera up when update(long deltaTime) is called

Parameters:
b -

moveDown

public void moveDown(boolean b)
Moves the camera down when update(long deltaTime) is called

Parameters:
b -

moveLeft

public void moveLeft(boolean b)
Moves the camera left when update(long deltaTime) is called

Parameters:
b -

moveRight

public void moveRight(boolean b)
Moves the camera right when update(long deltaTime) is called

Parameters:
b -

moveForward

public void moveForward(boolean b)
Moves the camera forward when update(long deltaTime) is called

Parameters:
b -

moveBackward

public void moveBackward(boolean b)
Moves the camera backward when update(long deltaTime) is called

Parameters:
b -

addPan

public void addPan(double pan)
Pans the camera when update(long deltaTime) is called

Parameters:
pan - pan to add

move

public void move(float x,
                 float y,
                 float z)
simply moves the camera instantly plus the given vector

Parameters:
x -
y -

getZoom

public double getZoom()
returns the zoom factor of the camera

Returns:
zoom

getPos

public double[] getPos()
returns the camera position in world coordinates

Returns:
position

addTilt

public void addTilt(double tilt)
Tilts the camera when update(long deltaTime) is called

Parameters:
tilt - tilt to add

addZoom

public void addZoom(double zoom)
Tilts the camera when update(long deltaTime) is called

Parameters:
zoom -

update

public void update(long deltaTime)
updates the camera position and orientation

Parameters:
deltaTime - passed time since update(long deltaTime) was called the last time

transformIntoCameraSpace

public void transformIntoCameraSpace()
transforms the OpenGL objects into camera space. NOTE: call this before drawing