-
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.2.0
- Author:
- William Bittle
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
begin(Contact contact)
Called when the given contact is a new contact.void
end(Contact contact)
Called when the given contact was ended.double
getFriction(BodyFixture fixture1, BodyFixture fixture2)
Returns the coefficient of friction given the twoBodyFixture
s in contact.double
getRestitution(BodyFixture fixture1, BodyFixture fixture2)
Returns the coefficient of restitution given the twoBodyFixture
s in contact.double
getRestitutionVelocity(BodyFixture fixture1, BodyFixture fixture2)
Returns the minimum velocity to apply restitution given the twoBodyFixture
s in contact.void
persist(Contact oldContact, Contact newContact)
Called when the given contact was persisted.
-
-
-
Method Detail
-
getFriction
double getFriction(BodyFixture fixture1, BodyFixture fixture2)
Returns the coefficient of friction given the twoBodyFixture
s in contact.- Parameters:
fixture1
- the first fixturefixture2
- the second fixture- Returns:
- double
-
getRestitution
double getRestitution(BodyFixture fixture1, BodyFixture fixture2)
Returns the coefficient of restitution given the twoBodyFixture
s in contact.- Parameters:
fixture1
- the first fixturefixture2
- the second fixture- Returns:
- double
-
getRestitutionVelocity
double getRestitutionVelocity(BodyFixture fixture1, BodyFixture fixture2)
Returns the minimum velocity to apply restitution given the twoBodyFixture
s in contact.- Parameters:
fixture1
- the first fixturefixture2
- the second fixture- Returns:
- double
- Since:
- 4.2.0
-
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 contactnewContact
- 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
-
-