Closed simsuniy closed 1 year ago
Hi @simsuniy, thank you for pointing this out. The main reason why update() is called before render is that even if the pointer hasn't been moved or clicked, elements in the scene might have changed their position and not cause any intersection with the pointer any more. So if you have no animation, it should be sufficient to call update() in the onDocumentMouseMove() event.
Thanks for that great work!
One thing I wondered about was the "
interactionManager.update();
" I added it to the render function but didn't get any mousemove events, unless I clicked on one of my objects (then the "click" and the "enter/leave" events were triggerd). Then I found out you use the update() inside the animation but in my app I do not have any animation function as I use three event based. (In my opininion this is something like polling, and polling should be used only if there is no other way...)For me I moved the update() to the
onDocumentMouseMove(e)
(just added this.update();) and removed the update on rendering. so, every time document triggers the mouseMove event, the interactionManager will be updated.Do you see any problems on doing it that way?