- SGVec3d center = obj.get_gbs_center2();
- SGGeod geodPos = SGGeod::fromCart(center);
- SGQuatd hlOr = SGQuatd::fromLonLat(geodPos);
- SGVec3f up = toVec3f(hlOr.backTransform(SGVec3d(0, 0, -1)));
-
- osg::Group* vasiLights = new osg::Group;
- vasiLights->setCullCallback(new SGPointSpriteLightCullCallback(osg::Vec3(1, 0.0001, 0.000001), 6));
- osg::StateSet* stateSet = vasiLights->getOrCreateStateSet();
- osg::Fog* fog = new osg::Fog;
- fog->setUpdateCallback(new SGRunwayLightFogUpdateCallback);
- stateSet->setAttribute(fog);
-
- osg::Group* rwyLights = new osg::Group;
- rwyLights->setCullCallback(new SGPointSpriteLightCullCallback);
- stateSet = rwyLights->getOrCreateStateSet();
- fog = new osg::Fog;
- fog->setUpdateCallback(new SGRunwayLightFogUpdateCallback);
- stateSet->setAttribute(fog);
-
- osg::Group* taxiLights = new osg::Group;
- taxiLights->setCullCallback(new SGPointSpriteLightCullCallback);
- stateSet = taxiLights->getOrCreateStateSet();
- fog = new osg::Fog;
- fog->setUpdateCallback(new SGTaxiLightFogUpdateCallback);
- stateSet->setAttribute(fog);
-
- osg::Group* groundLights0 = new osg::Group;
- stateSet = groundLights0->getOrCreateStateSet();
- fog = new osg::Fog;
- fog->setUpdateCallback(new SGGroundLightFogUpdateCallback);
- stateSet->setAttribute(fog);
-
- osg::Group* groundLights1 = new osg::Group;
- stateSet = groundLights1->getOrCreateStateSet();
- fog = new osg::Fog;
- fog->setUpdateCallback(new SGGroundLightFogUpdateCallback);
- stateSet->setAttribute(fog);
-
- osg::Group* groundLights2 = new osg::Group;
- stateSet = groundLights2->getOrCreateStateSet();
- fog = new osg::Fog;
- fog->setUpdateCallback(new SGGroundLightFogUpdateCallback);
- stateSet->setAttribute(fog);
-
- osg::Switch* lightSwitch = new osg::Switch;
- lightSwitch->setUpdateCallback(new SGTileUpdateCallback);
- lightSwitch->addChild(vasiLights, true);
- lightSwitch->addChild(rwyLights, true);
- lightSwitch->addChild(taxiLights, true);
- lightSwitch->addChild(groundLights0, true);
- lightSwitch->addChild(groundLights1, true);
- lightSwitch->addChild(groundLights2, true);
-
- osg::Group* lightGroup = new SGOffsetTransform(0.94);
- lightGroup->addChild(lightSwitch);
-
- osg::LOD* lightLOD = new osg::LOD;
- lightLOD->addChild(lightGroup, 0, 30000);
- unsigned nodeMask = ~0u;
- nodeMask &= ~SG_NODEMASK_CASTSHADOW_BIT;
- nodeMask &= ~SG_NODEMASK_RECIEVESHADOW_BIT;
- nodeMask &= ~SG_NODEMASK_PICK_BIT;
- nodeMask &= ~SG_NODEMASK_TERRAIN_BIT;
- lightLOD->setNodeMask(nodeMask);