ArcRotateCamera: is there a callback or other mechanism to detect when mouse zoom stops due to scrollwheel input

The ArcRotateCamera has a smooth zoom when using the mouse wheel. Is there a callback when this smooth zoom stops or another way to detect this? Reason for asking is that im experimenting with the idea of stopping the render loop when there is no mouse input. For the zoom behaviour there is a smooth lerp on the zoom so a delay after the scroll wheel event stops. I need to detect when the camera zoom behavour actual stops so I dont stop the render loop too early. Any ideas?

Assuming camera radius is only changed by mouse wheel, then I would store the camera radius:

let storedRadius = camera.radius
let isZooming

followed by adding observer for onAfterCameraRenderObservable:

if(camera.radius == storedRadius) {
  isZooming = false  // or remove observer and add at zoom start?
}
else {
   storedRadius = camera.radius
   isZooming = true
}

Another way could be to customize camera inputs, where you set isZooming in checkInputs():

PG Example:

3 Likes

Maybe this thread can help:

2 Likes