#include <Scenery/scenery.hxx>
#include "model.hxx"
+#include "panelnode.hxx"
\f
modelpath = modelpath.dir();
modelpath.append(props.getStringValue("/path"));
} else {
- throw sg_exception("No path for model");
+ if (_model == 0)
+ _model = new ssgBranch;
}
}
// Assume that textures are in
// the same location as the XML file.
- ssgTexturePath((char *)xmlpath.dir().c_str());
- _model = (ssgBranch *)ssgLoad((char *)modelpath.c_str());
- if (_model == 0)
- throw sg_exception("Failed to load 3D model");
+ if (_model == 0) {
+ ssgTexturePath((char *)xmlpath.dir().c_str());
+ _model = (ssgBranch *)ssgLoad((char *)modelpath.c_str());
+ if (_model == 0)
+ throw sg_exception("Failed to load 3D model");
+ }
// Set up the alignment node
ssgTransform * align = new ssgTransform;
}
}
+ // Load panels
+ vector<SGPropertyNode_ptr> panel_nodes = props.getChildren("panel");
+ for (i = 0; i < panel_nodes.size(); i++) {
+ printf("Reading a panel in model.cxx\n");
+ FGPanelNode * panel = new FGPanelNode(panel_nodes[i]);
+ _model->addKid(panel);
+ }
+
// Load sub-models
vector<SGPropertyNode_ptr> model_nodes = props.getChildren("model");
for (i = 0; i < model_nodes.size(); i++) {