I am attempting to save/restore viewpoints when the user of my application centers on a model object somewhere on the globe. Before attaching to the model object I store the current viewpoint from the earth manipulator into a variable. When the user detaches from the entity I then call setViewpoint on the manipulator to restore the old viewpoint.
However, what I am seeing is that the camera is returning to the original home position at application startup rather than the last saved viewpoint. The data looks like this:
Yes I am calling setViewpoint() and the camera pans to a different point then what is in the supplied viewpoint object. Now if I take the same viewpoint data and call setViewpoint() immediately upon startup it goes to the right place. I only see this after I have centered on a model object.
So when the user chooses to look at an object the code looks something like this:
OK. I was able to reproduce this in the osgearth_manip example. If you tether (with '8' or '9') and then go to a viewpoint, it goes to the wrong location. There must be an offset that doesn't get cleared.