smooth-bevy-cameras
smooth-bevy-cameras copied to clipboard
Maintain distance while orbiting fast
The orbit control example seems to bring the camera closer to the look-at point when rotating fast - presumably because it's taking the shortest path in 3D space. Would it be possible to maintain the distance from the centre when rotating?
That should not happen. Orbit radius should stay constant, except for when smoothing happens, but I would expect that to eventually converge on a correct radius. I will try to reproduce this.
Thank you. I can produce a minimal reproduction if needed.
Yea I'm not able to reproduce this in the simple_orbit example. Could you confirm that you can reproduce this on the simple_orbit example?
https://gfycat.com/briefelasticgermanwirehairedpointer
Here's a screen recording of the simple_orbit example
I see. The radius constraint is only temporarily violated by the smoothing. This is because the smoothing happens in Cartesian coordinates in a controller-agnostic way.
If you want a smooth orbit camera that always maintains the radius constraint, I suppose you would need to only apply smoothing in polar coordinates, i.e. to the camera's angles, not it's position.
Perhaps we want some way to choose between different kinds of smoothing? Instead of just one Smoother component we could have a CartesianSmoother and a PolarSmoother. I think the PolarSmoother could even reuse the LookAngles code.
However there is also the case where the target moves. If only polar smoothing is applied here, then the translation of the translation might feel weird. Not sure.
same behavior when rotating fast.