Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-14763

Pick ids can overlap between multiple scene objects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3: Somewhat important P3: Somewhat important
    • Qt3D TP2
    • 4.7.2
    • Qt3D
    • None

      QGLAbstractScene::generatePickNodes() generates pick identifiers starting at zero, adding new ids from nextPickId() onwards every time it is called. Because every QGLAbstractScene object starts at zero, it won't be possible to distinguish pickable objects that were loaded from two separate 3DS files (each with their own QGLAbstractScene), but displayed in the same QGLView. Some way is needed for the caller to offset the starting pick identifier when generatePickNodes() is called. Suggest something like:

      int generatePickNodes(int startId = 0);
      

      The caller supplies the starting identifier, and the function returns the highest allocated id plus 1. The return value can then be provided to the next QGLAbstractScene object to allocate disjoint identifiers.

      It should also be possible to do away with nextPickId(), simplifying the API in the process. Just have generatePickNodes() do this:

      QGLPickNode *pn = new QGLPickNode();
      pn->setId(startId++);
      

      I'm also not sure what purpose pickable/setPickable are serving. Presumably if the user calls generatePickNodes(), then the need for picking is implicit. If they don't call it, none of the nodes will have pick ids, so picking will be disabled during painting anyway. Perhaps the API can be simplified all the way down to just generatePickNodes()?

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            z35liu Zheng Liu (closed Nokia identity) (Inactive)
            rweather Rhys Weatherley (closed Nokia identity) (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes