Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qssgrendermesh_p.h
Go to the documentation of this file.
1// Copyright (C) 2008-2012 NVIDIA Corporation.
2// Copyright (C) 2019 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#ifndef QSSG_RENDER_MESH_H
6#define QSSG_RENDER_MESH_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuick3DRuntimeRender/private/qssgrhicontext_p.h>
20
21#include <QtQuick3DUtils/private/qssgbounds3_p.h>
22#include <QtQuick3DUtils/private/qssgmeshbvh_p.h>
23
25
27{
30 QSSGBounds3 bounds; // Vertex buffer bounds
32 struct {
37 } rhi;
38
39 struct Lod {
42 float distance = 0.0f;
43 };
45
46 QSSGRenderSubset() = default;
48 : count(inOther.count)
49 , offset(inOther.offset)
50 , bounds(inOther.bounds)
51 , bvhRoot(inOther.bvhRoot)
52 , rhi(inOther.rhi)
53 , lods(inOther.lods)
54 {
55 }
57 {
58 if (this != &inOther) {
59 count = inOther.count;
60 offset = inOther.offset;
61 bounds = inOther.bounds;
62 bvhRoot = inOther.bvhRoot;
63 rhi = inOther.rhi;
64 lods = inOther.lods;
65 }
66 return *this;
67 }
68
69 quint32 lodCount(int lodLevel) const {
70 if (lodLevel == 0 || lods.isEmpty())
71 return count;
72 if (lodLevel > lods.count())
73 lodLevel = lods.count() - 1;
74 else
75 lodLevel -= 1;
76
77 return lods[lodLevel].count;
78 }
79
80 quint32 lodOffset(int lodLevel) const {
81 if (lodLevel == 0 || lods.isEmpty())
82 return offset;
83 if (lodLevel > lods.count())
84 lodLevel = lods.count() - 1;
85 else
86 lodLevel -= 1;
87
88 return lods[lodLevel].offset;
89 }
90
91};
92
94{
95 Q_DISABLE_COPY(QSSGRenderMesh)
96
100 QSSGMeshBVH *bvh = nullptr;
102
104 : drawMode(inDrawMode), winding(inWinding)
105 {
106 }
107
109 {
110 delete bvh;
111 }
112};
114
115#endif
Definition qlist.h:74
\inmodule QtGui
Definition qrhi.h:883
Class representing 3D range or axis aligned bounding box.
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
GLenum GLenum GLsizei count
GLsizei GLsizei GLfloat distance
GLenum GLuint GLintptr offset
std::shared_ptr< QSSGRhiBuffer > QSSGRhiBufferPtr
unsigned int quint32
Definition qtypes.h:45
QVector< QSSGRenderSubset > subsets
QSSGRenderDrawMode drawMode
QSSGRenderWinding winding
QSSGMeshBVH * bvh
QSSGRhiBufferPtr indexBuffer
QSSGRhiInputAssemblerState ia
quint32 lodOffset(int lodLevel) const
quint32 lodCount(int lodLevel) const
QVector< Lod > lods
QSSGRenderSubset & operator=(const QSSGRenderSubset &inOther)
QRhiTexture * targetsTexture
QSSGRhiBufferPtr vertexBuffer
QSSGRenderSubset(const QSSGRenderSubset &inOther)
QSSGMeshBVHNode * bvhRoot
struct QSSGRenderSubset::@751 rhi
QSSGRenderSubset()=default