Ignore:
Timestamp:
Jan 7, 2011, 12:05:14 PM (14 years ago)
Author:
Torben Dannhauer
Message:

Adapted Sky_Silverlining to be aware of the XML configuration. The sky can now be disabled by XML configuration.

All calls to sky must be wrapped with if(sky.valid()) { ...} to ensure that it is only called when available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/src/core/visual_core.cpp

    r175 r182  
    7777#ifdef USE_SKY_SILVERLINING
    7878        // Initialize sky
    79         sky = new visual_skySilverLining( viewer, configFilename );
    80         sky->init(distortedSceneGraph, rootNode);       // Without distortion: distortedSceneGraph=NULL
     79        bool disabled = false;  // to ask if the skyp is disabled or enabled
     80        sky = new visual_skySilverLining( viewer, configFilename, disabled );
     81        if(disabled)
     82                sky = NULL;
     83        if(sky.valid())
     84                sky->init(distortedSceneGraph, rootNode);       // Without distortion: distortedSceneGraph=NULL
    8185#endif
    8286
     
    404408{
    405409
    406         // Sky settings:       
    407         sky->setTime(15,30,00);
    408         sky->setVisibility(50000);
    409         sky->addWindVolume( 0.0, 15000.0, 25.0, 90.0 );
    410        
    411         //sky->addCloudLayer( 0, 20000, 20000, 600.0, 1000.0, 0.5, CUMULONIMBUS_CAPPILATUS );
    412         //sky->addCloudLayer( 1, 5000000, 5000000, 600.0, 7351.0, 0.2, CIRRUS_FIBRATUS );
    413         //sky->addCloudLayer( 2, 50000, 50000, 600.0, 7351.0, 0.2, CIRROCUMULUS );
    414         ///sky->addCloudLayer( 2, 100000, 100000, 600.0, 2351.0, 0.75, STRATUS );
    415         sky->addCloudLayer( 3, 50000, 50000, 1300.0, 700.0, 0.07, CUMULUS_CONGESTUS );
    416         //sky->addCloudLayer( 1, 100000, 100000, 3500.0, 2000.0, 0.30, STRATOCUMULUS );
    417 
    418         //sky->setSlotPrecipitation( 1, 0.0, 0.0, 0.0, 25.0 );
     410        // Sky settings:
     411        if(sky.valid())
     412        {
     413                sky->setTime(15,30,00);
     414                sky->setVisibility(50000);
     415                sky->addWindVolume( 0.0, 15000.0, 25.0, 90.0 );
     416               
     417                //sky->addCloudLayer( 0, 20000, 20000, 600.0, 1000.0, 0.5, CUMULONIMBUS_CAPPILATUS );
     418                //sky->addCloudLayer( 1, 5000000, 5000000, 600.0, 7351.0, 0.2, CIRRUS_FIBRATUS );
     419                //sky->addCloudLayer( 2, 50000, 50000, 600.0, 7351.0, 0.2, CIRROCUMULUS );
     420                ///sky->addCloudLayer( 2, 100000, 100000, 600.0, 2351.0, 0.75, STRATUS );
     421                sky->addCloudLayer( 3, 50000, 50000, 1300.0, 700.0, 0.07, CUMULUS_CONGESTUS );
     422                //sky->addCloudLayer( 1, 100000, 100000, 3500.0, 2000.0, 0.30, STRATOCUMULUS );
     423
     424                //sky->setSlotPrecipitation( 1, 0.0, 0.0, 0.0, 25.0 );
     425        }
    419426
    420427
Note: See TracChangeset for help on using the changeset viewer.