1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "qquick3dextensionhelpers_p.h"
5#include "qquick3dobject_p.h"
6
7QT_BEGIN_NAMESPACE
8
9/*!
10 \class QQuick3DExtensionHelpers
11 \inmodule QtQuick3D
12 \since 6.6
13
14 \brief Helper functions for the Extensions APIs.
15*/
16
17QQuick3DExtensionHelpers::QQuick3DExtensionHelpers()
18{
19
20}
21
22/*!
23 \return a \c QSSGNodeId that can be used to retrieve the object in the engine
24 corresponding to \a node.
25
26 //! \sa QSSGFrameData::getNode()
27*/
28QSSGNodeId QQuick3DExtensionHelpers::getNodeId(const QQuick3DObject &node)
29{
30 // NOTE: Implementation detail (don't rely on this in user code).
31 return quintptr(QQuick3DObjectPrivate::get(item: &node)->spatialNode);
32}
33
34/*!
35 \return a \c QSSGResourceId that can be used to retrieve the corresponding \a resource object
36 in the engine.
37
38 //! \sa QSSGFrameData::getResource()
39*/
40QSSGResourceId QQuick3DExtensionHelpers::getResourceId(const QQuick3DObject &resource)
41{
42 // NOTE: Implementation detail (don't rely on this in user code).
43 return quintptr(QQuick3DObjectPrivate::get(item: &resource)->spatialNode);
44}
45
46QT_END_NAMESPACE
47

source code of qtquick3d/src/quick3d/extensions/qquick3dextensionhelpers.cpp