]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/tgdb/userdata.cxx
hla: Provide a directly property based api for property data element.
[simgear.git] / simgear / scene / tgdb / userdata.cxx
index 5413c8df0608aedd2be7b3fedce876527b945801..bf5823c99dba7b0bb28b1066f8e5387e694d05a3 100644 (file)
@@ -28,7 +28,6 @@
 #include <osgDB/Registry>
 
 #include <simgear/sg_inlines.h>
-#include <simgear/math/point3d.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/math/sg_random.h>
 #include <simgear/scene/material/mat.hxx>
@@ -60,27 +59,14 @@ void sgUserDataInit( SGPropertyNode *p ) {
     root_props = p;
 }
 
- osg::Node* sgGetRandomModel(SGMatModel *obj) {
-   return obj->get_random_model( root_props );
+osg::Node* sgGetRandomModel(SGMatModel *obj, mt seed) {
+   return obj->get_random_model( root_props, seed );
  }
 
-osg::Node* sgGetModel(int i, SGMatModel *obj) {
-   return obj->get_model(i, root_props );
- }
-
-static void random_pt_inside_tri( float *res,
-                                  float *n1, float *n2, float *n3 )
+namespace simgear
 {
-    double a = sg_random();
-    double b = sg_random();
-    if ( a + b > 1.0 ) {
-        a = 1.0 - a;
-        b = 1.0 - b;
-    }
-    double c = 1 - a - b;
-
-    res[0] = n1[0]*a + n2[0]*b + n3[0]*c;
-    res[1] = n1[1]*a + n2[1]*b + n3[1]*c;
-    res[2] = n1[2]*a + n2[2]*b + n3[2]*c;
+SGPropertyNode* getPropertyRoot()
+{
+    return root_props;
+}
 }
-