]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIBase.hxx
Bertrand Coconnier:
[flightgear.git] / src / AIModel / AIBase.hxx
index 0bdd6f85b0711ae990ed42e6700de7668e540876..8840136dae3546c7a9143f7069e6578461433ef8 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <simgear/constants.h>
 #include <simgear/math/SGMath.hxx>
-#include <simgear/math/point3d.hxx>
 #include <simgear/scene/model/placement.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/structure/SGSharedPtr.hxx>
 #include <Main/fg_props.hxx>
 
 
-SG_USING_STD(string);
-SG_USING_STD(list);
+using std::string;
+using std::list;
 
+class SGMaterial;
 class FGAIManager;
 class FGAIFlightPlan;
 
-class FGAIBase : public SGReferenced {
+class FGAIBase : public osg::Referenced {
 
 public:
     enum object_type { otNull = 0, otAircraft, otShip, otCarrier, otBallistic,
-                       otRocket, otStorm, otThermal, otStatic, otWingman,
+                       otRocket, otStorm, otThermal, otStatic, otWingman, otGroundVehicle,
                        otMultiplayer,
                        MAX_OBJECTS };  // Needs to be last!!!
 
@@ -54,6 +54,7 @@ public:
     virtual void readFromScenario(SGPropertyNode* scFileNode);
 
     virtual bool init(bool search_in_AI_path=false);
+    virtual void initModel(osg::Node *node);
     virtual void update(double dt);
     virtual void bind();
     virtual void unbind();
@@ -93,6 +94,9 @@ public:
     SGVec3d getCartPosAt(const SGVec3d& off) const;
     SGVec3d getCartPos() const;
 
+    bool getGroundElevationM(const SGGeod& pos, double& elev,
+                             const SGMaterial** material) const;
+
     double _getCartPosX() const;
     double _getCartPosY() const;
     double _getCartPosZ() const;
@@ -191,6 +195,7 @@ protected:
 private:
     int _refID;
     object_type _otype;
+    bool _initialized;
 
 public:
     object_type getType();
@@ -266,11 +271,9 @@ public:
     inline double _getRange() { return range; };
     inline double _getBearing() { return bearing; };
 
-    osg::Node* load3DModel(const string& fg_root,
-                            const string &path,
-                            SGPropertyNode *prop_root,
-                            double sim_time_sec);
-
+    virtual osg::Node* load3DModel(const string &path,
+                           SGPropertyNode *prop_root);
     static bool _isNight();
 };