X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2Fsubmodel.hxx;h=7ca046f9dc0789f8334c3a572634772d7635ea15;hb=7e73a8788223c9c2af3c26435162e0667b412279;hp=7764a51509b5f5babeeb3c5e5cdc5f9645c25987;hpb=3233ce8a44b0d608d19bee809c23a38431d50e45;p=flightgear.git diff --git a/src/AIModel/submodel.hxx b/src/AIModel/submodel.hxx index 7764a5150..7ca046f9d 100644 --- a/src/AIModel/submodel.hxx +++ b/src/AIModel/submodel.hxx @@ -16,8 +16,12 @@ #include #include #include -SG_USING_STD(vector); -SG_USING_STD(string); + +#include
+ +using std::vector; +using std::string; +using std::list; class FGAIBase; @@ -26,8 +30,7 @@ class FGSubmodelMgr : public SGSubsystem public: - typedef struct - { + typedef struct { SGPropertyNode_ptr trigger_node; SGPropertyNode_ptr prop; SGPropertyNode_ptr contents_node; @@ -59,11 +62,18 @@ public: int id; bool no_roll; bool serviceable; - } - submodel; - - typedef struct - { + bool collision; + bool impact; + string impact_report; + double fuse_range; + string submodel; + int sub_id; + bool force_stabilised; + bool ext_force; + string force_path; + } submodel; + + typedef struct { double lat; double lon; double alt; @@ -82,8 +92,7 @@ public: double mass; int id; bool no_roll; - } - IC_struct; + } IC_struct; FGSubmodelMgr(); ~FGSubmodelMgr(); @@ -94,25 +103,24 @@ public: void bind(); void unbind(); void update(double dt); - bool release(submodel* sm, double dt); - void transform(submodel* sm); void updatelat(double lat); private: typedef vector submodel_vector_type; - typedef submodel_vector_type::const_iterator submodel_vector_iterator; + typedef submodel_vector_type::iterator submodel_vector_iterator; submodel_vector_type submodels; - submodel_vector_iterator submodel_iterator; + submodel_vector_type subsubmodels; + submodel_vector_iterator submodel_iterator, subsubmodel_iterator; float trans[3][3]; float in[3]; float out[3]; - double Rx, Ry, Rz; - double Sx, Sy, Sz; - double Tx, Ty, Tz; + //double Rx, Ry, Rz; + //double Sx, Sy, Sz; + //double Tx, Ty, Tz; float cosRx, sinRx; float cosRy, sinRy; @@ -126,10 +134,21 @@ private: double x_offset, y_offset, z_offset; double pitch_offset, yaw_offset; + double _parent_lat; + double _parent_lon; + double _parent_elev; + double _parent_hdg; + double _parent_pitch; + double _parent_roll; + double _parent_speed; + static const double lbs_to_slugs; //conversion factor double contrail_altitude; + bool _impact; + bool _hit; + SGPropertyNode_ptr _serviceable_node; SGPropertyNode_ptr _user_lat_node; SGPropertyNode_ptr _user_lon_node; @@ -147,21 +166,34 @@ private: SGPropertyNode_ptr _user_speed_north_fps_node; SGPropertyNode_ptr _contrail_altitude_node; SGPropertyNode_ptr _contrail_trigger; + SGPropertyNode_ptr _count_node; + SGPropertyNode_ptr _trigger_node; + SGPropertyNode_ptr props; FGAIManager* ai; IC_struct IC; // A list of pointers to AI objects - typedef list > sm_list_type; + typedef list > sm_list_type; typedef sm_list_type::iterator sm_list_iterator; typedef sm_list_type::const_iterator sm_list_const_iterator; sm_list_type sm_list; + void loadAI(); void loadSubmodels(); + void setData(int id, string& path, bool serviceable); + void setSubData(int id, string& path, bool serviceable); + void valueChanged (SGPropertyNode *); + void transform(submodel *); + + bool release(submodel *, double dt); + double getRange(double lat, double lon, double lat2, double lon2) const; + int _count; + }; #endif // __SYSTEMS_SUBMODEL_HXX