Skip to content

New picker approach #1264

@pablo-mayrgundter

Description

@pablo-mayrgundter

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()
    }
  }

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions