#include <Camera.h>

Public Member Functions | |
| Camera () | |
| Constructor. | |
| Camera (const Camera &camera) | |
| Copy constructor. | |
| void | setFocusDistance (const GLfloat &distance) |
| Setter for distanceToTarget. | |
| GLfloat | getFocusDistance () |
| Getter for distanceToTarget. | |
| void | setUp (const Vector &up) |
| Setter for up-Vector. | |
| void | setNear (const GLfloat &near) |
| Setter for near plane distance. | |
| GLfloat | getNear () |
| Getter for near plane distance. | |
| void | setFar (const GLfloat &far) |
| Setter for far plane distance. | |
| GLfloat | getFar () |
| Getter for far plane distance. | |
| void | setFovy (const Angle &fovy) |
| Setter for camera opening angle. | |
| Angle & | getFovy () |
| Getter for camera opening angle. | |
| void | setLensShift (const GLfloat &lensShift) |
| Setter for lens shift (z-shift of the cam). | |
| GLfloat | getMaximumBackShift (const GLfloat &maxSizeOfBlur) |
| Getter for maximum lens back-shift. | |
| GLfloat | getMaximumForwardShift (const GLfloat &maxSizeOfBlur) |
| Getter for maximum lens forward-shift. | |
| void | setTarget (const Vector &target, const bool &adjustFocus) |
| Sets a target to look at. | |
| const Vector & | getTarget () |
| Getter for virtual target. | |
| void | setAzimuth (const Angle &azimuth) |
| Sets the azimuth of the camera. | |
| const Angle & | getAzimuth () |
| Getter for azimuth. | |
| void | setElevation (const Angle &elevation) |
| Sets the elevation of the camera. | |
| const Angle & | getElevation () |
| Getter for elevation. | |
| void | setOrbitDistance (const GLfloat &distance) |
| Setter for orbit distance. | |
| GLfloat | getOrbitDistance () |
| Getter for orbit distance. | |
| void | renderGl () |
| The specific OpenGL commands for renderGL. | |
| void | selectGl () |
| Not needed for cameras. | |
| void | projectGl (const GLint &width, const GLint &height, const GLfloat &pixelRatio) |
| Set up a projection for the given width and height. | |
| virtual string | toString () const |
| Returns a textual representation. | |
| virtual string | className () const |
| Returns the class name of the object. | |
| virtual enum classId | classId () const |
| Returns the class id of the object. | |
Private Member Functions | |
| GLfloat | getHalfSizeNearPlane () |
| Getter for half size of near plane (y-axis). | |
| GLfloat | getHalfSizeFocusPlane () |
| Getter for half size of focus plane (y-axis). | |
| GLfloat | getHalfSizeFarPlane () |
| Getter for half size of far plane (y-axis). | |
Private Attributes | |
| GLfloat | focusDistance |
| The presumed distance to the rotation center and focal point. | |
| GLfloat | nearP |
| The distance to the near plane. | |
| GLfloat | farP |
| The distance to the far plane. | |
| Angle | fovy |
| The opening angle (fovy). | |
| Vector | up |
| The up-vector. | |
| GLfloat | lensShift |
| lens shift for DoF-Effect | |
| Camera::Camera | ( | ) |
Constructor.
The camera will be initialized with the following values: Position (0,0,0), focal distance 1, up-vector (0, 1, 0), near 1 and far 100. The camara will be looking along the negative z-axis. The opening in y-direction is 45.0°.
| Camera::Camera | ( | const Camera & | camera | ) |
Copy constructor.
| GLfloat Camera::getHalfSizeNearPlane | ( | ) | [private] |
Getter for half size of near plane (y-axis).
| GLfloat Camera::getHalfSizeFocusPlane | ( | ) | [private] |
Getter for half size of focus plane (y-axis).
| GLfloat Camera::getHalfSizeFarPlane | ( | ) | [private] |
Getter for half size of far plane (y-axis).
| void Camera::setFocusDistance | ( | const GLfloat & | distance | ) |
Setter for distanceToTarget.
Setter for focus distance.
| GLfloat Camera::getFocusDistance | ( | ) |
Getter for distanceToTarget.
Getter for focus distance.
| void Camera::setUp | ( | const Vector & | up | ) |
Setter for up-Vector.
Setter for upVector.
| void Camera::setNear | ( | const GLfloat & | near | ) |
Setter for near plane distance.
| GLfloat Camera::getNear | ( | ) |
Getter for near plane distance.
| void Camera::setFar | ( | const GLfloat & | far | ) |
Setter for far plane distance.
| GLfloat Camera::getFar | ( | ) |
Getter for far plane distance.
| void Camera::setFovy | ( | const Angle & | fovy | ) |
Setter for camera opening angle.
| Angle & Camera::getFovy | ( | ) |
Getter for camera opening angle.
| void Camera::setLensShift | ( | const GLfloat & | lensShift | ) |
Setter for lens shift (z-shift of the cam).
The parameter defines a deviation from the actual position of the camera. If the camera is shifted, for projection the fovy will modified, so that the slice of the viewing frustum defined by focusDistance (the focus plane) stays the same size.
| lensShift | Negative values move the camera in, positive values move the camera out. |
| GLfloat Camera::getMaximumBackShift | ( | const GLfloat & | maxSizeOfBlur | ) |
Getter for maximum lens back-shift.
| maxSizeOfBlur | The maximum bluring in y-direction measured in one tenth of a percent (relative to screen resolution). |
| GLfloat Camera::getMaximumForwardShift | ( | const GLfloat & | maxSizeOfBlur | ) |
Getter for maximum lens forward-shift.
| maxSizeOfBlur | The maximum bluring in y-direction measured in one tenth of a percent (relative to screen resolution). |
| void Camera::setTarget | ( | const Vector & | target, | |
| const bool & | adjustFocus | |||
| ) |
Sets a target to look at.
Changes Yaw and Pitch of the Camera in order for it to point to a specific target.
| target | The Point in 3-space the cam shall look at | |
| adjustFocus | If set to true the focus of the camera will be changed to meet the target distance. |
| const Vector & Camera::getTarget | ( | ) |
Getter for virtual target.
| void Camera::setAzimuth | ( | const Angle & | azimuth | ) |
Sets the azimuth of the camera.
Rotates camera arount the current target. Azimuth is measured counter clock wise with 0.0 when camera is looking down the negative Z axis.
| azimuth | the camera's new azimuth |
| const Angle & Camera::getAzimuth | ( | ) |
Getter for azimuth.
Azimuth is measured counter clock wise with 0.0 when camera is looking down the negative Z axis.
| void Camera::setElevation | ( | const Angle & | elevation | ) |
Sets the elevation of the camera.
Rotates camera arount the current target. Elevation has 0.0 when camera is aligned with x/z-plane, positive when looking down.
| elevation | the new elevation |
| const Angle & Camera::getElevation | ( | ) |
Getter for elevation.
Elevation has 0.0 when camera is aligned with x/z-plane, positive when looking down.
| void Camera::setOrbitDistance | ( | const GLfloat & | distance | ) |
Setter for orbit distance.
Sets the orbiting distance to the rotation center. Changes the focus as well /param distance the new camera-target distance
| GLfloat Camera::getOrbitDistance | ( | ) |
Getter for orbit distance.
Getter for orbiting distance to the rotation center.
| void Camera::renderGl | ( | ) | [virtual] |
The specific OpenGL commands for renderGL.
The specific OpenGL commands for paintGL.
Implements Object3d.
| void Camera::selectGl | ( | ) | [virtual] |
| void Camera::projectGl | ( | const GLint & | width, | |
| const GLint & | height, | |||
| const GLfloat & | pixelRatio | |||
| ) |
Set up a projection for the given width and height.
| width | The width of the OpenGL viewport | |
| height | The height of the OpenGL viewport | |
| pixelAspect | The target ratio width/height of a pixel on the screen (e.g. use 1.2 for streching 4:3 resolutions to 16:10 widescreen) |
| string Camera::toString | ( | ) | const [virtual] |
Returns a textual representation.
Reimplemented from Object3d.
Reimplemented in OrbitCamera.
| string Camera::className | ( | ) | const [virtual] |
Returns the class name of the object.
Reimplemented from Object3d.
Reimplemented in OrbitCamera.
| enum classId Camera::classId | ( | ) | const [virtual] |
Returns the class id of the object.
Reimplemented from Object3d.
Reimplemented in OrbitCamera.
GLfloat Camera::focusDistance [private] |
The presumed distance to the rotation center and focal point.
GLfloat Camera::nearP [private] |
The distance to the near plane.
GLfloat Camera::farP [private] |
The distance to the far plane.
Angle Camera::fovy [private] |
The opening angle (fovy).
Vector Camera::up [private] |
The up-vector.
GLfloat Camera::lensShift [private] |
lens shift for DoF-Effect
1.5.6