Documentation
    Preparing search index...

    Function combineValues

    • Applies one §25 combination rule to two coefficients.

      combineValues(0.2, 0.8, "average");  // 0.5
      combineValues(0.2, 0.8, "minimum"); // 0.2
      combineValues(0.2, 0.8, "maximum"); // 0.8
      combineValues(0.2, 0.8, "multiply"); // 0.16000000000000003

      Commutative in every mode, which matters: a contact between A and B must produce the same coefficient whichever collider the solver happens to list first, or the simulation would depend on the solver's internal pair ordering (§33 determinism).

      Throws on an unrecognized mode rather than falling through to a default. The union makes that unreachable from TypeScript; the check exists for JavaScript callers and for deserialized data, where a silently substituted rule would produce a plausible-looking wrong simulation.

      Parameters

      Returns number