OrbitCameraController QML Type
围绕原点旋转的相机控制器。更多
Import Statement: | import QtQuick3D.Helpers |
Inherits: |
属性
- acceptedButtons : Qt::MouseButtons
(since 6.9)
- automaticClipping : bool
(since 6.9)
- camera : QtQuick3D::Camera
- mouseEnabled : bool
- origin : QtQuick3D::Node
- panEnabled : bool
- xInvert : bool
- xSpeed : real
- yInvert : bool
- ySpeed : real
详细说明
该辅助器提供了一种围绕原点旋转摄像机的方法。OrbitCameraController 接受一个节点(Node)作为原点,并接受一个摄像机对象(Camera)作为原点节点的子节点进行控制。只需调整子摄像头相对于父原点的 Z 位置,就能使摄像头靠近或远离目标原点。通过对原点节点进行旋转,子摄像头将围绕原点节点运行。
OrbitCameraController 项目本身是一个接受输入事件的 2D 项目,因此无论其大小和位置如何,都将是接受输入事件的地方。要缩放,可以使用鼠标滚轮或执行捏合手势。要旋转,请单击或触摸并拖动该区域。要平移,请按住 control 键并拖动该区域。平移将改变原点节点的位置。也可以通过双指拖动来执行平移手势。
View3D { camera: cameraNode Node { id: originNode PerspectiveCamera { id: cameraNode z: 100 } } OrbitCameraController { anchors.fill: parent origin: originNode camera: cameraNode } ... }
属性文档
acceptedButtons : Qt::MouseButtons |
指定控制摄像头的鼠标按钮。
该属性在 Qt 6.9 中引入。
automaticClipping : bool |
camera : QtQuick3D::Camera |
指定要控制的摄像机节点。这是必填属性,应为origin 节点的子节点。
mouseEnabled : bool |
启用鼠标控制。
origin : QtQuick3D::Node |
指定要控制的原点节点。这是必填属性,应为 节点的父节点。camera
panEnabled : bool |
启用平移控制。
xInvert : bool |
启用 X 轴控制。
xSpeed : real |
指定鼠标沿 X 轴移动时的导航速度。
yInvert : bool |
反转 Y 轴控件。
ySpeed : real |
指定鼠标沿 Y 轴移动时的导航速度。
© 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.