Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Producer::Camera::Lens Class Reference

A Lens provides control over the PROJECTION matrix. More...

Inheritance diagram for Producer::Camera::Lens:

Producer::Referenced List of all members.

Public Types

enum  Projection { Perspective, Orthographic, Manual }

Public Member Functions

 Lens ()
void setMatrix (const Matrix::value_type matrix[16])
void setPerspective (double hfov, double vfov, double nearClip, double farClip)
void setFrustum (double left, double right, double bottom, double top, double nearClip, double farClip)
void setOrtho (double left, double right, double bottom, double top, double nearClip, double farClip)
bool convertToOrtho (float d)
bool convertToPerspective (float d)
void apply (float xshear=0.0f, float yshear=0.0)
void generateMatrix (float xshear, float yshear, Matrix::value_type matrix[16])
Projection getProjectionType () const
void getParams (double &left, double &right, double &bottom, double &top, double &nearClip, double &farClip)
float getHorizontalFov () const
float getVerticalFov () const
void setAutoAspect (bool ar)
bool getAutoAspect () const
void setAspectRatio (double aspectRatio)
double getAspectRatio ()

Protected Member Functions

 ~Lens ()
bool getFrustum (double &left, double &right, double &bottom, double &top, double &zNear, double &zFar) const
bool getOrtho (double &left, double &right, double &bottom, double &top, double &zNear, double &zFar) const

Detailed Description

A Lens provides control over the PROJECTION matrix.

It is entirely contained within the Camera class. A Lens may be of type Perspective or Orthographic and set with one of the setFrustum, setProjection() or setOrtho(). The Lens type is implied by the method used to set it


Member Enumeration Documentation

enum Producer::Camera::Lens::Projection
 

Projection types

Enumerator:
Perspective 
Orthographic 
Manual 


Constructor & Destructor Documentation

Producer::Camera::Lens::Lens  ) 
 

Producer::Camera::Lens::~Lens  )  [inline, protected]
 


Member Function Documentation

void Producer::Camera::Lens::apply float  xshear = 0.0f,
float  yshear = 0.0
 

apply the lens. This generates a projection matrix for OpenGL

bool Producer::Camera::Lens::convertToOrtho float  d  ) 
 

convertToOrtho() converts the current perspective view to an orthographic view with dimensions that conserve the scale of the objects at distance d. convertToPerspective() converts the current orthographic view to a perspective view with parameters that conserve the scale of objects at distance d.

bool Producer::Camera::Lens::convertToPerspective float  d  ) 
 

void Producer::Camera::Lens::generateMatrix float  xshear,
float  yshear,
Matrix::value_type  matrix[16]
 

double Producer::Camera::Lens::getAspectRatio  )  [inline]
 

bool Producer::Camera::Lens::getAutoAspect  )  const [inline]
 

bool Producer::Camera::Lens::getFrustum double &  left,
double &  right,
double &  bottom,
double &  top,
double &  zNear,
double &  zFar
const [protected]
 

float Producer::Camera::Lens::getHorizontalFov  )  const [inline]
 

bool Producer::Camera::Lens::getOrtho double &  left,
double &  right,
double &  bottom,
double &  top,
double &  zNear,
double &  zFar
const [protected]
 

void Producer::Camera::Lens::getParams double &  left,
double &  right,
double &  bottom,
double &  top,
double &  nearClip,
double &  farClip
 

Projection Producer::Camera::Lens::getProjectionType  )  const [inline]
 

float Producer::Camera::Lens::getVerticalFov  )  const [inline]
 

void Producer::Camera::Lens::setAspectRatio double  aspectRatio  ) 
 

void Producer::Camera::Lens::setAutoAspect bool  ar  )  [inline]
 

void Producer::Camera::Lens::setFrustum double  left,
double  right,
double  bottom,
double  top,
double  nearClip,
double  farClip
 

Set the Projection type to be of Perspective and provide the dimensions of the left, right, bottom, top, nearClip and farClip extents of the viewing frustum as indicated. xshear- Assymetrical shear in viewing frustum in the horizontal direction. Value given in normalized device coordinates (see setShear() below). yshear- Assymetrical shear in viewing frustum in the vertical direction. Value given in normalized device coordinates (see setShear() below).

void Producer::Camera::Lens::setMatrix const Matrix::value_type  matrix[16]  ) 
 

setMatrix() exists to allow external projection-management tools (like elumens' spiclops) to do their magic and still work with producer

void Producer::Camera::Lens::setOrtho double  left,
double  right,
double  bottom,
double  top,
double  nearClip,
double  farClip
 

Set the Projection type to be of Orthographic and provide the left, right, bottom dimensions of the 2D rectangle

void Producer::Camera::Lens::setPerspective double  hfov,
double  vfov,
double  nearClip,
double  farClip
 

Set the Projection type to be of Perspective and provide the following parameters to set the Projection matrix. hfov - Horizontal Field of View in degrees vfov - Vertical Field of View in degrees nearClip - Distance from the viewer to the near plane of the viewing frustum. farClip - Distance from the viewer to the far plane of the viewing frustum. xshear- Assymetrical shear in viewing frustum in the horizontal direction. Value given in normalized device coordinates (see setShear() below). yshear- Assymetrical shear in viewing frustum in the vertical direction. Value given in normalized device coordinates (see setShear() below).


The documentation for this class was generated from the following file:
Generated on Wed Jun 7 05:04:42 2006 for Producer by  doxygen 1.4.4