public AtmosphereCalculator( Point3 cameraPos, AtmosphereCalculatorModel model )
 {
     m_CameraPos = cameraPos;
     m_Model = model;
     m_Inner = new Sphere3( Point3.Origin, model.PlanetRadius );
     m_Outer = new Sphere3( Point3.Origin, model.AtmosphereRadius );
     float heightRange = model.AtmosphereRadius - model.PlanetRadius;
     m_InvRH0 = -1.0f / ( heightRange * model.RayleighDensityScaleHeightFraction );
     m_InvMH0 = -1.0f / ( heightRange * model.MieDensityScaleHeightFraction );
 }
        private void AtmosphereTestForm_Load( object sender, System.EventArgs e )
        {
            float planetRadius = 1000.0f;
            float atmosphereThickness = 10.0f;

            AtmosphereCalculatorModel model = new AtmosphereCalculatorModel( );
            model.PlanetRenderRadius = planetRadius;
            model.AtmosphereRenderRadius = planetRadius + atmosphereThickness;
            model.Samples = 10;

            propertyGrid1.SelectedObject = model;

            IRenderable scene = new RenderableList( new PlanetSurface( planetRadius ), new AtmosphereSurface( model ) );

            Viewer viewer = new Viewer( this, CreateCamera( CommandUser.Default ), scene );
            viewer.ClearColour = Color.Black;
            display.AddViewer( viewer );

            //	TODO: AP: Horrible bodge to work around InteractionUpdateTimer not working properly without manual intervention
            display.OnBeginRender += delegate { InteractionUpdateTimer.Instance.OnUpdate( ); };
        }
 public AtmosphereCalculatorModel Clone( )
 {
     AtmosphereCalculatorModel clone = new AtmosphereCalculatorModel( );
     clone.m_Samples = m_Samples;
     clone.m_PlanetRenderRadius = m_PlanetRenderRadius;
     clone.m_AtmosphereRenderRadius = m_AtmosphereRenderRadius;
     clone.m_RayleighDensityScaleHeightFraction = m_RayleighDensityScaleHeightFraction;
     clone.m_MieDensityScaleHeightFraction = m_MieDensityScaleHeightFraction;
     clone.m_SunDirection = m_SunDirection;
     clone.m_RayleighCoefficients[ 0 ] = m_RayleighCoefficients[ 0 ];
     clone.m_RayleighCoefficients[ 1 ] = m_RayleighCoefficients[ 1 ];
     clone.m_RayleighCoefficients[ 2 ] = m_RayleighCoefficients[ 2 ];
     clone.m_MieCoefficients[ 0 ] = m_MieCoefficients[ 0 ];
     clone.m_MieCoefficients[ 1 ] = m_MieCoefficients[ 1 ];
     clone.m_MieCoefficients[ 2 ] = m_MieCoefficients[ 2 ];
     return clone;
 }