From c80eed85ee8250f1dbbf1565f2f8ff01b6fa6d0b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 30 Nov 2015 18:58:33 +0100 Subject: Avoid using the name Light in the examples To prevent colliding with the standard Qt 3D type. Change-Id: Ibf7b8b744dd23f1ced231e90486729be894a1be7 Reviewed-by: Sean Harmer --- examples/qt3d/planets-qml/CloudEffectDS.qml | 2 +- examples/qt3d/planets-qml/Light.qml | 65 ----------------------- examples/qt3d/planets-qml/PlanetEffectD.qml | 2 +- examples/qt3d/planets-qml/PlanetEffectDB.qml | 2 +- examples/qt3d/planets-qml/PlanetEffectDSB.qml | 2 +- examples/qt3d/planets-qml/PlanetShadowEffectD.qml | 2 +- examples/qt3d/planets-qml/PlanetsLight.qml | 65 +++++++++++++++++++++++ examples/qt3d/planets-qml/SolarSystem.qml | 2 +- examples/qt3d/planets-qml/planets-qml.qrc | 2 +- examples/qt3d/shadow-map-qml/AdsEffect.qml | 2 +- examples/qt3d/shadow-map-qml/Light.qml | 61 --------------------- examples/qt3d/shadow-map-qml/ShadowMapLight.qml | 61 +++++++++++++++++++++ examples/qt3d/shadow-map-qml/main.qml | 2 +- examples/qt3d/shadow-map-qml/shadow-map-qml.pro | 2 +- examples/qt3d/shadow-map-qml/shadow-map-qml.qrc | 2 +- 15 files changed, 137 insertions(+), 137 deletions(-) delete mode 100644 examples/qt3d/planets-qml/Light.qml create mode 100644 examples/qt3d/planets-qml/PlanetsLight.qml delete mode 100644 examples/qt3d/shadow-map-qml/Light.qml create mode 100644 examples/qt3d/shadow-map-qml/ShadowMapLight.qml (limited to 'examples/qt3d') diff --git a/examples/qt3d/planets-qml/CloudEffectDS.qml b/examples/qt3d/planets-qml/CloudEffectDS.qml index 836349c9b..a949e25c6 100644 --- a/examples/qt3d/planets-qml/CloudEffectDS.qml +++ b/examples/qt3d/planets-qml/CloudEffectDS.qml @@ -42,7 +42,7 @@ Effect { id: root property Texture2D shadowTexture - property Light light + property PlanetsLight light parameters: [ Parameter { name: "lightPosition"; value: root.light.lightPosition }, diff --git a/examples/qt3d/planets-qml/Light.qml b/examples/qt3d/planets-qml/Light.qml deleted file mode 100644 index d904d2cff..000000000 --- a/examples/qt3d/planets-qml/Light.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Entity { - id: root - - property alias near: lightCamera.nearPlane - property alias ratio: lightCamera.aspectRatio - - property vector3d lightPosition: Qt.vector3d(0.0, 0.0, 0.0) - property vector3d lightIntensity: Qt.vector3d(1.0, 1.0, 1.0) - - readonly property Camera lightCamera: lightCamera - readonly property matrix4x4 lightViewProjection: - lightCamera.projectionMatrix.times(lightCamera.matrix) - - Camera { - id: lightCamera - objectName: "lightCameraLens" - projectionType: CameraLens.PerspectiveProjection - fieldOfView: 30 - nearPlane: 2500000.0 - farPlane: 10000000.0 - position: root.lightPosition - viewCenter: Qt.vector3d(0.0, 0.0, 0.0) - upVector: Qt.vector3d(0.0, 1.0, 0.0) - } -} diff --git a/examples/qt3d/planets-qml/PlanetEffectD.qml b/examples/qt3d/planets-qml/PlanetEffectD.qml index f054db69e..1287967e4 100644 --- a/examples/qt3d/planets-qml/PlanetEffectD.qml +++ b/examples/qt3d/planets-qml/PlanetEffectD.qml @@ -42,7 +42,7 @@ Effect { id: root property Texture2D shadowTexture - property Light light + property PlanetsLight light parameters: [ Parameter { name: "lightViewProjection"; value: root.light.lightViewProjection }, diff --git a/examples/qt3d/planets-qml/PlanetEffectDB.qml b/examples/qt3d/planets-qml/PlanetEffectDB.qml index 210a3390d..b05e8ceaa 100644 --- a/examples/qt3d/planets-qml/PlanetEffectDB.qml +++ b/examples/qt3d/planets-qml/PlanetEffectDB.qml @@ -42,7 +42,7 @@ Effect { id: root property Texture2D shadowTexture - property Light light + property PlanetsLight light parameters: [ Parameter { name: "lightViewProjection"; value: root.light.lightViewProjection }, diff --git a/examples/qt3d/planets-qml/PlanetEffectDSB.qml b/examples/qt3d/planets-qml/PlanetEffectDSB.qml index 3e9e231bb..82e93edac 100644 --- a/examples/qt3d/planets-qml/PlanetEffectDSB.qml +++ b/examples/qt3d/planets-qml/PlanetEffectDSB.qml @@ -42,7 +42,7 @@ Effect { id: root property Texture2D shadowTexture - property Light light + property PlanetsLight light parameters: [ Parameter { name: "lightViewProjection"; value: root.light.lightViewProjection }, diff --git a/examples/qt3d/planets-qml/PlanetShadowEffectD.qml b/examples/qt3d/planets-qml/PlanetShadowEffectD.qml index ea589f491..1bbdf7548 100644 --- a/examples/qt3d/planets-qml/PlanetShadowEffectD.qml +++ b/examples/qt3d/planets-qml/PlanetShadowEffectD.qml @@ -42,7 +42,7 @@ Effect { id: root property Texture2D shadowTexture - property Light light + property PlanetsLight light parameters: [ Parameter { name: "lightViewProjection"; value: root.light.lightViewProjection }, diff --git a/examples/qt3d/planets-qml/PlanetsLight.qml b/examples/qt3d/planets-qml/PlanetsLight.qml new file mode 100644 index 000000000..d904d2cff --- /dev/null +++ b/examples/qt3d/planets-qml/PlanetsLight.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import Qt3D.Core 2.0 +import Qt3D.Render 2.0 + +Entity { + id: root + + property alias near: lightCamera.nearPlane + property alias ratio: lightCamera.aspectRatio + + property vector3d lightPosition: Qt.vector3d(0.0, 0.0, 0.0) + property vector3d lightIntensity: Qt.vector3d(1.0, 1.0, 1.0) + + readonly property Camera lightCamera: lightCamera + readonly property matrix4x4 lightViewProjection: + lightCamera.projectionMatrix.times(lightCamera.matrix) + + Camera { + id: lightCamera + objectName: "lightCameraLens" + projectionType: CameraLens.PerspectiveProjection + fieldOfView: 30 + nearPlane: 2500000.0 + farPlane: 10000000.0 + position: root.lightPosition + viewCenter: Qt.vector3d(0.0, 0.0, 0.0) + upVector: Qt.vector3d(0.0, 1.0, 0.0) + } +} diff --git a/examples/qt3d/planets-qml/SolarSystem.qml b/examples/qt3d/planets-qml/SolarSystem.qml index 8512b019e..eb8611aa5 100644 --- a/examples/qt3d/planets-qml/SolarSystem.qml +++ b/examples/qt3d/planets-qml/SolarSystem.qml @@ -107,7 +107,7 @@ Entity { } } - Light { + PlanetsLight { id: light ratio: width / height } diff --git a/examples/qt3d/planets-qml/planets-qml.qrc b/examples/qt3d/planets-qml/planets-qml.qrc index cf9aafc29..dceaffeeb 100644 --- a/examples/qt3d/planets-qml/planets-qml.qrc +++ b/examples/qt3d/planets-qml/planets-qml.qrc @@ -8,7 +8,7 @@ FpsDisplay.qml Planet.qml Ring.qml - Light.qml + PlanetsLight.qml CloudEffectDS.qml PlanetEffectD.qml PlanetEffectDB.qml diff --git a/examples/qt3d/shadow-map-qml/AdsEffect.qml b/examples/qt3d/shadow-map-qml/AdsEffect.qml index a965c94af..4d3924215 100644 --- a/examples/qt3d/shadow-map-qml/AdsEffect.qml +++ b/examples/qt3d/shadow-map-qml/AdsEffect.qml @@ -41,7 +41,7 @@ Effect { id: root property Texture2D shadowTexture - property Light light + property ShadowMapLight light // These parameters act as default values for the effect. They take // priority over any parameters specified in the RenderPasses below diff --git a/examples/qt3d/shadow-map-qml/Light.qml b/examples/qt3d/shadow-map-qml/Light.qml deleted file mode 100644 index a0e0306b0..000000000 --- a/examples/qt3d/shadow-map-qml/Light.qml +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Entity { - id: root - - property vector3d lightPosition: Qt.vector3d(30.0, 30.0, 0.0) - property vector3d lightIntensity: Qt.vector3d(1.0, 1.0, 1.0) - - readonly property Camera lightCamera: lightCamera - readonly property matrix4x4 lightViewProjection: lightCamera.projectionMatrix.times(lightCamera.viewMatrix) - - Camera { - id: lightCamera - objectName: "lightCameraLens" - projectionType: CameraLens.PerspectiveProjection - fieldOfView: 45 - aspectRatio: 1 - nearPlane : 0.1 - farPlane : 200.0 - position: root.lightPosition - viewCenter: Qt.vector3d(0.0, 0.0, 0.0) - upVector: Qt.vector3d(0.0, 1.0, 0.0) - } -} diff --git a/examples/qt3d/shadow-map-qml/ShadowMapLight.qml b/examples/qt3d/shadow-map-qml/ShadowMapLight.qml new file mode 100644 index 000000000..a0e0306b0 --- /dev/null +++ b/examples/qt3d/shadow-map-qml/ShadowMapLight.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import Qt3D.Core 2.0 +import Qt3D.Render 2.0 + +Entity { + id: root + + property vector3d lightPosition: Qt.vector3d(30.0, 30.0, 0.0) + property vector3d lightIntensity: Qt.vector3d(1.0, 1.0, 1.0) + + readonly property Camera lightCamera: lightCamera + readonly property matrix4x4 lightViewProjection: lightCamera.projectionMatrix.times(lightCamera.viewMatrix) + + Camera { + id: lightCamera + objectName: "lightCameraLens" + projectionType: CameraLens.PerspectiveProjection + fieldOfView: 45 + aspectRatio: 1 + nearPlane : 0.1 + farPlane : 200.0 + position: root.lightPosition + viewCenter: Qt.vector3d(0.0, 0.0, 0.0) + upVector: Qt.vector3d(0.0, 1.0, 0.0) + } +} diff --git a/examples/qt3d/shadow-map-qml/main.qml b/examples/qt3d/shadow-map-qml/main.qml index f05bbbc8a..37340053a 100644 --- a/examples/qt3d/shadow-map-qml/main.qml +++ b/examples/qt3d/shadow-map-qml/main.qml @@ -57,7 +57,7 @@ Entity { controlledCamera: camera } - Light { + ShadowMapLight { id: light } diff --git a/examples/qt3d/shadow-map-qml/shadow-map-qml.pro b/examples/qt3d/shadow-map-qml/shadow-map-qml.pro index 2988f563d..b8f50aed0 100644 --- a/examples/qt3d/shadow-map-qml/shadow-map-qml.pro +++ b/examples/qt3d/shadow-map-qml/shadow-map-qml.pro @@ -11,7 +11,7 @@ OTHER_FILES += \ main.qml \ AdsMaterial.qml \ AdsEffect.qml \ - Light.qml \ + ShadowMapLight.qml \ ShadowMapFrameGraph.qml \ Trefoil.qml \ Toyplane.qml \ diff --git a/examples/qt3d/shadow-map-qml/shadow-map-qml.qrc b/examples/qt3d/shadow-map-qml/shadow-map-qml.qrc index 9aa6e2c73..f51a418cd 100644 --- a/examples/qt3d/shadow-map-qml/shadow-map-qml.qrc +++ b/examples/qt3d/shadow-map-qml/shadow-map-qml.qrc @@ -3,7 +3,7 @@ main.qml AdsMaterial.qml AdsEffect.qml - Light.qml + ShadowMapLight.qml ShadowMapFrameGraph.qml Trefoil.qml -- cgit v1.2.3