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
20QT_BEGIN_NAMESPACE
21
22class QSSGRenderGraphObject;
23
24class QSSGRenderPickResult
25{
26public:
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
42Q_STATIC_ASSERT(std::is_trivially_destructible_v<QSSGRenderPickResult>);
43
44QT_END_NAMESPACE
45
46#endif // QSSGRENDERPICKRESULT_H
47

Provided by KDAB

Privacy Policy
Start learning QML with our Intro Training
Find out more

source code of qtquick3d/src/runtimerender/qssgrenderpickresult.h