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
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 };
44 QVector<Lod> lods;
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
109
110#endif
Definition qlist.h:75
\inmodule QtGui
Definition qrhi.h:895
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
QSSGRhiInputAssemblerStatePrivate::InputAssemblerState QSSGRhiInputAssemblerState
unsigned int quint32
Definition qtypes.h:50
QVector< QSSGRenderSubset > subsets
std::unique_ptr< QSSGMeshBVH > bvh
QSSGRenderDrawMode drawMode
QSSGRenderWinding winding
QSSGRhiBufferPtr indexBuffer
QSSGRhiInputAssemblerState ia
quint32 lodOffset(int lodLevel) const
QSSGMeshBVHNode::Handle bvhRoot
quint32 lodCount(int lodLevel) const
QVector< Lod > lods
QSSGRenderSubset & operator=(const QSSGRenderSubset &inOther)
QRhiTexture * targetsTexture
QSSGRhiBufferPtr vertexBuffer
QSSGRenderSubset(const QSSGRenderSubset &inOther)
QSSGRenderSubset()=default
struct QSSGRenderSubset::@757 rhi