Why is restitution defined like that?

According to user manual, restitution is defined like this:
Code:
restitution = b2Max(shape1->restitution, shape2->restitution);

I'm wondering why.

My physics knowledge is very weak, but this behaviour doesn't look realistic at all to me: it would mean that an elastic ball [with restitution=1] colliding against an elastic table will bounch as much as the same ball colliding against a mud puddle, while in the latter case it shold just stop.

Something like:
Code:
restitution = shape1->restitution * shape2->restitution

intuitively sounds better to me (in this case two mud-balls [restitution=0] colliding against each other will have the same effect as a mud-ball colliding against an elastic ball, yet this sounds a lot more realistic to me), but if restitution is defined the other way, I guess I'm missing something...
Usually in games people would rather tune the object rather than the environment. That's just my personal preference. You can tune the mixing rule however you like.
OK, good to know.
I'm not a fan of your method, but mine is not better either: none model the physics behaviour in the correct way.

Don't like very much the idea of tuning b2Settings.h, but I guess should open a different thread to talk about this...
peoro, understand that in practice, any way that you can get the object to feel the correct amount of "bouncy" for a surface is a "correct" result. The entire Box2D engine is a collection of trickery and hacks in a sense to make a plausible simulation of 2d physics (which don't strictly exist in reality). If you find a restitution mixing method between two objects that works better for you (even as far as assignment of material type to each object to be used as 2 key hash for getting the restitution correct between two objects), then please feel free to modify Box2D in exactly that way.
A physically correct restitution value must be measured in experiments. But as soon as you change the geometry from the experiment then the value is wrong. Next, adding simultaneous collision makes the answer worse. We've been down this road before.

So the question of accuracy has been answered: failure.

The only remaining question is how do we make it convenient. On this opinions may vary.

b2Settings is just that. Settings you can adjust if you know what you are doing.

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