Split up model[] into ship[], aircraft[], ballistic[] and model[] (for unspecified models).
This commit is contained in:
parent
298f53edef
commit
2d7a6e475d
5 changed files with 8 additions and 2 deletions
|
@ -51,6 +51,7 @@ FGAIAircraft::FGAIAircraft() {
|
||||||
// set heading and altitude locks
|
// set heading and altitude locks
|
||||||
hdg_lock = false;
|
hdg_lock = false;
|
||||||
alt_lock = false;
|
alt_lock = false;
|
||||||
|
_type_str = "aircraft";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
|
|
||||||
FGAIBallistic::FGAIBallistic() {
|
FGAIBallistic::FGAIBallistic() {
|
||||||
|
_type_str = "ballistic";
|
||||||
}
|
}
|
||||||
|
|
||||||
FGAIBallistic::~FGAIBallistic() {
|
FGAIBallistic::~FGAIBallistic() {
|
||||||
|
|
|
@ -46,6 +46,7 @@ FGAIBase *FGAIBase::_self = NULL;
|
||||||
|
|
||||||
FGAIBase::FGAIBase() {
|
FGAIBase::FGAIBase() {
|
||||||
_self = this;
|
_self = this;
|
||||||
|
_type_str = "model";
|
||||||
}
|
}
|
||||||
|
|
||||||
FGAIBase::~FGAIBase() {
|
FGAIBase::~FGAIBase() {
|
||||||
|
@ -66,11 +67,11 @@ void FGAIBase::Transform() {
|
||||||
bool FGAIBase::init() {
|
bool FGAIBase::init() {
|
||||||
|
|
||||||
SGPropertyNode *root = globals->get_props()->getNode("ai/modeles", true);
|
SGPropertyNode *root = globals->get_props()->getNode("ai/modeles", true);
|
||||||
vector<SGPropertyNode_ptr> p_vec = root->getChildren("model");
|
vector<SGPropertyNode_ptr> p_vec = root->getChildren(_type_str);
|
||||||
unsigned num = p_vec.size();
|
unsigned num = p_vec.size();
|
||||||
p_vec.clear();
|
p_vec.clear();
|
||||||
|
|
||||||
props = root->getNode("model", num, true);
|
props = root->getNode(_type_str, num, true);
|
||||||
ssgBranch *model = sgLoad3DModel( globals->get_fg_root(),
|
ssgBranch *model = sgLoad3DModel( globals->get_fg_root(),
|
||||||
model_path.c_str(),
|
model_path.c_str(),
|
||||||
props,
|
props,
|
||||||
|
|
|
@ -78,6 +78,7 @@ protected:
|
||||||
void Transform();
|
void Transform();
|
||||||
|
|
||||||
static FGAIBase *_self;
|
static FGAIBase *_self;
|
||||||
|
const char *_type_str;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -85,6 +86,7 @@ private:
|
||||||
static void _setLatitude ( double latitude );
|
static void _setLatitude ( double latitude );
|
||||||
static double _getLongitude();
|
static double _getLongitude();
|
||||||
static double _getLatitude ();
|
static double _getLatitude ();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
FGAIShip::FGAIShip() {
|
FGAIShip::FGAIShip() {
|
||||||
hdg_lock = false;
|
hdg_lock = false;
|
||||||
rudder = 0.0;
|
rudder = 0.0;
|
||||||
|
_type_str = "ship";
|
||||||
}
|
}
|
||||||
|
|
||||||
FGAIShip::~FGAIShip() {
|
FGAIShip::~FGAIShip() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue