Here is my working code. Please feel free to recommend modifications.

@yaustar You can also add theses Quat functions in the Playcanvas engine.

```
this.movementDuration = 3; //The duration (Secs)
this.time =0;
this.rotateTowardThis = new pc.Vec3(-7,5,0); //The 3D point to rotate toward
Camera.prototype.update = function(dt) {
this.time += dt;
var percent = this.time / this.movementDuration;
var original_rotation = new pc.Quat();
var final_rotation = new pc.Quat();
original_rotation.copy(this.entity.getRotation());
this.entity.lookAt(this.rotateTowardThis);
final_rotation.copy(this.entity.getRotation());
this.entity.setRotation(original_rotation);
var new_rotation = this.rotateTowards(original_rotation, final_rotation, percent);
this.entity.setRotation(new_rotation);
}
//// Quat functions
// Get the dot product between two quaternions
OrbitCamera.prototype.dot = function (quat_left, quat_right) {
var dot = quat_left.x * quat_right.x + quat_left.y * quat_right.y +
quat_left.z * quat_right.z + quat_left.w * quat_right.w;
return dot;
};
// Returns the angle in degrees between two rotations /a/ and /b/.
OrbitCamera.prototype.quatAngle = function (quat_a, quat_b) {
var dot = this.dot(quat_a, quat_b);
if(quat_a.equals(quat_b) )
{
return 0;
}
var rad2Deg = 1 / (Math.PI / 180);
var angle = Math.acos(Math.min(Math.abs(dot), 1)) * 2 * rad2Deg;
return angle;
};
// Rotates a rotation A towards B.
OrbitCamera.prototype.rotateTowards = function (quat_a, quat_b, percent) {
var angle = this.quatAngle(quat_a, quat_b);
if (angle === 0)
{
return quat_b;
}
return new pc.Quat().slerp(quat_a, quat_b, percent);
};
```