///User can override this material combiner by implementing gContactAddedCallback and setting body0.m_collisionFlags |= btCollisionObject::customMaterialCallback; public static double calculateCombinedFriction( btCollisionObject body0, btCollisionObject body1 ) { double friction = body0.getFriction() * body1.getFriction(); if( friction < -MAX_FRICTION ) friction = -MAX_FRICTION; if( friction > MAX_FRICTION ) friction = MAX_FRICTION; return friction; }