Change resitution based on contact fixtures

Hello,

I have different fixtures colliding with each other. I would like to apply different resitutions depending on which pair of fixtures are colliding. Actually I need to set it to almost 0 when 2 specific fixtures collide.

I have tried changing the restitution in the presolve contact listener method and restoring it in post solve but no luck!

I am using the box2dweb 2.1a version bundled with cocos2d.

Any help will be highly appreciated!

Thank you,
Francesco
You can set the restitution of the contact (not the fixture) in the BeginContact function of your contact listener, which is called when two fixtures begin to touch. From b2Contact.h:

/// Override the default restitution mixture. You can call this in b2ContactListener::PreSolve.
/// The value persists until you set or reset.
void SetRestitution(float32 restitution);
Thank you for your answer irresistible force.

Unfortunately the JS version bundled with cocos2d is 2.1a wich doesn't include that feature that would be perfect for me!!

Any alternatives?

Thank you!

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