示例#1
0
        /// <summary>
        /// Load graphics content for the screen.
        /// </summary>
        public virtual void LoadContent()
        {
            _lineBrush.Load(ScreenManager.GraphicsDevice);
            _physicsSimulatorView.LoadContent(ScreenManager.GraphicsDevice, ScreenManager.ContentManager);
            int borderWidth = (int)(ScreenManager.ScreenHeight * .05f);

            _border = new Border(ScreenManager.ScreenWidth, ScreenManager.ScreenHeight, borderWidth, ScreenManager.ScreenCenter);
            _border.Load(ScreenManager.GraphicsDevice, PhysicsSimulator);
        }
示例#2
0
        public Physics(Vector2 newGravity)
        {
            if (Instance != null) throw new Exception("Physics engine instance doubled!");
            Physics.Instance = this;

            this.setGravity(newGravity);
            BiasFactor = 0.01f;
            //AllowedPenetration = 0.01f;
            this.Iterations = 50;
            this.MaxContactsToResolve = 3;
            physicsSimulatorView = new DemoBaseXNA.PhysicsSimulatorView(this);
            // physicsSimulatorView.EnableEdgeView = false;
            physicsSimulatorView.LoadContent(Game1.Instance.GraphicsDevice, Game1.Instance.Content);
        }
示例#3
0
 /// <summary>
 /// Load graphics content for the screen.
 /// </summary>
 public virtual void LoadContent()
 {
     _physicsSimulatorView.LoadContent(ScreenManager.GraphicsDevice, ScreenManager.ContentManager);
 }