]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/material/matmodel.hxx
Random buildings - initial commit.
[simgear.git] / simgear / scene / material / matmodel.hxx
index 982e89a95293015d6183071865df50ce5309d7ba..1687302e26bbe3c150c863ebf86855537f6abe94 100644 (file)
@@ -30,7 +30,8 @@
 
 #include <simgear/compiler.h>
 
-#include STL_STRING      // Standard C++ string library
+#include <string>      // Standard C++ string library
+#include <vector>
 
 #include <osg/ref_ptr>
 #include <osg/Node>
 #include <simgear/props/props.hxx>
 #include <simgear/math/sg_random.h>
 
-SG_USING_STD(string);
-
 
 class SGMatModelGroup;
-class SGModelLib;
 
 
 /**
@@ -68,7 +66,8 @@ public:
     enum HeadingType {
         HEADING_FIXED,
         HEADING_BILLBOARD,
-        HEADING_RANDOM
+        HEADING_RANDOM,
+        HEADING_MASK
     };
 
     /**
@@ -76,23 +75,7 @@ public:
      *
      * @return The number of variant models.
      */
-    int get_model_count( SGModelLib *modellib,
-                         const string &fg_root,
-                         SGPropertyNode *prop_root,
-                         double sim_time_sec );
-
-
-    /**
-     * Get a specific variant model for the object.
-     *
-     * @param index The index of the model.
-     * @return The model.
-     */
-     osg::Node *get_model( int index,
-                          SGModelLib *modellib,
-                          const string &fg_root,
-                          SGPropertyNode *prop_root,
-                          double sim_time_sec );
+    int get_model_count( SGPropertyNode *prop_root );
 
 
     /**
@@ -100,10 +83,7 @@ public:
      *
      * @return A randomly select model from the variants.
      */
-    osg::Node *get_random_model( SGModelLib *modellib,
-                                 const string &fg_root,
-                                 SGPropertyNode *prop_root,
-                                 double sim_time_sec );
+    osg::Node *get_random_model( SGPropertyNode *prop_root, mt *seed );
 
 
     /**
@@ -119,6 +99,15 @@ public:
      * @return The visual range.
      */
     double get_range_m () const;
+
+    /**
+     * Get the minimum spacing between this and any
+     * other objects in m
+     *
+     * @return The spacing in m.
+     */
+    double get_spacing_m () const;
+    
     
     /**
      * Get a randomized visual range
@@ -151,15 +140,13 @@ private:
      * This class uses lazy loading so that models won't be held
      * in memory for materials that are never referenced.
      */
-    void load_models( SGModelLib *modellib,
-                      const string &fg_root,
-                      SGPropertyNode *prop_root,
-                      double sim_time_sec );
+    void load_models( SGPropertyNode *prop_root );
 
-    vector<string> _paths;
-    mutable vector<osg::ref_ptr<osg::Node> > _models;
+    std::vector<std::string> _paths;
+    mutable std::vector<osg::ref_ptr<osg::Node> > _models;
     mutable bool _models_loaded;
     double _coverage_m2;
+    double _spacing_m;
     double _range_m;
     HeadingType _heading_type;
 };
@@ -213,7 +200,7 @@ protected:
 private:
 
     double _range_m;
-    vector<SGSharedPtr<SGMatModel> > _objects;
+    std::vector<SGSharedPtr<SGMatModel> > _objects;
 };
 
 #endif // _SG_MAT_MODEL_HXX