forked from qt-creator/qt-creator
Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
40 lines
1.1 KiB
QML
40 lines
1.1 KiB
QML
// Copyright (C) 2020 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
|
|
|
import QtQuick 2.0
|
|
import QtQuick3D 1.15
|
|
import CameraGeometry 1.0
|
|
|
|
Model {
|
|
id: cameraFrustum
|
|
|
|
property alias geometryName: cameraGeometry.name // Name must be unique for each geometry
|
|
property alias viewPortRect: cameraGeometry.viewPortRect
|
|
property Node targetNode: null
|
|
property Node scene: null
|
|
property bool selected: false
|
|
|
|
function updateGeometry()
|
|
{
|
|
cameraGeometry.update();
|
|
}
|
|
|
|
position: targetNode ? targetNode.scenePosition : Qt.vector3d(0, 0, 0)
|
|
rotation: targetNode ? targetNode.sceneRotation : Qt.quaternion(1, 0, 0, 0)
|
|
|
|
geometry: cameraGeometry
|
|
materials: [
|
|
DefaultMaterial {
|
|
id: defaultMaterial
|
|
diffuseColor: cameraFrustum.selected ? "#FF0000" : "#555555"
|
|
lighting: DefaultMaterial.NoLighting
|
|
cullMode: Material.NoCulling
|
|
}
|
|
]
|
|
|
|
CameraGeometry {
|
|
id: cameraGeometry
|
|
camera: cameraFrustum.scene && cameraFrustum.targetNode ? cameraFrustum.targetNode : null
|
|
}
|
|
}
|