diff options
author | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2019-03-01 14:50:42 +0200 |
---|---|---|
committer | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2019-03-04 13:09:54 +0000 |
commit | 50af71b41bd80b828d9c15005595698a272d41e1 (patch) | |
tree | 8f874a0a16464b9be17acc7e9bad1fc695f7b243 /src/Authoring/Studio/Render/Q3DSManipulationWidget.cpp | |
parent | 3c2481ad777a0bcb8331d6ced44ebb976df039b6 (diff) |
Implement local/global manipulator toggle behavior
Manipulators now should be able to manipulate the object in global
space. Plane scaling works differently than in the old runtime in this
patch as the logic of that is unclear at the moment.
Task-number: QT3DS-3010
Change-Id: Ie6961727b32c530d55e41ed84f102526f018ace9
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Render/Q3DSManipulationWidget.cpp')
-rw-r--r-- | src/Authoring/Studio/Render/Q3DSManipulationWidget.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Authoring/Studio/Render/Q3DSManipulationWidget.cpp b/src/Authoring/Studio/Render/Q3DSManipulationWidget.cpp index 70a0505c..87232aa7 100644 --- a/src/Authoring/Studio/Render/Q3DSManipulationWidget.cpp +++ b/src/Authoring/Studio/Render/Q3DSManipulationWidget.cpp @@ -299,13 +299,16 @@ void Q3DSManipulationWidget::destroyManipulators() } void applyNodeProperties(Q3DSNode *node, Q3DSCameraNode *camera, Q3DSLayerNode *layer, - Q3DSModelNode *model, const QVector3D &modelScale) { + Q3DSModelNode *model, const QVector3D &modelScale, bool globalSpace) { QVector3D position; QVector3D rotation; QVector3D dummyScale; calculateGlobalProperties(node, position, rotation, dummyScale); + if (globalSpace) + rotation = QVector3D(0, 0, 0); + Q3DSPropertyChangeList list; list.append(model->setPosition(position)); list.append(model->setRotation(rotation)); @@ -340,7 +343,7 @@ void applyNodeProperties(Q3DSNode *node, Q3DSCameraNode *camera, Q3DSLayerNode * } void Q3DSManipulationWidget::applyProperties(Q3DSGraphObject *node, Q3DSCameraNode *camera, - Q3DSLayerNode *layer) + Q3DSLayerNode *layer, bool globalSpace) { for (int i = 0; i < m_manipulators.size(); ++i) { if (node->type() == Q3DSGraphObject::Model @@ -351,7 +354,7 @@ void Q3DSManipulationWidget::applyProperties(Q3DSGraphObject *node, Q3DSCameraNo || node->type() == Q3DSGraphObject::Text || node->type() == Q3DSGraphObject::Component) { applyNodeProperties(static_cast<Q3DSNode *>(node), camera, layer, m_manipulators[i], - m_manipulatorScales[i]); + m_manipulatorScales[i], globalSpace); } } |