jscastro76 / threebox

A Three.js plugin for Mapbox GL JS, with support for animations and advanced 3D rendering.
Other
549 stars 145 forks source link

How manually cancel the selection effect of model? #398

Closed leungMr closed 1 year ago

leungMr commented 1 year ago

when a model is selected, How manually cancel the selection effect? If directly set the parameters e.target.selected = false, although the visual selection effect (bbox+tooltip) has been removed, the internal model selection status is still present, because the next click cannot trigger the selection event

leungMr commented 1 year ago

do you know how to solve the problem I raised? @jscastro76

jscastro76 commented 1 year ago

If what you want is to remove the bounding box and tooltips, but keeping the selection event, you can add the attributes bbox: false and tooltip: false, if what you want is to completely hide a concrete object from being raycasted, you can use the attribute raycasted: false

Please, read the the documentation

leungMr commented 1 year ago

Sorry, I may not have described it clearly! my question is, when a model is clicked and selected, how to remove its selected state, except by clicking it again?

jscastro76 commented 1 year ago

tb.map.unselectObject(); should solve your issues but this could conflict when you have both features and objects selectable.