rebuildAnglesAndRadius seems broken

rebuildAnglesAndRadius should keep the camera alpha between 0 and 2*PI. It seems this function broke in 4.2. Here’s a playground which logs the alpha:
When you keep spinning around the sphere, the alpha value grows and grows.

It looks all stable on 5.0 alpha ???

Do you see it stable as well on Latest ?

For me it’s not working on 5.0 alpha 2 either. If I keep turning the scene, the alpha keeps incrementing.

Oh I see what you mean by none stable but the actual behaviour is the result of a bug fix in 4.2 regarding alpha limits: Arcrotatecamera rebuild angles fix by nilss0n · Pull Request #9342 · BabylonJS/Babylon.js · GitHub

If you wish to keep it in the range 0 2PI you could probably normalize before or after rendering ?

1 Like

I see. I was relying on this particular behavior and I wasn’t using alpha limits. So I didn’t experience any downsides. I’m now normalizing the alpha to 0, 2PI myself to resolve this.

Thanks for the prompt response.

1 Like