summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@theqtcompany.com>2015-06-25 13:00:54 +0300
committerTomi Korpipää <tomi.korpipaa@theqtcompany.com>2015-06-25 10:08:51 +0000
commit8dc95e0edc71cefc6c3e5c4cc67bfe385a8a0f32 (patch)
treeb71264a1896b70a33a1642db666c36657eda824c
parent330656aede38ce84735248de1d900a9ab998e826 (diff)
Fix for shadow pass
Change-Id: Ie7452c66a196ecdf348ed9cf9ca5b7cce7984d7c Task-number: QTBUG-44988 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--src/core/core-components/qcamera.cpp11
-rw-r--r--src/core/core-components/qcamera.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/src/core/core-components/qcamera.cpp b/src/core/core-components/qcamera.cpp
index e90479d06..9450ccf5b 100644
--- a/src/core/core-components/qcamera.cpp
+++ b/src/core/core-components/qcamera.cpp
@@ -77,6 +77,7 @@ QCamera::QCamera(QNode *parent) :
QObject::connect(d_func()->m_lookAt, SIGNAL(positionChanged()), this, SIGNAL(positionChanged()));
QObject::connect(d_func()->m_lookAt, SIGNAL(upVectorChanged()), this, SIGNAL(upVectorChanged()));
QObject::connect(d_func()->m_lookAt, SIGNAL(viewCenterChanged()), this, SIGNAL(viewCenterChanged()));
+ QObject::connect(d_func()->m_transform, SIGNAL(matrixChanged()), this, SIGNAL(matrixChanged()));
d_func()->m_transform->addTransform(d_func()->m_lookAt);
addComponent(d_func()->m_lens);
addComponent(d_func()->m_transform);
@@ -104,6 +105,7 @@ QCamera::QCamera(QCameraPrivate &dd, QNode *parent)
QObject::connect(d_func()->m_lookAt, SIGNAL(positionChanged()), this, SIGNAL(positionChanged()));
QObject::connect(d_func()->m_lookAt, SIGNAL(upVectorChanged()), this, SIGNAL(upVectorChanged()));
QObject::connect(d_func()->m_lookAt, SIGNAL(viewCenterChanged()), this, SIGNAL(viewCenterChanged()));
+ QObject::connect(d_func()->m_transform, SIGNAL(matrixChanged()), this, SIGNAL(matrixChanged()));
d_func()->m_transform->addTransform(d_func()->m_lookAt);
addComponent(d_func()->m_lens);
addComponent(d_func()->m_transform);
@@ -456,6 +458,15 @@ QVector3D QCamera::viewCenter() const
return d->m_lookAt->viewCenter();
}
+/*!
+ \qmlproperty matrix4x4 Qt3D::Camera::matrix
+*/
+QMatrix4x4 QCamera::matrix() const
+{
+ Q_D(const QCamera);
+ return d->m_transform->matrix();
+}
+
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/core/core-components/qcamera.h b/src/core/core-components/qcamera.h
index b6b9de4a6..4bf25534a 100644
--- a/src/core/core-components/qcamera.h
+++ b/src/core/core-components/qcamera.h
@@ -69,6 +69,7 @@ class QT3DCORESHARED_EXPORT QCamera : public QEntity
Q_PROPERTY(QVector3D position READ position WRITE setPosition NOTIFY positionChanged)
Q_PROPERTY(QVector3D upVector READ upVector WRITE setUpVector NOTIFY upVectorChanged)
Q_PROPERTY(QVector3D viewCenter READ viewCenter WRITE setViewCenter NOTIFY viewCenterChanged)
+ Q_PROPERTY(QMatrix4x4 matrix READ matrix NOTIFY matrixChanged)
public:
explicit QCamera(QNode *parent = 0);
@@ -142,6 +143,8 @@ public:
void setViewCenter(const QVector3D &viewCenter);
QVector3D viewCenter() const;
+ QMatrix4x4 matrix() const;
+
Q_SIGNALS:
void projectionTypeChanged();
void nearPlaneChanged();
@@ -156,6 +159,7 @@ Q_SIGNALS:
void positionChanged();
void upVectorChanged();
void viewCenterChanged();
+ void matrixChanged();
protected:
Q_DECLARE_PRIVATE(QCamera)