Hi Guys,
I've looked around this forum a couple of times for ideas on how to simulate Top-Down friction before its implemented in version 2.2.. The best I've found so far is
'As for top-down friction, it's not terribly difficult to simulate that yourself by applying an impulse at every timestep.'
So I've tried to work on this but with no success. Would somebody be able to explain to me the best way of going about this?
My best effort so far has been this:
var v = bb.GetLinearVelocity();
var vX = (v.x*-1)*0.99;
var vY = (v.y*-1)*0.99;
bb.ApplyImpulse(v, bb.GetPosition());
but this goes horribly wrong.
This is only my second day with Box2d so apologies if its a bit of a stupid question, I'll get the hang of it soon 🙂
I've looked around this forum a couple of times for ideas on how to simulate Top-Down friction before its implemented in version 2.2.. The best I've found so far is
'As for top-down friction, it's not terribly difficult to simulate that yourself by applying an impulse at every timestep.'
So I've tried to work on this but with no success. Would somebody be able to explain to me the best way of going about this?
My best effort so far has been this:
var v = bb.GetLinearVelocity();
var vX = (v.x*-1)*0.99;
var vY = (v.y*-1)*0.99;
bb.ApplyImpulse(v, bb.GetPosition());
but this goes horribly wrong.
This is only my second day with Box2d so apologies if its a bit of a stupid question, I'll get the hang of it soon 🙂