Example #1
0
        /// <summary>
        /// A base control with a camera.
        /// </summary>
        /// <param name="camera"></param>
        public BaseControl(BaseCamera camera)
        {
            _camera = camera;

            // Physics
            PhysicsPosition = new PhysicsController()
            {
                Acceleration = Vector3.One,
                Velocity     = Vector3.Zero,
                MaxVelocity  = 0.5f
            };

            PhysicsRotation = new PhysicsController()
            {
                Acceleration = Vector3.One,
                Velocity     = Vector3.Zero,
                MaxVelocity  = 0.5f
            };

            // Movement
            _moveSpeed     = 0.3f;
            _strafeSpeed   = 0.2f;
            _pitchSpeed    = 0.2f;
            _rotationSpeed = 0.3f;
            _playerIndex   = PlayerIndex.One;

            // Flags
            _enableKeyboard = true;
            _enableGamepad  = true;
            _enableMouse    = false;

            // Invert
            _xDirection = 1;
            _yDirection = 1;
            _zDirection = 1;
            _xRotation  = 1;
            _yRotation  = 1;
            _zRotation  = 1;
        }
Example #2
0
        /// <summary>
        /// A base control with a camera.
        /// </summary>
        /// <param name="camera"></param>
        public BaseControl(BaseCamera camera)
        {
            _camera = camera;

            // Physics
            PhysicsPosition = new PhysicsController()
            {
                Acceleration = Vector3.One,
                Velocity = Vector3.Zero,
                MaxVelocity = 0.5f
            };

            PhysicsRotation = new PhysicsController()
            {
                Acceleration = Vector3.One,
                Velocity = Vector3.Zero,
                MaxVelocity = 0.5f
            };

            // Movement
            _moveSpeed = 0.3f;
            _strafeSpeed = 0.2f;
            _pitchSpeed = 0.2f;
            _rotationSpeed = 0.3f;
            _playerIndex = PlayerIndex.One;

            // Flags
            _enableKeyboard = true;
            _enableGamepad = true;
            _enableMouse = false;

            // Invert
            _xDirection = 1;
            _yDirection = 1;
            _zDirection = 1;
            _xRotation = 1;
            _yRotation = 1;
            _zRotation = 1;
        }