Package jsim.material

Class MaterialCombiner

java.lang.Object
jsim.material.MaterialCombiner

public final class MaterialCombiner extends Object
Combines two surface materials into a single contact response.

Friction is combined geometrically (sqrt product), restitution by the minimum, matching common game-engine conventions that produce stable, physically plausible results.

  • Method Details

    • combineFriction

      public static double combineFriction(Material a, Material b)
      Combined coefficient of kinetic friction for a pair of surfaces.

      Uses the geometric mean so that a zero-friction surface always produces zero friction, while two high-friction surfaces produce high combined friction.

      Parameters:
      a - first surface material
      b - second surface material
      Returns:
      combined friction coefficient
    • combineRestitution

      public static double combineRestitution(Material a, Material b)
      Combined coefficient of restitution for a pair of surfaces.

      Uses the minimum so that a fully inelastic body always absorbs all energy at the contact, regardless of the other body's restitution.

      Parameters:
      a - first surface material
      b - second surface material
      Returns:
      combined restitution coefficient
    • combine

      public static Material combine(Material a, Material b)
      Convenience: produce a new Material from two surfaces.
      Parameters:
      a - first surface material
      b - second surface material
      Returns:
      combined material