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); }
public Raptor(DinosaurDatablock datablock) { this.datablock = datablock; model = new ViewModel(datablock.MeshName); model.GetAnimationLayer().SetActiveAnimation(datablock.GetAnimation(DinosaurAnimationsSimple.Idle), true); grounding.SetScale(datablock.Scale); grounding.SetRotation(datablock.Rotation); grounding.SetPosition(datablock.Position); model.SetCustomMatrix(grounding.GetTransform()); team = datablock.Team; }
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); }