Qt3DExtras::QOrbitCameraController Class

class Qt3DExtras::QOrbitCameraController

QOrbitCameraController 类允许沿轨道路径控制场景摄像机。更多

页首 #include <QOrbitCameraController>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dextras)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
继承: Qt3DExtras::QAbstractCameraController
状态:已废弃

属性

公共功能

bool inversePan() const
bool inverseTilt() const
bool inverseXTranslate() const
bool inverseYTranslate() const
QVector3D upVector() const
float zoomInLimit() const
bool zoomTranslateViewCenter() const

公共插槽

void setInversePan(bool isInverse)
void setInverseTilt(bool isInverse)
void setInverseXTranslate(bool isInverse)
void setInverseYTranslate(bool isInverse)
void setUpVector(const QVector3D &upVector)
void setZoomInLimit(float zoomInLimit)
void setZoomTranslateViewCenter(bool isTranslate)

信号

void inversePanChanged(bool isInverse)
void inverseTiltChanged(bool isInverse)
void inverseXTranslateChanged(bool isInverse)
void inverseYTranslateChanged(bool isInverse)
void upVectorChanged(const QVector3D &upVector)
void zoomInLimitChanged()
void zoomTranslateViewCenterChanged(bool isTranslate)

详细说明

控件包括

输入操作
鼠标左键按下鼠标左键时,鼠标沿 x 轴移动可左右移动摄像机,沿 y 轴移动可上下移动摄像机。
鼠标右键按下鼠标右键时,鼠标沿 x 轴移动可使摄像机围绕摄像机视图中心平移,沿 y 轴移动可使摄像机围绕摄像机视图中心倾斜。
同时按下鼠标左键和右键同时按下鼠标左键和右键时,沿 Y 轴移动鼠标可放大或缩小摄像机,而不会改变视图中心。
鼠标滚轮在不改变视图中心的情况下放大或缩小摄像机。
箭头键相对于摄像机视口垂直和水平移动摄像机。
上下翻页键前后移动摄像机。
移位键改变上下方向键的行为,在不改变视图中心的情况下放大或缩小摄像机。其他移动键无效。
Alt 键改变箭头键的行为,以围绕视图中心平移和倾斜摄像机。禁用向上翻页和向下翻页键。
Escape 键移动摄像机,使整个场景在摄像机视口中可见。

属性文档

zoomInLimit : float

保存当前的放大限制。放大限制决定了摄像机可以放大到多接近视图中心。

访问功能:

float zoomInLimit() const
void setZoomInLimit(float zoomInLimit)

通知信号:

void zoomInLimitChanged()

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.