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.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
7
8QMatrix4x4 QSSGRenderInstanceTable::getTransform(int index) const
9{
10 Q_ASSERT(index < instanceCount);
11 // NOTE: table size can be bigger than instanceCount due to QQuick3DInstancing::instanceCountOverride
12 Q_ASSERT(table.size() >= instanceStride * (index + 1));
13 auto *entry = reinterpret_cast<const QSSGRenderInstanceTableEntry*>(table.constData() + index * instanceStride);
14
15 QMatrix4x4 res;
16 res.setRow(0, entry->row0);
17 res.setRow(1, entry->row1);
18 res.setRow(2, entry->row2);
19 res.setRow(3, { 0, 0, 0, 1 });
20 return res;
21}
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:27