org.osm2world.core.target.common.rendering
Class Camera

Object
  extended by Camera

public class Camera
extends Object


Constructor Summary
Camera()
           
 
Method Summary
 VectorXYZ getLookAt()
           
 VectorXYZ getPos()
           
 VectorXYZ getRight()
          returns the vector that is orthogonal to the connection between pos and lookAt and points to the right of it.
 VectorXYZ getUp()
           
 VectorXYZ getViewDirection()
          returns the view direction vector with length 1
 void mapPitch(double d)
          rotates the camera around an axis orthogonal to the y axis and getViewDirection().
 void move(double moveX, double moveY, double moveZ)
          moves both pos and lookAt by the given vector
 void move(VectorXYZ move)
          moves both pos and lookAt by the given vector
 void moveForward(double step)
          moves pos and lookAt in the view direction
 void moveMapForward(double step)
          moves pos and lookAt forward in the map plane
 void moveMapRight(double step)
          moves pos and lookAt to the right in the map plane
 void moveMapUp(double step)
          move pos and lookAt upwards in respect to the map plane
 void moveRight(double step)
          moves pos and lookAt to the right, orthogonally to the view direction
 void moveUp(double step)
          move pos and lookAt upwards, orthogonally to the view direction
 void pitch(double d)
          rotates the camera around the pitch axis
 void roll(double d)
          rolls the camera
 void rotateY(double d)
          moves lookAt to represent a rotation counterclockwise around the y axis on pos
 void setCamera(double posX, double posY, double posZ, double lookAtX, double lookAtY, double lookAtZ)
           
 void setCamera(double posX, double posY, double posZ, double lookAtX, double lookAtY, double lookAtZ, double upX, double upY, double upZ)
           
 void setPos(VectorXYZ pos)
           
 String toString()
           
 void yaw(double d)
          rotates the camera around the yaw axis
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Camera

public Camera()
Method Detail

getViewDirection

public VectorXYZ getViewDirection()
returns the view direction vector with length 1


getRight

public VectorXYZ getRight()
returns the vector that is orthogonal to the connection between pos and lookAt and points to the right of it. The result has length 1.


getPos

public VectorXYZ getPos()

getLookAt

public VectorXYZ getLookAt()

getUp

public VectorXYZ getUp()

setPos

public void setPos(VectorXYZ pos)

setCamera

public void setCamera(double posX,
                      double posY,
                      double posZ,
                      double lookAtX,
                      double lookAtY,
                      double lookAtZ)

setCamera

public void setCamera(double posX,
                      double posY,
                      double posZ,
                      double lookAtX,
                      double lookAtY,
                      double lookAtZ,
                      double upX,
                      double upY,
                      double upZ)

moveForward

public void moveForward(double step)
moves pos and lookAt in the view direction

Parameters:
step - units to move forward

moveMapForward

public void moveMapForward(double step)
moves pos and lookAt forward in the map plane

Parameters:
step - units to move forward

moveRight

public void moveRight(double step)
moves pos and lookAt to the right, orthogonally to the view direction

Parameters:
step - units to move right, negative units move to the left

moveMapRight

public void moveMapRight(double step)
moves pos and lookAt to the right in the map plane

Parameters:
step - units to move right, negative units move to the left

moveUp

public void moveUp(double step)
move pos and lookAt upwards, orthogonally to the view direction

Parameters:
step - units to move up, negative units move down

moveMapUp

public void moveMapUp(double step)
move pos and lookAt upwards in respect to the map plane

Parameters:
step - units to move up, negative units move down

move

public void move(VectorXYZ move)
moves both pos and lookAt by the given vector


move

public void move(double moveX,
                 double moveY,
                 double moveZ)
moves both pos and lookAt by the given vector


rotateY

public void rotateY(double d)
moves lookAt to represent a rotation counterclockwise around the y axis on pos

Parameters:
d - angle in radians

yaw

public void yaw(double d)
rotates the camera around the yaw axis

Parameters:
d - angle in radians

roll

public void roll(double d)
rolls the camera

Parameters:
d - angle in radians

pitch

public void pitch(double d)
rotates the camera around the pitch axis

Parameters:
d - angle in radians

mapPitch

public void mapPitch(double d)
rotates the camera around an axis orthogonal to the y axis and getViewDirection(). The effect is similar to pitch(double), but independent from the current roll angle.

Parameters:
d - angle in radians

toString

public String toString()
Overrides:
toString in class Object