Inheritance diagram for Producer::Camera::Lens:
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 |
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
Producer::Camera::Lens::Lens | ( | ) |
Producer::Camera::Lens::~Lens | ( | ) | [inline, protected] |
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::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).
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::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
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::apply | ( | float | xshear = 0.0f , |
|
float | yshear = 0.0 | |||
) |
apply the lens. This generates a projection matrix for OpenGL
void Producer::Camera::Lens::generateMatrix | ( | float | xshear, | |
float | yshear, | |||
Matrix::value_type | matrix[16] | |||
) |
Projection Producer::Camera::Lens::getProjectionType | ( | ) | const [inline] |
void Producer::Camera::Lens::getParams | ( | double & | left, | |
double & | right, | |||
double & | bottom, | |||
double & | top, | |||
double & | nearClip, | |||
double & | farClip | |||
) |
float Producer::Camera::Lens::getHorizontalFov | ( | ) | const [inline] |
float Producer::Camera::Lens::getVerticalFov | ( | ) | const [inline] |
void Producer::Camera::Lens::setAutoAspect | ( | bool | ar | ) | [inline] |
bool Producer::Camera::Lens::getAutoAspect | ( | ) | const [inline] |
void Producer::Camera::Lens::setAspectRatio | ( | double | aspectRatio | ) |
double Producer::Camera::Lens::getAspectRatio | ( | ) | [inline] |
bool Producer::Camera::Lens::getFrustum | ( | double & | left, | |
double & | right, | |||
double & | bottom, | |||
double & | top, | |||
double & | zNear, | |||
double & | zFar | |||
) | const [protected] |
bool Producer::Camera::Lens::getOrtho | ( | double & | left, | |
double & | right, | |||
double & | bottom, | |||
double & | top, | |||
double & | zNear, | |||
double & | zFar | |||
) | const [protected] |