If pointer is held down without any movement "updated" keeps firing
vis-prime opened this issue · comments
Describe the bug
I'm using the on demand rendering method since model is static , it works great
one thing i noticed
if I keep left click held down , cameraControls.update(delta) return true continuously
my use case:
I want to render the final frame with full device pixel ratio after "sleep" event
When mouse is held down it's continuously firing 'sleep' and 'updated'
On mouse up everything is fine
To Reproduce
console.log the updated value in the render loop
Code
cameraControls.addEventListener("sleep", (e) => {
console.log(e)
})
renderer.setAnimationLoop(() => {
const delta = clock.getDelta()
const hasControlsUpdated = cameraControls.update(delta)
// on demand
if (hasControlsUpdated) {
console.log("render")
render()
}
})
Live example
Expected behavior
if the hold the mouse button down and do not move it at all , 'hasControlUpdated' should return false
Screenshots or Video
2023-08-08.22-38-59.mp4
Device
Desktop
OS
Windows
Browser
Chrome
Thanks for using camera-controls, and your report.
Your demo and video are really helpful.
I tested on your demo, but It seems I can't reproduce the problem.
Does it happen to other devices too? Might be some mouse devices are too sensitive.
Screen.Recording.2023-08-09.at.11.54.41.mp4
Strange , does not happen on phone too,
on sandbox and my vite js project it's happening even if mouse is lifted off the surface
mouse.mp4
will check if it's the mouse causing the issue !
uh, it somehow fixed it self !
now idea how ! both sandbox and my local project seems to working correctly
will close this for now !
thanks!