//
// This file is in the Public Domain, and comes with no warranty.
+#include <simgear/compiler.h>
+
+#include <vector>
+
#include <plib/ssg.h>
+#include <simgear/scene/model/placement.hxx>
+#include <simgear/scene/model/model.hxx>
+
#include <Main/fg_props.hxx>
#include <Scenery/scenery.hxx>
+
#include "modelmgr.hxx"
-#include "model.hxx"
+
+SG_USING_STD(vector);
FGModelMgr::FGModelMgr ()
SG_LOG(SG_GENERAL, SG_INFO,
"Adding model " << node->getStringValue("name", "[unnamed]"));
Instance * instance = new Instance;
- FGModelPlacement * model = new FGModelPlacement;
+ SGModelPlacement *model = new SGModelPlacement;
instance->model = model;
- model->init( globals->get_fg_root(),
- node->getStringValue("path", "Models/Geometry/glider.ac"),
- globals->get_props(),
- globals->get_sim_time_sec() );
+ ssgBranch *object
+ = sgLoad3DModel( globals->get_fg_root(),
+ node->getStringValue("path",
+ "Models/Geometry/glider.ac"),
+ globals->get_props(),
+ globals->get_sim_time_sec() );
+ model->init( object );
// Set position and orientation either
// indirectly through property refs
{
for (unsigned int i = 0; i < _instances.size(); i++) {
Instance * instance = _instances[i];
- FGModelPlacement * model = instance->model;
+ SGModelPlacement * model = instance->model;
// Optionally set position from properties
if (instance->lon_deg_node != 0)