Beispiel #1
0
        public override void Init()
        {
            Content.ContentPath = "../WorkingDirectory/Data";
            Content.ContentCachePath = "Cache/";
            Meshes.Load(Device);

            scene = new WorldScene(this);
            scene.Camera = new WalkaroundCamera(this, (float x, float y) =>
            {
                return 0;
            }) { Speed = 20, ZFar = 1000 };
            plane = Meshes.PositionTexcoord(Device, Meshes.IndexedPlane(-0.5f, -0.5f, 1, 1));

            navMeshEditor = new Editor.WorldEditor.NavMeshEditor(this, scene, (Point p, out Vector3 w) => { return CalcMouseWorldPos(p, scene.Camera, out w); }, plane);
            navMeshEditor.Active = true;
            navMeshEditor.LoadNavMesh(navMesh = new Common.Pathing.NavMesh());
            scene.Add(new WorldEntity()
            {
                Model = new Model
                {
                    Mesh = plane,
                    Texture = text = content.Get<Texture>("grid.tga"),
                    World = Matrix.Scaling(100, 100, 0)
                }
            });
        }
Beispiel #2
0
        public override void Init()
        {
            Content.ContentPath = "Data";
            Content.ContentCachePath = "Cache/";
            WorldScene = new WorldScene(this);

            WorldScene.Camera = new ClientCommon.WalkaroundCamera(this, delegate(float x, float y) { return 0; });

            SkinnedMesh goblin1 = content.Get<SkinnedMesh>("death1.x");

            gob_model_test = new Model { SkinnedMesh = goblin1, Texture = content.Get<Texture>("death1.png"), Effect = content.Get<Effect>("effects.fx"), HasAlpha = true };

            WorldEntity c;

            WorldScene.Add(c = new WorldEntity()
            {
                Model = gob_model_test,
            });

            //c.AnimationController.SetTrackAnimationSet(1, c.AnimationController.GetAnimationSet("cast1"));
            //c.AnimationController.SetTrackAnimationSet(0, c.AnimationController.GetAnimationSet("cast1"));

            //c.AnimationController.EnableTrack(1);
            //c.AnimationController.DisableTrack(1);
            //c.AnimationController.SetTrackWeight(0, 1);
            //c/.AnimationController.SetTrackWeight(1, 1);
            //c.AnimationController.SetTrackPriority(1, TrackPriority.High);
            //c.AnimationController.SetTrackPriority(0, TrackPriority.Low);

            //Console.WriteLine(c.AnimationController.GetTrackDescription(1));

            //c.AnimationList.Add("0death1", gob_model_test.SkinnedMesh.CloneAnimationObject("0death1"));
            //c.AnimationList.Add("attack1", gob_model_test.SkinnedMesh.CloneAnimationObject("attack1"));

            /*
            WorldScene.Add(c = new WorldEntity()
            {
                Model = gob_model_test,
                Translation = new Vector3(3, 3, 10)
            });

            c.AnimationList.Add("0death1", gob_model_test.SkinnedMesh.CloneAnimationObject("0death1"));

            WorldScene.Add(c = new WorldEntity()
            {
                Model = gob_model_test,
                Translation = new Vector3(6, 6, 0)
            });

            WorldScene.Add(c = new WorldEntity()
            {
                Model = gob_model_test,
                Translation = new Vector3(6, 3, 0)
            });
            */
        }
        public NavMeshEditor(View view, WorldScene scene, ScreenToWorld stw, ClientCommon.Mesh plane)
        {
            this.view = view;
            this.scene = scene;
            this.screenToWorld = stw;

            vertexModel = new Model
            {
                Mesh = plane,
                IsBillboard = true,
                Texture = view.content.Get<Texture>("blink.tga"),
                World = Matrix.Scaling(1, 1, 0),
                Effect = view.content.Get<Effect>("billboard.fx")
            };
            CreateNextFace();
        }