Ejemplo n.º 1
0
        public void TestPlayerMovement()
        {
            var game = new LocalGame();

            var ent = new Engine.WorldRendering.Entity();

            ent.Mesh = mesh;

            var ent2 = new Engine.WorldRendering.Entity();

            ent2.Mesh        = mesh;
            ent2.WorldMatrix = Matrix.Translation(5, 0, 0);

            var player = new PlayerData();

            player.Entity = ent;

            player.GroundHeight   = 5;
            player.DisableGravity = true;


            game
            .AddSimulator(new LocalPlayerSimulator(player))
            .AddSimulator(new ThirdPersonCameraSimulator())
            .AddSimulator(new WorldRenderingSimulator());


            TW.Data.GetSingleton <CameraInfo>().Mode = CameraInfo.CameraMode.ThirdPerson;
            TW.Data.GetSingleton <CameraInfo>().ThirdPersonCameraTarget = player.Entity;

            game.Run();
        }
Ejemplo n.º 2
0
        public void TestWorldRenderer()
        {
            var game = new LocalGame();

            var ent = new Engine.WorldRendering.Entity();

            var mBuilder = new MeshBuilder();

            mBuilder.AddSphere(12, 1);
            ent.Mesh = mBuilder.CreateMesh();

            var time = 0f;


            game
            .AddSimulator(new BasicSimulator(delegate
            {
                time           += TW.Graphics.Elapsed;
                ent.Mesh        = mesh;
                ent.WorldMatrix = Matrix.Translation(Vector3.UnitX * time);
            }))
            .AddSimulator(new WorldRenderingSimulator());



            game.Run();
        }
Ejemplo n.º 3
0
        public void TestEntityWithNoMesh()
        {
            var game = new LocalGame();

            new Engine.WorldRendering.Entity();

            game
            .AddSimulator(new WorldRenderingSimulator());

            game.Run();
        }
Ejemplo n.º 4
0
        public void TestSphere()
        {
            var game = new LocalGame();


            var sphere = new Sphere();

            game
            .AddSimulator(new PhysXSimulator())
            .AddSimulator(new WorldRenderingSimulator());



            game.Run();
        }