QCameraLens 类
class Qt3DRender::QCameraLensQt3DRender::QCameraLens 指定了将用于定义 3D 场景相机的投影矩阵。更多信息...
| 头文件 | #include <Qt3DRender/QCameraLens> | 
| CMake | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) | 
| qmake | QT += 3drender | 
| 实例化自 | CameraLens | 
| 继承自 | Qt3DCore::QComponent | 
公共类型
| enum | ProjectionType { 正交投影, 透视投影, 截头体投影, 自定义投影 } | 
属性
| 
 | 
 | 
公共函数
| QCameraLens(Qt3DCore::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 | 
| Qt3DRender::QCameraLens::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(Qt3DRender::QCameraLens::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(Qt3DRender::QCameraLens::ProjectionType projectionType) | 
| void | rightChanged(float right) | 
| void | topChanged(float top) | 
成员类型文档
枚举 QCameraLens::ProjectionType
指定用于计算投影矩阵的 Qt3DRender::QCameraLens 哪些参数。
| 常量 | 值 | 描述 | 
|---|---|---|
| Qt3DRender::QCameraLens::OrthographicProjection | 0 | 正交投影 | 
| Qt3DRender::QCameraLens::PerspectiveProjection | 1 | 透视投影 | 
| Qt3DRender::QCameraLens::FrustumProjection | 2 | 视锥投影 | 
| Qt3DRender::QCameraLens::CustomProjection | 3 | 自定义用户定义投影 | 
属性文档
aspectRatio : float
保留当前镜头的纵横比。
注意: 如果投影类型不是 Qt3DRender::QCameraLens::PerspectiveProjection,则返回值可能未定义。
访问函数
| float | aspectRatio() const | 
| void | setAspectRatio(float aspectRatio) | 
通知信号
| void | aspectRatioChanged(float aspectRatio) | 
bottom : float
保留当前镜头的底部平面。
注意: 如果投影类型是 Qt3DRender::QCameraLens::PerspectiveProjection,则返回值可能未定义。
访问函数
| float | bottom() const | 
| void | setBottom(float bottom) | 
通知信号
| void | bottomChanged(float bottom) | 
曝光 : 浮点型
包含相机镜头当前的曝光值。
访问函数
| float | 曝光() const | 
| void | setExposure(浮点型 曝光) | 
通知信号
| void | 曝光Changed(浮点型 曝光) | 
farPlane : 浮点型
包含相机镜头当前远平面。
访问函数
| float | farPlane() const | 
| void | setFarPlane(浮点型 farPlane) | 
通知信号
| void | farPlaneChanged(浮点型 farPlane) | 
fieldOfView : 浮点型
包含相机镜头当前视野。
注意: 如果投影类型不是 Qt3DRender::QCameraLens::PerspectiveProjection,则返回值可能未定义。
访问函数
| float | fieldOfView() const | 
| void | setFieldOfView(浮点型 fieldOfView) | 
通知信号
| void | fieldOfViewChanged(浮点型 fieldOfView) | 
left : 浮点型
包含相机镜头当前左平面。
注意: 如果投影类型是 Qt3DRender::QCameraLens::PerspectiveProjection,则返回值可能未定义。
访问函数
| float | left() const | 
| void | setLeft(浮点型 left) | 
通知信号
| void | leftChanged(浮点型 left) | 
nearPlane : 浮点型
包含相机镜头当前远平面。
访问函数
| float | nearPlane() const | 
| void | setNearPlane(浮点型 nearPlane) | 
通知信号
| void | nearPlaneChanged(浮点型 nearPlane) | 
projectionMatrix : QMatrix4x4
包含相机镜头当前的投影矩阵。
访问函数
| QMatrix4x4 | projectionMatrix() const | 
| void | setProjectionMatrix(const QMatrix4x4 &projectionMatrix) | 
通知信号
| void | projectionMatrixChanged(const QMatrix4x4 &projectionMatrix) | 
projectionType : ProjectionType
包含相机投影的类型。
访问函数
| Qt3DRender::QCameraLens::ProjectionType | projectionType() const | 
| void | setProjectionType(Qt3DRender::QCameraLens::ProjectionType projectionType) | 
通知信号
| void | projectionTypeChanged(Qt3DRender::QCameraLens::ProjectionType projectionType) | 
另请参阅Qt3DRender::QCameraLens::ProjectionType.
right : 浮点型
包含相机镜头当前右平面。
注意: 如果投影类型是 Qt3DRender::QCameraLens::PerspectiveProjection,则返回值可能未定义。
访问函数
| float | right() const | 
| void | setRight(浮点型 right) | 
通知信号
| void | rightChanged(浮点型 right) | 
top : 浮点型
包含相机镜头当前顶平面。
注意: 如果投影类型是 Qt3DRender::QCameraLens::PerspectiveProjection,则返回值可能未定义。
访问函数
| float | top() const | 
| void | setTop(浮点型 top) | 
通知信号
| void | topChanged(浮点型 top) | 
成员函数文档
[显式] QCameraLens::QCameraLens(Qt3DCore::QNode *parent = nullptr)
使用给定的 parent 构造 QCameraLens
[槽] void QCameraLens::setAspectRatio(float aspectRatio)
设置投影的纵横比至aspectRatio。这将触发表投影矩阵的更新。
注意:如果投影类型不是Qt3DRender::QCameraLens::PerspectiveProjection,则此操作无效果。
注意:该函数是属性aspectRatio的设置器。
另请参阅:aspectRatio。
[槽] void QCameraLens::setBottom(float bottom)
设置投影的底部窗口坐标至bottom。这将触发表投影矩阵的更新。
注意:如果投影类型为Qt3DRender::QCameraLens::PerspectiveProjection,则此操作无效果。
注意:该函数是属性bottom的设置器。
另请参阅:bottom。
[槽] void QCameraLens::setExposure(float exposure)
设置相机镜头的exposure
注意:该函数是属性exposure的设置器。
另请参阅:exposure。
[槽] void QCameraLens::setFarPlane(float farPlane)
设置投影的远平面至farPlane。这将触发表投影矩阵的更新。
注意:该函数是属性farPlane的设置器。
另请参阅:farPlane。
[槽] void QCameraLens::setFieldOfView(float fieldOfView)
设置投影的视场角至fieldOfView度。这将触发表投影矩阵的更新。
注意:如果投影类型不是Qt3DRender::QCameraLens::PerspectiveProjection,则此操作无效果。
注意:该函数是属性fieldOfView的设置器。
另请参阅:fieldOfView。
void QCameraLens::setFrustumProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)
基于left、right、bottom、top、nearPlane和farPlane定义一个正交投影。
[槽] void QCameraLens::setLeft(float left)
设置投影的左下窗口坐标至left。这将触发表投影矩阵的更新。
注意:如果投影类型为Qt3DRender::QCameraLens::PerspectiveProjection,则此操作无效果。
注意:该函数是属性left的设置器。
另请参阅:left。
[槽] void QCameraLens::setNearPlane(float nearPlane)
设置投影的近平面至nearPlane。这将触发表投影矩阵的更新。
注意:该函数是属性nearPlane的设置器。
另请参阅:nearPlane。
void QCameraLens::setOrthographicProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)
基于left、right、bottom、top、nearPlane和farPlane定义一个正交投影。
void QCameraLens::setPerspectiveProjection(float fieldOfView, float aspectRatio, float nearPlane, float farPlane)
基于视场、纵横比、近裁剪面、远裁剪面定义透视投影。
[slot] void QCameraLens::setProjectionMatrix(const QMatrix4x4 &projectionMatrix)
将投影矩阵设置为projectionMatrix。
注意:这将设置投影类型为Qt3DRender::QCameraLens::CustomProjection,因此将忽略所有其他可能已指定的相机参数。
注意:该属性projectionMatrix的设置函数。
另请参阅:projectionMatrix。
[slot] void QCameraLens::setProjectionType(Qt3DRender::QCameraLens::ProjectionType projectionType)
设置镜头的投影类型projectionType。
注意:Qt3DRender::QCameraLens::Frustum和Qt3DRender::QCameraLens::PerspectiveProjection是指定相同投影的两种不同方式。
注意:该属性projectionType的设置函数。
另请参阅:projectionType。
[slot] void QCameraLens::setRight(float right)
将投影的右上角窗口坐标设置为right。这将触发投影矩阵更新。
注意:如果投影类型为Qt3DRender::QCameraLens::PerspectiveProjection,则此操作无效果。
注意:该属性right的设置函数。
另请参阅:right。
[slot] void QCameraLens::setTop(float top)
将投影的顶部窗口坐标设置为top。这将触发投影矩阵更新。
注意:如果投影类型为Qt3DRender::QCameraLens::PerspectiveProjection,则此操作无效果。
注意:该属性top的设置函数。
另请参阅:top。
© 2024 Qt公司有限公司。此处包含的文档贡献的版权归其各自所有者所有。此处提供的文档是根据自由软件基金会颁布的GNU自由文档许可证版本1.3的条款许可的。Qt和相关的标志是芬兰及其它国家/地区的Qt公司注册商标。所有其它商标是它们各自所有者的财产。