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
5
6QMatrix4x4 QSSGRenderInstanceTable::getTransform(int index) const
7{
8 Q_ASSERT(index < instanceCount);
9 // NOTE: table size can be bigger than instanceCount due to QQuick3DInstancing::instanceCountOverride
10 Q_ASSERT(table.size() >= instanceStride * (index + 1));
11 auto *entry = reinterpret_cast<const QSSGRenderInstanceTableEntry*>(table.constData() + index * instanceStride);
12
13 QMatrix4x4 res;
14 res.setRow(0, entry->row0);
15 res.setRow(1, entry->row1);
16 res.setRow(2, entry->row2);
17 res.setRow(3, { 0, 0, 0, 1 });
18 return res;
19}
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:27