Esempio n. 1
0
 /// <summary>
 /// Makes sure that the layer the user is trying to add an entity to exists
 /// </summary>
 /// <param name="maxLayer">The layer number.</param>
 private void AddLayers(int _layer)
 {
     while (layers.Count <= _layer)
     {
         SceneLayer layer = new SceneLayer();
         layers.Add(layer);
     }
 }
Esempio n. 2
0
        //private List<Light> lightList;

        #endregion

        #region Constructor
        /// <summary>
        /// Creates and Initializes a new RendererScene with a camera named "Default" as the active camera.
        /// </summary>
        public Scene()
        {
            entityID        = new LowestAvailableID();
            defaultPosition = Vector3.Zero;
            updateToggle    = false;

            layers = new List <SceneLayer>();
            SceneLayer layer = new SceneLayer();

            layers.Add(layer);

            entityList          = new Dictionary <int, Entity>();
            drawableEntities    = new List <SceneLayer>();
            transparentEntities = new List <SceneLayer>();
            deleteQueue         = new List <int>();
            TransparentWalls    = true;

            cameraDictionary = new Dictionary <string, Camera>();

            CurrentCamera = new Camera();


            cameraDictionary.Add("Default", CurrentCamera);
            currentFrustum = new BoundingFrustum(CurrentCamera.Projection);

            shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicOptions.graphics.GraphicsDevice,
                                                                 1, SurfaceFormat.Single);
            shadowDepthBuffer =
                GfxComponent.CreateDepthStencil(shadowRenderTarget,
                                                DepthFormat.Depth24Stencil8Single);

            worldLight.Position       = new Vector3(7000, 4000, 10000);
            worldLight.TargetPosition = Vector3.Zero;
            worldLight.View           = Matrix.Identity;
            worldLight.Projection     = Matrix.Identity;

            PercentOfDayComplete = 0.5f;
        }
Esempio n. 3
0
        /// <summary>
        /// Creates and Initializes a new RendererScene with a camera named "Default" as the active camera.
        /// </summary>
        public Scene()
        {
            entityID = new LowestAvailableID();
            defaultPosition = Vector3.Zero;
            updateToggle = false;

            layers = new List<SceneLayer>();
            SceneLayer layer = new SceneLayer();
            layers.Add(layer);

            entityList = new Dictionary<int, Entity>();
            drawableEntities = new List<SceneLayer>();
            transparentEntities = new List<SceneLayer>();
            deleteQueue = new List<int>();
            TransparentWalls = true;

            cameraDictionary = new Dictionary<string, Camera>();

            CurrentCamera = new Camera();

            cameraDictionary.Add("Default", CurrentCamera);
            currentFrustum = new BoundingFrustum(CurrentCamera.Projection);

            shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicOptions.graphics.GraphicsDevice,
                1, SurfaceFormat.Single);
            shadowDepthBuffer =
                GfxComponent.CreateDepthStencil(shadowRenderTarget,
                DepthFormat.Depth24Stencil8Single);

            worldLight.Position = new Vector3(7000, 4000, 10000);
            worldLight.TargetPosition = Vector3.Zero;
            worldLight.View = Matrix.Identity;
            worldLight.Projection = Matrix.Identity;

            PercentOfDayComplete = 0.5f;
        }
Esempio n. 4
0
 /// <summary>
 /// Makes sure that the layer the user is trying to add an entity to exists
 /// </summary>
 /// <param name="maxLayer">The layer number.</param>
 private void AddLayers(int _layer)
 {
     while (layers.Count <= _layer)
     {
         SceneLayer layer = new SceneLayer();
         layers.Add(layer);
     }
 }