Changing pitch and heading

classic Classic list List threaded Threaded
2 messages Options
Dante Dante
Reply | Threaded
Open this post in threaded view
|

Changing pitch and heading

Hey, I use EarthManipulator with setHomeViewpoint and it places the camera just fine, but when i need to change heading and the pitch, it doesn't do anything.

    manip->setHomeViewpoint(osgEarth::Viewpoint(
        "Home",
        longitude, latitude, altitude + 2.0,   // longitude, latitude, altitude
        0.0, -90.0, 1000)); // heading, pitch, range

    manip->getViewpoint().setHeading(100.0);
    manip->getViewpoint().setPitch(0.0);
emminizer emminizer
Reply | Threaded
Open this post in threaded view
|

Re: Changing pitch and heading

Hi Dante,

EarthManipulator defines getViewpoint() as const:

        Viewpoint getViewpoint() const;

Get a viewpoint, edit it, then tell the EarthManipulator to use it with setViewpoint():

        virtual void setViewpoint( const Viewpoint& vp, double duration_s =0.0 );

 - Dan