public SkinnedModelInstance(string clipName, Matrix transform, SkinnedModel model) : base(model)
 {
     World    = transform;
     _model   = (SkinnedModel)Model;
     ClipName = clipName;
 }
Exemplo n.º 2
0
 public SkinnedModelInstance(string clipName, Matrix transform, SkinnedModel model)
 {
     World = transform;
     _model = model;
     ClipName = clipName;
 }
Exemplo n.º 3
0
        public override bool Init()
        {
            if (!base.Init()) return false;

            Effects.InitAll(Device);
            InputLayouts.InitAll(Device);
            RenderStates.InitAll(Device);

            _texMgr = new TextureManager();
            _texMgr.Init(Device);

            _drone = new SkinnedModel(Device, _texMgr, "Models/drone.x", "Textures", true);
            _droneInstance = new SkinnedModelInstance(
                "Attack",
                Matrix.RotationY(MathF.PI),
                _drone

            );
            foreach (var clip in _droneInstance.Clips) {
                _droneInstance.AddClip(clip);
            }
            _droneInstance.LoopClips = true;

            _mage = new SkinnedModel(Device, _texMgr, "Models/magician.x", "textures", true);

            _mageInstance = new SkinnedModelInstance(
                "Attack",
                Matrix.RotationY(MathF.PI)*Matrix.Translation(4.0f, 0, 0),
                _mage
            );
            foreach (var clip in _mageInstance.Clips) {
                _mageInstance.AddClip(clip);
            }
            _mageInstance.LoopClips = true;

            _soldier = new SkinnedModel(Device, _texMgr, "Models/soldier.x", "Textures", true);
            _soldierInstance = new SkinnedModelInstance (
                "Attack",
                Matrix.RotationY(MathF.PI)*Matrix.Translation(10, 0, 0),
                _soldier
            );

            foreach (var clip in _soldierInstance.Clips) {
                _soldierInstance.AddClip(clip);
            }
            _soldierInstance.LoopClips = true;

            _grid = BasicModel.CreateGrid(Device, 30, 30, 60, 60);
            _grid.DiffuseMapSRV[0] = (_texMgr.CreateTexture("Textures/floor.dds"));
            _grid.NormalMapSRV[0]= (_texMgr.CreateTexture("Textures/floor_nmap.dds"));
            _gridInstance = new BasicModelInstance() {
                Model = _grid,
                World = Matrix.Translation(0, -1.5f, 0)

            };

            return true;
        }