diff options
author | Sadegh Taghavi <[email protected]> | 2025-05-12 10:38:25 +0300 |
---|---|---|
committer | Nicholas Bennett <[email protected]> | 2025-06-03 07:57:46 +0000 |
commit | 90cbbe03e9ab9b070d1403658bb0bb9b806f5af1 (patch) | |
tree | bd242d1d952e8eea9b424b27495aec78547aa867 /src/xr/quick3dxr | |
parent | 41f2fcd036671d2a530dc8d836b4ff0d0b5041a0 (diff) |
Added necessary changes to demonstrate how to trigger a room scan for spatial anchors.
Task-number: QTBUG-133988
Pick-to: 6.9 6.10
Change-Id: Ie28585fd2e6e0c9a49e35c8386ee5232bfe2ae23
Reviewed-by: Christian Strømme <[email protected]>
Diffstat (limited to 'src/xr/quick3dxr')
-rw-r--r-- | src/xr/quick3dxr/qquick3dxrspatialanchorlistmodel.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/xr/quick3dxr/qquick3dxrspatialanchorlistmodel.cpp b/src/xr/quick3dxr/qquick3dxrspatialanchorlistmodel.cpp index 7ea6c8dc..cf12eb01 100644 --- a/src/xr/quick3dxr/qquick3dxrspatialanchorlistmodel.cpp +++ b/src/xr/quick3dxr/qquick3dxrspatialanchorlistmodel.cpp @@ -97,6 +97,7 @@ QQuick3DXrSpatialAnchorListModel::QQuick3DXrSpatialAnchorListModel(QObject *pare connect(m_anchorManager, &QQuick3DXrAnchorManager::anchorAdded, this, &QQuick3DXrSpatialAnchorListModel::handleAnchorAdded); connect(m_anchorManager, &QQuick3DXrAnchorManager::anchorUpdated, this, &QQuick3DXrSpatialAnchorListModel::handleAnchorUpdated); connect(m_anchorManager, &QQuick3DXrAnchorManager::anchorRemoved, this, &QQuick3DXrSpatialAnchorListModel::handleAnchorRemoved); + connect(m_anchorManager, &QQuick3DXrAnchorManager::sceneCaptureCompleted, this, [this]{queryAnchors();}); queryAnchors(); } else { qWarning("SpatialAnchorModel: Failed to get anchor manager instance"); @@ -140,6 +141,18 @@ QHash<int, QByteArray> QQuick3DXrSpatialAnchorListModel::roleNames() const return roles; } +/*! + \qmlmethod void QQuick3DXrSpatialAnchorListModel::requestSceneCapture() + \brief This method triggers a scan to capture or update spatial data for the current environment. + + This method triggers the underlying XR system to perform a scene capture of the user's current physical environment, + to update or refine the spatial mesh, enabling more accurate placement and tracking of spatial anchors. + + \note Some platforms do not perform this operation automatically. + For example, on Quest 3, if the user is in a previously uncaptured space, this method will not be called automatically, + resulting in no available anchors until a capture is manually triggered. + */ + void QQuick3DXrSpatialAnchorListModel::requestSceneCapture() { if (m_anchorManager == nullptr) |