I am using a QObjectPicker to select a 3D mesh on a Qt3DWindow. I am getting "clicked" signals when I click near the object but not actually on it, and this is an issue. I believe that if I change the QPickingSettings::PickMethod to TrianglePicking instead of the default setting of BoundingVolumePicking, it will fix this issue. Is this a reasonable assumption? The PickMethod settings are handled in the QPickingSettings class while object selection is handled in the QObjectPicker class. How do I attach the desired settings in the QPickingSettings class to the QObjectPicker class? I am using Qt5. Any help would be greatly appreciated, I am completely stuck!

Qt Code:
  1. Qt3DRender::QObjectPicker *MeshGraphics::createObjectPicker()
  2. {
  3. Qt3DRender::QObjectPicker *picker = new Qt3DRender::QObjectPicker();
  4.  
  5. Qt3DRender::QPickingSettings *settings = new Qt3DRender::QPickingSettings(picker);
  6.  
  7. settings->setFaceOrientationPickingMode(Qt3DRender::QPickingSettings::FrontFace);
  8. settings->setPickMethod(Qt3DRender::QPickingSettings::TrianglePicking);
  9. settings->setPickResultMode(Qt3DRender::QPickingSettings::NearestPick);
  10.  
  11. QObject::connect(picker, SIGNAL(clicked(Qt3DRender::QPickEvent*)), this, SLOT(pickMesh(Qt3DRender::QPickEvent*)));
  12.  
  13. return picker;
  14. }
To copy to clipboard, switch view to plain text mode