summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2015-08-08 23:20:38 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-08-10 01:23:47 +0000
commit2f1ca805f2edff70e7b3ddad5512bc5c27bf9d40 (patch)
tree818bc60866580ec7afc2fa65208e79db76e52486
parentf921d6f9ee45dbea550dd311571fc27587634a48 (diff)
Add new collision aspect
This will implement a simple collision-only (no physics) aspect that can be used to detect when collisions occur between entities that aggregate collider components. It is also intended to provide a concrete implementation of the ray cast service to permit users to perform ray casts and to also allow the input aspect to correctly deliver input events to entities. Change-Id: I20012ebdb0b3f1b2014ccdab039e87973d112c16 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/collision/collision.pri12
-rw-r--r--src/collision/collision.pro20
-rw-r--r--src/collision/doc/qt3dcollision.qdocconf62
-rw-r--r--src/collision/qcollisionaspect.cpp135
-rw-r--r--src/collision/qcollisionaspect.h79
-rw-r--r--src/collision/qcollisionaspect_p.h60
-rw-r--r--src/collision/qspherecollider.cpp91
-rw-r--r--src/collision/qspherecollider.h69
-rw-r--r--src/collision/qspherecollider_p.h64
-rw-r--r--src/collision/qt3dcollision_global.h56
-rw-r--r--src/src.pro5
-rw-r--r--sync.profile1
12 files changed, 654 insertions, 0 deletions
diff --git a/src/collision/collision.pri b/src/collision/collision.pri
new file mode 100644
index 000000000..7996dc6b7
--- /dev/null
+++ b/src/collision/collision.pri
@@ -0,0 +1,12 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qt3dcollision_global.h \
+ $$PWD/qcollisionaspect.h \
+ $$PWD/qcollisionaspect_p.h \
+ $$PWD/qspherecollider.h \
+ $$PWD/qspherecollider_p.h
+
+SOURCES += \
+ $$PWD/qcollisionaspect.cpp \
+ $$PWD/qspherecollider.cpp
diff --git a/src/collision/collision.pro b/src/collision/collision.pro
new file mode 100644
index 000000000..60ad79f25
--- /dev/null
+++ b/src/collision/collision.pro
@@ -0,0 +1,20 @@
+TARGET = Qt3DCollision
+MODULE = 3dcollision
+QT = core-private gui-private 3dcore 3dcore-private
+
+load(qt_module)
+
+DEFINES += QT3DCOLLISION_LIBRARY
+
+QMAKE_DOCS = $$PWD/doc/qt3dcollision.qdocconf
+
+gcov {
+ CONFIG += static
+ QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
+ QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage
+}
+
+# otherwise mingw headers do not declare common functions like ::strcasecmp
+win32-g++*:QMAKE_CXXFLAGS_CXX11 = -std=gnu++0x
+
+include(collision.pri)
diff --git a/src/collision/doc/qt3dcollision.qdocconf b/src/collision/doc/qt3dcollision.qdocconf
new file mode 100644
index 000000000..294eabf48
--- /dev/null
+++ b/src/collision/doc/qt3dcollision.qdocconf
@@ -0,0 +1,62 @@
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+
+project = Qt3DCollision
+description = Qt3D Collision Reference Documentation
+version = $QT_VERSION
+
+examplesinstallpath = qt3d
+
+qhp.projects = Qt3DCollision
+
+qhp.Qt3DCollision.file = qt3dcollision.qhp
+qhp.Qt3DCollision.namespace = org.qt-project.qt3dcollision.$QT_VERSION_TAG
+qhp.Qt3DCollision.virtualFolder = qt3dcollision
+qhp.Qt3DCollision.indexTitle = Qt3D Module
+qhp.Qt3DCollision.indexRoot =
+
+qhp.Qt3DCollision.filterAttributes = qt3dcollision $QT_VERSION qtrefdoc
+qhp.Qt3DCollision.customFilters.Qt.name = Qt3DCollision $QT_VERSION
+qhp.Qt3DCollision.customFilters.Qt.filterAttributes = qt3dcollision $QT_VERSION
+
+qhp.Qt3DCollision.subprojects = classes qmltypes
+
+qhp.Qt3DCollision.subprojects.classes.title = C++ Classes
+qhp.Qt3DCollision.subprojects.classes.indexTitle = Qt3D Collision C++ Classes
+qhp.Qt3DCollision.subprojects.classes.selectors = class fake:headerfile
+qhp.Qt3DCollision.subprojects.classes.sortPages = true
+
+qhp.Qt3DCollision.subprojects.qmltypes.title = QML Types
+qhp.Qt3DCollision.subprojects.qmltypes.indexTitle = Qt3D Collision QML Types
+qhp.Qt3DCollision.subprojects.qmltypes.selectors = qmlclass
+qhp.Qt3DCollision.subprojects.qmltypes.sortPages = true
+
+tagfile = ../../../doc/qt3dcollision/qt3dcollision.tags
+
+depends += qtcore qtqml qtquick qtdoc qt3drenderer
+
+headerdirs += .. \
+ ../../plugins \
+ ../../quick3d/quick3d \
+ ../../input
+
+sourcedirs += .. \
+ ../../plugins \
+ ../../quick3d/quick3d \
+ ../../input
+
+exampledirs += src/snippets
+
+#excludedirs +=
+
+imagedirs += images \
+ ../../../examples/qt3d/shadow-map-qml/doc/images
+
+Cpp.ignoretokens += QT3DCOLLISION_PRIVATE_EXPORT \
+ QT3DINPUTSHARED_EXPORT \
+ QT3DCOLLISIONSHARED_EXPORT
+
+Cpp.ignoredirectives += Q_DECLARE_LOGGING_CATEGORY
+
+navigation.landingpage = "Qt3D Module"
+navigation.cppclassespage = "Qt3D Collision C++ Classes"
+navigation.qmltypespage = "Qt3D Collision QML Types"
diff --git a/src/collision/qcollisionaspect.cpp b/src/collision/qcollisionaspect.cpp
new file mode 100644
index 000000000..16e52b3b4
--- /dev/null
+++ b/src/collision/qcollisionaspect.cpp
@@ -0,0 +1,135 @@
+/****************************************************************************
+**
+** 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 "qcollisionaspect.h"
+#include "qcollisionaspect_p.h"
+
+#include <Qt3DCore/qnodevisitor.h>
+#include <Qt3DCore/qscenepropertychange.h>
+
+#include <Qt3DCore/qnode.h>
+#include <Qt3DCore/private/qaspectmanager_p.h>
+#include <Qt3DCore/private/qchangearbiter_p.h>
+#include <Qt3DCore/private/qscene_p.h>
+#include <Qt3DCore/qaspectfactory.h>
+#include <Qt3DCore/qservicelocator.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+/*!
+ \class Qt3D::QCollisionAspectPrivate
+ \internal
+*/
+QCollisionAspectPrivate::QCollisionAspectPrivate()
+ : QAbstractAspectPrivate()
+ , m_time(0)
+{
+ m_aspectType = QAbstractAspect::AspectCollision;
+}
+
+QCollisionAspect::QCollisionAspect(QObject *parent)
+ : QAbstractAspect(*new QCollisionAspectPrivate(), parent)
+{
+ registerBackendTypes();
+}
+
+/*! \internal */
+QCollisionAspect::QCollisionAspect(QCollisionAspectPrivate &dd, QObject *parent)
+ : QAbstractAspect(dd, parent)
+{
+ registerBackendTypes();
+}
+
+void QCollisionAspect::registerBackendTypes()
+{
+ //registerBackendType<QSphereCollider>(QBackendNodeFunctorPtr(new Collision::SphereColliderFunctor(d_func()->m_manager.data())));
+}
+
+QVector<QAspectJobPtr> QCollisionAspect::jobsToExecute(qint64 time)
+{
+ Q_D(QCollisionAspect);
+ d->m_time = time;
+
+ // Create jobs that will get exectued by the threadpool
+ QVector<QAspectJobPtr> jobs;
+ return jobs;
+}
+
+void QCollisionAspect::sceneNodeAdded(QSceneChangePtr &e)
+{
+ QScenePropertyChangePtr propertyChange = e.staticCast<QScenePropertyChange>();
+ QNodePtr nodePtr = propertyChange->value().value<QNodePtr>();
+ QNode *n = nodePtr.data();
+ QNodeVisitor visitor;
+ visitor.traverse(n, this, &QCollisionAspect::visitNode);
+}
+
+void QCollisionAspect::sceneNodeRemoved(QSceneChangePtr &e)
+{
+ QScenePropertyChangePtr propertyChange = e.staticCast<QScenePropertyChange>();
+ QNodePtr nodePtr = propertyChange->value().value<QNodePtr>();
+ QNode *n = nodePtr.data();
+ QAbstractAspect::clearBackendNode(n);
+}
+
+void QCollisionAspect::setRootEntity(QEntity *rootObject)
+{
+ QNodeVisitor visitor;
+ visitor.traverse(rootObject, this, &QCollisionAspect::visitNode);
+}
+
+void QCollisionAspect::onInitialize(const QVariantMap &data)
+{
+ Q_UNUSED(data);
+}
+
+void QCollisionAspect::onCleanup()
+{
+}
+
+void QCollisionAspect::visitNode(QNode *node)
+{
+ QAbstractAspect::createBackendNode(node);
+}
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
+QT3D_REGISTER_NAMESPACED_ASPECT("collision", QT_PREPEND_NAMESPACE(Qt3D), QCollisionAspect)
+
diff --git a/src/collision/qcollisionaspect.h b/src/collision/qcollisionaspect.h
new file mode 100644
index 000000000..2c946b640
--- /dev/null
+++ b/src/collision/qcollisionaspect.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** 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 QT3D_QCOLLISIONASPECT_H
+#define QT3D_QCOLLISIONASPECT_H
+
+#include <Qt3DCollision/qt3dcollision_global.h>
+#include <Qt3DCore/qabstractaspect.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+class QCollisionAspectPrivate;
+
+class QT3DCOLLISIONSHARED_EXPORT QCollisionAspect : public QAbstractAspect
+{
+ Q_OBJECT
+public:
+ explicit QCollisionAspect(QObject *parent = 0);
+
+ QVector<QAspectJobPtr> jobsToExecute(qint64 time) Q_DECL_OVERRIDE;
+
+ void sceneNodeAdded(QSceneChangePtr &e) Q_DECL_OVERRIDE;
+ void sceneNodeRemoved(QSceneChangePtr &e) Q_DECL_OVERRIDE;
+
+protected:
+ void registerBackendTypes();
+
+private:
+ void setRootEntity(QEntity *rootObject) Q_DECL_OVERRIDE;
+ void onInitialize(const QVariantMap &data) Q_DECL_OVERRIDE;
+ void onCleanup() Q_DECL_OVERRIDE;
+
+ void visitNode(QNode *node);
+
+ Q_DECLARE_PRIVATE(QCollisionAspect)
+ QCollisionAspect(QCollisionAspectPrivate &dd, QObject *parent);
+};
+
+}
+
+QT_END_NAMESPACE
+
+#endif // QT3D_QCOLLISIONASPECT_H
+
diff --git a/src/collision/qcollisionaspect_p.h b/src/collision/qcollisionaspect_p.h
new file mode 100644
index 000000000..e91f2d33e
--- /dev/null
+++ b/src/collision/qcollisionaspect_p.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** 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 QT3D_COLLISION_QCOLLISIONASPECT_P_H
+#define QT3D_COLLISION_QCOLLISIONASPECT_P_H
+
+#include <Qt3DCore/private/qabstractaspect_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+class QCollisionAspectPrivate : public QAbstractAspectPrivate
+{
+ QCollisionAspectPrivate();
+
+ Q_DECLARE_PUBLIC(QCollisionAspect)
+
+ qint64 m_time;
+};
+
+}
+
+QT_END_NAMESPACE
+
+#endif // QT3D_COLLISION_QCOLLISIONASPECT_P_H
+
diff --git a/src/collision/qspherecollider.cpp b/src/collision/qspherecollider.cpp
new file mode 100644
index 000000000..840bd6ee0
--- /dev/null
+++ b/src/collision/qspherecollider.cpp
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** 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 "qspherecollider.h"
+#include "qspherecollider_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+/*!
+ \class Qt3D::QSphereColliderPrivate
+ \internal
+*/
+QSphereColliderPrivate::QSphereColliderPrivate()
+ : QComponentPrivate()
+ , m_center()
+ , m_radius(1.0f)
+{
+}
+
+/*!
+ \class Qt3D::QSphereCollider
+ \inmodule Qt3DCollision
+ \since 5.5
+ \brief Represents a sphere used for collision detection
+*/
+
+/*!
+ \qmltype SphereCollider
+ \inqmlmodule Qt3D.Collision
+ \instantiates Qt3D::QSphereCollider
+ \inherits Component3D
+ \since 5.5
+*/
+
+/*!
+ Constructs a new QSphereCollider instance with parent \a parent.
+ */
+QSphereCollider::QSphereCollider(QNode *parent)
+ : QComponent(*new QSphereColliderPrivate, parent)
+{
+}
+
+/*! \internal */
+QSphereCollider::QSphereCollider(QSphereColliderPrivate &dd, QNode *parent)
+ : QComponent(dd, parent)
+{
+}
+
+QSphereCollider::~QSphereCollider()
+{
+ QNode::cleanup();
+}
+
+}
+
+QT_END_NAMESPACE
diff --git a/src/collision/qspherecollider.h b/src/collision/qspherecollider.h
new file mode 100644
index 000000000..af147fc13
--- /dev/null
+++ b/src/collision/qspherecollider.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** 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 QT3D_QCOLLISIONCOMPONENT_H
+#define QT3D_QCOLLISIONCOMPONENT_H
+
+#include <Qt3DCore/qcomponent.h>
+#include <Qt3DCollision/qt3dcollision_global.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+class QSphereColliderPrivate;
+
+class QT3DCOLLISIONSHARED_EXPORT QSphereCollider : public QComponent
+{
+ Q_OBJECT
+
+public:
+ explicit QSphereCollider(QNode *parent = 0);
+ ~QSphereCollider();
+
+protected:
+ QSphereCollider(QSphereColliderPrivate &dd, QNode *parent = 0);
+
+private:
+ Q_DECLARE_PRIVATE(QSphereCollider)
+ QT3D_CLONEABLE(QSphereCollider)
+};
+
+}
+
+QT_END_NAMESPACE
+
+#endif // QT3D_QCOLLISIONCOMPONENT_H
diff --git a/src/collision/qspherecollider_p.h b/src/collision/qspherecollider_p.h
new file mode 100644
index 000000000..8d190b7a8
--- /dev/null
+++ b/src/collision/qspherecollider_p.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** 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 QT3D_COLLISION_QSPHERECOLLIDER_P_H
+#define QT3D_COLLISION_QSPHERECOLLIDER_P_H
+
+#include <private/qcomponent_p.h>
+#include <QtGui/qvector3d.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+class QSphereCollider;
+
+class QSphereColliderPrivate : public QComponentPrivate
+{
+public:
+ QSphereColliderPrivate();
+
+ Q_DECLARE_PUBLIC(QSphereCollider)
+
+ QVector3D m_center;
+ float m_radius;
+};
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
+#endif // QT3D_COLLISION_QSPHERECOLLIDER_P_H
diff --git a/src/collision/qt3dcollision_global.h b/src/collision/qt3dcollision_global.h
new file mode 100644
index 000000000..a1a2706dd
--- /dev/null
+++ b/src/collision/qt3dcollision_global.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** 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 QT3DCOLLISION_GLOBAL_H
+#define QT3DCOLLISION_GLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+#if defined(QT_SHARED) || !defined(QT_STATIC)
+# if defined(QT3DCOLLISION_LIBRARY)
+# define QT3DCOLLISIONSHARED_EXPORT Q_DECL_EXPORT
+# else
+# define QT3DCOLLISIONSHARED_EXPORT Q_DECL_IMPORT
+# endif
+#else
+# define QT3DCOLLISIONSHARED_EXPORT
+#endif
+
+QT_END_NAMESPACE
+
+#endif // QT3DCOLLISION_GLOBAL_H
diff --git a/src/src.pro b/src/src.pro
index 5fefa511d..962e8c20c 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -15,6 +15,10 @@ src_logic.subdir = $$PWD/logic
src_logic.target = sub-logic
src_logic.depends = src_core
+src_collision.subdir = $$PWD/collision
+src_collision.target = sub-collision
+src_collision.depends = src_core
+
# Quick3D libs
src_quick3d_core.subdir = $$PWD/quick3d/quick3d
src_quick3d_core.target = sub-quick3d-core
@@ -56,6 +60,7 @@ SUBDIRS += \
src_render \
src_input \
src_logic \
+ src_collision \
src_quick3d_core \
src_quick3d_core_imports \
src_quick3d_render \
diff --git a/sync.profile b/sync.profile
index bfe797c39..b6ffdf18e 100644
--- a/sync.profile
+++ b/sync.profile
@@ -5,6 +5,7 @@
"Qt3DQuickRenderer" => "$basedir/src/quick3d/quick3drenderer",
"Qt3DInput" => "$basedir/src/input",
"Qt3DLogic" => "$basedir/src/logic",
+ "Qt3DCollision" => "$basedir/src/collision",
);
%moduleheaders = ( # restrict the module headers to those found in relative path
);