Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qssgrenderinstancetable_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4
5#ifndef QSSGRENDERINDEXTABLE_P_H
6#define QSSGRENDERINDEXTABLE_P_H
7
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3DRuntimeRender/private/qssgrendergraphobject_p.h>
21
22#include <QtGui/qvectornd.h>
23#include <QtGui/qmatrix4x4.h>
24
26
28 QVector4D row0;
29 QVector4D row1;
30 QVector4D row2;
31 QVector4D color;
32 QVector4D instanceData;
33};
34
35struct Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderInstanceTable : public QSSGRenderGraphObject
36{
37 QSSGRenderInstanceTable() : QSSGRenderGraphObject(QSSGRenderGraphObject::Type::ModelInstance, FlagT(Flags::HasGraphicsResources)) {}
38
39 int count() const { return instanceCount; }
40 qsizetype dataSize() const { return table.size(); }
41 const void *constData() const { return table.constData(); }
42 void setData(const QByteArray &data, int count, int stride) { table = data; instanceCount = count; instanceStride = stride; ++instanceSerial; }
43 void setInstanceCountOverride(int count) { instanceCount = count; }
44 int serial() const { return instanceSerial; }
45 int stride() const { return instanceStride; }
46 bool hasTransparency() { return transparency; }
47 void setHasTransparency( bool t) { transparency = t; }
48 void setDepthSorting(bool enable) { depthSorting = enable; }
49 bool isDepthSortingEnabled() { return depthSorting; }
50 QMatrix4x4 getTransform(int index) const;
51 void setShadowBoundsMinimum(const QVector3D &value) { shadowBoundsMinimum = value; }
52 void setShadowBoundsMaximum(const QVector3D &value) { shadowBoundsMaximum = value; }
53 QVector3D getShadowBoundsMinimum() const { return shadowBoundsMinimum; }
54 QVector3D getShadowBoundsMaximum() const { return shadowBoundsMaximum; }
55
56private:
57 int instanceCount = 0;
58 int instanceSerial = 0;
59 int instanceStride = 0;
60 bool transparency = false;
61 bool depthSorting = false;
62 QVector3D shadowBoundsMinimum = QVector3D(1, 1, 1);
63 QVector3D shadowBoundsMaximum = QVector3D(-1, -1, -1);
64 QByteArray table;
65};
66
67QT_END_NAMESPACE
68
69#endif // QSSGRENDERINDEXTABLE_P_H
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:27