Good day everybody.
I've made some additions to camera flyTo for EndPoints LiquidGalaxy
(https://github.com/EndPointCorp/lg_cesium) and want to share them back to Cesium upstream.
I've added 2 new mechanics to camera flyto.
First one is pitchAdjusAltitude
When you fly for a big distance and with high altitude and start pitch and end pitch are quite close to zero, Earth goes out of sight.
That happens because pitch interpolated linear between start and end points, and with high altitude camera looks straight and Earth goes out of viewport.
What I want, is to point camera down during the high altitude flights.
So camera pitch interpolates following way:
(startPitch) ----- ( straight down ) ----- (endPitch)
Pitch interpolated accordingly to camera altitude distance between start/end altitude and middle point.
But for small altitude I wan to leave default behavior. I've implemented flyTo options parameter pitchAdjusAltitude. If camera goes higher than this altitude, camera pitch interpolated as mentioned above.
If this option is omitted, or camera goes lower, pitch interpolated as it was.
Second item is flyOverLon and flyOverLonWeight options.
Lets say you want to fly camera from Los Angeles to Tokyo. There are two ways on globe to do that:
a) over Pacific ocean (shortest path which is used now)
b) over Atlantic and Europe - which some times may be preferable, because it's populated and the rest of your data might be located there.
So to be able to specify which way you want camera to fly, you can add flyOverLon. For example above you can set it to 0 (Greenwich meridian).
flyOverLonWeight sets treshold for this option, camera will fly over flyOverLon only if this way is shorten than default way * flyOverLonWeight. In a nut shell we'll fly over flyOverLon until it's not too far away.