Top down physics.

Hy i have problem with top-down physics(actually with friction...) in jBox2D.

this is mine "callback" for updating physics. it is called every time before step.

Code:
   protected void update(float dt)
   {
      Vec2 pos = _body.getPosition();
      Mat22 rot = new Mat22(_body.getAngle());

      float mass = _body.getMass();
      float I = _body.getInertia();

      float fk_kinetic = _pm.getGroundFriction_Kinetic(pos);
      float fk_static = _pm.getGroundFriction_Static(pos);

      {
         Vec2 v_0 = _body.getLinearVelocity();

         Vec2 a = v_0.mul(-1/dt);
         float sa = a.length(); //scalar accleration

         float a_s = _pm.getGravity() * fk_static;//Static max acceleration
         float a_k = _pm.getGravity() * fk_kinetic;//Kinetic max acceleration

         float ar = sa * (1-fk_kinetic);
         if(sa>a_s)
         {
            ar = sa-a_k;
         }

         if(sa>0.0)
            _body.applyForce(a.mul((ar * mass)/sa),_body.getWorldCenter());
      }
      {
         float o_0 = _body.getAngularVelocity();
         float a = -o_0 / dt;

         _body.applyTorque(I * a * (1-fk_kinetic));
      }
   }


It acts very weird when hit by another object or i apply force on it . It stops fast. and then moves very slow but not stopping.
thx for help.
First: i'm not an expert of the jbox2d code
Second: I was just checking the difference in the function getInertia() from Jbox2d 2.0.1 where is
Code:
public float getInertia(){
                return m_I;
        }

in the updating version is
Code:
public final float getInertia(){
                return m_I + m_mass * Vec2.dot(m_sweep.localCenter, m_sweep.localCenter);
        }

seems to me the code use the parallel axis theorem

IT'S JUST A SUGGESTION, you can add it manually with:
Code:
float I = _body.getInertia()+Vec2.dot(_body.getLocalCenter(), _body.getLocalCenter())

Original thread: https://box2d.org/forum/viewtopic.php?t=5655