Esempio n. 1
0
        public override void Dispose()
        {
            base.Dispose();

            mInstance = null;
        }
Esempio n. 2
0
        /// <summary>
        /// Creates all Caelum's components needed,
        /// register them in <c>mChildren</c> and sets up them.
        /// </summary>
        protected override void OnPostCreate(bool loaded)
        {
            base.OnPostCreate(loaded);

            Log.Info("Initialising Caelum system...");

            // Avoid undo bug
            if(mChildren == null)
                mChildren = new List<CaelumBase>();

            // Creates and sets up a new UniversalClock
            UniversalClock clock = new UniversalClock();
            clock.SetGregorianDateTime(mStartYear, mStartMonth, mStartDay, mStartHour, 0, 0);

            // Sets up Sky color's calculation model
            SkyColorModel.GradientImage = _type.GradientImage;
            SkyColorModel.SkyGradientImage = _type.SkyGradientImage;

            /* Creates all Caelum's element
             * TODO: Find a better way to do that and clean up this code */
            CaelumItem item = getItembyType(CaelumComponent.Sun);
            if (item != null)
                if (CaelumUtils.IsContainType(_type.ComponentsToCreate, CaelumComponent.Sun))
                {
                    CaelumSun sun = new CaelumSun(item);
                    sun.FarDistance = _type.FarDistance;
                    mChildren.Add(sun);
                }

            item = getItembyType(CaelumComponent.Moon);
            if (item != null)
                if (CaelumUtils.IsContainType(_type.ComponentsToCreate, CaelumComponent.Moon))
                {
                    CaelumMoon moon = new CaelumMoon(item);
                    moon.FarDistance = _type.FarDistance;
                    mChildren.Add(moon);
                }

            item = getItembyType(CaelumComponent.Starfield);
            if (item != null)
            {
                if (CaelumUtils.IsContainType(_type.ComponentsToCreate, CaelumComponent.Starfield))
                    mChildren.Add(new CaelumStarfield(item));
            }

            item = getItembyType(CaelumComponent.Skydome);
            if (item != null)
            {
                if (CaelumUtils.IsContainType(_type.ComponentsToCreate, CaelumComponent.Skydome))
                    mChildren.Add(new CaelumSkydome(item));
            }

            item = getItembyType(CaelumComponent.Clouds);
            if (item != null)
            {
                if (CaelumUtils.IsContainType(_type.ComponentsToCreate, CaelumComponent.Clouds))
                {
                    CaelumClouds clouds = new CaelumClouds(item);
                    clouds.SetCoverImage( _type.CoverLookupImage );
                    mChildren.Add(clouds);
                }
            }

            if (CaelumUtils.IsContainType(_type.ComponentsToCreate, CaelumComponent.Fog))
                mManageFog = true;

            Log.Info("Done: Initialising Caelum system");
        }
Esempio n. 3
0
 // Methods --------------------------------------------------------------------
 public CaelumSun(CaelumItem item)
 {
     Initialise(RenderQueueGroupID.Queue1, item.Material, item.Scale);
     mInstance = this;
 }