The Camera class provides view and perspective projection matrices. Additional the viewport of camera is stored. The view of camera has to be specified by eye, center and up or by position, viewdirection and up. It is allowed to mix both definitions, but it might lead to unexpected behaviour. The perspective projection is specified by field of view, viewport, and near and far plane.
More...
#include <camera.h>
|
void | setPosition (const QVector3D &position) |
| Sets position of camera to given value. center() will be changed in order to keep viewDirection() the same. More...
|
|
void | setViewDirection (const QVector3D &viewDirection) |
| Sets viewDirection of camera to given vector. center() will be changed in order to keep eye() consistent. More...
|
|
void | setEye (const QVector3D &eye) |
| Sets eye (position) of camera to given value. center() will not be changed, so viewDirection() is set to center() - eye() More...
|
|
void | setCenter (const QVector3D ¢er) |
| Sets center of camera to given value. viewDirection() will be set to new center() - eye(). More...
|
|
void | setUp (const QVector3D &up) |
| Sets up-vector of camera. More...
|
|
void | setView (const QVector3D &eye, const QVector3D ¢er, const QVector3D &up) |
| Convenience method to specify view with one method call. More...
|
|
void | setViewport (const QSize &viewport) |
|
void | setViewport (int x, int y) |
|
void | setFovy (float angle) |
|
void | setZNear (float zNear) |
|
void | setZFar (float zFar) |
|
The Camera class provides view and perspective projection matrices. Additional the viewport of camera is stored. The view of camera has to be specified by eye, center and up or by position, viewdirection and up. It is allowed to mix both definitions, but it might lead to unexpected behaviour. The perspective projection is specified by field of view, viewport, and near and far plane.
Camera::Camera |
( |
QObject * |
parent = 0 | ) |
|
|
explicit |
Camera::Camera |
( |
const Camera & |
camera, |
|
|
QObject * |
parent = 0 |
|
) |
| |
Creates a new Camera with matrices copied.
- Parameters
-
camera | Specifies the camera the matrices are copied from. |
parent | Specifies the parent |
const QVector3D& Camera::center |
( |
| ) |
const |
const QVector3D& Camera::eye |
( |
| ) |
const |
float Camera::fovy |
( |
| ) |
const |
void Camera::invalidateProjection |
( |
| ) |
const |
|
protected |
void Camera::invalidateView |
( |
| ) |
const |
|
protected |
const QVector3D& Camera::position |
( |
| ) |
const |
QMatrix4x4 const & Camera::projection |
( |
| ) |
const |
QMatrix4x4 const & Camera::projectionInverted |
( |
| ) |
const |
void Camera::recalculateProjection |
( |
| ) |
const |
|
protected |
void Camera::recalculateView |
( |
| ) |
const |
|
protected |
void Camera::recalculateViewProjection |
( |
| ) |
const |
|
protected |
void Camera::setCenter |
( |
const QVector3D & |
center | ) |
|
|
slot |
Sets center of camera to given value. viewDirection() will be set to new center() - eye().
- Parameters
-
center | Position the camera is looking to. |
void Camera::setEye |
( |
const QVector3D & |
eye | ) |
|
|
slot |
Sets eye (position) of camera to given value. center() will not be changed, so viewDirection() is set to center() - eye()
- Parameters
-
eye | Camera will be set to this position. |
void Camera::setFovy |
( |
float |
angle | ) |
|
|
slot |
void Camera::setPosition |
( |
const QVector3D & |
position | ) |
|
|
slot |
Sets position of camera to given value. center() will be changed in order to keep viewDirection() the same.
- Parameters
-
position | Camera will be set to this position. |
void Camera::setUp |
( |
const QVector3D & |
up | ) |
|
|
slot |
Sets up-vector of camera.
- Parameters
-
void Camera::setView |
( |
const QVector3D & |
eye, |
|
|
const QVector3D & |
center, |
|
|
const QVector3D & |
up |
|
) |
| |
|
slot |
Convenience method to specify view with one method call.
- Parameters
-
void Camera::setViewDirection |
( |
const QVector3D & |
viewDirection | ) |
|
|
slot |
Sets viewDirection of camera to given vector. center() will be changed in order to keep eye() consistent.
- Parameters
-
viewDirection | Direction the camera should look. |
void Camera::setViewport |
( |
const QSize & |
viewport | ) |
|
|
slot |
void Camera::setViewport |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
slot |
void Camera::setZFar |
( |
float |
zFar | ) |
|
|
slot |
void Camera::setZNear |
( |
float |
zNear | ) |
|
|
slot |
const QVector3D& Camera::up |
( |
| ) |
const |
QMatrix4x4 const & Camera::view |
( |
| ) |
const |
void Camera::viewChanged |
( |
| ) |
|
|
signal |
QVector3D Camera::viewDirection |
( |
| ) |
const |
QMatrix4x4 const & Camera::viewInverted |
( |
| ) |
const |
const QSize& Camera::viewport |
( |
| ) |
const |
QMatrix4x4 const & Camera::viewProjection |
( |
| ) |
const |
QMatrix4x4 const & Camera::viewProjectionInverted |
( |
| ) |
const |
float Camera::zFar |
( |
| ) |
const |
float Camera::zNear |
( |
| ) |
const |
QVector3D* Camera::m_center |
|
protected |
bool Camera::m_isProjectionInvalid |
|
mutableprotected |
bool Camera::m_isViewInvalid |
|
mutableprotected |
bool Camera::m_isViewProjectionInvalid |
|
mutableprotected |
QMatrix4x4* Camera::m_projection |
|
mutableprotected |
QMatrix4x4* Camera::m_projectionInverted |
|
mutableprotected |
QMatrix4x4* Camera::m_view |
|
mutableprotected |
QMatrix4x4* Camera::m_viewInverted |
|
mutableprotected |
QSize* Camera::m_viewport |
|
protected |
QMatrix4x4* Camera::m_viewProjection |
|
mutableprotected |
QMatrix4x4* Camera::m_viewProjectionInverted |
|
mutableprotected |
The documentation for this class was generated from the following files: