1 | // Copyright (C) 2023 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QSSGRENDERPICKRESULT_H |
5 | #define QSSGRENDERPICKRESULT_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is part of the QtQuick3D API, with limited compatibility guarantees. |
12 | // Usage of this API may make your code source and binary incompatible with |
13 | // future versions of Qt. |
14 | // |
15 | |
16 | #include <QtQuick3DRuntimeRender/qtquick3druntimerenderexports.h> |
17 | #include <QtGui/qvectornd.h> |
18 | #include <limits> |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | class QSSGRenderGraphObject; |
23 | |
24 | class QSSGRenderPickResult |
25 | { |
26 | public: |
27 | const QSSGRenderGraphObject *m_hitObject = nullptr; |
28 | float m_distanceSq = std::numeric_limits<float>::max(); |
29 | // The local coordinates in X,Y UV space where the hit occurred |
30 | QVector2D m_localUVCoords; |
31 | // The position in world coordinates |
32 | QVector3D m_scenePosition; |
33 | // The position in local coordinates |
34 | QVector3D m_localPosition; |
35 | // The normal of the hit face |
36 | QVector3D m_faceNormal; |
37 | // The subset index |
38 | int m_subset = 0; |
39 | int m_instanceIndex = -1; |
40 | }; |
41 | |
42 | Q_STATIC_ASSERT(std::is_trivially_destructible_v<QSSGRenderPickResult>); |
43 | |
44 | QT_END_NAMESPACE |
45 | |
46 | #endif // QSSGRENDERPICKRESULT_H |
47 |