gnu.gleem
Class CameraParameters

java.lang.Object
  |
  +--gnu.gleem.CameraParameters

public class CameraParameters
extends java.lang.Object

Container class for camera's parameters.


Constructor Summary
CameraParameters()
           
CameraParameters(Vec3f position, Vec3f forwardDirection, Vec3f upDirection, float vertFOV, float imagePlaneAspectRatio, int xSize, int ySize)
           
 
Method Summary
 Vec3f getForwardDirection()
          Gets 3-space forward direction of camera.
 float getImagePlaneAspectRatio()
          Gets the aspect ratio of the image plane.
 Vec3f getPosition()
          Gets 3-space origin of camera
 Vec3f getUpDirection()
          Gets 3-space upward direction of camera.
 float getVertFOV()
          Returns HALF of the vertical angular span of the frustum, specified in radians.
 int getXSize()
          Gets the horizontal size of the window, in pixels
 int getYSize()
          Gets the vertical size of the window, in pixels
 void set(CameraParameters params)
           
 void setForwardDirection(Vec3f fwd)
          Sets 3-space forward direction of camera.
 void setImagePlaneAspectRatio(float ratio)
          Sets the aspect ratio of the image plane.
 void setPosition(Vec3f position)
          Sets 3-space origin of camera
 void setUpDirection(Vec3f up)
          Sets 3-space upward direction of camera.
 void setVertFOV(float vertFOV)
          Takes HALF of the vertical angular span of the frustum, specified in radians.
 void setXSize(int xSize)
          Sets the horizontal size of the window, in pixels
 void setYSize(int ySize)
          Sets the vertical size of the window, in pixels
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CameraParameters

public CameraParameters()

CameraParameters

public CameraParameters(Vec3f position,
                        Vec3f forwardDirection,
                        Vec3f upDirection,
                        float vertFOV,
                        float imagePlaneAspectRatio,
                        int xSize,
                        int ySize)
Method Detail

set

public void set(CameraParameters params)

setPosition

public void setPosition(Vec3f position)
Sets 3-space origin of camera


getPosition

public Vec3f getPosition()
Gets 3-space origin of camera


setForwardDirection

public void setForwardDirection(Vec3f fwd)
Sets 3-space forward direction of camera. Does not need to be normalized.


getForwardDirection

public Vec3f getForwardDirection()
Gets 3-space forward direction of camera.


setUpDirection

public void setUpDirection(Vec3f up)
Sets 3-space upward direction of camera. This must be orthogonal to the viewing direction, but does not need to be normalized.


getUpDirection

public Vec3f getUpDirection()
Gets 3-space upward direction of camera.


setVertFOV

public void setVertFOV(float vertFOV)
Takes HALF of the vertical angular span of the frustum, specified in radians. For example, if your fovy argument to gluPerspective() is 90, then this would be M_PI / 4.


getVertFOV

public float getVertFOV()
Returns HALF of the vertical angular span of the frustum, specified in radians.


setImagePlaneAspectRatio

public void setImagePlaneAspectRatio(float ratio)
Sets the aspect ratio of the image plane. Note that this does not necessarily have to correspond to the aspect ratio of the window.


getImagePlaneAspectRatio

public float getImagePlaneAspectRatio()
Gets the aspect ratio of the image plane.


setXSize

public void setXSize(int xSize)
Sets the horizontal size of the window, in pixels


getXSize

public int getXSize()
Gets the horizontal size of the window, in pixels


setYSize

public void setYSize(int ySize)
Sets the vertical size of the window, in pixels


getYSize

public int getYSize()
Gets the vertical size of the window, in pixels