Ignore:
Timestamp:
Oct 17, 2010, 8:32:03 PM (14 years ago)
Author:
Torben Dannhauer
Message:

Silverlining integration updated on the road to Silverlining 2.0 compatibility

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/src/sky_Silverlining/visual_skySilverLining.cpp

    r133 r134  
    432432        if (isInitialized() && slot_ >= 0 && slot_ < MAX_CLOUDLAYER_SLOTS)
    433433        {
    434                 // Calculation earth radius on current lat lon position
    435                 double radius;
    436                 if ( util::calculateEarthRadiusAtWGS84Coordinate(lat, lon, sceneRoot, radius) )
    437                 {
    438                         OSG_NOTIFY(osg::ALWAYS) << "radius:" << radius << std::endl;
    439                         // generate Cloud Layer
    440                         SilverLining::CloudLayer *cloudLayer_;
    441                         cloudLayer_ = SilverLining::CloudLayerFactory::Create(cloudtype_);
    442                         cloudLayer_->SetBaseAltitude( baseHeight_ + radius);
    443                                                
    444                         cloudLayer_->SetThickness(thickness_);
    445                         cloudLayer_->SetBaseLength(baseLength_);
    446                         cloudLayer_->SetBaseWidth(baseWidth_);
    447                         cloudLayer_->SetDensity(density_);
    448                         cloudLayer_->SetLayerPosition( 0.0, 0.0 );
    449                         cloudLayer_->GenerateShadowMaps(false);
    450 
    451                         //Save cloudlayer information into SLOT
    452                         cloudLayerSlots[slot_].used = true;
    453                         cloudLayerSlots[slot_].enabled = true;
    454                         cloudLayerSlots[slot_].cloudLayerPointer = cloudLayer_;
    455                         switch(cloudtype_)
    456                         {
    457                         case 0: cloudLayerSlots[slot_].typeName = "CIRROCUMULUS";                               // High planar cloud puffs             
    458                                 break;
    459                         case 1: cloudLayerSlots[slot_].typeName = "CIRRUS_FIBRATUS";                    // High, thicker and fibrous clouds that signal changing weather
    460                         break;
    461                         case 2: cloudLayerSlots[slot_].typeName = "STRATUS";                                    // Low clouds represented as a slab
    462                         break;
    463                         case 3: cloudLayerSlots[slot_].typeName = "CUMULUS_MEDIOCRIS";          // Low, puffy clouds on fair days
    464                         break;
    465                         case 4: cloudLayerSlots[slot_].typeName = "CUMULUS_CONGESTUS";          // Large cumulus clouds that could turn into a thunderhead
    466                         break;
    467                         case 5: cloudLayerSlots[slot_].typeName = "CUMULONIMBUS_CAPPILATUS";    // Big storm clouds.
    468                         break;
    469                         case 6: cloudLayerSlots[slot_].typeName = "STRATOCUMULUS";                              // Low, dense, puffy clouds with some sun breaks between them.
    470                                 break;
    471                         default: OSG_NOTIFY( osg::FATAL ) << "visual_skySilverlining::addCloudLayer - Invalid cloud type." << std::cout;
    472                                  break;
    473                         };
     434                // create cloudlayer order and pass to skyDrawable to instantiate.
     435                cloudlayerOrder newCL;
     436                newCL.slot = slot_;
     437                newCL.lat = lat;
     438                newCL.lon = lon;
     439                newCL.baseLength = baseLength_;
     440                newCL.baseWidth = baseWidth_;
     441                newCL.thickness = thickness_;
     442                newCL.baseHeight = baseHeight_;
     443                newCL.density = density_;
     444                newCL.cloudtype = cloudtype_;
     445                newCL.assocCloudLayerSlot = &cloudLayerSlots[slot_];
    474446               
    475                         // Pass cloudlayer for seeding and adding to sky framework to the render thread
    476                         skyDrawable->addCloudLayer( &cloudLayerSlots[slot_] );
    477                 } // If valid radius END
     447                skyDrawable->addCloudLayerOrder( newCL );
     448
    478449        }        // If isInitialized() END
    479450}
Note: See TracChangeset for help on using the changeset viewer.