I got a little error with my OrbitControl, when I click on my canvas and I drag on my canvas it works fine (my scene rotate etc).
But, if I press click on my canvas and I unpress my click outside of my canvas, when i come back on it my scene rotate whithout pressing my left click.
Which is pretty problematic because I’m using HTML beacon on my canvas so it “breaks” my orbit control management if I unpress my click on another html element.
I tried to dispatch end event on leaving my canvas etc by I didn’t succeed to prevent this behaviour.
This might be a problem in the three.js OrbitControls script.
As a workaround: can you try disabling our OrbitControls component during the time your cursor is not over the canvas?
I retried it with a new project to verify it in the last needle version 3.25.2
I got the same error, if I stay my click pressed from my canvas to an html element and I unpress.
Then my orbitControl rotate when my mouse come back on my canvas.
I need to regenerate a mouseup event by clicking my canvas if I want that my orbitcontrol stop rotating.
These events are handled by three’s OrbitControls tho. We just give it the canvas and call update (our component is basically a wrapper around it with some extra functionality for lerping the camera and setting look at focus)
Can you try calling needleOrbitControls.controls.saveState and then resetState when your pointer exits the canvas? (The threejs orbitcontrols is exposed via the controls property on the needle engine component)
I think it would be much better if OrbitControls would expose the state (or a way to reset it without modifying the positions). Maybe it’s worth making a PR in three to allow for it
Okay it works
But it stops my rotation when my mouse meet an html beacon
I think I will try to generate dynamically Hotspots like you do in one of your sample
But it seems very complex to do it only with js because I need to generate a lot of different components to make it working
HotspotManager, Mesh Renderer, Canvas, HotSpot… etc etc
Is it possible to use the hover function for the Button Component ?
There is an onClick.addEventListener but not onHover
I tried with its onPointerEnter but it doesn’t work