Inheritance: Microsoft.Xna.Framework.GameComponent, IDisposable
Exemplo n.º 1
0
        public Holodeck()
        {
            var gdm = new GraphicsDeviceManager(this);
            gdm.SynchronizeWithVerticalRetrace = false;
            #if XBOX
            gdm.IsFullScreen = true;
            gdm.PreferredBackBufferHeight = 720;
            gdm.PreferredBackBufferWidth = 1280;
            #elif WINDOWS_PHONE
            gdm.IsFullScreen = true;
            gdm.PreferredBackBufferHeight = 800;
            gdm.PreferredBackBufferWidth = 400;
            #endif

            this.IsFixedTimeStep = false;
            TaskManager.IsThreadingEnabled = false;

            _viewManager = new ViewManager(this);
            _inputManager = new InputManager(this);
            _stateManager = new StateManager(this);
            _physics = new PhysicsManager(this);
            this.Components.Add(new PhysicsScene(this, _physics));

            Content.RootDirectory = "Content";
        }
Exemplo n.º 2
0
 public ImprovedProcessor(Game game, IViewManager viewManager, PhysicsManager physics )
 {
     this._game = game;
     this._viewManager = viewManager;
     this._physics = physics;
     initialize();
 }
Exemplo n.º 3
0
        public InputManager(Game game, IViewManager viewManager, PhysicsManager physics)
		{
            this._game = game;
            this._viewManager = viewManager;
            this._physics = physics;
            //_inputProcessor = new DefaultProcessor(game, viewManager, physics);
            _inputProcessor = new ImprovedProcessor(game, viewManager, physics);
		}
Exemplo n.º 4
0
        public Element(Game1 game, PhysicsManager physics)
        {
            this.components = new List<SolidComponent>();
            this.physics = physics;
            this.game = game;

            InitializeComponents();
        }
Exemplo n.º 5
0
        public DefaultProcessor(Game game, IViewManager viewManager, PhysicsManager physics )
        {
            this.game = game;
            this.viewManager = viewManager;
            this.physics = physics;

            Manipulations2D enabledManipulations = Manipulations2D.Rotate | Manipulations2D.Scale | Manipulations2D.Translate;
            manipulationProcessor = new ManipulationProcessor2D(enabledManipulations);

            manipulationProcessor.Pivot = new ManipulationPivot2D();
            manipulationProcessor.Pivot.Radius = 10;

            manipulationProcessor.Started += OnManipulationStarted;
            manipulationProcessor.Delta += OnManipulationDelta;
            manipulationProcessor.Completed += OnManipulationCompleted;
        }
Exemplo n.º 6
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.IsFullScreen = false;
            graphics.PreferredBackBufferHeight = 720;
            graphics.PreferredBackBufferWidth = 1280;

            Content.RootDirectory = "Content";

            //Load physics manager;
            Physics = new PhysicsManager(this);
            Physics.Enabled = !pause;

            //create new room;
            machine = new Room(this, Physics);
            Physics.Gravity = new Vector3(0f, 0f, -9.8f);
        }
Exemplo n.º 7
0
        public Missile(PhysicsManager physicsenabler, float damage)
            : base(GameState.Get().Game.Content.Load<Model>("missile"))
        {
            this.Damage = damage;
            this.pm = physicsenabler;
            SetWorld(1f,
                    new Vector3(110, 10, 110),
                    Quaternion.CreateFromAxisAngle(Vector3.UnitY, (float)Math.PI / 5));//* Quaternion.CreateFromAxisAngle(Vector3.UnitZ, (float)Math.PI / 4));
            LinearVelocity = Vector3.Zero;
            AngularVelocity = Vector3.Zero;

            this.m_dragModule = new LinearDragModule(this, LINEAR_DRAG_COEFFICIENT);
            this.m_thrustModule = new ThrustModule(this, THRUST_MULTIPLIER, 1f, MAX_FUEL);
            this.m_angDragModule = new AngularDragModule(this, ANGULAR_DRAG_COEFFICIENT);

            Capsule capsule = new Capsule(new Vector3(5, 0, 0), Vector3.Zero, 1);
            Vector3 center = new Vector3(2.5f, 0, 0);
            MassProperties mp = MassProperties.FromCapsule(0.15f, capsule.P1, capsule.P2, capsule.Radius, out center);
            this.MassProperties = mp;
            this.Skin.Add(new CapsulePart(capsule));
        }
Exemplo n.º 8
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public App1()
        {
            this.IsFixedTimeStep = false;
            TaskManager.IsThreadingEnabled = false;
            instance = this;

            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);
            graphics.SynchronizeWithVerticalRetrace = false;

            _viewManager = new ViewManager(this);
            _viewManager.BackgroundColor = backgroundColor;

            _physics = new PhysicsManager(this);
            this.Components.Add(new PhysicsScene(this, _physics));

            _inputManager = new InputManager(this, _viewManager, _physics);
            _tangibles = new Tangibles(this, _viewManager, _physics);

        }
		public BodyCollisionFunctor(PhysicsManager manager)
		{
			_manager = manager;
			_taskManager = TaskManager.Current;

			int threads = TaskManager.ThreadCount;

			_alloc = new IAllocator<ContactConstraint>[threads];
			_items = new List<ContactConstraint>[threads];
			_contact = new ContactConstraint[threads];
			_a = new Part[threads];
			_b = new Part[threads];

			for (int i = 0; i < threads; i++)
			{
				_alloc[i] = new ContactConstraint.Allocator(manager.Game, manager.ContactPoolCapacity, 2, manager.MaxPointsPerContact);
				_items[i] = new List<ContactConstraint>();
			}

			_fastSpeedSquared = manager.SweepThresholdSquared;
		}
Exemplo n.º 10
0
 public Element2(Game1 game, PhysicsManager physics)
     : base(game, physics)
 {
 }
Exemplo n.º 11
0
 public Tangibles(Game game, IViewManager viewManager, PhysicsManager physics)
 {
     this.game = game;
     this.viewManager = viewManager;
     this.physics = physics;
 }
Exemplo n.º 12
0
 public Room(Game1 game, PhysicsManager physics)
 {
     this.Game = game;
     this.Physics = physics;
     this.GameComponents = new List<Interfaces.IComponent>();
 }
Exemplo n.º 13
0
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
       Content.RootDirectory = "Content";
       physicsManager = new PhysicsManager(this);
 }
Exemplo n.º 14
0
		public PhysicsScene(Game game, PhysicsManager physics)
			: base(game)
		{
			_physics = physics;
		}