I have the problem that the ghostmode on the hideObjects-function doesnt seem to work properly for my case. Maybe I’m doing it wrong but the objects are still somewhat visible and they are also selectable. At least they get detected by the:
I need to completely hide the objects and have the selectionEvent ignore them. Or at least get an Indicator, when a Hit is in ghostMode.
Just for reference. This is a really simple piece of code that I use to hide Objects:
(btw I have noticed that the code example in the documentation for showObjects and hideObjects seem to have wrong parameters, because the showObjects example has the ghoseMode-parameter and the hideObjects doesnt.)
I see that you are calling hideObjects with the ghost parameter (last parameter) set to true. That’s the reason upon hiding the hidden objects remain ghosted and intractable. Try either setting it to false, either not setting it at all, since it’s optional and it defaults to false.
Setting ghost to false helps with the transperency problem. I guess I missunderstood the ghost-parameter.
Object is still selectable though.
This is my select-function:
@dimitrie can correct me if I’m wrong, but you need to ignore hidden objects yourself by using the return value of hideObjects. All filtering calls return a FilteringState which you can use to keep track of various states of the objects in the scene at any time.
Basically you’d need to go through the hits array inside the SelectionEvent in order, and find the first hit which is not hidden by looking if it’s id is in the hiddenObjects array inside the FilteringState object returned by hideObjects
This worked. I am now storing my filteringState in my viewer service after using a filter and ignore hidden objects on selection based on my filteringState.