Took me a while to track this one down. Here’s the sequence:
Import GLB and add to scene
Add Gizmo to mesh on pick
On pointer double tap, dispose() of the mesh or bounding box
Voila, the camera is detached from canvas. Reattach and you’re good to go again. Behavior does not occur on desktop. And doesn’t occur on mobile if dispose() is run from the console. Only after a touch event.
Not a big deal, since I can just re-attach… but wanted to log it.
Unfortunately it is hard to debug in your app for us would it be possible to repro in the playground instead ? This would be more efficient for us to be able to fix.
Double click the sphere to detach camera.
(sorry ugly code. working quick)
ps. Note that if you double click anywhere other than the sphere, camera does not detach. Which makes me think that it has something to do with running the pick event and attach gizmo process at the same time that the double-click event is doing a dispose().
You sure?
After deleting the sphere by double clicking on it, if you run scene.cameras[0].attachControl(canvas, false)
In console, you get camera control back again…
(in my production code, i set the gizmo’s attachedMesh to null… just skipped that here)
As you kill the mesh during the pointer events, the dragbehavior which plays with the event to detach attach the camera to allow dragging, can not catch the final up event to reattach the camera.
It is why you need to kill it separately to force the reattach.