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
qquick3dxrorigin.cpp
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
5
7
16 : m_builtInCamera(new QQuick3DXrCamera(this))
17{
18 // These are the "real" cameras that are used for rendering.
19 auto *leftEyeCamera = new QQuick3DXrEyeCamera;
20 leftEyeCamera->setParent(this);
21 leftEyeCamera->setParentItem(this);
22 m_eyeCameras.append(leftEyeCamera);
23
24 auto *rightEyeCamera = new QQuick3DXrEyeCamera;
25 rightEyeCamera->setParent(this);
26 rightEyeCamera->setParentItem(this);
27 m_eyeCameras.append(rightEyeCamera);
28
29 // This is the user facing camera
30 setCamera(m_builtInCamera);
31}
32
37
44{
45 return m_camera;
46}
47
49{
50 if (m_camera == newCamera)
51 return;
52
53 if (m_camera) {
54 // connect the near/far properties to the real eye camers
55 for (auto eyeCamera : m_eyeCameras) {
56 // disconnnect the old camera
59 }
60 }
61
62 // There will always be a camera, either the built-in one or the user provided one
63 if (newCamera)
64 m_camera = newCamera;
65 else
66 m_camera = m_builtInCamera;
67
68 if (m_camera) {
69 for (auto eyeCamera : m_eyeCameras) {
70 // Set the initial value, and connect the signals
71 eyeCamera->setClipNear(m_camera->clipNear());
72 eyeCamera->setClipFar(m_camera->clipFar());
75 }
76 }
78}
79
80QQuick3DXrEyeCamera *QQuick3DXrOrigin::eyeCamera(int index) const
81{
82 return m_eyeCameras[index];
83}
84
91
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
void setParent(QObject *parent)
Makes the object a child of parent.
Definition qobject.cpp:2195
void clipFarChanged(float clipFar)
void clipNearChanged(float clipNear)
void setClipNear(float clipNear)
void setClipFar(float clipFar)
void setCamera(QQuick3DXrCamera *newCamera)
~QQuick3DXrOrigin() override
QQuick3DXrCamera * camera
QQuick3DXrOrigin()
\qmltype XrOrigin \inherits Node \inqmlmodule QtQuick3D.Xr
void append(const T &t)
#define this
Definition dialogs.cpp:9
Combined button and popup list for selecting options.
GLuint index
[2]
#define emit
myObject disconnect()
[26]