I don't think there is any easy way to do that right now. This is probably the most necessary feature for Box2D to have in future releases, as I have seen many people asking on the forums about this problem, or similar things that could be solved by allowing each side of the collision to be affected differently.
I would propose something like this for the b2Contact class:
Code: Select all
void b2Contact::setReactionFactor( float weightA, float weightB );
This would scale the normal collision response by the given factor for each of the colliding bodies. Passing a value of 1 for each parameter would cause no change. Passing 0.5 for one of them would do what you are needing, etc.
Unfortunately, I don't have the skill to implement it... if the simulation only uses one position/velocity iteration for the Step() it may be fairly easy, but the problem is that usually multiple steps are performed, and somehow they must all work together to arrive at the desired final result. It also goes against the core principal of the collision response which is supposed to be correcting any overlap. Maybe we can persuade Erin to look at this sometime