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
|
||||
hdg_lock = false;
|
||||
alt_lock = false;
|
||||
_type_str = "aircraft";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
|
||||
FGAIBallistic::FGAIBallistic() {
|
||||
_type_str = "ballistic";
|
||||
}
|
||||
|
||||
FGAIBallistic::~FGAIBallistic() {
|
||||
|
|
|
@ -46,6 +46,7 @@ FGAIBase *FGAIBase::_self = NULL;
|
|||
|
||||
FGAIBase::FGAIBase() {
|
||||
_self = this;
|
||||
_type_str = "model";
|
||||
}
|
||||
|
||||
FGAIBase::~FGAIBase() {
|
||||
|
@ -66,11 +67,11 @@ void FGAIBase::Transform() {
|
|||
bool FGAIBase::init() {
|
||||
|
||||
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();
|
||||
p_vec.clear();
|
||||
|
||||
props = root->getNode("model", num, true);
|
||||
props = root->getNode(_type_str, num, true);
|
||||
ssgBranch *model = sgLoad3DModel( globals->get_fg_root(),
|
||||
model_path.c_str(),
|
||||
props,
|
||||
|
|
|
@ -78,6 +78,7 @@ protected:
|
|||
void Transform();
|
||||
|
||||
static FGAIBase *_self;
|
||||
const char *_type_str;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -85,6 +86,7 @@ private:
|
|||
static void _setLatitude ( double latitude );
|
||||
static double _getLongitude();
|
||||
static double _getLatitude ();
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
FGAIShip::FGAIShip() {
|
||||
hdg_lock = false;
|
||||
rudder = 0.0;
|
||||
_type_str = "ship";
|
||||
}
|
||||
|
||||
FGAIShip::~FGAIShip() {
|
||||
|
|
Loading…
Add table
Reference in a new issue