diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2015-08-08 23:29:46 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2015-08-10 01:23:52 +0000 |
commit | 78e1a0e1f01d0772599eafca704e6627837275ce (patch) | |
tree | bb7ce41907d404fcb53c2e6d318f5ef051a152b6 | |
parent | 2f1ca805f2edff70e7b3ddad5512bc5c27bf9d40 (diff) |
Add collision aspect QML plugin
Change-Id: I46bc3a704daf822fedc358aa2797722ded802fdd
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/quick3d/imports/collision/importscollision.pro | 15 | ||||
-rw-r--r-- | src/quick3d/imports/collision/qmldir | 3 | ||||
-rw-r--r-- | src/quick3d/imports/collision/qt3dquick3dcollisionplugin.cpp | 48 | ||||
-rw-r--r-- | src/quick3d/imports/collision/qt3dquick3dcollisionplugin.h | 54 | ||||
-rw-r--r-- | src/src.pro | 5 |
5 files changed, 125 insertions, 0 deletions
diff --git a/src/quick3d/imports/collision/importscollision.pro b/src/quick3d/imports/collision/importscollision.pro new file mode 100644 index 000000000..8225bd81b --- /dev/null +++ b/src/quick3d/imports/collision/importscollision.pro @@ -0,0 +1,15 @@ +CXX_MODULE = qml +TARGET = quick3dcollisionplugin +TARGETPATH = Qt3D/Collision + +QT += core-private qml 3dcore 3dcollision + +OTHER_FILES += qmldir + +load(qml_plugin) + +HEADERS += \ + qt3dquick3dcollisionplugin.h + +SOURCES += \ + qt3dquick3dcollisionplugin.cpp diff --git a/src/quick3d/imports/collision/qmldir b/src/quick3d/imports/collision/qmldir new file mode 100644 index 000000000..f81a3f2e4 --- /dev/null +++ b/src/quick3d/imports/collision/qmldir @@ -0,0 +1,3 @@ +module Qt3D.Collision +plugin quick3dcolisionplugin +classname Qt3DQuick3DCollisionPlugin diff --git a/src/quick3d/imports/collision/qt3dquick3dcollisionplugin.cpp b/src/quick3d/imports/collision/qt3dquick3dcollisionplugin.cpp new file mode 100644 index 000000000..ec0aa0114 --- /dev/null +++ b/src/quick3d/imports/collision/qt3dquick3dcollisionplugin.cpp @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2015 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$ +** +****************************************************************************/ + +#include <QtQml> +#include <Qt3DCollision/qspherecollider.h> +#include "qt3dquick3dcollisionplugin.h" + +QT_BEGIN_NAMESPACE + +void Qt3DQuick3DCollisionPlugin::registerTypes(const char *uri) +{ + qmlRegisterType<Qt3D::QSphereCollider>(uri, 2, 0, "SphereCollider"); +} + +QT_END_NAMESPACE diff --git a/src/quick3d/imports/collision/qt3dquick3dcollisionplugin.h b/src/quick3d/imports/collision/qt3dquick3dcollisionplugin.h new file mode 100644 index 000000000..e98fe25d6 --- /dev/null +++ b/src/quick3d/imports/collision/qt3dquick3dcollisionplugin.h @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2015 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$ +** +****************************************************************************/ + +#ifndef QT3DQUICK3DCOLLISIONPLUGIN_H +#define QT3DQUICK3DCOLLISIONPLUGIN_H + +#include <QtQml/QQmlExtensionPlugin> + +QT_BEGIN_NAMESPACE + +class Qt3DQuick3DCollisionPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") +public: + void registerTypes(const char *uri) Q_DECL_OVERRIDE; +}; + +QT_END_NAMESPACE + +#endif // QT3DQUICK3DCOLLISIONPLUGIN_H diff --git a/src/src.pro b/src/src.pro index 962e8c20c..bf39a4aad 100644 --- a/src/src.pro +++ b/src/src.pro @@ -50,6 +50,10 @@ src_quick3d_imports_logic.file = $$PWD/quick3d/imports/logic/importslogic.pro src_quick3d_imports_logic.target = sub-quick3d-imports-logic src_quick3d_imports_logic.depends = src_logic +src_quick3d_imports_collision.file = $$PWD/quick3d/imports/collision/importscollision.pro +src_quick3d_imports_collision.target = sub-quick3d-imports-collision +src_quick3d_imports_collision.depends = src_collision + # Qt3D Scene Parser plugins src_plugins_sceneparsers.file = $$PWD/plugins/sceneparsers/sceneparsers.pro src_plugins_sceneparsers.target = sub-plugins-sceneparsers @@ -68,6 +72,7 @@ SUBDIRS += \ src_quick3d_imports_scene3d \ src_quick3d_imports_input \ src_quick3d_imports_logic \ + src_quick3d_imports_collision \ src_plugins_sceneparsers |