Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
70
78{
79 return m_top;
80}
81
89{
90 return m_bottom;
91}
92
100{
101 return m_right;
102}
103
111{
112 return m_left;
113}
114
116{
117 if (qFuzzyCompare(m_top, top))
118 return;
119
120 m_top = top;
122 update();
123}
124
126{
127 if (qFuzzyCompare(m_bottom, bottom))
128 return;
129
130 m_bottom = bottom;
132 update();
133}
134
136{
137 if (qFuzzyCompare(m_right, right))
138 return;
139
140 m_right = right;
142 update();
143}
144
146{
147 if (qFuzzyCompare(m_left, left))
148 return;
149
150 m_left = left;
152 update();
153}
154
156{
157 // NOTE: The frustum camera extends the perspective camera!
159 if (camera) {
160 const bool changed = ((int(qUpdateIfNeeded(camera->top, m_top))
161 | int(qUpdateIfNeeded(camera->bottom, m_bottom))
162 | int(qUpdateIfNeeded(camera->right, m_right))
163 | int(qUpdateIfNeeded(camera->left, m_left))) != 0);
164 if (changed)
166 }
167
168 return camera;
169}
170
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:333
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:23