]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/persparam.hxx
Modified Files:
[simgear.git] / simgear / scene / model / persparam.hxx
index 4ee014b6465c85c1080d27a717b22764a7b2c637..776e0c9c7bbb45f4889c7a497d5b5cbb098de909 100755 (executable)
@@ -5,6 +5,9 @@
 #ifndef _SG_PERSPARAM_HXX
 #define _SG_PERSPARAM_HXX 1
 
+#include <simgear/math/sg_random.h>
+
+
 template <class T>
 class SGPersonalityParameter {
 public:
@@ -14,8 +17,8 @@ public:
     if ( node != 0 ) {
       SGPropertyNode_ptr rand_n = node->getNode( "random" );
       if ( rand_n != 0 ) {
-        _min = rand_n->getDoubleValue( "min", 0.0 );
-        _max = rand_n->getDoubleValue( "max", 1.0 );
+        _min = getNodeValue( rand_n, "min", (T)0 );
+        _max = getNodeValue( rand_n, "max", (T)1 );
         shuffle();
       } else {
         _var = _min = _max = getNodeValue( props, name, defval );
@@ -36,4 +39,10 @@ private:
   T _max;
 };
 
+template <> double
+SGPersonalityParameter<double>::getNodeValue( SGPropertyNode *props,
+                                              const char *name,
+                                              double defval ) const;
+
 #endif // _SG_PERSPARAM_HXX
+