#define _SG_USERDATA_HXX
#include <simgear/compiler.h>
+#include <simgear/math/sg_random.h>
-#include STL_STRING
+#include <osg/Node>
-#include <plib/sg.h>
-
-#include <osg/Referenced>
-#include <osg/Geometry>
-#include <osg/Group>
-
-SG_USING_STD(string);
-
-class SGMaterial;
class SGMatModel;
-class SGMatModelGroup;
-class SGModelLib;
class SGPropertyNode;
-
/**
* the application must call sgUserDataInit() and specify the
* following values (needed by the model loader callback at draw time)
* before drawing any scenery.
*/
-void sgUserDataInit( SGModelLib *m, const string &r,
- SGPropertyNode *p, double t );
-
+void sgUserDataInit(SGPropertyNode *p);
/**
- * User data for populating leaves when they come in range.
+ * Get a random model.
*/
-class SGLeafUserData : public osg::Referenced
-{
-public:
- bool is_filled_in;
- osg::Geometry *leaf;
- SGMaterial *mat;
- osg::Group *branch;
- float sin_lat;
- float cos_lat;
- float sin_lon;
- float cos_lon;
-
- void setup_triangle( int i );
-};
-
+osg::Node* sgGetRandomModel(SGMatModel *obj, mt seed);
+namespace simgear
+{
/**
- * User data for populating triangles when they come in range.
+ * Get the property root for the simulation
*/
-class SGTriUserData : public osg::Referenced
-{
-public:
- bool is_filled_in;
- float * p1;
- float * p2;
- float * p3;
- osg::Vec3 center;
- double area;
- SGMatModelGroup * object_group;
- osg::Group * branch;
- SGLeafUserData * leafData;
- unsigned int seed;
-
- void fill_in_triangle();
- void add_object_to_triangle(SGMatModel * object);
- void makeWorldMatrix (sgMat4 ROT, double hdg_deg );
-};
+SGPropertyNode* getPropertyRoot();
+}
#endif // _SG_USERDATA_HXX