Top down view vehicle physics

Hi there

I'm trying to implement 2d tiled isometric game
so for box2D it is top-down-view-style

Im not good at physics, but im trying to make it anyways...
Now I need your help

World is 0,0 gravity, objects have damping to prevent them from floating.
Damping fits for a car that was just pushed foward...

to prevent it from moving to the left/right (car should only move foward/backward)
i made this code:
Code:
      Vec2 vel = car.getLinearVelocity();
      
      vel = car.getLocalVector(vel);
      

      vel.x *= -.5f;
      vel.y = 0;
      
      vel = car.getWorldDirection(vel);
      
      car.applyImpulse(vel, car.getWorldCenter());

It is Java code for jbox2d. (still should fit box2d)
It works good enough (it is run before every world step).

But now for brakes... adjusting damping is not good for brakes - as damping is multiplying speed - so the slower you drive, the weaker brake is. that is not how brakes work. it should be rather something like friction - but i dont know how to implement that.
Could anyone suggest me some method for realistic brakes?
Or aybe even someone could try to make better overall car physics example.

Regards, Kerai
I'd go nuts with vectors, and it'd become slightly more complicated.

I wrote an answer for a pool table type problem just a few days ago in this thread. It's pretty much the same thing, only difference being that you've got four of these points (the tires) on the car. There's not really any physics to my solution, only vector calculations. So read up on how 2D vectors add, subtract, multiply and dot product, if you don't know it already. Draw it up on a grid paper too to make sense of it graphically to see how the vectors are manipulated in my example.

If you're still stuck, I'll help you a bit more in depth!

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