fhwedel-hoe / OpenRoadEd

OpenRoadEd is a simple application designed to create both logical (OpenDRIVE standard) and geometrical (OpenSceneGraph) descriptions of road networks.
Other
154 stars 64 forks source link

Selection of items in 3D view area is not possible #9

Closed ebadi closed 3 years ago

ebadi commented 3 years ago

Using Windows pre-compiled binary, it is possible to select an element in 3D view area to see its properties, however on Linux, clicking and selecting an item is not possible.

I suspect that the issue has something to do with the CameraManipulator class.

To Check: Whether the version compiled on Windows with Qt5 behaves correctly.

fhwedel-hoe commented 3 years ago

I just compiled on Windows. Same behavior. Not ideal, but at least it is consistent across platforms. :)

As 3D navigation also does not work, I suspect mouse events are not forwarded to the OSG component at all.

ebadi commented 3 years ago

Thanks, so it is probably has nothing to do with the version mismatch (osgQt, OSG, etc). I am now debugging this part of the cod. It seems that mOsgMain->PickNode never returns a valid node. I even tried to change the code as below but that was not the solution.

OSGObjectNode *lLastPicked = mOsgMain->PickNode(width()-e->x(), height()-e->y());
ebadi commented 3 years ago

It seems that mViewer->computeIntersections(x,y,intersections) in OSGMain::PickNode returns no node. In this line we have valid mouse coordinates (x,y) but the function returns false eventhough there are nodes in the viewport (either after loading the sample .xodr file or after drawing a basic road).

 computeIntersections

public boolean computeIntersections(float x,
                                    float y,
                                    INTERSECTVISITORHitList hits)

    compute, from normalized mouse coords, for all Cameras, intersections with the scene. parameters:

    Parameters:
        x - float
        y - float
        hits - openscenegraph.osgUtil.INTERSECTVISITORHitList
ebadi commented 3 years ago

Ok, now I got access to a Windows machine and I see that the OpenRoadEd's Windows binary acts exactly the same as our version of OpenRoadEd. In the tree view, you can select a node and its corresponding object changes its color (as shown below). When you click on an object in 3D view nothing changes in the tree view which is consistent across platforms. Please reopen this issue if I am missing sth :)

image