1 | // Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QT3DRENDER_QBOUNDINGVOLUME_P_H |
5 | #define QT3DRENDER_QBOUNDINGVOLUME_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists for the convenience |
12 | // of other Qt classes. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <Qt3DRender/qt3drender_global.h> |
19 | #include <Qt3DCore/qnodeid.h> |
20 | #include <Qt3DCore/private/vector3d_p.h> |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | namespace Qt3DRender { |
24 | namespace RayCasting { |
25 | |
26 | class QRay3D; |
27 | |
28 | class Q_3DRENDERSHARED_EXPORT QBoundingVolume |
29 | { |
30 | public: |
31 | QBoundingVolume(); |
32 | virtual ~QBoundingVolume(); |
33 | |
34 | enum Type { |
35 | Sphere = 0, |
36 | Triangle |
37 | }; |
38 | |
39 | virtual Qt3DCore::QNodeId id() const = 0; |
40 | virtual bool intersects(const QRay3D &ray, Vector3D *q = nullptr, |
41 | Vector3D *uvw = nullptr) const = 0; |
42 | |
43 | virtual Type type() const = 0; |
44 | }; |
45 | |
46 | } // namespace RayCasting |
47 | } // namespace Qt3DRender |
48 | |
49 | QT_END_NAMESPACE |
50 | |
51 | Q_DECLARE_METATYPE(Qt3DRender::RayCasting::QBoundingVolume*) // LCOV_EXCL_LINE |
52 | |
53 | #endif // QT3DRENDER_QBOUNDINGVOLUME_P_H |
54 | |