I have two nodes, node A and node B. Node A has a Lemur CursorEventControl added to it.
Now if I click on a geometry that is a child of node B, and behind that geometry, there is another geometry that is a child of node A then the CursorEventControl on node A will be notified.
As you can see here:
PickEventSession will try to iterate through all collision results until it finds one that has a CursorEventControl on it (or it’s parents).
One ugly solution is to add an empty CursorEventControl to node B to prevent this behavior. Another solution is to attach A and B into another node and attach “CursorEventControl” to the parent but… you know… ah…
I guess a better and cheap solution is to also send the index of collision result inside AbstractCursorEvent so one can check the index and if it is > 0 then ignore it if he wants.
private Node terrainNode = new Node("Terrain");
private Node plotNode = new Node("Plot");
private Node entitiesNode = new Node("Entities");
“Terrain” node contains chunks and block geometries. (Voxel terrain)
“Plot” node contains all plotted objects by plotters (trees, walls, fences…)
“Entities” node holds models for NPCs, houses, …
I have added a CursorEventControl to “Terrian” node to detect mouse clicks on terrain and add some stuff on the clicked location.
But if I click on a tree which is inside the “Plot” or on a house which is inside “Entities” node then CursorEventControl on “Terrain” node will be notified and I do not want it to happen or at least I know that hit is not the first hit so I can skip it.