QCamera Class
(Qt3DRender::QCamera)The QCamera class defines a view point through which the scene will be rendered. 更多...
头文件: | #include <Qt3DRender/QCamera> |
qmake: | QT += 3drender |
开始支持版本: | Qt 5.5 |
Instantiated By: | Camera |
基类: | Qt3DCore::QEntity |
公有类型
enum | CameraTranslationOption { TranslateViewCenter, DontTranslateViewCenter } |
属性
|
|
- 3 个属性继承自 Qt3DCore::QNode
- 1 个属性继承自 QObject
公有函数
QCamera(QNode *parent = nullptr) | |
float | aspectRatio() const |
float | bottom() const |
float | exposure() const |
float | farPlane() const |
float | fieldOfView() const |
float | left() const |
QCameraLens * | lens() const |
float | nearPlane() const |
void | pan(float angle) |
void | pan(float angle, const QVector3D &axis) |
void | panAboutViewCenter(float angle) |
void | panAboutViewCenter(float angle, const QVector3D &axis) |
QQuaternion | panRotation(float angle) const |
QVector3D | position() const |
QMatrix4x4 | projectionMatrix() const |
QCameraLens::ProjectionType | projectionType() const |
float | right() const |
void | roll(float angle) |
void | rollAboutViewCenter(float angle) |
QQuaternion | rollRotation(float angle) const |
void | rotate(const QQuaternion &q) |
void | rotateAboutViewCenter(const QQuaternion &q) |
QQuaternion | rotation(float angle, const QVector3D &axis) const |
void | tilt(float angle) |
void | tiltAboutViewCenter(float angle) |
QQuaternion | tiltRotation(float angle) const |
float | top() const |
Qt3DCore::QTransform * | transform() const |
void | translate(const QVector3D &vLocal, CameraTranslationOption option = TranslateViewCenter) |
void | translateWorld(const QVector3D &vWorld, CameraTranslationOption option = TranslateViewCenter) |
QVector3D | upVector() const |
QVector3D | viewCenter() const |
QMatrix4x4 | viewMatrix() const |
QVector3D | viewVector() const |
- 4 个公有函数继承自 Qt3DCore::QEntity
- 11 个公有函数继承自 Qt3DCore::QNode
- 32 个公有函数继承自 QObject
公有槽函数
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 | setPosition(const QVector3D &position) |
void | setProjectionMatrix(const QMatrix4x4 &projectionMatrix) |
void | setProjectionType(QCameraLens::ProjectionType type) |
void | setRight(float right) |
void | setTop(float top) |
void | setUpVector(const QVector3D &upVector) |
void | setViewCenter(const QVector3D &viewCenter) |
- 3 个公有槽函数继承自 Qt3DCore::QNode
- 1 个公有槽函数继承自 QObject
信号
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 | positionChanged(const QVector3D &position) |
void | projectionMatrixChanged(const QMatrix4x4 &projectionMatrix) |
void | projectionTypeChanged(QCameraLens::ProjectionType projectionType) |
void | rightChanged(float right) |
void | topChanged(float top) |
void | upVectorChanged(const QVector3D &upVector) |
void | viewCenterChanged(const QVector3D &viewCenter) |
void | viewMatrixChanged() |
void | viewVectorChanged(const QVector3D &viewVector) |
- 4 个信号继承自 Qt3DCore::QNode
- 2 个信号继承自 QObject
受保护的函数
QCamera(QCameraPrivate &dd, QNode *parent = nullptr) |
- 2 个受保护的函数继承自 Qt3DCore::QNode
- 9 个受保护的函数继承自 QObject
其他继承的成员
详细描述
The QCamera class defines a view point through which the scene will be rendered.
成员类型
enum QCamera::CameraTranslationOption
This enum specifies how camera view center is translated
Constant | Value | Description |
---|---|---|
Qt3DRender::QCamera::TranslateViewCenter | 0 | Translate the view center causing the view direction to remain the same |
Qt3DRender::QCamera::DontTranslateViewCenter | 1 | Don't translate the view center causing the view direction to change |
属性
aspectRatio : float
Holds the current aspect ratio.
访问函数:
float | aspectRatio() const |
void | setAspectRatio(float aspectRatio) |
Notifier signal:
void | aspectRatioChanged(float aspectRatio) |
bottom : float
Holds the current bottom of the camera.
访问函数:
float | bottom() const |
void | setBottom(float bottom) |
Notifier signal:
void | bottomChanged(float bottom) |
exposure : float
Holds the current exposure of the camera.
访问函数:
float | exposure() const |
void | setExposure(float exposure) |
Notifier signal:
void | exposureChanged(float exposure) |
farPlane : float
Holds the current camera far plane.
访问函数:
float | farPlane() const |
void | setFarPlane(float farPlane) |
Notifier signal:
void | farPlaneChanged(float farPlane) |
fieldOfView : float
Holds the current field of view in degrees.
访问函数:
float | fieldOfView() const |
void | setFieldOfView(float fieldOfView) |
Notifier signal:
void | fieldOfViewChanged(float fieldOfView) |
left : float
Holds the current left of the camera.
访问函数:
float | left() const |
void | setLeft(float left) |
Notifier signal:
void | leftChanged(float left) |
nearPlane : float
Holds the current camera near plane.
访问函数:
float | nearPlane() const |
void | setNearPlane(float nearPlane) |
Notifier signal:
void | nearPlaneChanged(float nearPlane) |
position : QVector3D
Holds the camera's position.
访问函数:
QVector3D | position() const |
void | setPosition(const QVector3D &position) |
Notifier signal:
void | positionChanged(const QVector3D &position) |
projectionMatrix : QMatrix4x4
Holds the current projection matrix of the camera.
访问函数:
QMatrix4x4 | projectionMatrix() const |
void | setProjectionMatrix(const QMatrix4x4 &projectionMatrix) |
Notifier signal:
void | projectionMatrixChanged(const QMatrix4x4 &projectionMatrix) |
projectionType : Qt3DRender::QCameraLens::ProjectionType
Holds the type of the camera projection.
- CameraLens.OrthographicProjection
- CameraLens.PerspectiveProjection
- CameraLens.FrustumProjection
- CameraLens.CustomProjection
访问函数:
QCameraLens::ProjectionType | projectionType() const |
void | setProjectionType(QCameraLens::ProjectionType type) |
Notifier signal:
void | projectionTypeChanged(QCameraLens::ProjectionType projectionType) |
参见 Qt3DRender::QCameraLens::ProjectionType.
right : float
Holds the current right of the camera.
访问函数:
float | right() const |
void | setRight(float right) |
Notifier signal:
void | rightChanged(float right) |
top : float
Holds the current top of the camera.
访问函数:
float | top() const |
void | setTop(float top) |
Notifier signal:
void | topChanged(float top) |
upVector : QVector3D
Holds the camera's up vector.
访问函数:
QVector3D | upVector() const |
void | setUpVector(const QVector3D &upVector) |
Notifier signal:
void | upVectorChanged(const QVector3D &upVector) |
viewCenter : QVector3D
Holds the camera's view center.
访问函数:
QVector3D | viewCenter() const |
void | setViewCenter(const QVector3D &viewCenter) |
Notifier signal:
void | viewCenterChanged(const QVector3D &viewCenter) |
viewMatrix : const QMatrix4x4
Holds the camera's view matrix.
访问函数:
QMatrix4x4 | viewMatrix() const |
Notifier signal:
void | viewMatrixChanged() |
viewVector : const QVector3D
Holds the camera's view vector.
访问函数:
QVector3D | viewVector() const |
Notifier signal:
void | viewVectorChanged(const QVector3D &viewVector) |
成员函数
QCamera::QCamera(QNode *parent = nullptr)
Default constructs an instance of QCamera.
[protected]
QCamera::QCamera(QCameraPrivate &dd, QNode *parent = nullptr)
Copy constructor.
QCameraLens *QCamera::lens() const
Returns the current lens.
void QCamera::pan(float angle)
Adjusts the pan angle of the camera by angle in degrees.
void QCamera::pan(float angle, const QVector3D &axis)
Adjusts the pan angle of the camera by angle in degrees on a chosen axis.
void QCamera::panAboutViewCenter(float angle)
Adjusts the camera pan about view center by angle in degrees.
void QCamera::panAboutViewCenter(float angle, const QVector3D &axis)
Adjusts the camera pan about view center by angle in degrees on axis.
QQuaternion QCamera::panRotation(float angle) const
Returns the calculated pan rotation in relation to the angle in degrees taken in to adjust the camera's pan or left/right rotation on the Y axis.
void QCamera::roll(float angle)
Adjusts the camera roll by angle in degrees.
void QCamera::rollAboutViewCenter(float angle)
Adjusts the camera roll about view center by angle in degrees.
QQuaternion QCamera::rollRotation(float angle) const
Returns the calculated roll rotation in relation to the angle in degrees taken in to adjust the camera's roll or lean left/right rotation on the Z axis.
void QCamera::rotate(const QQuaternion &q)
Rotates the camera with the use of a Quaternion in q.
void QCamera::rotateAboutViewCenter(const QQuaternion &q)
Rotates the camera about the view center with the use of a Quaternion in q.
QQuaternion QCamera::rotation(float angle, const QVector3D &axis) const
Returns the calculated rotation in relation to the angle in degrees and chosen axis taken in.
[slot]
void QCamera::setAspectRatio(float aspectRatio)
Sets the camera's aspect ratio to aspectRatio.
Note: Setter function for property aspectRatio.
参见 aspectRatio().
[slot]
void QCamera::setBottom(float bottom)
Sets the bottom of the camera to bottom.
Note: Setter function for property bottom.
参见 bottom().
[slot]
void QCamera::setExposure(float exposure)
Sets the camera's exposure to exposure.
Note: Setter function for property exposure.
参见 exposure().
[slot]
void QCamera::setFarPlane(float farPlane)
Sets the camera's far plane to farPlane
Note: Setter function for property farPlane.
参见 farPlane().
[slot]
void QCamera::setFieldOfView(float fieldOfView)
Sets the camera's field of view to fieldOfView in degrees.
Note: Setter function for property fieldOfView.
参见 fieldOfView().
[slot]
void QCamera::setLeft(float left)
Sets the left of the camera to left.
Note: Setter function for property left.
参见 left().
[slot]
void QCamera::setNearPlane(float nearPlane)
Sets the camera's near plane to nearPlane.
Note: Setter function for property nearPlane.
参见 nearPlane().
[slot]
void QCamera::setPosition(const QVector3D &position)
Sets the camera's position in 3D space to position.
Note: Setter function for property position.
参见 position().
[slot]
void QCamera::setProjectionMatrix(const QMatrix4x4 &projectionMatrix)
Sets the camera's projection matrix to projectionMatrix.
Note: Setter function for property projectionMatrix.
参见 projectionMatrix().
[slot]
void QCamera::setProjectionType(QCameraLens::ProjectionType type)
Sets the camera's projection type to type.
Note: Setter function for property projectionType.
参见 projectionType().
[slot]
void QCamera::setRight(float right)
Sets the right of the camera to right.
Note: Setter function for property right.
参见 right().
[slot]
void QCamera::setTop(float top)
Sets the top of the camera to top.
Note: Setter function for property top.
参见 top().
[slot]
void QCamera::setUpVector(const QVector3D &upVector)
Sets the camera's up vector to upVector.
Note: Setter function for property upVector.
参见 upVector().
[slot]
void QCamera::setViewCenter(const QVector3D &viewCenter)
Sets the camera's view center to viewCenter.
Note: Setter function for property viewCenter.
参见 viewCenter().
void QCamera::tilt(float angle)
Adjusts the tilt angle of the camera by angle in degrees.
void QCamera::tiltAboutViewCenter(float angle)
Adjusts the camera tilt about view center by angle in degrees.
QQuaternion QCamera::tiltRotation(float angle) const
Returns the calculated tilt rotation in relation to the angle in degrees taken in to adjust the camera's tilt or up/down rotation on the X axis.
Qt3DCore::QTransform *QCamera::transform() const
Returns the camera's position via transform.
void QCamera::translate(const QVector3D &vLocal, CameraTranslationOption option = TranslateViewCenter)
Translates the camera's position and its view vector by vLocal in local coordinates. The option allows for toggling whether the view center should be translated.
void QCamera::translateWorld(const QVector3D &vWorld, CameraTranslationOption option = TranslateViewCenter)
Translates the camera's position and its view vector by vWorld in world coordinates. The option allows for toggling whether the view center should be translated.