How could I restrict an impulse ? I would like the body to jump fast, and restrict his jump after that.
I am looking for something like the following, a friction after the impulse, but this is not working (the player stays at its position in the y-axis, as vec2.y will equal "0")
//after a touch
body->ApplyLinearImpulse( b2Vec2(x,y), body->GetPosition() );
vec2 = body->GetLinearVelocity();
//in the tick method, called every step
vec2.y = vec2.y * 0.99;
CCLOG(@"vec2.y : %f", vec2.y);
body->SetLinearVelocity(vec2);