Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New picker approach #1264

Open
pablo-mayrgundter opened this issue Nov 20, 2024 · 0 comments
Open

New picker approach #1264

pablo-mayrgundter opened this issue Nov 20, 2024 · 0 comments
Assignees

Comments

@pablo-mayrgundter
Copy link
Member

pablo-mayrgundter commented Nov 20, 2024

I had started refactoring picker code. Need a place to stash this

From IfcViewerAPIExtended

async highlightIfcItem() {
    const picker = new Picker(this.context)
    const pickedAll = picker.castRay(this.context.scene.scene.children)
    if (pickedAll.length === 0) {
      return
    }
    // const picked = this.context.castRayIfc()
    const picked = pickedAll[0]
    if (!picked) {
      this.IFC.selector.preselection.toggleVisibility(false)
      return
    }
    // const id = this.getPickedItemId(picked)
    const id = picked.object.expressID
    if (this.isolator.canBePickedInScene(id)) {
      /* const preselectMat = new MeshLambertMaterial({
        transparent: true,
        opacity: 0.5,
        color: 0xff0000,
        depthTest: true,
      }) */
      // new Selection(this.context, this.IFC.loader, preselectMat).pick(picked)
      await this.IFC.selector.preselection.pick(picked)
      this.highlightPreselection()
    }
  }
@pablo-mayrgundter pablo-mayrgundter self-assigned this Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant