Quaternion Slerp problem

Hello everyone, if someone can help please the camera needs to travels smoothly to a certain position and a certain rotation (follow the object and flerp whenever he goes).
this is my code , someone nows how to fix it please?

    var t = new pc.Vec3();    
    t = this.entity.getEulerAngles();
    var quat = new pc.Quat();
    t.z = this.GetRotAngle();
    var pd = new pc.Vec3();
    pd = quat.slerp(this.entity.getRotation(), quat.transformVector(t), dt * this.SpeedCam * 
    this.EaseLerpExtreme(this.LerpRot));
    this.entity.setRotation(pd);

Maybe this project will help you:

https://playcanvas.com/project/363817/overview/ship-viewer

In particular, this script:

https://playcanvas.com/editor/code/363817?tabs=7403912

thank you very much Will.