summaryrefslogtreecommitdiffstats
path: root/src/quick3d
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-23 09:33:53 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-23 09:33:53 +0200
commitec2c6c0f13004bc1bba92f14443228778da287a0 (patch)
tree5c4e2621091ad7bbd31e6ffb6a277c1aaee39b55 /src/quick3d
parent5476bc6b4b6a12c921da502c24c4e078b04dd3b3 (diff)
parent0e3d54f8d7f9be26687afebcc9f456e4cefc2357 (diff)
Merge remote-tracking branch 'origin/5.8' into devwip/particles
Diffstat (limited to 'src/quick3d')
-rw-r--r--src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml18
-rw-r--r--src/quick3d/quick3d/items/quick3dentity.cpp27
-rw-r--r--src/quick3d/quick3drender/items/quick3dbuffer.cpp5
-rw-r--r--src/quick3d/quick3drender/items/quick3dparameter.cpp4
-rw-r--r--src/quick3d/quick3drender/items/quick3dshaderdata.cpp6
5 files changed, 39 insertions, 21 deletions
diff --git a/src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml b/src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml
index 4e3af0352..ae8869473 100644
--- a/src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml
+++ b/src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml
@@ -163,13 +163,13 @@ Entity {
id: keyboardZAxis
ButtonAxisInput {
sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Up]
- scale: d.shiftPressed ? 1.0 : 0.0
+ buttons: [Qt.Key_PageUp]
+ scale: 1.0
}
ButtonAxisInput {
sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Down]
- scale: d.shiftPressed ? -1.0 : 0.0
+ buttons: [Qt.Key_PageDown]
+ scale: -1.0
}
},
Axis {
@@ -177,12 +177,12 @@ Entity {
ButtonAxisInput {
sourceDevice: keyboardSourceDevice
buttons: [Qt.Key_Up]
- scale: d.shiftPressed ? 0.0 : 1.0
+ scale: 1.0
}
ButtonAxisInput {
sourceDevice: keyboardSourceDevice
buttons: [Qt.Key_Down]
- scale: d.shiftPressed ? 0.0 : -1.0
+ scale: -1.0
}
}
] // axes
@@ -206,8 +206,8 @@ Entity {
} else {
// Translate
root.camera.translate(Qt.vector3d(d.translationX, d.translationY, 0).times(dt));
- return
}
+ return
} else if (d.rightMouseButtonPressed) {
// Orbit
root.camera.panAboutViewCenter(d.orbitX * dt, d.firstPersonUp);
@@ -221,14 +221,14 @@ Entity {
} else if (d.shiftPressed) {
if (zoomDistance(root.camera.position, root.camera.viewCenter) > root.zoomLimit * root.zoomLimit) {
// Dolly up to limit
- root.camera.translate(Qt.vector3d(0, 0, d.translationZ).times(dt), Camera.DontTranslateViewCenter);
+ root.camera.translate(Qt.vector3d(0, 0, d.translationY).times(dt), Camera.DontTranslateViewCenter);
} else {
// Too close, Dolly backwards
root.camera.translate(Qt.vector3d(0, 0, -1).times(dt), Camera.DontTranslateViewCenter);
}
} else {
// Translate
- root.camera.translate(Qt.vector3d(d.translationX, d.translationY, 0).times(dt));
+ root.camera.translate(Qt.vector3d(d.translationX, d.translationY, d.translationZ).times(dt));
}
}
}
diff --git a/src/quick3d/quick3d/items/quick3dentity.cpp b/src/quick3d/quick3d/items/quick3dentity.cpp
index 4eac4400e..ebc92e843 100644
--- a/src/quick3d/quick3d/items/quick3dentity.cpp
+++ b/src/quick3d/quick3d/items/quick3dentity.cpp
@@ -47,20 +47,37 @@ namespace Quick {
/*!
\qmltype Entity
+ \instantiates Qt3DCore::QEntity
\inherits Node
\inqmlmodule Qt3D.Core
\since 5.5
-*/
+
+ \brief Entity is a \l Node subclass that can aggregate several
+ \l Component3D instances that will specify its behavior.
+
+ By itself a Entity is an empty shell. The behavior of a Entity
+ object is defined by the \l Component3D objects it references. Each Qt3D
+ backend aspect will be able to interpret and process an Entity by
+ recognizing which components it is made up of. One aspect may decide to only
+ process entities composed of a single \l Transform component whilst
+ another may focus on \l MouseHandler.
+
+ \sa Qt3D.Core::Component3D, Qt3D.Core::Transform
+ */
+
+/*!
+ \qmlproperty list<Component3D> Entity::components
+ Holds the list of \l Component3D instances, which define the behavior
+ of the entity.
+ \readonly
+ */
Quick3DEntity::Quick3DEntity(QObject *parent)
: QObject(parent)
{
}
-/*!
- \qmlproperty list<Component3D> Qt3DCore::Entity::components
- \readonly
-*/
+
QQmlListProperty<QComponent> Quick3DEntity::componentList()
{
return QQmlListProperty<Qt3DCore::QComponent>(this, 0,
diff --git a/src/quick3d/quick3drender/items/quick3dbuffer.cpp b/src/quick3d/quick3drender/items/quick3dbuffer.cpp
index 68ac21577..5701adf07 100644
--- a/src/quick3d/quick3drender/items/quick3dbuffer.cpp
+++ b/src/quick3d/quick3drender/items/quick3dbuffer.cpp
@@ -37,9 +37,10 @@
**
****************************************************************************/
-#include "quick3dbuffer_p.h"
-#include <QQmlEngine>
#include <QJSValue>
+#include <QQmlEngine>
+
+#include "quick3dbuffer_p.h"
#include <QtQml/private/qqmlengine_p.h>
#include <QtQml/private/qjsvalue_p.h>
#include <QtQml/private/qv4typedarray_p.h>
diff --git a/src/quick3d/quick3drender/items/quick3dparameter.cpp b/src/quick3d/quick3drender/items/quick3dparameter.cpp
index 22b6bba96..783f152c1 100644
--- a/src/quick3d/quick3drender/items/quick3dparameter.cpp
+++ b/src/quick3d/quick3drender/items/quick3dparameter.cpp
@@ -37,11 +37,11 @@
**
****************************************************************************/
-#include "quick3dparameter_p_p.h"
-
#include <QJSValue>
#include <QJSValueIterator>
+#include "quick3dparameter_p_p.h"
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
diff --git a/src/quick3d/quick3drender/items/quick3dshaderdata.cpp b/src/quick3d/quick3drender/items/quick3dshaderdata.cpp
index e5901e8fb..dbf351695 100644
--- a/src/quick3d/quick3drender/items/quick3dshaderdata.cpp
+++ b/src/quick3d/quick3drender/items/quick3dshaderdata.cpp
@@ -37,12 +37,12 @@
**
****************************************************************************/
-#include "quick3dshaderdata_p.h"
-#include <private/qshaderdata_p.h>
-
#include <Qt3DQuickRender/private/quick3dshaderdataarray_p.h>
#include <QMetaProperty>
+#include "quick3dshaderdata_p.h"
+#include <private/qshaderdata_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {