QCameraLens Class▲
-
Header: Qt3DRender/QCameraLens
-
Since: Qt 5.5
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
-
qmake: QT += 3drender
-
Inherited By:
-
Instantiated By: qml-qt3d-render-cameralens.xml
-
Inherits: Qt3DCore::QComponent
Detailed Description▲
Member Type Documentation▲
enum QCameraLens::ProjectionType▲
Specifies which parameters of Qt3DRender::QCameraLens are used to compute the projection matrix.
Constant |
Value |
Description |
---|---|---|
Qt3DRender::QCameraLens::OrthographicProjection |
0 |
Orthogonal projection |
Qt3DRender::QCameraLens::PerspectiveProjection |
1 |
Perspective projection |
Qt3DRender::QCameraLens::FrustumProjection |
2 |
Frustum projection |
Qt3DRender::QCameraLens::CustomProjection |
3 |
Custom user-defined projection |
Property Documentation▲
aspectRatio : float▲
Holds the current aspect ratio of the camera lens.
: 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.
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.
: 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.
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:
-
projectionMatrix() const
-
void setProjectionMatrix(const &projectionMatrix)
Notifier signal:
-
void projectionMatrixChanged(const &projectionMatrix)
projectionType : ProjectionType▲
Holds the type of the camera projection.
Access functions:
-
projectionType() const
-
void setProjectionType( projectionType)
Notifier signal:
-
void projectionTypeChanged( projectionType)
See Also▲
right : float▲
Holds the current right plane of the camera lens.
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.
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)
Member Function Documentation▲
[explicit] QCameraLens::QCameraLens(Qt3DCore::QNode *parent = nullptr)▲
Constructs a QCameraLens with given parent
void QCameraLens::setAspectRatio(float aspectRatio)▲
Sets the projection's aspect ratio to aspectRatio. This triggers a projection matrix update.
this has no effect if the projection type is not Qt3DRender::QCameraLens::PerspectiveProjection.
Setter function for property aspectRatio.
See Also▲
See also aspectRatio()
void QCameraLens::setBottom(float bottom)▲
Sets the projection's bottom window coordinate to bottom. This triggers a projection matrix update.
this has no effect if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.
Setter function for property bottom.
See Also▲
See also bottom()
void QCameraLens::setExposure(float exposure)▲
void QCameraLens::setFarPlane(float farPlane)▲
Sets the projection's far plane to farPlane. This triggers a projection matrix update.
Setter function for property farPlane.
See Also▲
See also farPlane()
void QCameraLens::setFieldOfView(float fieldOfView)▲
Sets the projection's field of view to fieldOfView degrees. This triggers a projection matrix update.
this has no effect if the projection type is not Qt3DRender::QCameraLens::PerspectiveProjection.
Setter function for property fieldOfView.
See Also▲
See also fieldOfView()
void QCameraLens::setFrustumProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)▲
Defines an orthographic projection based on left, right, bottom, top, nearPlane, farPlane.
void QCameraLens::setLeft(float left)▲
Sets the projection's lower left window coordinate to left. This triggers a projection matrix update.
this has no effect if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.
Setter function for property left.
See Also▲
See also left()
void QCameraLens::setNearPlane(float nearPlane)▲
Sets the projection's near plane to nearPlane. This triggers a projection matrix update.
Setter function for property nearPlane.
See Also▲
See also nearPlane()
void QCameraLens::setOrthographicProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)▲
Defines an orthographic projection based on left, right, bottom, top, nearPlane, farPlane.
void QCameraLens::setPerspectiveProjection(float fieldOfView, float aspectRatio, float nearPlane, float farPlane)▲
Defines a perspective projection based on fieldOfView, aspectRatio, nearPlane, farPlane.
void QCameraLens::setProjectionMatrix(const QMatrix4x4 &projectionMatrix)▲
Sets the project matrix to projectionMatrix.
This will set the projection type to Qt3DRender::QCameraLens::CustomProjection and thus ignore all other camera parameters that might have been specified.
Setter function for property projectionMatrix.
See Also▲
See also projectionMatrix()
void QCameraLens::setProjectionType(Qt3DRender::QCameraLens::ProjectionType projectionType)▲
Sets the lens' projection type projectionType.
Qt3DRender::QCameraLens::Frustum and Qt3DRender::QCameraLens::PerspectiveProjection are two different ways of specifying the same projection.
Setter function for property projectionType.
See Also▲
See also projectionType()
void QCameraLens::setRight(float right)▲
Sets the projection's upper right window coordinate to right. This triggers a projection matrix update.
this has no effect if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.
Setter function for property right.
See Also▲
See also right()
void QCameraLens::setTop(float top)▲
Sets the projection's top window coordinate to top. This triggers a projection matrix update.
this has no effect if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.
Setter function for property top.
See Also▲
See also top()