Ejemplo n.º 1
0
 public Weapon(string modelName, Body body, Transform transform, Scene scene)
 {
     this.ignorePred = new IgnoreSkinPredicate(body);
     this.scene = scene;
     this.fpsModel = new ViewModel(modelName);
     fpsModel.SetTransform(transform);
     Matrix weaponTransform = Matrix.CreateScale(0.1f) * Matrix.CreateRotationX(-MathHelper.PiOver2) * Matrix.CreateRotationY(MathHelper.PiOver2);
     fpsModel.SetCustomMatrix(weaponTransform);
     fpsModel.GetAnimationLayer().SetActiveAnimation("Pistol_Idle", true);//.SetAnimationLayer("Pistol_Idle", 1);
 }
Ejemplo n.º 2
0
 public Weapon(string datablockName, Body body, Transform transform, Scene scene)
 {
     this.ignorePred = new IgnoreSkinPredicate(body);
     this.scene = scene;
     this.datablock = ResourceManager.Inst.GetWeaponDatablock(datablockName);
     this.fpsModel = new ViewModel(datablock.MeshName);
     this.fpsModel.SetRenderAlways(true, scene);
     this.ammo = datablock.AmmoPerClip;
     this.ReserveAmmo = datablock.DefaultAmmo;
     fpsModel.SetTransform(transform);
     fpsModel.SetCustomMatrix(datablock.CustomMatrix);
     fpsModel.GetAnimationLayer().SetActiveAnimation(datablock.GetAnimation(WeaponAnimations.Idle), true);
 }