1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "qssgrenderinstancetable_p.h"
5
6QMatrix4x4 QSSGRenderInstanceTable::getTransform(int index) const
7{
8 Q_ASSERT(index < instanceCount);
9 Q_ASSERT(table.size() == instanceStride * instanceCount);
10 auto *entry = reinterpret_cast<const QSSGRenderInstanceTableEntry*>(table.constData() + index * instanceStride);
11
12 QMatrix4x4 res;
13 res.setRow(index: 0, value: entry->row0);
14 res.setRow(index: 1, value: entry->row1);
15 res.setRow(index: 2, value: entry->row2);
16 res.setRow(index: 3, value: { 0, 0, 0, 1 });
17 return res;
18}
19

source code of qtquick3d/src/runtimerender/graphobjects/qssgrenderinstancetable.cpp