SGDirectionalLightListBin rabitLights;
SGLightListBin odalLights;
SGDirectionalLightListBin holdshortLights;
+ SGDirectionalLightListBin guardLights;
SGDirectionalLightListBin reilLights;
SGMatModelBin randomModels;
SGBuildingBinList randomBuildings;
addPointGeometry(holdshortLights.back(), obj.get_wgs84_nodes(),
obj.get_normals(), color, obj.get_pts_v()[grp],
obj.get_pts_n()[grp]);
+ } else if (materialName == "RWY_GUARD_LIGHTS") {
+ guardLights.push_back(SGDirectionalLightBin());
+ addPointGeometry(guardLights.back(), obj.get_wgs84_nodes(),
+ obj.get_normals(), color, obj.get_pts_v()[grp],
+ obj.get_pts_n()[grp]);
} else if (materialName == "RWY_REIL_LIGHTS") {
reilLights.push_back(SGDirectionalLightBin());
addPointGeometry(reilLights.back(), obj.get_wgs84_nodes(),
|| !tileGeometryBin.rabitLights.empty()
|| !tileGeometryBin.reilLights.empty()
|| !tileGeometryBin.odalLights.empty()
- || !tileGeometryBin.holdshortLights.empty()) {
+ || !tileGeometryBin.holdshortLights.empty()
+ || !tileGeometryBin.guardLights.empty()) {
osg::Group* rwyLights = new osg::Group;
rwyLights->setStateSet(lightManager->getRunwayLightStateSet());
rwyLights->setNodeMask(RUNWAYLIGHTS_BIT);
i != tileGeometryBin.holdshortLights.end(); ++i) {
rwyLights->addChild(SGLightFactory::getHoldShort(*i));
}
+ for (i = tileGeometryBin.guardLights.begin();
+ i != tileGeometryBin.guardLights.end(); ++i) {
+ rwyLights->addChild(SGLightFactory::getGuard(*i));
+ }
SGLightListBin::const_iterator j;
for (j = tileGeometryBin.odalLights.begin();
j != tileGeometryBin.odalLights.end(); ++j) {
return 0;
sg_srandom(unsigned(lights.getLight(0).position[0]));
- float flashTime = 2 + 0.1 * sg_random();
+ float flashTime = 1 + 0.1 * sg_random();
osg::Sequence* sequence = new osg::Sequence;
// start with lights off
// ...and increase the lights in steps
for (int i = 2; i < 7; i+=2) {
Effect* effect = getLightEffect(i, osg::Vec3(1, 0.001, 0.000002),
- 0, i, true);
+ 0.0f, i, true);
EffectGeode* egeode = new EffectGeode;
for (unsigned int j = 0; j < lights.getNumLights(); ++j) {
egeode->addDrawable(getLightDrawable(lights.getLight(j)));
return sequence;
}
+
+// Alternating runway guard lights ("wig-wag")
+osg::Node*
+SGLightFactory::getGuard(const SGDirectionalLightBin& lights)
+{
+ if (lights.getNumLights() < 2)
+ return 0;
+
+ // generate a repeatable random seed
+ sg_srandom(unsigned(lights.getLight(0).position[0]));
+ float flashTime = 1.0f + 1*sg_random();
+ osg::Sequence* sequence = new osg::Sequence;
+ sequence->setDefaultTime(flashTime);
+ Effect* effect = getLightEffect(10.0f, osg::Vec3(1.0, 0.001, 0.000002),
+ 0.0f, 8.0f, true);
+ for (unsigned int i = 0; i < lights.getNumLights(); ++i) {
+ EffectGeode* egeode = new EffectGeode;
+ egeode->setEffect(effect);
+ egeode->addDrawable(getLightDrawable(lights.getLight(i)));
+ sequence->addChild(egeode, flashTime);
+ }
+ sequence->setInterval(osg::Sequence::LOOP, 0, -1);
+ sequence->setDuration(1.0f, -1);
+ sequence->setMode(osg::Sequence::START);
+ sequence->setSync(true);
+ return sequence;
+}