LookAtNode QML 类型
一种辅助节点,它会自动指向另一个节点。 更多信息...
| 导入语句 | import QtQuick3D.Helpers | 
| 自 | Qt 6.4 | 
| 继承自 | 
属性
- target : Node
详细说明
此辅助节点实现了自动旋转,使其始终指向指定的节点。旋转仅在 X 和 Y 轴上发生。
例如,以下片段使圆柱体始终指向立方体。
View3D {
    anchors.fill: parent
    camera: camera
    PerspectiveCamera {
        id: camera
    }
    DirectionalLight {}
    LookAtNode {
        target: cube
        Model {
            id: cylinder
            source: "#Cone"
            eulerRotation.x: -90
            materials: [
                PrincipledMaterial {}
            ]
        }
    }
    Model {
        id: cube
        position: Qt.vector3d(300, 300, 0);
        source: "#Cube"
        materials: [ PrincipledMaterial {} ]
    }
}属性文档
| target : Node | 
指定要查看的目标节点。默认值为 null。
© 2024 The Qt Company Ltd. 本文档中包含的文档贡献是各自所有者版权的归属。本文档是根据自由软件基金会发布的 GNU 自由文档许可证版本 1.3 的条款许可的。Qt 和相关徽标是 The Qt Company Ltd 在芬兰以及世界其他国家的商标。所有其他商标均为其各自所有者的财产。