title: Position interpolation not working properly
body: <p>I am developing an android game with box2d and use a fixed timestep system for advancing the physics.</p>
  
  <p>However as I use this system it requires the box2d positions to be interpolates. I read <a href="http://www.unagames.com/blog/daniele/2010/06/fixed-time-step-implementation-box2d" rel="nofollow">this article</a>
  and have implemented an interpolation method very much like the one in the article.</p>
  
  <p>The method seems to work nicely on the computer but on my phone the positions of objects are very jumpy. There is of course a big frame rate difference between PC and phone, but I think this algorithm should not mind that.</p>
  
  <p>Here is the just of the code if you don't feel like looking at the article :</p>
  
  <pre><code>void PhysicsSystem::smoothStates_ ()
  {
      const float oneMinusRatio = 1.f - fixedTimestepAccumulatorRatio_;
  
      for (b2Body * b = world_-&gt;GetBodyList (); b != NULL; b = b-&gt;GetNext ())
      {
          if (b-&gt;GetType () == b2_staticBody)
          {
              continue;
          }
  
          PhysicsComponent &amp; c = PhysicsComponent::b2BodyToPhysicsComponent (* b);
          c.smoothedPosition_ =
              fixedTimestepAccumulatorRatio_ * b-&gt;GetPosition () +
              oneMinusRatio * c.previousPosition_;
          c.smoothedAngle_ =
              fixedTimestepAccumulatorRatio_ * b-&gt;GetAngle () +
              oneMinusRatio * c.previousAngle_;
      }
  }
  </code></pre>
  
  <p>Does anyone know why my game is acting like this?</p>
  
  <p>Thanks for the help</p>