]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/model.hxx
Improved tile cache priority scheme.
[simgear.git] / simgear / scene / model / model.hxx
index 238b385c7fff73f6dbf8edce4e31009d171b558b..c2097fdcd52930cab553b80cd5cae13b53cc4ea7 100644 (file)
 #include <osgDB/ReaderWriter>
 
 #include <simgear/misc/sg_path.hxx>
+#include <simgear/props/props.hxx>
 #include <simgear/scene/util/NodeAndDrawableVisitor.hxx>
 
+namespace simgear
+{
+class SGReaderWriterXMLOptions;
+}
+
 osg::Texture2D*
 SGLoadTexture2D(bool staticTexture, const std::string& path,
                 const osgDB::ReaderWriter::Options* options = 0,
@@ -86,5 +92,33 @@ public:
     virtual void apply(osg::Node& node);
 };
 
+/**
+ * Transform an OSG subgraph by substituting Effects and EffectGeodes
+ * for osg::Geodes with osg::StateSets. This is only guaranteed to
+ * work for models prouced by the .ac loader.
+ *
+ * returns a copy if any nodes are changed
+ */
+osg::ref_ptr<osg::Node>
+instantiateEffects(osg::Node* model,
+                   PropertyList& effectProps,
+                   const SGReaderWriterXMLOptions* options);
+
+/**
+ * Transform an OSG subgraph by substituting the Effects and
+ * EffectGeodes for osg::Geodes with osg::StateSets, inheriting from
+ * the default model effect. This is only guaranteed to work for
+ * models prouced by the .ac loader.
+ *
+ * returns a copy if any nodes are changed
+ */
+
+inline osg::ref_ptr<osg::Node>
+instantiateEffects(osg::Node* model,
+                   const SGReaderWriterXMLOptions* options)
+{
+    PropertyList effectProps;
+    return instantiateEffects(model, effectProps, options);
+}
 }
 #endif // __MODEL_HXX