#include <AIModel/AIBase.hxx>
#include <vector>
#include <string>
+
+#include <Main/fg_props.hxx>
+
SG_USING_STD(vector);
SG_USING_STD(string);
+SG_USING_STD(list);
class FGAIBase;
public:
- typedef struct
- {
+ typedef struct {
SGPropertyNode_ptr trigger_node;
SGPropertyNode_ptr prop;
SGPropertyNode_ptr contents_node;
int id;
bool no_roll;
bool serviceable;
+ bool collision;
bool impact;
- string impact_reports;
- }
- submodel;
+ string impact_report;
+ double fuse_range;
+ string submodel;
+ int sub_id;
+ } submodel;
- typedef struct
- {
+ typedef struct {
double lat;
double lon;
double alt;
double mass;
int id;
bool no_roll;
- bool impact;
- }
- IC_struct;
+ } IC_struct;
FGSubmodelMgr();
~FGSubmodelMgr();
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*> 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];
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;
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;
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