Ejemplo n.º 1
0
        public AnimatableModel(Game1 game, ANSKModelContent model, Vector3 pos)
        {
            _game = game;
            _model = new ANSKModel(model);
            _modelTexture = null;

            //_model = ModelRegistry.GetModel("TestNormalBlendOppCorners2");

            _ansk = new ANSK( _model, game);
            //_skinData = _model.Tag as ANSKTagData;

            //if (_skinData == null)
            if (_ansk.SkinningAndBasicAnims == null)
                throw new InvalidOperationException("The model " + _model.ToString() + " does not contain the data needed for animations.");

            //_player = new AnimationPlayer(_skinData);
            _player = new AnimationPlayer(_ansk.SkinningAndBasicAnims);

            _currentClip = null;

            _player.Looped = false;

            _collisionSphereRadius = 0.1f;
            _parentCollisionSphereRadius = 0.6f;

            GenerateBoundingSpheres(Matrix.Identity);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Ejemplo n.º 3
0
        private List<Player> _players; // List of players that are registered in the game. Used for Xbox controller input organisation.

        #endregion Fields

        #region Constructors

        public Input(Game1 game)
            : base(game)
        {
            _gamePadToCheck = new List<Buttons>();
            _keyboardToCheck = new List<Keys>();

            _gamePadCommandsC = new List<Dictionary<Buttons, InputTypeComplex>> ();
            _keyboardCommandsC = new Dictionary<Keys, InputTypeComplex>();
            _mouseCommandsC = new Dictionary<MouseInput.MouseButtonsXNA, InputTypeComplex>();

            _mouseCommandsC.Add(MouseInput.MouseButtonsXNA.LeftButton, new InputTypeComplex());
            _mouseCommandsC.Add(MouseInput.MouseButtonsXNA.RightButton, new InputTypeComplex());
            _mouseCommandsC.Add(MouseInput.MouseButtonsXNA.MiddleButton, new InputTypeComplex());
            _mouseCommandsC.Add(MouseInput.MouseButtonsXNA.XButton1, new InputTypeComplex());
            _mouseCommandsC.Add(MouseInput.MouseButtonsXNA.XButton2, new InputTypeComplex());

            _padEnable = _keyEnable = _mouseEnable = true;

            for (int i = 0; i < LocalPlayerRegistry.MAX_LOCAL_MACHINE_PLAYERS; i++)
            {
                _gamePadCommandsC.Add(new Dictionary<Buttons, InputTypeComplex>());
            }

            _mouse = new MouseInput(game);
            _mouse.CenterScreen = new Microsoft.Xna.Framework.Vector2(game.GraphicsDevice.DisplayMode.Width / 2, game.GraphicsDevice.DisplayMode.Height / 2);

            _container = new InputContainer(_gamePadCommandsC, _keyboardCommandsC, _mouseCommandsC, _mouse, this);

            ReloadPlayerList();
        }
Ejemplo n.º 4
0
 public InputTypeComplex(MouseInput.MouseButtonsXNA button, Game1 game)
 {
     _button = button;
     _type = Type.Mouse;
     _timePressed = 0;
     _pressed = _prevPressed = false;
     _mouse = new MouseInput(game);
 }
Ejemplo n.º 5
0
        public ANSKTest(Game1 game, Vector3 pos, float speed, ANSKModelContent model)
            : base(game, pos, speed)
        {
            _model = new AnimatableModel(game, model, pos);

            //_model.ChangeAnimationSpeedTicks(-150000f);

            //Scale(0.3f);
        }
Ejemplo n.º 6
0
 public GameObject(Game1 game, Vector3 pos, float speed)
     : base(game, pos, speed)
 {
     _game = game;
     _ref = CollectRefCount();
     _cooldownTime = 0;
     _cooldownTimePast = 0;
     _hurt = false;
     _health = 4;
 }
Ejemplo n.º 7
0
 public GameObject(Game1 game)
     : base(game)
 {
     _game = game;
     _ref = CollectRefCount();
     _cooldownTime = 0;
     _cooldownTimePast = 0;
     _hurt = false;
     _health = 4;
 }
 public DrawableMovableComponent(Game1 game)
     : base(game)
 {
     _pos = Vector3.One;
     _main = Matrix.Identity;
     _trans = Matrix.Identity;
     _rot = Matrix.Identity;
     _scale = Matrix.Identity;
     _game = game;
     _speed = 0;
 }
 public DrawableMovableComponent(Game1 game, Vector3 pos, float speed)
     : base(game)
 {
     _pos = pos;
     //_trans.Translation = _pos;
     _trans = Matrix.CreateTranslation(pos);
     _rot = Matrix.Identity;
     _scale = Matrix.Identity;
     _main = Matrix.Identity;
     _speed = speed;
     _game = game;
 }
Ejemplo n.º 10
0
 public MouseInput(Game1 game)
 {
     _x = _prevX = _y = _prevY = _scrollV = _prevScrollV = 0;
     _leftClicked = _prevLeftClick = _rightClicked = _prevRightClick = _middleClicked = _prevMiddleClick =
         _xButton1Clicked = _prevXButton1Click = _xButton2Clicked = _prevXButton2Click = false;
     _mouseForcedCenter = false;
     _game = game;
     _game.IsMouseVisible = false;
 }