summaryrefslogtreecommitdiffstats
path: root/src/runtime/q3dsuippresentation_p.h
diff options
context:
space:
mode:
authorMäättä Antti <antti.maatta@qt.io>2018-09-20 09:23:57 +0300
committerAntti Määttä <antti.maatta@qt.io>2018-09-20 09:22:55 +0000
commitdd1fee885c5689f07812570e6ee62067d4f2d687 (patch)
tree9b206e482b28ecc8402e49eb36f2376284a3932e /src/runtime/q3dsuippresentation_p.h
parenta3600ed119ba3752aefc0f1976ef1ea268123f2e (diff)
Add zoom factor to camera node
The studio needs to be able to zoom the camera when using edit modes. The previous runtime used view matrix scale to do this, but the scale component is not used by Qt3D camera so add zoom factor to camera node and apply it to the projection matrix. Change-Id: I7ba66bc9b5b420d216ab201411ef4aa7d967d029 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/runtime/q3dsuippresentation_p.h')
-rw-r--r--src/runtime/q3dsuippresentation_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/q3dsuippresentation_p.h b/src/runtime/q3dsuippresentation_p.h
index 3efedca..40c10e9 100644
--- a/src/runtime/q3dsuippresentation_p.h
+++ b/src/runtime/q3dsuippresentation_p.h
@@ -1243,6 +1243,7 @@ class Q3DSV_PRIVATE_EXPORT Q3DSCameraNode : public Q3DSNode
Q_PROPERTY(float clipfar READ clipFar WRITE setClipFar)
Q_PROPERTY(ScaleMode scalemode READ scaleMode WRITE setScaleMode)
Q_PROPERTY(ScaleAnchor scaleanchor READ scaleAnchor WRITE setScaleAnchor)
+
public:
enum ScaleMode {
SameSize = 0,
@@ -1288,6 +1289,9 @@ public:
Q3DSPropertyChange setScaleAnchor(ScaleAnchor v);
float verticalFov(float aspectRatio) const;
+ float zoom() const { return m_zoom; }
+
+ Q3DSPropertyChange setZoom(float v);
private:
Q_DISABLE_COPY(Q3DSCameraNode)
@@ -1300,6 +1304,7 @@ private:
float m_clipFar = 5000;
ScaleMode m_scaleMode = Fit;
ScaleAnchor m_scaleAnchor = Center;
+ float m_zoom = 1.0;
};
class Q3DSV_PRIVATE_EXPORT Q3DSLightNode : public Q3DSNode