Module org.dyn4j

Interface ContactUpdateHandler


  • public interface ContactUpdateHandler
    This interface defines the mechanism to report begin, persist, and end events and the method of mixing the friction and restitution coefficients.
    Since:
    4.0.0
    Version:
    4.0.0
    Author:
    William Bittle
    • Method Detail

      • getFriction

        double getFriction​(BodyFixture fixture1,
                           BodyFixture fixture2)
        Returns the coefficient of friction given the two BodyFixtures in contact.
        Parameters:
        fixture1 - the first fixture
        fixture2 - the second fixture
        Returns:
        double
      • getRestitution

        double getRestitution​(BodyFixture fixture1,
                              BodyFixture fixture2)
        Returns the coefficient of restitution given the two BodyFixtures in contact.
        Parameters:
        fixture1 - the first fixture
        fixture2 - the second fixture
        Returns:
        double
      • begin

        void begin​(Contact contact)
        Called when the given contact is a new contact.

        A new contact is a contact that either didn't exist before or one that could not be warm started.

        Parameters:
        contact - the new contact
      • persist

        void persist​(Contact oldContact,
                     Contact newContact)
        Called when the given contact was persisted.

        A persisted contact is a contact that existed before and the new contact just updates the old.

        Parameters:
        oldContact - the old contact
        newContact - the new contact
      • end

        void end​(Contact contact)
        Called when the given contact was ended.

        An ended contact is a contact that no longer exists.

        Parameters:
        contact - the ended contact