/// <summary> /// Constructs an InputAction which will track multiple InputActions. /// </summary> /// <param name="inputs">The inputs to track.</param> /// <param name="buttonAction">What state the InputActions should be in to activate.</param> public CombinedInputAction(InputAction[] inputs, ButtonAction buttonAction) : base(PlayerIndex.One, buttonAction) { mInputs = inputs; }
public ChimeraGame(string firstLevel) { mFirstLevelName = firstLevel; this.Window.AllowUserResizing = true; this.Window.ClientSizeChanged += ResizedWindow; Game = this; Graphics = new GraphicsDeviceManager(this); Graphics.PreferredBackBufferWidth = 1280; Graphics.PreferredBackBufferHeight = 720; Graphics.PreferMultiSampling = true; //Graphics.ToggleFullScreen(); Content.RootDirectory = "Content"; forward = new KeyInputAction(PlayerIndex.One, InputAction.ButtonAction.Down, Microsoft.Xna.Framework.Input.Keys.W); celShading = new KeyInputAction(PlayerIndex.One, InputAction.ButtonAction.Pressed, Microsoft.Xna.Framework.Input.Keys.F2); // DEBUG mDebugScreen = new Nuclex.UserInterface.Screen(Graphics.PreferredBackBufferWidth, Graphics.PreferredBackBufferHeight); mDebugGUI = new GuiManager(Services); mDebugGUI.Screen = mDebugScreen; DebugConsole debugConsole = new DebugConsole(); mDebugScreen.Desktop.Children.Add(debugConsole); mDebugInput = new InputManager(Services, Window.Handle); Components.Add(mDebugInput); Components.Add(mDebugGUI); mDebugGUI.DrawOrder = 1000; mDebugScreen.FocusedControl = DebugConsole.ConsoleInput; DebugConsole.AddCommand("exit", new DebugConsole.ConsoleCommand(ExitConsoleCommand)); DebugConsole.AddCommand("enableAllParts", new DebugConsole.ConsoleCommand(EnableParts)); DebugConsole.AddCommand("partMenu", new DebugConsole.ConsoleCommand(PartMenuCommand)); DebugConsole.AddCommand("resizeShadowCascade", new DebugConsole.ConsoleCommand(ResizeShadowCascadesCommand)); DebugConsole.AddCommand("collisions", new DebugConsole.ConsoleCommand(CollisionMeshCommand)); DebugConsole.AddCommand("debug", new DebugConsole.ConsoleCommand(DebugConsoleCommand)); DebugConsole.AddCommand("visualizeCascades", new DebugConsole.ConsoleCommand(VisualizeCascadesCommand)); DebugConsole.AddCommand("celShading", new DebugConsole.ConsoleCommand(CelShadingCommand)); DebugConsole.AddCommand("outlining", new DebugConsole.ConsoleCommand(OutliningCommand)); DebugConsole.AddCommand("drawBoundingBoxes", new DebugConsole.ConsoleCommand(BoundingBoxCommand)); DebugConsole.AddCommand("BirdsEyeView", new DebugConsole.ConsoleCommand(BirdsEyeViewCommand)); DebugConsole.AddCommand("BEV", new DebugConsole.ConsoleCommand(BirdsEyeViewCommand)); DebugConsole.AddCommand("level", new DebugConsole.ConsoleCommand(LoadLevel)); DebugConsole.AddCommand("toggleShadows", new DebugConsole.ConsoleCommand(ToggleShadows)); DebugConsole.AddCommand("wireframe", new DebugConsole.ConsoleCommand(WireframeCommand)); DebugConsole.Hide(); // END CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Sensor.SensorGroup, CollisionRules.DefaultDynamicCollisionGroup), CollisionRule.NoSolver); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Sensor.SensorGroup, CollisionRules.DefaultKinematicCollisionGroup), CollisionRule.NoSolver); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Sensor.SensorGroup, Projectile.ProjectileGroup), CollisionRule.NoBroadPhase); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Sensor.SensorGroup, Sensor.SensorGroup), CollisionRule.NoBroadPhase); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Sensor.SensorGroup, TerrainPhysics.TerrainPhysicsGroup), CollisionRule.NoBroadPhase); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Sensor.SensorGroup, InvisibleWall.InvisibleWallGroup), CollisionRule.NoBroadPhase); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Projectile.SensorProjectileGroup, CollisionRules.DefaultDynamicCollisionGroup), CollisionRule.NoSolver); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Projectile.SensorProjectileGroup, CollisionRules.DefaultKinematicCollisionGroup), CollisionRule.NoSolver); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Projectile.SensorProjectileGroup, Projectile.ProjectileGroup), CollisionRule.NoBroadPhase); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Projectile.SensorProjectileGroup, Sensor.SensorGroup), CollisionRule.NoBroadPhase); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Projectile.SensorProjectileGroup, Projectile.SensorProjectileGroup), CollisionRule.NoBroadPhase); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Projectile.SensorProjectileGroup, InvisibleWall.InvisibleWallGroup), CollisionRule.NoBroadPhase); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Wormhole.WormholeGroup, CollisionRules.DefaultDynamicCollisionGroup), CollisionRule.NoSolver); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Wormhole.WormholeGroup, CollisionRules.DefaultKinematicCollisionGroup), CollisionRule.NoSolver); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Wormhole.WormholeGroup, Projectile.ProjectileGroup), CollisionRule.NoBroadPhase); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Wormhole.WormholeGroup, Wormhole.WormholeGroup), CollisionRule.NoBroadPhase); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Wormhole.WormholeGroup, TerrainPhysics.TerrainPhysicsGroup), CollisionRule.NoBroadPhase); CollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Wormhole.WormholeGroup, InvisibleWall.InvisibleWallGroup), CollisionRule.NoBroadPhase); }