I am currently working on a project that involves implementing a damping effect for the camera when the user stops rotating it using their mouse. While this effect is important, I also want to provide users with the option to disable the damping effect by clicking on the screen.
I attempted the following code to disable and re-enable the controls and damping in the onClick event:
this.control.enabled = false;
this.control.enableDamping = false;
this.control.update();
this.control.enableDamping = true;
this.control.enabled = true;
Unfortunately, this approach did not behave as expected. When the user clicks to cancel the damping effect, the camera abruptly shifts to a different position, almost as if it is trying to catch up with the latest update.
If anyone has suggestions on how to achieve the desired behavior, I would greatly appreciate it. Thank you!