behdad / box2d

Automatically exported from code.google.com/p/box2d
2 stars 12 forks source link

Feature Request: Externalize Friction/Restitution mixing behavior #144

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As per the forum discussion:

http://www.box2d.org/forum/viewtopic.php?t=5038

It would be good to be able to inject or override the default behavior for 
friction and/or restitution.  Ideally this could be implemented as per the 
b2ContactListener such that a friction and/or restitution listener could be 
registered to intercept contacts and provide an opportunity to alter friction 
based on custom business rules.

For example:

One may want to nominate differing friction values for edges on a polygon such 
that one edge has a different friction than the other.  This could be achieved 
by inspecting the normals etc of a contact and dynamically altering the 
friction to suit.  Similarly changing base friction values for contacts of 
differing body types could be achieved via the same mechanism.

Thanks,

Jason.

Original issue reported on code.google.com by jason.po...@gmail.com on 17 Jul 2010 at 9:37

GoogleCodeExporter commented 9 years ago

Original comment by erinca...@gmail.com on 27 Mar 2011 at 6:43