]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/modellib.hxx
Work around apparent OSG 3.2.0 normal binding bug.
[simgear.git] / simgear / scene / model / modellib.hxx
index 61091085f057900063b796ea3af929ed1153583e..7e8a5a8ed56ba675ad3c8d6c0ad0fa6a4065d3d7 100644 (file)
@@ -46,6 +46,8 @@ public:
 
     static void init(const std::string &root_dir, SGPropertyNode* root);
 
+    static void resetPropertyRoot();
+    
     static void setPanelFunc(panel_func pf);
     
     // Load a 3D model (any format)
@@ -55,17 +57,23 @@ public:
                                 SGModelData *data=0, bool load2DPanels=false);
 
     // Load a 3D model (any format) through the DatabasePager.
-    // Most models should be loaded using this function!
-    // This function will initially return an SGPagedLOD node.
-    // data->modelLoaded() will be called after the model is loaded and
-    // connected to the scene graph. See AIModelData on how to use this.
-    // NOTE: AIModelData uses observer_ptr to avoid circular references.
+    // This function initially just returns a proxy node that refers to
+    // the model file. Once the viewer steps onto that node the
+    // model will be loaded.
+    static osg::Node* loadDeferredModel(const std::string &path,
+                                        SGPropertyNode *prop_root = NULL,
+                                        SGModelData *data=0);
+    // Load a 3D model (any format) through the DatabasePager.
+    // This function initially just returns a PagedLOD node that refers to
+    // the model file. Once the viewer steps onto that node the
+    // model will be loaded. When the viewer does no longer reference this
+    // node for a long time the node is unloaded again.
     static osg::Node* loadPagedModel(const std::string &path,
                                      SGPropertyNode *prop_root = NULL,
                                      SGModelData *data=0);
 
     static std::string findDataFile(const std::string& file, 
-      const osgDB::ReaderWriter::Options* opts = NULL,
+      const osgDB::Options* opts = NULL,
       SGPath currentDir = SGPath()); 
 protected:
     SGModelLib();
@@ -87,6 +95,7 @@ public:
     virtual ~SGModelData() {}
     virtual void modelLoaded(const std::string& path, SGPropertyNode *prop,
                              osg::Node* branch) = 0;
+    virtual SGModelData* clone() const = 0;
 };
 
 }