How to receive a notifiaction/callback when arc camera inertia rotation complets?

Hi,
I am looking at the ArcRotateCamera. It has an inertia in the rotation. Do you know of a why to get notified when the rotation is complete. I would like to stop the rendering then.

This did not help - ArcRotateCamera - Babylon.js Documentation
The search for “camera on rotation complete” (and similar) both in the forum did not gave any results - Search results for 'camera on rotation complete' - Babylon.js

Thanks.

You can check the inertialXXX properties to determine when the (arc rotate) camera is stopped:

https://playground.babylonjs.com/#1AJRKW

4 Likes

More than enough. Thanks. I will try it.

I was expecting for this to be an animation and to register for an animation observer. After all if it walks like an animation and talks like an animation I though it is an animation.

To stop the ArcRotateCamera in-place we can use the following utility (I don’t think we have a public method):

function stopInertia(arcRotateCamera: ArcRotateCamera) {
  arcRotateCamera.inertialAlphaOffset = 0;
  arcRotateCamera.inertialBetaOffset = 0;
  arcRotateCamera.inertialRadiusOffset = 0;
  arcRotateCamera.inertialPanningX = 0;
  arcRotateCamera.inertialPanningY = 0;
}