GSAP & orbitControls

Hi everyone,

What do I have to update inside orbit controls in order to sync up manual changes added to the camera (in my case a gsap animation)? When I’m enabling the controls.update(), I’m back to point 0 of animation (last position before animation was started); I had some luck with setting camera position onComplete (with camera.getWorldDirection), but the outcome was not the desired one; I know that the problem is caused by controls.update() inside render/tick.animation loop function, but without it I don’t get the damping effect which I also need.

Here is a codepen which describe the problem:

Click on the arrows from the center GUI to trigger the animation.

Another problem is the animation itself; if we call outside gsap : camera.rotateOnWorldAxis(new THREE.Vector3(0,1,0), THREE.Math.degToRad(angle)), works perfectly - 90 degrees from last camera position, respectively 180 degrees.

Thank you