Jim Wilson writes:

 > On second thought why don't we go with what you are doing for the
 > time being.  I think I can get by with my view manager and viewer
 > changes as long as your model code is independent of the viewer and
 > the view manager.  Then if you want to go with the model
 > position/orientation config that I described in the previous
 > message, I can add that next week to the model and viewmanager
 > code.

Sounds good.  I'll check in my changes, then, as soon as they're
working.

While we're talking about refactoring, I think that it might be time
to consider creating something like an FGLocus class, to keep track of
a single location.  Its interface would look a lot like the viewer's:

  class FGLocus
  {
  public:
    FGLocus ();
    virtual ~FGLocus ();

    virtual double getLongitudeDeg () const;
    virtual double getLatitudeDeg () const;
    virtual double getAltitudeFt () const;

    virtual void setPosition (double lon_deg, double lat_deg, double alt_ft);

    virtual double getRollDeg () const;
    virtual double getPitchDeg () const;
    virtual double getHeadingDeg () const;

    virtual void setOrientation (double roll_deg, double pitch_deg,
                                 double heading_deg);

    virtual const sgMAT4 &getTransformMatrix () const;
 
  };

I can create an instance of this for everything I want to place in
FlightGear (a viewpoint, a 3D model, scenery, etc.) and all the
transformation code is in one place, so Norm can easily optimize it.
We could also add XYZ/RPH offsets, as with the viewer.

Most of the work of creating this class would just be cutting and
pasting from your current viewer class.  What do you think?  There's a
lot of duplicate code right now doing exactly this including code in
the new FG3DModel class I'm about to check in, and it would be nice to
purge it.


All the best,


David

-- 
David Megginson
[EMAIL PROTECTED]

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to