title: Box2d: Maximum possible linear velocity?
body: <p>I think I've configured Box2d to have some sort of maximum velocity for any body, but I'm not sure. I apply an impulse like <code>(100000000, 100000000)</code>, and the body moves just as fast as <code>(100, 100)</code> - which is not that fast at all.</p>
  
  <p>I'm using the Box2d XNA C# port.</p>
  
  <p>My game is a top-down 2d.</p>
  
  <p>Here is some code that may be relevant:</p>
  
  <pre><code>private readonly Vector2 GRAVITY = new Vector2(0, 0);
  
      public void initializePhysics(ContactReporter contactReporter)
      {
          world = new World(GRAVITY, true);
          IContactListener contactListener = contactReporter;
          world.ContactListener = contactListener;
      }
  
      public void Update(GameTime gameTime)
          {
       // ...
  
              worldState.PhysicsWorld.Step((float)gameTime.ElapsedGameTime.TotalSeconds, 10, 10);
  
       //...
          }
  </code></pre>
  
  <p>Here is some example code that applies the impulse:</p>
  
  <pre><code>    private void ApplyImpulseFromInput()
      {
          Vector2 movementImpulse = new Vector2();
  
          if (inputReader.ControlActivation(ActionInputType.MOVE_LEFT) == 1f)
          {
              movementImpulse.X = -Constants.PLAYER_IMPULSE_CONSTANT;
          } else if (inputReader.ControlActivation(ActionInputType.MOVE_RIGHT) == 1f)
          {
              movementImpulse.X = Constants.PLAYER_IMPULSE_CONSTANT; ;
          }
  
          if (inputReader.ControlActivation(ActionInputType.MOVE_UP) == 1f)
          {
              movementImpulse.Y = -Constants.PLAYER_IMPULSE_CONSTANT; ;
          } else if (inputReader.ControlActivation(ActionInputType.MOVE_DOWN) == 1f)
          {
              movementImpulse.Y = Constants.PLAYER_IMPULSE_CONSTANT; ;
          }
  
          model.Body.ApplyImpulse(movementImpulse, model.Position);
      }
  </code></pre>
  
  <p>If <code>Constants.PLAYER_IMPULSE_CONSTANT</code> is anywhere from <code>1000f</code> to <code>1000000000f</code>, the player can move at most <code>(-120, -120)</code> to <code>(120, 120)</code>. If the constant is less, like <code>1f</code>, the player will move more slowly.</p>
  
  <p>This code is used to set up physics for everything in the game world:</p>
  
  <pre><code>        controller.Model.BodyDef = new BodyDef();
          controller.Model.BodyDef.type = controller.Model.Mobile ? BodyType.Dynamic : BodyType.Static;
          controller.Model.Body = worldState.PhysicsWorld.CreateBody(controller.Model.BodyDef);
          controller.Model.Body.SetLinearDamping(10.0f);
  </code></pre>
  
  <p>Could it possibly be the linear damping? I changed it from <code>10.0f</code> to <code>0</code>, with no effect.</p>
  
  <p><strong>UPDATE:</strong> Weirdness with linear damping: I have made these observations on the body that is moved with the apply impulse method above:</p>
  
  <pre><code>Linear Damping       Max Speed
  0f                   120
  10f                  120
  50f                  120
  55f                  90
  60f                  0
  70f                  0
  100f                 0
  100000f              0
  </code></pre>
  
  <p>Why is there a range of sensitivity in linear damping between <code>50f</code> and <code>60f</code>?</p>