Andy Ross wrote:
Erik Hofman wrote:

I've put the current code, slightly modified on one or two places,
into CVS. The next step would be adding support for NASAL scripts to
controll the vehicles and after that we need some code the add dynamic
objects to scenery locations to make it possible for ferries to cross
the channel (or something like that).


I'd love to play with the AI stuff and see now Nasal fits in.  But
I've been kinda ignoring it so far. :) Is there a quickie tutorial or
something (or even a mailing list message that I missed) that you can
point me to?

Right now models are added by adding an <ai> section to the <sim> section in preferences.xml like:


  <ai>
   <enabled type="bool">true</enabled>

   <entry>
    <type>ship</type>
    <path>Models/Geometry/saratoga.xml</path>
    <speed-KTAS type="double">30.0</speed-KTAS>
    <altitude-ft type="double">0.0</altitude-ft>
    <longitude type="double">-122.33333</longitude>
    <latitude type="double">37.61667</latitude>
    <heading type="double">20.0</heading>
   </entry>
  </ai>

This will add a moving saratoga carrier in the bay area.
There are a number of functions to influence the behavior of the model (see AIBase.hxx in FlightGear/src/AIModel):


    void setSpeed( double speed_KTAS );
    void setAltitude( double altitude_ft );
    void setLongitude( double longitude );
    void setLatitude( double latitude );
    void setHeading( double heading );

And for aircraft models the following functions are alos available (see AIAircraft.hxx):

    void SetPerformance(PERF_STRUCT ps);
    void AccelTo(double speed);
    void PitchTo(double angle);
    void RollTo(double angle);
    void YawTo(double angle);
    void ClimbTo(double altitude);
    void TurnTo(double heading);

There are also special functions for ships (see AIShip.hxx) and balistic objects (see AIBallistic.hxx).

We might need another function to dynamically add new AI driver models.

Erik



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

Reply via email to