https://codereview.qt-project.org/c/qt/qtquick3d/+/323447 and related stuff in Qt Quick is too simple for this use case, because one 2D subscene has one DeliveryAgent, and the DA can only have one ViewportTransformHelper.
If you press two touchpoints at the same time on two models at different positions, picking works fine; but both of those models could have the same 2D subscene as their texture sourceItems (shared source). QQuick3DViewport::internalPick() has this data structure to keep track temporarily of which 3D model goes with which 2D scene:
which clearly can only accommodate one subscene for each 2D "root" item. To support the same 2D subscene on multiple 3D objects, the mapping would have to be the other way around. But this is not the only limiting factor: there's also the QQuickItemPrivate::ensureSubsceneDeliveryAgent() API which is called in QQuick3DTexture::setSourceItem() (you will only get a new DA if this subscene root didn't already have one), the fact that the DA is stored in ItemPrivate's ExtraData::subsceneDeliveryAgent (we only store at most one DA per subscene), etc.
So it will be a rather large refactoring to support this by making multiple instances of either the DA or the transform helper. Some thought should be put into whether it's really worth it; due to the time it will take to get this working, it will have the consequence that other things don't get done.
Alternatively we could just document that we don't support it. It's not so bad if the user needs to make a duplicate instance of the same 2D scene definition, in the cases when she needs to support this use case. Even if she didn't duplicate them, it shouldn't be a problem to use a single mouse, because you can't press two positions on two models at the same time, so one entry in visitedSubscenes is enough on press, and one fresh instance of ViewportTransformHelper is enough for the rest of the mouse events until release. On the next press, we start over.
So in my opinion: this is low priority for now, unless there are obvious reasons that we need this use case in real UIs.
|For Gerrit Dashboard: QTBUG-96324|
|369897,8||Make the "sharedSource" input autotests actually share the source||dev||qt/qtquick3d||Status: MERGED||+2||0|
|369932,3||doc: Describe input forwarding to Texture.sourceItem, with limitations||dev||qt/qtquick3d||Status: MERGED||+2||0|
|375699,2||doc: Describe input forwarding to Texture.sourceItem, with limitations||6.2||qt/qtquick3d||Status: MERGED||+2||0|
|375704,2||Make the "sharedSource" input autotests actually share the source||6.2||qt/qtquick3d||Status: MERGED||+2||0|