]> git.mxchange.org Git - simgear.git/commitdiff
pt_lights: add some randomness to the blinking interval of the hold short lights
authorChristian Schmitt <chris@ilovelinux.de>
Fri, 14 Sep 2012 08:14:31 +0000 (10:14 +0200)
committerChristian Schmitt <chris@ilovelinux.de>
Fri, 14 Sep 2012 08:14:31 +0000 (10:14 +0200)
simgear/scene/tgdb/pt_lights.cxx

index 925d3e20b85118dd5c8ec1fbb362158724a06a92..c6dd87c65701a985dafc149154513f260edf796b 100644 (file)
@@ -548,7 +548,8 @@ SGLightFactory::getHoldShort(const SGDirectionalLightBin& lights)
   if (lights.getNumLights() < 2)
     return 0;
 
   if (lights.getNumLights() < 2)
     return 0;
 
-  float flashTime = 2;
+  sg_srandom(unsigned(lights.getLight(0).position[0]));
+  float flashTime = 2 + 0.1 * sg_random();
   osg::Sequence* sequence = new osg::Sequence;
   sequence->setDefaultTime(flashTime);
   Effect* effect = getLightEffect(6, osg::Vec3(1, 0.001, 0.000002),
   osg::Sequence* sequence = new osg::Sequence;
   sequence->setDefaultTime(flashTime);
   Effect* effect = getLightEffect(6, osg::Vec3(1, 0.001, 0.000002),