QCameraLens Class

(Qt3DRender::QCameraLens)

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

头文件: #include <Qt3DRender/QCameraLens>
qmake: QT += 3drender
开始支持版本: Qt 5.5
Instantiated By: CameraLens
基类: Qt3DCore::QComponent

公有类型

enum ProjectionType { OrthographicProjection, PerspectiveProjection, FrustumProjection, CustomProjection }

属性

公有函数

QCameraLens(QNode *parent = nullptr)
float aspectRatio() const
float bottom() const
float exposure() const
float farPlane() const
float fieldOfView() const
float left() const
float nearPlane() const
QMatrix4x4 projectionMatrix() const
ProjectionType projectionType() const
float right() const
void setFrustumProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)
void setOrthographicProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)
void setPerspectiveProjection(float fieldOfView, float aspectRatio, float nearPlane, float farPlane)
float top() const

公有槽函数

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(ProjectionType projectionType)
void setRight(float right)
void setTop(float top)

信号

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)

受保护的函数

QCameraLens(QCameraLensPrivate &dd, QNode *parent = nullptr)

其他继承的成员

  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 2 个受保护的变量继承自 QObject

详细描述

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

成员类型

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

属性

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.

访问函数:

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.

访问函数:

float bottom() const
void setBottom(float bottom)

Notifier signal:

void bottomChanged(float bottom)

exposure : float

Holds the current exposure of the camera lens.

访问函数:

float exposure() const
void setExposure(float exposure)

Notifier signal:

void exposureChanged(float exposure)

farPlane : float

Holds the current near plane of the camera lens.

访问函数:

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.

访问函数:

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.

访问函数:

float left() const
void setLeft(float left)

Notifier signal:

void leftChanged(float left)

nearPlane : float

Holds the current near plane of the camera lens.

访问函数:

float nearPlane() const
void setNearPlane(float nearPlane)

Notifier signal:

void nearPlaneChanged(float nearPlane)

projectionMatrix : QMatrix4x4

Holds the current projection matrix of the camera lens.

访问函数:

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

Notifier signal:

void projectionMatrixChanged(const QMatrix4x4 &projectionMatrix)

projectionType : ProjectionType

Holds the type of the camera projection.

访问函数:

ProjectionType projectionType() const
void setProjectionType(ProjectionType projectionType)

Notifier signal:

void projectionTypeChanged(QCameraLens::ProjectionType projectionType)

参见 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.

访问函数:

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.

访问函数:

float top() const
void setTop(float top)

Notifier signal:

void topChanged(float top)

成员函数

QCameraLens::QCameraLens(QNode *parent = nullptr)

Constructs a QCameraLens with given parent

[protected] QCameraLens::QCameraLens(QCameraLensPrivate &dd, QNode *parent = nullptr)

Copy constructor.

[slot] void QCameraLens::setAspectRatio(float aspectRatio)

Sets the projection's aspect ratio to aspectRatio. This triggers a projection matrix update.

Note: this has no effect if the projection type is not Qt3DRender::QCameraLens::PerspectiveProjection.

Note: Setter function for property aspectRatio.

参见 aspectRatio().

[slot] void QCameraLens::setBottom(float bottom)

Sets the projection's bottom window coordinate to bottom. This triggers a projection matrix update.

Note: this has no effect if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.

Note: Setter function for property bottom.

参见 bottom().

[slot] void QCameraLens::setExposure(float exposure)

Sets the camera lens' exposure

Note: Setter function for property exposure.

参见 exposure().

[slot] void QCameraLens::setFarPlane(float farPlane)

Sets the projection's far plane to farPlane. This triggers a projection matrix update.

Note: Setter function for property farPlane.

参见 farPlane().

[slot] void QCameraLens::setFieldOfView(float fieldOfView)

Sets the projection's field of view to fieldOfView degrees. This triggers a projection matrix update.

Note: this has no effect if the projection type is not Qt3DRender::QCameraLens::PerspectiveProjection.

Note: Setter function for property fieldOfView.

参见 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.

[slot] void QCameraLens::setLeft(float left)

Sets the projection's lower left window coordinate to left. This triggers a projection matrix update.

Note: this has no effect if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.

Note: Setter function for property left.

参见 left().

[slot] void QCameraLens::setNearPlane(float nearPlane)

Sets the projection's near plane to nearPlane. This triggers a projection matrix update.

Note: Setter function for property nearPlane.

参见 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.

[slot] void QCameraLens::setProjectionMatrix(const QMatrix4x4 &projectionMatrix)

Sets the project matrix to projectionMatrix.

Note: This will set the projection type to Qt3DRender::QCameraLens::CustomProjection and thus ignore all other camera parameters that might have been specified.

Note: Setter function for property projectionMatrix.

参见 projectionMatrix().

[slot] void QCameraLens::setProjectionType(ProjectionType projectionType)

Sets the lens' projection type projectionType.

Note: Qt3DRender::QCameraLens::Frustum and Qt3DRender::QCameraLens::PerspectiveProjection are two different ways of specifying the same projection.

Note: Setter function for property projectionType.

参见 projectionType().

[slot] void QCameraLens::setRight(float right)

Sets the projection's upper right window coordinate to right. This triggers a projection matrix update.

Note: this has no effect if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.

Note: Setter function for property right.

参见 right().

[slot] void QCameraLens::setTop(float top)

Sets the projection's top window coordinate to top. This triggers a projection matrix update.

Note: this has no effect if the projection type is Qt3DRender::QCameraLens::PerspectiveProjection.

Note: Setter function for property top.

参见 top().