Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquick3dfrustumcamera.cpp
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
5
6#include <QtQuick3DRuntimeRender/private/qssgrendercamera_p.h>
7
8#include <QtMath>
9#include <QtQuick3DUtils/private/qssgutils_p.h>
10
11#include "qquick3dutils_p.h"
12
13#include "qquick3dnode_p_p.h"
14
16
59{}
60
67{
68 return m_top;
69}
70
77{
78 return m_bottom;
79}
80
87{
88 return m_right;
89}
90
97{
98 return m_left;
99}
100
102{
103 if (qFuzzyCompare(m_top, top))
104 return;
105
106 m_top = top;
108 update();
109}
110
112{
113 if (qFuzzyCompare(m_bottom, bottom))
114 return;
115
116 m_bottom = bottom;
118 update();
119}
120
122{
123 if (qFuzzyCompare(m_right, right))
124 return;
125
126 m_right = right;
128 update();
129}
130
132{
133 if (qFuzzyCompare(m_left, left))
134 return;
135
136 m_left = left;
138 update();
139}
140
142{
143 // NOTE: The frustum camera extends the perspective camera!
145 if (camera) {
146 const bool changed = ((int(qUpdateIfNeeded(camera->top, m_top))
147 | int(qUpdateIfNeeded(camera->bottom, m_bottom))
148 | int(qUpdateIfNeeded(camera->right, m_right))
149 | int(qUpdateIfNeeded(camera->left, m_left))) != 0);
150 if (changed)
152 }
153
154 return camera;
155}
156
QQuick3DFrustumCamera(QQuick3DNode *parent=nullptr)
\qmltype FrustumCamera \inherits PerspectiveCamera \inqmlmodule QtQuick3D
QSSGRenderGraphObject * updateSpatialNode(QSSGRenderGraphObject *node) override
QSSGRenderGraphObject * updateSpatialNode(QSSGRenderGraphObject *node) override
QCamera * camera
Definition camera.cpp:19
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Definition qfloat16.h:287
GLdouble GLdouble GLdouble GLdouble top
GLdouble GLdouble right
GLint left
GLint GLint bottom
QT_BEGIN_NAMESPACE bool qUpdateIfNeeded(T &orig, T updated)
#define emit
Definition moc.h:24
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent