bevy_xpbd icon indicating copy to clipboard operation
bevy_xpbd copied to clipboard

Consider applying 3D friction at manifold center and using twist friction

Open Jondolf opened this issue 11 months ago • 0 comments
trafficstars

Currently, Avian applies friction at every contact point.

A common optimization for 3D friction is to only apply friction at the center of each contact manifold, weighing the points based on penetration depth. This could yield noticeable performance savings for manifolds with several contact points. However, applying friction at the center also requires an additional twist friction.

Some engines do this (Bepu, and Bullet I think) and some don't seem to (Rapier and Jolt). We should try both and experiment.

Prior Art

  • An example of computing the friction center can be found in Bepu here.
  • Erin Catto's GDC2006 presentation mentions applying friction at the center of the manifold and applying a twist friction for big CPU savings.

Jondolf avatar Dec 11 '24 12:12 Jondolf