Пример #1
0
        public XDynamicSky(ref XMain X, XEnvironmentParameters Parameters) : base(ref X)
        {
            if (Parameters != null)
            {
                this.Params = Parameters;
            }

            RealTime = false;
            Theta    = 4.0f;
            Phi      = 0.0f;
        }
Пример #2
0
        public XHeightMap(ref XMain X, string HeightMap, XEnvironmentParameters Params, string RTexture, string GTexture, string BTexture, string TextureMap) : base(ref X)
        {
            if (Params != null)
            {
                this.Params = Params;
            }

            HeightMapFile  = HeightMap;
            TextureMapFile = TextureMap;
            RTextureFile   = RTexture;
            GTextureFile   = GTexture;
            BTextureFile   = BTexture;
            DrawOrder      = 21;
        }
Пример #3
0
        public XMain(GraphicsDevice GraphicsDevice, IServiceProvider Services, string ContentRootDir, XCamera defaultCamera)
        {
            Components = new List <XComponent>();

            this.Content = new ContentManager(Services);
            this.Content.RootDirectory = ContentRootDir;
            this.GraphicsDevice        = GraphicsDevice;
            this.Services = Services;

            Tools = new XTools(this);

            SystemFont  = new XFont(this, @"Content\XEngine\Fonts\System");
            Debug       = new XDebug(this);
            FrameRate   = new XFrameRate(this);
            Console     = new XConsole(this);
            DebugDrawer = new XDebugDrawer(this);
            DepthMap    = new XDepthMap(this);

            Environment = new XEnvironmentParameters(this);


            Physics = new PhysicsSystem();
            Physics.EnableFreezing  = true;
            Physics.SolverType      = PhysicsSystem.Solver.Normal;
            Physics.CollisionSystem = new CollisionSystemGrid(32, 32, 32, 32, 32, 32);
            Physics.CollisionSystem.UseSweepTests = true;

            //New system
            //Physics.CollisionSystem = new CollisionSystemSAP();

            //Rendering should be the last thing! The constructor requires some componnets like debug, debugdrawer to allready exist!
            Renderer = new XRenderer(this);

            this.DefaultCamera = defaultCamera;
            // Initialize the particle cloud system for tree leaves!
            cloudSystem = new ParticleCloudSystem(GraphicsDevice, Content, "Content/XEngine/Effects/ParticleCloud");
        }