Keep in mind that this.val
interpolation value will be increased by steps that equal to dt
. That is the delta time passed from previous frame. You would need to add additional check and clamp this.val
to 1.0 if it is over it, otherwise it will stop at close to 1.0, but not 1.0 value. I skipped it for example brevity.
Edit:
You can see how to clamp it in this project example:
https://playcanvas.com/project/711986/overview/rotation-example