xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
738 stars 291 forks source link

xrayed + (un)pickable, so that I can click on element inside model #957

Closed stepanchvatik closed 7 months ago

stepanchvatik commented 2 years ago

Is is possible, to make whole model xrayed, but with some filtered entities fully visible, so that they are clickable "through the xrayed" model?

Here is code what I do, when user filteres, toShow is array of filtered entities

 $("#btnSearch").on("click",function(e){
    e.preventDefault();
    var entities = scene.objects;
    if(toShow.length == 0){
      for (var key in entities) {
        entities[key].xrayed = false;
        entities[key].pickable = true;
        entities[key].highlighted = false;
      }
    }else{
      for (var key in entities) {
        if(toShow.indexOf(key)>-1){
          entities[key].xrayed = false;
          entities[key].pickable = true;
          entities[key].highlighted = true;
        }else{
          entities[key].xrayed = true;
          entities[key].pickable = false;
          entities[key].highlighted = false;

        }
      }
    }

  })

Screenshots: 1) entity that i want to click image

2) entity that gets clicked (outer wall, bad behavior) image

Amoki commented 2 years ago

It may be related to https://github.com/xeokit/xeokit-sdk/issues/879

xeolabs commented 7 months ago

Will reopen if still happening and not fixed by https://github.com/xeokit/xeokit-sdk/issues/879