- when switching views, force an update() to ensure view position
is valid. Otherwise various subsystems such as AI traffic and the
tile manager see a request for a 0,0 location.
- when switching to model view, we still generate a 0,0
location initially - to be fixed.
do_bind();
}
+void
+FGViewMgr::postinit()
+{
+ // force update now so many properties of the current view are valid,
+ // eg view position and orientation (as exposed via globals)
+ update(0.0);
+}
+
void
FGViewMgr::shutdown()
{
current = newview;
// copy in view data
copyToCurrent();
+
+ // force an update now, to avoid returning bogus data.
+ // real fix would to be make all the accessors use the dirty mechanism
+ // on FGViewer, so update() is a no-op.
+ update(0.0);
}
~FGViewMgr( void );
virtual void init ();
+ virtual void postinit();
virtual void bind ();
virtual void unbind ();
virtual void update (double dt);
void add_view( FGViewer * v );
- static const char* subsystemName() { return "view-mgr"; }
+ static const char* subsystemName() { return "view-manager"; }
private:
void do_bind();