QCameraLens Class

class Qt3DRender::QCameraLens

Qt3DRender::QCameraLens specifies the projection matrix that will be used to define a Camera for a 3D scene. More...

Header: #include <Qt3DRender/QCameraLens>
qmake: QT += 3drender
Since: Qt 5.5
Instantiated By: CameraLens
Inherits: Qt3DCore::QComponent

This class was introduced in Qt 5.5.

Public Types

enum ProjectionType { OrthographicProjection, PerspectiveProjection, FrustumProjection, CustomProjection }

Properties

Public Functions

float aspectRatio() const
float bottom() const
float exposure() const
float farPlane() const
float fieldOfView() const
float left() const
float nearPlane() const
QMatrix4x4 projectionMatrix() const
Qt3DRender::QCameraLens::ProjectionType projectionType() const
float right() const
float top() const

Public Slots

void setAspectRatio(float aspectRatio)
void setBottom(float bottom)
void setExposure(float exposure)
void setFarPlane(float farPlane)
void setFieldOfView(float fieldOfView)
void setLeft(float left)
void setNearPlane(float nearPlane)
void setProjectionMatrix(const QMatrix4x4 &projectionMatrix)
void setProjectionType(Qt3DRender::QCameraLens::ProjectionType projectionType)
void setRight(float right)
void setTop(float top)

Signals

void aspectRatioChanged(float aspectRatio)
void bottomChanged(float bottom)
void exposureChanged(float exposure)
void farPlaneChanged(float farPlane)
void fieldOfViewChanged(float fieldOfView)
void leftChanged(float left)
void nearPlaneChanged(float nearPlane)
void projectionMatrixChanged(const QMatrix4x4 &projectionMatrix)
void projectionTypeChanged(QCameraLens::ProjectionType projectionType)
void rightChanged(float right)
void topChanged(float top)

Detailed Description

Member Type Documentation

enum QCameraLens::ProjectionType

Specifies which parameters of Qt3DRender::QCameraLens are used to compute the projection matrix.

ConstantValueDescription
Qt3DRender::QCameraLens::OrthographicProjection0Orthogonal projection
Qt3DRender::QCameraLens::PerspectiveProjection1Perspective projection
Qt3DRender::QCameraLens::FrustumProjection2Frustum projection
Qt3DRender::QCameraLens::CustomProjection3Custom user-defined projection

Property Documentation

aspectRatio : float

Holds the current aspect ratio of the camera lens.

Note: : The return value may be undefined if the projection type is not Qt3DRender::QCameraLens::PerspectiveProjection.

Access functions:

float aspectRatio() const
void setAspectRatio(float aspectRatio)

Notifier signal:

void aspectRatioChanged(float aspectRatio)

bottom : float

Holds the current bottom plane of the camera lens.

Note: The return value may be undefined if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.

Access functions:

float bottom() const
void setBottom(float bottom)

Notifier signal:

void bottomChanged(float bottom)

exposure : float

Holds the current exposure of the camera lens.

Access functions:

float exposure() const
void setExposure(float exposure)

Notifier signal:

void exposureChanged(float exposure)

farPlane : float

Holds the current near plane of the camera lens.

Access functions:

float farPlane() const
void setFarPlane(float farPlane)

Notifier signal:

void farPlaneChanged(float farPlane)

fieldOfView : float

Holds the current field of view of the camera lens.

Note: : The return value may be undefined if the projection type is not Qt3DRender::QCameraLens::PerspectiveProjection.

Access functions:

float fieldOfView() const
void setFieldOfView(float fieldOfView)

Notifier signal:

void fieldOfViewChanged(float fieldOfView)

left : float

Holds the current left plane of the camera lens.

Note: The return value may be undefined if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.

Access functions:

float left() const
void setLeft(float left)

Notifier signal:

void leftChanged(float left)

nearPlane : float

Holds the current near plane of the camera lens.

Access functions:

float nearPlane() const
void setNearPlane(float nearPlane)

Notifier signal:

void nearPlaneChanged(float nearPlane)

projectionMatrix : QMatrix4x4

Holds the current projection matrix of the camera lens.

Access functions:

QMatrix4x4 projectionMatrix() const
void setProjectionMatrix(const QMatrix4x4 &projectionMatrix)

Notifier signal:

void projectionMatrixChanged(const QMatrix4x4 &projectionMatrix)

projectionType : ProjectionType

Holds the type of the camera projection.

Access functions:

Qt3DRender::QCameraLens::ProjectionType projectionType() const
void setProjectionType(Qt3DRender::QCameraLens::ProjectionType projectionType)

Notifier signal:

void projectionTypeChanged(QCameraLens::ProjectionType projectionType)

See also Qt3DRender::QCameraLens::ProjectionType.

right : float

Holds the current right plane of the camera lens.

Note: The return value may be undefined if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.

Access functions:

float right() const
void setRight(float right)

Notifier signal:

void rightChanged(float right)

top : float

Holds the current top plane of the camera lens.

Note: The return value may be undefined if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.

Access functions:

float top() const
void setTop(float top)

Notifier signal:

void topChanged(float top)