I have made further improvements to the vsg::Trackball adding throw and viewpoint animations with the goal of making the user interaction a smoother and more intuitive experience whether you are working on small models or whole earth GIS style models. To illustrate them in actions I've recorded a video:
The changes to vsg::Trackball are checked into VulkanSceneGraph master, as well as add API for setting new viewpoints to animate to, keyboard bindings for user defined viewpints there are now controls for setting the mouse button masks used to control so users can customize the behavior to what suits there users:
I have updated the vsgpagedlod example to illustrate how one can set up keyboard bindings that control which viewpoints to animate to:
The code for setting up the Trackball is:
auto trackball = vsg::Trackball::create(camera, ellipsoidModel);
trackball->addKeyViewpoint(vsg::KeySymbol('1'), 51.50151088842245, -0.14181489107549874, 2000.0, 2.0); // Grenwish Observatory
trackball->addKeyViewpoint(vsg::KeySymbol('2'), 55.948642740309324, -3.199226855522667, 2000.0, 2.0); // Edinburgh Castle
trackball->addKeyViewpoint(vsg::KeySymbol('3'), 48.858264952330764, 2.2945039609604665, 2000.0, 2.0); // Eiffel Town, Paris
trackball->addKeyViewpoint(vsg::KeySymbol('4'), 52.5162603714634, 13.377684902745642, 2000.0, 2.0); // Brandenburg Gate, Berlin
trackball->addKeyViewpoint(vsg::KeySymbol('5'), 30.047448591298807, 31.236319571791213, 10000.0, 2.0); // Cairo
trackball->addKeyViewpoint(vsg::KeySymbol('6'), 35.653099536061156, 139.74704060056993, 10000.0, 2.0); // Tokyo
trackball->addKeyViewpoint(vsg::KeySymbol('7'), 37.38701052699002, -122.08555895549424, 10000.0, 2.0); // Mountain View, California
trackball->addKeyViewpoint(vsg::KeySymbol('8'), 40.689618207006355, -74.04465595488215, 10000.0, 2.0); // Empire State Building
trackball->addKeyViewpoint(vsg::KeySymbol('9'), 25.997055873649554, -97.15543476551771, 1000.0, 2.0); // Boca Chica, Taxas
viewer->addEventHandler(trackball);
These additions combine functionality seen in osgEarth::EarthManipulator and the osgGA::TrackballManipulator/TerrainManipulator into a single class. The remaining vsg::Trackball feature I'd like to implement before VSG-1.0 is terrain following using intersections with the scene. There are more pressing features I need to get on with before returning to this. My end goal with vsg::Trackball is to provide good out of the box functionality but not the be all and end of all of camera manipulators for the VSG, it's also meant as a clean example/base for users to customize or implement their own camera manipulators.