Module org.dyn4j

Interface CoefficientMixer


  • public interface CoefficientMixer
    Interface used to customize the way friction and restitution coefficients are mixed.

    The DEFAULT_MIXER performs the following operations for friction and restitution mixing respectively:

     sqrt(friction1 * friction2)
     max(restitution1, restitution2)
    Since:
    1.0.0
    Version:
    4.0.0
    Author:
    William Bittle
    • Field Detail

      • DEFAULT_MIXER

        static final CoefficientMixer DEFAULT_MIXER
        The default dynamics mixer
    • Method Detail

      • mixFriction

        double mixFriction​(double friction1,
                           double friction2)
        Method used to mix the coefficients of friction of two BodyFixtures.
        Parameters:
        friction1 - the coefficient of friction for the first BodyFixture
        friction2 - the coefficient of friction for the second BodyFixture
        Returns:
        double
      • mixRestitution

        double mixRestitution​(double restitution1,
                              double restitution2)
        Method used to mix the coefficients of restitution of two BodyFixtures.
        Parameters:
        restitution1 - the coefficient of restitution for the first BodyFixture
        restitution2 - the coefficient of restitution for the second BodyFixture
        Returns:
        double