Convert HeadingPitchRange to Orientation


I am make an animation with, before the animation, I prefer to use to change the camera to the beginning position of the lookAt animation of next step.

I found there is an method for viewer.flyTo(entity, { offset: heading-pitch-range }) but without complete callback function, while we do have this onComplete callback for…

So I want to know how to convert the destination + headingPitchRange to destination + orientation, so I can use camera.viewer.flyTo?